@bastani/atomic 0.9.26-alpha.4 → 0.9.26-alpha.6

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 (127) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/builtin/intercom/package.json +2 -2
  3. package/dist/builtin/mcp/package.json +1 -1
  4. package/dist/builtin/subagents/package.json +3 -3
  5. package/dist/builtin/web-access/package.json +2 -2
  6. package/dist/builtin/workflows/CHANGELOG.md +17 -0
  7. package/dist/builtin/workflows/builtin/{chunk-73p2cm5s.js → chunk-9bhs02gm.js} +318 -52
  8. package/dist/builtin/workflows/builtin/{chunk-n95myjcg.js → chunk-gts8wgjr.js} +1 -1
  9. package/dist/builtin/workflows/builtin/{chunk-ycvg8y8k.js → chunk-gw7rghda.js} +1 -1
  10. package/dist/builtin/workflows/builtin/goal.js +2 -2
  11. package/dist/builtin/workflows/builtin/index.js +3 -3
  12. package/dist/builtin/workflows/builtin/ralph.js +2 -2
  13. package/dist/builtin/workflows/package.json +2 -2
  14. package/dist/builtin/workflows/src/extension/index.bundle.mjs +1383 -266
  15. package/dist/builtin/workflows/src/index.js +1129 -234
  16. package/dist/core/agent-session-export.js +1 -1
  17. package/dist/core/agent-session-export.js.map +1 -1
  18. package/dist/core/export-html/tool-renderer.d.ts +3 -3
  19. package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
  20. package/dist/core/export-html/tool-renderer.js +3 -3
  21. package/dist/core/export-html/tool-renderer.js.map +1 -1
  22. package/dist/core/extensions/api-types.d.ts +3 -1
  23. package/dist/core/extensions/api-types.d.ts.map +1 -1
  24. package/dist/core/extensions/api-types.js.map +1 -1
  25. package/dist/core/extensions/index.d.ts +1 -1
  26. package/dist/core/extensions/index.d.ts.map +1 -1
  27. package/dist/core/extensions/index.js.map +1 -1
  28. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  29. package/dist/core/extensions/loader-api.js +5 -0
  30. package/dist/core/extensions/loader-api.js.map +1 -1
  31. package/dist/core/extensions/loader-bindings.d.ts +1 -1
  32. package/dist/core/extensions/loader-bindings.d.ts.map +1 -1
  33. package/dist/core/extensions/loader-bindings.js +1 -0
  34. package/dist/core/extensions/loader-bindings.js.map +1 -1
  35. package/dist/core/extensions/runner.d.ts +3 -1
  36. package/dist/core/extensions/runner.d.ts.map +1 -1
  37. package/dist/core/extensions/runner.js +6 -0
  38. package/dist/core/extensions/runner.js.map +1 -1
  39. package/dist/core/extensions/runtime-types.d.ts +2 -1
  40. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  41. package/dist/core/extensions/runtime-types.js.map +1 -1
  42. package/dist/core/extensions/tool-types.d.ts +3 -0
  43. package/dist/core/extensions/tool-types.d.ts.map +1 -1
  44. package/dist/core/extensions/tool-types.js.map +1 -1
  45. package/dist/core/extensions/ui-types.d.ts +2 -2
  46. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  47. package/dist/core/extensions/ui-types.js.map +1 -1
  48. package/dist/core/extensions/workflow-run-control.d.ts +3 -0
  49. package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
  50. package/dist/core/extensions/workflow-run-control.js.map +1 -1
  51. package/dist/core/fast-model-routing.d.ts.map +1 -1
  52. package/dist/core/fast-model-routing.js +1 -5
  53. package/dist/core/fast-model-routing.js.map +1 -1
  54. package/dist/core/model-config.d.ts +36 -0
  55. package/dist/core/model-config.d.ts.map +1 -1
  56. package/dist/core/model-config.js +14 -2
  57. package/dist/core/model-config.js.map +1 -1
  58. package/dist/core/model-resolver-defaults.js +1 -1
  59. package/dist/core/model-resolver-defaults.js.map +1 -1
  60. package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
  61. package/dist/core/package-manager-auto-resources.js +6 -2
  62. package/dist/core/package-manager-auto-resources.js.map +1 -1
  63. package/dist/core/package-manager-resolver.d.ts.map +1 -1
  64. package/dist/core/package-manager-resolver.js +4 -2
  65. package/dist/core/package-manager-resolver.js.map +1 -1
  66. package/dist/core/provider-composer-internal.d.ts +2 -1
  67. package/dist/core/provider-composer-internal.d.ts.map +1 -1
  68. package/dist/core/provider-composer-internal.js +13 -0
  69. package/dist/core/provider-composer-internal.js.map +1 -1
  70. package/dist/core/settings-manager-resource-accessors.js +7 -3
  71. package/dist/core/settings-manager-resource-accessors.js.map +1 -1
  72. package/dist/core/settings-merge.d.ts.map +1 -1
  73. package/dist/core/settings-merge.js +10 -0
  74. package/dist/core/settings-merge.js.map +1 -1
  75. package/dist/core/settings-types.d.ts +7 -1
  76. package/dist/core/settings-types.d.ts.map +1 -1
  77. package/dist/core/settings-types.js.map +1 -1
  78. package/dist/extensions/mcp/index.d.ts.map +1 -1
  79. package/dist/extensions/mcp/index.js +20 -1
  80. package/dist/extensions/mcp/index.js.map +1 -1
  81. package/dist/extensions/mcp/tools.d.ts +3 -1
  82. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  83. package/dist/extensions/mcp/tools.js +19 -13
  84. package/dist/extensions/mcp/tools.js.map +1 -1
  85. package/dist/index.d.ts +2 -2
  86. package/dist/index.d.ts.map +1 -1
  87. package/dist/index.js.map +1 -1
  88. package/dist/modes/interactive/components/chat-message-renderer.d.ts +2 -3
  89. package/dist/modes/interactive/components/chat-message-renderer.d.ts.map +1 -1
  90. package/dist/modes/interactive/components/chat-message-renderer.js.map +1 -1
  91. package/dist/modes/interactive/components/config-selector-list.d.ts.map +1 -1
  92. package/dist/modes/interactive/components/config-selector-list.js +3 -1
  93. package/dist/modes/interactive/components/config-selector-list.js.map +1 -1
  94. package/dist/modes/interactive/components/config-selector-project-scope.d.ts.map +1 -1
  95. package/dist/modes/interactive/components/config-selector-project-scope.js +2 -1
  96. package/dist/modes/interactive/components/config-selector-project-scope.js.map +1 -1
  97. package/dist/modes/interactive/components/tool-execution.d.ts +2 -5
  98. package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
  99. package/dist/modes/interactive/components/tool-execution.js +14 -40
  100. package/dist/modes/interactive/components/tool-execution.js.map +1 -1
  101. package/dist/modes/interactive/interactive-mode-surface.d.ts +3 -3
  102. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  103. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  104. package/dist/modes/interactive/interactive-session-runtime.js +6 -1
  105. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  106. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  107. package/dist/modes/interactive/interactive-startup.js +5 -0
  108. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  109. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  110. package/dist/modes/interactive-engine/engine-custom-ui.js +9 -0
  111. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  112. package/dist/modes/interactive-engine/engine-render-service.d.ts.map +1 -1
  113. package/dist/modes/interactive-engine/engine-render-service.js +10 -1
  114. package/dist/modes/interactive-engine/engine-render-service.js.map +1 -1
  115. package/dist/utils/image-convert.d.ts +5 -0
  116. package/dist/utils/image-convert.d.ts.map +1 -1
  117. package/dist/utils/image-convert.js +36 -6
  118. package/dist/utils/image-convert.js.map +1 -1
  119. package/docs/extensions.md +6 -0
  120. package/docs/models/reference.md +28 -1
  121. package/docs/models.md +4 -0
  122. package/docs/providers.md +10 -0
  123. package/docs/sdk.md +26 -2
  124. package/docs/settings.md +28 -1
  125. package/docs/workflows/operations.md +40 -4
  126. package/npm-shrinkwrap.json +71 -92
  127. package/package.json +8 -8
@@ -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,GAAG,EACH,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wCAAwC,CAAC;AACpE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC7E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tE,+CAA+C;IAC/C,gBAAgB,IAAI,OAAO,CAAC;IAE5B,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":"AAwEA;;;;;;;;;;;;;;;;;;;;;;;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","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\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 { ToolDefinition } 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\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): ToolDefinition | 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},\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":"AAwEA;;;;;;;;;;;;;;;;;;;;;;;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","sourcesContent":["import type {\n\tAutocompleteProvider,\n\tComponent,\n\tEditorComponent,\n\tEditorTheme,\n\tOverlayHandle,\n\tOverlayOptions,\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\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},\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"]}
@@ -76,6 +76,9 @@ export interface WorkflowRunResumeOptions {
76
76
  readonly stageId?: string;
77
77
  /** Message delivered to each resumed stage. */
78
78
  readonly message?: string;
79
+ readonly legacyRecovery?: {
80
+ readonly olderWorkersStopped: true;
81
+ };
79
82
  }
80
83
  export type WorkflowRunControlStatus = "ok" | "running" | "paused" | "partial" | "noop" | "cancelled";
81
84
  /** A run that a batch pause or quit could not stop; it may still be active. */
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run-control.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,oBAAoB,EAAE,GAC/B,qBAAqB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;CACzD;AAED,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAEjG,MAAM,WAAW,qBAAqB;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,MAAM,WAAW,sBAAsB;IACtC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACxC,QAAQ,CAAC,OAAO,CAAC,E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AAuB;IACtE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,sGAAsG;AACtG,qBAAa,2BAA4B,SAAQ,uBAAuB;IACvE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,qFAAqF;AACrF,qBAAa,mCAAoC,SAAQ,uBAAuB;IAC/E,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,mFAAmF;AACnF,qBAAa,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,2FAA2F;AAC3F,qBAAa,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,SAA0D,EACjE,OAAO,CAAC,EAAE,8BAA8B,EAIxC;CACD"}
1
+ {"version":3,"file":"workflow-run-control.d.ts","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAC7B,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,oBAAoB,EAAE,GAC/B,qBAAqB,CAAC;AAEzB,MAAM,WAAW,qBAAqB;IACrC,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,oBAAoB,GAAG,SAAS,CAAC;CACzD;AAED,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,GAAG,mBAAmB,GAAG,gBAAgB,CAAC;AAEjG,MAAM,WAAW,qBAAqB;IACrC,4FAA4F;IAC5F,QAAQ,CAAC,MAAM,CAAC,EAAE,uBAAuB,CAAC;CAC1C;AAED,MAAM,WAAW,uBAAuB;IACvC,QAAQ,CAAC,MAAM,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED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AA8B,EAGpE;CACD;AAED,yFAAyF;AACzF,qBAAa,yBAA0B,SAAQ,uBAAuB;IACrE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,mGAAmG;AACnG,qBAAa,4BAA6B,SAAQ,uBAAuB;IACxE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,qEAAqE;AACrE,qBAAa,0BAA2B,SAAQ,uBAAuB;IACtE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,sGAAsG;AACtG,qBAAa,2BAA4B,SAAQ,uBAAuB;IACvE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,qFAAqF;AACrF,qBAAa,mCAAoC,SAAQ,uBAAuB;IAC/E,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,mFAAmF;AACnF,qBAAa,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,8BAA8B,EAGpE;CACD;AAED,2FAA2F;AAC3F,qBAAa,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,SAA0D,EACjE,OAAO,CAAC,EAAE,8BAA8B,EAIxC;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"workflow-run-control.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AA8JA,2FAA2F;AAC3F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,IAAI,CAA8B;IAClC,KAAK,CAAU;IACxB,mFAAmF;IAC1E,UAAU,CAA0C;IAE7D,YAAY,IAAiC,EAAE,OAAe,EAAE,OAAO,GAAmC,EAAE;QAC3G,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACx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KAAK,CAAC,0BAA0B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC3C,CAAC;CACD;AAED,qFAAqF;AACrF,MAAM,OAAO,mCAAoC,SAAQ,uBAAuB;IAC/E,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,mCAAmC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,qCAAqC,CAAC;IACnD,CAAC;CACD;AAED,mFAAmF;AACnF,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,uBAAuB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,2FAA2F;AAC3F,MAAM,OAAO,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,GAAG,uDAAuD,EACjE,OAAwC;QAExC,KAAK,CAAC,kCAAkC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IAClD,CAAC;CACD","sourcesContent":["import type { WorkflowRunStatus, WorkflowStageStatus } from \"./workflow-events.js\";\n\nexport type WorkflowRunJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly WorkflowRunJsonValue[]\n\t| WorkflowRunJsonObject;\n\nexport interface WorkflowRunJsonObject {\n\treadonly [key: string]: WorkflowRunJsonValue | undefined;\n}\n\nexport type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | \"awaiting_input\";\n\nexport interface WorkflowRunListFilter {\n\t/** Run statuses match directly; `awaiting_input` selects runs with an unanswered prompt. */\n\treadonly status?: WorkflowRunFilterStatus;\n}\n\nexport interface WorkflowStageListFilter {\n\treadonly status?: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunActiveStage {\n\treadonly stageId: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunAwaitingInput {\n\treadonly stageId?: string;\n\treadonly stageName?: string;\n\treadonly promptId?: string;\n\treadonly promptKind?: string;\n\treadonly message?: string;\n}\n\n/** The concise per-run data that the `workflow` tool's `status` action lists. */\nexport interface WorkflowRunSummary {\n\treadonly runId: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus;\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly elapsedMs: number;\n\treadonly activeStages: readonly WorkflowRunActiveStage[];\n\treadonly awaitingInputCount: number;\n\treadonly awaitingInput: readonly WorkflowRunAwaitingInput[];\n\treadonly exitReason?: string;\n\treadonly error?: string;\n}\n\nexport interface WorkflowRunStageSummary {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n\treadonly sessionId?: string;\n\treadonly error?: string;\n\treadonly skippedReason?: string;\n\treadonly awaitingInputSince?: number;\n}\n\n/** The per-run detail that the `workflow` tool's `status` action returns for one run id. */\nexport interface WorkflowRunDetail {\n\treadonly runId: string;\n\treadonly rootRunId?: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus | \"crashed\";\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly durationMs?: number;\n\treadonly inputs: WorkflowRunJsonObject;\n\treadonly stages: readonly WorkflowRunStageSummary[];\n\treadonly result?: WorkflowRunJsonObject;\n\treadonly error?: string;\n\treadonly exitReason?: string;\n\treadonly resumable?: boolean;\n\treadonly resumeGuidance?: string;\n\treadonly ownerActiveElsewhere?: boolean;\n}\n\nexport interface WorkflowRunAllTarget {\n\treadonly all: true;\n}\n\nexport interface WorkflowRunPauseOptions {\n\t/** Pause one stage instead of the whole run. */\n\treadonly stageId?: string;\n}\n\nexport interface WorkflowRunResumeOptions {\n\t/** Resume one paused stage instead of the whole run. */\n\treadonly stageId?: string;\n\t/** Message delivered to each resumed stage. */\n\treadonly message?: string;\n}\n\nexport type WorkflowRunControlStatus = \"ok\" | \"running\" | \"paused\" | \"partial\" | \"noop\" | \"cancelled\";\n\n/** A run that a batch pause or quit could not stop; it may still be active. */\nexport interface WorkflowRunControlFailedRun {\n\treadonly runId: string;\n\t/** Machine-readable refusal, such as `not_found`, `no_active_stages` or `pause_failed`. */\n\treadonly reason: string;\n\treadonly message?: string;\n}\n\n/**\n * The acknowledged result of a pause, quit or resume request, as the `workflow`\n * tool reports it. `runId` is `--all` for a batch request. `noop` means the request was\n * understood and found nothing to change; `partial` means only part of the\n * request took effect. For a batch pause or quit, `failedRuns` names every run that\n * could not be stopped, so a `partial` outcome is never a complete stop.\n */\nexport interface WorkflowRunControlOutcome {\n\treadonly action: \"pause\" | \"quit\" | \"resume\";\n\treadonly runId: string;\n\treadonly status: WorkflowRunControlStatus;\n\treadonly message: string;\n\treadonly stageId?: string;\n\treadonly workflowStatus?: WorkflowRunStatus;\n\treadonly abandoned?: boolean;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Typed run management for the workflow runs owned by one session. */\nexport interface SessionWorkflows {\n\tlistRuns(filter?: WorkflowRunListFilter): Promise<readonly WorkflowRunSummary[]>;\n\tgetRun(runId: string): Promise<WorkflowRunDetail>;\n\tgetStages(runId: string, filter?: WorkflowStageListFilter): Promise<readonly WorkflowRunStageSummary[]>;\n\tpause(runId: string, options?: WorkflowRunPauseOptions): Promise<WorkflowRunControlOutcome>;\n\tpause(target: WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tquit(target: string | WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tresume(runId: string, options?: WorkflowRunResumeOptions): Promise<WorkflowRunControlOutcome>;\n}\n\nexport interface WorkflowRunControlRegistration {\n\tdispose(): void;\n}\n\nexport type WorkflowRunControlErrorCode =\n\t| \"WORKFLOW_RUN_NOT_FOUND\"\n\t| \"WORKFLOW_RUN_OWNED_ELSEWHERE\"\n\t| \"WORKFLOW_RUN_NOT_RESUMABLE\"\n\t| \"WORKFLOW_STAGE_NOT_FOUND\"\n\t| \"WORKFLOW_STAGE_AMBIGUOUS\"\n\t| \"WORKFLOW_STAGE_RESUME_UNSUPPORTED\"\n\t| \"WORKFLOW_RUN_DATABASE\"\n\t| \"WORKFLOW_RUN_CONTROL_FAILED\"\n\t| \"WORKFLOW_RUN_CONTROL_UNAVAILABLE\";\n\nexport interface WorkflowRunControlErrorOptions extends ErrorOptions {\n\treadonly runId?: string;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Base class for every failure reported by {@link SessionWorkflows}; branch on `code`. */\nexport class WorkflowRunControlError extends Error {\n\treadonly code: WorkflowRunControlErrorCode;\n\treadonly runId?: string;\n\t/** Runs a batch pause or quit could not stop, when the whole batch was refused. */\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n\n\tconstructor(code: WorkflowRunControlErrorCode, message: string, options: WorkflowRunControlErrorOptions = {}) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WorkflowRunControlError\";\n\t\tthis.code = code;\n\t\tif (options.runId !== undefined) this.runId = options.runId;\n\t\tif (options.failedRuns !== undefined) this.failedRuns = options.failedRuns;\n\t}\n}\n\n/** The run id is unknown, malformed, or an ambiguous prefix. */\nexport class WorkflowRunNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowRunNotFoundError\";\n\t}\n}\n\n/** The run belongs to another session or is executing in another live Atomic process. */\nexport class WorkflowRunOwnershipError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_OWNED_ELSEWHERE\", message, options);\n\t\tthis.name = \"WorkflowRunOwnershipError\";\n\t}\n}\n\n/** The run has no continuation to resume: it completed, was killed, or has no durable progress. */\nexport class WorkflowRunNotResumableError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_RESUMABLE\", message, options);\n\t\tthis.name = \"WorkflowRunNotResumableError\";\n\t}\n}\n\n/** The stage identifier matches no stage or tool node of the run. */\nexport class WorkflowStageNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowStageNotFoundError\";\n\t}\n}\n\n/** The stage identifier matches more than one stage or tool node; pass a more specific identifier. */\nexport class WorkflowStageAmbiguousError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_AMBIGUOUS\", message, options);\n\t\tthis.name = \"WorkflowStageAmbiguousError\";\n\t}\n}\n\n/** A durable run can only be resumed whole; resume it without a stage identifier. */\nexport class WorkflowStageResumeUnsupportedError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_RESUME_UNSUPPORTED\", message, options);\n\t\tthis.name = \"WorkflowStageResumeUnsupportedError\";\n\t}\n}\n\n/** Workflow durability (the run database) is unavailable, shut down, or failed. */\nexport class WorkflowRunDatabaseError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_DATABASE\", message, options);\n\t\tthis.name = \"WorkflowRunDatabaseError\";\n\t}\n}\n\n/** The workflows extension is not loaded for this session, or the session was disposed. */\nexport class WorkflowRunControlUnavailableError extends WorkflowRunControlError {\n\tconstructor(\n\t\tmessage = \"Workflow run control is unavailable for this session.\",\n\t\toptions?: WorkflowRunControlErrorOptions,\n\t) {\n\t\tsuper(\"WORKFLOW_RUN_CONTROL_UNAVAILABLE\", message, options);\n\t\tthis.name = \"WorkflowRunControlUnavailableError\";\n\t}\n}\n"]}
1
+ {"version":3,"file":"workflow-run-control.js","sourceRoot":"","sources":["../../../src/core/extensions/workflow-run-control.ts"],"names":[],"mappings":"AA+JA,2FAA2F;AAC3F,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IACxC,IAAI,CAA8B;IAClC,KAAK,CAAU;IACxB,mFAAmF;IAC1E,UAAU,CAA0C;IAE7D,YAAY,IAAiC,EAAE,OAAe,EAAE,OAAO,GAAmC,EAAE;QAC3G,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACxB,IAAI,CAAC,IAAI,GAAG,yBAAyB,CAAC;QACtC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5D,IAAI,OAAO,CAAC,UAAU,KAAK,SAAS;YAAE,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IAC5E,CAAC;CACD;AAED,gEAAgE;AAChE,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,wBAAwB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAClD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,yFAAyF;AACzF,MAAM,OAAO,yBAA0B,SAAQ,uBAAuB;IACrE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,8BAA8B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACxD,IAAI,CAAC,IAAI,GAAG,2BAA2B,CAAC;IACzC,CAAC;CACD;AAED,mGAAmG;AACnG,MAAM,OAAO,4BAA6B,SAAQ,uBAAuB;IACxE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,4BAA4B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACtD,IAAI,CAAC,IAAI,GAAG,8BAA8B,CAAC;IAC5C,CAAC;CACD;AAED,qEAAqE;AACrE,MAAM,OAAO,0BAA2B,SAAQ,uBAAuB;IACtE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,0BAA0B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,4BAA4B,CAAC;IAC1C,CAAC;CACD;AAED,sGAAsG;AACtG,MAAM,OAAO,2BAA4B,SAAQ,uBAAuB;IACvE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,0BAA0B,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC3C,CAAC;CACD;AAED,qFAAqF;AACrF,MAAM,OAAO,mCAAoC,SAAQ,uBAAuB;IAC/E,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,mCAAmC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC7D,IAAI,CAAC,IAAI,GAAG,qCAAqC,CAAC;IACnD,CAAC;CACD;AAED,mFAAmF;AACnF,MAAM,OAAO,wBAAyB,SAAQ,uBAAuB;IACpE,YAAY,OAAe,EAAE,OAAwC;QACpE,KAAK,CAAC,uBAAuB,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,GAAG,0BAA0B,CAAC;IACxC,CAAC;CACD;AAED,2FAA2F;AAC3F,MAAM,OAAO,kCAAmC,SAAQ,uBAAuB;IAC9E,YACC,OAAO,GAAG,uDAAuD,EACjE,OAAwC;QAExC,KAAK,CAAC,kCAAkC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAC5D,IAAI,CAAC,IAAI,GAAG,oCAAoC,CAAC;IAClD,CAAC;CACD","sourcesContent":["import type { WorkflowRunStatus, WorkflowStageStatus } from \"./workflow-events.js\";\n\nexport type WorkflowRunJsonValue =\n\t| string\n\t| number\n\t| boolean\n\t| null\n\t| readonly WorkflowRunJsonValue[]\n\t| WorkflowRunJsonObject;\n\nexport interface WorkflowRunJsonObject {\n\treadonly [key: string]: WorkflowRunJsonValue | undefined;\n}\n\nexport type WorkflowRunFilterStatus = WorkflowRunStatus | WorkflowStageStatus | \"awaiting_input\";\n\nexport interface WorkflowRunListFilter {\n\t/** Run statuses match directly; `awaiting_input` selects runs with an unanswered prompt. */\n\treadonly status?: WorkflowRunFilterStatus;\n}\n\nexport interface WorkflowStageListFilter {\n\treadonly status?: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunActiveStage {\n\treadonly stageId: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n}\n\nexport interface WorkflowRunAwaitingInput {\n\treadonly stageId?: string;\n\treadonly stageName?: string;\n\treadonly promptId?: string;\n\treadonly promptKind?: string;\n\treadonly message?: string;\n}\n\n/** The concise per-run data that the `workflow` tool's `status` action lists. */\nexport interface WorkflowRunSummary {\n\treadonly runId: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus;\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly elapsedMs: number;\n\treadonly activeStages: readonly WorkflowRunActiveStage[];\n\treadonly awaitingInputCount: number;\n\treadonly awaitingInput: readonly WorkflowRunAwaitingInput[];\n\treadonly exitReason?: string;\n\treadonly error?: string;\n}\n\nexport interface WorkflowRunStageSummary {\n\treadonly id: string;\n\treadonly name: string;\n\treadonly status: WorkflowStageStatus;\n\treadonly sessionId?: string;\n\treadonly error?: string;\n\treadonly skippedReason?: string;\n\treadonly awaitingInputSince?: number;\n}\n\n/** The per-run detail that the `workflow` tool's `status` action returns for one run id. */\nexport interface WorkflowRunDetail {\n\treadonly runId: string;\n\treadonly rootRunId?: string;\n\treadonly name: string;\n\treadonly status: WorkflowRunStatus | \"crashed\";\n\treadonly startedAt: number;\n\treadonly endedAt?: number;\n\treadonly durationMs?: number;\n\treadonly inputs: WorkflowRunJsonObject;\n\treadonly stages: readonly WorkflowRunStageSummary[];\n\treadonly result?: WorkflowRunJsonObject;\n\treadonly error?: string;\n\treadonly exitReason?: string;\n\treadonly resumable?: boolean;\n\treadonly resumeGuidance?: string;\n\treadonly ownerActiveElsewhere?: boolean;\n}\n\nexport interface WorkflowRunAllTarget {\n\treadonly all: true;\n}\n\nexport interface WorkflowRunPauseOptions {\n\t/** Pause one stage instead of the whole run. */\n\treadonly stageId?: string;\n}\n\nexport interface WorkflowRunResumeOptions {\n\t/** Resume one paused stage instead of the whole run. */\n\treadonly stageId?: string;\n\t/** Message delivered to each resumed stage. */\n\treadonly message?: string;\n\treadonly legacyRecovery?: { readonly olderWorkersStopped: true };\n}\n\nexport type WorkflowRunControlStatus = \"ok\" | \"running\" | \"paused\" | \"partial\" | \"noop\" | \"cancelled\";\n\n/** A run that a batch pause or quit could not stop; it may still be active. */\nexport interface WorkflowRunControlFailedRun {\n\treadonly runId: string;\n\t/** Machine-readable refusal, such as `not_found`, `no_active_stages` or `pause_failed`. */\n\treadonly reason: string;\n\treadonly message?: string;\n}\n\n/**\n * The acknowledged result of a pause, quit or resume request, as the `workflow`\n * tool reports it. `runId` is `--all` for a batch request. `noop` means the request was\n * understood and found nothing to change; `partial` means only part of the\n * request took effect. For a batch pause or quit, `failedRuns` names every run that\n * could not be stopped, so a `partial` outcome is never a complete stop.\n */\nexport interface WorkflowRunControlOutcome {\n\treadonly action: \"pause\" | \"quit\" | \"resume\";\n\treadonly runId: string;\n\treadonly status: WorkflowRunControlStatus;\n\treadonly message: string;\n\treadonly stageId?: string;\n\treadonly workflowStatus?: WorkflowRunStatus;\n\treadonly abandoned?: boolean;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Typed run management for the workflow runs owned by one session. */\nexport interface SessionWorkflows {\n\tlistRuns(filter?: WorkflowRunListFilter): Promise<readonly WorkflowRunSummary[]>;\n\tgetRun(runId: string): Promise<WorkflowRunDetail>;\n\tgetStages(runId: string, filter?: WorkflowStageListFilter): Promise<readonly WorkflowRunStageSummary[]>;\n\tpause(runId: string, options?: WorkflowRunPauseOptions): Promise<WorkflowRunControlOutcome>;\n\tpause(target: WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tquit(target: string | WorkflowRunAllTarget): Promise<WorkflowRunControlOutcome>;\n\tresume(runId: string, options?: WorkflowRunResumeOptions): Promise<WorkflowRunControlOutcome>;\n}\n\nexport interface WorkflowRunControlRegistration {\n\tdispose(): void;\n}\n\nexport type WorkflowRunControlErrorCode =\n\t| \"WORKFLOW_RUN_NOT_FOUND\"\n\t| \"WORKFLOW_RUN_OWNED_ELSEWHERE\"\n\t| \"WORKFLOW_RUN_NOT_RESUMABLE\"\n\t| \"WORKFLOW_STAGE_NOT_FOUND\"\n\t| \"WORKFLOW_STAGE_AMBIGUOUS\"\n\t| \"WORKFLOW_STAGE_RESUME_UNSUPPORTED\"\n\t| \"WORKFLOW_RUN_DATABASE\"\n\t| \"WORKFLOW_RUN_CONTROL_FAILED\"\n\t| \"WORKFLOW_RUN_CONTROL_UNAVAILABLE\";\n\nexport interface WorkflowRunControlErrorOptions extends ErrorOptions {\n\treadonly runId?: string;\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n}\n\n/** Base class for every failure reported by {@link SessionWorkflows}; branch on `code`. */\nexport class WorkflowRunControlError extends Error {\n\treadonly code: WorkflowRunControlErrorCode;\n\treadonly runId?: string;\n\t/** Runs a batch pause or quit could not stop, when the whole batch was refused. */\n\treadonly failedRuns?: readonly WorkflowRunControlFailedRun[];\n\n\tconstructor(code: WorkflowRunControlErrorCode, message: string, options: WorkflowRunControlErrorOptions = {}) {\n\t\tsuper(message, options);\n\t\tthis.name = \"WorkflowRunControlError\";\n\t\tthis.code = code;\n\t\tif (options.runId !== undefined) this.runId = options.runId;\n\t\tif (options.failedRuns !== undefined) this.failedRuns = options.failedRuns;\n\t}\n}\n\n/** The run id is unknown, malformed, or an ambiguous prefix. */\nexport class WorkflowRunNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowRunNotFoundError\";\n\t}\n}\n\n/** The run belongs to another session or is executing in another live Atomic process. */\nexport class WorkflowRunOwnershipError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_OWNED_ELSEWHERE\", message, options);\n\t\tthis.name = \"WorkflowRunOwnershipError\";\n\t}\n}\n\n/** The run has no continuation to resume: it completed, was killed, or has no durable progress. */\nexport class WorkflowRunNotResumableError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_NOT_RESUMABLE\", message, options);\n\t\tthis.name = \"WorkflowRunNotResumableError\";\n\t}\n}\n\n/** The stage identifier matches no stage or tool node of the run. */\nexport class WorkflowStageNotFoundError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_NOT_FOUND\", message, options);\n\t\tthis.name = \"WorkflowStageNotFoundError\";\n\t}\n}\n\n/** The stage identifier matches more than one stage or tool node; pass a more specific identifier. */\nexport class WorkflowStageAmbiguousError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_AMBIGUOUS\", message, options);\n\t\tthis.name = \"WorkflowStageAmbiguousError\";\n\t}\n}\n\n/** A durable run can only be resumed whole; resume it without a stage identifier. */\nexport class WorkflowStageResumeUnsupportedError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_STAGE_RESUME_UNSUPPORTED\", message, options);\n\t\tthis.name = \"WorkflowStageResumeUnsupportedError\";\n\t}\n}\n\n/** Workflow durability (the run database) is unavailable, shut down, or failed. */\nexport class WorkflowRunDatabaseError extends WorkflowRunControlError {\n\tconstructor(message: string, options?: WorkflowRunControlErrorOptions) {\n\t\tsuper(\"WORKFLOW_RUN_DATABASE\", message, options);\n\t\tthis.name = \"WorkflowRunDatabaseError\";\n\t}\n}\n\n/** The workflows extension is not loaded for this session, or the session was disposed. */\nexport class WorkflowRunControlUnavailableError extends WorkflowRunControlError {\n\tconstructor(\n\t\tmessage = \"Workflow run control is unavailable for this session.\",\n\t\toptions?: WorkflowRunControlErrorOptions,\n\t) {\n\t\tsuper(\"WORKFLOW_RUN_CONTROL_UNAVAILABLE\", message, options);\n\t\tthis.name = \"WorkflowRunControlUnavailableError\";\n\t}\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fast-model-routing.d.ts","sourceRoot":"","sources":["../../src/core/fast-model-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EACN,KAAK,GAAG,EACR,KAAK,2BAA2B,EAChC,KAAK,OAAO,EAEZ,KAAK,KAAK,EACV,KAAK,cAAc,EAEnB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAIlB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,MAAM,uBAAuB,CAAC;AAY/B,MAAM,WAAW,sBAAuB,SAAQ,mBAAmB;IAClE,WAAW,CAAC,EAAE,cAAc,CAAC,aAAa,CAAC,CAAC;CAC5C;AAED,MAAM,WAAW,kBAAkB;IAClC,YAAY,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,mBAAmB,KAAK,2BAA2B,CAAC;IAClH,qBAAqB,EAAE,CACtB,KAAK,EAAE,KAAK,CAAC,kBAAkB,CAAC,EAChC,OAAO,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,sBAAsB,KAC5B,2BAA2B,CAAC;IACjC,0BA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function buildFastRouteBaseProviderOptions(model, options) {
137
- // Native fast-route streams bypass pi-ai's streamSimple base-options merge.
138
- const samplingParams = model.samplingParams || options?.samplingParams
139
- ? { ...model.samplingParams, ...options?.samplingParams }
140
- : undefined;
141
137
  const providerOptions = {
142
- samplingParams,
138
+ samplingParams: options?.samplingParams,
143
139
  temperature: options?.temperature,
144
140
  maxTokens: options?.maxTokens,
145
141
  signal: options?.signal,
@@ -1 +1 @@
1
- {"version":3,"file":"fast-model-routing.js","sourceRoot":"","sources":["../../src/core/fast-model-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAIN,kBAAkB,EAGlB,gBAAgB,EAMhB,0BAA0B,EAC1B,qBAAqB,EACrB,YAAY,GAGZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,sCAAsC,EACtC,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAoBvH,MAAM,4BAA4B,GAAuB;IACxD,YAAY;IACZ,qBAAqB;IACrB,0BAA0B;CAC1B,CAAC;AAEF,MAAM,qCAAqC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,0BAA0B,GAAG,IAAI,GAAG,EAAwE,CAAC;AAEnH;;;GAGG;AACH,MAAM,UAAU,iBAAiB,CAAC,KAAoC;IACrE,OAAO,KAAK,CAAC,SAAS,CAAC;AACxB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,sBAAsB,CAAC,KAA2C;IACjF,OAAO,KAAK,CAAC,SAAS,EAAE,eAAe,IAAI,KAAK,CAAC,EAAE,CAAC;AACrD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,0BAA0B,CAAC,K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C,EAAE,CAAC;YACtE,sCAAsC,EAAE,CAAC;QAC1C,CAAC;QAED,OAAO,SAAS,CAAC,0BAA0B,CAC1C,KAAwC,EACxC,gBAAgB,CAAC,OAAO,CAAC,EACzB,yCAAyC,CAAC,KAAK,EAAE,OAAO,CAAC,CACzD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { closeOpenAICodexWebSocketSessions } from \"@bastani/pi-ai/api/openai-codex-responses\";\nimport {\n\ttype Api,\n\ttype AssistantMessageEventStream,\n\ttype Context,\n\tclampThinkingLevel,\n\ttype Model,\n\ttype ModelFastRoute,\n\tnormalizeContext,\n\ttype OpenAICodexResponsesOptions,\n\ttype OpenAIResponsesOptions,\n\ttype ProviderHeaders,\n\ttype SimpleStreamOptions,\n\ttype StreamOptions,\n\tstreamOpenAICodexResponses,\n\tstreamOpenAIResponses,\n\tstreamSimple,\n\ttype ThinkingLevel,\n\ttype TranscriptContext,\n} from \"@bastani/pi-ai/compat\";\nimport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n\tclearCodexFastRouteRequestMarker,\n\tinstallCodexFastRouteWebSocketIdentity,\n\tisFirstPartyCodexBaseUrl,\n\tmarkCodexFastRouteRequest,\n\twrapCodexFastRouteFetch,\n} from \"./fast-model-routing-transport.ts\";\nimport { FAST_MODEL_SERVICE_TIER, isNativeFastRouteApi, ULTRAFAST_MODEL_SERVICE_TIER } from \"./fast-model-variants.ts\";\n\nexport interface FastRouteStreamOptions extends SimpleStreamOptions {\n\tserviceTier?: ModelFastRoute[\"serviceTier\"];\n}\n\nexport interface FastRouteStreamers {\n\tstreamSimple: (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;\n\tstreamOpenAIResponses: (\n\t\tmodel: Model<\"openai-responses\">,\n\t\tcontext: TranscriptContext,\n\t\toptions?: OpenAIResponsesOptions,\n\t) => AssistantMessageEventStream;\n\tstreamOpenAICodexResponses: (\n\t\tmodel: Model<\"openai-codex-responses\">,\n\t\tcontext: TranscriptContext,\n\t\toptions?: OpenAICodexResponsesOptions,\n\t) => AssistantMessageEventStream;\n}\n\nconst DEFAULT_FAST_ROUTE_STREAMERS: FastRouteStreamers = {\n\tstreamSimple,\n\tstreamOpenAIResponses,\n\tstreamOpenAICodexResponses,\n};\n\nconst CODEX_WEBSOCKET_ROUTING_STATE_IDLE_MS = 6 * 60 * 1000;\nconst codexWebSocketRoutingState = new Map<string, { signature: string; expiry: ReturnType<typeof setTimeout> }>();\n\n/**\n * Explicit route metadata is the only source of fast semantics. A model whose ID merely ends in\n * `-fast` — a provider, `models.json`, or extension model that owns that exact ID — routes normally.\n */\nexport function getModelFastRoute(model: Pick<Model<Api>, \"fastRoute\">): ModelFastRoute | undefined {\n\treturn model.fastRoute;\n}\n\n/**\n * The model ID this request sends upstream. An OpenAI-style fast route sends the base model and\n * carries a priority service tier instead; a provider with real fast siblings sends its own\n * advertised ID, which is already the canonical one. The canonical `-fast` identity always stays on\n * the model object Atomic selected, persisted, and records — only the serialized request differs.\n */\nexport function resolveUpstreamModelId(model: Pick<Model<Api>, \"fastRoute\" | \"id\">): string {\n\treturn model.fastRoute?.upstreamModelId ?? model.id;\n}\n\n/**\n * Whether a model uses the first-party OpenAI Codex provider identity and endpoint.\n * A renamed provider on the same protocol remains non-first-party.\n */\nexport function usesFirstPartyCodexRouting(model: Pick<Model<Api>, \"baseUrl\" | \"provider\">): boolean {\n\treturn model.provider === \"openai-codex\" && isFirstPartyCodexBaseUrl(model.baseUrl);\n}\n\n/** A provider alias or proxy still uses the shared ChatGPT Codex protocol when its API does. */\nexport function usesChatGptCodexTransport(model: Pick<Model<Api>, \"api\">): boolean {\n\treturn model.api === \"openai-codex-responses\";\n}\n\nfunction deleteHeader(headers: ProviderHeaders, name: string): void {\n\tfor (const existingName of Object.keys(headers)) {\n\t\tif (existingName.toLowerCase() === name.toLowerCase()) delete headers[existingName];\n\t}\n}\n\nfunction setHeader(headers: ProviderHeaders, name: string, value: string): void {\n\tdeleteHeader(headers, name);\n\theaders[name] = value;\n}\n\n/**\n * Eager first-party routing headers for a model that carries an OpenAI-style fast route.\n *\n * Derived entirely from the model: the headers are added only when the model's own `fastRoute`\n * declares the priority tier and the model uses first-party Codex routing, and the hint names the\n * route's upstream model ID — the same value the request serializes and\n * `withChatGptCodexTransportRouting` reads from route metadata. There is no caller-supplied enable\n * flag, so a model without a route can never be granted this identity.\n */\nexport function withCodexFastRouteHeaders(\n\tmodel: Pick<Model<Api>, \"baseUrl\" | \"fastRoute\" | \"id\" | \"provider\">,\n\theaders: ProviderHeaders | undefined,\n): ProviderHeaders | undefined {\n\tconst tier = getModelFastRoute(model)?.serviceTier;\n\tif (tier === undefined || !usesFirstPartyCodexRouting(model)) {\n\t\treturn headers;\n\t}\n\tconst fastHeaders: ProviderHeaders = { ...(headers ?? {}) };\n\tsetHeader(fastHeaders, \"originator\", CODEX_FAST_ROUTE_ORIGINATOR);\n\tsetHeader(fastHeaders, CODEX_FAST_ROUTE_HEADER, `model=${resolveUpstreamModelId(model)};tier=${tier}`);\n\treturn fastHeaders;\n}\n\n/** Attach the route's service tier to the outgoing stream options. */\nexport function withFastRouteStreamOptions(\n\tfastRoute: ModelFastRoute | undefined,\n\toptions: SimpleStreamOptions | undefined,\n): FastRouteStreamOptions | undefined {\n\tif (fastRoute?.serviceTier === undefined) return options;\n\treturn { ...(options ?? {}), headers: options?.headers, serviceTier: fastRoute.serviceTier };\n}\n\n/** A service-tier route needs pi-ai's native adapters; `streamSimple` drops `serviceTier`. */\nexport function shouldUseNativeFastRoute(\n\tmodel: Pick<Model<Api>, \"api\">,\n\toptions: FastRouteStreamOptions | undefined,\n): boolean {\n\treturn (\n\t\tisNativeFastRouteApi(model.api) &&\n\t\t(options?.serviceTier === FAST_MODEL_SERVICE_TIER || options?.serviceTier === ULTRAFAST_MODEL_SERVICE_TIER)\n\t);\n}\n\nfunction codexEnvironmentScope(env: StreamOptions[\"env\"]): string {\n\tif (!env) return \"none\";\n\tconst serialized = JSON.stringify(Object.entries(env).sort(([left], [right]) => left.localeCompare(right)));\n\tlet hash = 2166136261;\n\tfor (let index = 0; index < serialized.length; index += 1) {\n\t\thash = Math.imul(hash ^ serialized.charCodeAt(index), 16777619);\n\t}\n\treturn (hash >>> 0).toString(16);\n}\n\ntype CloseCodexWebSocketSessions = typeof closeOpenAICodexWebSocketSessions;\nfunction updateCodexWebSocketRoutingState(\n\tmodel: Pick<Model<Api>, \"baseUrl\" | \"provider\">,\n\troutedModel: string,\n\toptions: Pick<StreamOptions, \"env\" | \"sessionId\" | \"transport\">,\n\ttier: ModelFastRoute[\"serviceTier\"],\n\tcloseWebSocketSessions: CloseCodexWebSocketSessions,\n): void {\n\tif (options.transport === \"sse\" || !options.sessionId) return;\n\tconst signature = `${model.provider}\\0${model.baseUrl}\\0${codexEnvironmentScope(options.env)}\\0${tier ? `${tier}:${routedModel}` : \"normal\"}`;\n\tconst previous = codexWebSocketRoutingState.get(options.sessionId);\n\tif (previous?.signature !== undefined && previous.signature !== signature) {\n\t\tcloseWebSocketSessions(options.sessionId);\n\t}\n\tif (previous) clearTimeout(previous.expiry);\n\tconst expiry = setTimeout(() => {\n\t\tif (codexWebSocketRoutingState.get(options.sessionId!)?.signature === signature) {\n\t\t\tcodexWebSocketRoutingState.delete(options.sessionId!);\n\t\t}\n\t}, CODEX_WEBSOCKET_ROUTING_STATE_IDLE_MS);\n\texpiry.unref?.();\n\tcodexWebSocketRoutingState.set(options.sessionId, { signature, expiry });\n}\n\nexport function withChatGptCodexTransportRouting<TOptions extends StreamOptions>(\n\tmodel: Model<Api>,\n\toptions: TOptions,\n\tcloseWebSocketSessions: CloseCodexWebSocketSessions = closeOpenAICodexWebSocketSessions,\n): TOptions {\n\tconst headers: ProviderHeaders = { ...(options.headers ?? {}) };\n\tconst onPayload = options.onPayload;\n\tconst tier = usesFirstPartyCodexRouting(model) ? getModelFastRoute(model)?.serviceTier : undefined;\n\tconst routedModel = resolveUpstreamModelId(model);\n\treturn {\n\t\t...options,\n\t\theaders,\n\t\tfetch: wrapCodexFastRouteFetch(options.fetch ?? globalThis.fetch),\n\t\tonPayload: async (payload, requestModel) => {\n\t\t\tconst replacement = await onPayload?.(payload, requestModel);\n\t\t\tconst finalPayload = replacement === undefined ? payload : replacement;\n\t\t\tdeleteHeader(headers, CODEX_FAST_ROUTE_HEADER);\n\t\t\tclearCodexFastRouteRequestMarker(headers);\n\t\t\tif (tier) {\n\t\t\t\tsetHeader(headers, CODEX_FAST_ROUTE_HEADER, `model=${routedModel};tier=${tier}`);\n\t\t\t} else {\n\t\t\t\tfor (const [name, value] of Object.entries(headers)) {\n\t\t\t\t\tif (name.toLowerCase() === \"originator\" && value === CODEX_FAST_ROUTE_ORIGINATOR) delete headers[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tmarkCodexFastRouteRequest(headers, tier !== undefined);\n\t\t\tupdateCodexWebSocketRoutingState(model, routedModel, options, tier, closeWebSocketSessions);\n\t\t\treturn finalPayload;\n\t\t},\n\t} as TOptions;\n}\n\nfunction buildFastRouteBaseProviderOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): StreamOptions {\n\t// Native fast-route streams bypass pi-ai's streamSimple base-options merge.\n\tconst samplingParams =\n\t\tmodel.samplingParams || options?.samplingParams\n\t\t\t? { ...model.samplingParams, ...options?.samplingParams }\n\t\t\t: undefined;\n\tconst providerOptions: StreamOptions = {\n\t\tsamplingParams,\n\t\ttemperature: options?.temperature,\n\t\tmaxTokens: options?.maxTokens,\n\t\tsignal: options?.signal,\n\t\tapiKey: options?.apiKey,\n\t\tfetch: options?.fetch,\n\t\tenv: options?.env,\n\t\ttelemetryContext: options?.telemetryContext,\n\t\ttransport: options?.transport,\n\t\tcacheRetention: options?.cacheRetention,\n\t\tsessionId: options?.sessionId,\n\t\tonPayload: options?.onPayload,\n\t\tonResponse: options?.onResponse,\n\t\tonProviderStreamEvent: options?.onProviderStreamEvent,\n\t\theaders: options?.headers,\n\t\ttimeoutMs: options?.timeoutMs,\n\t\twebsocketConnectTimeoutMs: options?.websocketConnectTimeoutMs,\n\t\tstreamDeadlineMs: options?.streamDeadlineMs,\n\t\tmaxRetries: options?.maxRetries,\n\t\tmaxRetryDelayMs: options?.maxRetryDelayMs,\n\t\tmetadata: options?.metadata,\n\t};\n\treturn usesChatGptCodexTransport(model) ? withChatGptCodexTransportRouting(model, providerOptions) : providerOptions;\n}\n\nexport function mapFastRouteReasoningEffort(\n\tmodel: Model<Api>,\n\treasoning: ThinkingLevel | undefined,\n): ThinkingLevel | undefined {\n\tconst clampedReasoning = reasoning ? clampThinkingLevel(model, reasoning) : undefined;\n\treturn clampedReasoning === \"off\" ? undefined : clampedReasoning;\n}\n\nexport function buildOpenAIResponsesFastRouteOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): OpenAIResponsesOptions {\n\treturn {\n\t\t...buildFastRouteBaseProviderOptions(model, options),\n\t\treasoningEffort: mapFastRouteReasoningEffort(model, options?.reasoning),\n\t\tserviceTier: options?.serviceTier,\n\t};\n}\n\nexport function buildOpenAICodexResponsesFastRouteOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): OpenAICodexResponsesOptions {\n\treturn {\n\t\t...buildFastRouteBaseProviderOptions(model, options),\n\t\treasoningEffort: mapFastRouteReasoningEffort(model, options?.reasoning),\n\t\tserviceTier: options?.serviceTier,\n\t};\n}\n\n/**\n * Stream a request whose canonical selected model carries fast-route metadata. The provider adapter\n * translates only the serialized request to the route's upstream ID; the model object keeps its\n * canonical `-fast` identity.\n */\nexport function streamWithFastRoute(\n\tmodel: Model<Api>,\n\tcontext: Context,\n\toptions: FastRouteStreamOptions | undefined,\n\tstreamers: FastRouteStreamers = DEFAULT_FAST_ROUTE_STREAMERS,\n): AssistantMessageEventStream {\n\tif (shouldUseNativeFastRoute(model, options)) {\n\t\tif (model.api === \"openai-responses\") {\n\t\t\treturn streamers.streamOpenAIResponses(\n\t\t\t\tmodel as Model<\"openai-responses\">,\n\t\t\t\tnormalizeContext(context),\n\t\t\t\tbuildOpenAIResponsesFastRouteOptions(model, options),\n\t\t\t);\n\t\t}\n\n\t\t// The WebSocket handshake builds its headers inside pi-ai, and the runtime\n\t\t// constructor can be cached before the first turn, so repair the identity\n\t\t// through the global constructor rather than per-request options.\n\t\tif (options?.transport !== \"sse\" && usesChatGptCodexTransport(model)) {\n\t\t\tinstallCodexFastRouteWebSocketIdentity();\n\t\t}\n\n\t\treturn streamers.streamOpenAICodexResponses(\n\t\t\tmodel as Model<\"openai-codex-responses\">,\n\t\t\tnormalizeContext(context),\n\t\t\tbuildOpenAICodexResponsesFastRouteOptions(model, options),\n\t\t);\n\t}\n\n\treturn streamers.streamSimple(model, context, options);\n}\n"]}
1
+ {"version":3,"file":"fast-model-routing.js","sourceRoot":"","sources":["../../src/core/fast-model-routing.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAIN,kBAAkB,EAGlB,gBAAgB,EAMhB,0BAA0B,EAC1B,qBAAqB,EACrB,YAAY,GAGZ,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACN,uBAAuB,EACvB,2BAA2B,EAC3B,gCAAgC,EAChC,sCAAsC,EACtC,wBAAwB,EACxB,yBAAyB,EACzB,uBAAuB,GACvB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAoBvH,MAAM,4BAA4B,GAAuB;IACxD,YAAY;IACZ,qBAAqB;IACrB,0BAA0B;CAC1B,CAAC;AAEF,MAAM,qCAAqC,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAC5D,MAAM,0BAA0B,GAAG,IAAI,GAAG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C;QACH,CAAC;QAED,2EAA2E;QAC3E,0EAA0E;QAC1E,kEAAkE;QAClE,IAAI,OAAO,EAAE,SAAS,KAAK,KAAK,IAAI,yBAAyB,CAAC,KAAK,CAAC,EAAE,CAAC;YACtE,sCAAsC,EAAE,CAAC;QAC1C,CAAC;QAED,OAAO,SAAS,CAAC,0BAA0B,CAC1C,KAAwC,EACxC,gBAAgB,CAAC,OAAO,CAAC,EACzB,yCAAyC,CAAC,KAAK,EAAE,OAAO,CAAC,CACzD,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC,YAAY,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AACxD,CAAC","sourcesContent":["import { closeOpenAICodexWebSocketSessions } from \"@bastani/pi-ai/api/openai-codex-responses\";\nimport {\n\ttype Api,\n\ttype AssistantMessageEventStream,\n\ttype Context,\n\tclampThinkingLevel,\n\ttype Model,\n\ttype ModelFastRoute,\n\tnormalizeContext,\n\ttype OpenAICodexResponsesOptions,\n\ttype OpenAIResponsesOptions,\n\ttype ProviderHeaders,\n\ttype SimpleStreamOptions,\n\ttype StreamOptions,\n\tstreamOpenAICodexResponses,\n\tstreamOpenAIResponses,\n\tstreamSimple,\n\ttype ThinkingLevel,\n\ttype TranscriptContext,\n} from \"@bastani/pi-ai/compat\";\nimport {\n\tCODEX_FAST_ROUTE_HEADER,\n\tCODEX_FAST_ROUTE_ORIGINATOR,\n\tclearCodexFastRouteRequestMarker,\n\tinstallCodexFastRouteWebSocketIdentity,\n\tisFirstPartyCodexBaseUrl,\n\tmarkCodexFastRouteRequest,\n\twrapCodexFastRouteFetch,\n} from \"./fast-model-routing-transport.ts\";\nimport { FAST_MODEL_SERVICE_TIER, isNativeFastRouteApi, ULTRAFAST_MODEL_SERVICE_TIER } from \"./fast-model-variants.ts\";\n\nexport interface FastRouteStreamOptions extends SimpleStreamOptions {\n\tserviceTier?: ModelFastRoute[\"serviceTier\"];\n}\n\nexport interface FastRouteStreamers {\n\tstreamSimple: (model: Model<Api>, context: Context, options?: SimpleStreamOptions) => AssistantMessageEventStream;\n\tstreamOpenAIResponses: (\n\t\tmodel: Model<\"openai-responses\">,\n\t\tcontext: TranscriptContext,\n\t\toptions?: OpenAIResponsesOptions,\n\t) => AssistantMessageEventStream;\n\tstreamOpenAICodexResponses: (\n\t\tmodel: Model<\"openai-codex-responses\">,\n\t\tcontext: TranscriptContext,\n\t\toptions?: OpenAICodexResponsesOptions,\n\t) => AssistantMessageEventStream;\n}\n\nconst DEFAULT_FAST_ROUTE_STREAMERS: FastRouteStreamers = {\n\tstreamSimple,\n\tstreamOpenAIResponses,\n\tstreamOpenAICodexResponses,\n};\n\nconst CODEX_WEBSOCKET_ROUTING_STATE_IDLE_MS = 6 * 60 * 1000;\nconst codexWebSocketRoutingState = new Map<string, { signature: string; expiry: ReturnType<typeof setTimeout> }>();\n\n/**\n * Explicit route metadata is the only source of fast semantics. A model whose ID merely ends in\n * `-fast` — a provider, `models.json`, or extension model that owns that exact ID — routes normally.\n */\nexport function getModelFastRoute(model: Pick<Model<Api>, \"fastRoute\">): ModelFastRoute | undefined {\n\treturn model.fastRoute;\n}\n\n/**\n * The model ID this request sends upstream. An OpenAI-style fast route sends the base model and\n * carries a priority service tier instead; a provider with real fast siblings sends its own\n * advertised ID, which is already the canonical one. The canonical `-fast` identity always stays on\n * the model object Atomic selected, persisted, and records — only the serialized request differs.\n */\nexport function resolveUpstreamModelId(model: Pick<Model<Api>, \"fastRoute\" | \"id\">): string {\n\treturn model.fastRoute?.upstreamModelId ?? model.id;\n}\n\n/**\n * Whether a model uses the first-party OpenAI Codex provider identity and endpoint.\n * A renamed provider on the same protocol remains non-first-party.\n */\nexport function usesFirstPartyCodexRouting(model: Pick<Model<Api>, \"baseUrl\" | \"provider\">): boolean {\n\treturn model.provider === \"openai-codex\" && isFirstPartyCodexBaseUrl(model.baseUrl);\n}\n\n/** A provider alias or proxy still uses the shared ChatGPT Codex protocol when its API does. */\nexport function usesChatGptCodexTransport(model: Pick<Model<Api>, \"api\">): boolean {\n\treturn model.api === \"openai-codex-responses\";\n}\n\nfunction deleteHeader(headers: ProviderHeaders, name: string): void {\n\tfor (const existingName of Object.keys(headers)) {\n\t\tif (existingName.toLowerCase() === name.toLowerCase()) delete headers[existingName];\n\t}\n}\n\nfunction setHeader(headers: ProviderHeaders, name: string, value: string): void {\n\tdeleteHeader(headers, name);\n\theaders[name] = value;\n}\n\n/**\n * Eager first-party routing headers for a model that carries an OpenAI-style fast route.\n *\n * Derived entirely from the model: the headers are added only when the model's own `fastRoute`\n * declares the priority tier and the model uses first-party Codex routing, and the hint names the\n * route's upstream model ID — the same value the request serializes and\n * `withChatGptCodexTransportRouting` reads from route metadata. There is no caller-supplied enable\n * flag, so a model without a route can never be granted this identity.\n */\nexport function withCodexFastRouteHeaders(\n\tmodel: Pick<Model<Api>, \"baseUrl\" | \"fastRoute\" | \"id\" | \"provider\">,\n\theaders: ProviderHeaders | undefined,\n): ProviderHeaders | undefined {\n\tconst tier = getModelFastRoute(model)?.serviceTier;\n\tif (tier === undefined || !usesFirstPartyCodexRouting(model)) {\n\t\treturn headers;\n\t}\n\tconst fastHeaders: ProviderHeaders = { ...(headers ?? {}) };\n\tsetHeader(fastHeaders, \"originator\", CODEX_FAST_ROUTE_ORIGINATOR);\n\tsetHeader(fastHeaders, CODEX_FAST_ROUTE_HEADER, `model=${resolveUpstreamModelId(model)};tier=${tier}`);\n\treturn fastHeaders;\n}\n\n/** Attach the route's service tier to the outgoing stream options. */\nexport function withFastRouteStreamOptions(\n\tfastRoute: ModelFastRoute | undefined,\n\toptions: SimpleStreamOptions | undefined,\n): FastRouteStreamOptions | undefined {\n\tif (fastRoute?.serviceTier === undefined) return options;\n\treturn { ...(options ?? {}), headers: options?.headers, serviceTier: fastRoute.serviceTier };\n}\n\n/** A service-tier route needs pi-ai's native adapters; `streamSimple` drops `serviceTier`. */\nexport function shouldUseNativeFastRoute(\n\tmodel: Pick<Model<Api>, \"api\">,\n\toptions: FastRouteStreamOptions | undefined,\n): boolean {\n\treturn (\n\t\tisNativeFastRouteApi(model.api) &&\n\t\t(options?.serviceTier === FAST_MODEL_SERVICE_TIER || options?.serviceTier === ULTRAFAST_MODEL_SERVICE_TIER)\n\t);\n}\n\nfunction codexEnvironmentScope(env: StreamOptions[\"env\"]): string {\n\tif (!env) return \"none\";\n\tconst serialized = JSON.stringify(Object.entries(env).sort(([left], [right]) => left.localeCompare(right)));\n\tlet hash = 2166136261;\n\tfor (let index = 0; index < serialized.length; index += 1) {\n\t\thash = Math.imul(hash ^ serialized.charCodeAt(index), 16777619);\n\t}\n\treturn (hash >>> 0).toString(16);\n}\n\ntype CloseCodexWebSocketSessions = typeof closeOpenAICodexWebSocketSessions;\nfunction updateCodexWebSocketRoutingState(\n\tmodel: Pick<Model<Api>, \"baseUrl\" | \"provider\">,\n\troutedModel: string,\n\toptions: Pick<StreamOptions, \"env\" | \"sessionId\" | \"transport\">,\n\ttier: ModelFastRoute[\"serviceTier\"],\n\tcloseWebSocketSessions: CloseCodexWebSocketSessions,\n): void {\n\tif (options.transport === \"sse\" || !options.sessionId) return;\n\tconst signature = `${model.provider}\\0${model.baseUrl}\\0${codexEnvironmentScope(options.env)}\\0${tier ? `${tier}:${routedModel}` : \"normal\"}`;\n\tconst previous = codexWebSocketRoutingState.get(options.sessionId);\n\tif (previous?.signature !== undefined && previous.signature !== signature) {\n\t\tcloseWebSocketSessions(options.sessionId);\n\t}\n\tif (previous) clearTimeout(previous.expiry);\n\tconst expiry = setTimeout(() => {\n\t\tif (codexWebSocketRoutingState.get(options.sessionId!)?.signature === signature) {\n\t\t\tcodexWebSocketRoutingState.delete(options.sessionId!);\n\t\t}\n\t}, CODEX_WEBSOCKET_ROUTING_STATE_IDLE_MS);\n\texpiry.unref?.();\n\tcodexWebSocketRoutingState.set(options.sessionId, { signature, expiry });\n}\n\nexport function withChatGptCodexTransportRouting<TOptions extends StreamOptions>(\n\tmodel: Model<Api>,\n\toptions: TOptions,\n\tcloseWebSocketSessions: CloseCodexWebSocketSessions = closeOpenAICodexWebSocketSessions,\n): TOptions {\n\tconst headers: ProviderHeaders = { ...(options.headers ?? {}) };\n\tconst onPayload = options.onPayload;\n\tconst tier = usesFirstPartyCodexRouting(model) ? getModelFastRoute(model)?.serviceTier : undefined;\n\tconst routedModel = resolveUpstreamModelId(model);\n\treturn {\n\t\t...options,\n\t\theaders,\n\t\tfetch: wrapCodexFastRouteFetch(options.fetch ?? globalThis.fetch),\n\t\tonPayload: async (payload, requestModel) => {\n\t\t\tconst replacement = await onPayload?.(payload, requestModel);\n\t\t\tconst finalPayload = replacement === undefined ? payload : replacement;\n\t\t\tdeleteHeader(headers, CODEX_FAST_ROUTE_HEADER);\n\t\t\tclearCodexFastRouteRequestMarker(headers);\n\t\t\tif (tier) {\n\t\t\t\tsetHeader(headers, CODEX_FAST_ROUTE_HEADER, `model=${routedModel};tier=${tier}`);\n\t\t\t} else {\n\t\t\t\tfor (const [name, value] of Object.entries(headers)) {\n\t\t\t\t\tif (name.toLowerCase() === \"originator\" && value === CODEX_FAST_ROUTE_ORIGINATOR) delete headers[name];\n\t\t\t\t}\n\t\t\t}\n\t\t\tmarkCodexFastRouteRequest(headers, tier !== undefined);\n\t\t\tupdateCodexWebSocketRoutingState(model, routedModel, options, tier, closeWebSocketSessions);\n\t\t\treturn finalPayload;\n\t\t},\n\t} as TOptions;\n}\n\nfunction buildFastRouteBaseProviderOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): StreamOptions {\n\tconst providerOptions: StreamOptions = {\n\t\tsamplingParams: options?.samplingParams,\n\t\ttemperature: options?.temperature,\n\t\tmaxTokens: options?.maxTokens,\n\t\tsignal: options?.signal,\n\t\tapiKey: options?.apiKey,\n\t\tfetch: options?.fetch,\n\t\tenv: options?.env,\n\t\ttelemetryContext: options?.telemetryContext,\n\t\ttransport: options?.transport,\n\t\tcacheRetention: options?.cacheRetention,\n\t\tsessionId: options?.sessionId,\n\t\tonPayload: options?.onPayload,\n\t\tonResponse: options?.onResponse,\n\t\tonProviderStreamEvent: options?.onProviderStreamEvent,\n\t\theaders: options?.headers,\n\t\ttimeoutMs: options?.timeoutMs,\n\t\twebsocketConnectTimeoutMs: options?.websocketConnectTimeoutMs,\n\t\tstreamDeadlineMs: options?.streamDeadlineMs,\n\t\tmaxRetries: options?.maxRetries,\n\t\tmaxRetryDelayMs: options?.maxRetryDelayMs,\n\t\tmetadata: options?.metadata,\n\t};\n\treturn usesChatGptCodexTransport(model) ? withChatGptCodexTransportRouting(model, providerOptions) : providerOptions;\n}\n\nexport function mapFastRouteReasoningEffort(\n\tmodel: Model<Api>,\n\treasoning: ThinkingLevel | undefined,\n): ThinkingLevel | undefined {\n\tconst clampedReasoning = reasoning ? clampThinkingLevel(model, reasoning) : undefined;\n\treturn clampedReasoning === \"off\" ? undefined : clampedReasoning;\n}\n\nexport function buildOpenAIResponsesFastRouteOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): OpenAIResponsesOptions {\n\treturn {\n\t\t...buildFastRouteBaseProviderOptions(model, options),\n\t\treasoningEffort: mapFastRouteReasoningEffort(model, options?.reasoning),\n\t\tserviceTier: options?.serviceTier,\n\t};\n}\n\nexport function buildOpenAICodexResponsesFastRouteOptions(\n\tmodel: Model<Api>,\n\toptions: FastRouteStreamOptions | undefined,\n): OpenAICodexResponsesOptions {\n\treturn {\n\t\t...buildFastRouteBaseProviderOptions(model, options),\n\t\treasoningEffort: mapFastRouteReasoningEffort(model, options?.reasoning),\n\t\tserviceTier: options?.serviceTier,\n\t};\n}\n\n/**\n * Stream a request whose canonical selected model carries fast-route metadata. The provider adapter\n * translates only the serialized request to the route's upstream ID; the model object keeps its\n * canonical `-fast` identity.\n */\nexport function streamWithFastRoute(\n\tmodel: Model<Api>,\n\tcontext: Context,\n\toptions: FastRouteStreamOptions | undefined,\n\tstreamers: FastRouteStreamers = DEFAULT_FAST_ROUTE_STREAMERS,\n): AssistantMessageEventStream {\n\tif (shouldUseNativeFastRoute(model, options)) {\n\t\tif (model.api === \"openai-responses\") {\n\t\t\treturn streamers.streamOpenAIResponses(\n\t\t\t\tmodel as Model<\"openai-responses\">,\n\t\t\t\tnormalizeContext(context),\n\t\t\t\tbuildOpenAIResponsesFastRouteOptions(model, options),\n\t\t\t);\n\t\t}\n\n\t\t// The WebSocket handshake builds its headers inside pi-ai, and the runtime\n\t\t// constructor can be cached before the first turn, so repair the identity\n\t\t// through the global constructor rather than per-request options.\n\t\tif (options?.transport !== \"sse\" && usesChatGptCodexTransport(model)) {\n\t\t\tinstallCodexFastRouteWebSocketIdentity();\n\t\t}\n\n\t\treturn streamers.streamOpenAICodexResponses(\n\t\t\tmodel as Model<\"openai-codex-responses\">,\n\t\t\tnormalizeContext(context),\n\t\t\tbuildOpenAICodexResponsesFastRouteOptions(model, options),\n\t\t);\n\t}\n\n\treturn streamers.streamSimple(model, context, options);\n}\n"]}
@@ -49,6 +49,15 @@ declare const ModelDefinitionSchema: Type.TObject<{
49
49
  contextWindow: Type.TOptional<Type.TNumber>;
50
50
  maxTokens: Type.TOptional<Type.TNumber>;
51
51
  samplingParams: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
52
+ samplingParamsByThinkingLevel: Type.TOptional<Type.TObject<{
53
+ off: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
54
+ minimal: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
55
+ low: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
56
+ medium: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
57
+ high: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
58
+ xhigh: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
59
+ max: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
60
+ }>>;
52
61
  headers: Type.TOptional<Type.TRecord<"^.*$", Type.TString>>;
53
62
  compat: Type.TOptional<Type.TUnion<[Type.TObject<{
54
63
  supportsStore: Type.TOptional<Type.TBoolean>;
@@ -206,6 +215,15 @@ declare const ModelOverrideSchema: Type.TObject<{
206
215
  contextWindow: Type.TOptional<Type.TNumber>;
207
216
  maxTokens: Type.TOptional<Type.TNumber>;
208
217
  samplingParams: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
218
+ samplingParamsByThinkingLevel: Type.TOptional<Type.TObject<{
219
+ off: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
220
+ minimal: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
221
+ low: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
222
+ medium: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
223
+ high: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
224
+ xhigh: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
225
+ max: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
226
+ }>>;
209
227
  headers: Type.TOptional<Type.TRecord<"^.*$", Type.TString>>;
210
228
  compat: Type.TOptional<Type.TUnion<[Type.TObject<{
211
229
  supportsStore: Type.TOptional<Type.TBoolean>;
@@ -483,6 +501,15 @@ declare const ProviderConfigSchema: Type.TObject<{
483
501
  contextWindow: Type.TOptional<Type.TNumber>;
484
502
  maxTokens: Type.TOptional<Type.TNumber>;
485
503
  samplingParams: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
504
+ samplingParamsByThinkingLevel: Type.TOptional<Type.TObject<{
505
+ off: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
506
+ minimal: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
507
+ low: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
508
+ medium: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
509
+ high: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
510
+ xhigh: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
511
+ max: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
512
+ }>>;
486
513
  headers: Type.TOptional<Type.TRecord<"^.*$", Type.TString>>;
487
514
  compat: Type.TOptional<Type.TUnion<[Type.TObject<{
488
515
  supportsStore: Type.TOptional<Type.TBoolean>;
@@ -640,6 +667,15 @@ declare const ProviderConfigSchema: Type.TObject<{
640
667
  contextWindow: Type.TOptional<Type.TNumber>;
641
668
  maxTokens: Type.TOptional<Type.TNumber>;
642
669
  samplingParams: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
670
+ samplingParamsByThinkingLevel: Type.TOptional<Type.TObject<{
671
+ off: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
672
+ minimal: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
673
+ low: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
674
+ medium: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
675
+ high: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
676
+ xhigh: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
677
+ max: Type.TOptional<Type.TRecord<"^.*$", Type.TUnknown>>;
678
+ }>>;
643
679
  headers: Type.TOptional<Type.TRecord<"^.*$", Type.TString>>;
644
680
  compat: Type.TOptional<Type.TUnion<[Type.TObject<{
645
681
  supportsStore: Type.TOptional<Type.TBoolean>;
@@ -1 +1 @@
1
- {"version":3,"file":"model-config.d.ts","sourceRoot":"","sources":["../../src/core/model-config.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAGxD,OAAO,EAAE,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAmM5C,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAWxB,CAAC;AAOH,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACnE,MAAM,MAAM,uBAAuB,GAAG,MAAM,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACzE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAsBrE,yCAAyC;AACzC,qBAAa,WAAW;IACvB,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0C;IACpE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAqB;IAE3C,OAAO,eAGN;IAED,OAAa,IAAI,CAAC,cAAc,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAuC1E;IAED,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS,CAE9D;IAED,cAAc,IAAI,SAAS,MAAM,EAAE,CAElC;IAED,QAAQ,IAAI,MAAM,GAAG,SAAS,CAE7B;CACD"}
@@ -52,6 +52,16 @@ const ThinkingLevelMapSchema = Type.Object({
52
52
  xhigh: Type.Optional(ThinkingLevelMapValueSchema),
53
53
  max: Type.Optional(ThinkingLevelMapValueSchema),
54
54
  });
55
+ const SamplingParamsSchema = Type.Record(Type.String(), Type.Unknown());
56
+ const SamplingParamsByThinkingLevelSchema = Type.Object({
57
+ off: Type.Optional(SamplingParamsSchema),
58
+ minimal: Type.Optional(SamplingParamsSchema),
59
+ low: Type.Optional(SamplingParamsSchema),
60
+ medium: Type.Optional(SamplingParamsSchema),
61
+ high: Type.Optional(SamplingParamsSchema),
62
+ xhigh: Type.Optional(SamplingParamsSchema),
63
+ max: Type.Optional(SamplingParamsSchema),
64
+ });
55
65
  const ChatTemplateKwargScalarSchema = Type.Union([Type.String(), Type.Number(), Type.Boolean(), Type.Null()]);
56
66
  const ChatTemplateKwargVariableSchema = Type.Object({
57
67
  $var: Type.Union([Type.Literal("thinking.enabled"), Type.Literal("thinking.effort")]),
@@ -176,7 +186,8 @@ const ModelDefinitionSchema = Type.Object({
176
186
  promptCache: Type.Optional(ModelPromptCacheSchema),
177
187
  contextWindow: Type.Optional(Type.Number()),
178
188
  maxTokens: Type.Optional(Type.Number()),
179
- samplingParams: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
189
+ samplingParams: Type.Optional(SamplingParamsSchema),
190
+ samplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),
180
191
  headers: Type.Optional(Type.Record(Type.String(), Type.String())),
181
192
  compat: Type.Optional(ProviderCompatSchema),
182
193
  });
@@ -196,7 +207,8 @@ const ModelOverrideSchema = Type.Object({
196
207
  promptCache: Type.Optional(ModelPromptCacheSchema),
197
208
  contextWindow: Type.Optional(Type.Number()),
198
209
  maxTokens: Type.Optional(Type.Number()),
199
- samplingParams: Type.Optional(Type.Record(Type.String(), Type.Unknown())),
210
+ samplingParams: Type.Optional(SamplingParamsSchema),
211
+ samplingParamsByThinkingLevel: Type.Optional(SamplingParamsByThinkingLevelSchema),
200
212
  headers: Type.Optional(Type.Record(Type.String(), Type.String())),
201
213
  compat: Type.Optional(ProviderCompatSchema),
202
214
  });