mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 12:04:35 +00:00
Show UI context methods in extension quick start example
This commit is contained in:
parent
08f9622e99
commit
3e38fce541
1 changed files with 5 additions and 1 deletions
|
|
@ -158,7 +158,11 @@ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
||||||
export default function (pi: ExtensionAPI) {
|
export default function (pi: ExtensionAPI) {
|
||||||
// Subscribe to events
|
// Subscribe to events
|
||||||
pi.on("event_name", async (event, ctx) => {
|
pi.on("event_name", async (event, ctx) => {
|
||||||
// Handle event
|
// ctx.ui for user interaction
|
||||||
|
const ok = await ctx.ui.confirm("Title", "Are you sure?");
|
||||||
|
ctx.ui.notify("Done!", "success");
|
||||||
|
ctx.ui.setStatus("my-ext", "Processing..."); // Footer status
|
||||||
|
ctx.ui.setWidget("my-ext", ["Line 1", "Line 2"]); // Widget above editor
|
||||||
});
|
});
|
||||||
|
|
||||||
// Register tools, commands, shortcuts, flags
|
// Register tools, commands, shortcuts, flags
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue