@gajae-code/coding-agent 0.17.2 → 0.17.4

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 (349) hide show
  1. package/CHANGELOG.md +194 -0
  2. package/dist/types/cli/daemon-cli.d.ts +3 -1
  3. package/dist/types/cli/github-release.d.ts +17 -0
  4. package/dist/types/cli/public-command-entry.d.ts +56 -0
  5. package/dist/types/cli/public-command-errors.d.ts +126 -0
  6. package/dist/types/cli/public-command-evidence.d.ts +99 -0
  7. package/dist/types/cli/public-command-help.d.ts +65 -0
  8. package/dist/types/cli/public-command-registry.d.ts +69 -0
  9. package/dist/types/cli/session-picker.d.ts +1 -1
  10. package/dist/types/cli/setup-cli.d.ts +1 -0
  11. package/dist/types/cli/skills-cli.d.ts +5 -0
  12. package/dist/types/cli.d.ts +3 -0
  13. package/dist/types/commands/daemon.d.ts +4 -50
  14. package/dist/types/commands/sdk.d.ts +20 -37
  15. package/dist/types/commands/setup.d.ts +3 -0
  16. package/dist/types/commands/skills.d.ts +9 -0
  17. package/dist/types/config/autorouting-tier-map.d.ts +18 -0
  18. package/dist/types/config/file-lock.d.ts +9 -1
  19. package/dist/types/config/model-profile-activation.d.ts +45 -1
  20. package/dist/types/config/model-registry.d.ts +11 -2
  21. package/dist/types/config/settings-schema.d.ts +11 -0
  22. package/dist/types/coordinator-mcp/question-state.d.ts +6 -1
  23. package/dist/types/daemon/operator-contract.d.ts +5 -1
  24. package/dist/types/eval/js/worker-protocol.d.ts +2 -0
  25. package/dist/types/extensibility/extensions/types.d.ts +12 -0
  26. package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
  27. package/dist/types/extensibility/runtime-skill-discovery.d.ts +18 -0
  28. package/dist/types/extensibility/shared-events.d.ts +3 -1
  29. package/dist/types/gjc-runtime/session-state-lock.d.ts +61 -0
  30. package/dist/types/internal-urls/embedded-protocol.d.ts +9 -0
  31. package/dist/types/internal-urls/index.d.ts +1 -0
  32. package/dist/types/internal-urls/parse.d.ts +9 -1
  33. package/dist/types/main.d.ts +22 -0
  34. package/dist/types/modes/acp/acp-agent.d.ts +55 -1
  35. package/dist/types/modes/acp/startup-provenance.d.ts +16 -0
  36. package/dist/types/modes/components/custom-provider-wizard.d.ts +19 -1
  37. package/dist/types/modes/components/session-selector.d.ts +5 -2
  38. package/dist/types/modes/components/user-message-selector.d.ts +5 -2
  39. package/dist/types/modes/controllers/command-controller.d.ts +1 -1
  40. package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
  41. package/dist/types/modes/interactive-mode.d.ts +1 -1
  42. package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +11 -1
  43. package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +14 -1
  44. package/dist/types/modes/types.d.ts +2 -2
  45. package/dist/types/runtime/process-lifecycle.d.ts +2 -0
  46. package/dist/types/runtime-mcp/manager.d.ts +56 -0
  47. package/dist/types/runtime-mcp/pool.d.ts +17 -0
  48. package/dist/types/runtime-mcp/redaction.d.ts +20 -0
  49. package/dist/types/runtime-mcp/startup-policy.d.ts +6 -0
  50. package/dist/types/runtime-mcp/tool-bridge.d.ts +9 -0
  51. package/dist/types/runtime-mcp/transports/http.d.ts +11 -0
  52. package/dist/types/sdk/broker/broker.d.ts +13 -2
  53. package/dist/types/sdk/broker/identity.d.ts +3 -1
  54. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +23 -3
  55. package/dist/types/sdk/broker/lifecycle.d.ts +15 -8
  56. package/dist/types/sdk/broker/runtime.d.ts +1 -1
  57. package/dist/types/sdk/broker/session-index.d.ts +22 -3
  58. package/dist/types/sdk/broker/spawn-authority.d.ts +4 -0
  59. package/dist/types/sdk/broker/stderr-drainer.d.ts +13 -0
  60. package/dist/types/sdk/bus/index.d.ts +19 -0
  61. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
  62. package/dist/types/sdk/bus/telegram-daemon.d.ts +5 -0
  63. package/dist/types/sdk/cli/master-cli.d.ts +6 -10
  64. package/dist/types/sdk/cli/rows.d.ts +19 -1
  65. package/dist/types/sdk/cli/session-cli.d.ts +22 -5
  66. package/dist/types/sdk/client/client.d.ts +2 -0
  67. package/dist/types/sdk/guides/cli.d.ts +3 -4
  68. package/dist/types/sdk/guides/verify.d.ts +2 -0
  69. package/dist/types/sdk/host/host.d.ts +9 -0
  70. package/dist/types/sdk/host/session-runtime.d.ts +31 -0
  71. package/dist/types/sdk/host/types.d.ts +10 -0
  72. package/dist/types/sdk/index.d.ts +1 -0
  73. package/dist/types/sdk/prompt-deadline-flush.d.ts +83 -0
  74. package/dist/types/sdk/prompt-deadline-manager.d.ts +37 -0
  75. package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -0
  76. package/dist/types/sdk/router/session-router.d.ts +2 -0
  77. package/dist/types/sdk/startup-capability.d.ts +2 -0
  78. package/dist/types/sdk/transport/relay.d.ts +1 -0
  79. package/dist/types/sdk/transport/serve-cli.d.ts +48 -4
  80. package/dist/types/sdk/transport/stdio.d.ts +5 -1
  81. package/dist/types/session/agent-session.d.ts +168 -21
  82. package/dist/types/session/fallback-chain-controller.d.ts +6 -6
  83. package/dist/types/session/fold-coordinator.d.ts +17 -3
  84. package/dist/types/session/internal/managed-session-storage.d.ts +7 -1
  85. package/dist/types/session/session-manager.d.ts +64 -1
  86. package/dist/types/session/session-work-lease.d.ts +14 -0
  87. package/dist/types/setup/model-onboarding-guidance.d.ts +1 -1
  88. package/dist/types/setup/provider-onboarding.d.ts +81 -1
  89. package/dist/types/tools/bash.d.ts +37 -11
  90. package/dist/types/tools/job.d.ts +1 -1
  91. package/dist/types/tools/steer-fold.d.ts +31 -0
  92. package/dist/types/utils/git.d.ts +28 -2
  93. package/dist/types/utils/mupdf-embedded.d.ts +2 -0
  94. package/dist/types/utils/mupdf.d.ts +4 -0
  95. package/dist/types/utils/session-title-generation.d.ts +6 -0
  96. package/dist/types/utils/title-generator.d.ts +11 -2
  97. package/dist/types/web/scrapers/types.d.ts +3 -0
  98. package/package.json +18 -10
  99. package/scripts/build-binary.ts +9 -3
  100. package/scripts/compile-args.ts +0 -9
  101. package/scripts/embed-mupdf.ts +52 -0
  102. package/scripts/generate-sdk-operation-inventory.ts +31 -1
  103. package/scripts/vendor-markit.ts +196 -0
  104. package/src/async/job-manager.ts +22 -1
  105. package/src/cli/daemon-cli.ts +53 -18
  106. package/src/cli/github-release.ts +87 -5
  107. package/src/cli/mcp-cli.ts +38 -4
  108. package/src/cli/public-command-entry.ts +450 -0
  109. package/src/cli/public-command-errors.ts +581 -0
  110. package/src/cli/public-command-evidence.ts +717 -0
  111. package/src/cli/public-command-help.ts +360 -0
  112. package/src/cli/public-command-registry.ts +535 -0
  113. package/src/cli/session-picker.ts +2 -1
  114. package/src/cli/setup-cli.ts +9 -1
  115. package/src/cli/skills-cli.ts +46 -2
  116. package/src/cli.ts +61 -1
  117. package/src/commands/daemon.ts +65 -69
  118. package/src/commands/sdk.ts +175 -117
  119. package/src/commands/setup.ts +2 -0
  120. package/src/commands/skills.ts +11 -0
  121. package/src/config/autorouting-tier-map.ts +14 -0
  122. package/src/config/file-lock.ts +147 -51
  123. package/src/config/model-profile-activation.ts +334 -43
  124. package/src/config/model-registry.ts +183 -25
  125. package/src/config/settings-schema.ts +26 -2
  126. package/src/coordinator-mcp/policy.ts +10 -5
  127. package/src/coordinator-mcp/question-gate-codec.ts +17 -0
  128. package/src/coordinator-mcp/question-state.ts +175 -8
  129. package/src/coordinator-mcp/server.ts +507 -81
  130. package/src/coordinator-mcp/session-reaper.ts +6 -4
  131. package/src/crash/record-loader.ts +6 -2
  132. package/src/daemon/operator-contract.ts +26 -12
  133. package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
  134. package/src/eval/js/context-manager.ts +8 -8
  135. package/src/eval/js/worker-core.ts +9 -4
  136. package/src/eval/js/worker-protocol.ts +2 -0
  137. package/src/extensibility/extensions/runner.ts +52 -4
  138. package/src/extensibility/extensions/types.ts +10 -0
  139. package/src/extensibility/gjc-plugins/registry.ts +196 -37
  140. package/src/extensibility/runtime-skill-discovery.ts +61 -3
  141. package/src/extensibility/shared-events.ts +3 -1
  142. package/src/gjc-runtime/session-state-lock.ts +165 -24
  143. package/src/gjc-runtime/ultragoal-succession.ts +31 -3
  144. package/src/internal-urls/docs-index.generated.ts +20 -19
  145. package/src/internal-urls/embedded-protocol.ts +83 -0
  146. package/src/internal-urls/index.ts +1 -0
  147. package/src/internal-urls/parse.ts +21 -1
  148. package/src/internal-urls/router.ts +4 -2
  149. package/src/main.ts +123 -55
  150. package/src/modes/acp/acp-agent.ts +408 -35
  151. package/src/modes/acp/startup-provenance.ts +59 -0
  152. package/src/modes/components/custom-provider-wizard.ts +308 -7
  153. package/src/modes/components/oauth-selector.ts +9 -0
  154. package/src/modes/components/session-selector.ts +47 -4
  155. package/src/modes/components/user-message-selector.ts +57 -15
  156. package/src/modes/controllers/command-controller.ts +58 -32
  157. package/src/modes/controllers/extension-ui-controller.ts +33 -7
  158. package/src/modes/controllers/input-controller.ts +4 -0
  159. package/src/modes/controllers/selector-controller.ts +161 -15
  160. package/src/modes/interactive-mode.ts +21 -7
  161. package/src/modes/runtime-init.ts +1 -0
  162. package/src/modes/shared/agent-wire/workflow-gate-broker.ts +124 -7
  163. package/src/modes/shared/agent-wire/workflow-gate-types.ts +16 -2
  164. package/src/modes/types.ts +2 -2
  165. package/src/prompts/agent-fragments/browser-aside.md +1 -0
  166. package/src/prompts/system/title-system.md +1 -1
  167. package/src/prompts/tools/bash.md +1 -1
  168. package/src/prompts/tools/job.md +1 -1
  169. package/src/prompts/tools/read.md +2 -0
  170. package/src/runtime/network-prewarm-service.test.ts +36 -1
  171. package/src/runtime/network-prewarm-service.ts +28 -3
  172. package/src/runtime/process-lifecycle.ts +22 -11
  173. package/src/runtime-mcp/config.ts +16 -1
  174. package/src/runtime-mcp/manager.ts +689 -55
  175. package/src/runtime-mcp/pool.test.ts +31 -0
  176. package/src/runtime-mcp/pool.ts +304 -28
  177. package/src/runtime-mcp/redaction.ts +42 -0
  178. package/src/runtime-mcp/startup-policy.ts +7 -0
  179. package/src/runtime-mcp/tool-bridge.ts +71 -0
  180. package/src/runtime-mcp/transports/http.ts +108 -25
  181. package/src/sdk/acp/adapter.ts +27 -8
  182. package/src/sdk/broker/broker.ts +378 -52
  183. package/src/sdk/broker/identity.ts +9 -1
  184. package/src/sdk/broker/lifecycle-ledger.ts +95 -31
  185. package/src/sdk/broker/lifecycle.ts +690 -141
  186. package/src/sdk/broker/runtime.ts +1 -1
  187. package/src/sdk/broker/session-index.ts +97 -4
  188. package/src/sdk/broker/spawn-authority.ts +35 -7
  189. package/src/sdk/broker/stderr-drainer.ts +59 -0
  190. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  191. package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
  192. package/src/sdk/bus/index.ts +690 -80
  193. package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
  194. package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
  195. package/src/sdk/bus/telegram-daemon.ts +10 -3
  196. package/src/sdk/cli/master-cli.ts +47 -36
  197. package/src/sdk/cli/rows.ts +30 -7
  198. package/src/sdk/cli/session-cli.ts +687 -184
  199. package/src/sdk/client/client.ts +18 -0
  200. package/src/sdk/guides/catalog.ts +2 -2
  201. package/src/sdk/guides/cli.ts +20 -62
  202. package/src/sdk/guides/verify.ts +14 -0
  203. package/src/sdk/host/host.ts +49 -5
  204. package/src/sdk/host/session-runtime.test.ts +138 -2
  205. package/src/sdk/host/session-runtime.ts +311 -97
  206. package/src/sdk/host/types.ts +12 -1
  207. package/src/sdk/host/websocket-transport.lifecycle.test.ts +84 -0
  208. package/src/sdk/host/websocket-transport.ts +40 -6
  209. package/src/sdk/index.ts +11 -0
  210. package/src/sdk/prompt-deadline-flush.ts +334 -0
  211. package/src/sdk/prompt-deadline-manager.ts +133 -1
  212. package/src/sdk/prompt-tool-boundary.ts +121 -0
  213. package/src/sdk/protocol/operation-inventory.generated.json +106 -0
  214. package/src/sdk/router/session-router.ts +9 -1
  215. package/src/sdk/session.ts +182 -7
  216. package/src/sdk/startup-capability.ts +1 -1
  217. package/src/sdk/transport/relay.ts +71 -6
  218. package/src/sdk/transport/serve-cli.ts +397 -42
  219. package/src/sdk/transport/socket.ts +12 -11
  220. package/src/sdk/transport/stdio.ts +7 -3
  221. package/src/session/agent-session.ts +2437 -400
  222. package/src/session/fallback-chain-controller.ts +6 -7
  223. package/src/session/fold-coordinator.ts +24 -5
  224. package/src/session/internal/managed-session-scope.ts +58 -18
  225. package/src/session/internal/managed-session-storage.ts +304 -11
  226. package/src/session/session-manager.ts +382 -44
  227. package/src/session/session-work-lease.ts +34 -0
  228. package/src/setup/model-onboarding-guidance.ts +1 -1
  229. package/src/setup/provider-onboarding.ts +397 -24
  230. package/src/slash-commands/builtin-registry.ts +258 -14
  231. package/src/task/index.ts +14 -2
  232. package/src/tools/bash.ts +98 -78
  233. package/src/tools/fetch.ts +119 -20
  234. package/src/tools/job.ts +151 -25
  235. package/src/tools/output-meta.ts +15 -2
  236. package/src/tools/path-utils.ts +27 -3
  237. package/src/tools/read.ts +3 -3
  238. package/src/tools/steer-fold.ts +107 -0
  239. package/src/tools/tool-catalog.generated.ts +29 -2
  240. package/src/tools/tool-errors.ts +4 -0
  241. package/src/utils/git.ts +53 -3
  242. package/src/utils/markit.ts +55 -41
  243. package/src/utils/mupdf-assets.d.ts +4 -0
  244. package/src/utils/mupdf-embedded.ts +4 -0
  245. package/src/utils/mupdf.ts +129 -0
  246. package/src/utils/session-title-generation.ts +29 -0
  247. package/src/utils/title-generator.ts +46 -2
  248. package/src/web/scrapers/types.ts +24 -3
  249. package/vendor/markit-ai/LICENSE +21 -0
  250. package/vendor/markit-ai/MANIFEST.json +412 -0
  251. package/vendor/markit-ai/dist/commands/config.d.ts +4 -0
  252. package/vendor/markit-ai/dist/commands/config.js +139 -0
  253. package/vendor/markit-ai/dist/commands/convert.d.ts +6 -0
  254. package/vendor/markit-ai/dist/commands/convert.js +113 -0
  255. package/vendor/markit-ai/dist/commands/formats.d.ts +2 -0
  256. package/vendor/markit-ai/dist/commands/formats.js +92 -0
  257. package/vendor/markit-ai/dist/commands/init.d.ts +2 -0
  258. package/vendor/markit-ai/dist/commands/init.js +29 -0
  259. package/vendor/markit-ai/dist/commands/onboard.d.ts +2 -0
  260. package/vendor/markit-ai/dist/commands/onboard.js +61 -0
  261. package/vendor/markit-ai/dist/commands/plugin.d.ts +4 -0
  262. package/vendor/markit-ai/dist/commands/plugin.js +58 -0
  263. package/vendor/markit-ai/dist/config.d.ts +26 -0
  264. package/vendor/markit-ai/dist/config.js +42 -0
  265. package/vendor/markit-ai/dist/converters/audio.d.ts +7 -0
  266. package/vendor/markit-ai/dist/converters/audio.js +104 -0
  267. package/vendor/markit-ai/dist/converters/csv.d.ts +7 -0
  268. package/vendor/markit-ai/dist/converters/csv.js +83 -0
  269. package/vendor/markit-ai/dist/converters/docx.d.ts +6 -0
  270. package/vendor/markit-ai/dist/converters/docx.js +57 -0
  271. package/vendor/markit-ai/dist/converters/epub.d.ts +8 -0
  272. package/vendor/markit-ai/dist/converters/epub.js +128 -0
  273. package/vendor/markit-ai/dist/converters/github.d.ts +18 -0
  274. package/vendor/markit-ai/dist/converters/github.js +148 -0
  275. package/vendor/markit-ai/dist/converters/html.d.ts +6 -0
  276. package/vendor/markit-ai/dist/converters/html.js +30 -0
  277. package/vendor/markit-ai/dist/converters/image.d.ts +6 -0
  278. package/vendor/markit-ai/dist/converters/image.js +124 -0
  279. package/vendor/markit-ai/dist/converters/ipynb.d.ts +6 -0
  280. package/vendor/markit-ai/dist/converters/ipynb.js +75 -0
  281. package/vendor/markit-ai/dist/converters/iwork.d.ts +20 -0
  282. package/vendor/markit-ai/dist/converters/iwork.js +391 -0
  283. package/vendor/markit-ai/dist/converters/json.d.ts +6 -0
  284. package/vendor/markit-ai/dist/converters/json.js +21 -0
  285. package/vendor/markit-ai/dist/converters/pdf/columns.d.ts +35 -0
  286. package/vendor/markit-ai/dist/converters/pdf/columns.js +93 -0
  287. package/vendor/markit-ai/dist/converters/pdf/extract.d.ts +19 -0
  288. package/vendor/markit-ai/dist/converters/pdf/extract.js +514 -0
  289. package/vendor/markit-ai/dist/converters/pdf/grid.d.ts +25 -0
  290. package/vendor/markit-ai/dist/converters/pdf/grid.js +795 -0
  291. package/vendor/markit-ai/dist/converters/pdf/headers.d.ts +24 -0
  292. package/vendor/markit-ai/dist/converters/pdf/headers.js +108 -0
  293. package/vendor/markit-ai/dist/converters/pdf/index.d.ts +19 -0
  294. package/vendor/markit-ai/dist/converters/pdf/index.js +136 -0
  295. package/vendor/markit-ai/dist/converters/pdf/mupdf-loader.js +9 -0
  296. package/vendor/markit-ai/dist/converters/pdf/render.d.ts +24 -0
  297. package/vendor/markit-ai/dist/converters/pdf/render.js +513 -0
  298. package/vendor/markit-ai/dist/converters/pdf/types.d.ts +75 -0
  299. package/vendor/markit-ai/dist/converters/pdf/types.js +1 -0
  300. package/vendor/markit-ai/dist/converters/plain-text.d.ts +6 -0
  301. package/vendor/markit-ai/dist/converters/plain-text.js +87 -0
  302. package/vendor/markit-ai/dist/converters/pptx.d.ts +8 -0
  303. package/vendor/markit-ai/dist/converters/pptx.js +289 -0
  304. package/vendor/markit-ai/dist/converters/rss.d.ts +11 -0
  305. package/vendor/markit-ai/dist/converters/rss.js +138 -0
  306. package/vendor/markit-ai/dist/converters/wikipedia.d.ts +6 -0
  307. package/vendor/markit-ai/dist/converters/wikipedia.js +33 -0
  308. package/vendor/markit-ai/dist/converters/xlsx.d.ts +8 -0
  309. package/vendor/markit-ai/dist/converters/xlsx.js +147 -0
  310. package/vendor/markit-ai/dist/converters/xml.d.ts +6 -0
  311. package/vendor/markit-ai/dist/converters/xml.js +18 -0
  312. package/vendor/markit-ai/dist/converters/yaml.d.ts +6 -0
  313. package/vendor/markit-ai/dist/converters/yaml.js +17 -0
  314. package/vendor/markit-ai/dist/converters/zip.d.ts +8 -0
  315. package/vendor/markit-ai/dist/converters/zip.js +57 -0
  316. package/vendor/markit-ai/dist/index.d.ts +30 -0
  317. package/vendor/markit-ai/dist/index.js +26 -0
  318. package/vendor/markit-ai/dist/main.d.ts +2 -0
  319. package/vendor/markit-ai/dist/main.js +191 -0
  320. package/vendor/markit-ai/dist/markit.d.ts +45 -0
  321. package/vendor/markit-ai/dist/markit.js +267 -0
  322. package/vendor/markit-ai/dist/plugins/api.d.ts +7 -0
  323. package/vendor/markit-ai/dist/plugins/api.js +42 -0
  324. package/vendor/markit-ai/dist/plugins/index.d.ts +4 -0
  325. package/vendor/markit-ai/dist/plugins/index.js +3 -0
  326. package/vendor/markit-ai/dist/plugins/installer.d.ts +25 -0
  327. package/vendor/markit-ai/dist/plugins/installer.js +176 -0
  328. package/vendor/markit-ai/dist/plugins/loader.d.ts +6 -0
  329. package/vendor/markit-ai/dist/plugins/loader.js +61 -0
  330. package/vendor/markit-ai/dist/plugins/types.d.ts +25 -0
  331. package/vendor/markit-ai/dist/plugins/types.js +1 -0
  332. package/vendor/markit-ai/dist/providers/anthropic.d.ts +2 -0
  333. package/vendor/markit-ai/dist/providers/anthropic.js +47 -0
  334. package/vendor/markit-ai/dist/providers/index.d.ts +21 -0
  335. package/vendor/markit-ai/dist/providers/index.js +56 -0
  336. package/vendor/markit-ai/dist/providers/openai.d.ts +2 -0
  337. package/vendor/markit-ai/dist/providers/openai.js +76 -0
  338. package/vendor/markit-ai/dist/providers/types.d.ts +26 -0
  339. package/vendor/markit-ai/dist/providers/types.js +1 -0
  340. package/vendor/markit-ai/dist/types.d.ts +36 -0
  341. package/vendor/markit-ai/dist/types.js +1 -0
  342. package/vendor/markit-ai/dist/utils/exit-codes.d.ts +4 -0
  343. package/vendor/markit-ai/dist/utils/exit-codes.js +4 -0
  344. package/vendor/markit-ai/dist/utils/output.d.ts +22 -0
  345. package/vendor/markit-ai/dist/utils/output.js +31 -0
  346. package/vendor/markit-ai/dist/utils/turndown.d.ts +8 -0
  347. package/vendor/markit-ai/dist/utils/turndown.js +70 -0
  348. package/vendor/markit-ai/package.json +74 -0
  349. package/vendor/markit-ai.patch +49 -0
@@ -23,6 +23,16 @@ export interface RuntimeSkillDiscoveryResult {
23
23
  candidates: RuntimeSkillDiscoveryCandidate[];
24
24
  /** Deduped skill metadata the query filter ran against, including bundled entries; candidates.length <= scanned. */
25
25
  scanned: number;
26
+ /**
27
+ * Skills left after the query filter, before the page slice: the denominator
28
+ * a page is a page *of*. `scanned` counts everything the filter ran against,
29
+ * so it cannot serve this role.
30
+ */
31
+ matching: number;
32
+ /** Normalized zero-based offset the returned page starts at. */
33
+ offset: number;
34
+ /** Offset of the next page, present only while one exists; omitted on the final page. */
35
+ nextOffset?: number;
26
36
  diagnostics: RuntimeSkillDiscoveryDiagnostics;
27
37
  }
28
38
  export interface DiscoverRuntimeSkillsOptions {
@@ -33,9 +43,17 @@ export interface DiscoverRuntimeSkillsOptions {
33
43
  profileAuthority?: "default" | "custom";
34
44
  query?: string;
35
45
  limit?: number;
46
+ /** Zero-based index into the matching set the returned page starts at; defaults to 0. */
47
+ offset?: number;
36
48
  source?: RuntimeSkillDiscoveryScope | "all";
37
49
  policy?: SkillsSettings;
38
50
  }
51
+ /**
52
+ * Upper bound every caller's `limit` clamps to. Exported so `gjc skills discover`
53
+ * can default a human to the widest page the library will serve instead of the
54
+ * model-context-sized `DEFAULT_LIMIT`.
55
+ */
56
+ export declare const SKILL_DISCOVERY_MAX_LIMIT = 50;
39
57
  /**
40
58
  * Explain an empty result that is caused by disabled discovery config rather
41
59
  * than by an actually empty skill catalog. Uses the user-facing trust
@@ -81,9 +81,11 @@ export interface SessionCompactEvent {
81
81
  /** Whether the compaction entry was provided by an extension/hook */
82
82
  fromExtension: boolean;
83
83
  }
84
- /** Fired on process exit (SIGINT/SIGTERM) */
84
+ /** Fired during session teardown, including process exit and SDK host self-reap. */
85
85
  export interface SessionShutdownEvent {
86
86
  type: "session_shutdown";
87
+ /** Set only when the SDK host reaped itself after detached-idle grace. */
88
+ reason?: "detached_idle";
87
89
  }
88
90
  /** Preparation data for tree navigation (used by session_before_tree event) */
89
91
  export interface TreePreparation {
@@ -1,3 +1,4 @@
1
+ import { type LinuxProcPidProbeResult } from "./linux-proc";
1
2
  /**
2
3
  * How a `<file>.lock` owner record can be opened safely on this platform.
3
4
  *
@@ -43,6 +44,13 @@ export declare const SessionStateLockTestHooks: {
43
44
  * configuration.
44
45
  */
45
46
  probeProcessSignal?: (pid: number) => void;
47
+ /**
48
+ * @internal How an owner pid's `/proc` entry is read. Whether a killed pid is still an
49
+ * unreaped zombie depends on when its parent happens to reap it, so it cannot be
50
+ * arranged deterministically from a test. Production code never sets it, and it is
51
+ * never serialized or exposed as runtime configuration.
52
+ */
53
+ probeLinuxProcPid?: (pid: number) => LinuxProcPidProbeResult;
46
54
  /**
47
55
  * @internal Runs inside a NEW owner record's write, after the exclusive create has
48
56
  * taken the pathname and before the record's bytes land. Throwing from it fails that
@@ -90,6 +98,32 @@ export declare const SessionStateLockTestHooks: {
90
98
  };
91
99
  /** Raised when the lock could not be acquired; callers map it to their own refusal. */
92
100
  export type SessionStateLockUnavailableReason = "acquire_timeout" | "legacy_directory_owner_unprovenanced" | "lock_initialization_failed" | "lock_inspection_failed" | "lock_owner_live_or_unverifiable" | "lock_owner_record_fresh" | "lock_owner_record_unprovenanced" | "lock_release_failed" | "transition_claim_timeout" | "unsafe_lock_path_type";
101
+ /**
102
+ * Why a stale-transition reclaim refused, as a bounded classifier.
103
+ *
104
+ * `transition_claim_timeout` collapsed several structurally different refusals into
105
+ * one message, so an operator could not tell a foreign-host tombstone from a
106
+ * live owner from a directory an external process was stamping — the gap #5606
107
+ * asked for. Every member is a fixed enum: never a path, token, host id, pid or
108
+ * raw errno, because this rides on an error message users paste into reports.
109
+ */
110
+ export type TransitionReclaimRefusal =
111
+ /** The claim vanished, or its owner sidecar was absent/unparseable/invalid. */
112
+ "claim_or_owner_unreadable"
113
+ /** A released tombstone carrying no `owner_host_id` at all. */
114
+ | "released_owner_unprovenanced"
115
+ /** A released tombstone belonging to a different installation. */
116
+ | "released_owner_foreign_host"
117
+ /** A released tombstone still inside `RELEASED_TRANSITION_GRACE_MS`. */
118
+ | "released_owner_within_grace"
119
+ /** The owner is alive, or its liveness could not be disproven. */
120
+ | "owner_live_or_unverifiable"
121
+ /** The claim changed between inspection and capture — an external writer. */
122
+ | "claim_generation_changed"
123
+ /** The claim was not empty when captured, so it is not ours to remove. */
124
+ | "claim_not_empty"
125
+ /** The claim's canonical path or directory snapshot could not be taken. */
126
+ | "claim_capture_failed";
93
127
  interface SessionStateLockUnavailableDetails {
94
128
  lockPath: string;
95
129
  reason: SessionStateLockUnavailableReason;
@@ -170,6 +204,33 @@ export declare function setSessionStateLockNativeBindings(load: SessionStateLock
170
204
  * and deletion has a different inode identity and is refused by construction.
171
205
  */
172
206
  export declare function removeVerifiedEmptyQuarantine(directory: string, name: string): Promise<void>;
207
+ /**
208
+ * Outcome of one stale-transition reclaim attempt. `reclaimed` drives the
209
+ * caller's retry accounting exactly as the previous boolean did; `refusal`
210
+ * exists only so the eventual `transition_claim_timeout` can name which
211
+ * precondition said no (#5606).
212
+ */
213
+ interface TransitionReclaimOutcome {
214
+ reclaimed: boolean;
215
+ reclaimReason?: "released_handoff" | "dead_owner";
216
+ refusal?: TransitionReclaimRefusal;
217
+ }
218
+ /**
219
+ * Classify one stale-transition reclaim attempt.
220
+ *
221
+ * @internal exported as the seam the refusal classifier is tested through. Driving
222
+ * a real `transition_claim_timeout` would mean waiting out `LOCK_ACQUIRE_MAX_WAIT_MS`
223
+ * (60s) per case, and `tryWithSessionStateFileLock` throws BUSY before the timeout
224
+ * is ever built, so the per-branch reasons have no other reachable surface (#5606).
225
+ */
226
+ export declare function classifyTransitionReclaimForTests(transitionDir: string, quarantineName: string): Promise<TransitionReclaimOutcome>;
227
+ /**
228
+ * Build the timeout error exactly as the transition loop does.
229
+ *
230
+ * @internal exported so the message contract — a bounded enum suffix and nothing
231
+ * else — is pinned without a 60s wait (#5606).
232
+ */
233
+ export declare function transitionClaimTimeoutForTests(transitionDir: string, refusal: TransitionReclaimRefusal | undefined): SessionStateLockUnavailableError;
173
234
  export declare function reclaimStaleSessionStateLock(lockFile: string, quarantineName?: string): Promise<void>;
174
235
  /**
175
236
  * Serialize one read-modify-write of `stateFile` against every other holder of
@@ -0,0 +1,9 @@
1
+ import type { InternalResource, InternalUrl, ProtocolHandler } from "./types";
2
+ /**
3
+ * Handler for `embedded:` URLs.
4
+ */
5
+ export declare class EmbeddedProtocolHandler implements ProtocolHandler {
6
+ readonly scheme = "embedded";
7
+ readonly immutable = true;
8
+ resolve(url: InternalUrl): Promise<InternalResource>;
9
+ }
@@ -9,6 +9,7 @@
9
9
  */
10
10
  export * from "./agent-protocol";
11
11
  export * from "./artifact-protocol";
12
+ export * from "./embedded-protocol";
12
13
  export * from "./gjc-protocol";
13
14
  export * from "./issue-pr-protocol";
14
15
  export * from "./json-query";
@@ -10,10 +10,18 @@
10
10
  * MUST use this function instead of calling `new URL()` directly.
11
11
  */
12
12
  import type { InternalUrl } from "./types";
13
+ /**
14
+ * Canonicalize an internal URL so slashless schemes carry an authority.
15
+ *
16
+ * Every entry point that inspects or routes an internal URL (router,
17
+ * read/write tools, selector splitting) MUST normalize first, so handlers only
18
+ * ever see the `scheme://authority/path` form.
19
+ */
20
+ export declare function normalizeInternalUrlInput(input: string): string;
13
21
  /**
14
22
  * Parse an internal URL into an InternalUrl.
15
23
  *
16
24
  * Handles URLs where `new URL()` would fail (e.g., `skill://plugin:name`
17
25
  * where the colon is not a port separator).
18
26
  */
19
- export declare function parseInternalUrl(input: string): InternalUrl;
27
+ export declare function parseInternalUrl(rawInput: string): InternalUrl;
@@ -5,6 +5,7 @@
5
5
  * createAgentSession() options. The SDK does the heavy lifting.
6
6
  */
7
7
  import type { ImageContent } from "@gajae-code/ai/core";
8
+ import { postmortem } from "@gajae-code/utils";
8
9
  import type { Args } from "./cli/args";
9
10
  import { ModelRegistry } from "./config/model-registry";
10
11
  import { Settings } from "./config/settings";
@@ -17,6 +18,8 @@ import { initTheme } from "./modes/theme/theme";
17
18
  import type { SubmittedUserInput } from "./modes/types";
18
19
  import type { MCPManager } from "./runtime-mcp";
19
20
  import { type CreateAgentSessionOptions, type CreateAgentSessionResult, createAgentSession, discoverAuthStorage } from "./sdk";
21
+ import { processIncarnation } from "./sdk/broker/process-incarnation";
22
+ import { SessionIndex } from "./sdk/broker/session-index";
20
23
  import type { AgentSession } from "./session/agent-session";
21
24
  import { type ResumeSessionIdentity, type SessionDestination, type SessionDirectoryMigrationPolicy, type SessionInfo, SessionManager, type StrictSessionOpenResult } from "./session/session-manager";
22
25
  import { resolveStartupAuthConfig } from "./session/startup-auth-config";
@@ -117,6 +120,7 @@ export declare class SessionNotFoundError extends Error {
117
120
  get sessionId(): string;
118
121
  }
119
122
  export declare function operatorFacingSessionOpenMessage(value: unknown): string | undefined;
123
+ export declare function shouldNotifyModelFallback(authBootstrap: boolean | undefined, isInteractive: boolean): boolean;
120
124
  export declare function runInteractiveMode(session: AgentSession, version: string, changelogMarkdown: string | undefined, notifs: (InteractiveModeNotify | null)[], startupUpdate: StartupUpdateOrchestrator, initialMessages: string[], setExtensionUIContext: (uiContext: ExtensionUIContext, hasUI: boolean) => void, lspServers: LspStartupServerInfo[] | undefined, mcpManager: MCPManager | undefined, eventBus?: EventBus, initialMessage?: string, initialImages?: ImageContent[], createInteractiveMode?: CreateInteractiveMode, resumeAction?: "continue-tail" | "open-idle", startDeferredMcpConfig?: CreateAgentSessionResult["startDeferredMcpConfig"], startDeferredModelProfiles?: DeferredModelProfileStartup, options?: {
121
125
  stopAfterFirstPaint?: boolean;
122
126
  }): Promise<void>;
@@ -153,6 +157,24 @@ export interface RunRootCommandDependencies {
153
157
  initializeSettings?: typeof Settings.init;
154
158
  loadSettingsForScope?: typeof Settings.loadForScope;
155
159
  }
160
+ type DirectSessionManager = Pick<SessionManager, "getCwd" | "getSessionFile" | "getSessionId">;
161
+ /**
162
+ * Direct CLI liveness is meaningful only for sessions with a durable transcript.
163
+ * An in-memory manager has no artifacts for GC to fence and must not touch the
164
+ * shared SDK session-index lock.
165
+ */
166
+ export declare function directSessionRegistrationId(sessionManager: DirectSessionManager | undefined, lifecycleRequestId: string | undefined): string | undefined;
167
+ interface DirectSessionRegistrationDependencies {
168
+ createIndex?: (agentDir: string) => SessionIndex;
169
+ processIncarnation?: typeof processIncarnation;
170
+ registerPostmortem?: typeof postmortem.register;
171
+ masterRole?: {
172
+ ownerSessionId: string;
173
+ attestationEpoch: string;
174
+ };
175
+ }
176
+ /** Register a durable direct CLI session while leaving ephemeral sessions lock-free. */
177
+ export declare function registerDirectSession(sessionManager: DirectSessionManager | undefined, agentDir: string, lifecycleRequestId: string | undefined, dependencies?: DirectSessionRegistrationDependencies): Promise<void>;
156
178
  export interface ModelRoleOverrides {
157
179
  smol?: string;
158
180
  slow?: string;
@@ -1,6 +1,6 @@
1
1
  import { type Agent, type AgentSideConnection, type AuthenticateRequest, type AuthenticateResponse, type AvailableCommand, type CancelNotification, type ClientCapabilities, type CloseSessionRequest, type CloseSessionResponse, type DeleteSessionRequest, type DeleteSessionResponse, type ForkSessionRequest, type ForkSessionResponse, type InitializeRequest, type InitializeResponse, type ListSessionsRequest, type ListSessionsResponse, type LoadSessionRequest, type LoadSessionResponse, type NewSessionRequest, type NewSessionResponse, type PromptRequest, type PromptResponse, type ResumeSessionRequest, type ResumeSessionResponse, type SetSessionConfigOptionRequest, type SetSessionConfigOptionResponse, type SetSessionModeRequest, type SetSessionModeResponse } from "@agentclientprotocol/sdk";
2
2
  import { type AcpProviderRegistration, type AcpReverseConnection, AcpSdkAdapter, AcpSdkAdapterError } from "../../sdk/acp";
3
- import type { SdkPromptTerminalOutcome } from "../../sdk/prompt-status";
3
+ import type { SdkPromptFailureCategory, SdkPromptFailurePhase, SdkPromptTerminalOutcome } from "../../sdk/prompt-status";
4
4
  import { type PromptWatchdogClock } from "../../sdk/prompt-watchdog";
5
5
  import type { AcpStartupOptions } from "./startup-options";
6
6
  /**
@@ -58,6 +58,60 @@ export declare class AcpPromptFailureError extends AcpSdkAdapterError {
58
58
  readonly failure: SdkPromptFailedOutcome;
59
59
  constructor(failure: SdkPromptFailedOutcome);
60
60
  }
61
+ /**
62
+ * The wire projection of a prompt terminal's classification (issue #5615).
63
+ *
64
+ * `super(failure.code, failure.message)` above narrows the error to the generic
65
+ * `prompt_failed` plus its fixed redacted message, so the classification the
66
+ * terminal already computed used to die at the JSON-RPC boundary: an ACP client
67
+ * saw only `-32603 {code, details}` and could not tell a transient provider blip
68
+ * from a dead session without parsing English. These fields carry it across.
69
+ *
70
+ * `providerCode` is re-checked against the safe-token rule rather than trusted:
71
+ * `terminalOutcome` accepts the host's `providerCode` on a `typeof` check alone,
72
+ * and this is the first path that puts it on the wire, so an unbounded value is
73
+ * dropped instead of becoming a leak of provider text (the redaction contract in
74
+ * `sanitizePromptFailure`). A dropped or absent code is omitted, never nulled.
75
+ */
76
+ export declare const OPERATOR_UPSTREAM_LABEL = "Upstream provider failure";
77
+ export declare const OPERATOR_UPSTREAM_SUFFIX = ": the model provider ended this turn.";
78
+ /**
79
+ * `post_start` proves execution began, so tools may already have run and had effects before the
80
+ * provider died. The wording therefore qualifies the turn rather than absolving the task: saying
81
+ * the task was unaffected would assert something the bounded classifiers do not establish.
82
+ */
83
+ export declare const OPERATOR_PARTIAL_WORK_NOTE = " Work this turn had already performed may have taken effect; check before retrying.";
84
+ /**
85
+ * Operator-facing wording for a post-start terminal, assembled ONLY from bounded safe tokens: the
86
+ * classifier `phase`, the `category`, and a `providerCode` that passes `isSafePromptFailureCode`.
87
+ * Raw provider text never reaches this function and must never reach it.
88
+ *
89
+ * Gated on BOTH `phase === "post_start"` and `category === "provider_transport"`. A submission-phase
90
+ * provider failure is rejected by the phase gate: nothing executed, so wording about a turn the
91
+ * provider ended would describe an event that never occurred.
92
+ *
93
+ * It claims only what those tokens prove — that the upstream provider ended the turn — and says
94
+ * nothing about whether the operator's work survived. `post_start` proves execution began, so the
95
+ * wording qualifies that earlier work may already have taken effect instead of absolving the task.
96
+ *
97
+ * This is additive. The wire `code`/`details` pair and every `PROMPT_FAILURE_MESSAGE_*` constant
98
+ * stay exactly as they are — pinned ACP core-v1 conformance asserts on them — so this wording
99
+ * travels alongside the redacted message instead of repurposing it.
100
+ *
101
+ * It says NOTHING about the worktree, deliberately. Nothing on this path inspects the worktree, so
102
+ * any sentence about uncommitted work would assert a check that never ran — reporting an
103
+ * uninspected tree as clean is the absence-of-evidence-as-evidence-of-absence error, and an
104
+ * operator who believed it would sweep work away. Silence is the only honest option until something
105
+ * actually looks.
106
+ *
107
+ * Returns `undefined` for every other category: `phase` and `category` are already on the wire, so
108
+ * restating them in prose tells an operator nothing they do not already have.
109
+ */
110
+ export declare function postStartOperatorMessage(input: {
111
+ phase: SdkPromptFailurePhase;
112
+ category: SdkPromptFailureCategory;
113
+ providerCode?: string;
114
+ }): string | undefined;
61
115
  /**
62
116
  * What an ACP `plan` update said the turn intended to do. Structural rather than the SDK's
63
117
  * `PlanEntry` so only the fields this evidence reads are depended on.
@@ -0,0 +1,16 @@
1
+ type JsonObject = Record<string, unknown>;
2
+ export type PrimaryControlSurface = "cli" | "sdk";
3
+ /**
4
+ * Startup-control provenance is the authority record ACP needs before it may take
5
+ * permission, provider, and lifecycle ownership of a session. Hosts serving that
6
+ * record report capabilities carrying `promptTerminalOutcomeVersion`
7
+ * and `primaryControlSurface`; a host that predates the record reports neither, and a
8
+ * host that cannot answer at all reports nothing. Those are three different operator
9
+ * problems, so they get three different messages instead of one "restart the session".
10
+ */
11
+ export declare function resolveStartupProvenance(input: {
12
+ sessionId: string;
13
+ capabilities: JsonObject | undefined;
14
+ queryFailure: unknown;
15
+ }): PrimaryControlSurface;
16
+ export {};
@@ -2,10 +2,28 @@ import { Container } from "@gajae-code/tui";
2
2
  import type { ProviderSetupInput } from "../../setup/provider-onboarding";
3
3
  export type CustomProviderCredentialSource = "env" | "literal";
4
4
  export type CustomProviderWizardSubmit = ProviderSetupInput;
5
+ export interface CustomProviderWizardDiscoveryDeps {
6
+ discoverModels?: (input: {
7
+ baseUrl: string;
8
+ apiKeyEnv?: string;
9
+ apiKey?: string;
10
+ signal?: AbortSignal;
11
+ }) => Promise<{
12
+ models: string[];
13
+ }>;
14
+ }
5
15
  export declare class CustomProviderWizardComponent extends Container {
6
16
  #private;
7
- constructor(onSubmit: (input: CustomProviderWizardSubmit) => void, onCancel: () => void, onRender?: () => void);
17
+ constructor(onSubmit: (input: CustomProviderWizardSubmit) => void, onCancel: () => void, onRender?: () => void, discoveryDeps?: CustomProviderWizardDiscoveryDeps);
8
18
  setSubmitError(error: string): void;
9
19
  handleInput(keyData: string): void;
10
20
  complete(): void;
21
+ /** Generation token for the latest submit attempt. */
22
+ currentSubmitGeneration(): number;
23
+ /**
24
+ * Whether a submit attempt is still current: same generation and not
25
+ * dismissed. Revision or cancel invalidates pending completions so a
26
+ * stale refresh cannot report success or rerender over new inputs.
27
+ */
28
+ isSubmitCurrent(generation: number): boolean;
11
29
  }
@@ -19,14 +19,16 @@ declare class SessionList implements Component {
19
19
  onCancel?: () => void;
20
20
  onExit: () => void;
21
21
  onDeleteRequest?: (session: SessionInfo) => void;
22
+ onToggleStarRequest?: (session: SessionInfo) => void;
22
23
  constructor(allSessions: SessionInfo[], showCwd?: boolean);
23
24
  setInputFrozen(frozen: boolean): void;
24
25
  removeSession(sessionPath: string): void;
26
+ setSessionStarred(sessionPath: string, starred: boolean): void;
25
27
  invalidate(): void;
26
28
  render(width: number): string[];
27
29
  handleInput(keyData: string): void;
28
30
  }
29
- /** A one-shot resume consent selector. It never opens or mutates sessions. */
31
+ /** A one-shot resume consent selector with host-owned deletion and star persistence. */
30
32
  export declare class SessionSelectorComponent extends Container {
31
33
  #private;
32
34
  private readonly onSelect;
@@ -35,7 +37,8 @@ export declare class SessionSelectorComponent extends Container {
35
37
  private readonly onDelete?;
36
38
  private readonly inspector?;
37
39
  private readonly onSelection?;
38
- constructor(sessions: SessionInfo[], onSelect: (sessionPath: string) => void | Promise<void>, onCancel: () => void, onExit: () => void, onDelete?: ((session: SessionInfo) => Promise<boolean>) | undefined, inspector?: SessionInspector | undefined, onSelection?: ((selection: SessionSelectionResult) => void) | undefined);
40
+ private readonly onSetStarred?;
41
+ constructor(sessions: SessionInfo[], onSelect: (sessionPath: string) => void | Promise<void>, onCancel: () => void, onExit: () => void, onDelete?: ((session: SessionInfo) => Promise<boolean>) | undefined, inspector?: SessionInspector | undefined, onSelection?: ((selection: SessionSelectionResult) => void) | undefined, onSetStarred?: ((session: SessionInfo, starred: boolean) => Promise<void>) | undefined);
39
42
  setOnRequestRender(callback: () => void): void;
40
43
  handleInput(keyData: string): void;
41
44
  getSessionList(): SessionList;
@@ -13,16 +13,19 @@ declare class UserMessageList implements Component {
13
13
  onSelect?: (entryId: string) => void;
14
14
  onCancel?: () => void;
15
15
  constructor(messages: UserMessageItem[]);
16
+ setAvailableRows(rows: number): void;
16
17
  invalidate(): void;
17
18
  render(width: number): string[];
18
19
  handleInput(keyData: string): void;
19
20
  }
20
21
  /**
21
- * Component that renders a user message selector for branching
22
+ * Component that renders a prompt selector for creating a new session
22
23
  */
23
24
  export declare class UserMessageSelectorComponent extends Container {
24
25
  #private;
25
- constructor(messages: UserMessageItem[], onSelect: (entryId: string) => void, onCancel: () => void);
26
+ private readonly getViewportRows;
27
+ constructor(messages: UserMessageItem[], onSelect: (entryId: string) => void, onCancel: () => void, getViewportRows: () => number);
28
+ render(width: number): string[];
26
29
  getMessageList(): UserMessageList;
27
30
  }
28
31
  export {};
@@ -30,7 +30,7 @@ export declare class CommandController {
30
30
  handleDropCommand(): Promise<boolean>;
31
31
  handleForkCommand(): Promise<void>;
32
32
  handleMoveCommand(targetPath: string): Promise<void>;
33
- handleRenameCommand(title: string): Promise<void>;
33
+ handleRenameCommand(title?: string): Promise<void>;
34
34
  handleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;
35
35
  handlePythonCommand(code: string, excludeFromContext?: boolean): Promise<void>;
36
36
  handleCompactCommand(customInstructions?: string): Promise<CompactionOutcome>;
@@ -131,7 +131,7 @@ export declare class SelectorController {
131
131
  smartRoutingOnly?: boolean;
132
132
  }): void;
133
133
  showPluginSelector(mode?: "install" | "uninstall"): Promise<void>;
134
- showUserMessageSelector(): void;
134
+ showUserMessageSelector(onCommitted?: () => void): void;
135
135
  showTreeSelector(): void;
136
136
  showSessionSelector(): Promise<void>;
137
137
  handleResumeSession(sessionPath: string): Promise<void>;
@@ -257,7 +257,7 @@ export declare class InteractiveMode implements InteractiveModeContext {
257
257
  handleDropCommand(): Promise<boolean>;
258
258
  handleForkCommand(): Promise<void>;
259
259
  handleMoveCommand(targetPath: string): Promise<void>;
260
- handleRenameCommand(title: string): Promise<void>;
260
+ handleRenameCommand(title?: string): Promise<void>;
261
261
  handleMemoryCommand(text: string): Promise<void>;
262
262
  handleSTTToggle(): Promise<void>;
263
263
  showDebugSelector(): void;
@@ -8,6 +8,8 @@ export type PersistedResolutionOrigin = {
8
8
  kind: "telegram_notification";
9
9
  interactionActionId: string;
10
10
  };
11
+ /** Keep accepted diagnostics below the coordinator's cumulative Q12 snapshot cap. */
12
+ export declare const MAX_ACCEPTED_WORKFLOW_GATE_QUERY_RECORDS = 32;
11
13
  export type PersistedAckPolicy = {
12
14
  kind: "none";
13
15
  reason: "non_telegram" | "semantic_noncommit" | "legacy_unproven";
@@ -95,7 +97,7 @@ export interface WorkflowGateEmitter {
95
97
  */
96
98
  export declare class BrokerWorkflowGateEmitter implements WorkflowGateEmitter {
97
99
  #private;
98
- constructor(runId: string, store: GateStore, emitterHooks?: Pick<BrokerHooks, "advance">);
100
+ constructor(runId: string, store: GateStore, emitterHooks?: Pick<BrokerHooks, "advance" | "continuationLost">);
99
101
  supportsRemoteGateAnswers(): boolean;
100
102
  setRuntimeTurnProvider(provider: (() => string | undefined) | null): void;
101
103
  emitGate(input: OpenGateInput): Promise<unknown>;
@@ -193,6 +195,11 @@ export type GateAuditEvent = {
193
195
  } | {
194
196
  event: "gate_response_idempotent_replay";
195
197
  gate_id: string;
198
+ }
199
+ /** An idempotent replay refused because this runtime cannot prove the continuation ran. */
200
+ | {
201
+ event: "gate_response_replay_unproven";
202
+ gate_id: string;
196
203
  } | {
197
204
  event: "gate_response_idempotency_conflict";
198
205
  gate_id: string;
@@ -225,6 +232,8 @@ export interface BrokerHooks {
225
232
  terminalizeAccepted?(record: PersistedGate): WorkflowGateTerminalProof | Promise<WorkflowGateTerminalProof>;
226
233
  /** Runs only after a successful advance has been durably marked advanced. */
227
234
  completeAccepted?(record: PersistedGate): void | Promise<void>;
235
+ /** Notifies the owning runtime when the accepted answer cannot reach its continuation. */
236
+ continuationLost?(record: PersistedGate): void;
228
237
  /** Append-only audit sink. */
229
238
  audit?(event: GateAuditEvent): void;
230
239
  }
@@ -277,6 +286,7 @@ export declare class WorkflowGateBroker {
277
286
  lookupCompletedResolution(response: WorkflowGateResponse): WorkflowGateCompletedResolutionLookup;
278
287
  private runShort;
279
288
  private hasLiveContinuation;
289
+ private recordContinuationLoss;
280
290
  hasRecoverableAcceptedGate(): boolean;
281
291
  prepareTerminalization(gateId: string, proof: WorkflowGateTerminalProof): boolean;
282
292
  clearPreparedTerminalization(gateId: string): void;
@@ -117,13 +117,26 @@ export interface WorkflowGateDiagnostic extends WorkflowGate {
117
117
  id: string;
118
118
  tag: "quarantined";
119
119
  lifecycle: WorkflowGateLifecycle;
120
+ /** Whether the durable broker retained an answer for this gate. */
121
+ answer_recorded: boolean;
122
+ }
123
+ /** Durable acceptance evidence for a gate that is no longer pending. */
124
+ export interface WorkflowGateResolutionDiagnostic extends WorkflowGate {
125
+ id: string;
126
+ tag: "accepted";
127
+ /** True when the accepted record contains the answer body. */
128
+ answer_recorded: true;
129
+ resolved_at: string;
130
+ /** Single post-accept disposition; raw answers and derived answer values stay private. */
131
+ post_accept_disposition: "accepted" | "terminalized" | "advanced" | "continuation_lost" | "unknown";
120
132
  }
121
133
  /** Stable Q12 row preserving the root WorkflowGate shape. */
122
134
  export type WorkflowGateQueryRecord = (WorkflowGate & {
123
135
  id: string;
124
136
  tag: "pending";
125
137
  lifecycle?: undefined;
126
- }) | WorkflowGateDiagnostic;
138
+ answer_recorded: false;
139
+ }) | WorkflowGateDiagnostic | WorkflowGateResolutionDiagnostic;
127
140
  /** Inbound: the agent's answer to a workflow gate. */
128
141
  export interface WorkflowGateResponse {
129
142
  gate_id: string;
@@ -303,7 +303,7 @@ export interface InteractiveModeContext {
303
303
  handleHandoffCommand(customInstructions?: string): Promise<void>;
304
304
  handleContributionPrepCommand(customInstructions?: string): Promise<void>;
305
305
  handleMoveCommand(targetPath: string): Promise<void>;
306
- handleRenameCommand(title: string): Promise<void>;
306
+ handleRenameCommand(title?: string): Promise<void>;
307
307
  handleMemoryCommand(text: string): Promise<void>;
308
308
  handleSTTToggle(): Promise<void>;
309
309
  executeCompaction(customInstructionsOrOptions?: string | CompactOptions, isAuto?: boolean): Promise<CompactionOutcome>;
@@ -367,7 +367,7 @@ export interface InteractiveModeContext {
367
367
  initHooksAndCustomTools(): Promise<void>;
368
368
  emitCustomToolSessionEvent(reason: "start" | "switch" | "branch" | "tree" | "shutdown", previousSessionFile?: string): Promise<void>;
369
369
  planModeController: Pick<import("./controllers/plan-mode-controller").PlanModeController, "enabled" | "paused" | "planFilePath" | "handleCommand" | "handleApproval" | "flushPendingModelSwitch">;
370
- goalModeController: Pick<import("./controllers/goal-mode-controller").GoalModeController, "enabled" | "paused" | "handleCommand">;
370
+ goalModeController: Pick<import("./controllers/goal-mode-controller").GoalModeController, "enabled" | "paused" | "handleCommand" | "cancelContinuation" | "scheduleContinuation">;
371
371
  setHookWidget(key: string, content: ExtensionWidgetContent, options?: ExtensionWidgetOptions): void;
372
372
  setHookStatus(key: string, text: string | undefined): void;
373
373
  showHookSelector(title: string, options: string[], dialogOptions?: ExtensionUIDialogOptions): Promise<string | undefined>;
@@ -80,6 +80,8 @@ type ResourceDisposer = () => void | Promise<void>;
80
80
  export declare function registerResourceOwner(name: string, disposer: ResourceDisposer): () => void;
81
81
  /** Number of registered resource owners. Exposed for leak assertions/tests. */
82
82
  export declare function resourceOwnerCount(): number;
83
+ /** True while a process-level resource-owner sweep is in progress. */
84
+ export declare function isResourceOwnerDisposalActive(): boolean;
83
85
  /**
84
86
  * Run and clear every registered resource disposer. Attempts all disposers even
85
87
  * if some throw, then surfaces the failures as an `AggregateError` so callers
@@ -14,6 +14,7 @@ import type { MCPProtocolObservation } from "./protocol";
14
14
  import type { MCPToolDetails } from "./tool-bridge";
15
15
  import type { MCPToolCache } from "./tool-cache";
16
16
  import type { MCPGetPromptResult, MCPInputRequestHandler, MCPPrompt, MCPRequestOptions, MCPResource, MCPResourceReadResult, MCPResourceTemplate, MCPServerConfig, MCPServerConnection } from "./types";
17
+ export declare function isMCPStartupTimeoutError(error: unknown): boolean;
17
18
  export declare function resolveStartupTimeoutMs(configs: MCPServerConfig[], maxStartupTimeoutMs?: number): number;
18
19
  export declare function resolveExactConfigStartupTimeoutMs(configs: MCPServerConfig[]): number;
19
20
  /**
@@ -56,6 +57,20 @@ export interface MCPLoadResult {
56
57
  /** Extracted Exa API keys from filtered MCP servers */
57
58
  exaApiKeys: string[];
58
59
  }
60
+ export type MCPToolCatalogPublication = "unpublished" | "published" | "fenced";
61
+ /**
62
+ * Atomic view of the manager's fenced tool catalog and its publication state.
63
+ *
64
+ * `unpublished` is reserved for the initial deferred window where no manager
65
+ * catalog has been published and no exact control is fencing it. An empty
66
+ * `published` or `fenced` catalog is authoritative and must not be replaced
67
+ * with an in-flight discovery result.
68
+ */
69
+ export interface MCPToolCatalogSnapshot {
70
+ tools: CustomTool<TSchema, MCPToolDetails>[];
71
+ publication: MCPToolCatalogPublication;
72
+ generation: number;
73
+ }
59
74
  /** Options for discovering and connecting to MCP servers */
60
75
  export interface MCPDiscoverOptions {
61
76
  /** Whether to load project-level config (default: true) */
@@ -100,6 +115,30 @@ export interface MCPManagerOptions {
100
115
  /** Test seam for fencing the acquisition-to-registration replacement race. */
101
116
  afterLeaseAcquiredForTests?: (name: string, lease: MCPPoolLease) => void | Promise<void>;
102
117
  }
118
+ export type ExactMcpServerControlStatus = "suspended" | "already-suspended" | "resumed" | "not-suspended" | "reconnected" | "unavailable" | "unknown-server";
119
+ export interface ExactMcpServerControlResult {
120
+ readonly name: string;
121
+ readonly status: ExactMcpServerControlStatus;
122
+ readonly toolCount: number;
123
+ }
124
+ /**
125
+ * A staged catalog the caller can validate against before it is published.
126
+ * `commit` is the single publication point; `abort` releases anything the
127
+ * preparation opened and leaves the manager on its predecessor.
128
+ */
129
+ export interface PreparedExactMcpCatalog {
130
+ readonly tools: CustomTool<TSchema, MCPToolDetails>[];
131
+ canCommit(): boolean;
132
+ commit(): Promise<void>;
133
+ abort(): Promise<void>;
134
+ }
135
+ export interface PreparedExactMcpServerControl extends PreparedExactMcpCatalog {
136
+ readonly result: ExactMcpServerControlResult;
137
+ /** Validate a resumed replacement before an atomic multi-server publication. */
138
+ precommit?(): void;
139
+ /** Publish after every replacement in the catalog has passed precommit. */
140
+ publish?(): void;
141
+ }
103
142
  /**
104
143
  * MCP Server Manager.
105
144
  *
@@ -164,6 +203,23 @@ export declare class MCPManager {
164
203
  * Get all loaded tools.
165
204
  */
166
205
  getTools(): CustomTool<TSchema, MCPToolDetails>[];
206
+ /**
207
+ * Read the fenced catalog and publication state atomically.
208
+ *
209
+ * An empty catalog is still authoritative after publication or while an
210
+ * exact control is in flight. Deferred startup may fall back to its discovery
211
+ * result only for the explicit `unpublished` state.
212
+ */
213
+ getToolCatalogSnapshot(): MCPToolCatalogSnapshot;
214
+ isExactServerSuppressed(name: string): boolean;
215
+ /**
216
+ * Prepare one exact-config control without publishing manager state. Session
217
+ * registry and prompt validation run against `tools`; commit is the single
218
+ * publication point and abort releases only an unpublished candidate.
219
+ */
220
+ prepareExactServerControl(action: "suspend" | "resume" | "reconnect", name: string): Promise<PreparedExactMcpServerControl>;
221
+ /** Clear all session-local suppression before this owner adopts a new identity. */
222
+ prepareExactServerControlReset(): Promise<PreparedExactMcpCatalog>;
167
223
  /**
168
224
  * Get a specific connection.
169
225
  */