@bastani/atomic 0.9.11 → 0.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (119) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +12 -0
  3. package/dist/builtin/intercom/closed-workflow-stage-message.ts +1 -1
  4. package/dist/builtin/intercom/contact-supervisor-tool.ts +1 -1
  5. package/dist/builtin/intercom/index-heavy.ts +2 -2
  6. package/dist/builtin/intercom/intercom-tool.ts +2 -2
  7. package/dist/builtin/intercom/intercom-utils.ts +1 -1
  8. package/dist/builtin/intercom/lifecycle.ts +2 -2
  9. package/dist/builtin/intercom/overlay.ts +2 -2
  10. package/dist/builtin/intercom/package.json +1 -1
  11. package/dist/builtin/intercom/reply-tracker.ts +1 -1
  12. package/dist/builtin/intercom/subagent-relay.ts +2 -2
  13. package/dist/builtin/mcp/CHANGELOG.md +12 -0
  14. package/dist/builtin/mcp/apps-cancellation.ts +1 -1
  15. package/dist/builtin/mcp/commands.ts +7 -7
  16. package/dist/builtin/mcp/direct-tool-executor.ts +1 -1
  17. package/dist/builtin/mcp/direct-tools.ts +3 -3
  18. package/dist/builtin/mcp/host-html-template.ts +1 -1
  19. package/dist/builtin/mcp/index.ts +3 -3
  20. package/dist/builtin/mcp/init.ts +6 -6
  21. package/dist/builtin/mcp/mcp-auth-flow.ts +1 -1
  22. package/dist/builtin/mcp/mcp-callback-server.ts +1 -1
  23. package/dist/builtin/mcp/mcp-panel-state.ts +1 -1
  24. package/dist/builtin/mcp/mcp-panel.ts +1 -1
  25. package/dist/builtin/mcp/metadata-cache.ts +1 -1
  26. package/dist/builtin/mcp/package.json +1 -1
  27. package/dist/builtin/mcp/proxy-call.ts +2 -2
  28. package/dist/builtin/mcp/proxy-info-modes.ts +2 -2
  29. package/dist/builtin/mcp/sampling-handler.ts +1 -1
  30. package/dist/builtin/mcp/server-manager.ts +3 -3
  31. package/dist/builtin/mcp/startup-warmup.ts +5 -5
  32. package/dist/builtin/mcp/state.ts +1 -1
  33. package/dist/builtin/mcp/tool-call-timeout.ts +1 -1
  34. package/dist/builtin/mcp/tool-metadata.ts +2 -2
  35. package/dist/builtin/mcp/types.ts +1 -1
  36. package/dist/builtin/mcp/ui-server.ts +4 -4
  37. package/dist/builtin/mcp/ui-session.ts +3 -3
  38. package/dist/builtin/subagents/CHANGELOG.md +12 -0
  39. package/dist/builtin/subagents/package.json +1 -1
  40. package/dist/builtin/subagents/src/runs/background/result-delivery-processor.ts +5 -5
  41. package/dist/builtin/subagents/src/runs/background/result-file-claims.ts +1 -1
  42. package/dist/builtin/subagents/src/runs/background/result-status.ts +2 -2
  43. package/dist/builtin/subagents/src/runs/background/result-watcher-data.ts +2 -2
  44. package/dist/builtin/subagents/src/runs/background/result-watcher.ts +1 -1
  45. package/dist/builtin/subagents/src/runs/foreground/execution-detach-reservations.ts +1 -1
  46. package/dist/builtin/subagents/src/shared/artifacts.ts +1 -1
  47. package/dist/builtin/web-access/CHANGELOG.md +12 -0
  48. package/dist/builtin/web-access/index-heavy.ts +1 -1
  49. package/dist/builtin/web-access/package.json +1 -1
  50. package/dist/builtin/workflows/CHANGELOG.md +24 -0
  51. package/dist/builtin/workflows/README.md +1 -1
  52. package/dist/builtin/workflows/builtin/goal-prompts.ts +4 -1
  53. package/dist/builtin/workflows/builtin/ralph-core.ts +7 -4
  54. package/dist/builtin/workflows/builtin/ralph-forked-prompts.ts +5 -2
  55. package/dist/builtin/workflows/builtin/ralph-reviewer-prompt.ts +2 -1
  56. package/dist/builtin/workflows/builtin/ralph-runner.ts +2 -1
  57. package/dist/builtin/workflows/builtin/shared-prompts.ts +34 -7
  58. package/dist/builtin/workflows/package.json +1 -1
  59. package/dist/builtin/workflows/src/authoring/keep-context.ts +46 -0
  60. package/dist/builtin/workflows/src/authoring.d.ts +11 -0
  61. package/dist/builtin/workflows/src/extension/index.bundle.mjs +35 -17
  62. package/dist/builtin/workflows/src/extension/workflow-prompts.ts +4 -0
  63. package/dist/builtin/workflows/src/sdk-surface.ts +1 -0
  64. package/dist/core/agent-session-methods.d.ts +1 -1
  65. package/dist/core/agent-session-methods.js.map +1 -1
  66. package/dist/core/agent-session.d.ts +1 -1
  67. package/dist/core/agent-session.js.map +1 -1
  68. package/dist/core/async/session-manager.d.ts +1 -1
  69. package/dist/core/async/session-manager.js.map +1 -1
  70. package/dist/core/compaction/branch-summarization.js.map +1 -1
  71. package/dist/core/compaction/compaction-boundary.d.ts +2 -2
  72. package/dist/core/compaction/compaction-boundary.js.map +1 -1
  73. package/dist/core/compaction/compaction-parameters.d.ts +5 -0
  74. package/dist/core/compaction/compaction-parameters.d.ts.map +1 -1
  75. package/dist/core/compaction/compaction-parameters.js +6 -5
  76. package/dist/core/compaction/compaction-parameters.js.map +1 -1
  77. package/dist/core/compaction/compaction-runner.d.ts +4 -0
  78. package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
  79. package/dist/core/compaction/compaction-runner.js +5 -1
  80. package/dist/core/compaction/compaction-runner.js.map +1 -1
  81. package/dist/core/compaction/compaction-types.d.ts +7 -1
  82. package/dist/core/compaction/compaction-types.d.ts.map +1 -1
  83. package/dist/core/compaction/compaction-types.js.map +1 -1
  84. package/dist/core/compaction/deleted-ranges.d.ts.map +1 -1
  85. package/dist/core/compaction/deleted-ranges.js +2 -0
  86. package/dist/core/compaction/deleted-ranges.js.map +1 -1
  87. package/dist/core/compaction/fallback-planner.d.ts +1 -1
  88. package/dist/core/compaction/fallback-planner.js.map +1 -1
  89. package/dist/core/compaction/range-planner.d.ts +3 -3
  90. package/dist/core/compaction/range-planner.d.ts.map +1 -1
  91. package/dist/core/compaction/range-planner.js +12 -14
  92. package/dist/core/compaction/range-planner.js.map +1 -1
  93. package/dist/core/compaction/transcript-serialization.d.ts +12 -0
  94. package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
  95. package/dist/core/compaction/transcript-serialization.js +99 -1
  96. package/dist/core/compaction/transcript-serialization.js.map +1 -1
  97. package/dist/core/compaction/utils.d.ts +3 -0
  98. package/dist/core/compaction/utils.d.ts.map +1 -1
  99. package/dist/core/compaction/utils.js +16 -0
  100. package/dist/core/compaction/utils.js.map +1 -1
  101. package/dist/core/session-manager-history.js.map +1 -1
  102. package/dist/core/tools/bash-async-execution.d.ts +1 -1
  103. package/dist/core/tools/bash-async-execution.js.map +1 -1
  104. package/dist/core/tools/bash.js.map +1 -1
  105. package/dist/core/tools/oversized-tool-result.js.map +1 -1
  106. package/dist/extensions/index.d.ts +1 -1
  107. package/dist/extensions/index.js.map +1 -1
  108. package/dist/extensions/llama/huggingface-ui.d.ts +2 -2
  109. package/dist/extensions/llama/huggingface-ui.js.map +1 -1
  110. package/dist/extensions/llama/index.d.ts +1 -1
  111. package/dist/extensions/llama/index.js.map +1 -1
  112. package/dist/extensions/llama/ui.d.ts +1 -1
  113. package/dist/extensions/llama/ui.js.map +1 -1
  114. package/dist/modes/interactive-engine/remote-queue-pause.d.ts +1 -1
  115. package/dist/modes/interactive-engine/remote-queue-pause.js.map +1 -1
  116. package/docs/compaction.md +24 -0
  117. package/docs/workflows.md +56 -0
  118. package/npm-shrinkwrap.json +39 -39
  119. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/extensions/llama/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,SAAS,EAGT,UAAU,EACV,MAAM,EACN,IAAI,EAEJ,eAAe,EACf,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAIjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,cAAc,GAAG,YAAY,CAAC;AASpC,SAAS,YAAY,CAAC,KAAqB;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,KA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E,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;AAClD,CAAC","sourcesContent":["import {\n\ttype Component,\n\tContainer,\n\ttype Focusable,\n\ttype SelectItem,\n\tSelectList,\n\tSpacer,\n\tText,\n\ttype TUI,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@earendil-works/pi-tui\";\nimport type { ExtensionCommandContext } from \"../../core/extensions/types.js\";\nimport type { KeybindingsManager } from \"../../core/keybindings.js\";\nimport { DynamicBorder } from \"../../modes/interactive/components/dynamic-border.js\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.js\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.js\";\nimport type { LlamaModelInfo, LlamaProgress } from \"./client.js\";\nimport type { HuggingFaceModel } from \"./huggingface.js\";\nimport { HuggingFaceSearch } from \"./huggingface-ui.js\";\n\nconst DOWNLOAD_VALUE = \"\\0download\";\n\nexport type LlamaManagerAction = { type: \"model\"; model: LlamaModelInfo } | { type: \"download\" } | { type: \"close\" };\n\ninterface ProgressState extends LlamaProgress {\n\ttitle: string;\n\tmodel: string;\n}\n\nfunction contextLabel(model: LlamaModelInfo): string | undefined {\n\tconst context = model.meta?.n_ctx ?? model.meta?.n_ctx_train;\n\tif (context) return context >= 1000 ? `${Math.round(context / 1000)}k` : String(context);\n\tconst args = model.status.args ?? [];\n\tfor (let index = 0; index < args.length - 1; index++) {\n\t\tif (args[index] !== \"--ctx-size\" && args[index] !== \"-c\" && args[index] !== \"-ctx\") continue;\n\t\tconst value = Number(args[index + 1]);\n\t\tif (Number.isFinite(value) && value > 0) return value >= 1000 ? `${Math.round(value / 1000)}k` : String(value);\n\t}\n\treturn undefined;\n}\n\nfunction modelDescription(model: LlamaModelInfo): string {\n\tconst details: string[] = [];\n\tconst loaded = model.status.value === \"loaded\" || model.status.value === \"sleeping\";\n\tif (loaded) details.push(\"loaded\");\n\telse if (model.status.value !== \"unloaded\") details.push(model.status.value);\n\tconst context = loaded ? contextLabel(model) : undefined;\n\tif (context) details.push(`${context} context`);\n\treturn details.join(\" · \");\n}\n\nfunction selectTheme(theme: Theme) {\n\treturn {\n\t\tselectedPrefix: (text: string) => theme.fg(\"accent\", text),\n\t\tselectedText: (text: string) => theme.fg(\"accent\", text),\n\t\tdescription: (text: string) => theme.fg(\"muted\", text),\n\t\tscrollInfo: (text: string) => theme.fg(\"dim\", text),\n\t\tnoMatch: (text: string) => theme.fg(\"warning\", text),\n\t};\n}\n\nfunction frame(theme: Theme, title: string, body: Component[], footer?: string): Container {\n\tconst container = new Container();\n\tcontainer.addChild(new DynamicBorder((text: string) => theme.fg(\"accent\", text)));\n\tcontainer.addChild(new Text(theme.fg(\"accent\", theme.bold(title)), 1, 0));\n\tfor (const child of body) container.addChild(child);\n\tif (footer) {\n\t\tcontainer.addChild(new Spacer(1));\n\t\tcontainer.addChild(new Text(theme.fg(\"dim\", footer), 1, 0));\n\t}\n\tcontainer.addChild(new DynamicBorder((text: string) => theme.fg(\"accent\", text)));\n\treturn container;\n}\n\nexport interface LlamaUi {\n\tshowModels(serverUrl: string, models: LlamaModelInfo[]): Promise<LlamaManagerAction>;\n\tselect(title: string, options: string[]): Promise<string | undefined>;\n\tconfirm(title: string, message: string): Promise<boolean>;\n\tconnectionError(serverUrl: string, message: string): Promise<\"retry\" | \"close\">;\n\tsearchModels(\n\t\tsearch: (query: string, signal: AbortSignal) => Promise<HuggingFaceModel[]>,\n\t): Promise<string | undefined>;\n\tshowStatus(title: string, message: string): void;\n\tprogress(state: ProgressState): Promise<void>;\n\tupdateProgress(state: ProgressState): void;\n}\n\nclass LlamaView implements LlamaUi, Focusable {\n\tprivate readonly tui: TUI;\n\tprivate readonly theme: Theme;\n\tprivate readonly keybindings: KeybindingsManager;\n\tprivate readonly searchCache = new Map<string, HuggingFaceModel[]>();\n\tprivate content: Container;\n\tprivate inputHandler: { handleInput?(data: string): void } | undefined;\n\tprivate inputTarget: Focusable | undefined;\n\tprivate progressPromise: Promise<void> | undefined;\n\tprivate progressResolver: (() => void) | undefined;\n\tprivate showingProgress = false;\n\tprivate _focused = false;\n\n\tconstructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager) {\n\t\tthis.tui = tui;\n\t\tthis.theme = theme;\n\t\tthis.keybindings = keybindings;\n\t\tthis.content = frame(theme, \"llama.cpp models\", [new Text(theme.fg(\"muted\", \"Loading…\"), 1, 1)]);\n\t}\n\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tif (this.inputTarget) this.inputTarget.focused = value;\n\t}\n\n\tprivate setContent(\n\t\tcontent: Container,\n\t\tinputHandler?: { handleInput?(data: string): void },\n\t\tinputTarget?: Focusable,\n\t): void {\n\t\tif (this.inputTarget) this.inputTarget.focused = false;\n\t\tthis.progressPromise = undefined;\n\t\tthis.progressResolver = undefined;\n\t\tthis.showingProgress = false;\n\t\tthis.content = content;\n\t\tthis.inputHandler = inputHandler;\n\t\tthis.inputTarget = inputTarget;\n\t\tif (this.inputTarget) this.inputTarget.focused = this._focused;\n\t\tthis.tui.requestRender();\n\t}\n\n\tshowModels(serverUrl: string, models: LlamaModelInfo[]): Promise<LlamaManagerAction> {\n\t\tconst sorted = [...models].sort((left, right) => {\n\t\t\tconst loaded = Number(right.status.value === \"loaded\") - Number(left.status.value === \"loaded\");\n\t\t\treturn loaded || left.id.localeCompare(right.id);\n\t\t});\n\t\tconst byId = new Map(sorted.map((model) => [model.id, model]));\n\t\tconst items: SelectItem[] = [\n\t\t\t...sorted.map((model) => ({\n\t\t\t\tvalue: model.id,\n\t\t\t\tlabel: model.id,\n\t\t\t\tdescription: modelDescription(model),\n\t\t\t})),\n\t\t\t{ value: DOWNLOAD_VALUE, label: \"Download model…\", description: \"Hugging Face owner/repository[:quant]\" },\n\t\t];\n\t\treturn new Promise((resolve) => {\n\t\t\tconst list = new SelectList(items, Math.min(items.length, 12), selectTheme(this.theme), {\n\t\t\t\tminPrimaryColumnWidth: 36,\n\t\t\t\tmaxPrimaryColumnWidth: 56,\n\t\t\t});\n\t\t\tlist.onSelect = (item) => {\n\t\t\t\tif (item.value === DOWNLOAD_VALUE) resolve({ type: \"download\" });\n\t\t\t\telse {\n\t\t\t\t\tconst model = byId.get(item.value);\n\t\t\t\t\tif (model) resolve({ type: \"model\", model });\n\t\t\t\t}\n\t\t\t};\n\t\t\tlist.onCancel = () => resolve({ type: \"close\" });\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\t\"llama.cpp models\",\n\t\t\t\t\t[new Text(this.theme.fg(\"dim\", serverUrl), 1, 0), new Spacer(1), list],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"load/unload/download\")} • ${keyHint(\"tui.select.cancel\", \"close\")}`,\n\t\t\t\t),\n\t\t\t\tlist,\n\t\t\t);\n\t\t});\n\t}\n\n\tselect(title: string, options: string[]): Promise<string | undefined> {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst list = new SelectList(\n\t\t\t\toptions.map((option) => ({ value: option, label: option })),\n\t\t\t\tMath.min(options.length, 12),\n\t\t\t\tselectTheme(this.theme),\n\t\t\t);\n\t\t\tlist.onSelect = (item) => resolve(item.value);\n\t\t\tlist.onCancel = () => resolve(undefined);\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\ttitle,\n\t\t\t\t\t[new Spacer(1), list],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"select\")} • ${keyHint(\"tui.select.cancel\", \"cancel\")}`,\n\t\t\t\t),\n\t\t\t\tlist,\n\t\t\t);\n\t\t});\n\t}\n\n\tasync confirm(title: string, message: string): Promise<boolean> {\n\t\treturn (await this.select(`${title}\\n${message}`, [\"Yes\", \"No\"])) === \"Yes\";\n\t}\n\n\tasync connectionError(serverUrl: string, message: string): Promise<\"retry\" | \"close\"> {\n\t\tconst choice = await this.select(`llama.cpp unavailable\\n${serverUrl}\\n\\n${message}`, [\"Retry\", \"Close\"]);\n\t\treturn choice === \"Retry\" ? \"retry\" : \"close\";\n\t}\n\n\tsearchModels(\n\t\tsearch: (query: string, signal: AbortSignal) => Promise<HuggingFaceModel[]>,\n\t): Promise<string | undefined> {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst component = new HuggingFaceSearch(\n\t\t\t\tthis.tui,\n\t\t\t\tthis.theme,\n\t\t\t\tthis.keybindings,\n\t\t\t\tsearch,\n\t\t\t\tthis.searchCache,\n\t\t\t\tresolve,\n\t\t\t);\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\t\"Download model\",\n\t\t\t\t\t[new Spacer(1), component],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"select\")} • ${keyHint(\"tui.select.cancel\", \"back\")}`,\n\t\t\t\t),\n\t\t\t\tcomponent,\n\t\t\t\tcomponent,\n\t\t\t);\n\t\t});\n\t}\n\n\tshowStatus(title: string, message: string): void {\n\t\tthis.setContent(frame(this.theme, title, [new Spacer(1), new Text(this.theme.fg(\"muted\", message), 1, 0)]));\n\t}\n\n\tprogress(state: ProgressState): Promise<void> {\n\t\tif (!this.progressPromise) {\n\t\t\tthis.progressPromise = new Promise((resolve) => {\n\t\t\t\tthis.progressResolver = resolve;\n\t\t\t});\n\t\t}\n\t\tthis.showingProgress = true;\n\t\tthis.updateProgress(state);\n\t\treturn this.progressPromise;\n\t}\n\n\tupdateProgress(state: ProgressState): void {\n\t\tif (!this.showingProgress) return;\n\t\tconst body = [\n\t\t\tnew Text(this.theme.fg(\"text\", state.model), 1, 0),\n\t\t\tnew Spacer(1),\n\t\t\tnew Text(this.theme.fg(\"muted\", state.message), 1, 0),\n\t\t];\n\t\tif (state.ratio !== undefined) {\n\t\t\tconst available = 40;\n\t\t\tconst filled = Math.round(Math.max(0, Math.min(1, state.ratio)) * available);\n\t\t\tbody.push(\n\t\t\t\tnew Text(\n\t\t\t\t\tthis.theme.fg(\n\t\t\t\t\t\t\"accent\",\n\t\t\t\t\t\t`${\"█\".repeat(filled)}${\"─\".repeat(available - filled)} ${Math.round(state.ratio * 100)}%`,\n\t\t\t\t\t),\n\t\t\t\t\t1,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tif (state.detail) body.push(new Text(this.theme.fg(\"dim\", state.detail), 1, 0));\n\t\tthis.content = frame(this.theme, state.title, body, keyHint(\"tui.select.cancel\", \"stop\"));\n\t\tthis.inputHandler = undefined;\n\t\tthis.tui.requestRender();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (this.progressResolver && this.keybindings.matches(data, \"tui.select.cancel\")) {\n\t\t\tconst resolve = this.progressResolver;\n\t\t\tthis.progressPromise = undefined;\n\t\t\tthis.progressResolver = undefined;\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\t\tthis.inputHandler?.handleInput?.(data);\n\t\tthis.tui.requestRender();\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.content\n\t\t\t.render(width)\n\t\t\t.map((line) => (visibleWidth(line) > width ? truncateToWidth(line, width, \"\") : line));\n\t}\n\n\tinvalidate(): void {\n\t\tthis.content.invalidate();\n\t}\n}\n\nexport async function showLlamaUi(ctx: ExtensionCommandContext, run: (ui: LlamaUi) => Promise<void>): Promise<void> {\n\tawait ctx.ui.custom<void>((tui, theme, keybindings, done) => {\n\t\tconst view = new LlamaView(tui, theme, keybindings);\n\t\tvoid run(view).then(\n\t\t\t() => done(),\n\t\t\t(error: unknown) => {\n\t\t\t\tctx.ui.notify(error instanceof Error ? error.message : String(error), \"error\");\n\t\t\t\tdone();\n\t\t\t},\n\t\t);\n\t\treturn view;\n\t});\n}\n\nexport async function runWithProgress<T>(\n\tui: LlamaUi,\n\toptions: {\n\t\ttitle: string;\n\t\tmodel: string;\n\t\tinitialMessage: string;\n\t\tcancelTitle: string;\n\t\tcancelMessage: string;\n\t\trun(signal: AbortSignal, update: (progress: LlamaProgress) => void): Promise<T>;\n\t\tcancel(): Promise<void>;\n\t},\n): Promise<{ cancelled: true } | { cancelled: false; value: T }> {\n\tconst controller = new AbortController();\n\tconst state: ProgressState = { title: options.title, model: options.model, message: options.initialMessage };\n\tconst settled = options\n\t\t.run(controller.signal, (progress) => {\n\t\t\tObject.assign(state, progress);\n\t\t\tui.updateProgress(state);\n\t\t})\n\t\t.then(\n\t\t\t(value) => ({ ok: true as const, value }),\n\t\t\t(error: unknown) => ({ ok: false as const, error }),\n\t\t);\n\tlet completed = false;\n\tsettled.finally(() => {\n\t\tcompleted = true;\n\t});\n\n\twhile (!completed) {\n\t\tconst outcome = await Promise.race([\n\t\t\tsettled.then(() => \"settled\" as const),\n\t\t\tui.progress(state).then(() => \"stop\" as const),\n\t\t]);\n\t\tif (outcome === \"settled\") break;\n\t\tconst stop = await ui.confirm(options.cancelTitle, options.cancelMessage);\n\t\tif (!stop || completed) continue;\n\t\ttry {\n\t\t\tawait options.cancel();\n\t\t} finally {\n\t\t\tcontroller.abort(new Error(\"Cancelled\"));\n\t\t}\n\t\tawait settled;\n\t\treturn { cancelled: true };\n\t}\n\n\tconst result = await settled;\n\tif (!result.ok) throw result.error;\n\treturn { cancelled: false, value: result.value };\n}\n"]}
1
+ {"version":3,"file":"ui.js","sourceRoot":"","sources":["../../../src/extensions/llama/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAEN,SAAS,EAGT,UAAU,EACV,MAAM,EACN,IAAI,EAEJ,eAAe,EACf,YAAY,GACZ,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AACrF,OAAO,EAAE,OAAO,EAAE,MAAM,wDAAwD,CAAC;AAIjF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAExD,MAAM,cAAc,GAAG,YAAY,CAAC;AASpC,SAAS,YAAY,CAAC,KAAqB;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,KAAK,IAAI,KAAK,CAAC,IAAI,EAAE,WA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C,KAAK,EAAE,CAAC;AAClD,CAAC","sourcesContent":["import {\n\ttype Component,\n\tContainer,\n\ttype Focusable,\n\ttype SelectItem,\n\tSelectList,\n\tSpacer,\n\tText,\n\ttype TUI,\n\ttruncateToWidth,\n\tvisibleWidth,\n} from \"@earendil-works/pi-tui\";\nimport type { ExtensionCommandContext } from \"../../core/extensions/types.ts\";\nimport type { KeybindingsManager } from \"../../core/keybindings.ts\";\nimport { DynamicBorder } from \"../../modes/interactive/components/dynamic-border.ts\";\nimport { keyHint } from \"../../modes/interactive/components/keybinding-hints.ts\";\nimport type { Theme } from \"../../modes/interactive/theme/theme.ts\";\nimport type { LlamaModelInfo, LlamaProgress } from \"./client.js\";\nimport type { HuggingFaceModel } from \"./huggingface.js\";\nimport { HuggingFaceSearch } from \"./huggingface-ui.js\";\n\nconst DOWNLOAD_VALUE = \"\\0download\";\n\nexport type LlamaManagerAction = { type: \"model\"; model: LlamaModelInfo } | { type: \"download\" } | { type: \"close\" };\n\ninterface ProgressState extends LlamaProgress {\n\ttitle: string;\n\tmodel: string;\n}\n\nfunction contextLabel(model: LlamaModelInfo): string | undefined {\n\tconst context = model.meta?.n_ctx ?? model.meta?.n_ctx_train;\n\tif (context) return context >= 1000 ? `${Math.round(context / 1000)}k` : String(context);\n\tconst args = model.status.args ?? [];\n\tfor (let index = 0; index < args.length - 1; index++) {\n\t\tif (args[index] !== \"--ctx-size\" && args[index] !== \"-c\" && args[index] !== \"-ctx\") continue;\n\t\tconst value = Number(args[index + 1]);\n\t\tif (Number.isFinite(value) && value > 0) return value >= 1000 ? `${Math.round(value / 1000)}k` : String(value);\n\t}\n\treturn undefined;\n}\n\nfunction modelDescription(model: LlamaModelInfo): string {\n\tconst details: string[] = [];\n\tconst loaded = model.status.value === \"loaded\" || model.status.value === \"sleeping\";\n\tif (loaded) details.push(\"loaded\");\n\telse if (model.status.value !== \"unloaded\") details.push(model.status.value);\n\tconst context = loaded ? contextLabel(model) : undefined;\n\tif (context) details.push(`${context} context`);\n\treturn details.join(\" · \");\n}\n\nfunction selectTheme(theme: Theme) {\n\treturn {\n\t\tselectedPrefix: (text: string) => theme.fg(\"accent\", text),\n\t\tselectedText: (text: string) => theme.fg(\"accent\", text),\n\t\tdescription: (text: string) => theme.fg(\"muted\", text),\n\t\tscrollInfo: (text: string) => theme.fg(\"dim\", text),\n\t\tnoMatch: (text: string) => theme.fg(\"warning\", text),\n\t};\n}\n\nfunction frame(theme: Theme, title: string, body: Component[], footer?: string): Container {\n\tconst container = new Container();\n\tcontainer.addChild(new DynamicBorder((text: string) => theme.fg(\"accent\", text)));\n\tcontainer.addChild(new Text(theme.fg(\"accent\", theme.bold(title)), 1, 0));\n\tfor (const child of body) container.addChild(child);\n\tif (footer) {\n\t\tcontainer.addChild(new Spacer(1));\n\t\tcontainer.addChild(new Text(theme.fg(\"dim\", footer), 1, 0));\n\t}\n\tcontainer.addChild(new DynamicBorder((text: string) => theme.fg(\"accent\", text)));\n\treturn container;\n}\n\nexport interface LlamaUi {\n\tshowModels(serverUrl: string, models: LlamaModelInfo[]): Promise<LlamaManagerAction>;\n\tselect(title: string, options: string[]): Promise<string | undefined>;\n\tconfirm(title: string, message: string): Promise<boolean>;\n\tconnectionError(serverUrl: string, message: string): Promise<\"retry\" | \"close\">;\n\tsearchModels(\n\t\tsearch: (query: string, signal: AbortSignal) => Promise<HuggingFaceModel[]>,\n\t): Promise<string | undefined>;\n\tshowStatus(title: string, message: string): void;\n\tprogress(state: ProgressState): Promise<void>;\n\tupdateProgress(state: ProgressState): void;\n}\n\nclass LlamaView implements LlamaUi, Focusable {\n\tprivate readonly tui: TUI;\n\tprivate readonly theme: Theme;\n\tprivate readonly keybindings: KeybindingsManager;\n\tprivate readonly searchCache = new Map<string, HuggingFaceModel[]>();\n\tprivate content: Container;\n\tprivate inputHandler: { handleInput?(data: string): void } | undefined;\n\tprivate inputTarget: Focusable | undefined;\n\tprivate progressPromise: Promise<void> | undefined;\n\tprivate progressResolver: (() => void) | undefined;\n\tprivate showingProgress = false;\n\tprivate _focused = false;\n\n\tconstructor(tui: TUI, theme: Theme, keybindings: KeybindingsManager) {\n\t\tthis.tui = tui;\n\t\tthis.theme = theme;\n\t\tthis.keybindings = keybindings;\n\t\tthis.content = frame(theme, \"llama.cpp models\", [new Text(theme.fg(\"muted\", \"Loading…\"), 1, 1)]);\n\t}\n\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tif (this.inputTarget) this.inputTarget.focused = value;\n\t}\n\n\tprivate setContent(\n\t\tcontent: Container,\n\t\tinputHandler?: { handleInput?(data: string): void },\n\t\tinputTarget?: Focusable,\n\t): void {\n\t\tif (this.inputTarget) this.inputTarget.focused = false;\n\t\tthis.progressPromise = undefined;\n\t\tthis.progressResolver = undefined;\n\t\tthis.showingProgress = false;\n\t\tthis.content = content;\n\t\tthis.inputHandler = inputHandler;\n\t\tthis.inputTarget = inputTarget;\n\t\tif (this.inputTarget) this.inputTarget.focused = this._focused;\n\t\tthis.tui.requestRender();\n\t}\n\n\tshowModels(serverUrl: string, models: LlamaModelInfo[]): Promise<LlamaManagerAction> {\n\t\tconst sorted = [...models].sort((left, right) => {\n\t\t\tconst loaded = Number(right.status.value === \"loaded\") - Number(left.status.value === \"loaded\");\n\t\t\treturn loaded || left.id.localeCompare(right.id);\n\t\t});\n\t\tconst byId = new Map(sorted.map((model) => [model.id, model]));\n\t\tconst items: SelectItem[] = [\n\t\t\t...sorted.map((model) => ({\n\t\t\t\tvalue: model.id,\n\t\t\t\tlabel: model.id,\n\t\t\t\tdescription: modelDescription(model),\n\t\t\t})),\n\t\t\t{ value: DOWNLOAD_VALUE, label: \"Download model…\", description: \"Hugging Face owner/repository[:quant]\" },\n\t\t];\n\t\treturn new Promise((resolve) => {\n\t\t\tconst list = new SelectList(items, Math.min(items.length, 12), selectTheme(this.theme), {\n\t\t\t\tminPrimaryColumnWidth: 36,\n\t\t\t\tmaxPrimaryColumnWidth: 56,\n\t\t\t});\n\t\t\tlist.onSelect = (item) => {\n\t\t\t\tif (item.value === DOWNLOAD_VALUE) resolve({ type: \"download\" });\n\t\t\t\telse {\n\t\t\t\t\tconst model = byId.get(item.value);\n\t\t\t\t\tif (model) resolve({ type: \"model\", model });\n\t\t\t\t}\n\t\t\t};\n\t\t\tlist.onCancel = () => resolve({ type: \"close\" });\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\t\"llama.cpp models\",\n\t\t\t\t\t[new Text(this.theme.fg(\"dim\", serverUrl), 1, 0), new Spacer(1), list],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"load/unload/download\")} • ${keyHint(\"tui.select.cancel\", \"close\")}`,\n\t\t\t\t),\n\t\t\t\tlist,\n\t\t\t);\n\t\t});\n\t}\n\n\tselect(title: string, options: string[]): Promise<string | undefined> {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst list = new SelectList(\n\t\t\t\toptions.map((option) => ({ value: option, label: option })),\n\t\t\t\tMath.min(options.length, 12),\n\t\t\t\tselectTheme(this.theme),\n\t\t\t);\n\t\t\tlist.onSelect = (item) => resolve(item.value);\n\t\t\tlist.onCancel = () => resolve(undefined);\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\ttitle,\n\t\t\t\t\t[new Spacer(1), list],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"select\")} • ${keyHint(\"tui.select.cancel\", \"cancel\")}`,\n\t\t\t\t),\n\t\t\t\tlist,\n\t\t\t);\n\t\t});\n\t}\n\n\tasync confirm(title: string, message: string): Promise<boolean> {\n\t\treturn (await this.select(`${title}\\n${message}`, [\"Yes\", \"No\"])) === \"Yes\";\n\t}\n\n\tasync connectionError(serverUrl: string, message: string): Promise<\"retry\" | \"close\"> {\n\t\tconst choice = await this.select(`llama.cpp unavailable\\n${serverUrl}\\n\\n${message}`, [\"Retry\", \"Close\"]);\n\t\treturn choice === \"Retry\" ? \"retry\" : \"close\";\n\t}\n\n\tsearchModels(\n\t\tsearch: (query: string, signal: AbortSignal) => Promise<HuggingFaceModel[]>,\n\t): Promise<string | undefined> {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst component = new HuggingFaceSearch(\n\t\t\t\tthis.tui,\n\t\t\t\tthis.theme,\n\t\t\t\tthis.keybindings,\n\t\t\t\tsearch,\n\t\t\t\tthis.searchCache,\n\t\t\t\tresolve,\n\t\t\t);\n\t\t\tthis.setContent(\n\t\t\t\tframe(\n\t\t\t\t\tthis.theme,\n\t\t\t\t\t\"Download model\",\n\t\t\t\t\t[new Spacer(1), component],\n\t\t\t\t\t`${keyHint(\"tui.select.confirm\", \"select\")} • ${keyHint(\"tui.select.cancel\", \"back\")}`,\n\t\t\t\t),\n\t\t\t\tcomponent,\n\t\t\t\tcomponent,\n\t\t\t);\n\t\t});\n\t}\n\n\tshowStatus(title: string, message: string): void {\n\t\tthis.setContent(frame(this.theme, title, [new Spacer(1), new Text(this.theme.fg(\"muted\", message), 1, 0)]));\n\t}\n\n\tprogress(state: ProgressState): Promise<void> {\n\t\tif (!this.progressPromise) {\n\t\t\tthis.progressPromise = new Promise((resolve) => {\n\t\t\t\tthis.progressResolver = resolve;\n\t\t\t});\n\t\t}\n\t\tthis.showingProgress = true;\n\t\tthis.updateProgress(state);\n\t\treturn this.progressPromise;\n\t}\n\n\tupdateProgress(state: ProgressState): void {\n\t\tif (!this.showingProgress) return;\n\t\tconst body = [\n\t\t\tnew Text(this.theme.fg(\"text\", state.model), 1, 0),\n\t\t\tnew Spacer(1),\n\t\t\tnew Text(this.theme.fg(\"muted\", state.message), 1, 0),\n\t\t];\n\t\tif (state.ratio !== undefined) {\n\t\t\tconst available = 40;\n\t\t\tconst filled = Math.round(Math.max(0, Math.min(1, state.ratio)) * available);\n\t\t\tbody.push(\n\t\t\t\tnew Text(\n\t\t\t\t\tthis.theme.fg(\n\t\t\t\t\t\t\"accent\",\n\t\t\t\t\t\t`${\"█\".repeat(filled)}${\"─\".repeat(available - filled)} ${Math.round(state.ratio * 100)}%`,\n\t\t\t\t\t),\n\t\t\t\t\t1,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tif (state.detail) body.push(new Text(this.theme.fg(\"dim\", state.detail), 1, 0));\n\t\tthis.content = frame(this.theme, state.title, body, keyHint(\"tui.select.cancel\", \"stop\"));\n\t\tthis.inputHandler = undefined;\n\t\tthis.tui.requestRender();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (this.progressResolver && this.keybindings.matches(data, \"tui.select.cancel\")) {\n\t\t\tconst resolve = this.progressResolver;\n\t\t\tthis.progressPromise = undefined;\n\t\t\tthis.progressResolver = undefined;\n\t\t\tresolve();\n\t\t\treturn;\n\t\t}\n\t\tthis.inputHandler?.handleInput?.(data);\n\t\tthis.tui.requestRender();\n\t}\n\n\trender(width: number): string[] {\n\t\treturn this.content\n\t\t\t.render(width)\n\t\t\t.map((line) => (visibleWidth(line) > width ? truncateToWidth(line, width, \"\") : line));\n\t}\n\n\tinvalidate(): void {\n\t\tthis.content.invalidate();\n\t}\n}\n\nexport async function showLlamaUi(ctx: ExtensionCommandContext, run: (ui: LlamaUi) => Promise<void>): Promise<void> {\n\tawait ctx.ui.custom<void>((tui, theme, keybindings, done) => {\n\t\tconst view = new LlamaView(tui, theme, keybindings);\n\t\tvoid run(view).then(\n\t\t\t() => done(),\n\t\t\t(error: unknown) => {\n\t\t\t\tctx.ui.notify(error instanceof Error ? error.message : String(error), \"error\");\n\t\t\t\tdone();\n\t\t\t},\n\t\t);\n\t\treturn view;\n\t});\n}\n\nexport async function runWithProgress<T>(\n\tui: LlamaUi,\n\toptions: {\n\t\ttitle: string;\n\t\tmodel: string;\n\t\tinitialMessage: string;\n\t\tcancelTitle: string;\n\t\tcancelMessage: string;\n\t\trun(signal: AbortSignal, update: (progress: LlamaProgress) => void): Promise<T>;\n\t\tcancel(): Promise<void>;\n\t},\n): Promise<{ cancelled: true } | { cancelled: false; value: T }> {\n\tconst controller = new AbortController();\n\tconst state: ProgressState = { title: options.title, model: options.model, message: options.initialMessage };\n\tconst settled = options\n\t\t.run(controller.signal, (progress) => {\n\t\t\tObject.assign(state, progress);\n\t\t\tui.updateProgress(state);\n\t\t})\n\t\t.then(\n\t\t\t(value) => ({ ok: true as const, value }),\n\t\t\t(error: unknown) => ({ ok: false as const, error }),\n\t\t);\n\tlet completed = false;\n\tsettled.finally(() => {\n\t\tcompleted = true;\n\t});\n\n\twhile (!completed) {\n\t\tconst outcome = await Promise.race([\n\t\t\tsettled.then(() => \"settled\" as const),\n\t\t\tui.progress(state).then(() => \"stop\" as const),\n\t\t]);\n\t\tif (outcome === \"settled\") break;\n\t\tconst stop = await ui.confirm(options.cancelTitle, options.cancelMessage);\n\t\tif (!stop || completed) continue;\n\t\ttry {\n\t\t\tawait options.cancel();\n\t\t} finally {\n\t\t\tcontroller.abort(new Error(\"Cancelled\"));\n\t\t}\n\t\tawait settled;\n\t\treturn { cancelled: true };\n\t}\n\n\tconst result = await settled;\n\tif (!result.ok) throw result.error;\n\treturn { cancelled: false, value: result.value };\n}\n"]}
@@ -1,4 +1,4 @@
1
- import type { RpcClient } from "../rpc/rpc-client.js";
1
+ import type { RpcClient } from "../rpc/rpc-client.ts";
2
2
  export declare class RemoteQueuePause {
3
3
  private paused;
4
4
  private pauseRequest;
@@ -1 +1 @@
1
- {"version":3,"file":"remote-queue-pause.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-queue-pause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,MAAM,OAAO,gBAAgB;IAK5B,YAAY,MAA0C;QAJ9C,WAAM,GAAG,KAAK,CAAC;QAKtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,MAAe;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED,KAAK;QACJ,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,aAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC/B,IAAI,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,CAAC,YAAY,CAAC;QAC/C,aAAa,EAAE,EAAE,CAAC;QAClB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAwB,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAClH,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,iBAAiB;QACtB,IAAI,IAAI,CAAC,YAAY;YAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;CACD","sourcesContent":["import { sleep } from \"../../utils/sleep.js\";\nimport type { RpcClient } from \"../rpc/rpc-client.js\";\n\nexport class RemoteQueuePause {\n\tprivate paused = false;\n\tprivate pauseRequest: Promise<void> | undefined;\n\tprivate readonly client: Pick<RpcClient, \"requestInternal\">;\n\n\tconstructor(client: Pick<RpcClient, \"requestInternal\">) {\n\t\tthis.client = client;\n\t}\n\n\tget isPaused(): boolean {\n\t\treturn this.paused;\n\t}\n\n\tsynchronize(paused: boolean): void {\n\t\tthis.paused = paused;\n\t\tthis.pauseRequest = undefined;\n\t}\n\n\tpause(): void {\n\t\tif (this.paused) return;\n\t\tthis.paused = true;\n\t\tconst request = this.client.requestInternal<void>({ type: \"pause_queued_messages\" });\n\t\tthis.pauseRequest = request;\n\t\tvoid request.catch(() => {});\n\t}\n\n\tasync resume(beforeRelease?: () => void): Promise<boolean> {\n\t\tif (!this.paused) return false;\n\t\tif (this.pauseRequest) await this.pauseRequest;\n\t\tbeforeRelease?.();\n\t\tconst { released } = await this.client.requestInternal<{ released: boolean }>({ type: \"resume_queued_messages\" });\n\t\tthis.pauseRequest = undefined;\n\t\tthis.paused = false;\n\t\treturn released;\n\t}\n\n\tasync settleBeforeAbort(): Promise<void> {\n\t\tif (this.pauseRequest) await Promise.race([this.pauseRequest, sleep(100)]);\n\t}\n}\n"]}
1
+ {"version":3,"file":"remote-queue-pause.js","sourceRoot":"","sources":["../../../src/modes/interactive-engine/remote-queue-pause.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAG7C,MAAM,OAAO,gBAAgB;IAK5B,YAAY,MAA0C;QAJ9C,WAAM,GAAG,KAAK,CAAC;QAKtB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED,IAAI,QAAQ;QACX,OAAO,IAAI,CAAC,MAAM,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,MAAe;QAC1B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;IAC/B,CAAC;IAED,KAAK;QACJ,IAAI,IAAI,CAAC,MAAM;YAAE,OAAO;QACxB,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;QACnB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,CAAO,EAAE,IAAI,EAAE,uBAAuB,EAAE,CAAC,CAAC;QACrF,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC;QAC5B,KAAK,OAAO,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC9B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,aAA0B;QACtC,IAAI,CAAC,IAAI,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC/B,IAAI,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,CAAC,YAAY,CAAC;QAC/C,aAAa,EAAE,EAAE,CAAC;QAClB,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,CAAwB,EAAE,IAAI,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAClH,IAAI,CAAC,YAAY,GAAG,SAAS,CAAC;QAC9B,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC;QACpB,OAAO,QAAQ,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,iBAAiB;QACtB,IAAI,IAAI,CAAC,YAAY;YAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,YAAY,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5E,CAAC;CACD","sourcesContent":["import { sleep } from \"../../utils/sleep.ts\";\nimport type { RpcClient } from \"../rpc/rpc-client.ts\";\n\nexport class RemoteQueuePause {\n\tprivate paused = false;\n\tprivate pauseRequest: Promise<void> | undefined;\n\tprivate readonly client: Pick<RpcClient, \"requestInternal\">;\n\n\tconstructor(client: Pick<RpcClient, \"requestInternal\">) {\n\t\tthis.client = client;\n\t}\n\n\tget isPaused(): boolean {\n\t\treturn this.paused;\n\t}\n\n\tsynchronize(paused: boolean): void {\n\t\tthis.paused = paused;\n\t\tthis.pauseRequest = undefined;\n\t}\n\n\tpause(): void {\n\t\tif (this.paused) return;\n\t\tthis.paused = true;\n\t\tconst request = this.client.requestInternal<void>({ type: \"pause_queued_messages\" });\n\t\tthis.pauseRequest = request;\n\t\tvoid request.catch(() => {});\n\t}\n\n\tasync resume(beforeRelease?: () => void): Promise<boolean> {\n\t\tif (!this.paused) return false;\n\t\tif (this.pauseRequest) await this.pauseRequest;\n\t\tbeforeRelease?.();\n\t\tconst { released } = await this.client.requestInternal<{ released: boolean }>({ type: \"resume_queued_messages\" });\n\t\tthis.pauseRequest = undefined;\n\t\tthis.paused = false;\n\t\treturn released;\n\t}\n\n\tasync settleBeforeAbort(): Promise<void> {\n\t\tif (this.pauseRequest) await Promise.race([this.pauseRequest, sleep(100)]);\n\t}\n}\n"]}
@@ -54,6 +54,28 @@ Role-header lines such as `[User]:` and `[Assistant]:` are ordinary ranked lines
54
54
 
55
55
  Images in the compactable region become the literal line `[image]`; images in the protected recent tail remain normal image content. Tool-result text remains capped at 16,000 characters before becoming durable compaction text, with an explicit truncation marker for the remainder.
56
56
 
57
+ ### `keepContext` tags
58
+
59
+ Wrap any section you never want compressed in `<keepContext>` / `</keepContext>`. Tagged content survives compression verbatim regardless of the compression ratio:
60
+
61
+ ```
62
+ <keepContext>
63
+ You are researching only. Do not implement code changes.
64
+ </keepContext>
65
+ ```
66
+
67
+ Every line of the span becomes a protected line, tag lines included, and the guarantee is mechanical rather than advisory: deletion ranges are split around protected lines after the planner responds, so a protected line survives even if the planner ignores its instructions.
68
+
69
+ Three properties are worth knowing when using this for long-lived instructions:
70
+
71
+ - **Spans re-arm themselves.** Each compaction re-ranks the previous compaction's output, so a constraint must survive every cycle, not just the first. Because the tag lines are protected too, the span is re-detected on the next boundary and stays protected for the life of the session.
72
+ - **Tags are structural and bounded.** Each tag must be the whole line, after the transcript's role header — a tag mentioned inside prose is payload, not syntax. A span opens and closes within one message, and an unclosed span protects through the end of *its own message*, never the rest of the region. User and assistant messages may both protect: prompts, run inputs, and steering arrive as user messages, and an agent may pin its own core information — a restated contract amendment, a decision that changes later behavior. Tags inside **tool results** are inert, because that payload is file contents, fetched pages, and command output, and honoring it would let read material mark itself unreclaimable and persist ahead of real content; restate what matters in your own message instead. A closing tag with no opener is ignored.
73
+ - **Kept content counts against the compression budget.** Protection does not raise the keep target. Protect 40% under a `compression_ratio` of `0.5` and the remaining 60% compresses harder to reach the same total, so the ratio stays a real bound on output size. Protecting more therefore costs the surrounding transcript, which is why the guidance is to tag the constraint rather than the material it applies to.
74
+
75
+ Results report the force-preserved ranges as `keptRanges`, so protection that fired unexpectedly is diagnosable rather than a silent reduction in what compaction reclaimed.
76
+
77
+ Use it for role constraints, invariants, and anything whose loss would silently change behavior. Prefer it over restating a constraint: without tags, a one-line constraint competes line-by-line against bulky tool output and is the cheaper deletion.
78
+
57
79
  ## Parameters
58
80
 
59
81
  The effective parameters appear in extension events and successful results:
@@ -66,6 +88,8 @@ The effective parameters appear in extension events and successful results:
66
88
 
67
89
  `preserve_recent` counts context-visible messages without aligning the boundary to a user turn. An assistant message or tool result may therefore begin the kept tail. Because such a tail can start or end mid-turn, the kept messages are not replayed as structured message blocks: they are serialized with the same transcript grammar as the compacted region and appended to the end of the boundary string, so the whole boundary reaches the provider as one message. Serialization of the kept tail is lossless — tool results keep their full text instead of being truncated at 16k characters, and images stay attached as image blocks rather than becoming `[image]` markers — so protected content is preserved, not merely summarized. A value of `0` protects no messages and makes the entire active transcript compactable. If `query` is absent, Atomic derives it from the last visible user message.
68
90
 
91
+ The query is used whole and is never truncated. This matters for structured prompts: a truncated query would make section order the retention policy, because only the leading section could influence what the planner kept, and a constraint stated later in the prompt could not. Long queries are safe — an oversized planner request surfaces as an explicit provider-overflow failure rather than silent truncation — but `keepContext` tags, not query length, are the way to guarantee a span survives.
92
+
69
93
  Configure defaults in `~/.atomic/agent/settings.json` or `.atomic/settings.json`:
70
94
 
71
95
  ```json
package/docs/workflows.md CHANGED
@@ -633,6 +633,60 @@ While implementing:
633
633
 
634
634
  At the end, report three things: what the contract was, evidence each criterion passes, and the deferred list. Scope changes belong in the report, never in the diff.
635
635
 
636
+ ### Protect the contract from compaction
637
+
638
+ A long-running stage gets compacted, and compaction ranks lines individually rather than preserving whole instructions. That ranking has a bias worth knowing: an objective is verbose and restated, while the constraint that bounds it is usually one line. Rank them independently and the constraint is the cheaper deletion — so what survives is coherent, actionable, and missing its boundary conditions. A prohibition removed from context reads as permission.
639
+
640
+ Wrap contract text in `keepContext` so it survives verbatim regardless of the compression ratio:
641
+
642
+ ```ts
643
+ import { keepContext, workflow } from "@bastani/workflows";
644
+
645
+ const prompt = [
646
+ keepContext("Research only. Do not implement code changes."),
647
+ `Investigate: ${ctx.inputs.question}`,
648
+ ].join("\n\n");
649
+ ```
650
+
651
+ Every line of the span is protected, tag lines included. The guarantee is mechanical rather than advisory: protected lines are removed from the planner's deletion ranges after it responds. Because the tag lines are protected too, the span is re-detected on each later boundary — which matters, since every compaction re-ranks the previous compaction's output, so a constraint must survive every cycle rather than only the first. Tags must sit on their own line, and a span is scoped to one message. User and assistant messages may both protect — stage prompts, run inputs, and steering arrive as user messages, and a stage may pin its own core information — while tags inside tool results are inert, so file, page, or command output a stage reads cannot mark itself unreclaimable.
652
+
653
+ `keepContext` is a pure string helper, not a `ctx.*` primitive: it creates no graph node and has no side effect, so call it anywhere a prompt is assembled. It is idempotent, so composing already-wrapped text will not nest.
654
+
655
+ Tag:
656
+
657
+ - role constraints that bound a stage to part of the work — "research only", "review and report, do not repair";
658
+ - acceptance criteria and immutable contracts a later stage is judged against;
659
+ - explicit prohibitions;
660
+ - identifiers a stage must not lose, such as a target branch, worktree path, or run ID.
661
+
662
+ Do not tag bulk context. Protected lines count against the keep target rather than raising it, so a large protected span makes the surrounding transcript compress harder. Tag the constraint, not the material it applies to — pass that through files and `reads`.
663
+
664
+ Every builtin does this for its own invariants: the steering propagation contract, the literal objective contract, scope discipline, worktree discipline, per-run acceptance criteria, and the research/review role constraints are all protected. See [Compaction](/compaction#keepcontext-tags) for the retention mechanism.
665
+
666
+ #### Tagging is not only for workflow authors
667
+
668
+ The tags are plain text, so they work anywhere text becomes a stage prompt — you do not need to be writing a workflow definition to use them. Two cases matter in everyday use, and both apply to an agent driving the `workflow` tool on your behalf.
669
+
670
+ **Run inputs.** Workflows inject their inputs into stage prompts, so anything you tag in an input is inherited by the stages that receive it:
671
+
672
+ ```
673
+ workflow({ action: "run", workflow: "ralph", inputs: {
674
+ prompt: "<keepContext>\nResearch and implement issue #2170. Do not touch the release pipeline.\n</keepContext>\n\n" + issueBody,
675
+ acceptance_criteria: "<keepContext>\n1. ...\n2. ...\n</keepContext>",
676
+ }})
677
+ ```
678
+
679
+ Note what is tagged and what is not: the constraint and the criteria are protected, the quoted issue body is not. A launch prompt is usually mostly reference material, and protecting all of it would raise the keep target so far that stages lose the transcript evidence they need.
680
+
681
+ **Steering.** A `send` amendment is authoritative and stages must carry it forward, but it is one short message arriving late into an already-long session, competing against the entire transcript for retention. Tagging it keeps it alive until the stage acts on it:
682
+
683
+ ```
684
+ workflow({ action: "send", runId, text:
685
+ "<keepContext>\nNew requirement: the fix must not change the public API.\n</keepContext>" })
686
+ ```
687
+
688
+ An agent launching or steering a run should make this call per message rather than tagging by habit — protect the clause that must hold, and leave the surrounding explanation to be compacted normally.
689
+
636
690
  ### Practical consequences
637
691
 
638
692
  - **Steer freely — it is the supported amendment channel.** You do not need to restart a run to add a requirement.
@@ -928,6 +982,8 @@ Also document the context that stages pass to one another:
928
982
 
929
983
  See [Context Engineering](#context-engineering) for details.
930
984
 
985
+ Protect a stage's role constraints, acceptance criteria, and prohibitions with `keepContext` so compaction cannot delete them out from under a long-running stage — see [Protect the contract from compaction](#protect-the-contract-from-compaction).
986
+
931
987
  ### Inputs
932
988
 
933
989
  Inputs are declared with TypeBox `Type.*` schemas in the `inputs` object. Import `Type` from `typebox` directly in workflow files. Workflow packages still declare `typebox` as a peer dependency so TypeBox schemas resolve under `tsc` — see [Programmatic Usage](#programmatic-usage). Common input schemas map to picker kinds and accepted runtime values:
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.11",
9
+ "version": "0.9.12",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.11",
12
+ "@bastani/atomic-natives": "0.9.12",
13
13
  "@dbos-inc/dbos-sdk": "4.24.16",
14
14
  "@earendil-works/pi-agent-core": "^0.83.0",
15
15
  "@earendil-works/pi-ai": "^0.83.0",
@@ -38,7 +38,7 @@
38
38
  "tsx": "^4.23.1",
39
39
  "turndown": "^7.2.0",
40
40
  "typebox": "1.3.7",
41
- "undici": "8.5.0",
41
+ "undici": "8.9.0",
42
42
  "unpdf": "1.7.0",
43
43
  "yaml": "2.9.0",
44
44
  "zod": "^3.25.0 || ^4.0.0"
@@ -515,18 +515,18 @@
515
515
  }
516
516
  },
517
517
  "node_modules/@bastani/atomic-natives": {
518
- "version": "0.9.11",
519
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.11.tgz",
518
+ "version": "0.9.12",
519
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.12.tgz",
520
520
  "license": "MIT",
521
521
  "optionalDependencies": {
522
- "@bastani/atomic-natives-darwin-arm64": "0.9.11",
523
- "@bastani/atomic-natives-darwin-x64": "0.9.11",
524
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.11",
525
- "@bastani/atomic-natives-linux-arm64-musl": "0.9.11",
526
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.11",
527
- "@bastani/atomic-natives-linux-x64-musl": "0.9.11",
528
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.11",
529
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.11"
522
+ "@bastani/atomic-natives-darwin-arm64": "0.9.12",
523
+ "@bastani/atomic-natives-darwin-x64": "0.9.12",
524
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.12",
525
+ "@bastani/atomic-natives-linux-arm64-musl": "0.9.12",
526
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.12",
527
+ "@bastani/atomic-natives-linux-x64-musl": "0.9.12",
528
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.12",
529
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.12"
530
530
  },
531
531
  "engines": {
532
532
  "bun": ">=1.3.14",
@@ -534,8 +534,8 @@
534
534
  }
535
535
  },
536
536
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
537
- "version": "0.9.11",
538
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.11.tgz",
537
+ "version": "0.9.12",
538
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.12.tgz",
539
539
  "license": "MIT",
540
540
  "os": [
541
541
  "darwin"
@@ -546,8 +546,8 @@
546
546
  "optional": true
547
547
  },
548
548
  "node_modules/@bastani/atomic-natives-darwin-x64": {
549
- "version": "0.9.11",
550
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.11.tgz",
549
+ "version": "0.9.12",
550
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.12.tgz",
551
551
  "license": "MIT",
552
552
  "os": [
553
553
  "darwin"
@@ -558,8 +558,8 @@
558
558
  "optional": true
559
559
  },
560
560
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
561
- "version": "0.9.11",
562
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.11.tgz",
561
+ "version": "0.9.12",
562
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.12.tgz",
563
563
  "license": "MIT",
564
564
  "os": [
565
565
  "linux"
@@ -573,8 +573,8 @@
573
573
  "optional": true
574
574
  },
575
575
  "node_modules/@bastani/atomic-natives-linux-arm64-musl": {
576
- "version": "0.9.11",
577
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.11.tgz",
576
+ "version": "0.9.12",
577
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-musl/-/atomic-natives-linux-arm64-musl-0.9.12.tgz",
578
578
  "license": "MIT",
579
579
  "os": [
580
580
  "linux"
@@ -588,8 +588,8 @@
588
588
  "optional": true
589
589
  },
590
590
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
591
- "version": "0.9.11",
592
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.11.tgz",
591
+ "version": "0.9.12",
592
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.12.tgz",
593
593
  "license": "MIT",
594
594
  "os": [
595
595
  "linux"
@@ -603,8 +603,8 @@
603
603
  "optional": true
604
604
  },
605
605
  "node_modules/@bastani/atomic-natives-linux-x64-musl": {
606
- "version": "0.9.11",
607
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.11.tgz",
606
+ "version": "0.9.12",
607
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-musl/-/atomic-natives-linux-x64-musl-0.9.12.tgz",
608
608
  "license": "MIT",
609
609
  "os": [
610
610
  "linux"
@@ -618,8 +618,8 @@
618
618
  "optional": true
619
619
  },
620
620
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
621
- "version": "0.9.11",
622
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.11.tgz",
621
+ "version": "0.9.12",
622
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.12.tgz",
623
623
  "license": "MIT",
624
624
  "os": [
625
625
  "win32"
@@ -630,8 +630,8 @@
630
630
  "optional": true
631
631
  },
632
632
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
633
- "version": "0.9.11",
634
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.11.tgz",
633
+ "version": "0.9.12",
634
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.12.tgz",
635
635
  "license": "MIT",
636
636
  "os": [
637
637
  "win32"
@@ -2991,9 +2991,9 @@
2991
2991
  }
2992
2992
  },
2993
2993
  "node_modules/hono": {
2994
- "version": "4.12.27",
2995
- "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.27.tgz",
2996
- "integrity": "sha512-1yrb/+w6HWQJrUCLkJ2IF5jNIPvvFkblV5RNOYl6bV+OA6p9GLcMpHFFGTosSvHvcAUibuUukRqhlYI4z32C7Q==",
2994
+ "version": "4.12.34",
2995
+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.12.34.tgz",
2996
+ "integrity": "sha512-GqXJqY/xJkJmuloTrnV1ZEXG3fqte+VjkUqoRNZXcrUidiUOP4fMSIHHY4tsqZBK++kVyWmt/AAfSUuy57/eSA==",
2997
2997
  "license": "MIT",
2998
2998
  "engines": {
2999
2999
  "node": ">=16.9.0"
@@ -3152,9 +3152,9 @@
3152
3152
  "license": "ISC"
3153
3153
  },
3154
3154
  "node_modules/ip-address": {
3155
- "version": "10.2.0",
3156
- "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.2.0.tgz",
3157
- "integrity": "sha512-/+S6j4E9AHvW9SWMSEY9Xfy66O5PWvVEJ08O0y5JGyEKQpojb0K0GKpz/v5HJ/G0vi3D2sjGK78119oXZeE0qA==",
3155
+ "version": "10.3.1",
3156
+ "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-10.3.1.tgz",
3157
+ "integrity": "sha512-1e9d3kb97NHJTIJDZW9rKqW2h6+dFa50Dy0fpPSMQp2ADje5gvKsXmdiK6dwY5t76TaTt5+P5N1Y/LoToIxP6g==",
3158
3158
  "license": "MIT",
3159
3159
  "engines": {
3160
3160
  "node": ">= 12"
@@ -4812,9 +4812,9 @@
4812
4812
  "license": "MIT"
4813
4813
  },
4814
4814
  "node_modules/undici": {
4815
- "version": "8.5.0",
4816
- "resolved": "https://registry.npmjs.org/undici/-/undici-8.5.0.tgz",
4817
- "integrity": "sha512-xamtWoB1EshgjpmlXd7GGm2VfdDtw1+rD8uhry8pSNW3If6S8E0m2T2+orSKeZXEn/aPJMviCpDBA65WJt8zhg==",
4815
+ "version": "8.9.0",
4816
+ "resolved": "https://registry.npmjs.org/undici/-/undici-8.9.0.tgz",
4817
+ "integrity": "sha512-aWZpUj7XoGonMClx4gdDRfgBjqeA+F473aDmROQQbM9n6PRfK/u1q/a0X4wMTgcHfT8H6fpbt98PFuDUwFg2YA==",
4818
4818
  "license": "MIT",
4819
4819
  "engines": {
4820
4820
  "node": ">=22.19.0"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "description": "Atomic coding agent CLI with read, bash, edit, write tools and session management",
5
5
  "type": "module",
6
6
  "atomicConfig": {
@@ -78,7 +78,7 @@
78
78
  "prepublishOnly": "bun run clean && bun run build && bun run shrinkwrap"
79
79
  },
80
80
  "dependencies": {
81
- "@bastani/atomic-natives": "0.9.11",
81
+ "@bastani/atomic-natives": "0.9.12",
82
82
  "@dbos-inc/dbos-sdk": "4.24.16",
83
83
  "@earendil-works/pi-agent-core": "^0.83.0",
84
84
  "@earendil-works/pi-ai": "^0.83.0",
@@ -107,7 +107,7 @@
107
107
  "tsx": "^4.23.1",
108
108
  "turndown": "^7.2.0",
109
109
  "typebox": "1.3.7",
110
- "undici": "8.5.0",
110
+ "undici": "8.9.0",
111
111
  "unpdf": "1.7.0",
112
112
  "yaml": "2.9.0",
113
113
  "zod": "^3.25.0 || ^4.0.0"