@bastani/atomic 0.9.49 → 0.9.50

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 (38) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/builtin/intercom/package.json +1 -1
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/package.json +1 -1
  5. package/dist/builtin/web-access/package.json +1 -1
  6. package/dist/builtin/workflows/package.json +1 -1
  7. package/dist/core/extensions/ui-types.d.ts +6 -0
  8. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  9. package/dist/core/extensions/ui-types.js.map +1 -1
  10. package/dist/core/tools/ask-user-question/ask-user-question.d.ts.map +1 -1
  11. package/dist/core/tools/ask-user-question/ask-user-question.js +3 -0
  12. package/dist/core/tools/ask-user-question/ask-user-question.js.map +1 -1
  13. package/dist/modes/rpc/rpc-client-api.d.ts +7 -0
  14. package/dist/modes/rpc/rpc-client-api.d.ts.map +1 -1
  15. package/dist/modes/rpc/rpc-client-api.js +7 -0
  16. package/dist/modes/rpc/rpc-client-api.js.map +1 -1
  17. package/dist/modes/rpc/rpc-command-handler.d.ts +3 -2
  18. package/dist/modes/rpc/rpc-command-handler.d.ts.map +1 -1
  19. package/dist/modes/rpc/rpc-command-handler.js +6 -1
  20. package/dist/modes/rpc/rpc-command-handler.js.map +1 -1
  21. package/dist/modes/rpc/rpc-extension-ui.d.ts +7 -1
  22. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  23. package/dist/modes/rpc/rpc-extension-ui.js +19 -1
  24. package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
  25. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  26. package/dist/modes/rpc/rpc-mode.js +3 -0
  27. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  28. package/dist/modes/rpc/rpc-session-binding.d.ts +4 -2
  29. package/dist/modes/rpc/rpc-session-binding.d.ts.map +1 -1
  30. package/dist/modes/rpc/rpc-session-binding.js +5 -2
  31. package/dist/modes/rpc/rpc-session-binding.js.map +1 -1
  32. package/dist/modes/rpc/rpc-types.d.ts +19 -0
  33. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  34. package/dist/modes/rpc/rpc-types.js.map +1 -1
  35. package/docs/rpc/extension-ui.md +41 -2
  36. package/docs/rpc/protocol.md +17 -0
  37. package/npm-shrinkwrap.json +32 -32
  38. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.9.50] - 2026-10-28
6
+
7
+ RPC clients can answer questions.
8
+
9
+ - **Questionnaires over RPC:** RPC clients that opt in receive each `ask_user_question` call as one request carrying all its questions and reply with the answers, so headless and embedded integrations can handle interactive prompts; clients that don't opt in see no change ([#4089](https://github.com/bastani-inc/atomic/pull/4089))
10
+
11
+ ### Added
12
+
13
+ - RPC clients can answer `ask_user_question`: after `{"type": "set_extension_ui_capabilities", "questionnaire": true}`, each call reaches the client as one `extension_ui_request` with method `questionnaire` and all its questions, and the client replies with the answers. Clients that don't opt in see no change. `RpcClient.setExtensionUiCapabilities()` sends the command ([#4089](https://github.com/bastani-inc/atomic/pull/4089))
14
+
15
+ ## [0.9.50-alpha.1] - 2026-10-27
16
+
17
+ RPC clients can answer questions.
18
+
19
+ - **Questionnaires over RPC:** RPC clients that opt in receive each `ask_user_question` call as one request carrying all its questions and reply with the answers, so headless and embedded integrations can handle interactive prompts; clients that don't opt in see no change ([#4089](https://github.com/bastani-inc/atomic/pull/4089))
20
+
21
+ ### Added
22
+
23
+ - RPC clients can answer `ask_user_question`: after `{"type": "set_extension_ui_capabilities", "questionnaire": true}`, each call reaches the client as one `extension_ui_request` with method `questionnaire` and all its questions, and the client replies with the answers. Clients that don't opt in see no change. `RpcClient.setExtensionUiCapabilities()` sends the command ([#4089](https://github.com/bastani-inc/atomic/pull/4089))
24
+
5
25
  ## [0.9.49] - 2026-10-27
6
26
 
7
27
  Faster workflow journals on remote databases.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/intercom",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "private": true,
5
5
  "description": "Atomic extension providing a private coordination channel between parent and child agent sessions. Fork of: https://github.com/nicobailon/pi-intercom",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/mcp",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "private": true,
5
5
  "description": "Atomic's pi-compatible MCP integration for server connections, OAuth, tools, resources, and terminal management.",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/subagents",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "private": true,
5
5
  "description": "Atomic extension for delegating tasks to subagents with parallel execution. Fork of: https://github.com/nicobailon/pi-subagents",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/web-access",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "private": true,
5
5
  "description": "Atomic extension for web search, URL fetching, GitHub repo cloning, PDF/video extraction. Fork of: https://github.com/nicobailon/pi-web-access",
6
6
  "contributors": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/workflows",
3
- "version": "0.9.49",
3
+ "version": "0.9.50",
4
4
  "private": true,
5
5
  "description": "Atomic extension for multi-stage workflow authoring and execution.",
6
6
  "contributors": [
@@ -312,6 +312,12 @@ export interface ExtensionUIContext {
312
312
  * terminal host. Resolves raw field values, or undefined on cancellation.
313
313
  */
314
314
  hostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;
315
+ /**
316
+ * Ask a whole `ask_user_question` questionnaire through the host, as one request, instead of rendering it in the
317
+ * terminal. Resolves the user's answers, or undefined when the host can't ask right now, in which case the caller
318
+ * renders the questionnaire itself.
319
+ */
320
+ hostQuestionnaire?(params: import("../tools/ask-user-question/tool/types.js").QuestionParams, signal?: AbortSignal): Promise<import("../tools/ask-user-question/tool/types.js").QuestionnaireResult | undefined>;
315
321
  /** Paste text into the editor, triggering paste handling (collapse for large content). */
316
322
  pasteToEditor(text: string): void;
317
323
  /** Set the text in the core input editor. */
@@ -1 +1 @@
1
- {"version":3,"file":"ui-types.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,oBAAoB,EACpB,SAAS,EACT,eAAe,EACf,WAAW,EACX,aAAa,EACb,cAAc,EACd,aAAa,EACb,GAAG,EACH,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAC5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,wCAAwC;AACxC,MAAM,WAAW,wBAAwB;IACxC,0DAA0D;IAC1D,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,kFAAkF;IAClF,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,uCAAuC;AACvC,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,aAAa,CAAC;AAE5D,MAAM,WAAW,iBAAiB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,mBAAmB;IACnC,6DAA6D;IAC7D,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAA0B,SAAQ,SAAS;IAC3D,gBAAgB,CAAC,IAAI,mBAAmB,GAAG,SAAS,CAAC;IACrD,Q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uCAAuC;IACvC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;IAE1C,sEAAsE;IACtE,qBAAqB,IAAI,kBAAkB,CAAC;CAC5C"}
@@ -1 +1 @@
1
- {"version":3,"file":"ui-types.js","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProgramStatus,\n\tTUI,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t/**\n\t\t\t * Report Atomic as blocked on user input (OSC 7501 program status) while this component is visible.\n\t\t\t * Only applies to inline components, not overlays.\n\t\t\t */\n\t\t\tblocked?: { kind: NonNullable<ProgramStatus[\"kind\"]>; message: string };\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}
1
+ {"version":3,"file":"ui-types.js","sourceRoot":"","sources":["../../../src/core/extensions/ui-types.ts"],"names":[],"mappings":"AAyEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,8BAA8B,CAAC;AAExE,6FAA6F;AAC7F,MAAM,UAAU,2BAA2B,CAAC,KAAwB;IACnE,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAChG,CAAC;AACH,CAAC;AAED,MAAM,kBAAkB,GAAG,aAAa,CAAC;AACzC,MAAM,0BAA0B,GAAG,uDAAuD,CAAC;AAE3F;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAwB;IACxD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CACzB,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CACvF,CAAC;AACH,CAAC","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProgramStatus,\n\tTUI,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { ReadonlyFooterDataProvider } from \"../footer-data-provider.ts\";\nimport type { KeybindingsManager } from \"../keybindings.ts\";\nimport type { MarkdownTransformer, MessageRenderer } from \"./message-types.ts\";\nimport type { ToolRenderers } from \"./tool-types.ts\";\n\n/** Options for extension UI dialogs. */\nexport interface ExtensionUIDialogOptions {\n\t/** AbortSignal to programmatically dismiss the dialog. */\n\tsignal?: AbortSignal;\n\t/** Timeout in milliseconds. Dialog auto-dismisses with live countdown display. */\n\ttimeout?: number;\n}\n\n/** Placement for extension widgets. */\nexport type WidgetPlacement = \"aboveEditor\" | \"belowEditor\";\n\nexport interface WidgetScrollState {\n\tscrollTop: number;\n\tviewportHeight: number;\n\tcontentHeight: number;\n}\n\nexport interface WidgetScrollRequest {\n\t/** Increase when intentionally requesting a new position. */\n\tversion: number;\n\tscrollTop: number;\n}\n\nexport interface ScrollableWidgetComponent extends Component {\n\tgetScrollRequest?(): WidgetScrollRequest | undefined;\n\tonScroll?(state: WidgetScrollState): void;\n\tdispose?(): void;\n}\n\n/** Options for extension widgets. */\nexport interface ExtensionWidgetOptions {\n\t/** Where the widget is rendered. Defaults to \"aboveEditor\". */\n\tplacement?: WidgetPlacement;\n\t/** Opt in to a host-owned viewport. Height is a cap, not a guaranteed allocation. */\n\tscroll?: { maxHeight: number; maxHeightFraction?: number };\n}\n\n/** Raw terminal input listener for extensions. */\nexport type TerminalInputHandler = (data: string) => { consume?: boolean; data?: string } | undefined;\n\n/** Working indicator configuration for the interactive Working lifecycle. */\nexport interface WorkingIndicatorOptions {\n\t/** Animation frames. Use an empty array to hide the indicator entirely. Custom frames are rendered verbatim. */\n\tframes?: string[];\n\t/** Frame interval in milliseconds for animated indicators. */\n\tintervalMs?: number;\n}\n\n/** Wrap the current autocomplete provider with additional behavior. */\nexport type AutocompleteProviderFactory = (current: AutocompleteProvider) => AutocompleteProvider;\nexport type EditorFactory = (tui: TUI, theme: EditorTheme, keybindings: KeybindingsManager) => EditorComponent;\n/** Component returned by `ctx.ui.custom()`. Input handlers must report whether they consumed the key. */\nexport type ExtensionCustomComponent = Omit<Component, \"handleInput\"> & {\n\thandleInput?: (data: string) => boolean | undefined | Promise<boolean | undefined>;\n\tdispose?(): void;\n};\n\n/**\n * Zero-width mark a custom component may embed in the line it most needs kept\n * on screen — the selected row of a list, say.\n *\n * A `reserveTranscriptRows` overlay is bounded against the terminal height, and\n * on a short terminal that bound has to drop rows. Without a mark the host can\n * only guess, and it guessed wrong: it kept a fixed number of rows from the top,\n * so on a 16-to-22-row terminal the selected option was cropped away and the\n * dialog looked frozen under the arrow keys. With the mark the host windows what\n * it keeps around that row instead.\n *\n * It is an APC sequence, so pi-tui's `visibleWidth` measures it as zero and\n * terminals ignore it — the same mechanism as pi-tui's own `CURSOR_MARKER`, but\n * private to Atomic. Embed it once per frame; the host uses the first line that\n * carries it.\n *\n * The terminator is ST (`ESC \\`), which is what ECMA-48 requires of an APC\n * string. A BEL terminator is accepted for OSC but not for APC, so terminals\n * that follow the spec — tmux among them — kept swallowing the rest of the line\n * as APC payload and drew whatever followed the mark at the wrong column. The\n * renderer strips the mark centrally in `applyLineResets` before painting, so\n * it does not reach the terminal at all; the conforming terminator is the\n * second layer, bounding the damage if a frame ever escapes that strip.\n */\nexport const OVERLAY_ACTIVE_ROW_MARKER = \"\\u001B_atomic:active\\u001B\\\\\";\n\n/** Remove every {@link OVERLAY_ACTIVE_ROW_MARKER} from `lines`, leaving widths untouched. */\nexport function stripOverlayActiveRowMarker(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OVERLAY_ACTIVE_ROW_MARKER) ? line.replaceAll(OVERLAY_ACTIVE_ROW_MARKER, \"\") : line,\n\t);\n}\n\nconst OSC133_PROMPT_MARK = \"\\u001B]133;\";\nconst OSC133_PROMPT_MARK_PATTERN = /\\u001B\\]133;[ABC][^\\u0007\\u001B]*(?:\\u0007|\\u001B\\\\)/g;\n\n/**\n * Remove every OSC 133 `A`/`B`/`C` shell-integration mark from `lines`, wherever it sits in the line.\n * Terminals treat `A` as a new shell prompt and drop the program's OSC 7501 status record, so a\n * fullscreen frame must never carry one. The marks are zero-width, so no column moves.\n */\nexport function stripOsc133Marks(lines: readonly string[]): string[] {\n\treturn lines.map((line) =>\n\t\tline.includes(OSC133_PROMPT_MARK) ? line.replace(OSC133_PROMPT_MARK_PATTERN, \"\") : line,\n\t);\n}\n\nexport interface ChatRenderSettings {\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\ttoolOutputExpanded: boolean;\n\tshowImages: boolean;\n\timageWidthCells: number;\n\tmarkdownTransformers: readonly MarkdownTransformer[];\n\trenderLatex?: boolean;\n\tgetToolDefinition(toolName: string): ToolRenderers | undefined;\n\tgetCustomMessageRenderer(customType: string): MessageRenderer | undefined;\n}\n\n/** Host-owned inline custom UI focus state exposed to overlays without prompt content. */\nexport interface HostCustomUiState {\n\t/** Number of active non-overlay host custom UI mounts. */\n\tblockingInlineCustomUiDepth: number;\n\t/** True when at least one non-overlay host custom UI is mounted and blocking. */\n\tblockingInlineCustomUiActive: boolean;\n\t/** True when the active inline custom UI is waiting behind an overlay that kept focus. */\n\tblockingInlineCustomUiFocusDeferred?: boolean;\n\t/** Distinguishes required prompts from navigation. Omitted when all mounts are prompts. */\n\tblockingInlineCustomUiNeedsInput?: boolean;\n}\n\nexport type HostCustomUiStateListener = (state: HostCustomUiState) => void;\n\n/** Supported field kinds for the host-native input form. */\nexport type HostInputFormFieldType = \"string\" | \"text\" | \"number\" | \"integer\" | \"boolean\" | \"select\";\n\n/** JSON-safe field descriptor for {@link ExtensionUIContext.hostInputForm}. */\nexport interface HostInputFormField {\n\tname: string;\n\ttype: HostInputFormFieldType;\n\tdescription?: string;\n\trequired?: boolean;\n\tchoices?: string[];\n\tplaceholder?: string;\n\t/** Raw, display-ready initial value. */\n\tinitialValue: string;\n}\n\n/** Request for a host-owned inline input form. */\nexport interface HostInputFormRequest {\n\ttitle: string;\n\tfields: HostInputFormField[];\n\t/** Panel heading label. Defaults to \"WORKFLOW INPUTS\". */\n\theading?: string;\n\t/** Submit button label. Defaults to \"[ Run workflow ]\". */\n\tsubmitLabel?: string;\n}\n\n/**\n * JSON-safe session-selector row for the host-native session picker.\n * Mirrors `SessionInfo` with `created`/`modified` flattened to epoch millis so\n * rows can cross the interactive-engine protocol without `Date` objects.\n */\nexport interface HostSessionPickerRow {\n\tpath: string;\n\tid: string;\n\tcwd: string;\n\t/** Creation time in epoch milliseconds. */\n\tcreatedAt: number;\n\t/** Last-modified time in epoch milliseconds. */\n\tmodifiedAt: number;\n\tmessageCount: number;\n\tfirstMessage: string;\n\t/** Generated resume summary. Absent when never generated, or stale against the latest message. */\n\tsummary?: string;\n\tallMessagesText?: string;\n\tname?: string;\n\t/** Optional semantic color for synthetic selector rows. */\n\tmessageColor?: \"success\" | \"warning\" | \"accent\" | \"error\";\n}\n\n/** Request for {@link ExtensionUIContext.hostSessionPicker}. */\nexport interface HostSessionPickerRequest {\n\t/** Rows shown in the first frame. Push later rows via the handle's `update()`. */\n\tsessions: HostSessionPickerRow[];\n\t/** Show the rename keybinding hint in the picker header. Defaults to false. */\n\tshowRenameHint?: boolean;\n\t/**\n\t * Invoked after the user confirms a Ctrl+D delete on a row. The host does\n\t * NOT remove the row; reply with `update()` (row removed) or `error()`.\n\t */\n\tonDelete?: (path: string) => void | Promise<void>;\n}\n\n/** Live control surface for an open host-native session picker. */\nexport interface HostSessionPickerHandle {\n\t/** Resolves with the selected row's `path`, or `undefined` on cancel/close. */\n\tresult: Promise<string | undefined>;\n\t/** Replace the picker rows (navigation/search state is preserved host-side). */\n\tupdate(sessions: HostSessionPickerRow[]): void;\n\t/** Surface a transient error message in the picker header. */\n\terror(message: string): void;\n\t/** Close the picker; `result` resolves `undefined`. Idempotent. */\n\tclose(): void;\n}\n\n/**\n * UI context for extensions to request interactive UI.\n * Each mode (interactive, RPC, print) provides its own implementation.\n */\nexport interface ExtensionUIContext {\n\t/** Show a selector and return the user's choice. */\n\tselect(title: string, options: string[], opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a confirmation dialog. */\n\tconfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\n\t/** Show a text input dialog. */\n\tinput(title: string, placeholder?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Show a notification to the user. */\n\tnotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\n\t/** Request an interactive repaint after extension-owned state changes. */\n\trequestRender(): void;\n\n\t/** Get host-owned inline custom UI focus state, if the mode exposes it. */\n\tgetHostCustomUiState?(): HostCustomUiState;\n\n\t/** Observe host-owned inline custom UI focus state changes. Returns an unsubscribe function. */\n\tonHostCustomUiStateChange?(listener: HostCustomUiStateListener): () => void;\n\n\t/** Move focus to a mounted host-owned inline custom UI, if one is pending. */\n\tfocusHostInlineCustomUi?(): boolean;\n\n\t/** Listen to raw terminal input (interactive mode only). Returns an unsubscribe function. */\n\tonTerminalInput(handler: TerminalInputHandler): () => void;\n\n\t/** Set status text in the footer/status bar. Pass undefined to clear. */\n\tsetStatus(key: string, text: string | undefined): void;\n\n\t/**\n\t * Set the working/loading message presented during the active Working lifecycle,\n\t * from accepted prompt startup through the agent turn. This customizes\n\t * presentation only; it does not start work or emit pre-start events. Call with\n\t * no argument to restore the default.\n\t */\n\tsetWorkingMessage(message?: string): void;\n\n\t/**\n\t * Show or hide the built-in row during the active Working lifecycle.\n\t * This customizes presentation only; it does not start or stop work.\n\t */\n\tsetWorkingVisible(visible: boolean): void;\n\n\t/**\n\t * Configure the interactive indicator presented during the active Working\n\t * lifecycle, from accepted prompt startup through the agent turn. This\n\t * customizes presentation only; it does not start work or emit pre-start events.\n\t *\n\t * - Omit the argument to restore the default animated spinner.\n\t * - Use `frames: [\"●\"]` for a static indicator.\n\t * - Use `frames: []` to hide the indicator entirely.\n\t * - Custom frames are rendered as provided, so extensions must add their own colors.\n\t */\n\tsetWorkingIndicator(options?: WorkingIndicatorOptions): void;\n\n\t/** Set the label shown for hidden thinking blocks. Call with no argument to restore default. */\n\tsetHiddenThinkingLabel(label?: string): void;\n\n\t/** Set a widget to display above or below the editor. Accepts string array or component factory. */\n\tsetWidget(key: string, content: string[] | undefined, options?: ExtensionWidgetOptions): void;\n\tsetWidget(\n\t\tkey: string,\n\t\tcontent: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined,\n\t\toptions?: ExtensionWidgetOptions,\n\t): void;\n\n\t/** Observe host-driven widget release events for a key. Returns an unsubscribe function. */\n\tonWidgetRelease?(key: string, listener: () => void): () => void;\n\n\t/** Set a custom footer component, or undefined to restore the built-in footer.\n\t *\n\t * The factory receives a FooterDataProvider for data not otherwise accessible:\n\t * git branch and extension statuses from setStatus(). Context usage is on\n\t * ctx.getContextUsage(), token stats on ctx.sessionManager.getEntries(), and model info on ctx.model.\n\t */\n\tsetFooter(\n\t\tfactory:\n\t\t\t| ((tui: TUI, theme: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t| undefined,\n\t): void;\n\n\t/** Set a custom header component (shown at startup, above chat), or undefined to restore the built-in header. */\n\tsetHeader(factory: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;\n\n\t/** Set the terminal window/tab title. */\n\tsetTitle(title: string): void;\n\n\t/** Show a custom component with keyboard focus. */\n\tcustom<T>(\n\t\tfactory: (\n\t\t\ttui: TUI,\n\t\t\ttheme: Theme,\n\t\t\tkeybindings: KeybindingsManager,\n\t\t\tdone: (result: T) => void,\n\t\t) => ExtensionCustomComponent | Promise<ExtensionCustomComponent>,\n\t\toptions?: {\n\t\t\t/** Navigation does not emit approval-prompt events. Defaults to \"prompt\". */\n\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\toverlay?: boolean;\n\t\t\t/** Keep host inline custom UI pending in the background while this overlay is visible. */\n\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t/**\n\t\t\t * Declare that this component binds Ctrl+C itself (cancel, skip, close).\n\t\t\t * The host then forwards the first Ctrl+C to it instead of closing it.\n\t\t\t *\n\t\t\t * Leave it unset unless the component really handles the key: the host\n\t\t\t * closes an undeclared component on the first Ctrl+C so a component that\n\t\t\t * never resolves can never trap the keyboard.\n\t\t\t */\n\t\t\thandlesCtrlC?: boolean;\n\t\t\t/** Declare that this component claims internal UI actions such as the jump-to-bottom URL. */\n\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t/**\n\t\t\t * Overlay-only. Bound this overlay's height so a transcript strip stays\n\t\t\t * visible, and extend the transcript's scroll extent by the rows it\n\t\t\t * still covers, so every line of the scrollback can be brought above it.\n\t\t\t *\n\t\t\t * Set it for a blocking bottom-anchored dialog. Leave it unset for an\n\t\t\t * overlay that is meant to take the screen, such as a full-screen graph.\n\t\t\t */\n\t\t\treserveTranscriptRows?: boolean;\n\t\t\t/** AbortSignal to programmatically dismiss the custom UI. */\n\t\t\tsignal?: AbortSignal;\n\t\t\t/** Overlay positioning/sizing options. Can be static or a function for dynamic updates. */\n\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t/** Called with the overlay handle after the overlay is shown. Use to control visibility. */\n\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t/**\n\t\t\t * Report Atomic as blocked on user input (OSC 7501 program status) while this component is visible.\n\t\t\t * Only applies to inline components, not overlays.\n\t\t\t */\n\t\t\tblocked?: { kind: NonNullable<ProgramStatus[\"kind\"]>; message: string };\n\t\t},\n\t): Promise<T>;\n\n\t/**\n\t * Open a session-list picker that runs natively in the host terminal\n\t * process. Every interactive host implements it — non-isolated mode\n\t * mounts the selector directly (no IPC), isolated mode routes it over\n\t * the engine session-picker protocol channel — so callers use one\n\t * identical API. In both cases navigation and search never cross a\n\t * process boundary; only open/update/select/delete/cancel do. The\n\t * member is absent only on non-interactive surfaces (headless RPC,\n\t * print); callers should fail with an actionable error there rather\n\t * than degrade.\n\t */\n\thostSessionPicker?(request: HostSessionPickerRequest): HostSessionPickerHandle;\n\n\t/**\n\t * Open an inline form whose component, focus, and editing state live in the\n\t * terminal host. Resolves raw field values, or undefined on cancellation.\n\t */\n\thostInputForm?(request: HostInputFormRequest): Promise<Record<string, string> | undefined>;\n\n\t/**\n\t * Ask a whole `ask_user_question` questionnaire through the host, as one request, instead of rendering it in the\n\t * terminal. Resolves the user's answers, or undefined when the host can't ask right now, in which case the caller\n\t * renders the questionnaire itself.\n\t */\n\thostQuestionnaire?(\n\t\tparams: import(\"../tools/ask-user-question/tool/types.js\").QuestionParams,\n\t\tsignal?: AbortSignal,\n\t): Promise<import(\"../tools/ask-user-question/tool/types.js\").QuestionnaireResult | undefined>;\n\n\t/** Paste text into the editor, triggering paste handling (collapse for large content). */\n\tpasteToEditor(text: string): void;\n\n\t/** Set the text in the core input editor. */\n\tsetEditorText(text: string): void;\n\n\t/** Get the current text from the core input editor. */\n\tgetEditorText(): string;\n\n\t/**\n\t * Show a multi-line editor for text editing.\n\t *\n\t * `opts.signal` lets a host cancel the mount it owns — the isolated engine\n\t * bridge uses it to close dialogs belonging to a dead engine generation.\n\t */\n\teditor(title: string, prefill?: string, opts?: ExtensionUIDialogOptions): Promise<string | undefined>;\n\n\t/** Stack additional autocomplete behavior on top of the built-in provider. */\n\taddAutocompleteProvider(factory: AutocompleteProviderFactory): void;\n\n\t/**\n\t * Set a custom editor component via factory function.\n\t * Pass undefined to restore the default editor.\n\t *\n\t * The factory receives:\n\t * - `theme`: EditorTheme for styling borders and autocomplete\n\t * - `keybindings`: KeybindingsManager for app-level keybindings\n\t *\n\t * For full app keybinding support (escape, ctrl+d, model switching, etc.),\n\t * extend `CustomEditor` from `@bastani/atomic` and return `super.handleInput(data)`\n\t * for keys you don't handle.\n\t *\n\t * @example\n\t * ```ts\n\t * import { CustomEditor } from \"@bastani/atomic\";\n\t *\n\t * class VimEditor extends CustomEditor {\n\t * private mode: \"normal\" | \"insert\" = \"insert\";\n\t *\n\t * handleInput(data: string): boolean {\n\t * if (this.mode === \"normal\") {\n\t * // Handle vim normal mode keys...\n\t * if (data === \"i\") { this.mode = \"insert\"; return true; }\n\t * }\n\t * return super.handleInput(data); // App keybindings + text editing\n\t * }\n\t * }\n\t *\n\t * ctx.ui.setEditorComponent((tui, theme, keybindings) =>\n\t * new VimEditor(tui, theme, keybindings)\n\t * );\n\t * ```\n\t */\n\tsetEditorComponent(factory: EditorFactory | undefined): void;\n\n\t/** Get the currently configured custom editor factory, or undefined when using the default editor. */\n\tgetEditorComponent(): EditorFactory | undefined;\n\n\t/** Get the built-in footer data provider so embedded extension UIs can reuse the core footer. */\n\tgetFooterDataProvider(): ReadonlyFooterDataProvider;\n\n\t/** Get the current theme for styling. */\n\treadonly theme: Theme;\n\n\t/** Get all available themes with their names and file paths. */\n\tgetAllThemes(): { name: string; path: string | undefined }[];\n\n\t/** Load a theme by name without switching to it. Returns undefined if not found. */\n\tgetTheme(name: string): Theme | undefined;\n\n\t/** Set the current theme by name or Theme object. */\n\tsetTheme(theme: string | Theme): { success: boolean; error?: string };\n\n\t/** Get current tool output expansion state. */\n\tgetToolsExpanded(): boolean;\n\n\t/** Set tool output expansion state. */\n\tsetToolsExpanded(expanded: boolean): void;\n\n\t/** Get current chat rendering preferences and extension renderers. */\n\tgetChatRenderSettings(): ChatRenderSettings;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAG3C,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAWlF;AAED,eAAO,MAAM,2CAA2C;;;EAU7C,CAAC;AAEZ,wBAAgB,mCAAmC,CAAC,OAAO,CAAC,EAAE;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,cAAc,CAAC,OAAO,oBAAoB,EAAE,OAAO,CAAC,CAoEvD;AAED,gFAAgF;AAChF,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,kBAAkB,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,WAAW,EACpB,YAAY,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAmB9B;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"ask-user-question.d.ts","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAIvE,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAIN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,oBAAoB,EACpB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAM/E;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,6BAA6B,EAAE,cAG3C,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,YAAY,GAAG,kBAAkB,EAAE,CAWlF;AAED,eAAO,MAAM,2CAA2C;;;EAU7C,CAAC;AAEZ,wBAAgB,mCAAmC,CAAC,OAAO,CAAC,EAAE;IAC7D,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CAChC,GAAG,cAAc,CAAC,OAAO,oBAAoB,EAAE,OAAO,CAAC,CAoEvD;AAED,gFAAgF;AAChF,wBAAsB,oBAAoB,CACzC,EAAE,EAAE,kBAAkB,EACtB,MAAM,EAAE,cAAc,EACtB,MAAM,CAAC,EAAE,WAAW,EACpB,YAAY,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,mBAAmB,CAAC,CAqB9B;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC"}
@@ -114,6 +114,9 @@ Preview content is rendered as markdown in a monospace box. Multi-line text with
114
114
  }
115
115
  /** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */
116
116
  export async function presentQuestionnaire(ui, params, signal, chatAsOption) {
117
+ const hosted = await ui.hostQuestionnaire?.(params, signal);
118
+ if (hosted !== undefined)
119
+ return hosted;
117
120
  const itemsByTab = params.questions.map(buildItemsForQuestion);
118
121
  ui.setWorkingVisible?.(false);
119
122
  try {
@@ -1 +1 @@
1
- {"version":3,"file":"ask-user-question.js","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,UAAU,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,EACpB,YAAsB;IAEtB,MAAM,UAAU,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,qBAAqB,CAAC,CAAC;IAC/D,EAAE,CAAC,iBAAiB,EAAE,CAAC,KAAK,CAAC,CAAC;IAC9B,IAAI,CAAC;QACJ,OAAO,MAAM,EAAE,CAAC,MAAM,CACrB,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE,IAAI,EAAE,EAAE,CACzB,IAAI,oBAAoB,CAAC;YACxB,GAAG;YACH,KAAK;YACL,MAAM;YACN,UAAU;YACV,IAAI;YACJ,GAAG,CAAC,YAAY,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACxD,CAAC,CAAC,SAAS,EACb,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,6BAA6B,EAAE,CACrG,CAAC;IACH,CAAC;YAAS,CAAC;QACV,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { OverlayOptions } from \"@earendil-works/pi-tui\";\nimport { experimentalToolSamplingProperty } from \"../../experimental.ts\";\nimport { getHostQuestionnaire } from \"../../extensions/host-input.js\";\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ExtensionUIContext } from \"../../extensions/ui-types.js\";\nimport { loadConfig, validateGuidanceFields } from \"./config.ts\";\nimport { QuestionnaireSession } from \"./state/questionnaire-session.ts\";\nimport { ROW_INTENT_META, sentinelsToAppend } from \"./state/row-intent.ts\";\nimport { buildQuestionnaireResponse, buildToolResult } from \"./tool/response-envelope.ts\";\nimport {\n\tMAX_OPTIONS,\n\tMAX_QUESTIONS,\n\tMIN_OPTIONS,\n\ttype QuestionData,\n\ttype QuestionnaireResult,\n\ttype QuestionParams,\n\tQuestionParamsSchema,\n} from \"./tool/types.js\";\nimport { validateQuestionnaire } from \"./tool/validate-questionnaire.ts\";\nimport type { WrappingSelectItem } from \"./view/components/wrapping-select.ts\";\n\nconst ERROR_NO_UI = \"Error: UI not available (running in non-interactive mode)\";\n// Private first-party route: a workflow owns this waiter even without a human host.\nconst STAGE_QUESTIONNAIRE = Symbol.for(\"atomic-coding-agent/stage-questionnaire@1\");\n\n/**\n * Mount options for the blocking questionnaire (#2378).\n *\n * The dialog used to mount inline, inside the fullscreen dock, where it is a\n * flex sibling of the transcript `ScrollView`. A tall side-by-side dialog then\n * took the transcript's rows: on a 40-row terminal the transcript viewport\n * collapsed from 34 rows to 6, and pi-tui derives its page step from that\n * viewport (`viewportHeight - PAGE_SCROLL_OVERLAP`), so PageUp crawled two\n * lines at a time through a six-line window.\n *\n * A bottom-anchored overlay is composited over the bottom rows instead of being\n * measured into the layout, so the transcript keeps its full viewport height\n * and its full page step. `reserveTranscriptRows` is what makes those rows\n * observable rather than merely addressable: the host bounds this overlay so a\n * transcript strip always survives, and extends the transcript's scroll extent\n * by the rows the overlay still covers, so the newest output can be raised into\n * that strip. No `maxHeight` — the host's bound is tighter, and letting pi-tui\n * slice as well would make the measured overlay height wrong.\n */\nexport const QUESTIONNAIRE_OVERLAY_OPTIONS: OverlayOptions = {\n\tanchor: \"bottom-center\",\n\twidth: \"100%\",\n};\n\nexport function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[] {\n\tconst items: WrappingSelectItem[] = question.options.map((o) => ({\n\t\tkind: \"option\",\n\t\tlabel: o.label,\n\t\tdescription: o.description,\n\t}));\n\tconst hasAnyPreview = question.options.some((o) => typeof o.preview === \"string\" && o.preview.length > 0);\n\tfor (const kind of sentinelsToAppend(question, hasAnyPreview)) {\n\t\titems.push({ kind, label: ROW_INTENT_META[kind].label });\n\t}\n\treturn items;\n}\n\nexport const askUserQuestionToolSystemPromptContribution = Object.freeze({\n\tsnippet: `Ask all user questions through this tool, including clarifications and approvals; up to ${MAX_QUESTIONS} questions with ${MIN_OPTIONS}-${MAX_OPTIONS} options each`,\n\tguidelines: Object.freeze([\n\t\t\"When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including clarifications, preferences, confirmations, approvals, and permission to proceed. Prefer ask_user_question when available. In these sessions, do not end a progress update or final response with a prose-only question such as 'Proceed?'.\",\n\t\t\"Ask only when a decision is needed; do not seek approval again for already-authorized work. For a confirmation, put the concrete action and its scope in the question and offer explicit proceed and decline options. A cancelled or unanswered question is not approval.\",\n\t\t`Each question MUST have ${MIN_OPTIONS}-${MAX_OPTIONS} options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.`,\n\t\t`Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.`,\n\t\t\"Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.\",\n\t\t\"If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\",\n\t] as const),\n} as const);\n\nexport function createAskUserQuestionToolDefinition(options?: {\n\treadonly chatAsOption?: boolean;\n}): ToolDefinition<typeof QuestionParamsSchema, unknown> {\n\tconst guidance = validateGuidanceFields(loadConfig().guidance);\n\treturn {\n\t\tname: \"ask_user_question\",\n\t\texposure: \"model-only\",\n\t\tconcurrency: \"exclusive\",\n\t\tlabel: \"Ask User Question\",\n\t\tdescription: `Ask the user one or more structured questions during execution. When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including a short 'Proceed?' confirmation. Prefer ask_user_question when available. Use when you need to:\n1. Gather user preferences or requirements\n2. Clarify ambiguous instructions\n3. Get decisions on implementation choices as you work\n4. Request confirmation, approval, or permission to proceed\n\nUsage notes:\n- Ask only for decisions that are needed; do not re-request existing authorization. State the exact action and scope, with explicit proceed and decline options for confirmations. A cancelled or unanswered question is not approval.\n- If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\n- Users will always be able to type a custom answer (\"Type something.\" row is appended automatically to every single-select question) or pick \"Chat about this\" to abandon the questionnaire and continue in free-form conversation. Do NOT author \"Other\" / \"Type something.\" / \"Chat about this\" labels yourself — duplicates are rejected at runtime.\n- Use multiSelect: true to allow multiple answers to be selected for a question. The \"Type something.\" row is suppressed on multi-select questions, and is ALSO suppressed on single-select questions where any option carries a \\`preview\\` (the side-by-side layout has no room for inline custom text — \"Chat about this\" remains as the free-form escape hatch).\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label.\n\nPreview feature:\nUse the optional \\`preview\\` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).`,\n\t\tpromptSnippet: guidance.promptSnippet ?? askUserQuestionToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: guidance.promptGuidelines ?? [...askUserQuestionToolSystemPromptContribution.guidelines],\n\t\t...experimentalToolSamplingProperty(),\n\t\tparameters: QuestionParamsSchema,\n\n\t\tasync execute(_toolCallId, params, signal, _onUpdate, ctx) {\n\t\t\tconst typed = params as unknown as QuestionParams;\n\t\t\tconst stageOwned = (\n\t\t\t\tctx.ui as ExtensionUIContext & {\n\t\t\t\t\t[STAGE_QUESTIONNAIRE]?: (sessionId: string, ui: ExtensionUIContext) => void;\n\t\t\t\t}\n\t\t\t)[STAGE_QUESTIONNAIRE];\n\t\t\tif (typeof stageOwned !== \"function\" && !(ctx.hasHumanInput ?? ctx.hasUI))\n\t\t\t\treturn buildToolResult(ERROR_NO_UI, { answers: [], cancelled: true, error: \"no_ui\" });\n\n\t\t\tconst validation = validateQuestionnaire(typed);\n\t\t\tif (!validation.ok) {\n\t\t\t\treturn buildToolResult(validation.message, {\n\t\t\t\t\tanswers: [],\n\t\t\t\t\tcancelled: true,\n\t\t\t\t\terror: validation.error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof stageOwned === \"function\") {\n\t\t\t\tstageOwned(ctx.sessionManager.getSessionId(), ctx.ui);\n\t\t\t\treturn buildQuestionnaireResponse(\n\t\t\t\t\tawait presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption),\n\t\t\t\t\ttyped,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst questionnaire = getHostQuestionnaire(ctx.ui);\n\t\t\tconst result = questionnaire\n\t\t\t\t? await questionnaire(typed, signal, (requestSignal) =>\n\t\t\t\t\t\tpresentQuestionnaire(ctx.ui, typed, requestSignal, options?.chatAsOption),\n\t\t\t\t\t)\n\t\t\t\t: await presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption);\n\t\t\treturn buildQuestionnaireResponse(result, typed);\n\t\t},\n\t};\n}\n\n/** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */\nexport async function presentQuestionnaire(\n\tui: ExtensionUIContext,\n\tparams: QuestionParams,\n\tsignal?: AbortSignal,\n\tchatAsOption?: boolean,\n): Promise<QuestionnaireResult> {\n\tconst itemsByTab = params.questions.map(buildItemsForQuestion);\n\tui.setWorkingVisible?.(false);\n\ttry {\n\t\treturn await ui.custom<QuestionnaireResult>(\n\t\t\t(tui, theme, _kb, done) =>\n\t\t\t\tnew QuestionnaireSession({\n\t\t\t\t\ttui,\n\t\t\t\t\ttheme,\n\t\t\t\t\tparams,\n\t\t\t\t\titemsByTab,\n\t\t\t\t\tdone,\n\t\t\t\t\t...(chatAsOption === true ? { chatAsOption: true } : {}),\n\t\t\t\t}).component,\n\t\t\t{ signal, overlay: true, reserveTranscriptRows: true, overlayOptions: QUESTIONNAIRE_OVERLAY_OPTIONS },\n\t\t);\n\t} finally {\n\t\tui.setWorkingVisible?.(true);\n\t}\n}\n\nexport { buildQuestionnaireResponse, buildToolResult };\n"]}
1
+ {"version":3,"file":"ask-user-question.js","sourceRoot":"","sources":["../../../../src/core/tools/ask-user-question/ask-user-question.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gCAAgC,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC3E,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EACN,WAAW,EACX,aAAa,EACb,WAAW,EAIX,oBAAoB,GACpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAGzE,MAAM,WAAW,GAAG,2DAA2D,CAAC;AAChF,oFAAoF;AACpF,MAAM,mBAAmB,GAAG,MAAM,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;AAEpF;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAmB;IAC5D,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,MAAM;CACb,CAAC;AAEF,MAAM,UAAU,qBAAqB,CAAC,QAAsB;I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AAE,OAAO,EAAE,IAAI,EAAE,qBAAqB,EAAE,IAAI,EAAE,cAAc,EAAE,6BAA6B,EAAE,CACrG,CAAC;IACH,CAAC;YAAS,CAAC;QACV,EAAE,CAAC,iBAAiB,EAAE,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;AACF,CAAC;AAED,OAAO,EAAE,0BAA0B,EAAE,eAAe,EAAE,CAAC","sourcesContent":["import type { OverlayOptions } from \"@earendil-works/pi-tui\";\nimport { experimentalToolSamplingProperty } from \"../../experimental.ts\";\nimport { getHostQuestionnaire } from \"../../extensions/host-input.js\";\nimport type { ToolDefinition } from \"../../extensions/types.ts\";\nimport type { ExtensionUIContext } from \"../../extensions/ui-types.js\";\nimport { loadConfig, validateGuidanceFields } from \"./config.ts\";\nimport { QuestionnaireSession } from \"./state/questionnaire-session.ts\";\nimport { ROW_INTENT_META, sentinelsToAppend } from \"./state/row-intent.ts\";\nimport { buildQuestionnaireResponse, buildToolResult } from \"./tool/response-envelope.ts\";\nimport {\n\tMAX_OPTIONS,\n\tMAX_QUESTIONS,\n\tMIN_OPTIONS,\n\ttype QuestionData,\n\ttype QuestionnaireResult,\n\ttype QuestionParams,\n\tQuestionParamsSchema,\n} from \"./tool/types.js\";\nimport { validateQuestionnaire } from \"./tool/validate-questionnaire.ts\";\nimport type { WrappingSelectItem } from \"./view/components/wrapping-select.ts\";\n\nconst ERROR_NO_UI = \"Error: UI not available (running in non-interactive mode)\";\n// Private first-party route: a workflow owns this waiter even without a human host.\nconst STAGE_QUESTIONNAIRE = Symbol.for(\"atomic-coding-agent/stage-questionnaire@1\");\n\n/**\n * Mount options for the blocking questionnaire (#2378).\n *\n * The dialog used to mount inline, inside the fullscreen dock, where it is a\n * flex sibling of the transcript `ScrollView`. A tall side-by-side dialog then\n * took the transcript's rows: on a 40-row terminal the transcript viewport\n * collapsed from 34 rows to 6, and pi-tui derives its page step from that\n * viewport (`viewportHeight - PAGE_SCROLL_OVERLAP`), so PageUp crawled two\n * lines at a time through a six-line window.\n *\n * A bottom-anchored overlay is composited over the bottom rows instead of being\n * measured into the layout, so the transcript keeps its full viewport height\n * and its full page step. `reserveTranscriptRows` is what makes those rows\n * observable rather than merely addressable: the host bounds this overlay so a\n * transcript strip always survives, and extends the transcript's scroll extent\n * by the rows the overlay still covers, so the newest output can be raised into\n * that strip. No `maxHeight` — the host's bound is tighter, and letting pi-tui\n * slice as well would make the measured overlay height wrong.\n */\nexport const QUESTIONNAIRE_OVERLAY_OPTIONS: OverlayOptions = {\n\tanchor: \"bottom-center\",\n\twidth: \"100%\",\n};\n\nexport function buildItemsForQuestion(question: QuestionData): WrappingSelectItem[] {\n\tconst items: WrappingSelectItem[] = question.options.map((o) => ({\n\t\tkind: \"option\",\n\t\tlabel: o.label,\n\t\tdescription: o.description,\n\t}));\n\tconst hasAnyPreview = question.options.some((o) => typeof o.preview === \"string\" && o.preview.length > 0);\n\tfor (const kind of sentinelsToAppend(question, hasAnyPreview)) {\n\t\titems.push({ kind, label: ROW_INTENT_META[kind].label });\n\t}\n\treturn items;\n}\n\nexport const askUserQuestionToolSystemPromptContribution = Object.freeze({\n\tsnippet: `Ask all user questions through this tool, including clarifications and approvals; up to ${MAX_QUESTIONS} questions with ${MIN_OPTIONS}-${MAX_OPTIONS} options each`,\n\tguidelines: Object.freeze([\n\t\t\"When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including clarifications, preferences, confirmations, approvals, and permission to proceed. Prefer ask_user_question when available. In these sessions, do not end a progress update or final response with a prose-only question such as 'Proceed?'.\",\n\t\t\"Ask only when a decision is needed; do not seek approval again for already-authorized work. For a confirmation, put the concrete action and its scope in the question and offer explicit proceed and decline options. A cancelled or unanswered question is not approval.\",\n\t\t`Each question MUST have ${MIN_OPTIONS}-${MAX_OPTIONS} options. Every option requires a concise label (1-5 words) and a description explaining what the choice means or its trade-offs. The user can additionally type a custom answer (\"Type something.\" row is appended automatically to single-select questions) or pick \"Chat about this\" to abandon the questionnaire.`,\n\t\t`Set multiSelect: true when multiple answers are valid; this suppresses the \"Type something.\" row. Provide an options[].preview markdown string when an option benefits from richer side-by-side context (mockups, code snippets, diagrams, configs) — single-select only. NOTE: any non-empty preview on a single-select question ALSO suppresses the \"Type something.\" row (no room in the side-by-side layout); \"Chat about this\" remains the escape hatch. If you recommend a specific option, make it the first option and append \"(Recommended)\" to its label.`,\n\t\t\"Do not stack multiple ask_user_question calls back-to-back — group all clarifying questions into one invocation.\",\n\t\t\"If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\",\n\t] as const),\n} as const);\n\nexport function createAskUserQuestionToolDefinition(options?: {\n\treadonly chatAsOption?: boolean;\n}): ToolDefinition<typeof QuestionParamsSchema, unknown> {\n\tconst guidance = validateGuidanceFields(loadConfig().guidance);\n\treturn {\n\t\tname: \"ask_user_question\",\n\t\texposure: \"model-only\",\n\t\tconcurrency: \"exclusive\",\n\t\tlabel: \"Ask User Question\",\n\t\tdescription: `Ask the user one or more structured questions during execution. When ask_user_question or an equivalent question tool is available, all questions to the user must use that tool instead of plain text, including a short 'Proceed?' confirmation. Prefer ask_user_question when available. Use when you need to:\n1. Gather user preferences or requirements\n2. Clarify ambiguous instructions\n3. Get decisions on implementation choices as you work\n4. Request confirmation, approval, or permission to proceed\n\nUsage notes:\n- Ask only for decisions that are needed; do not re-request existing authorization. State the exact action and scope, with explicit proceed and decline options for confirmations. A cancelled or unanswered question is not approval.\n- If ask_user_question is unavailable, use an equivalent available question tool with its supported schema. If no usable question tool is available, continue autonomously using best judgment and state evidence-backed assumptions. Tool unavailability alone is not a blocker; preserve safety and authorization constraints.\n- Users will always be able to type a custom answer (\"Type something.\" row is appended automatically to every single-select question) or pick \"Chat about this\" to abandon the questionnaire and continue in free-form conversation. Do NOT author \"Other\" / \"Type something.\" / \"Chat about this\" labels yourself — duplicates are rejected at runtime.\n- Use multiSelect: true to allow multiple answers to be selected for a question. The \"Type something.\" row is suppressed on multi-select questions, and is ALSO suppressed on single-select questions where any option carries a \\`preview\\` (the side-by-side layout has no room for inline custom text — \"Chat about this\" remains as the free-form escape hatch).\n- If you recommend a specific option, make that the first option in the list and add \"(Recommended)\" at the end of the label.\n\nPreview feature:\nUse the optional \\`preview\\` field on options when presenting concrete artifacts that users need to visually compare:\n- ASCII mockups of UI layouts or components\n- Code snippets showing different implementations\n- Diagram variations\n- Configuration examples\n\nPreview content is rendered as markdown in a monospace box. Multi-line text with newlines is supported. When any option has a preview, the UI switches to a side-by-side layout with a vertical option list on the left and preview on the right. Do not use previews for simple preference questions where labels and descriptions suffice. Note: previews are only supported for single-select questions (not multiSelect).`,\n\t\tpromptSnippet: guidance.promptSnippet ?? askUserQuestionToolSystemPromptContribution.snippet,\n\t\tpromptGuidelines: guidance.promptGuidelines ?? [...askUserQuestionToolSystemPromptContribution.guidelines],\n\t\t...experimentalToolSamplingProperty(),\n\t\tparameters: QuestionParamsSchema,\n\n\t\tasync execute(_toolCallId, params, signal, _onUpdate, ctx) {\n\t\t\tconst typed = params as unknown as QuestionParams;\n\t\t\tconst stageOwned = (\n\t\t\t\tctx.ui as ExtensionUIContext & {\n\t\t\t\t\t[STAGE_QUESTIONNAIRE]?: (sessionId: string, ui: ExtensionUIContext) => void;\n\t\t\t\t}\n\t\t\t)[STAGE_QUESTIONNAIRE];\n\t\t\tif (typeof stageOwned !== \"function\" && !(ctx.hasHumanInput ?? ctx.hasUI))\n\t\t\t\treturn buildToolResult(ERROR_NO_UI, { answers: [], cancelled: true, error: \"no_ui\" });\n\n\t\t\tconst validation = validateQuestionnaire(typed);\n\t\t\tif (!validation.ok) {\n\t\t\t\treturn buildToolResult(validation.message, {\n\t\t\t\t\tanswers: [],\n\t\t\t\t\tcancelled: true,\n\t\t\t\t\terror: validation.error,\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tif (typeof stageOwned === \"function\") {\n\t\t\t\tstageOwned(ctx.sessionManager.getSessionId(), ctx.ui);\n\t\t\t\treturn buildQuestionnaireResponse(\n\t\t\t\t\tawait presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption),\n\t\t\t\t\ttyped,\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst questionnaire = getHostQuestionnaire(ctx.ui);\n\t\t\tconst result = questionnaire\n\t\t\t\t? await questionnaire(typed, signal, (requestSignal) =>\n\t\t\t\t\t\tpresentQuestionnaire(ctx.ui, typed, requestSignal, options?.chatAsOption),\n\t\t\t\t\t)\n\t\t\t\t: await presentQuestionnaire(ctx.ui, typed, signal, options?.chatAsOption);\n\t\t\treturn buildQuestionnaireResponse(result, typed);\n\t\t},\n\t};\n}\n\n/** Rendering adapter shared by the CLI bridge and legacy presentation hosts. */\nexport async function presentQuestionnaire(\n\tui: ExtensionUIContext,\n\tparams: QuestionParams,\n\tsignal?: AbortSignal,\n\tchatAsOption?: boolean,\n): Promise<QuestionnaireResult> {\n\tconst hosted = await ui.hostQuestionnaire?.(params, signal);\n\tif (hosted !== undefined) return hosted;\n\tconst itemsByTab = params.questions.map(buildItemsForQuestion);\n\tui.setWorkingVisible?.(false);\n\ttry {\n\t\treturn await ui.custom<QuestionnaireResult>(\n\t\t\t(tui, theme, _kb, done) =>\n\t\t\t\tnew QuestionnaireSession({\n\t\t\t\t\ttui,\n\t\t\t\t\ttheme,\n\t\t\t\t\tparams,\n\t\t\t\t\titemsByTab,\n\t\t\t\t\tdone,\n\t\t\t\t\t...(chatAsOption === true ? { chatAsOption: true } : {}),\n\t\t\t\t}).component,\n\t\t\t{ signal, overlay: true, reserveTranscriptRows: true, overlayOptions: QUESTIONNAIRE_OVERLAY_OPTIONS },\n\t\t);\n\t} finally {\n\t\tui.setWorkingVisible?.(true);\n\t}\n}\n\nexport { buildQuestionnaireResponse, buildToolResult };\n"]}
@@ -89,6 +89,13 @@ export declare abstract class RpcClientApi {
89
89
  setFollowUpMode(mode: "all" | "one-at-a-time"): Promise<void>;
90
90
  compact(): Promise<VerbatimCompactionResult>;
91
91
  setAutoCompaction(enabled: boolean): Promise<void>;
92
+ /**
93
+ * Say what extension UI this client can show. With `questionnaire`, `ask_user_question` arrives as one
94
+ * `extension_ui_request` with method `questionnaire` instead of failing for lack of a terminal.
95
+ */
96
+ setExtensionUiCapabilities(capabilities: {
97
+ questionnaire?: boolean;
98
+ }): Promise<void>;
92
99
  setAutoRetry(enabled: boolean): Promise<void>;
93
100
  abortRetry(): Promise<void>;
94
101
  bash(command: string): Promise<BashResult>;
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-client-api.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client-api.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,KAAK,EACX,iBAAiB,EACjB,sBAAsB,EACtB,qBAAqB,EACrB,YAAY,EACZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EACX,iBAAiB,EACjB,uBAAuB,EACvB,kBAAkB,EAClB,MAAM,+CAA+C,CAAC;AACvD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAC7E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2B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EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,MAAM,GACvB,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAEjC;IACK,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAEzE;IACK,KAAK,IAAI,OAAO,CAAC;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC,CAE7C;IACK,eAAe,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC,CAIzE;IACK,UAAU,CAAC,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,YAAY,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAE5F;IACK,OAAO,IAAI,OAAO,CAAC;QAAE,IAAI,EAAE,eAAe,EAAE,CAAC;QAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CAE3E;IACK,oBAAoB,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAEnD;IACK,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAEhD;IACK,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC,CAE3C;IACK,WAAW,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAE9C;IACK,qBAAqB,CAAC,WAAW,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,EAAE,GAAG,IAAI,CAAC,CAI9G;CACD"}
@@ -135,6 +135,13 @@ export class RpcClientApi {
135
135
  async setAutoCompaction(enabled) {
136
136
  await this.request({ type: "set_auto_compaction", enabled });
137
137
  }
138
+ /**
139
+ * Say what extension UI this client can show. With `questionnaire`, `ask_user_question` arrives as one
140
+ * `extension_ui_request` with method `questionnaire` instead of failing for lack of a terminal.
141
+ */
142
+ async setExtensionUiCapabilities(capabilities) {
143
+ await this.request({ type: "set_extension_ui_capabilities", ...capabilities });
144
+ }
138
145
  async setAutoRetry(enabled) {
139
146
  await this.request({ type: "set_auto_retry", enabled });
140
147
  }
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-client-api.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+CzC,MAAM,OAAgB,YAAY;IAIjC;;;OAGG;IACH,KAAK,CAAC,MAAM,CACX,OAAe,EACf,MAAuB,EACvB,iBAAwC;QAExC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC;QAC5F,OAAO,IAAI,CAAC,IAAI,CAAqC,QAAQ,CAAC,CAAC,WAAW,CAAC;IAC5E,CAAC;IACD,KAAK,CAAC,KAAK,CAAC,OAAe,EAAE,MAAuB;QACnD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,IAAI,CAA0C,QAAQ,CAAC,CAAC,WAAW,CAAC;IACjF,CAAC;IACD,KAAK,CAAC,QAAQ,CAAC,OAAe,EAAE,MAAuB;QACtD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5E,OAAO,IAAI,CAAC,IAAI,CAA0C,QAAQ,CAAC,CAAC,WAAW,CAAC;IACjF,CAAC;IACD,KAAK,CAAC,KAAK;QACV,MAAM,IA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\nimport type { Credential } from \"@bastani/pi-ai\";\nimport type { Api, ImageContent, Model } from \"@bastani/pi-ai/compat\";\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type {\n\tPromptDisposition,\n\tQueuedInputDisposition,\n\tSessionRecoveryReport,\n\tSessionStats,\n} from \"../../core/agent-session.js\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { VerbatimCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SessionRecoveryReason } from \"../../core/extensions/index.js\";\nimport type {\n\tWorkflowRunDetail,\n\tWorkflowRunFilterStatus,\n\tWorkflowRunSummary,\n} from \"../../core/extensions/workflow-run-control.js\";\nimport type { AtomicProviderCompat } from \"../../core/model-capabilities.ts\";\nimport type { SaveCredentialOptions } from \"../../core/model-runtime.js\";\nimport type { SessionEntry, SessionSummaryEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { ToolStatusReport } from \"../../core/tool-status.js\";\nimport type {\n\tRpcAutocompleteItem,\n\tRpcCommand,\n\tRpcLoginProviderResult,\n\tRpcLogoutProviderResult,\n\tRpcModelCatalog,\n\tRpcModelRefreshResult,\n\tRpcResponse,\n\tRpcSessionInfo,\n\tRpcSessionState,\n\tRpcSlashCommand,\n} from \"./rpc-types.ts\";\n\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\nexport type RpcCommandBody = DistributiveOmit<RpcCommand, \"id\">;\n\nexport interface ModelInfo {\n\tprovider: string;\n\tid: string;\n\tcontextWindow: number;\n\treasoning: boolean;\n\t/** Provider/model capability metadata used to gate constrained sampling. */\n\tcompat?: AtomicProviderCompat;\n}\n\nexport abstract class RpcClientApi {\n\tprotected abstract request(command: RpcCommandBody): Promise<RpcResponse>;\n\tprotected abstract data<T>(response: RpcResponse): T;\n\n\t/**\n\t * Send a prompt and return its disposition once accepted.\n\t * If the disposition is \"handled\", no run started for this prompt, so don't wait for agent_settled.\n\t */\n\tasync prompt(\n\t\tmessage: string,\n\t\timages?: ImageContent[],\n\t\tstreamingBehavior?: \"steer\" | \"followUp\",\n\t): Promise<PromptDisposition> {\n\t\tconst response = await this.request({ type: \"prompt\", message, images, streamingBehavior });\n\t\treturn this.data<{ disposition: PromptDisposition }>(response).disposition;\n\t}\n\tasync steer(message: string, images?: ImageContent[]): Promise<QueuedInputDisposition> {\n\t\tconst response = await this.request({ type: \"steer\", message, images });\n\t\treturn this.data<{ disposition: QueuedInputDisposition }>(response).disposition;\n\t}\n\tasync followUp(message: string, images?: ImageContent[]): Promise<QueuedInputDisposition> {\n\t\tconst response = await this.request({ type: \"follow_up\", message, images });\n\t\treturn this.data<{ disposition: QueuedInputDisposition }>(response).disposition;\n\t}\n\tasync abort(): Promise<void> {\n\t\tawait this.request({ type: \"abort\" });\n\t}\n\tasync clearQueue(): Promise<{ steering: string[]; followUp: string[] }> {\n\t\treturn this.data(await this.request({ type: \"clear_queue\" }));\n\t}\n\tasync newSession(parentSession?: string): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"new_session\", parentSession }));\n\t}\n\tasync deleteSession(sessionId: string): Promise<void> {\n\t\tthis.data<void>(await this.request({ type: \"delete_session\", sessionId }));\n\t}\n\tasync getState(): Promise<RpcSessionState> {\n\t\treturn this.data(await this.request({ type: \"get_state\" }));\n\t}\n\tasync getSessionSummary(): Promise<SessionSummaryEntry | null> {\n\t\treturn this.data<{ summary: SessionSummaryEntry | null }>(await this.request({ type: \"get_session_summary\" }))\n\t\t\t.summary;\n\t}\n\tasync listSessions(): Promise<RpcSessionInfo[]> {\n\t\treturn this.data<{ sessions: RpcSessionInfo[] }>(await this.request({ type: \"list_sessions\" })).sessions;\n\t}\n\tasync listWorkflowRuns(status?: WorkflowRunFilterStatus): Promise<readonly WorkflowRunSummary[]> {\n\t\treturn this.data<{ runs: readonly WorkflowRunSummary[] }>(\n\t\t\tawait this.request({ type: \"list_workflow_runs\", status }),\n\t\t).runs;\n\t}\n\tasync getWorkflowRunSummary(runId: string): Promise<WorkflowRunDetail> {\n\t\treturn this.data(await this.request({ type: \"get_workflow_run_summary\", runId }));\n\t}\n\tasync setModel(\n\t\tprovider: string,\n\t\tmodelId: string,\n\t\toptions?: { persist?: boolean },\n\t): Promise<{ provider: string; id: string }> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"set_model\",\n\t\t\t\tprovider,\n\t\t\t\tmodelId,\n\t\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t\t}),\n\t\t);\n\t}\n\tasync cycleModel(\n\t\tdirection?: \"forward\" | \"backward\",\n\t\toptions?: { persist?: boolean },\n\t): Promise<{\n\t\tmodel: Model<Api>;\n\t\tthinkingLevel: ThinkingLevel;\n\t\tisScoped: boolean;\n\t} | null> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"cycle_model\",\n\t\t\t\tdirection,\n\t\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t\t}),\n\t\t);\n\t}\n\tasync getAvailableModels(): Promise<ModelInfo[]> {\n\t\treturn this.data<{ models: ModelInfo[] }>(await this.request({ type: \"get_available_models\" })).models;\n\t}\n\tasync loginProvider(provider: string, signal?: AbortSignal): Promise<RpcLoginProviderResult> {\n\t\tconst loginId = randomUUID();\n\t\tif (signal?.aborted) return { provider, cancelled: true };\n\t\tconst cancel = () => {\n\t\t\tvoid this.cancelLoginProvider(provider, loginId).catch(() => {});\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", cancel, { once: true });\n\t\ttry {\n\t\t\treturn this.data(await this.request({ type: \"login_provider\", provider, loginId }));\n\t\t} finally {\n\t\t\tsignal?.removeEventListener(\"abort\", cancel);\n\t\t}\n\t}\n\tasync saveProviderCredential(\n\t\tprovider: string,\n\t\tcredential: Credential,\n\t\toptions: SaveCredentialOptions = {},\n\t): Promise<RpcModelCatalog> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"save_provider_credential\",\n\t\t\t\tprovider,\n\t\t\t\tcredential,\n\t\t\t\trefreshCatalog: options.refreshCatalog,\n\t\t\t}),\n\t\t);\n\t}\n\tasync cancelLoginProvider(provider: string, loginId?: string): Promise<void> {\n\t\tawait this.request({ type: \"cancel_login_provider\", provider, loginId });\n\t}\n\tasync logoutProvider(provider: string): Promise<RpcLogoutProviderResult> {\n\t\treturn this.data(await this.request({ type: \"logout_provider\", provider }));\n\t}\n\n\tasync refreshModels(\n\t\toptions: { timeoutMs?: number; force?: boolean; allowNetwork?: boolean } = {},\n\t): Promise<RpcModelRefreshResult> {\n\t\treturn this.data(await this.request({ type: \"refresh_models\", ...options }));\n\t}\n\tasync setThinkingLevel(level: ThinkingLevel): Promise<void> {\n\t\tawait this.request({ type: \"set_thinking_level\", level });\n\t}\n\t/**\n\t * Isolated persist path: forwards `persist` and returns the engine's effective\n\t * level plus the provider/model the engine persisted against. Public callers\n\t * must keep using one-argument {@link setThinkingLevel}.\n\t */\n\tasync setThinkingLevelAck(\n\t\tlevel: ThinkingLevel,\n\t\toptions?: { persist?: boolean },\n\t): Promise<{ level: ThinkingLevel; provider?: string; modelId?: string }> {\n\t\tconst response = await this.request({\n\t\t\ttype: \"set_thinking_level\",\n\t\t\tlevel,\n\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t});\n\t\tif (!response.success) {\n\t\t\treturn this.data(response);\n\t\t}\n\t\tif (response.command === \"set_thinking_level\" && \"data\" in response && response.data) {\n\t\t\treturn response.data;\n\t\t}\n\t\treturn { level };\n\t}\n\tasync cycleThinkingLevel(): Promise<{ level: ThinkingLevel } | null> {\n\t\treturn this.data(await this.request({ type: \"cycle_thinking_level\" }));\n\t}\n\tasync getAvailableThinkingLevels(): Promise<ThinkingLevel[]> {\n\t\treturn this.data<{ levels: ThinkingLevel[] }>(await this.request({ type: \"get_available_thinking_levels\" }))\n\t\t\t.levels;\n\t}\n\tasync setSteeringMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.request({ type: \"set_steering_mode\", mode });\n\t}\n\tasync setFollowUpMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.request({ type: \"set_follow_up_mode\", mode });\n\t}\n\tasync compact(): Promise<VerbatimCompactionResult> {\n\t\treturn this.data(await this.request({ type: \"compact\" }));\n\t}\n\tasync setAutoCompaction(enabled: boolean): Promise<void> {\n\t\tawait this.request({ type: \"set_auto_compaction\", enabled });\n\t}\n\tasync setAutoRetry(enabled: boolean): Promise<void> {\n\t\tawait this.request({ type: \"set_auto_retry\", enabled });\n\t}\n\tasync abortRetry(): Promise<void> {\n\t\tawait this.request({ type: \"abort_retry\" });\n\t}\n\tasync bash(command: string): Promise<BashResult> {\n\t\treturn this.data(await this.request({ type: \"bash\", command }));\n\t}\n\tasync abortBash(requestId?: string): Promise<void> {\n\t\tawait this.request({ type: \"abort_bash\", requestId });\n\t}\n\t/** Recover work an earlier process left unfinished; call once the transcript is shown. */\n\tasync startPendingRecovery(reason?: SessionRecoveryReason): Promise<SessionRecoveryReport> {\n\t\treturn this.data(await this.request({ type: \"start_pending_recovery\", reason }));\n\t}\n\tasync getSessionStats(): Promise<SessionStats> {\n\t\treturn this.data(await this.request({ type: \"get_session_stats\" }));\n\t}\n\t/** Which tools are active, which are not (and why), and which selected names nothing registered. */\n\tasync getTools(): Promise<ToolStatusReport> {\n\t\treturn this.data(await this.request({ type: \"get_tools\" }));\n\t}\n\tasync exportHtml(outputPath?: string): Promise<{ path: string }> {\n\t\treturn this.data(await this.request({ type: \"export_html\", outputPath }));\n\t}\n\tasync switchSession(\n\t\tsessionId: string,\n\t\tcwdOverride?: string,\n\t\tsessionDirectory?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"switch_session\", sessionId, cwdOverride, sessionDirectory }));\n\t}\n\tasync fork(entryId: string): Promise<{ text: string; cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"fork\", entryId }));\n\t}\n\tasync clone(): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"clone\" }));\n\t}\n\tasync getForkMessages(): Promise<Array<{ entryId: string; text: string }>> {\n\t\treturn this.data<{ messages: Array<{ entryId: string; text: string }> }>(\n\t\t\tawait this.request({ type: \"get_fork_messages\" }),\n\t\t).messages;\n\t}\n\tasync getEntries(since?: string): Promise<{ entries: SessionEntry[]; leafId: string | null }> {\n\t\treturn this.data(await this.request({ type: \"get_entries\", since }));\n\t}\n\tasync getTree(): Promise<{ tree: SessionTreeNode[]; leafId: string | null }> {\n\t\treturn this.data(await this.request({ type: \"get_tree\" }));\n\t}\n\tasync getLastAssistantText(): Promise<string | null> {\n\t\treturn this.data<{ text: string | null }>(await this.request({ type: \"get_last_assistant_text\" })).text;\n\t}\n\tasync setSessionName(name: string): Promise<void> {\n\t\tawait this.request({ type: \"set_session_name\", name });\n\t}\n\tasync getMessages(): Promise<AgentMessage[]> {\n\t\treturn this.data<{ messages: AgentMessage[] }>(await this.request({ type: \"get_messages\" })).messages;\n\t}\n\tasync getCommands(): Promise<RpcSlashCommand[]> {\n\t\treturn this.data<{ commands: RpcSlashCommand[] }>(await this.request({ type: \"get_commands\" })).commands;\n\t}\n\tasync getCommandCompletions(commandName: string, argumentPrefix: string): Promise<RpcAutocompleteItem[] | null> {\n\t\treturn this.data<{ completions: RpcAutocompleteItem[] | null }>(\n\t\t\tawait this.request({ type: \"get_command_completions\", commandName, argumentPrefix }),\n\t\t).completions;\n\t}\n}\n"]}
1
+ {"version":3,"file":"rpc-client-api.js","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-client-api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+CzC,MAAM,OAAgB,YAAY;IAIjC;;;OAGG;IACH,KAAK,CAAC,MAAM,CACX,OAAe,EACf,MAAuB,EACvB,iBAAwC;QAExC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO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CAA0B,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACzG,CAAC;IACD,KAAK,CAAC,cAAc,CAAC,IAAY;QAChC,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,CAAC,CAAC;IACxD,CAAC;IACD,KAAK,CAAC,WAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAA+B,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IACvG,CAAC;IACD,KAAK,CAAC,WAAW;QAChB,OAAO,IAAI,CAAC,IAAI,CAAkC,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC;IAC1G,CAAC;IACD,KAAK,CAAC,qBAAqB,CAAC,WAAmB,EAAE,cAAsB;QACtE,OAAO,IAAI,CAAC,IAAI,CACf,MAAM,IAAI,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,yBAAyB,EAAE,WAAW,EAAE,cAAc,EAAE,CAAC,CACpF,CAAC,WAAW,CAAC;IACf,CAAC;CACD","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { Credential } from \"@bastani/pi-ai\";\nimport type { Api, ImageContent, Model } from \"@bastani/pi-ai/compat\";\nimport type { AgentMessage, ThinkingLevel } from \"@earendil-works/pi-agent-core\";\nimport type {\n\tPromptDisposition,\n\tQueuedInputDisposition,\n\tSessionRecoveryReport,\n\tSessionStats,\n} from \"../../core/agent-session.js\";\nimport type { BashResult } from \"../../core/bash-executor.ts\";\nimport type { VerbatimCompactionResult } from \"../../core/compaction/index.ts\";\nimport type { SessionRecoveryReason } from \"../../core/extensions/index.js\";\nimport type {\n\tWorkflowRunDetail,\n\tWorkflowRunFilterStatus,\n\tWorkflowRunSummary,\n} from \"../../core/extensions/workflow-run-control.js\";\nimport type { AtomicProviderCompat } from \"../../core/model-capabilities.ts\";\nimport type { SaveCredentialOptions } from \"../../core/model-runtime.js\";\nimport type { SessionEntry, SessionSummaryEntry, SessionTreeNode } from \"../../core/session-manager.ts\";\nimport type { ToolStatusReport } from \"../../core/tool-status.js\";\nimport type {\n\tRpcAutocompleteItem,\n\tRpcCommand,\n\tRpcLoginProviderResult,\n\tRpcLogoutProviderResult,\n\tRpcModelCatalog,\n\tRpcModelRefreshResult,\n\tRpcResponse,\n\tRpcSessionInfo,\n\tRpcSessionState,\n\tRpcSlashCommand,\n} from \"./rpc-types.ts\";\n\ntype DistributiveOmit<T, K extends keyof T> = T extends unknown ? Omit<T, K> : never;\nexport type RpcCommandBody = DistributiveOmit<RpcCommand, \"id\">;\n\nexport interface ModelInfo {\n\tprovider: string;\n\tid: string;\n\tcontextWindow: number;\n\treasoning: boolean;\n\t/** Provider/model capability metadata used to gate constrained sampling. */\n\tcompat?: AtomicProviderCompat;\n}\n\nexport abstract class RpcClientApi {\n\tprotected abstract request(command: RpcCommandBody): Promise<RpcResponse>;\n\tprotected abstract data<T>(response: RpcResponse): T;\n\n\t/**\n\t * Send a prompt and return its disposition once accepted.\n\t * If the disposition is \"handled\", no run started for this prompt, so don't wait for agent_settled.\n\t */\n\tasync prompt(\n\t\tmessage: string,\n\t\timages?: ImageContent[],\n\t\tstreamingBehavior?: \"steer\" | \"followUp\",\n\t): Promise<PromptDisposition> {\n\t\tconst response = await this.request({ type: \"prompt\", message, images, streamingBehavior });\n\t\treturn this.data<{ disposition: PromptDisposition }>(response).disposition;\n\t}\n\tasync steer(message: string, images?: ImageContent[]): Promise<QueuedInputDisposition> {\n\t\tconst response = await this.request({ type: \"steer\", message, images });\n\t\treturn this.data<{ disposition: QueuedInputDisposition }>(response).disposition;\n\t}\n\tasync followUp(message: string, images?: ImageContent[]): Promise<QueuedInputDisposition> {\n\t\tconst response = await this.request({ type: \"follow_up\", message, images });\n\t\treturn this.data<{ disposition: QueuedInputDisposition }>(response).disposition;\n\t}\n\tasync abort(): Promise<void> {\n\t\tawait this.request({ type: \"abort\" });\n\t}\n\tasync clearQueue(): Promise<{ steering: string[]; followUp: string[] }> {\n\t\treturn this.data(await this.request({ type: \"clear_queue\" }));\n\t}\n\tasync newSession(parentSession?: string): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"new_session\", parentSession }));\n\t}\n\tasync deleteSession(sessionId: string): Promise<void> {\n\t\tthis.data<void>(await this.request({ type: \"delete_session\", sessionId }));\n\t}\n\tasync getState(): Promise<RpcSessionState> {\n\t\treturn this.data(await this.request({ type: \"get_state\" }));\n\t}\n\tasync getSessionSummary(): Promise<SessionSummaryEntry | null> {\n\t\treturn this.data<{ summary: SessionSummaryEntry | null }>(await this.request({ type: \"get_session_summary\" }))\n\t\t\t.summary;\n\t}\n\tasync listSessions(): Promise<RpcSessionInfo[]> {\n\t\treturn this.data<{ sessions: RpcSessionInfo[] }>(await this.request({ type: \"list_sessions\" })).sessions;\n\t}\n\tasync listWorkflowRuns(status?: WorkflowRunFilterStatus): Promise<readonly WorkflowRunSummary[]> {\n\t\treturn this.data<{ runs: readonly WorkflowRunSummary[] }>(\n\t\t\tawait this.request({ type: \"list_workflow_runs\", status }),\n\t\t).runs;\n\t}\n\tasync getWorkflowRunSummary(runId: string): Promise<WorkflowRunDetail> {\n\t\treturn this.data(await this.request({ type: \"get_workflow_run_summary\", runId }));\n\t}\n\tasync setModel(\n\t\tprovider: string,\n\t\tmodelId: string,\n\t\toptions?: { persist?: boolean },\n\t): Promise<{ provider: string; id: string }> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"set_model\",\n\t\t\t\tprovider,\n\t\t\t\tmodelId,\n\t\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t\t}),\n\t\t);\n\t}\n\tasync cycleModel(\n\t\tdirection?: \"forward\" | \"backward\",\n\t\toptions?: { persist?: boolean },\n\t): Promise<{\n\t\tmodel: Model<Api>;\n\t\tthinkingLevel: ThinkingLevel;\n\t\tisScoped: boolean;\n\t} | null> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"cycle_model\",\n\t\t\t\tdirection,\n\t\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t\t}),\n\t\t);\n\t}\n\tasync getAvailableModels(): Promise<ModelInfo[]> {\n\t\treturn this.data<{ models: ModelInfo[] }>(await this.request({ type: \"get_available_models\" })).models;\n\t}\n\tasync loginProvider(provider: string, signal?: AbortSignal): Promise<RpcLoginProviderResult> {\n\t\tconst loginId = randomUUID();\n\t\tif (signal?.aborted) return { provider, cancelled: true };\n\t\tconst cancel = () => {\n\t\t\tvoid this.cancelLoginProvider(provider, loginId).catch(() => {});\n\t\t};\n\t\tsignal?.addEventListener(\"abort\", cancel, { once: true });\n\t\ttry {\n\t\t\treturn this.data(await this.request({ type: \"login_provider\", provider, loginId }));\n\t\t} finally {\n\t\t\tsignal?.removeEventListener(\"abort\", cancel);\n\t\t}\n\t}\n\tasync saveProviderCredential(\n\t\tprovider: string,\n\t\tcredential: Credential,\n\t\toptions: SaveCredentialOptions = {},\n\t): Promise<RpcModelCatalog> {\n\t\treturn this.data(\n\t\t\tawait this.request({\n\t\t\t\ttype: \"save_provider_credential\",\n\t\t\t\tprovider,\n\t\t\t\tcredential,\n\t\t\t\trefreshCatalog: options.refreshCatalog,\n\t\t\t}),\n\t\t);\n\t}\n\tasync cancelLoginProvider(provider: string, loginId?: string): Promise<void> {\n\t\tawait this.request({ type: \"cancel_login_provider\", provider, loginId });\n\t}\n\tasync logoutProvider(provider: string): Promise<RpcLogoutProviderResult> {\n\t\treturn this.data(await this.request({ type: \"logout_provider\", provider }));\n\t}\n\n\tasync refreshModels(\n\t\toptions: { timeoutMs?: number; force?: boolean; allowNetwork?: boolean } = {},\n\t): Promise<RpcModelRefreshResult> {\n\t\treturn this.data(await this.request({ type: \"refresh_models\", ...options }));\n\t}\n\tasync setThinkingLevel(level: ThinkingLevel): Promise<void> {\n\t\tawait this.request({ type: \"set_thinking_level\", level });\n\t}\n\t/**\n\t * Isolated persist path: forwards `persist` and returns the engine's effective\n\t * level plus the provider/model the engine persisted against. Public callers\n\t * must keep using one-argument {@link setThinkingLevel}.\n\t */\n\tasync setThinkingLevelAck(\n\t\tlevel: ThinkingLevel,\n\t\toptions?: { persist?: boolean },\n\t): Promise<{ level: ThinkingLevel; provider?: string; modelId?: string }> {\n\t\tconst response = await this.request({\n\t\t\ttype: \"set_thinking_level\",\n\t\t\tlevel,\n\t\t\t...(options?.persist === true ? { persist: true } : {}),\n\t\t});\n\t\tif (!response.success) {\n\t\t\treturn this.data(response);\n\t\t}\n\t\tif (response.command === \"set_thinking_level\" && \"data\" in response && response.data) {\n\t\t\treturn response.data;\n\t\t}\n\t\treturn { level };\n\t}\n\tasync cycleThinkingLevel(): Promise<{ level: ThinkingLevel } | null> {\n\t\treturn this.data(await this.request({ type: \"cycle_thinking_level\" }));\n\t}\n\tasync getAvailableThinkingLevels(): Promise<ThinkingLevel[]> {\n\t\treturn this.data<{ levels: ThinkingLevel[] }>(await this.request({ type: \"get_available_thinking_levels\" }))\n\t\t\t.levels;\n\t}\n\tasync setSteeringMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.request({ type: \"set_steering_mode\", mode });\n\t}\n\tasync setFollowUpMode(mode: \"all\" | \"one-at-a-time\"): Promise<void> {\n\t\tawait this.request({ type: \"set_follow_up_mode\", mode });\n\t}\n\tasync compact(): Promise<VerbatimCompactionResult> {\n\t\treturn this.data(await this.request({ type: \"compact\" }));\n\t}\n\tasync setAutoCompaction(enabled: boolean): Promise<void> {\n\t\tawait this.request({ type: \"set_auto_compaction\", enabled });\n\t}\n\t/**\n\t * Say what extension UI this client can show. With `questionnaire`, `ask_user_question` arrives as one\n\t * `extension_ui_request` with method `questionnaire` instead of failing for lack of a terminal.\n\t */\n\tasync setExtensionUiCapabilities(capabilities: { questionnaire?: boolean }): Promise<void> {\n\t\tawait this.request({ type: \"set_extension_ui_capabilities\", ...capabilities });\n\t}\n\tasync setAutoRetry(enabled: boolean): Promise<void> {\n\t\tawait this.request({ type: \"set_auto_retry\", enabled });\n\t}\n\tasync abortRetry(): Promise<void> {\n\t\tawait this.request({ type: \"abort_retry\" });\n\t}\n\tasync bash(command: string): Promise<BashResult> {\n\t\treturn this.data(await this.request({ type: \"bash\", command }));\n\t}\n\tasync abortBash(requestId?: string): Promise<void> {\n\t\tawait this.request({ type: \"abort_bash\", requestId });\n\t}\n\t/** Recover work an earlier process left unfinished; call once the transcript is shown. */\n\tasync startPendingRecovery(reason?: SessionRecoveryReason): Promise<SessionRecoveryReport> {\n\t\treturn this.data(await this.request({ type: \"start_pending_recovery\", reason }));\n\t}\n\tasync getSessionStats(): Promise<SessionStats> {\n\t\treturn this.data(await this.request({ type: \"get_session_stats\" }));\n\t}\n\t/** Which tools are active, which are not (and why), and which selected names nothing registered. */\n\tasync getTools(): Promise<ToolStatusReport> {\n\t\treturn this.data(await this.request({ type: \"get_tools\" }));\n\t}\n\tasync exportHtml(outputPath?: string): Promise<{ path: string }> {\n\t\treturn this.data(await this.request({ type: \"export_html\", outputPath }));\n\t}\n\tasync switchSession(\n\t\tsessionId: string,\n\t\tcwdOverride?: string,\n\t\tsessionDirectory?: string,\n\t): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"switch_session\", sessionId, cwdOverride, sessionDirectory }));\n\t}\n\tasync fork(entryId: string): Promise<{ text: string; cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"fork\", entryId }));\n\t}\n\tasync clone(): Promise<{ cancelled: boolean }> {\n\t\treturn this.data(await this.request({ type: \"clone\" }));\n\t}\n\tasync getForkMessages(): Promise<Array<{ entryId: string; text: string }>> {\n\t\treturn this.data<{ messages: Array<{ entryId: string; text: string }> }>(\n\t\t\tawait this.request({ type: \"get_fork_messages\" }),\n\t\t).messages;\n\t}\n\tasync getEntries(since?: string): Promise<{ entries: SessionEntry[]; leafId: string | null }> {\n\t\treturn this.data(await this.request({ type: \"get_entries\", since }));\n\t}\n\tasync getTree(): Promise<{ tree: SessionTreeNode[]; leafId: string | null }> {\n\t\treturn this.data(await this.request({ type: \"get_tree\" }));\n\t}\n\tasync getLastAssistantText(): Promise<string | null> {\n\t\treturn this.data<{ text: string | null }>(await this.request({ type: \"get_last_assistant_text\" })).text;\n\t}\n\tasync setSessionName(name: string): Promise<void> {\n\t\tawait this.request({ type: \"set_session_name\", name });\n\t}\n\tasync getMessages(): Promise<AgentMessage[]> {\n\t\treturn this.data<{ messages: AgentMessage[] }>(await this.request({ type: \"get_messages\" })).messages;\n\t}\n\tasync getCommands(): Promise<RpcSlashCommand[]> {\n\t\treturn this.data<{ commands: RpcSlashCommand[] }>(await this.request({ type: \"get_commands\" })).commands;\n\t}\n\tasync getCommandCompletions(commandName: string, argumentPrefix: string): Promise<RpcAutocompleteItem[] | null> {\n\t\treturn this.data<{ completions: RpcAutocompleteItem[] | null }>(\n\t\t\tawait this.request({ type: \"get_command_completions\", commandName, argumentPrefix }),\n\t\t).completions;\n\t}\n}\n"]}
@@ -2,7 +2,7 @@ import type { AgentSession } from "../../core/agent-session.js";
2
2
  import type { AgentSessionRuntime } from "../../core/agent-session-runtime.ts";
3
3
  import type { ExtensionUIContext } from "../../core/extensions/index.js";
4
4
  import { KeybindingsManager } from "../../core/keybindings.ts";
5
- import type { RpcPendingExtensionRequests } from "./rpc-extension-ui.ts";
5
+ import type { RpcExtensionUICapabilities, RpcPendingExtensionRequests } from "./rpc-extension-ui.ts";
6
6
  import type { KeybindingsReloadCoordinator } from "./rpc-keybindings-reload.ts";
7
7
  import { type ProviderLoginInput } from "./rpc-provider-auth.ts";
8
8
  import { type RpcOutput } from "./rpc-responses.ts";
@@ -21,10 +21,11 @@ interface RpcCommandHandlerOptions {
21
21
  reloadCoordinator?: KeybindingsReloadCoordinator<AgentSession>;
22
22
  inputForm?: ProviderLoginInput;
23
23
  pendingExtensionRequests?: RpcPendingExtensionRequests;
24
+ extensionUICapabilities?: RpcExtensionUICapabilities;
24
25
  waitForResources?: () => Promise<void> | undefined;
25
26
  reloadResources?: () => Promise<void>;
26
27
  shouldRetryResources?: () => boolean;
27
28
  }
28
- export declare function createRpcCommandHandler({ runtimeHost, getSession, rebindSession, output, keybindings, taskInspectorUi, reloadCoordinator, inputForm, pendingExtensionRequests, waitForResources, reloadResources, shouldRetryResources, }: RpcCommandHandlerOptions): ManagedRpcCommandHandler;
29
+ export declare function createRpcCommandHandler({ runtimeHost, getSession, rebindSession, output, keybindings, taskInspectorUi, reloadCoordinator, inputForm, pendingExtensionRequests, extensionUICapabilities, waitForResources, reloadResources, shouldRetryResources, }: RpcCommandHandlerOptions): ManagedRpcCommandHandler;
29
30
  export {};
30
31
  //# sourceMappingURL=rpc-command-handler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"rpc-command-handler.d.ts","sourceRoot":"","sources":["../../../src/modes/rpc/rpc-command-handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAE/E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAI/D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAC;AAGhF,OAAO,EAAE,KAAK,kBAAkB,EAAmB,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAIN,KAAK,SAAS,EACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAoC,MAAM,gBAAgB,CAAC;AAGhG,MAAM,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,UAAU,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C,EAAE,MAAM,OAAO,CAAC;CACrC;AA2BD,wBAAgB,uBAAuB,CAAC,EACvC,WAAW,EACX,UAAU,EACV,aAAa,EACb,MAAM,EACN,WAAW,EACX,eAAe,EACf,iBAAiB,EACjB,SAAS,EACT,wBAAwB,EACxB,uBAAuB,EACvB,gBAAgB,EAChB,eAAe,EACf,oBAAoB,GACpB,EAAE,wBAAwB,GAAG,wBAAwB,CAwiBrD"}
@@ -22,6 +22,7 @@ function canRunBeforeOptionalResources(command) {
22
22
  case "resume_queued_messages":
23
23
  case "set_auto_compaction":
24
24
  case "set_auto_retry":
25
+ case "set_extension_ui_capabilities":
25
26
  case "set_follow_up_mode":
26
27
  case "set_steering_mode":
27
28
  return true;
@@ -31,7 +32,7 @@ function canRunBeforeOptionalResources(command) {
31
32
  return false;
32
33
  }
33
34
  }
34
- export function createRpcCommandHandler({ runtimeHost, getSession, rebindSession, output, keybindings, taskInspectorUi, reloadCoordinator, inputForm, pendingExtensionRequests, waitForResources, reloadResources, shouldRetryResources, }) {
35
+ export function createRpcCommandHandler({ runtimeHost, getSession, rebindSession, output, keybindings, taskInspectorUi, reloadCoordinator, inputForm, pendingExtensionRequests, extensionUICapabilities, waitForResources, reloadResources, shouldRetryResources, }) {
35
36
  let fallbackShortcutKeybindings;
36
37
  const providerAuth = new RpcProviderAuth(inputForm, {
37
38
  output,
@@ -270,6 +271,10 @@ export function createRpcCommandHandler({ runtimeHost, getSession, rebindSession
270
271
  case "abort_compaction":
271
272
  session.abortCompaction();
272
273
  return createRpcSuccessResponse(id, "abort_compaction");
274
+ case "set_extension_ui_capabilities":
275
+ if (extensionUICapabilities && command.questionnaire !== undefined)
276
+ extensionUICapabilities.questionnaire = command.questionnaire === true;
277
+ return createRpcSuccessResponse(id, "set_extension_ui_capabilities");
273
278
  case "set_auto_retry":
274
279
  session.setAutoRetryEnabled(command.enabled);
275
280
  return createRpcSuccessResponse(id, "set_auto_retry");