@gajae-code/coding-agent 0.17.1 → 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 (375) hide show
  1. package/CHANGELOG.md +266 -0
  2. package/dist/types/async/job-manager.d.ts +7 -6
  3. package/dist/types/cli/daemon-cli.d.ts +3 -1
  4. package/dist/types/cli/github-release.d.ts +17 -0
  5. package/dist/types/cli/public-command-entry.d.ts +56 -0
  6. package/dist/types/cli/public-command-errors.d.ts +126 -0
  7. package/dist/types/cli/public-command-evidence.d.ts +99 -0
  8. package/dist/types/cli/public-command-help.d.ts +65 -0
  9. package/dist/types/cli/public-command-registry.d.ts +69 -0
  10. package/dist/types/cli/session-picker.d.ts +1 -1
  11. package/dist/types/cli/setup-cli.d.ts +1 -0
  12. package/dist/types/cli/skills-cli.d.ts +5 -0
  13. package/dist/types/cli.d.ts +3 -0
  14. package/dist/types/commands/daemon.d.ts +4 -50
  15. package/dist/types/commands/sdk.d.ts +20 -37
  16. package/dist/types/commands/setup.d.ts +3 -0
  17. package/dist/types/commands/skills.d.ts +9 -0
  18. package/dist/types/config/autorouting-tier-map.d.ts +24 -0
  19. package/dist/types/config/file-lock.d.ts +10 -1
  20. package/dist/types/config/model-profile-activation.d.ts +63 -4
  21. package/dist/types/config/model-registry.d.ts +20 -2
  22. package/dist/types/config/settings-schema.d.ts +11 -0
  23. package/dist/types/coordinator-mcp/question-state.d.ts +6 -1
  24. package/dist/types/coordinator-mcp/server.d.ts +3 -0
  25. package/dist/types/daemon/operator-contract.d.ts +5 -1
  26. package/dist/types/eval/js/worker-protocol.d.ts +2 -0
  27. package/dist/types/extensibility/extensions/types.d.ts +12 -0
  28. package/dist/types/extensibility/gjc-plugins/registry.d.ts +4 -0
  29. package/dist/types/extensibility/runtime-skill-discovery.d.ts +18 -0
  30. package/dist/types/extensibility/shared-events.d.ts +3 -1
  31. package/dist/types/gjc-runtime/session-state-lock.d.ts +61 -0
  32. package/dist/types/internal-urls/embedded-protocol.d.ts +9 -0
  33. package/dist/types/internal-urls/index.d.ts +1 -0
  34. package/dist/types/internal-urls/parse.d.ts +9 -1
  35. package/dist/types/main.d.ts +22 -0
  36. package/dist/types/modes/acp/acp-agent.d.ts +94 -1
  37. package/dist/types/modes/acp/startup-provenance.d.ts +16 -0
  38. package/dist/types/modes/components/custom-provider-wizard.d.ts +19 -1
  39. package/dist/types/modes/components/session-selector.d.ts +5 -2
  40. package/dist/types/modes/components/thinking-selector.d.ts +2 -1
  41. package/dist/types/modes/components/user-message-selector.d.ts +5 -2
  42. package/dist/types/modes/controllers/command-controller.d.ts +1 -1
  43. package/dist/types/modes/controllers/selector-controller.d.ts +1 -1
  44. package/dist/types/modes/interactive-mode.d.ts +1 -1
  45. package/dist/types/modes/shared/agent-wire/workflow-gate-broker.d.ts +11 -1
  46. package/dist/types/modes/shared/agent-wire/workflow-gate-types.d.ts +14 -1
  47. package/dist/types/modes/types.d.ts +2 -2
  48. package/dist/types/runtime/process-lifecycle.d.ts +2 -0
  49. package/dist/types/runtime-mcp/manager.d.ts +56 -0
  50. package/dist/types/runtime-mcp/pool.d.ts +17 -0
  51. package/dist/types/runtime-mcp/redaction.d.ts +20 -0
  52. package/dist/types/runtime-mcp/startup-policy.d.ts +6 -0
  53. package/dist/types/runtime-mcp/tool-bridge.d.ts +9 -0
  54. package/dist/types/runtime-mcp/transports/http.d.ts +11 -0
  55. package/dist/types/sdk/acp/adapter.d.ts +27 -0
  56. package/dist/types/sdk/acp/final-text.d.ts +8 -0
  57. package/dist/types/sdk/broker/broker.d.ts +13 -2
  58. package/dist/types/sdk/broker/ensure.d.ts +46 -1
  59. package/dist/types/sdk/broker/identity.d.ts +3 -1
  60. package/dist/types/sdk/broker/lifecycle-ledger.d.ts +23 -3
  61. package/dist/types/sdk/broker/lifecycle.d.ts +15 -8
  62. package/dist/types/sdk/broker/runtime.d.ts +1 -1
  63. package/dist/types/sdk/broker/session-index.d.ts +22 -3
  64. package/dist/types/sdk/broker/spawn-authority.d.ts +4 -0
  65. package/dist/types/sdk/broker/stderr-drainer.d.ts +13 -0
  66. package/dist/types/sdk/bus/index.d.ts +19 -0
  67. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +3 -1
  68. package/dist/types/sdk/bus/telegram-daemon.d.ts +5 -0
  69. package/dist/types/sdk/cli/master-cli.d.ts +6 -10
  70. package/dist/types/sdk/cli/rows.d.ts +19 -1
  71. package/dist/types/sdk/cli/session-cli.d.ts +22 -5
  72. package/dist/types/sdk/client/client.d.ts +2 -0
  73. package/dist/types/sdk/guides/cli.d.ts +3 -4
  74. package/dist/types/sdk/guides/verify.d.ts +2 -0
  75. package/dist/types/sdk/host/host.d.ts +9 -0
  76. package/dist/types/sdk/host/session-runtime.d.ts +31 -0
  77. package/dist/types/sdk/host/types.d.ts +10 -0
  78. package/dist/types/sdk/index.d.ts +1 -0
  79. package/dist/types/sdk/prompt-deadline-flush.d.ts +83 -0
  80. package/dist/types/sdk/prompt-deadline-manager.d.ts +38 -1
  81. package/dist/types/sdk/prompt-failure.d.ts +30 -1
  82. package/dist/types/sdk/prompt-status.d.ts +8 -0
  83. package/dist/types/sdk/prompt-tool-boundary.d.ts +73 -0
  84. package/dist/types/sdk/router/replay-retention-gap-cache.d.ts +13 -0
  85. package/dist/types/sdk/router/session-router.d.ts +2 -0
  86. package/dist/types/sdk/startup-capability.d.ts +2 -0
  87. package/dist/types/sdk/transport/relay.d.ts +1 -0
  88. package/dist/types/sdk/transport/serve-cli.d.ts +73 -2
  89. package/dist/types/sdk/transport/stdio.d.ts +5 -1
  90. package/dist/types/session/agent-session.d.ts +168 -21
  91. package/dist/types/session/fallback-chain-controller.d.ts +6 -6
  92. package/dist/types/session/fold-coordinator.d.ts +17 -3
  93. package/dist/types/session/internal/managed-session-storage.d.ts +7 -1
  94. package/dist/types/session/session-manager.d.ts +64 -1
  95. package/dist/types/session/session-work-lease.d.ts +14 -0
  96. package/dist/types/setup/model-onboarding-guidance.d.ts +1 -1
  97. package/dist/types/setup/provider-onboarding.d.ts +81 -1
  98. package/dist/types/thinking.d.ts +3 -1
  99. package/dist/types/tools/bash.d.ts +37 -11
  100. package/dist/types/tools/job.d.ts +1 -1
  101. package/dist/types/tools/steer-fold.d.ts +31 -0
  102. package/dist/types/utils/git.d.ts +28 -2
  103. package/dist/types/utils/mupdf-embedded.d.ts +2 -0
  104. package/dist/types/utils/mupdf-wasm-embedded.d.ts +2 -0
  105. package/dist/types/utils/mupdf.d.ts +4 -0
  106. package/dist/types/utils/session-title-generation.d.ts +6 -0
  107. package/dist/types/utils/title-generator.d.ts +11 -2
  108. package/dist/types/web/scrapers/types.d.ts +3 -0
  109. package/package.json +18 -10
  110. package/scripts/build-binary.ts +9 -3
  111. package/scripts/compile-args.ts +0 -9
  112. package/scripts/embed-mupdf.ts +52 -0
  113. package/scripts/generate-sdk-operation-inventory.ts +31 -1
  114. package/scripts/vendor-markit.ts +196 -0
  115. package/src/async/job-manager.ts +60 -9
  116. package/src/cli/daemon-cli.ts +53 -18
  117. package/src/cli/github-release.ts +87 -5
  118. package/src/cli/mcp-cli.ts +38 -4
  119. package/src/cli/public-command-entry.ts +450 -0
  120. package/src/cli/public-command-errors.ts +581 -0
  121. package/src/cli/public-command-evidence.ts +717 -0
  122. package/src/cli/public-command-help.ts +360 -0
  123. package/src/cli/public-command-registry.ts +535 -0
  124. package/src/cli/session-picker.ts +2 -1
  125. package/src/cli/setup-cli.ts +9 -1
  126. package/src/cli/skills-cli.ts +46 -2
  127. package/src/cli.ts +61 -1
  128. package/src/commands/daemon.ts +65 -69
  129. package/src/commands/sdk.ts +232 -100
  130. package/src/commands/setup.ts +2 -0
  131. package/src/commands/skills.ts +11 -0
  132. package/src/config/autorouting-tier-map.ts +16 -0
  133. package/src/config/file-lock.ts +199 -68
  134. package/src/config/model-profile-activation.ts +406 -53
  135. package/src/config/model-registry.ts +204 -25
  136. package/src/config/settings-schema.ts +26 -2
  137. package/src/coordinator-mcp/policy.ts +10 -5
  138. package/src/coordinator-mcp/question-gate-codec.ts +17 -0
  139. package/src/coordinator-mcp/question-state.ts +175 -8
  140. package/src/coordinator-mcp/server.ts +528 -87
  141. package/src/coordinator-mcp/session-reaper.ts +6 -4
  142. package/src/crash/record-loader.ts +6 -2
  143. package/src/daemon/operator-contract.ts +26 -12
  144. package/src/debug/report-bundle.ts +114 -24
  145. package/src/defaults/gjc/skills/ultragoal/SKILL.md +1 -1
  146. package/src/eval/js/context-manager.ts +8 -8
  147. package/src/eval/js/worker-core.ts +9 -4
  148. package/src/eval/js/worker-protocol.ts +2 -0
  149. package/src/extensibility/extensions/runner.ts +52 -4
  150. package/src/extensibility/extensions/types.ts +10 -0
  151. package/src/extensibility/gjc-plugins/registry.ts +196 -37
  152. package/src/extensibility/runtime-skill-discovery.ts +61 -3
  153. package/src/extensibility/shared-events.ts +3 -1
  154. package/src/gjc-runtime/managed-owner-admission.ts +67 -50
  155. package/src/gjc-runtime/session-state-lock.ts +165 -24
  156. package/src/gjc-runtime/ultragoal-succession.ts +31 -3
  157. package/src/internal-urls/docs-index.generated.ts +21 -19
  158. package/src/internal-urls/embedded-protocol.ts +83 -0
  159. package/src/internal-urls/index.ts +1 -0
  160. package/src/internal-urls/parse.ts +21 -1
  161. package/src/internal-urls/router.ts +4 -2
  162. package/src/main.ts +123 -55
  163. package/src/modes/acp/acp-agent.ts +593 -47
  164. package/src/modes/acp/acp-event-mapper.ts +9 -0
  165. package/src/modes/acp/startup-provenance.ts +59 -0
  166. package/src/modes/components/custom-provider-wizard.ts +308 -7
  167. package/src/modes/components/model-selector.ts +31 -15
  168. package/src/modes/components/oauth-selector.ts +9 -0
  169. package/src/modes/components/session-selector.ts +47 -4
  170. package/src/modes/components/status-line/segments.ts +6 -1
  171. package/src/modes/components/thinking-selector.ts +7 -3
  172. package/src/modes/components/user-message-selector.ts +57 -15
  173. package/src/modes/controllers/command-controller.ts +58 -32
  174. package/src/modes/controllers/extension-ui-controller.ts +33 -7
  175. package/src/modes/controllers/input-controller.ts +4 -0
  176. package/src/modes/controllers/selector-controller.ts +177 -18
  177. package/src/modes/interactive-mode.ts +21 -7
  178. package/src/modes/runtime-init.ts +1 -0
  179. package/src/modes/shared/agent-wire/workflow-gate-broker.ts +124 -7
  180. package/src/modes/shared/agent-wire/workflow-gate-types.ts +16 -2
  181. package/src/modes/types.ts +2 -2
  182. package/src/prompts/agent-fragments/browser-aside.md +1 -0
  183. package/src/prompts/system/title-system.md +1 -1
  184. package/src/prompts/tools/bash.md +1 -1
  185. package/src/prompts/tools/job.md +1 -1
  186. package/src/prompts/tools/read.md +2 -0
  187. package/src/runtime/network-prewarm-service.test.ts +36 -1
  188. package/src/runtime/network-prewarm-service.ts +28 -3
  189. package/src/runtime/process-lifecycle.ts +22 -11
  190. package/src/runtime-mcp/config.ts +16 -1
  191. package/src/runtime-mcp/manager.ts +689 -55
  192. package/src/runtime-mcp/pool.test.ts +31 -0
  193. package/src/runtime-mcp/pool.ts +304 -28
  194. package/src/runtime-mcp/redaction.ts +42 -0
  195. package/src/runtime-mcp/startup-policy.ts +7 -0
  196. package/src/runtime-mcp/tool-bridge.ts +71 -0
  197. package/src/runtime-mcp/transports/http.ts +108 -25
  198. package/src/sdk/acp/adapter.ts +90 -9
  199. package/src/sdk/acp/final-text.ts +19 -2
  200. package/src/sdk/broker/broker.ts +378 -52
  201. package/src/sdk/broker/ensure.ts +97 -19
  202. package/src/sdk/broker/identity.ts +9 -1
  203. package/src/sdk/broker/lifecycle-ledger.ts +95 -31
  204. package/src/sdk/broker/lifecycle.ts +690 -141
  205. package/src/sdk/broker/runtime.ts +1 -1
  206. package/src/sdk/broker/session-index.ts +97 -4
  207. package/src/sdk/broker/spawn-authority.ts +35 -7
  208. package/src/sdk/broker/stderr-drainer.ts +59 -0
  209. package/src/sdk/bus/chat-daemon-control.ts +2 -2
  210. package/src/sdk/bus/chat-daemon-runtime.ts +1 -0
  211. package/src/sdk/bus/index.ts +721 -84
  212. package/src/sdk/bus/telegram-daemon-cli.ts +31 -2
  213. package/src/sdk/bus/telegram-daemon-contract.ts +3 -1
  214. package/src/sdk/bus/telegram-daemon.ts +10 -3
  215. package/src/sdk/cli/master-cli.ts +47 -36
  216. package/src/sdk/cli/rows.ts +30 -7
  217. package/src/sdk/cli/session-cli.ts +687 -184
  218. package/src/sdk/client/client.ts +18 -0
  219. package/src/sdk/guides/catalog.ts +2 -2
  220. package/src/sdk/guides/cli.ts +20 -62
  221. package/src/sdk/guides/verify.ts +14 -0
  222. package/src/sdk/host/host.ts +49 -5
  223. package/src/sdk/host/session-runtime.test.ts +636 -9
  224. package/src/sdk/host/session-runtime.ts +499 -118
  225. package/src/sdk/host/types.ts +12 -1
  226. package/src/sdk/host/websocket-transport.lifecycle.test.ts +84 -0
  227. package/src/sdk/host/websocket-transport.ts +40 -6
  228. package/src/sdk/index.ts +11 -0
  229. package/src/sdk/prompt-deadline-flush.ts +334 -0
  230. package/src/sdk/prompt-deadline-manager.ts +136 -4
  231. package/src/sdk/prompt-failure.ts +43 -1
  232. package/src/sdk/prompt-status.ts +8 -0
  233. package/src/sdk/prompt-tool-boundary.ts +121 -0
  234. package/src/sdk/protocol/operation-inventory.generated.json +106 -0
  235. package/src/sdk/router/replay-retention-gap-cache.ts +27 -0
  236. package/src/sdk/router/session-router.ts +31 -4
  237. package/src/sdk/session.ts +194 -16
  238. package/src/sdk/startup-capability.ts +1 -1
  239. package/src/sdk/transport/relay.ts +71 -6
  240. package/src/sdk/transport/serve-cli.ts +494 -49
  241. package/src/sdk/transport/socket.ts +12 -11
  242. package/src/sdk/transport/stdio.ts +7 -3
  243. package/src/session/agent-session.ts +2437 -400
  244. package/src/session/fallback-chain-controller.ts +6 -7
  245. package/src/session/fold-coordinator.ts +24 -5
  246. package/src/session/internal/managed-session-scope.ts +58 -18
  247. package/src/session/internal/managed-session-storage.ts +304 -11
  248. package/src/session/session-manager.ts +382 -44
  249. package/src/session/session-work-lease.ts +34 -0
  250. package/src/session-import/codex.ts +12 -3
  251. package/src/setup/model-onboarding-guidance.ts +1 -1
  252. package/src/setup/provider-onboarding.ts +397 -24
  253. package/src/slash-commands/builtin-registry.ts +258 -14
  254. package/src/task/index.ts +14 -2
  255. package/src/thinking.ts +21 -2
  256. package/src/tools/bash.ts +98 -78
  257. package/src/tools/fetch.ts +119 -20
  258. package/src/tools/job.ts +151 -25
  259. package/src/tools/output-meta.ts +15 -2
  260. package/src/tools/path-utils.ts +27 -3
  261. package/src/tools/read.ts +3 -3
  262. package/src/tools/steer-fold.ts +107 -0
  263. package/src/tools/tool-catalog.generated.ts +29 -2
  264. package/src/tools/tool-errors.ts +4 -0
  265. package/src/utils/git.ts +53 -3
  266. package/src/utils/markit.ts +55 -41
  267. package/src/utils/mupdf-assets.d.ts +4 -0
  268. package/src/utils/mupdf-embedded.ts +4 -0
  269. package/src/utils/mupdf-wasm-embedded.ts +3 -0
  270. package/src/utils/mupdf-wasm.ts +24 -2
  271. package/src/utils/mupdf.ts +129 -0
  272. package/src/utils/session-title-generation.ts +29 -0
  273. package/src/utils/title-generator.ts +46 -2
  274. package/src/web/scrapers/types.ts +24 -3
  275. package/vendor/markit-ai/LICENSE +21 -0
  276. package/vendor/markit-ai/MANIFEST.json +412 -0
  277. package/vendor/markit-ai/dist/commands/config.d.ts +4 -0
  278. package/vendor/markit-ai/dist/commands/config.js +139 -0
  279. package/vendor/markit-ai/dist/commands/convert.d.ts +6 -0
  280. package/vendor/markit-ai/dist/commands/convert.js +113 -0
  281. package/vendor/markit-ai/dist/commands/formats.d.ts +2 -0
  282. package/vendor/markit-ai/dist/commands/formats.js +92 -0
  283. package/vendor/markit-ai/dist/commands/init.d.ts +2 -0
  284. package/vendor/markit-ai/dist/commands/init.js +29 -0
  285. package/vendor/markit-ai/dist/commands/onboard.d.ts +2 -0
  286. package/vendor/markit-ai/dist/commands/onboard.js +61 -0
  287. package/vendor/markit-ai/dist/commands/plugin.d.ts +4 -0
  288. package/vendor/markit-ai/dist/commands/plugin.js +58 -0
  289. package/vendor/markit-ai/dist/config.d.ts +26 -0
  290. package/vendor/markit-ai/dist/config.js +42 -0
  291. package/vendor/markit-ai/dist/converters/audio.d.ts +7 -0
  292. package/vendor/markit-ai/dist/converters/audio.js +104 -0
  293. package/vendor/markit-ai/dist/converters/csv.d.ts +7 -0
  294. package/vendor/markit-ai/dist/converters/csv.js +83 -0
  295. package/vendor/markit-ai/dist/converters/docx.d.ts +6 -0
  296. package/vendor/markit-ai/dist/converters/docx.js +57 -0
  297. package/vendor/markit-ai/dist/converters/epub.d.ts +8 -0
  298. package/vendor/markit-ai/dist/converters/epub.js +128 -0
  299. package/vendor/markit-ai/dist/converters/github.d.ts +18 -0
  300. package/vendor/markit-ai/dist/converters/github.js +148 -0
  301. package/vendor/markit-ai/dist/converters/html.d.ts +6 -0
  302. package/vendor/markit-ai/dist/converters/html.js +30 -0
  303. package/vendor/markit-ai/dist/converters/image.d.ts +6 -0
  304. package/vendor/markit-ai/dist/converters/image.js +124 -0
  305. package/vendor/markit-ai/dist/converters/ipynb.d.ts +6 -0
  306. package/vendor/markit-ai/dist/converters/ipynb.js +75 -0
  307. package/vendor/markit-ai/dist/converters/iwork.d.ts +20 -0
  308. package/vendor/markit-ai/dist/converters/iwork.js +391 -0
  309. package/vendor/markit-ai/dist/converters/json.d.ts +6 -0
  310. package/vendor/markit-ai/dist/converters/json.js +21 -0
  311. package/vendor/markit-ai/dist/converters/pdf/columns.d.ts +35 -0
  312. package/vendor/markit-ai/dist/converters/pdf/columns.js +93 -0
  313. package/vendor/markit-ai/dist/converters/pdf/extract.d.ts +19 -0
  314. package/vendor/markit-ai/dist/converters/pdf/extract.js +514 -0
  315. package/vendor/markit-ai/dist/converters/pdf/grid.d.ts +25 -0
  316. package/vendor/markit-ai/dist/converters/pdf/grid.js +795 -0
  317. package/vendor/markit-ai/dist/converters/pdf/headers.d.ts +24 -0
  318. package/vendor/markit-ai/dist/converters/pdf/headers.js +108 -0
  319. package/vendor/markit-ai/dist/converters/pdf/index.d.ts +19 -0
  320. package/vendor/markit-ai/dist/converters/pdf/index.js +136 -0
  321. package/vendor/markit-ai/dist/converters/pdf/mupdf-loader.js +9 -0
  322. package/vendor/markit-ai/dist/converters/pdf/render.d.ts +24 -0
  323. package/vendor/markit-ai/dist/converters/pdf/render.js +513 -0
  324. package/vendor/markit-ai/dist/converters/pdf/types.d.ts +75 -0
  325. package/vendor/markit-ai/dist/converters/pdf/types.js +1 -0
  326. package/vendor/markit-ai/dist/converters/plain-text.d.ts +6 -0
  327. package/vendor/markit-ai/dist/converters/plain-text.js +87 -0
  328. package/vendor/markit-ai/dist/converters/pptx.d.ts +8 -0
  329. package/vendor/markit-ai/dist/converters/pptx.js +289 -0
  330. package/vendor/markit-ai/dist/converters/rss.d.ts +11 -0
  331. package/vendor/markit-ai/dist/converters/rss.js +138 -0
  332. package/vendor/markit-ai/dist/converters/wikipedia.d.ts +6 -0
  333. package/vendor/markit-ai/dist/converters/wikipedia.js +33 -0
  334. package/vendor/markit-ai/dist/converters/xlsx.d.ts +8 -0
  335. package/vendor/markit-ai/dist/converters/xlsx.js +147 -0
  336. package/vendor/markit-ai/dist/converters/xml.d.ts +6 -0
  337. package/vendor/markit-ai/dist/converters/xml.js +18 -0
  338. package/vendor/markit-ai/dist/converters/yaml.d.ts +6 -0
  339. package/vendor/markit-ai/dist/converters/yaml.js +17 -0
  340. package/vendor/markit-ai/dist/converters/zip.d.ts +8 -0
  341. package/vendor/markit-ai/dist/converters/zip.js +57 -0
  342. package/vendor/markit-ai/dist/index.d.ts +30 -0
  343. package/vendor/markit-ai/dist/index.js +26 -0
  344. package/vendor/markit-ai/dist/main.d.ts +2 -0
  345. package/vendor/markit-ai/dist/main.js +191 -0
  346. package/vendor/markit-ai/dist/markit.d.ts +45 -0
  347. package/vendor/markit-ai/dist/markit.js +267 -0
  348. package/vendor/markit-ai/dist/plugins/api.d.ts +7 -0
  349. package/vendor/markit-ai/dist/plugins/api.js +42 -0
  350. package/vendor/markit-ai/dist/plugins/index.d.ts +4 -0
  351. package/vendor/markit-ai/dist/plugins/index.js +3 -0
  352. package/vendor/markit-ai/dist/plugins/installer.d.ts +25 -0
  353. package/vendor/markit-ai/dist/plugins/installer.js +176 -0
  354. package/vendor/markit-ai/dist/plugins/loader.d.ts +6 -0
  355. package/vendor/markit-ai/dist/plugins/loader.js +61 -0
  356. package/vendor/markit-ai/dist/plugins/types.d.ts +25 -0
  357. package/vendor/markit-ai/dist/plugins/types.js +1 -0
  358. package/vendor/markit-ai/dist/providers/anthropic.d.ts +2 -0
  359. package/vendor/markit-ai/dist/providers/anthropic.js +47 -0
  360. package/vendor/markit-ai/dist/providers/index.d.ts +21 -0
  361. package/vendor/markit-ai/dist/providers/index.js +56 -0
  362. package/vendor/markit-ai/dist/providers/openai.d.ts +2 -0
  363. package/vendor/markit-ai/dist/providers/openai.js +76 -0
  364. package/vendor/markit-ai/dist/providers/types.d.ts +26 -0
  365. package/vendor/markit-ai/dist/providers/types.js +1 -0
  366. package/vendor/markit-ai/dist/types.d.ts +36 -0
  367. package/vendor/markit-ai/dist/types.js +1 -0
  368. package/vendor/markit-ai/dist/utils/exit-codes.d.ts +4 -0
  369. package/vendor/markit-ai/dist/utils/exit-codes.js +4 -0
  370. package/vendor/markit-ai/dist/utils/output.d.ts +22 -0
  371. package/vendor/markit-ai/dist/utils/output.js +31 -0
  372. package/vendor/markit-ai/dist/utils/turndown.d.ts +8 -0
  373. package/vendor/markit-ai/dist/utils/turndown.js +70 -0
  374. package/vendor/markit-ai/package.json +74 -0
  375. package/vendor/markit-ai.patch +49 -0
@@ -20,6 +20,12 @@ export type { BillingPath, BillingPathKind } from "./billing-path";
20
20
  export type { EffectiveProviderAuth, ProviderSelectionPolicy } from "./provider-selection-policy";
21
21
  export type { CanonicalModelIndex, CanonicalModelRecord, CanonicalModelVariant, ModelEquivalenceConfig };
22
22
  export { isAuthenticated, kNoAuth };
23
+ /**
24
+ * Scrub resolved credential material from a discovery failure before it is
25
+ * published to discovery state, cache provenance, or the logger. Mutates
26
+ * Error messages and stacks in place to preserve class/identity; wraps non-Errors.
27
+ */
28
+ export declare function scrubDiscoveryError(error: unknown, secrets: ReadonlyArray<string | undefined>): unknown;
23
29
  /**
24
30
  * A loopback discovery endpoint that is proven to have no listener is the normal state of
25
31
  * a machine without a local model server. Structured transport evidence is required when
@@ -321,6 +327,7 @@ interface ProviderOverride {
321
327
  cacheRetention?: CacheRetention;
322
328
  isOAuth?: boolean;
323
329
  }
330
+ export declare function registrySelectorResolvesToModel(selector: string, models: readonly Model<Api>[]): boolean;
324
331
  /**
325
332
  * Merge a freshly discovered model with the matching bundled/configured entry
326
333
  * (or a runtime provider override when no bundled entry exists).
@@ -406,6 +413,15 @@ export declare class ModelRegistry {
406
413
  getAll(): Model<Api>[];
407
414
  /** Provider ids declared in models.yml, including override-only providers. */
408
415
  getConfiguredProviderIds(): readonly string[];
416
+ /**
417
+ * Whether this registry can serve a provider id from any active source.
418
+ *
419
+ * Built-in providers are backed by the bundled AI catalog, configured
420
+ * providers come from models.yml, and extension registrations are retained
421
+ * in the runtime provider stores below. Runtime model/override state is
422
+ * included for direct registrations that do not have an extension source id.
423
+ */
424
+ isKnownProvider(provider: string): boolean;
409
425
  /**
410
426
  * Deterministic provider priority for autorouting tier generation: configured
411
427
  * `modelProviderOrder` first, then first-wins catalog order.
@@ -514,8 +530,10 @@ export declare class ModelRegistry {
514
530
  */
515
531
  seedCanonicalVariant(sessionId: string, model: Model<Api>): boolean;
516
532
  /**
517
- * Get only models that have auth configured.
518
- * This is a fast check that doesn't refresh OAuth tokens.
533
+ * Get selectable models with auth configured.
534
+ * This is a fast check that doesn't refresh OAuth tokens. A current,
535
+ * authoritative live catalog also limits each provider to its enrolled ids;
536
+ * bundled entries remain the fallback until that evidence exists.
519
537
  */
520
538
  getAvailable(): Model<Api>[];
521
539
  /**
@@ -157,6 +157,12 @@ export interface ModelTagsSettings {
157
157
  [key: string]: ModelTagDef;
158
158
  }
159
159
  export declare const DEFAULT_BASH_INTERCEPTOR_RULES: BashInterceptorRule[];
160
+ export declare const DEFAULT_SDK_PROMPT_DEADLINE_MS = 3600000;
161
+ export declare const DEFAULT_SDK_PROMPT_MAX_RUNTIME_MS = 21600000;
162
+ /** Resolve a `sdk.promptDeadlineMs` lookup, falling back on any non-finite value. */
163
+ export declare function resolveSdkPromptDeadlineMs(value: unknown): number;
164
+ /** Resolve a `sdk.promptMaxRuntimeMs` lookup, falling back on any non-finite value. */
165
+ export declare function resolveSdkPromptMaxRuntimeMs(value: unknown): number;
160
166
  export declare const SETTINGS_SCHEMA: {
161
167
  readonly lastChangelogVersion: {
162
168
  readonly type: "string";
@@ -219,6 +225,11 @@ export declare const SETTINGS_SCHEMA: {
219
225
  readonly description: "Hard maximum runtime for an SDK prompt from acceptance, bounding progress-aware renewals.";
220
226
  readonly validate: (value: number) => boolean;
221
227
  };
228
+ readonly "sdk.flushWorktreeOnDeadline": {
229
+ readonly type: "boolean";
230
+ readonly default: true;
231
+ readonly description: "Autosave uncommitted changes in the session's linked worktree by default as a WIP commit when a prompt deadline retires a prompt; primary checkouts require an explicit true opt-in.";
232
+ };
222
233
  readonly "sdk.masterOrphanGraceMs": {
223
234
  readonly type: "number";
224
235
  readonly default: 120000;
@@ -454,7 +454,12 @@ export declare function readSchedulerRoster(paths: CoordinatorStatePaths, option
454
454
  export declare function advanceSchedulerCursor(paths: CoordinatorStatePaths, cursor: string, options?: {
455
455
  signal?: AbortSignal;
456
456
  }): Promise<void>;
457
- export declare function readSessionTransaction(paths: CoordinatorStatePaths, sessionId: string): Promise<CoordinatorSessionTransactionV1 | null>;
457
+ export declare function readSessionTransaction(paths: CoordinatorStatePaths, sessionId: string, options?: {
458
+ signal?: AbortSignal;
459
+ }): Promise<CoordinatorSessionTransactionV1 | null>;
460
+ export declare function repairLegacyReportIds(paths: CoordinatorStatePaths, sessionId: string, options?: {
461
+ signal?: AbortSignal;
462
+ }): Promise<CoordinatorSessionTransactionV1 | null>;
458
463
  export declare function withSessionTransaction<T>(paths: CoordinatorStatePaths, sessionId: string, operation: (transaction: CoordinatorSessionTransactionV1) => Promise<T>, options?: {
459
464
  signal?: AbortSignal;
460
465
  }): Promise<T>;
@@ -62,6 +62,9 @@ interface CoordinatorServices {
62
62
  canonicalizePath?: (value: string) => Promise<string>;
63
63
  codexTransportFactory?: CodexTransportFactory;
64
64
  eventWebhookDelivery?: WebhookDelivery;
65
+ /** Observable transitions for consumers coordinating with the filesystem-backed event wait. */
66
+ onCoordinatorEventWatchReady?: () => void;
67
+ onCoordinatorEventWake?: () => void;
65
68
  /** Test barrier invoked after an accepted prompt receipt is durable and before turn finalization. */
66
69
  afterPromptReceiptPersisted?: (sessionId: string) => void | Promise<void>;
67
70
  /** Test barrier invoked after an answer dispatch is claimed and before its final admission check. */
@@ -24,11 +24,15 @@ export declare const DAEMON_ACTION_ALIASES: Readonly<Record<string, DaemonAction
24
24
  export declare const DAEMON_ACTION_TOKENS: readonly string[];
25
25
  /** Resolve a leading verb (canonical or alias) to its canonical action. */
26
26
  export declare function resolveDaemonAction(token: string | undefined): DaemonAction | undefined;
27
- /** Exit codes for `gjc daemon`. Backward compatible: success 0, any failure 1. */
27
+ /** Public input failures exit 2; operational failures retain exit 1. */
28
28
  export declare const DAEMON_EXIT: {
29
29
  readonly ok: 0;
30
30
  readonly failure: 1;
31
+ readonly usage: 2;
31
32
  };
33
+ /** A refused result may follow a successful stop or spawn; snapshots and prose
34
+ * do not prove that no effect occurred. Only completed results prove applied. */
35
+ export declare function daemonOperationOutcome(result: DaemonOperationResult): "applied" | "unknown";
32
36
  /** Human-facing headline when a spawn/reload is refused by a live foreign identity. */
33
37
  export declare const OWNERSHIP_MISMATCH_MESSAGE = "refused: a live Telegram daemon with a different bot token or chat already owns this workspace";
34
38
  /** Structured, actionable recovery for a token/chat ownership mismatch. */
@@ -10,6 +10,8 @@ export interface RunErrorPayload {
10
10
  stack?: string;
11
11
  isAbort?: boolean;
12
12
  isToolError?: boolean;
13
+ /** Set only when the originating error carried the trusted designed marker. */
14
+ isDesigned?: boolean;
13
15
  }
14
16
  export type ToolReply = {
15
17
  ok: true;
@@ -31,6 +31,7 @@ import type { AgentSessionEventListener } from "../../session/agent-session";
31
31
  import type { ClientBridge, ClientBridgePermissionOption, ClientBridgePermissionOutcome, ClientBridgePermissionToolCall } from "../../session/client-bridge";
32
32
  import type { CustomMessage } from "../../session/messages";
33
33
  import type { ReadonlySessionManager, SessionManager } from "../../session/session-manager";
34
+ import type { SessionWorkLease } from "../../session/session-work-lease";
34
35
  import type { BashToolDetails, BashToolInput, FindToolDetails, FindToolInput, ReadToolDetails, ReadToolInput, SearchToolDetails, SearchToolInput, WriteToolInput } from "../../tools";
35
36
  import type { EventBus } from "../../utils/event-bus";
36
37
  import type { AgentEndEvent, AutoCompactionEndEvent, AutoCompactionStartEvent, AutoRetryEndEvent, AutoRetryStartEvent, ContextEvent, GoalUpdatedEvent, SessionBeforeBranchEvent, SessionBeforeBranchResult, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionBeforeSwitchEvent, SessionBeforeSwitchResult, SessionBeforeTreeEvent, SessionBeforeTreeResult, SessionBranchEvent, SessionCompactEvent, SessionCompactingEvent, SessionCompactingResult, SessionEvent, SessionShutdownEvent, SessionStartEvent, SessionSwitchEvent, SessionTreeEvent, AgentStartEvent as SharedAgentStartEvent, TodoReminderEvent, ToolCallEventResult, ToolResultEventResult, TtsrTriggeredEvent, TurnEndEvent, TurnStartEvent } from "../shared-events";
@@ -279,6 +280,8 @@ export interface ExtensionContext {
279
280
  isIdle(): boolean;
280
281
  /** Stable resource ownership identifier for the active prompt run. */
281
282
  getActivePromptHandle(): string | undefined;
283
+ /** The session's authoritative host-liveness lease. */
284
+ getSessionWorkLease?(): SessionWorkLease | undefined;
282
285
  /** Abort the current agent operation */
283
286
  abort(): void | Promise<void>;
284
287
  /** Abort and prove whether resources for a specific prompt settled. */
@@ -1044,6 +1047,13 @@ export type SendUserMessageHandler = (content: string | (TextContent | ImageCont
1044
1047
  startsOwnRun?: boolean;
1045
1048
  removed?: boolean;
1046
1049
  }) => void;
1050
+ /**
1051
+ * Fired synchronously when a plain prompt's dispatch resolves at queue
1052
+ * time instead of run end (diverted into an in-flight run's steering).
1053
+ */
1054
+ onDispatchDisposition?: (promotion: {
1055
+ startsOwnRun: boolean;
1056
+ }) => void;
1047
1057
  preflightSignal?: AbortSignal;
1048
1058
  }) => void | Promise<void>;
1049
1059
  export type AppendEntryHandler = <T = unknown>(customType: string, data?: T) => void;
@@ -1111,6 +1121,8 @@ export interface ExtensionContextActions {
1111
1121
  isIdle: () => boolean;
1112
1122
  /** Stable resource ownership identifier for the active prompt run. */
1113
1123
  getActivePromptHandle?: () => string | undefined;
1124
+ /** The session's authoritative host-liveness lease. */
1125
+ getSessionWorkLease?: () => SessionWorkLease | undefined;
1114
1126
  abort: () => void | Promise<void>;
1115
1127
  abortPromptAndWait?: (handle: string, options: {
1116
1128
  graceMs: number;
@@ -1,4 +1,8 @@
1
1
  import { type GjcPluginRegistry, type GjcPluginRegistryEntry, type GjcPluginScope } from "./types";
2
+ export declare const RegistryLockTestHooks: {
3
+ beforeEviction?: (lockPath: string, raw: string) => void | Promise<void>;
4
+ beforePublish?: (stagingPath: string, lockPath: string) => void | Promise<void>;
5
+ };
2
6
  export declare function registryRootForScope(scope: GjcPluginScope, cwd: string): string;
3
7
  export declare function registryPathForScope(scope: GjcPluginScope, cwd: string): string;
4
8
  /**
@@ -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,5 +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
- import { type AcpProviderRegistration, type AcpReverseConnection, AcpSdkAdapter } from "../../sdk/acp";
2
+ import { type AcpProviderRegistration, type AcpReverseConnection, AcpSdkAdapter, AcpSdkAdapterError } from "../../sdk/acp";
3
+ import type { SdkPromptFailureCategory, SdkPromptFailurePhase, SdkPromptTerminalOutcome } from "../../sdk/prompt-status";
3
4
  import { type PromptWatchdogClock } from "../../sdk/prompt-watchdog";
4
5
  import type { AcpStartupOptions } from "./startup-options";
5
6
  /**
@@ -43,6 +44,98 @@ export declare function paginateAcpSessions(listed: unknown[], cwd: string | und
43
44
  }>): ListSessionsResponse;
44
45
  /** Build the ACP command palette from the shared builtins and live SDK skill state. */
45
46
  export declare function acpAvailableCommandsFromSkills(query: unknown): AvailableCommand[];
47
+ type SdkPromptFailedOutcome = Extract<SdkPromptTerminalOutcome, {
48
+ kind: "failed";
49
+ }>;
50
+ /**
51
+ * A prompt rejection that still carries the terminal's structured failure classification.
52
+ * The ACP client sees only the code and message, but the first-turn retry gate must decide on
53
+ * what the terminal actually proved — the failure's execution phase and its bounded origin
54
+ * category — so settlement carries that classification instead of discarding it into a bare
55
+ * `AcpSdkAdapterError` (review P1, issue #5574).
56
+ */
57
+ export declare class AcpPromptFailureError extends AcpSdkAdapterError {
58
+ readonly failure: SdkPromptFailedOutcome;
59
+ constructor(failure: SdkPromptFailedOutcome);
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;
115
+ /**
116
+ * What an ACP `plan` update said the turn intended to do. Structural rather than the SDK's
117
+ * `PlanEntry` so only the fields this evidence reads are depended on.
118
+ */
119
+ type AcpPlanSnapshot = Array<{
120
+ content: string;
121
+ status: "pending" | "in_progress" | "completed";
122
+ _meta?: {
123
+ gjcTodoStatus?: unknown;
124
+ } | null;
125
+ }>;
126
+ /**
127
+ * An abandoned prompt that still carries the plan its turn was working through (issue #5669).
128
+ *
129
+ * The watchdog settles a prompt whose host stopped producing frames, and that rejection used to
130
+ * be a bare `AcpSdkAdapterError`: `{code, details}` and nothing else. A wrapper could not tell
131
+ * "the agent finished" from "the agent stopped with work left", so an abandoned turn's unverified
132
+ * diff was published as if it were complete. The last observed plan is the evidence that settles
133
+ * that question, so settlement carries it instead of dropping it at the JSON-RPC boundary.
134
+ */
135
+ export declare class AcpPromptAbandonedError extends AcpSdkAdapterError {
136
+ readonly plan: AcpPlanSnapshot | undefined;
137
+ constructor(code: string, message: string, plan: AcpPlanSnapshot | undefined);
138
+ }
46
139
  export type TranscriptReplayBlock = {
47
140
  type: "text";
48
141
  text: string;
@@ -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;
@@ -1,4 +1,5 @@
1
1
  import { type ThinkingLevel as ThinkingLevelValue } from "@gajae-code/agent-core";
2
+ import type { Model } from "@gajae-code/ai/types";
2
3
  import { Container, SelectList } from "@gajae-code/tui";
3
4
  export interface ThinkingSelectorSelection {
4
5
  level: ThinkingLevelValue;
@@ -9,7 +10,7 @@ export interface ThinkingSelectorSelection {
9
10
  */
10
11
  export declare class ThinkingSelectorComponent extends Container {
11
12
  #private;
12
- constructor(currentLevel: ThinkingLevelValue | undefined, availableLevels: ThinkingLevelValue[], onSelect: (selection: ThinkingSelectorSelection) => void, onCancel: () => void);
13
+ constructor(currentLevel: ThinkingLevelValue | undefined, availableLevels: ThinkingLevelValue[], onSelect: (selection: ThinkingSelectorSelection) => void, onCancel: () => void, model?: Model);
13
14
  handleInput(data: string): void;
14
15
  getSelectList(): SelectList;
15
16
  }
@@ -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>;