@gajae-code/coding-agent 0.18.11 → 0.19.0

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 (462) hide show
  1. package/CHANGELOG.md +760 -0
  2. package/dist/types/async/job-manager.d.ts +7 -3
  3. package/dist/types/async/result-formatting.d.ts +2 -0
  4. package/dist/types/autoresearch/git.d.ts +1 -1
  5. package/dist/types/capability/fs.d.ts +2 -2
  6. package/dist/types/capability/rule.d.ts +7 -2
  7. package/dist/types/cli/accounts-cli.d.ts +2 -2
  8. package/dist/types/cli/append-system-prompt.d.ts +6 -0
  9. package/dist/types/cli/args.d.ts +7 -2
  10. package/dist/types/cli/customize-doctor-precedence.d.ts +16 -0
  11. package/dist/types/cli/customize-doctor.d.ts +4 -3
  12. package/dist/types/cli/doctor/install-repairs.d.ts +4 -1
  13. package/dist/types/cli/install-activation.d.ts +10 -4
  14. package/dist/types/cli/public-command-errors.d.ts +2 -0
  15. package/dist/types/cli/root-flags.d.ts +0 -12
  16. package/dist/types/cli/update-cli.d.ts +21 -3
  17. package/dist/types/cli-main.d.ts +0 -6
  18. package/dist/types/cli-ordinary.d.ts +2 -2
  19. package/dist/types/commands/accounts.d.ts +2 -1
  20. package/dist/types/commands/launch.d.ts +0 -6
  21. package/dist/types/commands/migrate.d.ts +1 -1
  22. package/dist/types/commands/sdk.d.ts +13 -0
  23. package/dist/types/commit/changelog/index.d.ts +1 -0
  24. package/dist/types/commit/map-reduce/index.d.ts +4 -4
  25. package/dist/types/config/autorouting-tier-map.d.ts +53 -1
  26. package/dist/types/config/config-hot-reload-trust.d.ts +12 -0
  27. package/dist/types/config/config-hot-reload.d.ts +44 -0
  28. package/dist/types/config/file-lock.d.ts +52 -3
  29. package/dist/types/config/model-discovery-manager.d.ts +2 -0
  30. package/dist/types/config/model-profile-activation.d.ts +79 -9
  31. package/dist/types/config/model-registry.d.ts +72 -8
  32. package/dist/types/config/model-resolver.d.ts +7 -4
  33. package/dist/types/config/models-config-schema.d.ts +10 -0
  34. package/dist/types/config/settings-schema.d.ts +57 -4
  35. package/dist/types/config/settings.d.ts +33 -1
  36. package/dist/types/coordinator-mcp/server.d.ts +4 -0
  37. package/dist/types/customization/import.d.ts +2 -0
  38. package/dist/types/customization/types.d.ts +1 -1
  39. package/dist/types/dap/config.d.ts +8 -4
  40. package/dist/types/dap/session.d.ts +11 -2
  41. package/dist/types/debug/system-info.d.ts +6 -1
  42. package/dist/types/discovery/helpers.d.ts +7 -2
  43. package/dist/types/discovery/mcp-compat.d.ts +3 -1
  44. package/dist/types/edit/index.d.ts +5 -0
  45. package/dist/types/edit/modes/patch.d.ts +14 -0
  46. package/dist/types/edit/modes/replace.d.ts +3 -0
  47. package/dist/types/eval/py/runtime.d.ts +9 -0
  48. package/dist/types/exec/bash-executor.d.ts +12 -0
  49. package/dist/types/export/ttsr.d.ts +19 -0
  50. package/dist/types/extensibility/extensions/types.d.ts +5 -1
  51. package/dist/types/extensibility/slash-commands.d.ts +1 -0
  52. package/dist/types/gjc-runtime/managed-owner-admission.d.ts +3 -0
  53. package/dist/types/gjc-runtime/ralplan-current-final.d.ts +54 -0
  54. package/dist/types/gjc-runtime/ralplan-runtime.d.ts +5 -0
  55. package/dist/types/gjc-runtime/session-state-lock.d.ts +2 -0
  56. package/dist/types/gjc-runtime/state-runtime.d.ts +0 -2
  57. package/dist/types/gjc-runtime/tmux-sessions.d.ts +24 -0
  58. package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +6 -0
  59. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +1 -0
  60. package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
  61. package/dist/types/hindsight/content.d.ts +5 -6
  62. package/dist/types/internal-urls/types.d.ts +2 -0
  63. package/dist/types/lsp/clients/swiftlint-client.d.ts +0 -4
  64. package/dist/types/main.d.ts +23 -18
  65. package/dist/types/migrate/action-planner.d.ts +10 -1
  66. package/dist/types/migrate/adapters/codex.d.ts +2 -1
  67. package/dist/types/migrate/adapters/index.d.ts +42 -1
  68. package/dist/types/migrate/executor.d.ts +3 -1
  69. package/dist/types/migrate/hook-module.d.ts +23 -0
  70. package/dist/types/migrate/report.d.ts +2 -1
  71. package/dist/types/migrate/types.d.ts +82 -3
  72. package/dist/types/modes/components/agent-dashboard.d.ts +1 -1
  73. package/dist/types/modes/components/model-selector.d.ts +43 -0
  74. package/dist/types/modes/components/settings-selector.d.ts +6 -0
  75. package/dist/types/modes/controllers/selector-controller.d.ts +2 -0
  76. package/dist/types/modes/prompt-suggestion-controller.d.ts +1 -1
  77. package/dist/types/modes/theme/theme.d.ts +1 -0
  78. package/dist/types/modes/utils/host-status.d.ts +15 -11
  79. package/dist/types/runtime-mcp/content-limits.d.ts +4 -0
  80. package/dist/types/runtime-mcp/manager.d.ts +7 -0
  81. package/dist/types/runtime-mcp/plugin-mcp-name-filter.d.ts +22 -0
  82. package/dist/types/runtime-mcp/project-host-values.d.ts +11 -5
  83. package/dist/types/runtime-mcp/tool-bridge.d.ts +4 -0
  84. package/dist/types/sdk/broker/broker-exit.d.ts +3 -3
  85. package/dist/types/sdk/broker/broker.d.ts +29 -2
  86. package/dist/types/sdk/broker/daemon-entry.d.ts +11 -1
  87. package/dist/types/sdk/broker/doctor-restart.d.ts +1 -1
  88. package/dist/types/sdk/broker/ensure.d.ts +141 -9
  89. package/dist/types/sdk/broker/hop.d.ts +45 -0
  90. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +18 -10
  91. package/dist/types/sdk/broker/lifecycle.d.ts +22 -0
  92. package/dist/types/sdk/broker/lock-host-identity.d.ts +5 -0
  93. package/dist/types/sdk/broker/session-index.d.ts +6 -1
  94. package/dist/types/sdk/broker/transport.d.ts +2 -0
  95. package/dist/types/sdk/bus/chat-command-policy.d.ts +2 -1
  96. package/dist/types/sdk/bus/index.d.ts +44 -0
  97. package/dist/types/sdk/bus/reconciliation-store.d.ts +10 -0
  98. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +9 -1
  99. package/dist/types/sdk/bus/telegram-daemon.d.ts +2 -0
  100. package/dist/types/sdk/bus/threaded-render.d.ts +2 -1
  101. package/dist/types/sdk/cli/session-cli.d.ts +0 -1
  102. package/dist/types/sdk/host/control/operations.d.ts +5 -1
  103. package/dist/types/sdk/host/events.d.ts +4 -0
  104. package/dist/types/sdk/host/host.d.ts +2 -1
  105. package/dist/types/sdk/host/prompt-image-upload.d.ts +43 -0
  106. package/dist/types/sdk/host/session-runtime.d.ts +40 -8
  107. package/dist/types/sdk/host/surface-policy.d.ts +2 -1
  108. package/dist/types/sdk/lifecycle/service.d.ts +12 -0
  109. package/dist/types/sdk/prompt-deadline-flush.d.ts +42 -4
  110. package/dist/types/sdk/prompt-deadline-manager.d.ts +2 -0
  111. package/dist/types/sdk/prompt-status.d.ts +11 -4
  112. package/dist/types/sdk/protocol/adapter-validation.d.ts +10 -4
  113. package/dist/types/sdk/reconciliation-extensions.d.ts +1 -1
  114. package/dist/types/sdk/session-list.d.ts +1 -1
  115. package/dist/types/session/agent-session.d.ts +107 -9
  116. package/dist/types/session/internal/managed-session-scope.d.ts +2 -2
  117. package/dist/types/session/internal/managed-session-storage.d.ts +1 -1
  118. package/dist/types/session/internal/native-publish-outcome.d.ts +1 -1
  119. package/dist/types/session/messages.d.ts +5 -1
  120. package/dist/types/session/session-manager.d.ts +29 -3
  121. package/dist/types/session/startup-auth-config.d.ts +24 -2
  122. package/dist/types/session/streaming-output.d.ts +11 -0
  123. package/dist/types/session/terminal-abort.d.ts +3 -1
  124. package/dist/types/session-import/service.d.ts +1 -1
  125. package/dist/types/skill-state/workflow-mutation-guard.d.ts +20 -4
  126. package/dist/types/slash-commands/helpers/mcp.d.ts +5 -0
  127. package/dist/types/slash-commands/helpers/provider-auth-status.d.ts +8 -0
  128. package/dist/types/ssh/ssh-executor.d.ts +8 -1
  129. package/dist/types/system-prompt.d.ts +3 -2
  130. package/dist/types/task/executor.d.ts +19 -2
  131. package/dist/types/task/role-body.d.ts +11 -0
  132. package/dist/types/tools/ast-edit-write-path.d.ts +10 -0
  133. package/dist/types/tools/atomic-file-write.d.ts +9 -7
  134. package/dist/types/tools/awaiting-input.d.ts +28 -0
  135. package/dist/types/tools/bash-allowed-prefixes.d.ts +17 -0
  136. package/dist/types/tools/bash-skill-urls.d.ts +4 -0
  137. package/dist/types/tools/bash.d.ts +7 -0
  138. package/dist/types/tools/descriptors.d.ts +15 -2
  139. package/dist/types/tools/fetch.d.ts +7 -1
  140. package/dist/types/tools/index.d.ts +2 -0
  141. package/dist/types/tools/irc.d.ts +5 -3
  142. package/dist/types/tools/python.d.ts +1 -1
  143. package/dist/types/tools/report-issue.d.ts +41 -0
  144. package/dist/types/tools/subagent.d.ts +23 -0
  145. package/dist/types/tools/tmux-self-injection-guard.d.ts +2 -0
  146. package/dist/types/tools/ultragoal-ask-guard.d.ts +1 -1
  147. package/dist/types/tools/write.d.ts +2 -0
  148. package/dist/types/utils/file-mentions.d.ts +5 -0
  149. package/dist/types/utils/image-limits.d.ts +7 -0
  150. package/dist/types/utils/image-loading.d.ts +0 -1
  151. package/dist/types/utils/open.d.ts +0 -1
  152. package/dist/types/utils/pasted-image-loading.d.ts +1 -5
  153. package/dist/types/utils/prompt-suggestion.d.ts +2 -2
  154. package/dist/types/utils/shell-snapshot.d.ts +2 -0
  155. package/dist/types/utils/title-generator.d.ts +13 -3
  156. package/dist/types/web/scrapers/types.d.ts +8 -1
  157. package/dist/types/web/search/providers/codex.d.ts +6 -7
  158. package/dist/types/web/search/providers/insane.d.ts +7 -1
  159. package/dist/types/web/search/providers/searxng.d.ts +5 -0
  160. package/package.json +10 -9
  161. package/scripts/acp-conformance-agent.ts +12 -2
  162. package/scripts/build-binary.ts +2 -1
  163. package/scripts/capture-subagent-compact-panel-showcase.ts +105 -0
  164. package/scripts/generate-docs-index.ts +8 -1
  165. package/scripts/generate-sdk-operation-inventory.ts +38 -4
  166. package/src/async/job-manager.ts +356 -56
  167. package/src/async/result-formatting.ts +40 -0
  168. package/src/autoresearch/git.ts +9 -2
  169. package/src/autoresearch/prompts/prompt-setup.md +1 -1
  170. package/src/capability/fs.ts +58 -22
  171. package/src/capability/index.ts +2 -2
  172. package/src/capability/rule.ts +11 -2
  173. package/src/cli/accounts-cli.ts +176 -8
  174. package/src/cli/append-system-prompt.ts +12 -0
  175. package/src/cli/args.ts +11 -7
  176. package/src/cli/auth-broker-cli.ts +21 -11
  177. package/src/cli/customize-doctor-precedence.ts +31 -0
  178. package/src/cli/customize-doctor.ts +49 -39
  179. package/src/cli/doctor/install-repairs.ts +35 -5
  180. package/src/cli/fast-help.ts +1 -3
  181. package/src/cli/install-activation.ts +47 -4
  182. package/src/cli/migrate-cli.ts +19 -6
  183. package/src/cli/public-command-errors.ts +6 -0
  184. package/src/cli/root-flags.ts +2 -4
  185. package/src/cli/stats-cli.ts +9 -5
  186. package/src/cli/update-cli.ts +471 -13
  187. package/src/cli-ordinary.ts +7 -2
  188. package/src/commands/accounts.ts +10 -5
  189. package/src/commands/harness.ts +25 -15
  190. package/src/commands/migrate.ts +3 -3
  191. package/src/commands/sdk.ts +277 -50
  192. package/src/commands/ultragoal.ts +16 -8
  193. package/src/commit/agentic/agent.ts +6 -6
  194. package/src/commit/analysis/conventional.ts +14 -5
  195. package/src/commit/changelog/index.ts +39 -1
  196. package/src/commit/map-reduce/index.ts +7 -7
  197. package/src/commit/message.ts +10 -3
  198. package/src/commit/pipeline.ts +12 -12
  199. package/src/config/autorouting-tier-map.ts +50 -1
  200. package/src/config/config-file.ts +106 -3
  201. package/src/config/config-hot-reload-trust.ts +148 -0
  202. package/src/config/config-hot-reload.ts +742 -0
  203. package/src/config/file-lock.ts +1615 -328
  204. package/src/config/keybindings.ts +154 -7
  205. package/src/config/model-bindings-applier.ts +85 -47
  206. package/src/config/model-discovery-manager.ts +10 -0
  207. package/src/config/model-profile-activation.ts +889 -148
  208. package/src/config/model-registry.ts +1706 -205
  209. package/src/config/model-resolver.ts +52 -22
  210. package/src/config/models-config-schema.ts +6 -0
  211. package/src/config/settings-schema.ts +73 -4
  212. package/src/config/settings.ts +460 -24
  213. package/src/coordinator-mcp/policy.ts +26 -1
  214. package/src/coordinator-mcp/server.ts +37 -2
  215. package/src/crash/sanitize.ts +7 -1
  216. package/src/customization/import.ts +279 -8
  217. package/src/customization/inventory.ts +24 -8
  218. package/src/customization/types.ts +1 -0
  219. package/src/dap/client.ts +3 -2
  220. package/src/dap/config.ts +31 -11
  221. package/src/dap/defaults.json +1 -1
  222. package/src/dap/session.ts +161 -36
  223. package/src/debug/crash-diagnostics.ts +89 -6
  224. package/src/debug/report-bundle.ts +90 -2
  225. package/src/debug/system-info.ts +8 -3
  226. package/src/defaults/gjc/extensions/grok-cli-vendor/src/shared/base-url.ts +21 -7
  227. package/src/discovery/agents-md.ts +1 -1
  228. package/src/discovery/builtin.ts +4 -3
  229. package/src/discovery/helpers.ts +25 -16
  230. package/src/discovery/mcp-compat.ts +120 -17
  231. package/src/edit/apply-patch/index.ts +12 -1
  232. package/src/edit/index.ts +204 -22
  233. package/src/edit/modes/patch.ts +214 -8
  234. package/src/edit/modes/replace.ts +136 -0
  235. package/src/eval/js/context-manager.ts +29 -3
  236. package/src/eval/js/worker-entry.ts +51 -18
  237. package/src/eval/py/executor.ts +14 -4
  238. package/src/eval/py/runner.py +144 -5
  239. package/src/eval/py/runtime.ts +44 -4
  240. package/src/exec/bash-executor.ts +81 -4
  241. package/src/exec/bash-shell-guardian.ts +4 -1
  242. package/src/exec/bash-shell-supervisor.ts +8 -4
  243. package/src/exec/isolated-shell.ts +5 -1
  244. package/src/exec/non-interactive-env.ts +0 -1
  245. package/src/export/html/index.ts +86 -6
  246. package/src/export/ttsr.ts +176 -1
  247. package/src/extensibility/custom-tools/wrapper.ts +3 -1
  248. package/src/extensibility/extensions/loader.ts +10 -1
  249. package/src/extensibility/extensions/ouroboros-ooo-bridge.ts +63 -1
  250. package/src/extensibility/extensions/types.ts +5 -1
  251. package/src/extensibility/hooks/loader.ts +10 -2
  252. package/src/extensibility/plugins/marketplace/fetcher.ts +2 -2
  253. package/src/extensibility/plugins/marketplace/manager.ts +36 -10
  254. package/src/extensibility/slash-commands.ts +5 -0
  255. package/src/gjc-runtime/gc-runtime.ts +37 -7
  256. package/src/gjc-runtime/launch-tmux.ts +30 -15
  257. package/src/gjc-runtime/launch-worktree.test.ts +148 -0
  258. package/src/gjc-runtime/launch-worktree.ts +101 -14
  259. package/src/gjc-runtime/managed-owner-admission.ts +46 -2
  260. package/src/gjc-runtime/ralplan-current-final.ts +294 -0
  261. package/src/gjc-runtime/ralplan-runtime.ts +95 -1
  262. package/src/gjc-runtime/session-resolution.ts +38 -6
  263. package/src/gjc-runtime/session-state-lock.ts +59 -14
  264. package/src/gjc-runtime/state-runtime.ts +23 -19
  265. package/src/gjc-runtime/state-writer.ts +109 -5
  266. package/src/gjc-runtime/tmux-sessions.ts +93 -13
  267. package/src/gjc-runtime/ultragoal-change-set.ts +90 -11
  268. package/src/gjc-runtime/ultragoal-guard.ts +9 -1
  269. package/src/gjc-runtime/ultragoal-runtime.ts +15 -5
  270. package/src/harness-control-plane/finalize.ts +11 -0
  271. package/src/harness-control-plane/receipt-spool.ts +105 -28
  272. package/src/harness-control-plane/storage.ts +124 -6
  273. package/src/hindsight/content.ts +116 -16
  274. package/src/hindsight/mental-models.ts +22 -10
  275. package/src/hindsight/state.ts +7 -4
  276. package/src/hooks/native-skill-hook.ts +17 -12
  277. package/src/internal-urls/artifact-protocol.ts +3 -1
  278. package/src/internal-urls/docs-index.generated.ts +23 -22
  279. package/src/internal-urls/local-protocol.ts +167 -8
  280. package/src/internal-urls/types.ts +2 -0
  281. package/src/lsp/client.ts +2 -1
  282. package/src/lsp/clients/biome-client.ts +2 -0
  283. package/src/lsp/clients/swiftlint-client.ts +2 -0
  284. package/src/lsp/index.ts +29 -0
  285. package/src/lsp/workspace-path.ts +23 -0
  286. package/src/main.ts +330 -92
  287. package/src/memories/index.ts +25 -2
  288. package/src/migrate/action-planner.ts +574 -2
  289. package/src/migrate/adapters/claude-code.ts +162 -5
  290. package/src/migrate/adapters/codex.ts +77 -7
  291. package/src/migrate/adapters/index.ts +258 -5
  292. package/src/migrate/adapters/opencode.ts +10 -1
  293. package/src/migrate/executor.ts +222 -7
  294. package/src/migrate/hook-module.ts +193 -0
  295. package/src/migrate/report.ts +63 -2
  296. package/src/migrate/types.ts +84 -4
  297. package/src/modes/DESIGN.md +51 -0
  298. package/src/modes/acp/acp-agent.ts +10 -1
  299. package/src/modes/acp/permission-mode.ts +18 -1
  300. package/src/modes/components/agent-dashboard.ts +20 -4
  301. package/src/modes/components/assistant-message.ts +55 -1
  302. package/src/modes/components/customization/customization-dashboard.ts +7 -0
  303. package/src/modes/components/customization/import-wizard.ts +29 -3
  304. package/src/modes/components/model-selector.ts +157 -103
  305. package/src/modes/components/settings-selector.ts +103 -37
  306. package/src/modes/components/welcome.ts +3 -1
  307. package/src/modes/controllers/command-controller.ts +300 -9
  308. package/src/modes/controllers/event-controller.ts +1 -1
  309. package/src/modes/controllers/extension-ui-controller.ts +31 -1
  310. package/src/modes/controllers/goal-mode-controller.ts +79 -10
  311. package/src/modes/controllers/input-controller.ts +2 -0
  312. package/src/modes/controllers/plan-mode-controller.ts +66 -11
  313. package/src/modes/controllers/runtime-mcp-command-controller.ts +7 -6
  314. package/src/modes/controllers/selector-controller.ts +76 -7
  315. package/src/modes/interactive-mode.ts +123 -4
  316. package/src/modes/prompt-suggestion-controller.ts +1 -1
  317. package/src/modes/runtime-init.ts +5 -1
  318. package/src/modes/theme/theme.ts +15 -0
  319. package/src/modes/utils/host-status.ts +21 -10
  320. package/src/prompts/agent-fragments/browser-aside.md +2 -2
  321. package/src/prompts/system/irc-incoming.md +3 -1
  322. package/src/prompts/tools/debug.md +1 -1
  323. package/src/prompts/tools/irc.md +1 -1
  324. package/src/prompts/tools/read.md +1 -1
  325. package/src/prompts/tools/report-issue.md +13 -0
  326. package/src/prompts/tools/task.md +1 -1
  327. package/src/runtime-credential-selector.ts +2 -2
  328. package/src/runtime-mcp/content-limits.ts +7 -0
  329. package/src/runtime-mcp/manager-pool.test.ts +5 -4
  330. package/src/runtime-mcp/manager.ts +40 -3
  331. package/src/runtime-mcp/oauth-flow.ts +32 -6
  332. package/src/runtime-mcp/plugin-mcp-name-filter.ts +62 -0
  333. package/src/runtime-mcp/project-host-values.ts +12 -8
  334. package/src/runtime-mcp/render.ts +16 -1
  335. package/src/runtime-mcp/tool-bridge.ts +194 -21
  336. package/src/runtime-mcp/transports/stdio.ts +2 -1
  337. package/src/sdk/broker/broker-exit.ts +10 -5
  338. package/src/sdk/broker/broker.ts +484 -85
  339. package/src/sdk/broker/daemon-entry.ts +338 -116
  340. package/src/sdk/broker/doctor-restart.ts +2 -1
  341. package/src/sdk/broker/ensure.ts +1214 -268
  342. package/src/sdk/broker/hop.ts +286 -0
  343. package/src/sdk/broker/lifecycle-ledger.ts +38 -11
  344. package/src/sdk/broker/lifecycle.ts +102 -6
  345. package/src/sdk/broker/lock-host-identity.ts +29 -0
  346. package/src/sdk/broker/session-index.ts +91 -16
  347. package/src/sdk/broker/transport.ts +17 -1
  348. package/src/sdk/bus/chat-command-policy.ts +16 -3
  349. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  350. package/src/sdk/bus/index.ts +460 -35
  351. package/src/sdk/bus/reconciliation-store.ts +201 -8
  352. package/src/sdk/bus/session-control.ts +2 -0
  353. package/src/sdk/bus/slack-daemon.ts +105 -9
  354. package/src/sdk/bus/telegram-daemon-contract.ts +9 -1
  355. package/src/sdk/bus/telegram-daemon.ts +10 -2
  356. package/src/sdk/bus/threaded-render.ts +20 -1
  357. package/src/sdk/cli/session-cli.ts +23 -6
  358. package/src/sdk/host/control/dispatch.ts +13 -1
  359. package/src/sdk/host/control/operations.ts +10 -1
  360. package/src/sdk/host/events.ts +67 -4
  361. package/src/sdk/host/host.ts +8 -2
  362. package/src/sdk/host/prompt-image-upload.ts +438 -0
  363. package/src/sdk/host/sdk-surface-parity.test.ts +15 -0
  364. package/src/sdk/host/session-runtime.test.ts +1737 -129
  365. package/src/sdk/host/session-runtime.ts +684 -83
  366. package/src/sdk/host/surface-policy.ts +4 -0
  367. package/src/sdk/host/websocket-transport.lifecycle.test.ts +90 -2
  368. package/src/sdk/host/websocket-transport.ts +19 -7
  369. package/src/sdk/lifecycle/service.ts +15 -1
  370. package/src/sdk/prompt-deadline-flush.ts +78 -5
  371. package/src/sdk/prompt-deadline-manager.ts +68 -14
  372. package/src/sdk/prompt-status.ts +6 -4
  373. package/src/sdk/protocol/adapter-validation.ts +81 -12
  374. package/src/sdk/protocol/operation-inventory.generated.json +261 -2
  375. package/src/sdk/protocol/operation-registry.ts +33 -3
  376. package/src/sdk/reconciliation-extensions.ts +1 -0
  377. package/src/sdk/session-list.ts +1 -0
  378. package/src/sdk/session.ts +237 -97
  379. package/src/session/agent-session.ts +2726 -479
  380. package/src/session/history-storage.ts +182 -12
  381. package/src/session/internal/managed-session-scope.ts +173 -57
  382. package/src/session/internal/managed-session-storage.ts +85 -12
  383. package/src/session/internal/native-publish-outcome.ts +5 -1
  384. package/src/session/messages.ts +47 -6
  385. package/src/session/session-manager.ts +326 -19
  386. package/src/session/startup-auth-config.ts +116 -8
  387. package/src/session/streaming-output.ts +262 -4
  388. package/src/session/terminal-abort.ts +14 -2
  389. package/src/session-import/redact.ts +53 -2
  390. package/src/session-import/service.ts +1 -0
  391. package/src/skill-state/workflow-mutation-guard.ts +2145 -206
  392. package/src/slash-commands/builtin-registry.ts +21 -6
  393. package/src/slash-commands/helpers/credential-switch.ts +10 -5
  394. package/src/slash-commands/helpers/mcp.ts +11 -3
  395. package/src/slash-commands/helpers/provider-auth-status.ts +456 -0
  396. package/src/ssh/ssh-executor.ts +9 -2
  397. package/src/stt/recorder.ts +26 -9
  398. package/src/system-prompt.ts +61 -16
  399. package/src/task/executor.ts +115 -20
  400. package/src/task/index.ts +389 -175
  401. package/src/task/role-body.ts +84 -0
  402. package/src/task/token-log-mode.test.ts +162 -0
  403. package/src/task/token-log.ts +91 -2
  404. package/src/tools/archive-reader.ts +650 -37
  405. package/src/tools/ask.ts +1 -0
  406. package/src/tools/ast-edit-write-path.ts +64 -0
  407. package/src/tools/ast-edit.ts +18 -1
  408. package/src/tools/ast-grep.ts +7 -2
  409. package/src/tools/atomic-file-write.ts +46 -15
  410. package/src/tools/auto-generated-guard.ts +15 -3
  411. package/src/tools/awaiting-input.ts +114 -0
  412. package/src/tools/bash-allowed-prefixes.ts +214 -6
  413. package/src/tools/bash-interactive.ts +14 -2
  414. package/src/tools/bash-skill-urls.ts +58 -5
  415. package/src/tools/bash.ts +113 -26
  416. package/src/tools/browser/tab-worker.ts +39 -13
  417. package/src/tools/browser.ts +17 -7
  418. package/src/tools/cron.ts +10 -1
  419. package/src/tools/debug.ts +16 -8
  420. package/src/tools/descriptors.test.ts +44 -0
  421. package/src/tools/descriptors.ts +50 -6
  422. package/src/tools/eval.ts +15 -0
  423. package/src/tools/fetch.ts +93 -4
  424. package/src/tools/gh.ts +27 -12
  425. package/src/tools/image-gen.ts +20 -6
  426. package/src/tools/index.ts +2 -0
  427. package/src/tools/irc.ts +5 -3
  428. package/src/tools/monitor.ts +9 -1
  429. package/src/tools/output-meta.ts +74 -5
  430. package/src/tools/python.ts +1 -1
  431. package/src/tools/read.ts +26 -37
  432. package/src/tools/recipe/runner.ts +23 -12
  433. package/src/tools/render-utils.ts +2 -2
  434. package/src/tools/report-issue.ts +184 -0
  435. package/src/tools/search.ts +3 -2
  436. package/src/tools/ssh.ts +274 -8
  437. package/src/tools/subagent-render.ts +114 -12
  438. package/src/tools/subagent.ts +118 -5
  439. package/src/tools/tmux-self-injection-guard.ts +3301 -122
  440. package/src/tools/todo-write.ts +41 -3
  441. package/src/tools/tool-catalog.generated.ts +32 -4
  442. package/src/tools/ultragoal-ask-guard.ts +13 -1
  443. package/src/tools/write.ts +42 -3
  444. package/src/tui/tree-list.ts +15 -1
  445. package/src/utils/commit-message-generator.ts +12 -4
  446. package/src/utils/external-editor.ts +21 -7
  447. package/src/utils/file-mentions.ts +75 -7
  448. package/src/utils/git.ts +38 -7
  449. package/src/utils/image-limits.ts +8 -0
  450. package/src/utils/image-loading.ts +1 -1
  451. package/src/utils/open.ts +73 -4
  452. package/src/utils/pasted-image-loading.ts +9 -8
  453. package/src/utils/prompt-suggestion.ts +5 -4
  454. package/src/utils/shell-snapshot.ts +9 -1
  455. package/src/utils/title-generator.ts +72 -22
  456. package/src/web/scrapers/index.ts +3 -1
  457. package/src/web/scrapers/types.ts +8 -0
  458. package/src/web/scrapers/youtube.ts +3 -2
  459. package/src/web/search/index.ts +2 -1
  460. package/src/web/search/providers/codex.ts +29 -32
  461. package/src/web/search/providers/insane.ts +91 -28
  462. package/src/web/search/providers/searxng.ts +62 -10
@@ -14,10 +14,12 @@ import { Settings } from "../config/settings";
14
14
  import { type Skill } from "../extensibility/skills";
15
15
  import type { HindsightSessionState } from "../hindsight/state";
16
16
  import type { LocalProtocolOptions } from "../internal-urls";
17
+ import type { PlanModeState } from "../plan-mode/state";
17
18
  import { AgentRegistry } from "../registry/agent-registry";
18
19
  import type { ForkContextSeed } from "../session/agent-session";
19
20
  import { ArtifactManager } from "../session/artifacts";
20
21
  import type { AuthStorage } from "../session/auth-storage";
22
+ import type { ClientBridge } from "../session/client-bridge";
21
23
  import { SessionManager, type SessionMemoryMode } from "../session/session-manager";
22
24
  import "../tools/yield";
23
25
  import type { ContextFileEntry } from "../tools";
@@ -109,6 +111,21 @@ export interface ExecutorOptions {
109
111
  * the same immutable child settings snapshot.
110
112
  */
111
113
  inheritedServiceTier?: ServiceTier;
114
+ /**
115
+ * Parent ACP/SDK approval mode. `deny` and `prompt` replace the child
116
+ * default (`allow`) before the first prompt. `allow` is that default.
117
+ */
118
+ sdkPermissionMode?: "prompt" | "allow" | "deny";
119
+ /**
120
+ * Parent plan-mode state. Copied onto the child before the first prompt so
121
+ * `enforcePlanModeWrite` still refuses product-file writes.
122
+ */
123
+ planModeState?: PlanModeState;
124
+ /**
125
+ * Parent client bridge. Only `requestPermission` is copied onto the child.
126
+ * Terminal, filesystem, and deferAgentInitiatedTurns stay on the parent.
127
+ */
128
+ clientBridge?: ClientBridge;
112
129
  /** Override local:// protocol options so subagent shares parent's local:// root */
113
130
  localProtocolOptions?: LocalProtocolOptions;
114
131
  /**
@@ -149,12 +166,12 @@ export interface ExecutorOptions {
149
166
  }
150
167
  export declare class ManagedTaskPersistence {
151
168
  #private;
152
- constructor(artifacts: ArtifactManager, taskId: string);
169
+ constructor(artifacts: ArtifactManager, taskId: string, getArtifacts?: () => ArtifactManager);
153
170
  openSession(cwd: string, sessionMemoryMode?: SessionMemoryMode): Promise<SessionManager>;
154
171
  openStagedSession(attemptId?: string): Promise<SessionManager>;
155
172
  publishOutput(rawOutput: string, metadata: Uint8Array): Promise<void>;
156
173
  }
157
- export declare function createManagedTaskPersistence(artifacts: ArtifactManager, taskId: string): ManagedTaskPersistence;
174
+ export declare function createManagedTaskPersistence(artifacts: ArtifactManager, taskId: string, getArtifacts?: () => ArtifactManager): ManagedTaskPersistence;
158
175
  export declare function renderSubagentUserPrompt(assignment: string, independentMode: boolean): string;
159
176
  export interface YieldItem {
160
177
  data?: unknown;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Keep a subagent role body inside the host [ROLE] block.
3
+ *
4
+ * The body is the agent instruction. It is inserted between host [ROLE] and
5
+ * [/ROLE]. A literal framing tag would end that block early. Only the four
6
+ * host framing names are rewritten; other brackets stay literal.
7
+ *
8
+ * One left-to-right scan: a gap run, a slash only when it is present, then
9
+ * one more gap run, then the word. A non-matching "[" does not hide a later tag.
10
+ */
11
+ export declare function containSubagentRoleBody(body: string): string;
@@ -11,3 +11,13 @@ export declare function canonicalizeAstEditWritePath(absolutePath: string): Prom
11
11
  * or a symlinked workspace), so an in-workspace real path is reattached to `cwd`.
12
12
  */
13
13
  export declare function resolveAstEditPreviewWritePaths(cwd: string, previewedPaths: readonly string[]): Promise<string[]>;
14
+ /** Refusal prefix when a single-file real path leaves its reference root. */
15
+ export declare const AST_EDIT_OUTSIDE_ROOT_MESSAGE = "AST edit target resolves outside its root";
16
+ /**
17
+ * Native astEdit canonicalizes one file and writes that real path. Directory
18
+ * scans do not follow links. A lexical path inside cwd uses the real cwd as
19
+ * the reference root; an explicit path outside cwd uses its real parent, so a
20
+ * direct file there still applies. Returns the lexical path that would leave
21
+ * that root, if any.
22
+ */
23
+ export declare function astEditSingleFileOutsideReferenceRoot(cwd: string, candidatePaths: readonly string[], signal?: AbortSignal): Promise<string | undefined>;
@@ -25,10 +25,11 @@
25
25
  *
26
26
  * Destination symlinks are followed: the referent is replaced, the link stays.
27
27
  * The referent is re-resolved immediately before publication so a retargeted
28
- * link cannot silently repoint the write, and when the lexical destination
29
- * sits inside a session-scoped `gjc-local` root the resolved referent and its
30
- * parent must remain inside that root (a link there must not redirect the
31
- * write out of the trust boundary).
28
+ * link cannot silently repoint the write. When the lexical destination sits
29
+ * inside the active explicit artifacts local root (`<artifacts>/local`) or a
30
+ * session-scoped `gjc-local` root, the resolved referent and its parent must
31
+ * remain inside that root (a link there must not redirect the write out of
32
+ * the trust boundary).
32
33
  *
33
34
  * Staging uses exclusive create (`wx`) so a colliding leftover temp is never
34
35
  * truncated or unlinked; only the temp this call created is cleaned on failure.
@@ -57,9 +58,10 @@ export declare function formatFileWriteError(error: unknown, dest: string, optio
57
58
  export interface WriteFileAtomicallyOptions {
58
59
  /**
59
60
  * Trusted root that a resolved symlink referent and its parent must not
60
- * leave. When omitted, the helper still enforces the session-scoped
61
- * `gjc-local` boundary implied by a lexical destination under
62
- * `<tmpdir>/gjc-local/<session-id>`.
61
+ * leave. When omitted, a destination inside the active explicit artifacts
62
+ * local root (`<artifacts>/local`) uses that root. Otherwise the helper
63
+ * still enforces the session-scoped `gjc-local` boundary implied by a
64
+ * lexical destination under `<tmpdir>/gjc-local/<session-id>`.
63
65
  */
64
66
  trustBoundary?: string;
65
67
  /** Platform override used by deterministic retry tests. */
@@ -0,0 +1,28 @@
1
+ export type AwaitingInputKind = "browser_auth" | "device_code";
2
+ export interface AwaitingInputSignal {
3
+ kind: AwaitingInputKind;
4
+ /** Epoch milliseconds when the quiet window elapsed after the match. */
5
+ detectedAt: number;
6
+ }
7
+ /** Cancels a scheduled callback. */
8
+ export type CancelScheduled = () => void;
9
+ export interface AwaitingInputDetectorOptions {
10
+ onDetect: (signal: AwaitingInputSignal) => void;
11
+ /** Quiet window after a match before the signal fires. */
12
+ quietMs?: number;
13
+ /** Injectable scheduler; defaults to `setTimeout`. */
14
+ schedule?: (callback: () => void, ms: number) => CancelScheduled;
15
+ /** Injectable clock; defaults to `Date.now`. */
16
+ now?: () => number;
17
+ }
18
+ export declare const AWAITING_INPUT_QUIET_MS = 3000;
19
+ /** Classify an output tail; `undefined` when it does not look like an auth prompt. */
20
+ export declare function classifyAwaitingInput(tail: string): AwaitingInputKind | undefined;
21
+ export declare class AwaitingInputDetector {
22
+ #private;
23
+ constructor(options: AwaitingInputDetectorOptions);
24
+ /** Feed one streamed output chunk. Any new output restarts the quiet window. */
25
+ push(chunk: string): void;
26
+ /** Stop watching; the command exited or was folded. Never fires afterwards. */
27
+ dispose(): void;
28
+ }
@@ -3,8 +3,25 @@ export interface BashAllowedPrefixesCheck {
3
3
  reason?: string;
4
4
  }
5
5
  export type BashRestrictionProfile = "workflow" | "read-only";
6
+ /** Session identities and workspace the restricted `gjc` command may name. */
7
+ export interface GjcSessionBinding {
8
+ sessionId?: string | null;
9
+ /** Owner identity already on the tool session. Role-agent ralplan writes use it. */
10
+ credentialSessionId?: string | null;
11
+ /** Session workspace. A `--worktree-root` must be this repo, not a foreign one. */
12
+ worktreeRoot: string;
13
+ /** Child cwd. Relative `--worktree-root` resolves against it, as ralplan does. */
14
+ invocationCwd: string;
15
+ }
6
16
  export interface BashRestrictionOptions {
7
17
  profile?: BashRestrictionProfile;
18
+ gjcSessionBinding?: GjcSessionBinding;
8
19
  }
20
+ /**
21
+ * Workflow restricted bash keeps the lexical prefix check, then runs the resolved
22
+ * executable. Callers also skip the shell snapshot and shell prefix, because a
23
+ * snapshot function can be named for that absolute path.
24
+ */
25
+ export declare function normalizeWorkflowBashCommand(command: string, allowedPrefixes: readonly string[] | undefined, options?: BashRestrictionOptions): string | undefined;
9
26
  export declare function normalizeReadOnlyBashCommand(command: string): string | undefined;
10
27
  export declare function checkBashAllowedPrefixes(command: string, allowedPrefixes: readonly string[] | undefined, options?: BashRestrictionOptions): BashAllowedPrefixesCheck;
@@ -16,6 +16,10 @@ export interface InternalUrlExpansionOptions {
16
16
  * Resolve a single skill:// URL to its absolute filesystem path.
17
17
  * Does NOT read file content or verify existence.
18
18
  */
19
+ export declare function resolveSkillUrl(url: string, skills: readonly Skill[]): {
20
+ skill: Skill;
21
+ lexicalPath: string;
22
+ };
19
23
  export declare function resolveSkillUrlToPath(url: string, skills: readonly Skill[]): string;
20
24
  /**
21
25
  * Expand all skill:// URIs in a bash command string.
@@ -7,6 +7,7 @@ import type { RenderResultOptions } from "../extensibility/custom-tools/types";
7
7
  import { type Theme } from "../modes/theme/theme";
8
8
  import { type SdkSpawnArgs } from "../sdk/cli/master-cli";
9
9
  import type { ToolSession } from ".";
10
+ import { type AwaitingInputSignal } from "./awaiting-input";
10
11
  import { type OutputMeta } from "./output-meta";
11
12
  export { STEER_FOLD_GRACE_MS, steerFoldReasonLine } from "./steer-fold";
12
13
  export declare const BASH_DEFAULT_PREVIEW_LINES = 10;
@@ -91,6 +92,12 @@ export interface BashToolDetails {
91
92
  foldReason?: FoldReason;
92
93
  /** The accepted model-declared activity declaration, when the call carried one. */
93
94
  activity?: BashActivityDeclaration;
95
+ /**
96
+ * Set on a running (partial) update when the foreground command printed an
97
+ * interactive auth prompt and then went quiet. Carries only the prompt kind,
98
+ * never the URL or code.
99
+ */
100
+ awaitingInput?: AwaitingInputSignal;
94
101
  async?: {
95
102
  state: "running" | "completed" | "failed";
96
103
  jobId: string;
@@ -55,8 +55,16 @@ export declare class LazyAgentTool implements AgentTool<any, any, any> {
55
55
  #private;
56
56
  readonly descriptor: ToolDescriptor;
57
57
  constructor(descriptor: ToolDescriptor, materialized?: AgentTool<any, any, any>, loader?: () => ToolDescriptorLoadResult, session?: ToolSession);
58
- /** Materialize this facade for contract tests without exposing it in production dispatch. */
59
- materializeForTests(): Promise<AgentTool<any, any, any>>;
58
+ /** Clear a session-bound materialization after its owning session moves. */
59
+ invalidateForSessionMove(expectedCwd?: string): void;
60
+ /**
61
+ * Resolve the underlying implementation. Pre-dispatch hooks (TTSR `astCondition`
62
+ * matching) call this to read implementation-only members such as the matcher
63
+ * hooks before the first `execute` would otherwise load the tool.
64
+ * An arrow property (like `execute`) so session guard proxies can forward it
65
+ * without losing access to the private loader state.
66
+ */
67
+ readonly materialize: () => Promise<AgentTool<any, any, any>>;
60
68
  get name(): string;
61
69
  get description(): string;
62
70
  get parameters(): TSchema;
@@ -86,6 +94,11 @@ export declare class LazyAgentTool implements AgentTool<any, any, any> {
86
94
  get mergeCallAndResult(): boolean | undefined;
87
95
  get inline(): boolean | undefined;
88
96
  get mode(): any;
97
+ get matcherDigest(): ((args: unknown) => string | undefined) | undefined;
98
+ get matcherEntries(): ((args: unknown) => readonly {
99
+ path: string;
100
+ digest: string;
101
+ }[] | undefined) | undefined;
89
102
  readonly execute: AgentTool<any, any, any>["execute"];
90
103
  }
91
104
  export type EffectiveToolDiscoveryMode = "off" | "mcp-only" | "all";
@@ -31,7 +31,7 @@ type FetchRenderResult = RenderResult & {
31
31
  /**
32
32
  * Try all special handlers
33
33
  */
34
- declare function handleSpecialUrls(url: string, timeout: number, signal: AbortSignal | undefined, storage: AgentStorage | null): Promise<FetchRenderResult | null>;
34
+ declare function handleSpecialUrls(url: string, timeout: number, signal: AbortSignal | undefined, storage: AgentStorage | null, settings: Settings): Promise<FetchRenderResult | null>;
35
35
  /** Test-only seam for verifying lazy special-handler loading and dispatch. */
36
36
  export declare const fetchSpecialHandlerTestHooks: {
37
37
  dispatch: typeof handleSpecialUrls;
@@ -74,6 +74,12 @@ export declare const readUrlCacheTestHooks: {
74
74
  readonly retainedOutputChars: number;
75
75
  reset(): void;
76
76
  };
77
+ /**
78
+ * Publish text at an explicit artifact path the way `ArtifactManager.save` does:
79
+ * a temp file opened with `O_NOFOLLOW` and mode 0600, then rename. A symlink is
80
+ * not followed. A pre-existing regular file is replaced, so mode 0644 is not kept.
81
+ */
82
+ export declare function publishExplicitArtifactText(destination: string, text: string): Promise<void>;
77
83
  export declare function loadReadUrlCacheEntry(session: ToolSession, params: {
78
84
  path: string;
79
85
  raw?: boolean;
@@ -317,6 +317,8 @@ export interface ToolSession {
317
317
  from: string;
318
318
  to: string;
319
319
  }>;
320
+ /** Live ACP/SDK approval mode. Task children copy this at spawn; absent means `allow`. */
321
+ getSdkPermissionMode?: () => "prompt" | "allow" | "deny";
320
322
  /** Bridge to the connected client (e.g. ACP editor host). Tools should route fs/terminal/permission requests through this when available. */
321
323
  getClientBridge?: () => ClientBridge | undefined;
322
324
  /** Get compact conversation context for subagents (excludes tool results, system prompts) */
@@ -9,9 +9,11 @@
9
9
  * mirrors `/btw`: the recipient's current model, system prompt, and message
10
10
  * history are used to compute a reply without persisting it through the
11
11
  * normal stream path. After the reply is generated, both the incoming
12
- * message and the auto-reply are queued for injection into the recipient's
13
- * persisted history (deferred until the recipient is idle), so the model
14
- * sees the exchange on its next turn.
12
+ * message and the auto-reply are injected into the recipient's persisted
13
+ * history: an idle recipient gets them immediately, while a streaming recipient
14
+ * receives them at its next step boundary (the live run's next tool boundary)
15
+ * rather than at the end of its turn — an exchange admitted into a run that ends
16
+ * before that boundary is still appended to the outgoing session's history.
15
17
  *
16
18
  * This avoids the deadlock that arises when the recipient is blocked on a
17
19
  * long-running tool call: the side-channel call does not depend on the
@@ -14,7 +14,7 @@ export interface SessionPythonToolInput {
14
14
  /** Resolve the GJC session id used for the kernel owner and transcript paths. */
15
15
  getSessionId: () => string | null;
16
16
  /** Register cleanup with the current logical session lifecycle. */
17
- registerSessionCleanup: (cleanup: () => Promise<void> | void) => (() => void) | void;
17
+ registerSessionCleanup: (cleanup: () => Promise<void> | void) => (() => void) | undefined;
18
18
  /** Reject execution after the owning session has begun disposal. */
19
19
  assertEvalExecutionAllowed?: () => void;
20
20
  /** Track this whole invocation through its transcript append. */
@@ -0,0 +1,41 @@
1
+ import type { AgentTool, AgentToolResult } from "@gajae-code/agent-core";
2
+ import * as z from "zod/v4";
3
+ import type { ToolSession } from "./index";
4
+ declare const reportIssueSchema: z.ZodObject<{
5
+ tool: z.ZodString;
6
+ report: z.ZodString;
7
+ }, z.core.$strip>;
8
+ export type ReportIssueToolInput = z.infer<typeof reportIssueSchema>;
9
+ export interface ReportIssueToolDetails {
10
+ recorded: boolean;
11
+ tool: string;
12
+ }
13
+ export interface ToolIssueEntry {
14
+ tool: string;
15
+ report: string;
16
+ model: string | null;
17
+ sessionId: string | null;
18
+ }
19
+ /** Normalize and clamp a report to the stored field limits. */
20
+ export declare function normalizeToolIssue(tool: string, report: string): {
21
+ tool: string;
22
+ report: string;
23
+ };
24
+ /** Append one report to the tool-issue database at `dbPath`. */
25
+ export declare function recordToolIssue(dbPath: string, entry: ToolIssueEntry): Promise<void>;
26
+ export declare class ReportIssueTool implements AgentTool<typeof reportIssueSchema, ReportIssueToolDetails> {
27
+ #private;
28
+ readonly name = "report_issue";
29
+ readonly label = "Report Issue";
30
+ readonly loadMode: "essential";
31
+ readonly description: string;
32
+ readonly parameters: z.ZodObject<{
33
+ tool: z.ZodString;
34
+ report: z.ZodString;
35
+ }, z.core.$strip>;
36
+ readonly strict = true;
37
+ readonly intent: "omit";
38
+ constructor(session: ToolSession, dbPath?: string);
39
+ execute(_toolCallId: string, params: ReportIssueToolInput): Promise<AgentToolResult<ReportIssueToolDetails>>;
40
+ }
41
+ export {};
@@ -178,4 +178,27 @@ export declare function capCodePointsAndBytes(text: string, maxCodePoints: numbe
178
178
  /** Shared cadence for await progress refreshes and rendered last-activity age. */
179
179
  export declare const SUBAGENT_ACTIVITY_BUCKET_MS = 5000;
180
180
  export declare function subagentAwaitRenderedStateSignature(subagents: readonly SubagentSnapshot[], receipt?: Pick<SubagentToolDetails, "awaitOutcome" | "interrupted">): string;
181
+ /** A running subagent with no activity for longer than this counts as idle in the compact panel. */
182
+ export declare const SUBAGENT_COMPACT_IDLE_MS = 30000;
183
+ /** Group counts behind the compact await panel's single summary line. */
184
+ export interface SubagentGroupSummary {
185
+ running: number;
186
+ idle: number;
187
+ retrying: number;
188
+ queued: number;
189
+ paused: number;
190
+ completed: number;
191
+ failed: number;
192
+ cancelled: number;
193
+ /** Running subagents in provider retry, per provider; drives the degradation warning. */
194
+ retryingByProvider: Record<string, number>;
195
+ }
196
+ export declare function summarizeSubagentGroup(subagents: readonly SubagentSnapshot[], nowMs: number): SubagentGroupSummary;
197
+ /**
198
+ * Rendered-state signature for the compact await panel. It covers only what the
199
+ * compact view shows (group counts and the single degradation row), so per-subagent activity that does not move
200
+ * a count no longer re-emits: the update rate is bounded by count transitions and
201
+ * the liveness interval instead of growing with the number of live subagents.
202
+ */
203
+ export declare function subagentCompactRenderedStateSignature(subagents: readonly SubagentSnapshot[], nowMs: number, receipt?: Pick<SubagentToolDetails, "awaitOutcome" | "interrupted">): string;
181
204
  export {};
@@ -10,6 +10,8 @@ export type TmuxPaneResolver = (options: {
10
10
  export interface TmuxSelfInjectionOptions {
11
11
  env?: Record<string, string | undefined>;
12
12
  cwd?: string;
13
+ /** Effective Bash environment for locating shell-runner scripts; never used for tmux identity. */
14
+ executionEnv?: Record<string, string | undefined>;
13
15
  resolvePaneId?: TmuxPaneResolver;
14
16
  }
15
17
  export declare function checkTmuxSelfInjection(command: string, options?: TmuxSelfInjectionOptions, depth?: number): Promise<TmuxSelfInjectionResult>;
@@ -11,5 +11,5 @@ export interface UltragoalAskGuardContext {
11
11
  sessionId?: string | null;
12
12
  }
13
13
  export declare function formatUltragoalAskBlockMessage(diagnostic: UltragoalAskBlockDiagnostic): string;
14
- export declare function assertUltragoalAskAllowed(cwd: string, context?: UltragoalAskGuardContext, agentDir?: string): Promise<void>;
14
+ export declare function assertUltragoalAskAllowed(cwd: string, context?: UltragoalAskGuardContext, agentDir?: string, pendingQuestions?: unknown): Promise<void>;
15
15
  export declare function guardToolForUltragoalAsk<T extends AgentTool>(tool: T, getCwd: () => string, getContext?: () => UltragoalAskGuardContext, getSessionAgentDir?: () => string | undefined): T;
@@ -37,6 +37,8 @@ export declare class WriteTool implements AgentTool<typeof writeSchema, WriteToo
37
37
  readonly concurrency = "exclusive";
38
38
  readonly loadMode = "discoverable";
39
39
  readonly summary = "Write content to a file (creates or overwrites)";
40
+ /** Stream matchers should see the real file content, not its JSON-escaped argument encoding. */
41
+ matcherDigest(args: unknown): string | undefined;
40
42
  constructor(session: ToolSession);
41
43
  execute(_toolCallId: string, { path, content }: WriteParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback<WriteToolDetails>, context?: AgentToolContext): Promise<AgentToolResult<WriteToolDetails>>;
42
44
  }
@@ -7,6 +7,11 @@ import type { AgentMessage } from "@gajae-code/agent-core";
7
7
  export declare const DEFAULT_FILE_MENTION_INLINE_BYTES: number;
8
8
  /** Extract all @filepath mentions from text */
9
9
  export declare function extractFileMentions(text: string): string[];
10
+ /**
11
+ * Compare canonical Windows paths without folding directory names: individual
12
+ * directories can opt into case-sensitive names.
13
+ */
14
+ export declare function isCanonicalWindowsPathWithin(root: string, candidate: string): boolean;
10
15
  /**
11
16
  * Generate a FileMentionMessage containing the contents of mentioned files.
12
17
  * Returns empty array if no files could be read.
@@ -0,0 +1,7 @@
1
+ export declare const MAX_IMAGE_INPUT_BYTES: number;
2
+ export declare const MAX_STAGED_PROMPT_IMAGES = 16;
3
+ export declare const MAX_PASTED_IMAGE_SOURCE_BYTES: number;
4
+ export declare const MAX_PASTED_IMAGE_OUTPUT_BYTES: number;
5
+ export declare const MAX_PASTED_IMAGE_DIMENSION = 20000;
6
+ export declare const MAX_PASTED_IMAGE_PIXELS = 40000000;
7
+ export declare const MAX_PASTED_IMAGE_DECODED_BYTES: number;
@@ -1,5 +1,4 @@
1
1
  import type { ImageContent } from "@gajae-code/ai/core";
2
- export declare const MAX_IMAGE_INPUT_BYTES: number;
3
2
  export declare const SUPPORTED_INPUT_IMAGE_MIME_TYPES: Set<string>;
4
3
  export declare function rasterizeSvgInputBytes(inputBuffer: Uint8Array): Promise<Uint8Array>;
5
4
  export interface LoadImageInputOptions {
@@ -1,2 +1 @@
1
- /** Open a URL or file path in the default browser/application. Best-effort, never throws. */
2
1
  export declare function openPath(urlOrPath: string): void;
@@ -1,10 +1,5 @@
1
1
  import type { ImageContent } from "@gajae-code/ai/core";
2
2
  import { type LoadedImageInput, transformImageInputBytes } from "./image-loading";
3
- export declare const MAX_PASTED_IMAGE_SOURCE_BYTES: number;
4
- export declare const MAX_PASTED_IMAGE_OUTPUT_BYTES: number;
5
- export declare const MAX_PASTED_IMAGE_DIMENSION = 20000;
6
- export declare const MAX_PASTED_IMAGE_PIXELS = 40000000;
7
- export declare const MAX_PASTED_IMAGE_DECODED_BYTES: number;
8
3
  export type PastedImageBatchErrorCode = "too-many" | "unsafe-path" | "unsupported-image" | "source-aggregate-too-large" | "output-aggregate-too-large" | "dimensions-too-large";
9
4
  export declare class PastedImageBatchError extends Error {
10
5
  readonly code: PastedImageBatchErrorCode;
@@ -23,6 +18,7 @@ export interface PastedImageLoadingDependencies {
23
18
  transformImageBytes?: typeof transformImageInputBytes;
24
19
  }
25
20
  export type PastedImageSourcePolicy = "confirmed" | "automatic-temp";
21
+ export declare function isAnimatedImage(bytes: Buffer, mimeType: string): boolean | undefined;
26
22
  export interface LoadPastedImageBatchOptions {
27
23
  paths: readonly string[];
28
24
  autoResize: boolean;
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Predict the user's likely next prompt after an agent turn using a smol,
3
- * fast model. Native GJC port of the ghost-text prompt-suggestion behavior
2
+ * Predict the user's likely next prompt after an agent turn with the `default`
3
+ * model role. Native GJC port of the ghost-text prompt-suggestion behavior
4
4
  * from Claude Code: the prediction renders as dim ghost text in the empty
5
5
  * composer and Tab accepts it.
6
6
  */
@@ -1,3 +1,5 @@
1
+ /** One POSIX shell word. Double quotes would still run `$()` and backticks. */
2
+ export declare function quotePosixShell(value: string): string;
1
3
  interface ShellSnapshotCacheOptions {
2
4
  tempRoot: string;
3
5
  home: string | (() => string);
@@ -6,8 +6,17 @@ import type { Settings } from "../config/settings";
6
6
  * Build a bounded conversation digest for title regeneration. Regeneration
7
7
  * reads several messages so a throwaway first prompt can be corrected, while
8
8
  * the automatic first-message path intentionally uses only its initial input.
9
+ * `obfuscateText`, when set, runs on each kept message's full text before the
10
+ * per-message character cut so a secret cannot be split by that cut.
9
11
  */
10
- export declare function buildConversationTitleInput(messages: readonly AgentMessage[]): string | undefined;
12
+ export declare function buildConversationTitleInput(messages: readonly AgentMessage[], obfuscateText?: (text: string) => string): string | undefined;
13
+ /**
14
+ * Obfuscate the full title input, then truncate, then wrap.
15
+ * A secret that crosses the character cap is replaced before the cut, and the
16
+ * `<user-message>` fence stays outside the truncated body.
17
+ */
18
+ export declare function prepareTitleOutboundText(firstMessage: string, obfuscateText?: (text: string) => string): string;
19
+ export declare function titleInputObfuscator(settings: Settings, activeCwd?: string): Promise<((text: string) => string) | undefined>;
11
20
  /**
12
21
  * Generate a title for a session based on the provided user-message input.
13
22
  * Automatic titles pass the first user message; regeneration passes a bounded
@@ -15,15 +24,16 @@ export declare function buildConversationTitleInput(messages: readonly AgentMess
15
24
  *
16
25
  * @param firstMessage The first user message or bounded conversation digest
17
26
  * @param registry Model registry
18
- * @param settings Settings used to resolve the smol role
27
+ * @param settings Settings used to resolve the `default` model role
19
28
  * @param sessionId Optional session id for sticky API key selection
20
29
  * @param currentModel Current model (used to derive title model)
21
30
  * @param metadataResolver Optional resolver evaluated after credential selection
22
31
  * to produce request metadata (e.g. user_id for session attribution). Using a
23
32
  * resolver instead of a pre-evaluated value ensures the metadata's account_uuid
24
33
  * reflects the credential actually selected for this request.
34
+ * @param activeCwd Active session cwd for project-scoped secret lookup.
25
35
  */
26
- export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined): Promise<string | null>;
36
+ export declare function generateSessionTitle(firstMessage: string, registry: ModelRegistry, settings: Settings, sessionId?: string, currentModel?: Model<Api>, metadataResolver?: (provider: string) => Record<string, unknown> | undefined, activeCwd?: string): Promise<string | null>;
27
37
  export declare function formatSessionTerminalTitle(sessionName: string | undefined, cwd?: string): string;
28
38
  /**
29
39
  * Set the terminal title using OSC 0 (sets both tab and window title). Unsupported terminals ignore it.
@@ -1,3 +1,4 @@
1
+ import type { Settings } from "../../config/settings";
1
2
  import type { AgentStorage } from "../../session/agent-storage";
2
3
  import type { AddressResolver } from "../insane/url-guard";
3
4
  export { formatNumber } from "@gajae-code/utils";
@@ -11,7 +12,13 @@ export interface RenderResult {
11
12
  truncated: boolean;
12
13
  notes: string[];
13
14
  }
14
- export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null) => Promise<RenderResult | null>;
15
+ /**
16
+ * `settings` is the caller's session settings. Handlers must read through it
17
+ * rather than the process-global singleton: the SDK/ACP host path runs tools
18
+ * without ever calling `Settings.init()`, where a global read throws
19
+ * "Settings not initialized" instead of scraping the page.
20
+ */
21
+ export type SpecialHandler = (url: string, timeout: number, signal?: AbortSignal, storage?: AgentStorage | null, settings?: Settings) => Promise<RenderResult | null>;
15
22
  export declare const MAX_OUTPUT_CHARS = 500000;
16
23
  export declare const MAX_BYTES: number;
17
24
  /**
@@ -1,4 +1,4 @@
1
- import { type AuthStorage } from "@gajae-code/ai/core";
1
+ import type { AuthStorage } from "@gajae-code/ai/core";
2
2
  import type { SearchResponse } from "../../../web/search/types";
3
3
  import type { SearchParams } from "./base";
4
4
  import { SearchProvider } from "./base";
@@ -14,12 +14,11 @@ export interface CodexSearchParams {
14
14
  * Executes a web search using OpenAI code provider's built-in web search tool.
15
15
  *
16
16
  * Default-model behavior:
17
- * - If `PI_CODEX_WEB_SEARCH_MODEL` is set, use it exactly once and surface any
18
- * upstream error verbatim.
19
- * - Otherwise prefer ChatGPT-account-safe bundled defaults (GPT-5.5, GPT-5.4,
20
- * GPT-5 code backend, …) and retry the next candidate only when OpenAI code backend returns the
21
- * known 400 "model is not supported" family. This avoids selecting
22
- * `gpt-5-codex-mini` first on ChatGPT accounts, which OpenAI rejects.
17
+ * - Use `GJC_OPENAI_CODE_WEB_SEARCH_MODEL` (then `PI_CODEX_WEB_SEARCH_MODEL`)
18
+ * exactly once when configured and surface upstream errors without model retries.
19
+ * - Otherwise intersect current account discovery with GPT-6.1 Sol, then GPT-6 Luna.
20
+ * Fail closed when discovery is unavailable or neither candidate is advertised.
21
+ * Retry the next advertised candidate only for the known unsupported-model 400 family.
23
22
  */
24
23
  export declare function searchCodex(params: SearchParams): Promise<SearchResponse>;
25
24
  /**
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import type { AuthStorage } from "@gajae-code/ai/core";
14
14
  import type { SearchResponse, SearchSource } from "../../../web/search/types";
15
+ import type { AddressResolver } from "../../insane/url-guard";
15
16
  import type { SearchParams } from "./base";
16
17
  import { SearchProvider } from "./base";
17
18
  export interface InsaneRouteAttempt {
@@ -35,13 +36,18 @@ interface RouteFailure {
35
36
  attempts: InsaneRouteAttempt[];
36
37
  }
37
38
  type RouteResult = RouteSuccess | RouteFailure | null;
38
- export declare function routeInsanePublicUrl(rawUrl: string, signal?: AbortSignal): Promise<RouteResult>;
39
+ export declare function routeInsanePublicUrl(rawUrl: string, signal?: AbortSignal, resolverOption?: {
40
+ resolver?: AddressResolver;
41
+ }): Promise<RouteResult>;
39
42
  /** Execute safe Insane Search public-route discovery. */
40
43
  export declare function searchInsane(params: {
41
44
  query: string;
42
45
  num_results?: number;
43
46
  recency?: "day" | "week" | "month" | "year";
44
47
  signal?: AbortSignal;
48
+ resolverOption?: {
49
+ resolver?: AddressResolver;
50
+ };
45
51
  }): Promise<SearchResponse>;
46
52
  /** Keyless provider that ports safe upstream public-route fallbacks only. */
47
53
  export declare class InsaneProvider extends SearchProvider {
@@ -22,6 +22,11 @@
22
22
  * SEARXNG_BASIC_USERNAME - Optional RFC 7617 Basic auth username
23
23
  * SEARXNG_BASIC_PASSWORD - Optional RFC 7617 Basic auth password
24
24
  *
25
+ * A project settings endpoint must not receive a credential that exists only in
26
+ * the operator environment. The project file can still authenticate with a
27
+ * credential it sets itself, and an operator endpoint still receives an
28
+ * operator environment credential.
29
+ *
25
30
  * Reference: https://docs.searxng.org/dev/search_api.html
26
31
  */
27
32
  import type { AuthStorage } from "@gajae-code/ai/core";