@bastani/atomic 0.9.19-alpha.5 → 0.9.19-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +32 -0
- package/README.md +2 -2
- package/dist/builtin/intercom/CHANGELOG.md +6 -0
- package/dist/builtin/intercom/broker/client.ts +19 -1
- package/dist/builtin/intercom/index.bundle.mjs +8 -1
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/CHANGELOG.md +6 -0
- package/dist/builtin/subagents/README.md +3 -1
- package/dist/builtin/subagents/agents/codebase-online-researcher.md +7 -7
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/subagents/skills/subagent/SKILL.md +3 -1
- package/dist/builtin/subagents/src/extension/index.bundle.mjs +2 -1
- package/dist/builtin/web-access/CHANGELOG.md +13 -0
- package/dist/builtin/web-access/README.md +31 -24
- package/dist/builtin/web-access/index.bundle.mjs +16121 -80
- package/dist/builtin/web-access/package.json +2 -1
- package/dist/builtin/workflows/CHANGELOG.md +15 -0
- package/dist/builtin/workflows/README.md +1 -1
- package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
- package/dist/builtin/workflows/builtin/{chunk-vhmnzdj9.js → chunk-1jth021m.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-p8jjwfg6.js → chunk-2377r57g.js} +4 -2
- package/dist/builtin/workflows/builtin/{chunk-hbnwv56f.js → chunk-31j2gs7h.js} +2 -2
- package/dist/builtin/workflows/builtin/{chunk-n8zysf1t.js → chunk-ngkqkzej.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-1nbq96fh.js → chunk-nkrafh9s.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-1kx4aggw.js → chunk-wf741bv3.js} +2 -2
- package/dist/builtin/workflows/builtin/{chunk-t6x2d78s.js → chunk-z29qbehr.js} +1 -1
- package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
- package/dist/builtin/workflows/builtin/goal.js +3 -3
- package/dist/builtin/workflows/builtin/index.js +7 -7
- package/dist/builtin/workflows/builtin/ralph.js +3 -3
- package/dist/builtin/workflows/builtin/tournament.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +339 -31
- package/dist/builtin/workflows/src/index.js +67 -19
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -0
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +10 -0
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/tools/bash.d.ts +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +3 -2
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +3 -0
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +91 -12
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/file-mutation-coordinator.d.ts +255 -0
- package/dist/core/tools/file-mutation-coordinator.d.ts.map +1 -0
- package/dist/core/tools/file-mutation-coordinator.js +300 -0
- package/dist/core/tools/file-mutation-coordinator.js.map +1 -0
- package/dist/core/tools/file-mutation-queue.d.ts +14 -1
- package/dist/core/tools/file-mutation-queue.d.ts.map +1 -1
- package/dist/core/tools/file-mutation-queue.js +15 -3
- package/dist/core/tools/file-mutation-queue.js.map +1 -1
- package/dist/core/tools/hashline.d.ts +9 -0
- package/dist/core/tools/hashline.d.ts.map +1 -1
- package/dist/core/tools/hashline.js +12 -1
- package/dist/core/tools/hashline.js.map +1 -1
- package/dist/core/tools/index.d.ts +9 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +67 -12
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/non-minting-snapshot-store.d.ts +49 -0
- package/dist/core/tools/non-minting-snapshot-store.d.ts.map +1 -0
- package/dist/core/tools/non-minting-snapshot-store.js +64 -0
- package/dist/core/tools/non-minting-snapshot-store.js.map +1 -0
- package/dist/core/tools/powershell.d.ts +2 -2
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +2 -5
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read-document-extract.js.map +1 -1
- package/dist/core/tools/render-utils.js.map +1 -1
- package/dist/core/tools/write.d.ts +30 -1
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +97 -8
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/task-live-transcript.d.ts +1 -1
- package/dist/modes/interactive/components/task-live-transcript.d.ts.map +1 -1
- package/dist/modes/interactive/components/task-live-transcript.js +19 -11
- package/dist/modes/interactive/components/task-live-transcript.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +3 -1
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +28 -4
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +3 -0
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.d.ts +2 -2
- package/dist/modes/interactive-engine/activity-watchdog.d.ts.map +1 -1
- package/dist/modes/interactive-engine/activity-watchdog.js.map +1 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts +3 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.d.ts.map +1 -1
- package/dist/modes/interactive-engine/engine-diagnostic-view.js +11 -0
- package/dist/modes/interactive-engine/engine-diagnostic-view.js.map +1 -1
- package/dist/modes/interactive-engine/isolated-runtime.js +2 -1
- package/dist/modes/interactive-engine/isolated-runtime.js.map +1 -1
- package/dist/modes/rpc/rpc-client-process.d.ts +2 -0
- package/dist/modes/rpc/rpc-client-process.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client-process.js +23 -1
- package/dist/modes/rpc/rpc-client-process.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js +20 -3
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/utils/markit.d.ts +2 -0
- package/dist/utils/markit.d.ts.map +1 -1
- package/dist/utils/markit.js +65 -5
- package/dist/utils/markit.js.map +1 -1
- package/docs/background-tasks.md +15 -11
- package/docs/build.md +51 -0
- package/docs/changelog.mdx +8 -8
- package/docs/compaction/reference.md +267 -0
- package/docs/compaction.md +36 -219
- package/docs/computer-use.md +35 -0
- package/docs/containerization.md +9 -5
- package/docs/custom-provider/api-reference.md +145 -0
- package/docs/custom-provider/oauth.md +131 -0
- package/docs/custom-provider/override.md +34 -0
- package/docs/custom-provider/registration.md +163 -0
- package/docs/custom-provider/streaming.md +214 -0
- package/docs/custom-provider.md +43 -607
- package/docs/development.md +87 -0
- package/docs/docs.json +199 -76
- package/docs/environment-variables.md +1 -1
- package/docs/extensions/api-reference.md +1001 -0
- package/docs/extensions/authoring.md +676 -0
- package/docs/extensions/events.md +793 -0
- package/docs/extensions/examples.md +94 -0
- package/docs/extensions/ui.md +470 -0
- package/docs/extensions.md +270 -2768
- package/docs/getting-started/authentication.md +55 -0
- package/docs/getting-started/first-session.md +172 -0
- package/docs/getting-started/installation.md +154 -0
- package/docs/getting-started/project-instructions.md +43 -0
- package/docs/guides/configuration.md +65 -0
- package/docs/guides/intercom.md +24 -0
- package/docs/guides/non-interactive.md +33 -0
- package/docs/guides/subagents.md +24 -0
- package/docs/guides/workflows.md +27 -0
- package/docs/guides.md +41 -0
- package/docs/index.md +13 -45
- package/docs/intercom/operations.md +178 -0
- package/docs/intercom/reference.md +146 -0
- package/docs/intercom.md +54 -259
- package/docs/json.md +17 -0
- package/docs/llama-cpp.md +5 -0
- package/docs/models/artificial-analysis-index.md +89 -0
- package/docs/models/evals.md +2 -2
- package/docs/models/model-selection.md +3 -3
- package/docs/models/pareto-efficiency.md +2 -2
- package/docs/models/reference.md +601 -0
- package/docs/models.md +45 -550
- package/docs/packages/authoring.md +88 -0
- package/docs/packages/reference.md +43 -0
- package/docs/packages.md +28 -107
- package/docs/programmatic.md +29 -0
- package/docs/prompt-templates.md +11 -0
- package/docs/providers/reference.md +23 -0
- package/docs/providers.md +10 -15
- package/docs/quickstart.md +44 -238
- package/docs/reference/cli.md +252 -0
- package/docs/reference.md +52 -0
- package/docs/rpc/examples.md +64 -0
- package/docs/rpc/extension-ui.md +198 -0
- package/docs/rpc/protocol.md +1341 -0
- package/docs/rpc.md +109 -1346
- package/docs/sdk/reference.md +1090 -0
- package/docs/sdk.md +56 -1002
- package/docs/session-format.md +2 -0
- package/docs/sessions.md +6 -10
- package/docs/settings.md +6 -45
- package/docs/skills/authoring.md +95 -0
- package/docs/skills/reference.md +60 -0
- package/docs/skills.md +20 -122
- package/docs/subagents/authoring.md +37 -0
- package/docs/subagents/reference.md +60 -0
- package/docs/subagents.md +42 -96
- package/docs/terminal-setup.md +1 -1
- package/docs/themes/reference.md +176 -0
- package/docs/themes.md +21 -135
- package/docs/tmux.md +5 -0
- package/docs/tools/edit.md +5 -0
- package/docs/tools.md +31 -0
- package/docs/tui/reference.md +343 -0
- package/docs/tui.md +23 -286
- package/docs/usage.md +26 -209
- package/docs/web-access.md +40 -0
- package/docs/windows.md +2 -1
- package/docs/workflows/api-reference.md +11 -4
- package/docs/workflows/authoring.md +4 -2
- package/docs/workflows/builtins.md +2 -2
- package/docs/workflows/operations.md +11 -7
- package/docs/workflows/reliable-design.md +21 -3
- package/docs/workflows/verification.md +8 -0
- package/examples/extensions/gondolin/index.ts +116 -148
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/ssh.ts +56 -34
- package/npm-shrinkwrap.json +33 -33
- package/package.json +4 -4
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Reference
|
|
3
|
+
sidebarTitle: "Reference index"
|
|
4
|
+
description: "Exact contracts: CLI, settings, environment variables, keybindings, tools, session format, provider, model, compaction, extension, SDK, RPC, and TUI references."
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Reference
|
|
8
|
+
|
|
9
|
+
Reference pages state exact contracts. They use stable command, flag, setting, type, event, method, and tool names as headings, and they do not carry a tutorial narrative. If you want to learn a capability rather than look one up, start at [Guides](/guides) or [Build with Atomic](/build).
|
|
10
|
+
|
|
11
|
+
## Everyday contracts
|
|
12
|
+
|
|
13
|
+
- [CLI reference](/reference/cli) — every command, flag, argument, and environment variable.
|
|
14
|
+
- [Settings](/settings) — every settings field, with defaults and constraints.
|
|
15
|
+
- [Environment variables](/environment-variables) — Atomic/Pi aliases, provider credentials, and bash session metadata.
|
|
16
|
+
- [Keybindings](/keybindings) — default shortcuts and custom keybinding actions.
|
|
17
|
+
- [Built-in tools](/tools) — the tools Atomic ships, and the [edit tool](/tools/edit) in detail.
|
|
18
|
+
|
|
19
|
+
## Domain contracts
|
|
20
|
+
|
|
21
|
+
- [Provider reference](/providers/reference) — stop reasons and credential resolution order.
|
|
22
|
+
- [Model configuration reference](/models/reference) — provider and model fields, overrides, variants, and API compatibility.
|
|
23
|
+
- [Compaction reference](/compaction/reference) — parameters, persistence, hooks, formats, settings, and historical formats.
|
|
24
|
+
- [Extension API reference](/extensions/api-reference) — `ExtensionContext`, `ExtensionCommandContext`, and `ExtensionAPI` methods.
|
|
25
|
+
- [Extension events](/extensions/events) — every event and its payload.
|
|
26
|
+
- [SDK API reference](/sdk/reference) — options, loaders, return values, run modes, and exports.
|
|
27
|
+
- [RPC protocol](/rpc/protocol) — commands, events, types, and errors.
|
|
28
|
+
- [TUI API reference](/tui/reference) — component, focusable, input, and rendering contracts.
|
|
29
|
+
- [Session format](/session-format) — the JSONL session file format, entry types, and `SessionManager` API.
|
|
30
|
+
- [Theme reference](/themes/reference) — theme file format, color tokens, and color values.
|
|
31
|
+
- [Skill reference](/skills/reference) — `SKILL.md` frontmatter and validation.
|
|
32
|
+
- [Subagent reference](/subagents/reference) — fallback models and reasoning levels.
|
|
33
|
+
- [Intercom reference](/intercom/reference) — the `intercom` tool contract and settings.
|
|
34
|
+
- [Package reference](/packages/reference) — filtering, scope, and deduplication.
|
|
35
|
+
- [Provider API reference](/custom-provider/api-reference) — provider config and model definition contracts.
|
|
36
|
+
- [Workflow API reference](/workflows/api-reference) — workflow, stage, and context contracts.
|
|
37
|
+
|
|
38
|
+
## Reference
|
|
39
|
+
|
|
40
|
+
- [Session format](/session-format) - JSONL session file format, entry types, and SessionManager API.
|
|
41
|
+
|
|
42
|
+
## Platform setup
|
|
43
|
+
|
|
44
|
+
- [Windows](/windows)
|
|
45
|
+
- [Termux on Android](/termux)
|
|
46
|
+
- [tmux](/tmux)
|
|
47
|
+
- [Terminal setup](/terminal-setup)
|
|
48
|
+
- [Shell aliases](/shell-aliases)
|
|
49
|
+
|
|
50
|
+
## Development
|
|
51
|
+
|
|
52
|
+
- [Development](/development) - local setup, project structure, and debugging.
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: RPC client examples
|
|
3
|
+
description: Additional RPC client implementations.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RPC client examples
|
|
7
|
+
|
|
8
|
+
## Example: Interactive Client (Node.js)
|
|
9
|
+
|
|
10
|
+
See [`test/rpc-example.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/test/rpc-example.ts) for a complete interactive example, or [`src/modes/rpc/rpc-client.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/modes/rpc/rpc-client.ts) for a typed client implementation.
|
|
11
|
+
|
|
12
|
+
For a complete example of handling the extension UI protocol, see [`examples/rpc-extension-ui.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/rpc-extension-ui.ts) which pairs with the [`examples/extensions/rpc-demo.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/examples/extensions/rpc-demo.ts) extension.
|
|
13
|
+
|
|
14
|
+
```javascript
|
|
15
|
+
const { spawn } = require("child_process");
|
|
16
|
+
const { StringDecoder } = require("string_decoder");
|
|
17
|
+
|
|
18
|
+
const agent = spawn("atomic", ["--mode", "rpc", "--no-session"]);
|
|
19
|
+
|
|
20
|
+
function attachJsonlReader(stream, onLine) {
|
|
21
|
+
const decoder = new StringDecoder("utf8");
|
|
22
|
+
let buffer = "";
|
|
23
|
+
|
|
24
|
+
stream.on("data", (chunk) => {
|
|
25
|
+
buffer += typeof chunk === "string" ? chunk : decoder.write(chunk);
|
|
26
|
+
|
|
27
|
+
while (true) {
|
|
28
|
+
const newlineIndex = buffer.indexOf("\n");
|
|
29
|
+
if (newlineIndex === -1) break;
|
|
30
|
+
|
|
31
|
+
let line = buffer.slice(0, newlineIndex);
|
|
32
|
+
buffer = buffer.slice(newlineIndex + 1);
|
|
33
|
+
if (line.endsWith("\r")) line = line.slice(0, -1);
|
|
34
|
+
onLine(line);
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
stream.on("end", () => {
|
|
39
|
+
buffer += decoder.end();
|
|
40
|
+
if (buffer.length > 0) {
|
|
41
|
+
onLine(buffer.endsWith("\r") ? buffer.slice(0, -1) : buffer);
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
attachJsonlReader(agent.stdout, (line) => {
|
|
47
|
+
const event = JSON.parse(line);
|
|
48
|
+
|
|
49
|
+
if (event.type === "message_update") {
|
|
50
|
+
const { assistantMessageEvent } = event;
|
|
51
|
+
if (assistantMessageEvent.type === "text_delta") {
|
|
52
|
+
process.stdout.write(assistantMessageEvent.delta);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
// Send prompt
|
|
58
|
+
agent.stdin.write(JSON.stringify({ type: "prompt", message: "Hello" }) + "\n");
|
|
59
|
+
|
|
60
|
+
// Abort on CTRL+C
|
|
61
|
+
process.on("SIGINT", () => {
|
|
62
|
+
agent.stdin.write(JSON.stringify({ type: "abort" }) + "\n");
|
|
63
|
+
});
|
|
64
|
+
```
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: RPC extension UI protocol
|
|
3
|
+
description: Drive extension-rendered UI over the RPC transport.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# RPC extension UI protocol
|
|
7
|
+
|
|
8
|
+
## Extension UI Protocol
|
|
9
|
+
|
|
10
|
+
Extensions can request user interaction via `ctx.ui.select()`, `ctx.ui.confirm()`, etc. In RPC mode, these are translated into a request/response sub-protocol on top of the base command/event flow.
|
|
11
|
+
|
|
12
|
+
There are two categories of extension UI methods:
|
|
13
|
+
|
|
14
|
+
- **Dialog methods** (`select`, `confirm`, `input`, `editor`): emit an `extension_ui_request` on stdout and block until the client sends back an `extension_ui_response` on stdin with the matching `id`.
|
|
15
|
+
- **Fire-and-forget methods** (`notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`): emit an `extension_ui_request` on stdout but do not expect a response. The client can display the information or ignore it.
|
|
16
|
+
|
|
17
|
+
If a dialog method includes a `timeout` field, the agent-side will auto-resolve with a default value when the timeout expires. The client does not need to track timeouts.
|
|
18
|
+
|
|
19
|
+
Some `ExtensionUIContext` methods are not supported or degraded in RPC mode because they require direct TUI access:
|
|
20
|
+
- `custom()` returns `undefined`
|
|
21
|
+
- `setWorkingMessage()`, `setWorkingIndicator()`, `setFooter()`, `setHeader()`, `setEditorComponent()` are no-ops
|
|
22
|
+
- `getEditorText()` returns `""`
|
|
23
|
+
- `setToolsExpanded()` and `getToolsExpanded()` maintain context-local expansion state; `getChatRenderSettings().toolOutputExpanded` reports the same value. A same-value `setToolsExpanded()` call is a no-op and does not request a custom-UI render. This state is not sent through the client extension-UI protocol.
|
|
24
|
+
- `pasteToEditor()` delegates to `setEditorText()` (no paste/collapse handling)
|
|
25
|
+
- `getAllThemes()` returns `[]`
|
|
26
|
+
- `getTheme()` returns `undefined`
|
|
27
|
+
- `setTheme()` returns `{ success: false, error: "..." }`
|
|
28
|
+
|
|
29
|
+
Note: `ctx.mode` is `"rpc"` and `ctx.hasUI` is `true` in RPC mode because the dialog and fire-and-forget methods are functional via the extension UI sub-protocol. Use `ctx.mode === "tui"` to guard TUI-specific features like `custom()` that require a real terminal.
|
|
30
|
+
|
|
31
|
+
### Extension UI Requests (stdout)
|
|
32
|
+
|
|
33
|
+
All requests have `type: "extension_ui_request"`, a unique `id`, and a `method` field.
|
|
34
|
+
|
|
35
|
+
#### select
|
|
36
|
+
|
|
37
|
+
Prompt the user to choose from a list. Dialog methods with a `timeout` field include the timeout in milliseconds; the agent auto-resolves with `undefined` if the client doesn't respond in time.
|
|
38
|
+
|
|
39
|
+
```json
|
|
40
|
+
{
|
|
41
|
+
"type": "extension_ui_request",
|
|
42
|
+
"id": "uuid-1",
|
|
43
|
+
"method": "select",
|
|
44
|
+
"title": "Allow dangerous command?",
|
|
45
|
+
"options": ["Allow", "Block"],
|
|
46
|
+
"timeout": 10000
|
|
47
|
+
}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Expected response: `extension_ui_response` with `value` (the selected option string) or `cancelled: true`.
|
|
51
|
+
|
|
52
|
+
#### confirm
|
|
53
|
+
|
|
54
|
+
Prompt the user for yes/no confirmation.
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"type": "extension_ui_request",
|
|
59
|
+
"id": "uuid-2",
|
|
60
|
+
"method": "confirm",
|
|
61
|
+
"title": "Clear session?",
|
|
62
|
+
"message": "All messages will be lost.",
|
|
63
|
+
"timeout": 5000
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
Expected response: `extension_ui_response` with `confirmed: true/false` or `cancelled: true`.
|
|
68
|
+
|
|
69
|
+
#### input
|
|
70
|
+
|
|
71
|
+
Prompt the user for free-form text.
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"type": "extension_ui_request",
|
|
76
|
+
"id": "uuid-3",
|
|
77
|
+
"method": "input",
|
|
78
|
+
"title": "Enter a value",
|
|
79
|
+
"placeholder": "type something..."
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Expected response: `extension_ui_response` with `value` (the entered text) or `cancelled: true`.
|
|
84
|
+
|
|
85
|
+
#### editor
|
|
86
|
+
|
|
87
|
+
Open a multi-line text editor with optional prefilled content.
|
|
88
|
+
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"type": "extension_ui_request",
|
|
92
|
+
"id": "uuid-4",
|
|
93
|
+
"method": "editor",
|
|
94
|
+
"title": "Edit some text",
|
|
95
|
+
"prefill": "Line 1\nLine 2\nLine 3"
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
Expected response: `extension_ui_response` with `value` (the edited text) or `cancelled: true`.
|
|
100
|
+
|
|
101
|
+
#### notify
|
|
102
|
+
|
|
103
|
+
Display a notification. Fire-and-forget, no response expected.
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"type": "extension_ui_request",
|
|
108
|
+
"id": "uuid-5",
|
|
109
|
+
"method": "notify",
|
|
110
|
+
"message": "Command blocked by user",
|
|
111
|
+
"notifyType": "warning"
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
The `notifyType` field is `"info"`, `"warning"`, or `"error"`. Defaults to `"info"` if omitted.
|
|
116
|
+
|
|
117
|
+
#### setStatus
|
|
118
|
+
|
|
119
|
+
Set or clear a status entry in the footer/status bar. Fire-and-forget.
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"type": "extension_ui_request",
|
|
124
|
+
"id": "uuid-6",
|
|
125
|
+
"method": "setStatus",
|
|
126
|
+
"statusKey": "my-ext",
|
|
127
|
+
"statusText": "Turn 3 running..."
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Send `statusText: undefined` (or omit it) to clear the status entry for that key.
|
|
132
|
+
|
|
133
|
+
#### setWidget
|
|
134
|
+
|
|
135
|
+
Set or clear a widget (block of text lines) displayed above or below the editor. Fire-and-forget.
|
|
136
|
+
|
|
137
|
+
```json
|
|
138
|
+
{
|
|
139
|
+
"type": "extension_ui_request",
|
|
140
|
+
"id": "uuid-7",
|
|
141
|
+
"method": "setWidget",
|
|
142
|
+
"widgetKey": "my-ext",
|
|
143
|
+
"widgetLines": ["--- My Widget ---", "Line 1", "Line 2"],
|
|
144
|
+
"widgetPlacement": "aboveEditor"
|
|
145
|
+
}
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
Send `widgetLines: undefined` (or omit it) to clear the widget. The `widgetPlacement` field is `"aboveEditor"` (default) or `"belowEditor"`. Only string arrays are supported in RPC mode; component factories are ignored.
|
|
149
|
+
|
|
150
|
+
#### setTitle
|
|
151
|
+
|
|
152
|
+
Set the terminal window/tab title. Fire-and-forget.
|
|
153
|
+
|
|
154
|
+
```json
|
|
155
|
+
{
|
|
156
|
+
"type": "extension_ui_request",
|
|
157
|
+
"id": "uuid-8",
|
|
158
|
+
"method": "setTitle",
|
|
159
|
+
"title": "atomic - my project"
|
|
160
|
+
}
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
#### set_editor_text
|
|
164
|
+
|
|
165
|
+
Set the text in the input editor. Fire-and-forget.
|
|
166
|
+
|
|
167
|
+
```json
|
|
168
|
+
{
|
|
169
|
+
"type": "extension_ui_request",
|
|
170
|
+
"id": "uuid-9",
|
|
171
|
+
"method": "set_editor_text",
|
|
172
|
+
"text": "prefilled text for the user"
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Extension UI Responses (stdin)
|
|
177
|
+
|
|
178
|
+
Responses are sent for dialog methods only (`select`, `confirm`, `input`, `editor`). The `id` must match the request.
|
|
179
|
+
|
|
180
|
+
#### Value response (select, input, editor)
|
|
181
|
+
|
|
182
|
+
```json
|
|
183
|
+
{"type": "extension_ui_response", "id": "uuid-1", "value": "Allow"}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
#### Confirmation response (confirm)
|
|
187
|
+
|
|
188
|
+
```json
|
|
189
|
+
{"type": "extension_ui_response", "id": "uuid-2", "confirmed": true}
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
#### Cancellation response (any dialog)
|
|
193
|
+
|
|
194
|
+
Dismiss any dialog method. The extension receives `undefined` (for select/input/editor) or `false` (for confirm).
|
|
195
|
+
|
|
196
|
+
```json
|
|
197
|
+
{"type": "extension_ui_response", "id": "uuid-3", "cancelled": true}
|
|
198
|
+
```
|