@gajae-code/coding-agent 0.11.0 → 0.11.2

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 (418) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/dist/types/async/job-manager.d.ts +46 -7
  3. package/dist/types/cli/config-cli.d.ts +11 -1
  4. package/dist/types/cli/notify-cli.d.ts +1 -0
  5. package/dist/types/cli/session-picker.d.ts +2 -1
  6. package/dist/types/cli/setup-cli.d.ts +1 -1
  7. package/dist/types/commands/mcp-serve.d.ts +33 -0
  8. package/dist/types/commands/mcp.d.ts +1 -1
  9. package/dist/types/commands/notify.d.ts +0 -2
  10. package/dist/types/commands/sdk.d.ts +1 -1
  11. package/dist/types/config/atomic-yaml-patch.d.ts +18 -0
  12. package/dist/types/config/file-lock.d.ts +14 -4
  13. package/dist/types/config/keybindings.d.ts +42 -1
  14. package/dist/types/config/model-auth.d.ts +3 -0
  15. package/dist/types/config/model-bindings-applier.d.ts +13 -0
  16. package/dist/types/config/model-discovery-manager.d.ts +49 -0
  17. package/dist/types/config/model-equivalence.d.ts +20 -0
  18. package/dist/types/config/model-registry.d.ts +16 -15
  19. package/dist/types/config/model-resolver.d.ts +28 -18
  20. package/dist/types/config/models-config-schema.d.ts +11 -0
  21. package/dist/types/config/settings-schema.d.ts +56 -1
  22. package/dist/types/config/settings.d.ts +14 -11
  23. package/dist/types/coordinator-mcp/policy.d.ts +5 -0
  24. package/dist/types/coordinator-mcp/question-gate-codec.d.ts +129 -0
  25. package/dist/types/coordinator-mcp/question-state.d.ts +356 -0
  26. package/dist/types/coordinator-mcp/server.d.ts +4 -0
  27. package/dist/types/discovery/helpers.d.ts +0 -6
  28. package/dist/types/edit/index.d.ts +3 -0
  29. package/dist/types/eval/py/env.d.ts +9 -0
  30. package/dist/types/extensibility/extensions/loader.d.ts +2 -1
  31. package/dist/types/extensibility/extensions/runner.d.ts +2 -2
  32. package/dist/types/extensibility/extensions/types.d.ts +34 -3
  33. package/dist/types/extensibility/hooks/runner.d.ts +1 -1
  34. package/dist/types/extensibility/shared-events.d.ts +2 -0
  35. package/dist/types/gjc-runtime/deep-interview-recorder.d.ts +10 -1
  36. package/dist/types/gjc-runtime/deep-interview-state.d.ts +44 -0
  37. package/dist/types/gjc-runtime/goal-mode-request.d.ts +11 -1
  38. package/dist/types/gjc-runtime/launch-worktree.d.ts +4 -2
  39. package/dist/types/gjc-runtime/linux-proc.d.ts +29 -0
  40. package/dist/types/gjc-runtime/session-resolution.d.ts +2 -2
  41. package/dist/types/gjc-runtime/state-migrations.d.ts +1 -1
  42. package/dist/types/gjc-runtime/state-writer.d.ts +2 -1
  43. package/dist/types/gjc-runtime/team-launch.d.ts +59 -0
  44. package/dist/types/gjc-runtime/team-notify.d.ts +45 -0
  45. package/dist/types/gjc-runtime/team-runtime.d.ts +29 -121
  46. package/dist/types/gjc-runtime/team-store.d.ts +160 -0
  47. package/dist/types/gjc-runtime/team-workers.d.ts +78 -0
  48. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +8 -0
  49. package/dist/types/gjc-runtime/ultragoal-change-set.d.ts +13 -0
  50. package/dist/types/gjc-runtime/ultragoal-evidence.d.ts +38 -0
  51. package/dist/types/gjc-runtime/ultragoal-guard.d.ts +7 -0
  52. package/dist/types/gjc-runtime/ultragoal-pipeline.d.ts +23 -0
  53. package/dist/types/gjc-runtime/ultragoal-receipt-freshness.d.ts +11 -0
  54. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +55 -33
  55. package/dist/types/gjc-runtime/workflow-cli-common.d.ts +8 -0
  56. package/dist/types/gjc-runtime/workflow-manifest.d.ts +3 -0
  57. package/dist/types/goals/continuation-timeout-guard.d.ts +22 -0
  58. package/dist/types/goals/runtime.d.ts +1 -0
  59. package/dist/types/goals/state.d.ts +8 -0
  60. package/dist/types/harness-control-plane/lifecycle-reconciliation.d.ts +17 -0
  61. package/dist/types/harness-control-plane/phase-rollup.d.ts +4 -7
  62. package/dist/types/harness-control-plane/receipt-ingest.d.ts +5 -0
  63. package/dist/types/harness-control-plane/receipt-spool.d.ts +4 -0
  64. package/dist/types/hindsight/state.d.ts +11 -4
  65. package/dist/types/lsp/lspmux.d.ts +5 -3
  66. package/dist/types/lsp/path-trust.d.ts +1 -0
  67. package/dist/types/main.d.ts +3 -2
  68. package/dist/types/memories/storage.d.ts +1 -0
  69. package/dist/types/modes/action-registry.d.ts +29 -0
  70. package/dist/types/modes/components/chrome.d.ts +14 -0
  71. package/dist/types/modes/components/command-palette.d.ts +27 -0
  72. package/dist/types/modes/components/custom-provider-wizard.d.ts +1 -0
  73. package/dist/types/modes/components/index.d.ts +2 -1
  74. package/dist/types/modes/components/pet-selector.d.ts +1 -1
  75. package/dist/types/modes/components/plan-preview-overlay.d.ts +43 -0
  76. package/dist/types/modes/components/queue-mode-selector.d.ts +1 -1
  77. package/dist/types/modes/components/queue-pane.d.ts +12 -0
  78. package/dist/types/modes/components/read-tool-group.d.ts +6 -0
  79. package/dist/types/modes/components/session-observer-overlay.d.ts +3 -4
  80. package/dist/types/modes/components/sessions-dashboard.d.ts +32 -0
  81. package/dist/types/modes/components/settings-selector.d.ts +1 -1
  82. package/dist/types/modes/components/show-images-selector.d.ts +1 -1
  83. package/dist/types/modes/components/status-line/types.d.ts +1 -1
  84. package/dist/types/modes/components/status-line.d.ts +1 -94
  85. package/dist/types/modes/components/tasks-pane.d.ts +15 -0
  86. package/dist/types/modes/components/theme-selector.d.ts +1 -1
  87. package/dist/types/modes/components/tool-execution.d.ts +15 -0
  88. package/dist/types/modes/components/tool-status-header.d.ts +111 -0
  89. package/dist/types/modes/components/transcript-viewer-overlay.d.ts +42 -0
  90. package/dist/types/modes/controllers/command-controller.d.ts +2 -2
  91. package/dist/types/modes/controllers/extension-ui-controller.d.ts +1 -0
  92. package/dist/types/modes/controllers/goal-mode-controller.d.ts +62 -0
  93. package/dist/types/modes/controllers/input-controller.d.ts +8 -1
  94. package/dist/types/modes/controllers/mode-gate.d.ts +8 -0
  95. package/dist/types/modes/controllers/plan-mode-controller.d.ts +65 -0
  96. package/dist/types/modes/controllers/selector-controller.d.ts +15 -3
  97. package/dist/types/modes/controllers/stt-controller.d.ts +26 -0
  98. package/dist/types/modes/interactive-mode.d.ts +21 -19
  99. package/dist/types/modes/jobs-observer.d.ts +2 -0
  100. package/dist/types/modes/shared/agent-wire/deep-interview-gate.d.ts +4 -11
  101. package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +21 -2
  102. package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +31 -0
  103. package/dist/types/modes/tasks-aggregator.d.ts +39 -0
  104. package/dist/types/modes/transcript-item-registry.d.ts +60 -0
  105. package/dist/types/modes/types.d.ts +22 -15
  106. package/dist/types/modes/utils/ui-helpers.d.ts +2 -2
  107. package/dist/types/runtime-mcp/manager.d.ts +1 -1
  108. package/dist/types/sdk/broker/broker.d.ts +78 -12
  109. package/dist/types/sdk/broker/ensure.d.ts +9 -0
  110. package/dist/types/sdk/broker/lifecycle-codec.d.ts +4 -0
  111. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +15 -1
  112. package/dist/types/sdk/broker/lifecycle.d.ts +6 -2
  113. package/dist/types/sdk/broker/process-incarnation.d.ts +2 -0
  114. package/dist/types/sdk/broker/session-index.d.ts +0 -1
  115. package/dist/types/sdk/broker/state-version.d.ts +2 -0
  116. package/dist/types/sdk/bus/chat-effect-journal.d.ts +1 -0
  117. package/dist/types/sdk/bus/config-commands.d.ts +1 -1
  118. package/dist/types/sdk/bus/config.d.ts +11 -0
  119. package/dist/types/sdk/bus/daemon-paths.d.ts +1 -0
  120. package/dist/types/sdk/bus/discord-daemon.d.ts +5 -0
  121. package/dist/types/sdk/bus/html-format.d.ts +3 -2
  122. package/dist/types/sdk/bus/index.d.ts +27 -0
  123. package/dist/types/sdk/bus/lifecycle-control-runtime.d.ts +4 -0
  124. package/dist/types/sdk/bus/notification-service.d.ts +20 -0
  125. package/dist/types/sdk/bus/rate-limit-pool.d.ts +13 -2
  126. package/dist/types/sdk/bus/recent-activity.d.ts +21 -12
  127. package/dist/types/sdk/bus/rich-document.d.ts +7 -0
  128. package/dist/types/sdk/bus/rich-render.d.ts +18 -41
  129. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +9 -4
  130. package/dist/types/sdk/bus/telegram-daemon.d.ts +69 -3
  131. package/dist/types/sdk/bus/threaded-inbound.d.ts +1 -1
  132. package/dist/types/sdk/bus/threaded-render.d.ts +13 -0
  133. package/dist/types/sdk/bus/topic-registry.d.ts +24 -2
  134. package/dist/types/sdk/host/control/operations.d.ts +1 -1
  135. package/dist/types/sdk/host/host.d.ts +2 -0
  136. package/dist/types/sdk/index.d.ts +1 -0
  137. package/dist/types/sdk/session-directory.d.ts +56 -0
  138. package/dist/types/session/agent-session.d.ts +82 -47
  139. package/dist/types/session/agent-storage.d.ts +7 -0
  140. package/dist/types/session/fallback-chain-controller.d.ts +10 -2
  141. package/dist/types/session/internal/managed-session-scope.d.ts +102 -0
  142. package/dist/types/session/internal/managed-session-storage.d.ts +38 -0
  143. package/dist/types/session/messages.d.ts +16 -0
  144. package/dist/types/session/session-manager-internal.d.ts +14 -0
  145. package/dist/types/session/session-manager.d.ts +82 -12
  146. package/dist/types/session/session-storage.d.ts +43 -3
  147. package/dist/types/session/volatile-context-pruning.d.ts +15 -0
  148. package/dist/types/skill-state/{deep-interview-mutation-guard.d.ts → workflow-mutation-guard.d.ts} +24 -8
  149. package/dist/types/skill-state/workflow-state-contract.d.ts +1 -3
  150. package/dist/types/slash-commands/builtin-registry.d.ts +4 -1
  151. package/dist/types/system-prompt.d.ts +2 -11
  152. package/dist/types/task/executor.d.ts +3 -1
  153. package/dist/types/thinking.d.ts +7 -0
  154. package/dist/types/tool-discovery/tool-index.d.ts +1 -50
  155. package/dist/types/tools/ask.d.ts +64 -2
  156. package/dist/types/tools/bash.d.ts +3 -0
  157. package/dist/types/tools/browser/dead-tab-recovery.d.ts +24 -0
  158. package/dist/types/tools/browser/tab-supervisor.d.ts +21 -0
  159. package/dist/types/tools/cron.d.ts +2 -0
  160. package/dist/types/tools/fetch.d.ts +1 -0
  161. package/dist/types/tools/index.d.ts +30 -15
  162. package/dist/types/tools/output-meta.d.ts +1 -0
  163. package/dist/types/tools/read.d.ts +3 -0
  164. package/dist/types/tools/search-tool-bm25.d.ts +3 -4
  165. package/dist/types/tools/subagent-render.d.ts +1 -0
  166. package/dist/types/tools/subagent.d.ts +6 -1
  167. package/dist/types/utils/event-bus.d.ts +1 -1
  168. package/dist/types/web/search/index.d.ts +3 -1
  169. package/package.json +21 -9
  170. package/scripts/build-sdk-package-smoke.ts +39 -1
  171. package/scripts/generate-hotkeys-docs.ts +74 -0
  172. package/scripts/generate-sdk-operation-inventory.ts +64 -20
  173. package/scripts/verify-gjc-sdk-canonicalization.ts +182 -2
  174. package/src/async/job-manager.ts +455 -69
  175. package/src/cli/config-cli.ts +75 -2
  176. package/src/cli/notify-cli.ts +92 -26
  177. package/src/cli/session-picker.ts +20 -3
  178. package/src/cli/setup-cli.ts +1 -1
  179. package/src/cli.ts +1 -1
  180. package/src/commands/config.ts +1 -1
  181. package/src/commands/harness.ts +34 -106
  182. package/src/commands/launch.ts +6 -4
  183. package/src/commands/mcp-serve.ts +85 -8
  184. package/src/commands/mcp.ts +2 -2
  185. package/src/commands/notify.ts +8 -4
  186. package/src/commands/sdk.ts +61 -40
  187. package/src/commands/ultragoal.ts +4 -1
  188. package/src/config/atomic-yaml-patch.ts +80 -13
  189. package/src/config/file-lock.ts +105 -43
  190. package/src/config/keybindings.ts +64 -20
  191. package/src/config/model-auth.ts +9 -0
  192. package/src/config/model-bindings-applier.ts +139 -0
  193. package/src/config/model-discovery-manager.ts +224 -0
  194. package/src/config/model-equivalence.ts +66 -0
  195. package/src/config/model-registry.ts +169 -302
  196. package/src/config/model-resolver.ts +361 -369
  197. package/src/config/models-config-schema.ts +5 -4
  198. package/src/config/settings-schema.ts +159 -2
  199. package/src/config/settings.ts +458 -482
  200. package/src/coordinator-mcp/policy.ts +76 -11
  201. package/src/coordinator-mcp/question-gate-codec.ts +274 -0
  202. package/src/coordinator-mcp/question-state.ts +778 -0
  203. package/src/coordinator-mcp/server.ts +1702 -238
  204. package/src/debug/index.ts +1 -1
  205. package/src/defaults/gjc/skills/deep-interview/SKILL.md +13 -1
  206. package/src/defaults/gjc/skills/team/SKILL.md +16 -0
  207. package/src/discovery/helpers.ts +1 -50
  208. package/src/edit/index.ts +64 -0
  209. package/src/eval/py/env.ts +26 -0
  210. package/src/eval/py/kernel.ts +5 -3
  211. package/src/extensibility/extensions/loader.ts +9 -1
  212. package/src/extensibility/extensions/runner.ts +12 -3
  213. package/src/extensibility/extensions/types.ts +39 -1
  214. package/src/extensibility/gjc-plugins/installer.ts +16 -16
  215. package/src/extensibility/hooks/runner.ts +2 -2
  216. package/src/extensibility/runtime-skill-discovery.ts +33 -13
  217. package/src/extensibility/shared-events.ts +2 -0
  218. package/src/gjc-runtime/deep-interview-recorder.ts +63 -3
  219. package/src/gjc-runtime/deep-interview-runtime.ts +76 -27
  220. package/src/gjc-runtime/deep-interview-state.ts +317 -5
  221. package/src/gjc-runtime/goal-mode-request.ts +55 -8
  222. package/src/gjc-runtime/launch-tmux.ts +2 -5
  223. package/src/gjc-runtime/launch-worktree.ts +5 -5
  224. package/src/gjc-runtime/linux-proc.ts +71 -0
  225. package/src/gjc-runtime/ralplan-runtime.ts +74 -90
  226. package/src/gjc-runtime/session-resolution.ts +18 -3
  227. package/src/gjc-runtime/session-state-sidecar.ts +6 -107
  228. package/src/gjc-runtime/state-migrations.ts +1 -1
  229. package/src/gjc-runtime/state-runtime.ts +320 -249
  230. package/src/gjc-runtime/state-writer.ts +36 -40
  231. package/src/gjc-runtime/team-launch.ts +319 -0
  232. package/src/gjc-runtime/team-notify.ts +326 -0
  233. package/src/gjc-runtime/team-runtime.ts +1099 -1482
  234. package/src/gjc-runtime/team-store.ts +828 -0
  235. package/src/gjc-runtime/team-workers.ts +962 -0
  236. package/src/gjc-runtime/tmux-owner-isolation-cli.ts +2 -11
  237. package/src/gjc-runtime/tmux-owner-isolation.ts +14 -9
  238. package/src/gjc-runtime/tmux-sessions.ts +4 -21
  239. package/src/gjc-runtime/ultragoal-change-set.ts +172 -0
  240. package/src/gjc-runtime/ultragoal-evidence.ts +874 -0
  241. package/src/gjc-runtime/ultragoal-guard.ts +83 -12
  242. package/src/gjc-runtime/ultragoal-pipeline.ts +306 -0
  243. package/src/gjc-runtime/ultragoal-receipt-freshness.ts +102 -1
  244. package/src/gjc-runtime/ultragoal-runtime.ts +156 -1319
  245. package/src/gjc-runtime/workflow-cli-common.ts +30 -0
  246. package/src/gjc-runtime/workflow-manifest.generated.json +58 -0
  247. package/src/gjc-runtime/workflow-manifest.ts +18 -0
  248. package/src/goals/continuation-timeout-guard.ts +79 -0
  249. package/src/goals/runtime.ts +7 -5
  250. package/src/goals/state.ts +18 -0
  251. package/src/harness-control-plane/lifecycle-reconciliation.ts +64 -0
  252. package/src/harness-control-plane/phase-rollup.ts +4 -7
  253. package/src/harness-control-plane/receipt-ingest.ts +5 -0
  254. package/src/harness-control-plane/receipt-spool.ts +51 -7
  255. package/src/harness-control-plane/session-lease.ts +12 -130
  256. package/src/hindsight/backend.ts +26 -27
  257. package/src/hindsight/state.ts +101 -32
  258. package/src/hooks/skill-state.ts +17 -11
  259. package/src/internal-urls/docs-index.generated.ts +21 -18
  260. package/src/lsp/client.ts +1 -1
  261. package/src/lsp/config.ts +145 -26
  262. package/src/lsp/index.ts +1 -1
  263. package/src/lsp/lspmux.ts +39 -10
  264. package/src/lsp/path-trust.ts +81 -0
  265. package/src/main.ts +28 -8
  266. package/src/memories/index.ts +1 -0
  267. package/src/memories/storage.ts +6 -2
  268. package/src/modes/action-registry.ts +165 -0
  269. package/src/modes/components/chrome.ts +40 -0
  270. package/src/modes/components/command-palette.ts +168 -0
  271. package/src/modes/components/custom-editor.ts +1 -1
  272. package/src/modes/components/custom-provider-wizard.ts +51 -14
  273. package/src/modes/components/index.ts +2 -1
  274. package/src/modes/components/pet-selector.ts +11 -17
  275. package/src/modes/components/plan-preview-overlay.ts +295 -0
  276. package/src/modes/components/queue-mode-selector.ts +10 -27
  277. package/src/modes/components/queue-pane.ts +79 -0
  278. package/src/modes/components/read-tool-group.ts +13 -0
  279. package/src/modes/components/session-observer-overlay.ts +207 -772
  280. package/src/modes/components/sessions-dashboard.ts +181 -0
  281. package/src/modes/components/settings-selector.ts +1 -1
  282. package/src/modes/components/show-images-selector.ts +10 -24
  283. package/src/modes/components/status-line/types.ts +1 -1
  284. package/src/modes/components/status-line.ts +1 -969
  285. package/src/modes/components/tasks-pane.ts +73 -0
  286. package/src/modes/components/theme-selector.ts +11 -31
  287. package/src/modes/components/tool-execution.ts +22 -0
  288. package/src/modes/components/tool-status-header.ts +1056 -0
  289. package/src/modes/components/transcript-viewer-overlay.ts +384 -0
  290. package/src/modes/controllers/btw-controller.ts +1 -0
  291. package/src/modes/controllers/command-controller.ts +9 -15
  292. package/src/modes/controllers/event-controller.ts +3 -2
  293. package/src/modes/controllers/extension-ui-controller.ts +72 -25
  294. package/src/modes/controllers/goal-mode-controller.ts +474 -0
  295. package/src/modes/controllers/input-controller.ts +764 -229
  296. package/src/modes/controllers/mode-gate.ts +24 -0
  297. package/src/modes/controllers/plan-mode-controller.ts +517 -0
  298. package/src/modes/controllers/selector-controller.ts +225 -10
  299. package/src/modes/controllers/stt-controller.ts +125 -0
  300. package/src/modes/interactive-mode.ts +302 -1151
  301. package/src/modes/jobs-observer.ts +3 -0
  302. package/src/modes/runtime-init.ts +8 -0
  303. package/src/modes/shared/agent-wire/deep-interview-gate.ts +31 -106
  304. package/src/modes/shared/agent-wire/workflow-gate-broker.ts +78 -19
  305. package/src/modes/shared/agent-wire/workflow-gate-types.ts +177 -0
  306. package/src/modes/tasks-aggregator.ts +199 -0
  307. package/src/modes/transcript-item-registry.ts +229 -0
  308. package/src/modes/types.ts +47 -20
  309. package/src/modes/utils/ui-helpers.ts +17 -9
  310. package/src/prompts/agent-fragments/ralplan-persistence.md +6 -0
  311. package/src/prompts/agent-fragments/restricted-bash.md +1 -0
  312. package/src/prompts/agents/architect.md +2 -8
  313. package/src/prompts/agents/critic.md +2 -8
  314. package/src/prompts/agents/executor.md +3 -0
  315. package/src/prompts/agents/planner.md +4 -12
  316. package/src/prompts/system/custom-system-prompt.md +1 -23
  317. package/src/prompts/system/plan-mode-approved.md +8 -0
  318. package/src/prompts/system/system-prompt.md +17 -96
  319. package/src/prompts/tools/bash.md +4 -4
  320. package/src/prompts/tools/browser.md +15 -52
  321. package/src/prompts/tools/find.md +2 -2
  322. package/src/prompts/tools/hashline.md +13 -55
  323. package/src/prompts/tools/read.md +3 -6
  324. package/src/prompts/tools/search-tool-bm25.md +0 -2
  325. package/src/prompts/tools/search.md +2 -4
  326. package/src/prompts/tools/skill-discovery.md +1 -2
  327. package/src/prompts/tools/task.md +1 -1
  328. package/src/runtime-mcp/manager.ts +1 -1
  329. package/src/sdk/broker/broker.ts +206 -78
  330. package/src/sdk/broker/discovery.ts +21 -2
  331. package/src/sdk/broker/ensure.ts +85 -25
  332. package/src/sdk/broker/lifecycle-codec.ts +11 -0
  333. package/src/sdk/broker/lifecycle-ledger.ts +371 -74
  334. package/src/sdk/broker/lifecycle.ts +1399 -142
  335. package/src/sdk/broker/process-incarnation.ts +5 -13
  336. package/src/sdk/broker/session-index.ts +145 -56
  337. package/src/sdk/broker/state-version.ts +21 -0
  338. package/src/sdk/broker/transport.ts +1 -1
  339. package/src/sdk/bus/chat-daemon-cli.ts +2 -0
  340. package/src/sdk/bus/chat-daemon-control.ts +8 -28
  341. package/src/sdk/bus/chat-effect-journal.ts +14 -4
  342. package/src/sdk/bus/config-commands.ts +5 -4
  343. package/src/sdk/bus/config.ts +98 -0
  344. package/src/sdk/bus/conversation-store.ts +5 -29
  345. package/src/sdk/bus/daemon-paths.ts +2 -0
  346. package/src/sdk/bus/discord-daemon.ts +25 -8
  347. package/src/sdk/bus/html-format.ts +20 -3
  348. package/src/sdk/bus/index.ts +834 -113
  349. package/src/sdk/bus/lifecycle-control-runtime.ts +91 -33
  350. package/src/sdk/bus/native-runtime-compatibility.ts +1 -1
  351. package/src/sdk/bus/natives-augment.d.ts +26 -1
  352. package/src/sdk/bus/notification-service.ts +168 -20
  353. package/src/sdk/bus/rate-limit-pool.ts +58 -14
  354. package/src/sdk/bus/recent-activity.ts +188 -74
  355. package/src/sdk/bus/rich-document.ts +258 -0
  356. package/src/sdk/bus/rich-render.ts +62 -70
  357. package/src/sdk/bus/telegram-daemon-cli.ts +15 -59
  358. package/src/sdk/bus/telegram-daemon-contract.ts +9 -4
  359. package/src/sdk/bus/telegram-daemon.ts +1491 -247
  360. package/src/sdk/bus/threaded-inbound.ts +8 -3
  361. package/src/sdk/bus/threaded-render.ts +57 -1
  362. package/src/sdk/bus/topic-registry.ts +120 -13
  363. package/src/sdk/host/control/dispatch.ts +14 -2
  364. package/src/sdk/host/control/operations.ts +6 -1
  365. package/src/sdk/host/host.ts +31 -1
  366. package/src/sdk/host/query/handlers.ts +20 -22
  367. package/src/sdk/host/query/revision-store.ts +80 -57
  368. package/src/sdk/index.ts +1 -0
  369. package/src/sdk/protocol/operation-inventory.generated.json +943 -1907
  370. package/src/sdk/session-directory.ts +141 -0
  371. package/src/sdk/session.ts +458 -479
  372. package/src/session/agent-session.ts +1901 -637
  373. package/src/session/agent-storage.ts +18 -0
  374. package/src/session/cache-economics.ts +25 -8
  375. package/src/session/fallback-chain-controller.ts +53 -3
  376. package/src/session/internal/managed-session-scope.ts +2226 -0
  377. package/src/session/internal/managed-session-storage.ts +453 -0
  378. package/src/session/messages.ts +91 -2
  379. package/src/session/session-manager-internal.ts +33 -0
  380. package/src/session/session-manager.ts +1112 -333
  381. package/src/session/session-storage.ts +444 -39
  382. package/src/session/volatile-context-pruning.ts +78 -0
  383. package/src/setup/credential-auto-import.ts +2 -1
  384. package/src/setup/hermes/templates/operator-instructions.v1.md +1 -1
  385. package/src/setup/provider-onboarding.ts +36 -61
  386. package/src/setup/provider-presets.json +5 -0
  387. package/src/skill-state/active-state.ts +3 -13
  388. package/src/skill-state/{deep-interview-mutation-guard.ts → workflow-mutation-guard.ts} +47 -29
  389. package/src/skill-state/workflow-state-contract.ts +6 -41
  390. package/src/slash-commands/builtin-registry.ts +46 -11
  391. package/src/system-prompt.ts +37 -44
  392. package/src/task/agents.ts +19 -1
  393. package/src/task/executor.ts +90 -6
  394. package/src/task/index.ts +62 -37
  395. package/src/thinking.ts +21 -6
  396. package/src/tool-discovery/tool-index.ts +2 -134
  397. package/src/tools/ask.ts +157 -21
  398. package/src/tools/ast-edit.ts +1 -1
  399. package/src/tools/bash.ts +38 -0
  400. package/src/tools/browser/dead-tab-recovery.ts +78 -0
  401. package/src/tools/browser/tab-supervisor.ts +282 -36
  402. package/src/tools/computer.ts +10 -3
  403. package/src/tools/cron.ts +30 -16
  404. package/src/tools/eval.ts +1 -2
  405. package/src/tools/fetch.ts +11 -4
  406. package/src/tools/index.ts +76 -24
  407. package/src/tools/output-meta.ts +13 -5
  408. package/src/tools/read.ts +37 -1
  409. package/src/tools/resource-gc.ts +2 -2
  410. package/src/tools/search-tool-bm25.ts +11 -74
  411. package/src/tools/subagent-render.ts +19 -8
  412. package/src/tools/subagent.ts +84 -32
  413. package/src/utils/event-bus.ts +9 -4
  414. package/src/web/search/index.ts +3 -3
  415. package/dist/types/discovery/plugin-dir-roots.d.ts +0 -15
  416. package/dist/types/runtime-mcp/discoverable-tool-metadata.d.ts +0 -7
  417. package/src/discovery/plugin-dir-roots.ts +0 -28
  418. package/src/runtime-mcp/discoverable-tool-metadata.ts +0 -25
package/CHANGELOG.md CHANGED
@@ -2,15 +2,74 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.11.2] - 2026-07-19
6
+
7
+ ### Changed
8
+ - Simplified the release CI to a minimal, industry-standard workflow: a version tag builds the native addons and binaries, then publishes to npm and cuts the GitHub Release in one self-contained job graph. Removed the source-SHA re-verification gate, evidence-provenance handshake, and draft/finalize multi-job dance that made every version-bump commit fail CI. The lint/type-check job is now native-free (biome + tsc); runtime doc and SDK-canonicalization checks moved to the test job so they run with a built addon.
9
+
10
+ ### Fixed
11
+ - The Python eval runtime now honors the documented `GJC_*` environment variables instead of silently reading only legacy `PI_*` names. `GJC_PY` (tokens `0`/`bash`, `1`/`py`, `js`, `mix`/`both`) overrides the eval backend allowance with precedence over legacy `PI_PY`/`PI_JS`; `GJC_PYTHON_SKIP_CHECK`, `GJC_PYTHON_IPC_TRACE`, and `GJC_PYTHON_INTEGRATION` are read first with `PI_*` fallback (OR semantics, so either truthy name wins). Operators following `docs/environment-variables.md` and `docs/python-repl.md` who set `GJC_PY=py` previously saw no effect — a silent docs/runtime contract break. Legacy `PI_*` names remain supported for backward compatibility.
12
+
13
+ ### Fixed
14
+ - Team worker launches now receive the validated owning `GJC_SESSION_ID` for sanctioned session-scoped writes while preserving absent identity, fail-closed resolution, and separate spawn provenance (#2597).
15
+ - Managed and explicit session directories now canonicalize benign ancestor symlinks (e.g. macOS `/var -> /private/var`, a symlinked `$HOME` or project directory) to a symlink-free trusted root before the strict owner-only and reparse guards run, so session creation, moves, resume, and writes no longer fail with `reparse_point` / `Unsafe reparse storage path` under a symlinked temp root or home. The native primitive stays strict and continues to reject symlinked components at or below the trusted root.
16
+ - Skill invocation failures now list available skill names so agents can recover from typos without a blind retry loop.
17
+ - Workflow state receipts now use canonical session-layout paths, require resolved session identity, and report a `state_path` that matches native write/clear output (#2393).
18
+ - Coordinator MCP operational calls now canonically bootstrap or reuse the agent-global SDK broker when discovery is absent or stale, while coordinator/hermes JSON checks report catalog and broker-discovery readiness separately without mutating broker state (#2552).
19
+ - Coordinator MCP question polling now requires a session, reconciles pending workflow gates into bounded public questions, diagnostics, and reconciliation state, and submits bound idempotent answers through `workflow.gate_answer` without exposing private gate payloads (#2550).
20
+ - Runtime skill discovery now follows native user config-root precedence: nearest project, canonical `GJC_CONFIG_DIR`/`PI_CONFIG_DIR`/`.gjc` `agent/skills`, configured legacy `<config>/skills`, then historical legacy `~/.gjc/skills`, preserving exact fallback precedence (#2572).
21
+ - Opt-in stalled team-worker continuation now remains default-off (`GJC_TEAM_AUTO_CONTINUE_STALLED_WORKERS=1`) and sends at most two fenced, journaled fixed prompts only to a verified stale worker pane with a matching live claim and sufficient lease; unknown restart state fails closed, with no provider replay, pane lifecycle action, or claim mutation (#2580).
22
+
23
+ ### Fixed
24
+ - SDK host response delivery to a disconnected client no longer escalates a second structured-error send failure into a process-level unhandled rejection; failures stay local to that connection.
25
+
26
+ ### Fixed
27
+ - Repository LSP configuration can no longer define process-affecting server behavior: project files may control declarative matching, activation, and capabilities, but cannot set launch fields, initialization options, or opaque server settings. Trusted canonical user configuration outside the project retains those overrides; project-controlled plugin roots and the quarantined `--plugin-dir` surface cannot inject them. Automatic discovery uses trusted external executables and rejects repository-owned lexical paths as well as symlink-resolved project binaries; status uses the session cwd as its lspmux trust root. `GJC_DISABLE_LSPMUX=1` is the canonical opt-out and `PI_DISABLE_LSPMUX=1` is a supported compatibility alias; either truthy value disables lspmux probing and wrapping.
28
+ - Palette slash commands now run only from an empty composer; drafts are never touched.
29
+ - Aborting a session without an enabled active goal no longer suppresses the first reminder when a goal is activated later; active-goal abort suppression is one-shot, goal-owned, and clears across inactive or replacement-goal transitions (#2436).
30
+ - Palette slash submissions no longer clear or rewrite composer text, cursor state, history, or pending images created while an asynchronous input hook is awaiting; canonical keyboard submission cleanup remains unchanged (#2441).
31
+ - Dead browser-tab recovery now expires descriptors without releasing replacement, revived, or differently owned tabs, while exactly-once teardown closes stale targets and releases browser holds without refcount underflow (#2437).
32
+ - Local-memory Phase 1 no longer processes history from another working directory.
33
+
34
+ ### Added
35
+ - Double-Esc now clears an idle draft after a confirmation hint, saving it to prompt history; from an empty editor it follows the configured tree, branch, or disabled action.
36
+ - Added a searchable command palette with direct action dispatch; slash commands run only from an empty composer, and drafts are never touched.
37
+ - Added deep-interview intent manifests that preserve user-locked artifacts, surfaces, and integrations through Round 0.
38
+ - Added Telegram `/btw <question>` support through the `ephemeral_turn_v1` SDK capability in authorized known private-session topics. It uses current-session context in an isolated side turn without injecting or persisting user or assistant messages in main history, remains available while the main turn is busy, permits two concurrent questions per logical session, and cancels provider work at the 120-second host deadline; `notifications.telegram.btw.enabled` defaults to `true` as the local kill switch.
39
+ - Telegram `/btw` replies now use eligible complete Bot API 10.1 structured Markdown once as `{rich_message:{markdown,skip_entity_detection:true}}`, correlated in the source topic. Tables and math use Telegram Markdown support rather than outgoing native blocks or media; ineligible content and definite rich rejection use correlated HTML, while ambiguous outcomes never retry or fall back and `/rich off` remains HTML-only.
40
+
41
+ ### Fixed
42
+
43
+ - Sessions running a managed model fallback chain no longer wedge with repeated `Retry failed after N attempts: The object can not be cloned.` after a provider HTTP error whose response carried headers. The live `Headers` instance attached to the provider error was not structured-cloneable, so the managed attempt snapshot replaced the real provider failure with a local `DataCloneError` on every model in the chain — misreporting `Model fallback chain exhausted` and permanently failing every subsequent prompt while the provider kept erroring. Transport facts now retain only plain-record retry signals, and the attempt snapshot degrades gracefully instead of failing the attempt.
44
+
45
+ ### Fixed
46
+ - Active deep-interview sessions now resume automatically after a normal assistant stop while ordinary active interviewing remains eligible, using bounded workflow-state continuation; recovery, leak, stale-state, handoff, and crystallization blocks remain Stop-gate handled.
47
+
48
+ ### Changed
49
+ - Removed deprecated `DiscoverableMCPTool`, `DiscoverableMCPSearchIndex`, and related MCP-only discovery helper exports. Use the unified `DiscoverableTool` discovery APIs; the `mcp.discoveryMode` settings alias remains supported.
50
+
51
+ ### Fixed
52
+ - Connected MCP server instructions now remain untrusted user-role data instead of entering the cached system prompt; hostile file paths, working directories, and workspace-tree metadata are structurally encoded, and volatile project context is removed from durable session history between requests.
53
+ - Restored the strict G002 public-surface quarantine by removing the default README advertisement for the private coordinator MCP runtime.
54
+
55
+ ## [0.11.1] - 2026-07-16
56
+
57
+ ### Fixed
58
+ - Published the Windows Bun workflow-gate durability fix that tolerates unsupported `EPERM` directory `fsync` failures after an already-committed atomic rename; the 0.11.0 package changelog described the fix, but the released artifact did not contain it (#2316).
59
+
5
60
  ## [0.11.0] - 2026-07-15
6
61
 
7
62
  ### Fixed
63
+ - Discord inbound lease recovery now exposes a deterministic scheduler seam, preserves exponential retry wakeups after transient endpoint lookup failures, and cancels pending recovery exactly on daemon stop instead of relying on wall-clock sleeps in regression coverage.
8
64
  - Input-free interactive TTY startup now keeps the TUI reachable when configured model profiles are missing required provider credentials, skips only the blocked profiles, and preserves later `--mpreset` and explicit model/thinking precedence; redirected terminals, input-bearing, resume-continuation, image-only, print/text, and unrelated activation failures remain fail-closed (#2277).
65
+ - Windows Bun runtimes no longer crash while committing the durable workflow-gate store when directory `fsync` reports the unsupported-operation code `EPERM`; unexpected directory-sync failures remain fail-closed.
9
66
  - Browser geo settings now propagate coherently across request `Accept-Language`, navigator languages, and `Intl` locale/timezone surfaces; configured managed browsers are isolated by geo/profile posture, concurrent acquisition is serialized, and unset geo preserves Chromium's native locale/timezone instead of injecting a fixed New York profile.
67
+ - Windows startup no longer fails when the platform rejects the workflow-gate store's parent-directory durability sync with `EPERM`; file fsync and atomic replacement remain enforced.
10
68
 
11
69
  - Cooperative mid-run context maintenance now waits at a cancellation-aware FIFO consumer-drain checkpoint before flushing or rewriting session history. Materialized tool results and steering messages are synchronously canonicalized first; aborted barriers and hook/signal-cancelled compactions settle without rewriting or scheduling a continuation. Promotion, pruning, and compaction each start a clean provider/prompt-cache epoch. Script-aware #2067 unsent-delta accounting remains cache-free and distinct from the lifecycle checkpoint.
12
70
  - Classified the cooperative mid-run maintenance driver and token estimator test seams as locked non-public SDK exclusions, restoring deterministic operation-inventory generation and post-merge dev CI coverage.
13
71
  - Accepted SDK prompts now deliver correlated `agent_start` and exactly one terminal lifecycle frame directly to the requesting authenticated WebSocket connection while retaining replayable host events. Harness owner observation also waits for every previously accepted frame to finish serial persistence, so message-update storms and polling gaps cannot hide sticky completion evidence (#2169).
72
+ - `/new` now fails closed while owned subagent shutdown is unproven: it preserves the current session identity and shows an actionable cleanup notice. Successful replacement waits for cooperative child cancellation, cancels owner jobs before switching identity, and `/drop` creates the replacement before attempting old-session deletion (#2261).
14
73
 
15
74
  ### Added
16
75
 
@@ -19,15 +78,17 @@
19
78
  - Added the standalone `@gajae-code/bridge-client` transport-only v3 SDK package. It exports `SdkClient` and its associated types; `@gajae-code/coding-agent/sdk` remains a compatibility re-export with the exact same class identity. Historical BridgeClient backend protocol, handshake, commands, SSE, and host-control bypass surfaces remain unavailable.
20
79
  - Added explicit `--mcp-config <absolute-path>` support for one trusted, tools-only MCP config in top-level standalone sessions without enabling automatic user or project MCP discovery; exact reads reject links and identity changes, and MCP tool-name collisions fail closed.
21
80
  - Added additive v3 workflow-gate correlation compatibility surfaces (#2171): explicit Rust workflow-frame readers/registration preserve `workflowGateId` without changing legacy `ActionNeeded`, `ServerMessage`, or `register_ask`; N-API retains `registerAsk` and adds correlated/arbitrated registration and exact unclaimed-retirement APIs. Private presentation leases, routes, claims, receipts, epochs, and endpoint generations remain non-public.
81
+ - Added the versioned, readonly managed session-directory SDK: `SESSION_DIRECTORY_API_VERSION`, `resolveManagedSessionScope`, and `listManagedSessionCandidates` are exported from `@gajae-code/coding-agent/sdk`. The package boundary continues to reject private `session/internal/*` imports. Managed writes use v2 workspace scopes with validated opt-in legacy copy-retain migration (#2177).
22
82
 
23
83
  ### Changed
84
+ - Explicit fold choices from the user shortcut or extension `setToolsExpanded` now pin a block for its component lifetime, so automatic stamping no longer overwrites them; sessions that never toggle are unchanged.
24
85
 
25
86
  - Renamed the notifications SDK to the Gajae-Code SDK: `docs/notifications-sdk.md` is now `docs/sdk.md`, `src/notifications/` is now `src/sdk/bus/`, and `src/sdk.ts` is now the `src/sdk/` module directory. Old deep-import specifiers no longer resolve.
26
87
  - Moved SDK discovery from `.gjc/state/notifications/` to `.gjc/state/sdk/`. Restart sessions and daemons together when upgrading; the runtime does not dual-scan the old and new directories.
27
88
  - Removed the `--mode rpc`, `--mode rpc-ui`, and `--mode bridge` external ingress modes. Machine clients must use the SDK WebSocket interfaces documented in `docs/sdk.md`; no RPC or Bridge compatibility path remains.
28
89
  - Documented the current GPT-5.6 Codex and combo profile mappings as product judgments, including the durable `opus-codex` `anthropic/claude-sonnet-5` planner override and `fable-opus-codex` `anthropic/claude-opus-4-8:medium` planner.
29
90
  - Resolved the SDK v3 workflow-gate shipping classification (#2171): `workflowGateId` and Q12 diagnostics are additive SDK v3 surfaces, while `action_needed.id` remains the transient, generic `reply.id` authority. `expectedSessionId` omission remains accepted and audited for the entire SDK v3 line; new clients must send it, and mandatory enforcement or removal can occur no earlier than SDK v4 only after at least one full published deprecation release/window with deployed-client notice. Explicit session mismatches fail closed before resolution; mismatched sessions, stale/reissued actions, and unsafe ambiguity never regain authority.
30
- - Documented release pairing: the `@gajae-code/coding-agent` runtime and `@gajae-code/natives` native addon ship from the same source release at exact matching package versions (currently `0.10.2`), with the native loader version sentinel enforcing the pair. Mixed native/runtime versions are unsupported and cannot claim SDK compatibility.
91
+ - Documented release pairing: the `@gajae-code/coding-agent` runtime and `@gajae-code/natives` native addon ship from the same source release at exact matching package versions, with the native loader version sentinel enforcing the pair. Mixed native/runtime versions are unsupported and cannot claim SDK compatibility.
31
92
  ### Fixed
32
93
  - Startup continuation now participates in the existing managed fallback and in-flight recovery envelope, preventing a retryable resumed turn from publishing `agent_end`/idle before retry success, exhaustion, cancellation, or startup failure has settled (#2092).
33
94
 
@@ -105,6 +166,7 @@
105
166
  - Cache-miss diagnostics now separate actionable, diagnostic-only, and provider-side-suspected causes instead of asserting a user-side fix for every miss (#2020). A large, costly miss with no cache reads or writes is reported as a neutral `Cache notice` marked "provider-side suspected / not user-actionable" (with what GJC cannot determine) rather than telling the user to keep a stable prefix; a miss with reads but no writes is reported as diagnostic-only without asserting a single cause; and the "cache write without enough matching reads" warning now only fires when reads actually fail to cover the writes. The existing miss cost summary and the #1929/#1936 pricing/provenance safeguards are unchanged.
106
167
 
107
168
  ### Fixed
169
+ - `/btw` side questions now start independently while the main answer is still streaming, read only committed conversation state, avoid main-session callbacks/history/IRC-roster mutation, disable silent provider retries, and fail the side request visibly if no provider event arrives within 15 seconds.
108
170
 
109
171
  - Fixed native-Windows coordinator/runtime compatibility by treating psmux's successful empty `list-sessions` response as an absent server while keeping malformed rows fail-closed, reading process incarnations through a validated PowerShell start-time query, sharing the existing BOM-free encoded PowerShell pane command, preserving multiline SDK prompts behind semantic readiness, and retaining runtime command/turn acknowledgement identity across Windows-equivalent workspace paths (#2145).
110
172
  - The coordinator MCP owner-server probe now recognizes tmux ≥3.7's missing-server diagnostic (`error connecting to <socket> (No such file or directory)`) as an absent server. tmux 3.7 changed the wording from the older `no server running on <socket>`, which the coordinator probe did not match — so a brand-new coordinator socket (which never has a server yet) was misclassified `unverifiable` instead of `absent`, and **every** `gjc_delegate_*` / session create failed closed with `coordinator_tmux_owner_server_unverifiable` on tmux ≥3.7. The coordinator and `gjc` harness probes now match the same no-server wordings the other owner-isolation probes already did.
@@ -59,6 +59,31 @@ export type SubagentRunOutcome = {
59
59
  };
60
60
  /** Canonical lifecycle of a subagent across pause/resume cycles. */
61
61
  export type SubagentLifecycle = "running" | "paused" | "queued" | "completed" | "failed" | "cancelled";
62
+ /** Maximum time allowed to prove owned subagents have stopped before replacement. */
63
+ export declare const OWNER_SUBAGENT_SHUTDOWN_TIMEOUT_MS = 5000;
64
+ export declare class OwnerSubagentShutdownError extends Error {
65
+ readonly code = "owner_shutdown_in_progress";
66
+ constructor();
67
+ }
68
+ export interface OwnerSubagentShutdownTarget {
69
+ subagentId: string;
70
+ jobId: string | null;
71
+ source: "record" | "metadata_job";
72
+ }
73
+ export interface OwnerSubagentShutdownLease {
74
+ ownerId: string;
75
+ id: string;
76
+ targets: readonly OwnerSubagentShutdownTarget[];
77
+ }
78
+ export interface OwnerSubagentShutdownProof {
79
+ ownerId: string;
80
+ leaseId: string;
81
+ confirmed: boolean;
82
+ reason: "confirmed" | "deadline_exceeded" | "missing_terminal_evidence" | "lease_lost";
83
+ targets: readonly OwnerSubagentShutdownTarget[];
84
+ terminalIds: readonly string[];
85
+ unresolvedIds: readonly string[];
86
+ }
62
87
  /**
63
88
  * Live, executor-owned control handle for a RUNNING subagent. Registered when a
64
89
  * subagent run starts and removed on pause/terminal so a paused subagent retains
@@ -106,6 +131,11 @@ export interface ResumeDescriptor {
106
131
  ownerId?: string;
107
132
  data: unknown;
108
133
  }
134
+ /**
135
+ * In-memory resume runner bound to the session that originally launched a
136
+ * subagent. Never serialized: process restart drops it so resume fails closed.
137
+ */
138
+ export type ResumeRunner = (subagentId: string, message?: string, descriptor?: ResumeDescriptor) => string | undefined;
109
139
  export interface AsyncJobManagerOptions {
110
140
  onJobComplete: (jobId: string, text: string, job?: AsyncJob) => void | Promise<void>;
111
141
  maxRunningJobs?: number;
@@ -241,9 +271,16 @@ export declare class AsyncJobManager {
241
271
  */
242
272
  hasLiveSubagent(subagentId: string, filter?: AsyncJobFilter): boolean;
243
273
  /** Install the TaskTool-owned resume runner. Returns the new job id, or undefined on failure. */
244
- setResumeRunner(runner: (subagentId: string, message?: string, descriptor?: ResumeDescriptor) => string | undefined): void;
245
- registerResumeDescriptor(descriptor: ResumeDescriptor): void;
274
+ setResumeRunner(runner: ResumeRunner): void;
275
+ registerResumeDescriptor(descriptor: ResumeDescriptor, runner?: ResumeRunner): void;
246
276
  getResumeDescriptor(subagentId: string, filter?: AsyncJobFilter): ResumeDescriptor | undefined;
277
+ beginOwnerSubagentShutdown(ownerId: string): OwnerSubagentShutdownLease | undefined;
278
+ runOwnerProducerCleanups(filter?: AsyncJobFilter): void;
279
+ runOwnerProducerCleanupsStrict(filter?: AsyncJobFilter): void;
280
+ cancelAndProveOwnerSubagents(lease: OwnerSubagentShutdownLease, options?: {
281
+ timeoutMs?: number;
282
+ }): Promise<OwnerSubagentShutdownProof>;
283
+ finishOwnerSubagentShutdown(lease: OwnerSubagentShutdownLease, outcome: "commit" | "release"): void;
247
284
  /** Request a graceful safe-boundary pause of a running subagent. */
248
285
  pauseSubagent(subagentId: string, filter?: AsyncJobFilter): {
249
286
  ok: boolean;
@@ -298,11 +335,7 @@ export declare class AsyncJobManager {
298
335
  * teardown.
299
336
  */
300
337
  registerOwnerCleanup(ownerId: string, cleanup: () => void): () => void;
301
- /**
302
- * Run and clear every registered cleanup for the given filter. Idempotent
303
- * and error-isolated: a throwing cleanup does not prevent siblings from
304
- * running and never escalates to the caller.
305
- */
338
+ /** Run producer cleanups, then perform the legacy destructive subagent purge. */
306
339
  runOwnerCleanups(filter?: AsyncJobFilter): void;
307
340
  getDeliveryState(filter?: AsyncJobFilter): AsyncJobDeliveryState;
308
341
  hasPendingDeliveries(filter?: AsyncJobFilter): boolean;
@@ -315,6 +348,12 @@ export declare class AsyncJobManager {
315
348
  * (used by `dispose()` to nuke the manager's state).
316
349
  */
317
350
  cancelAll(filter?: AsyncJobFilter): void;
351
+ waitForOwnerInFlightDeliveries(ownerId: string, options?: {
352
+ timeoutMs?: number;
353
+ }): Promise<boolean>;
354
+ cancelAndSettleOwnerJobs(ownerId: string, options?: {
355
+ timeoutMs?: number;
356
+ }): Promise<boolean>;
318
357
  getLastDisposeDiagnostics(): AsyncJobDisposeDiagnostics;
319
358
  waitForAll(): Promise<void>;
320
359
  drainDeliveries(options?: {
@@ -4,7 +4,7 @@
4
4
  * Handles `gjc config <command>` subcommands for managing settings.
5
5
  * Uses the settings schema as the source of truth for available settings.
6
6
  */
7
- export type ConfigAction = "list" | "get" | "set" | "reset" | "path" | "init-xdg";
7
+ export type ConfigAction = "list" | "get" | "set" | "reset" | "path" | "doctor" | "init-xdg";
8
8
  export interface ConfigCommandArgs {
9
9
  action: ConfigAction;
10
10
  key?: string;
@@ -20,4 +20,14 @@ export interface ConfigCommandArgs {
20
20
  */
21
21
  export declare function parseConfigArgs(args: string[]): ConfigCommandArgs | undefined;
22
22
  export declare function runConfigCommand(cmd: ConfigCommandArgs): Promise<void>;
23
+ type ConfigDoctorReport = {
24
+ unknownKeys: string[];
25
+ invalidValues: Array<{
26
+ path: string;
27
+ value: unknown;
28
+ }>;
29
+ legacyShapes: string[];
30
+ };
31
+ export declare function inspectConfigFile(configPath: string): Promise<ConfigDoctorReport>;
23
32
  export declare function printConfigHelp(): void;
33
+ export {};
@@ -37,6 +37,7 @@ export interface NotifyCommandDeps {
37
37
  tokenPrompt?: () => Promise<string>;
38
38
  setExitCode?: (code: number) => void;
39
39
  exitProcess?: (code: number) => void;
40
+ valuePrompt?: (label: string, masked: boolean) => Promise<string>;
40
41
  /** Optional daemon ownership facts collected by an embedding host. */
41
42
  setupPreflight?: TelegramSetupPreflight;
42
43
  /** Injectable timers and cancellation for setup pairing. */
@@ -1,4 +1,5 @@
1
1
  import { type SessionSelectionResult } from "../modes/components/session-selector";
2
2
  import { type SessionInfo } from "../session/session-manager";
3
+ export declare function deleteSessionPickerCandidate(sessionPath: string, explicitSessionDir?: string): Promise<void>;
3
4
  /** Show the read-only TUI session picker and return the user's consent intent. */
4
- export declare function selectSession(sessions: SessionInfo[]): Promise<SessionSelectionResult>;
5
+ export declare function selectSession(sessions: SessionInfo[], explicitSessionDir?: string): Promise<SessionSelectionResult>;
@@ -58,7 +58,7 @@ export declare function runSetupCommand(cmd: SetupCommandArgs): Promise<void>;
58
58
  */
59
59
  export interface CredentialsSetupDependencies {
60
60
  openStore?: typeof SqliteAuthCredentialStore.open;
61
- createAuthStorage?: (store: Awaited<ReturnType<typeof SqliteAuthCredentialStore.open>>) => AuthStorage;
61
+ createAuthStorage?: (store: SqliteAuthCredentialStore) => AuthStorage;
62
62
  discover?: Parameters<typeof runExternalCredentialAutoImport>[0]["discover"];
63
63
  }
64
64
  export declare function handleCredentialsSetup(flags: {
@@ -1,4 +1,37 @@
1
1
  import { Command } from "@gajae-code/utils/cli";
2
+ import { COORDINATOR_MCP_PROTOCOL_VERSION, COORDINATOR_MCP_SERVER_NAME } from "../coordinator/contract";
3
+ import { type BrokerDiscovery } from "../sdk/broker/discovery";
4
+ export type CoordinatorBrokerDiscoveryStatus = "ready" | "unavailable" | "error";
5
+ export type CoordinatorBrokerDiscoveryReason = null | "absent_or_invalid" | "unsupported_state_version" | "discovery_access_denied" | "discovery_read_failed";
6
+ export interface CoordinatorBrokerObservation {
7
+ discovery_status: CoordinatorBrokerDiscoveryStatus;
8
+ reason: CoordinatorBrokerDiscoveryReason;
9
+ }
10
+ export interface CoordinatorCheckProbe {
11
+ agentDir?: string;
12
+ readBrokerDiscovery?: (agentDir: string) => Promise<BrokerDiscovery | null>;
13
+ }
14
+ export interface CoordinatorCheckPayload {
15
+ ok: true;
16
+ server: {
17
+ name: typeof COORDINATOR_MCP_SERVER_NAME;
18
+ protocolVersion: typeof COORDINATOR_MCP_PROTOCOL_VERSION;
19
+ };
20
+ readOnly: true;
21
+ tools: readonly string[];
22
+ catalog: {
23
+ ready: true;
24
+ reason: null;
25
+ };
26
+ broker: CoordinatorBrokerObservation & {
27
+ operational_ready: null;
28
+ bootstrap_supported: true;
29
+ bootstrap_attempted: false;
30
+ };
31
+ }
32
+ export declare function probeCoordinatorBrokerCheck(probe?: CoordinatorCheckProbe): Promise<CoordinatorBrokerObservation>;
33
+ export declare function formatCoordinatorCheckPayload(observation: CoordinatorBrokerObservation): CoordinatorCheckPayload;
34
+ export declare function buildCoordinatorCheckPayload(probe?: CoordinatorCheckProbe): Promise<CoordinatorCheckPayload>;
2
35
  export declare function validateMcpServeSubcommandForTest(server: string | undefined): void;
3
36
  export default class McpServe extends Command {
4
37
  static description: string;
@@ -4,6 +4,7 @@
4
4
  import { Command } from "@gajae-code/utils/cli";
5
5
  import { type MCPAction } from "../cli/mcp-cli";
6
6
  export default class MCP extends Command {
7
+ #private;
7
8
  static description: string;
8
9
  static delegateHelp: boolean;
9
10
  static examples: string[];
@@ -66,5 +67,4 @@ export default class MCP extends Command {
66
67
  };
67
68
  };
68
69
  run(): Promise<void>;
69
- private printHelp;
70
70
  }
@@ -2,14 +2,12 @@
2
2
  * Configure Telegram, Discord, or Slack notifications.
3
3
  */
4
4
  import { Command } from "@gajae-code/utils/cli";
5
- import { type NotifyAction } from "../cli/notify-cli";
6
5
  export default class Notify extends Command {
7
6
  static description: string;
8
7
  static args: {
9
8
  action: import("@gajae-code/utils/cli").ArgDescriptor & {
10
9
  description: string;
11
10
  required: false;
12
- options: NotifyAction[];
13
11
  };
14
12
  extra: import("@gajae-code/utils/cli").ArgDescriptor & {
15
13
  description: string;
@@ -2,7 +2,7 @@ import { Command } from "@gajae-code/utils/cli";
2
2
  import type { Args as ParsedArgs } from "../cli/args";
3
3
  import { type SessionLifecycleLaunchRequest } from "../sdk/broker/lifecycle";
4
4
  import { SessionManager } from "../session/session-manager";
5
- export declare function lifecycleArgs(request: SessionLifecycleLaunchRequest, cwd: string, agentDir: string): ParsedArgs;
5
+ export declare function lifecycleArgs(request: SessionLifecycleLaunchRequest, cwd: string, agentDir: string): Promise<ParsedArgs>;
6
6
  /** Opens lifecycle-authorized history without letting replacement content reach readiness. */
7
7
  export declare function openLifecycleSessionManager(request: SessionLifecycleLaunchRequest, cwd: string, agentDir: string): Promise<{
8
8
  parsed: ParsedArgs;
@@ -1,13 +1,27 @@
1
+ export interface AtomicYamlExpectedPrecondition {
2
+ path: string;
3
+ hash: string;
4
+ }
1
5
  export interface AtomicYamlSetPatch {
2
6
  path: string;
3
7
  op: "set";
4
8
  value: unknown;
9
+ expected?: AtomicYamlExpectedPrecondition;
5
10
  }
6
11
  export interface AtomicYamlUnsetPatch {
7
12
  path: string;
8
13
  op: "unset";
14
+ expected?: AtomicYamlExpectedPrecondition;
9
15
  }
10
16
  export type AtomicYamlPatch = AtomicYamlSetPatch | AtomicYamlUnsetPatch;
17
+ /** Raised when a compare-and-swap precondition no longer matches durable YAML. */
18
+ export declare class AtomicYamlConflictError extends Error {
19
+ readonly path: string;
20
+ readonly expectedHash: string;
21
+ readonly actualHash: string;
22
+ readonly code = "ATOMIC_YAML_CONFLICT";
23
+ constructor(path: string, expectedHash: string, actualHash: string);
24
+ }
11
25
  export interface AtomicYamlPatchRevision {
12
26
  path: string;
13
27
  beforeHash: string;
@@ -45,6 +59,8 @@ export interface AtomicYamlPatchOptions {
45
59
  sleep?: (ms: number) => Promise<void>;
46
60
  /** Test seam for Windows rename retry behavior. */
47
61
  platform?: NodeJS.Platform;
62
+ /** Called under the config lock before patches are applied. */
63
+ validateRoot?: (root: unknown, patches: readonly AtomicYamlPatch[]) => void | Promise<void>;
48
64
  /** Called under the config lock after a successful CAS restore. */
49
65
  onRestored?: (patches: readonly AtomicYamlPatch[]) => void | Promise<void>;
50
66
  }
@@ -60,6 +76,8 @@ export declare class AtomicYamlReplaceError extends Error {
60
76
  export declare function setByPath(value: Record<string, unknown>, segments: readonly string[], nextValue: unknown): void;
61
77
  /** Delete a dotted YAML path without disturbing sibling keys or parent objects. */
62
78
  export declare function deleteByPath(value: Record<string, unknown>, segments: readonly string[]): void;
79
+ /** Hash a dotted YAML path state for an expected-hash patch precondition. */
80
+ export declare function atomicYamlPathHash(value: Record<string, unknown>, path: string): string;
63
81
  /** Build patches from current durable YAML while holding the shared queue and file lock. */
64
82
  export declare function applyAtomicYamlPatchesWithCurrent(configPath: string, buildPatches: (current: Readonly<Record<string, unknown>>) => Promise<readonly AtomicYamlPatch[]> | readonly AtomicYamlPatch[], options?: AtomicYamlPatchOptions): Promise<CasReceipt>;
65
83
  /**
@@ -3,14 +3,18 @@ export interface FileLockOptions {
3
3
  retries?: number;
4
4
  retryDelayMs?: number;
5
5
  }
6
+ /**
7
+ * Returns the OS-provided process start timestamp for PID-reuse detection.
8
+ * `ps` is available on the supported Unix hosts (macOS and Linux), unlike
9
+ * Linux's `/proc/<pid>/stat` pseudo-file.
10
+ */
11
+ export declare function processStartTime(pid: number): string | null;
6
12
  /** @internal */
7
- export declare function readFileLockInfoForGc(lockDir: string): Promise<{
8
- pid: number;
9
- timestamp: number;
10
- } | null>;
13
+ export declare function readFileLockInfoForGc(lockDir: string): Promise<FileLockOwnerToken | null>;
11
14
  /** Owner identity stamped into a `<file>.lock/info` record. */
12
15
  export interface FileLockOwnerToken {
13
16
  pid: number;
17
+ start_time?: string;
14
18
  timestamp: number;
15
19
  }
16
20
  /** Outcome of a guarded lock-dir removal attempt (`removeFileLockDirForGc`). */
@@ -33,4 +37,10 @@ export type FileLockGcRemoval = "removed" | "owner_changed" | "missing";
33
37
  * but the reclaim-after-stale scenario the issue describes is now guarded.
34
38
  */
35
39
  export declare function removeFileLockDirForGc(lockDir: string, expected: FileLockOwnerToken): Promise<FileLockGcRemoval>;
40
+ /**
41
+ * Serializes all contenders, including callers in the same process. Because this
42
+ * API exposes no ownership token, recursive acquisition is indistinguishable
43
+ * from independent async contention; code that already holds the lock must pass
44
+ * that fact through its own `lockHeld` path instead of acquiring it again.
45
+ */
36
46
  export declare function withFileLock<T>(filePath: string, fn: () => Promise<T>, options?: FileLockOptions): Promise<T>;
@@ -29,6 +29,7 @@ interface AppKeybindings {
29
29
  "app.session.fork": true;
30
30
  "app.session.resume": true;
31
31
  "app.session.observe": true;
32
+ "app.session.dashboard": true;
32
33
  "app.jobs.open": true;
33
34
  "app.session.togglePath": true;
34
35
  "app.session.toggleSort": true;
@@ -41,6 +42,13 @@ interface AppKeybindings {
41
42
  "app.history.search": true;
42
43
  "app.stt.toggle": true;
43
44
  "app.irc.sidebar.toggle": true;
45
+ "app.transcript.browse": true;
46
+ "app.transcript.prevTurn": true;
47
+ "app.transcript.nextTurn": true;
48
+ "app.mode.cycle": true;
49
+ "app.tasks.toggle": true;
50
+ "app.queue.togglePane": true;
51
+ "app.message.sendNow": true;
44
52
  }
45
53
  export type AppKeybinding = keyof AppKeybindings;
46
54
  declare module "@gajae-code/tui" {
@@ -48,6 +56,7 @@ declare module "@gajae-code/tui" {
48
56
  }
49
57
  }
50
58
  export declare function defaultMessageQueueKeysForPlatform(platform?: NodeJS.Platform): KeyId;
59
+ export declare function defaultClipboardPasteImageKeysForPlatform(platform?: NodeJS.Platform): KeyId;
51
60
  /**
52
61
  * All keybindings definitions: TUI + app-specific.
53
62
  */
@@ -249,7 +258,7 @@ export declare const KEYBINDINGS: {
249
258
  readonly description: "Select queued message to edit";
250
259
  };
251
260
  readonly "app.clipboard.pasteImage": {
252
- readonly defaultKeys: "alt+v" | "ctrl+v";
261
+ readonly defaultKeys: KeyId;
253
262
  readonly description: "Paste image from clipboard";
254
263
  };
255
264
  readonly "app.clipboard.copyLine": {
@@ -280,6 +289,10 @@ export declare const KEYBINDINGS: {
280
289
  readonly defaultKeys: "ctrl+s";
281
290
  readonly description: "Observe subagent sessions";
282
291
  };
292
+ readonly "app.session.dashboard": {
293
+ readonly defaultKeys: [];
294
+ readonly description: "Show all persisted sessions dashboard";
295
+ };
283
296
  readonly "app.jobs.open": {
284
297
  readonly defaultKeys: "alt+j";
285
298
  readonly description: "Open monitor/cron jobs overlay";
@@ -328,6 +341,34 @@ export declare const KEYBINDINGS: {
328
341
  readonly defaultKeys: "alt+i";
329
342
  readonly description: "Toggle IRC sidebar";
330
343
  };
344
+ readonly "app.transcript.browse": {
345
+ readonly defaultKeys: [];
346
+ readonly description: "Browse the transcript";
347
+ };
348
+ readonly "app.transcript.prevTurn": {
349
+ readonly defaultKeys: [];
350
+ readonly description: "Jump to previous user turn";
351
+ };
352
+ readonly "app.transcript.nextTurn": {
353
+ readonly defaultKeys: [];
354
+ readonly description: "Jump to next user turn";
355
+ };
356
+ readonly "app.mode.cycle": {
357
+ readonly defaultKeys: [];
358
+ readonly description: "Cycle interaction mode";
359
+ };
360
+ readonly "app.tasks.toggle": {
361
+ readonly defaultKeys: "alt+t";
362
+ readonly description: "Toggle tasks pane";
363
+ };
364
+ readonly "app.queue.togglePane": {
365
+ readonly defaultKeys: [];
366
+ readonly description: "Toggle message queue pane";
367
+ };
368
+ readonly "app.message.sendNow": {
369
+ readonly defaultKeys: [];
370
+ readonly description: "Send message immediately";
371
+ };
331
372
  };
332
373
  declare function migrateKeybindingsConfigFile(agentDir: string): void;
333
374
  /**
@@ -0,0 +1,3 @@
1
+ export declare const kNoAuth = "N/A";
2
+ export declare function isAuthenticated(apiKey: string | undefined | null): apiKey is string;
3
+ export declare function isAuthenticatedOrKeyless(apiKey: string | undefined | null): boolean;
@@ -0,0 +1,13 @@
1
+ import { type ModelSelectorValue } from "./model-selector-value";
2
+ import type { Settings } from "./settings";
3
+ export interface ConfiguredModelBindings {
4
+ modelRoles?: Record<string, ModelSelectorValue>;
5
+ agentModelOverrides?: Record<string, ModelSelectorValue>;
6
+ }
7
+ /** Synchronizes config-owned model bindings while preserving user edits. */
8
+ export declare class ModelBindingsApplier {
9
+ #private;
10
+ setBindings(bindings: ConfiguredModelBindings | undefined): void;
11
+ applyTo(targetSettings: Settings): void;
12
+ apply(): void;
13
+ }
@@ -0,0 +1,49 @@
1
+ import { type Api, type Model, type ModelRefreshStrategy } from "@gajae-code/ai";
2
+ export interface DiscoveryProvider {
3
+ provider: string;
4
+ optional?: boolean;
5
+ }
6
+ export type ProviderDiscoveryStatus = "idle" | "ok" | "empty" | "cached" | "unavailable" | "unauthenticated";
7
+ export interface ProviderDiscoveryState {
8
+ provider: string;
9
+ status: ProviderDiscoveryStatus;
10
+ optional: boolean;
11
+ stale: boolean;
12
+ fetchedAt?: number;
13
+ models: string[];
14
+ error?: string;
15
+ }
16
+ export interface DiscoveryRefreshToken {
17
+ provider: string;
18
+ generation: number;
19
+ }
20
+ /** A generation-guarded, immutable result for the registry to merge into its catalog. */
21
+ export interface DiscoveryMergeInput {
22
+ provider: string;
23
+ token: DiscoveryRefreshToken;
24
+ current: boolean;
25
+ models: readonly Model<Api>[];
26
+ state: ProviderDiscoveryState;
27
+ warning?: string;
28
+ }
29
+ export interface ProviderDiscoveryCallbacks<TProvider extends DiscoveryProvider> {
30
+ cacheDbPath?: string;
31
+ requiresAuth: (provider: TProvider) => boolean;
32
+ peekApiKey: (provider: TProvider) => Promise<string | undefined>;
33
+ isAuthenticated: (apiKey: string | undefined) => boolean;
34
+ fetchModels: (provider: TProvider) => Promise<Model<Api>[]>;
35
+ }
36
+ /** Owns configured discovery inputs, status, cache lifecycle, and refresh generations. */
37
+ export declare class ModelDiscoveryManager<TProvider extends DiscoveryProvider> {
38
+ #private;
39
+ reset(): void;
40
+ setProviders(providers: readonly TProvider[]): void;
41
+ addProvider(provider: TProvider): void;
42
+ get providers(): readonly TProvider[];
43
+ providerIds(): Set<string>;
44
+ getState(provider: string): ProviderDiscoveryState | undefined;
45
+ loadCached(provider: TProvider, cacheDbPath?: string): readonly Model<Api>[];
46
+ beginRefresh(provider: string): DiscoveryRefreshToken;
47
+ isCurrent(token: DiscoveryRefreshToken): boolean;
48
+ discover(provider: TProvider, strategy: ModelRefreshStrategy, callbacks: ProviderDiscoveryCallbacks<TProvider>): Promise<DiscoveryMergeInput>;
49
+ }
@@ -21,4 +21,24 @@ export interface CanonicalModelIndex {
21
21
  bySelector: Map<string, string>;
22
22
  }
23
23
  export declare function formatCanonicalVariantSelector(model: Model<Api>): string;
24
+ /**
25
+ * Compare equivalent provider variants using the caller's ranking policy.
26
+ *
27
+ * The ordered criteria intentionally mirror the historical canonical resolver:
28
+ * vision support, configured provider rank, canonical exactness, canonical
29
+ * source, input plus cache-read cost, and original catalog order. Callers that
30
+ * do not have a canonical index can omit those axes while retaining a stable,
31
+ * total comparison.
32
+ */
33
+ export declare function compareEquivalentModelVariants(left: Model<Api>, right: Model<Api>, options?: {
34
+ providerRank?: ReadonlyMap<string, number>;
35
+ canonicalId?: string;
36
+ leftSourceRank?: number;
37
+ rightSourceRank?: number;
38
+ modelOrder?: ReadonlyMap<string, number>;
39
+ includeCost?: boolean;
40
+ finalize?: boolean;
41
+ }): number;
42
+ /** @deprecated Use compareEquivalentModelVariants for total variant ranking. */
43
+ export declare function compareModelVariantRank(left: Model<Api>, right: Model<Api>): number;
24
44
  export declare function buildCanonicalModelIndex(models: readonly Model<Api>[], equivalence?: ModelEquivalenceConfig): CanonicalModelIndex;