@bastani/atomic 0.9.19-alpha.6 → 0.9.19-alpha.8

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +2 -2
  3. package/dist/builtin/intercom/package.json +1 -1
  4. package/dist/builtin/mcp/package.json +1 -1
  5. package/dist/builtin/subagents/package.json +1 -1
  6. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  7. package/dist/builtin/web-access/index.bundle.mjs +22 -3
  8. package/dist/builtin/web-access/package.json +1 -1
  9. package/dist/builtin/workflows/CHANGELOG.md +19 -0
  10. package/dist/builtin/workflows/README.md +1 -1
  11. package/dist/builtin/workflows/builtin/adversarial-verification.js +2 -2
  12. package/dist/builtin/workflows/builtin/{chunk-vhmnzdj9.js → chunk-1jth021m.js} +1 -1
  13. package/dist/builtin/workflows/builtin/{chunk-p8jjwfg6.js → chunk-2377r57g.js} +4 -2
  14. package/dist/builtin/workflows/builtin/{chunk-hbnwv56f.js → chunk-31j2gs7h.js} +2 -2
  15. package/dist/builtin/workflows/builtin/{chunk-n8zysf1t.js → chunk-ngkqkzej.js} +1 -1
  16. package/dist/builtin/workflows/builtin/{chunk-1nbq96fh.js → chunk-nkrafh9s.js} +1 -1
  17. package/dist/builtin/workflows/builtin/{chunk-1kx4aggw.js → chunk-wf741bv3.js} +2 -2
  18. package/dist/builtin/workflows/builtin/{chunk-t6x2d78s.js → chunk-z29qbehr.js} +1 -1
  19. package/dist/builtin/workflows/builtin/generate-and-filter.js +2 -2
  20. package/dist/builtin/workflows/builtin/goal.js +3 -3
  21. package/dist/builtin/workflows/builtin/index.js +7 -7
  22. package/dist/builtin/workflows/builtin/ralph.js +3 -3
  23. package/dist/builtin/workflows/builtin/tournament.js +2 -2
  24. package/dist/builtin/workflows/package.json +1 -1
  25. package/dist/builtin/workflows/src/extension/index.bundle.mjs +590 -256
  26. package/dist/builtin/workflows/src/index.js +67 -19
  27. package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +2 -0
  28. package/dist/modes/interactive/components/task-live-transcript.d.ts +1 -1
  29. package/dist/modes/interactive/components/task-live-transcript.d.ts.map +1 -1
  30. package/dist/modes/interactive/components/task-live-transcript.js +19 -11
  31. package/dist/modes/interactive/components/task-live-transcript.js.map +1 -1
  32. package/docs/background-tasks.md +1 -1
  33. package/docs/build.md +51 -0
  34. package/docs/changelog.mdx +8 -8
  35. package/docs/compaction/reference.md +267 -0
  36. package/docs/compaction.md +36 -219
  37. package/docs/computer-use.md +35 -0
  38. package/docs/containerization.md +2 -0
  39. package/docs/custom-provider/api-reference.md +145 -0
  40. package/docs/custom-provider/oauth.md +131 -0
  41. package/docs/custom-provider/override.md +34 -0
  42. package/docs/custom-provider/registration.md +163 -0
  43. package/docs/custom-provider/streaming.md +214 -0
  44. package/docs/custom-provider.md +43 -607
  45. package/docs/development.md +76 -0
  46. package/docs/docs.json +199 -77
  47. package/docs/environment-variables.md +1 -1
  48. package/docs/extensions/api-reference.md +1001 -0
  49. package/docs/extensions/authoring.md +676 -0
  50. package/docs/extensions/events.md +793 -0
  51. package/docs/extensions/examples.md +94 -0
  52. package/docs/extensions/ui.md +470 -0
  53. package/docs/extensions.md +270 -2768
  54. package/docs/getting-started/authentication.md +55 -0
  55. package/docs/getting-started/first-session.md +172 -0
  56. package/docs/getting-started/installation.md +154 -0
  57. package/docs/getting-started/project-instructions.md +43 -0
  58. package/docs/guides/configuration.md +65 -0
  59. package/docs/guides/intercom.md +24 -0
  60. package/docs/guides/non-interactive.md +33 -0
  61. package/docs/guides/subagents.md +24 -0
  62. package/docs/guides/workflows.md +27 -0
  63. package/docs/guides.md +41 -0
  64. package/docs/index.md +13 -45
  65. package/docs/intercom/operations.md +178 -0
  66. package/docs/intercom/reference.md +146 -0
  67. package/docs/intercom.md +54 -259
  68. package/docs/json.md +17 -0
  69. package/docs/llama-cpp.md +5 -0
  70. package/docs/models/artificial-analysis-index.md +89 -0
  71. package/docs/models/evals.md +2 -2
  72. package/docs/models/model-selection.md +3 -3
  73. package/docs/models/pareto-efficiency.md +2 -2
  74. package/docs/models/reference.md +601 -0
  75. package/docs/models.md +45 -550
  76. package/docs/packages/authoring.md +88 -0
  77. package/docs/packages/reference.md +43 -0
  78. package/docs/packages.md +28 -107
  79. package/docs/programmatic.md +29 -0
  80. package/docs/prompt-templates.md +11 -0
  81. package/docs/providers/reference.md +23 -0
  82. package/docs/providers.md +10 -15
  83. package/docs/quickstart.md +44 -238
  84. package/docs/reference/cli.md +252 -0
  85. package/docs/reference.md +52 -0
  86. package/docs/rpc/examples.md +64 -0
  87. package/docs/rpc/extension-ui.md +198 -0
  88. package/docs/rpc/protocol.md +1341 -0
  89. package/docs/rpc.md +109 -1346
  90. package/docs/sdk/reference.md +1090 -0
  91. package/docs/sdk.md +56 -1002
  92. package/docs/session-format.md +2 -0
  93. package/docs/sessions.md +6 -10
  94. package/docs/settings.md +6 -45
  95. package/docs/skills/authoring.md +95 -0
  96. package/docs/skills/reference.md +60 -0
  97. package/docs/skills.md +20 -122
  98. package/docs/subagents/authoring.md +37 -0
  99. package/docs/subagents/reference.md +60 -0
  100. package/docs/subagents.md +39 -95
  101. package/docs/terminal-setup.md +1 -1
  102. package/docs/themes/reference.md +176 -0
  103. package/docs/themes.md +21 -135
  104. package/docs/tmux.md +5 -0
  105. package/docs/tools/edit.md +5 -0
  106. package/docs/tools.md +5 -0
  107. package/docs/tui/reference.md +343 -0
  108. package/docs/tui.md +23 -286
  109. package/docs/usage.md +26 -209
  110. package/docs/web-access.md +2 -0
  111. package/docs/windows.md +2 -1
  112. package/docs/workflows/api-reference.md +11 -4
  113. package/docs/workflows/authoring.md +4 -2
  114. package/docs/workflows/builtins.md +2 -2
  115. package/docs/workflows/operations.md +15 -10
  116. package/docs/workflows/reliable-design.md +21 -3
  117. package/docs/workflows/verification.md +8 -0
  118. package/npm-shrinkwrap.json +32 -32
  119. package/package.json +3 -3
@@ -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
+ ```