@gajae-code/coding-agent 0.16.7 → 0.17.1

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 (321) hide show
  1. package/CHANGELOG.md +180 -1
  2. package/dist/types/capability/fs.d.ts +37 -4
  3. package/dist/types/capability/index.d.ts +19 -0
  4. package/dist/types/capability/types.d.ts +9 -0
  5. package/dist/types/cli/doctor/args.d.ts +36 -0
  6. package/dist/types/cli/doctor/checks.d.ts +18 -0
  7. package/dist/types/cli/doctor/config-repairs.d.ts +38 -0
  8. package/dist/types/cli/doctor/context.d.ts +89 -0
  9. package/dist/types/cli/doctor/files.d.ts +27 -0
  10. package/dist/types/cli/doctor/ids.d.ts +20 -0
  11. package/dist/types/cli/doctor/install-repairs.d.ts +94 -0
  12. package/dist/types/cli/doctor/journal.d.ts +43 -0
  13. package/dist/types/cli/doctor/managed-link.d.ts +39 -0
  14. package/dist/types/cli/doctor/native-probe.d.ts +2 -0
  15. package/dist/types/cli/doctor/permission-repairs.d.ts +25 -0
  16. package/dist/types/cli/doctor/plugin-quarantine.d.ts +77 -0
  17. package/dist/types/cli/doctor/plugin-restore.d.ts +40 -0
  18. package/dist/types/cli/doctor/plugin-targets.d.ts +11 -0
  19. package/dist/types/cli/doctor/probe-client.d.ts +9 -0
  20. package/dist/types/cli/doctor/probe-types.d.ts +18 -0
  21. package/dist/types/cli/doctor/probe.d.ts +3 -0
  22. package/dist/types/cli/doctor/projection-probe.d.ts +2 -0
  23. package/dist/types/cli/doctor/repairs.d.ts +28 -0
  24. package/dist/types/cli/doctor/report.d.ts +27 -0
  25. package/dist/types/cli/doctor/runner.d.ts +4 -0
  26. package/dist/types/cli/doctor/safety.d.ts +10 -0
  27. package/dist/types/cli/doctor/service-repairs.d.ts +8 -0
  28. package/dist/types/cli/doctor/service-targets.d.ts +41 -0
  29. package/dist/types/cli/doctor/types.d.ts +145 -0
  30. package/dist/types/cli/doctor-cli.d.ts +7 -0
  31. package/dist/types/cli/doctor-supervisor.d.ts +121 -0
  32. package/dist/types/cli/doctor-worker.d.ts +29 -0
  33. package/dist/types/cli/install-activation.d.ts +158 -0
  34. package/dist/types/cli/macos-community-app.d.ts +41 -0
  35. package/dist/types/cli/mcp-cli.d.ts +0 -11
  36. package/dist/types/cli/update-cli.d.ts +41 -4
  37. package/dist/types/cli-main.d.ts +174 -0
  38. package/dist/types/cli.d.ts +1 -171
  39. package/dist/types/commands/doctor.d.ts +7 -0
  40. package/dist/types/commands/sdk.d.ts +17 -8
  41. package/dist/types/config/autorouting-tier-map.d.ts +19 -0
  42. package/dist/types/config/file-lock.d.ts +27 -3
  43. package/dist/types/config/model-preset-registry.d.ts +1 -0
  44. package/dist/types/config/model-registry.d.ts +12 -5
  45. package/dist/types/config/model-resolver.d.ts +16 -3
  46. package/dist/types/config/models-config-schema.d.ts +2 -0
  47. package/dist/types/config/settings-schema.d.ts +1 -1
  48. package/dist/types/coordinator-mcp/question-gate-codec.d.ts +1 -1
  49. package/dist/types/coordinator-mcp/session-reaper.d.ts +15 -5
  50. package/dist/types/cursor.d.ts +9 -9
  51. package/dist/types/discovery/agents-md.d.ts +6 -1
  52. package/dist/types/discovery/helpers.d.ts +36 -7
  53. package/dist/types/discovery/index.d.ts +1 -1
  54. package/dist/types/discovery/mcp-json.d.ts +2 -0
  55. package/dist/types/extensibility/extensions/loader.d.ts +22 -1
  56. package/dist/types/extensibility/gjc-plugins/lifecycle.d.ts +14 -1
  57. package/dist/types/extensibility/gjc-plugins/paths.d.ts +2 -1
  58. package/dist/types/extensibility/gjc-plugins/types.d.ts +25 -0
  59. package/dist/types/extensibility/plugins/manager.d.ts +33 -4
  60. package/dist/types/extensibility/plugins/marketplace/cache.d.ts +6 -0
  61. package/dist/types/extensibility/plugins/marketplace/manager.d.ts +186 -0
  62. package/dist/types/extensibility/plugins/marketplace/registry.d.ts +27 -0
  63. package/dist/types/extensibility/plugins/marketplace/source-resolver.d.ts +16 -1
  64. package/dist/types/extensibility/runtime-skill-discovery.d.ts +16 -3
  65. package/dist/types/gjc-runtime/autoresearch-runtime.d.ts +6 -0
  66. package/dist/types/gjc-runtime/launch-worktree.d.ts +53 -0
  67. package/dist/types/gjc-runtime/session-layout.d.ts +8 -0
  68. package/dist/types/gjc-runtime/session-state-lock.d.ts +15 -0
  69. package/dist/types/gjc-runtime/session-state-sidecar.d.ts +13 -0
  70. package/dist/types/gjc-runtime/ultragoal-runtime.d.ts +6 -0
  71. package/dist/types/main.d.ts +19 -1
  72. package/dist/types/modes/acp/acp-agent.d.ts +40 -0
  73. package/dist/types/modes/components/agent-dashboard.d.ts +1 -0
  74. package/dist/types/modes/components/model-selector.d.ts +2 -0
  75. package/dist/types/modes/interactive-mode.d.ts +1 -1
  76. package/dist/types/runtime-mcp/config-writer.d.ts +47 -0
  77. package/dist/types/runtime-mcp/policy-json-edit.d.ts +60 -0
  78. package/dist/types/runtime-mcp/startup-policy.d.ts +4 -0
  79. package/dist/types/runtime-mcp/types.d.ts +2 -2
  80. package/dist/types/sdk/acp/adapter.d.ts +5 -1
  81. package/dist/types/sdk/broker/broker.d.ts +51 -0
  82. package/dist/types/sdk/broker/daemon-entry.d.ts +39 -0
  83. package/dist/types/sdk/broker/discovery.d.ts +38 -0
  84. package/dist/types/sdk/broker/doctor-restart.d.ts +79 -0
  85. package/dist/types/sdk/broker/endpoint-authority.d.ts +7 -0
  86. package/dist/types/sdk/broker/ensure.d.ts +14 -0
  87. package/dist/types/sdk/broker/lifecycle.d.ts +2 -0
  88. package/dist/types/sdk/broker/process-incarnation.d.ts +50 -0
  89. package/dist/types/sdk/broker/runtime.d.ts +26 -0
  90. package/dist/types/sdk/broker/session-index.d.ts +13 -4
  91. package/dist/types/sdk/broker/worktree-occupancy.d.ts +14 -0
  92. package/dist/types/sdk/bus/chat-daemon-cli.d.ts +16 -0
  93. package/dist/types/sdk/bus/chat-daemon-control.d.ts +101 -6
  94. package/dist/types/sdk/bus/chat-daemon-runtime.d.ts +16 -0
  95. package/dist/types/sdk/bus/daemon-startup-exclusion.d.ts +43 -0
  96. package/dist/types/sdk/bus/doctor-daemon-restart-client.d.ts +51 -0
  97. package/dist/types/sdk/bus/doctor-daemon-restart.d.ts +39 -0
  98. package/dist/types/sdk/bus/index.d.ts +2 -0
  99. package/dist/types/sdk/bus/notification-service.d.ts +3 -0
  100. package/dist/types/sdk/bus/telegram-daemon-cli.d.ts +11 -0
  101. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
  102. package/dist/types/sdk/bus/telegram-daemon-control.d.ts +5 -0
  103. package/dist/types/sdk/bus/telegram-daemon-owner-registry.d.ts +1 -0
  104. package/dist/types/sdk/bus/telegram-daemon.d.ts +36 -5
  105. package/dist/types/sdk/cli/session-cli.d.ts +1 -0
  106. package/dist/types/sdk/host/session-runtime.d.ts +4 -0
  107. package/dist/types/sdk/host/surface-policy.d.ts +3 -1
  108. package/dist/types/sdk/lifecycle/service.d.ts +44 -10
  109. package/dist/types/sdk/prompt-deadline-lease.d.ts +6 -3
  110. package/dist/types/sdk/prompt-deadline-manager.d.ts +2 -2
  111. package/dist/types/sdk/prompt-failure.d.ts +47 -0
  112. package/dist/types/sdk/prompt-status.d.ts +19 -0
  113. package/dist/types/sdk/router/session-router.d.ts +3 -4
  114. package/dist/types/sdk/service-artifact-paths.d.ts +16 -0
  115. package/dist/types/sdk/session-authority.d.ts +9 -0
  116. package/dist/types/sdk/session.d.ts +3 -1
  117. package/dist/types/session/agent-session.d.ts +1 -1
  118. package/dist/types/session/blob-store.d.ts +1 -1
  119. package/dist/types/session/fallback-chain-controller.d.ts +3 -6
  120. package/dist/types/session/internal/managed-session-scope.d.ts +44 -0
  121. package/dist/types/session/primary-control-surface.d.ts +4 -0
  122. package/dist/types/session/session-manager.d.ts +6 -0
  123. package/dist/types/system-prompt.d.ts +6 -0
  124. package/dist/types/tools/ask.d.ts +25 -0
  125. package/dist/types/tools/image-gen.d.ts +0 -4
  126. package/dist/types/tools/skill-discovery.d.ts +7 -5
  127. package/dist/types/tools/ultragoal-ask-guard.d.ts +7 -4
  128. package/dist/types/utils/changelog.d.ts +0 -9
  129. package/dist/types/utils/mupdf-wasm.d.ts +1 -0
  130. package/package.json +9 -8
  131. package/scripts/compile-args.ts +8 -4
  132. package/src/capability/fs.ts +395 -17
  133. package/src/capability/index.ts +273 -10
  134. package/src/capability/types.ts +9 -0
  135. package/src/cli/customize-doctor.ts +18 -12
  136. package/src/cli/doctor/args.ts +236 -0
  137. package/src/cli/doctor/checks.ts +431 -0
  138. package/src/cli/doctor/config-repairs.ts +517 -0
  139. package/src/cli/doctor/context.ts +149 -0
  140. package/src/cli/doctor/files.ts +149 -0
  141. package/src/cli/doctor/ids.ts +115 -0
  142. package/src/cli/doctor/install-repairs.ts +335 -0
  143. package/src/cli/doctor/journal.ts +423 -0
  144. package/src/cli/doctor/managed-link.ts +514 -0
  145. package/src/cli/doctor/native-probe.ts +13 -0
  146. package/src/cli/doctor/permission-repairs.ts +242 -0
  147. package/src/cli/doctor/plugin-quarantine.ts +377 -0
  148. package/src/cli/doctor/plugin-restore.ts +59 -0
  149. package/src/cli/doctor/plugin-targets.ts +373 -0
  150. package/src/cli/doctor/probe-client.ts +195 -0
  151. package/src/cli/doctor/probe-types.ts +21 -0
  152. package/src/cli/doctor/probe.ts +42 -0
  153. package/src/cli/doctor/projection-probe.ts +249 -0
  154. package/src/cli/doctor/repairs.ts +1157 -0
  155. package/src/cli/doctor/report.ts +176 -0
  156. package/src/cli/doctor/runner.ts +342 -0
  157. package/src/cli/doctor/safety.ts +40 -0
  158. package/src/cli/doctor/service-repairs.ts +452 -0
  159. package/src/cli/doctor/service-targets.ts +274 -0
  160. package/src/cli/doctor/types.ts +164 -0
  161. package/src/cli/doctor-cli.ts +62 -0
  162. package/src/cli/doctor-supervisor.ts +571 -0
  163. package/src/cli/doctor-worker.ts +181 -0
  164. package/src/cli/install-activation.ts +666 -0
  165. package/src/cli/macos-community-app.ts +1449 -0
  166. package/src/cli/mcp-cli.ts +11 -21
  167. package/src/cli/nofile-limit.ts +5 -1
  168. package/src/cli/plugin-cli.ts +6 -1
  169. package/src/cli/update-cli.ts +362 -264
  170. package/src/cli-main.ts +517 -0
  171. package/src/cli.ts +64 -433
  172. package/src/commands/autoresearch.ts +11 -5
  173. package/src/commands/completion.ts +1 -1
  174. package/src/commands/doctor.ts +13 -0
  175. package/src/commands/sdk.ts +58 -10
  176. package/src/commands/ultragoal.ts +11 -5
  177. package/src/config/autorouting-tier-map.ts +7 -0
  178. package/src/config/file-lock.ts +736 -71
  179. package/src/config/mcp-schema.json +3 -3
  180. package/src/config/model-preset-registry.ts +1 -0
  181. package/src/config/model-registry.ts +80 -27
  182. package/src/config/model-resolver.ts +33 -4
  183. package/src/config/models-config-schema.ts +2 -0
  184. package/src/config/settings-schema.ts +6 -2
  185. package/src/coordinator-mcp/question-gate-codec.ts +1 -0
  186. package/src/coordinator-mcp/server.ts +534 -51
  187. package/src/coordinator-mcp/session-reaper.ts +64 -8
  188. package/src/cursor.ts +223 -53
  189. package/src/discovery/agents-md.ts +74 -8
  190. package/src/discovery/agents.ts +32 -7
  191. package/src/discovery/builtin.ts +184 -75
  192. package/src/discovery/claude-plugins.ts +85 -17
  193. package/src/discovery/cline.ts +38 -10
  194. package/src/discovery/cursor.ts +19 -6
  195. package/src/discovery/gemini.ts +62 -22
  196. package/src/discovery/github.ts +13 -3
  197. package/src/discovery/helpers.ts +483 -89
  198. package/src/discovery/index.ts +1 -0
  199. package/src/discovery/mcp-json.ts +36 -10
  200. package/src/discovery/opencode.ts +36 -19
  201. package/src/discovery/ssh.ts +11 -8
  202. package/src/discovery/windsurf.ts +12 -3
  203. package/src/exec/bash-executor.ts +10 -3
  204. package/src/exec/isolated-shell.ts +15 -2
  205. package/src/extensibility/extensions/loader.ts +88 -26
  206. package/src/extensibility/gjc-plugins/lifecycle.ts +189 -0
  207. package/src/extensibility/gjc-plugins/paths.ts +4 -1
  208. package/src/extensibility/gjc-plugins/types.ts +27 -0
  209. package/src/extensibility/plugins/manager.ts +200 -22
  210. package/src/extensibility/plugins/marketplace/cache.ts +55 -2
  211. package/src/extensibility/plugins/marketplace/manager.ts +1262 -162
  212. package/src/extensibility/plugins/marketplace/registry.ts +153 -0
  213. package/src/extensibility/plugins/marketplace/source-resolver.ts +116 -10
  214. package/src/extensibility/runtime-skill-discovery.ts +61 -9
  215. package/src/extensibility/skill-management.ts +7 -1
  216. package/src/gjc-runtime/autoresearch-runtime.ts +10 -1
  217. package/src/gjc-runtime/launch-worktree.test.ts +248 -0
  218. package/src/gjc-runtime/launch-worktree.ts +275 -38
  219. package/src/gjc-runtime/repository-binding.ts +26 -1
  220. package/src/gjc-runtime/session-layout.ts +10 -0
  221. package/src/gjc-runtime/session-state-lock.ts +330 -23
  222. package/src/gjc-runtime/session-state-sidecar.ts +328 -80
  223. package/src/gjc-runtime/ultragoal-runtime.ts +10 -1
  224. package/src/harness-control-plane/session-lease.ts +2 -2
  225. package/src/internal-urls/docs-index.generated.ts +28 -26
  226. package/src/main.ts +150 -29
  227. package/src/memories/index.ts +24 -2
  228. package/src/modes/acp/acp-agent.ts +522 -68
  229. package/src/modes/components/agent-dashboard.ts +3 -1
  230. package/src/modes/components/model-selector.ts +28 -19
  231. package/src/modes/components/plugin-settings.ts +2 -1
  232. package/src/modes/controllers/selector-controller.ts +15 -9
  233. package/src/modes/interactive-mode.ts +21 -3
  234. package/src/prompts/system/system-prompt.md +5 -1
  235. package/src/prompts/tools/browser.md +1 -1
  236. package/src/prompts/tools/move-session.md +4 -0
  237. package/src/prompts/tools/read.md +2 -1
  238. package/src/prompts/tools/skill-discovery.md +6 -5
  239. package/src/prompts/tools/task.md +1 -0
  240. package/src/runtime-mcp/config-writer.ts +228 -0
  241. package/src/runtime-mcp/oauth-discovery.ts +114 -14
  242. package/src/runtime-mcp/policy-json-edit.ts +129 -0
  243. package/src/runtime-mcp/startup-policy.ts +14 -0
  244. package/src/runtime-mcp/types.ts +2 -2
  245. package/src/sdk/acp/adapter.ts +27 -12
  246. package/src/sdk/broker/broker.ts +273 -44
  247. package/src/sdk/broker/daemon-entry.ts +119 -0
  248. package/src/sdk/broker/discovery.ts +173 -20
  249. package/src/sdk/broker/doctor-restart.ts +206 -0
  250. package/src/sdk/broker/endpoint-authority.ts +36 -0
  251. package/src/sdk/broker/ensure.ts +49 -14
  252. package/src/sdk/broker/lifecycle.ts +174 -42
  253. package/src/sdk/broker/process-incarnation.ts +86 -2
  254. package/src/sdk/broker/runtime.ts +145 -21
  255. package/src/sdk/broker/session-index.ts +136 -22
  256. package/src/sdk/broker/spawn-substrate.ts +4 -1
  257. package/src/sdk/broker/transport.ts +5 -0
  258. package/src/sdk/broker/worktree-occupancy.ts +21 -1
  259. package/src/sdk/bus/chat-daemon-cli.ts +63 -0
  260. package/src/sdk/bus/chat-daemon-control.ts +260 -64
  261. package/src/sdk/bus/chat-daemon-runtime.ts +141 -25
  262. package/src/sdk/bus/daemon-startup-exclusion.ts +119 -0
  263. package/src/sdk/bus/doctor-daemon-restart-client.ts +291 -0
  264. package/src/sdk/bus/doctor-daemon-restart.ts +92 -0
  265. package/src/sdk/bus/index.ts +252 -51
  266. package/src/sdk/bus/kind-aware-reconciliation.ts +76 -41
  267. package/src/sdk/bus/notification-service.ts +21 -3
  268. package/src/sdk/bus/reconciliation-store.ts +17 -11
  269. package/src/sdk/bus/telegram-daemon-cli.ts +91 -5
  270. package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
  271. package/src/sdk/bus/telegram-daemon-control.ts +47 -0
  272. package/src/sdk/bus/telegram-daemon-owner-registry.ts +1 -1
  273. package/src/sdk/bus/telegram-daemon.ts +178 -13
  274. package/src/sdk/cli/session-cli.ts +100 -12
  275. package/src/sdk/host/host.ts +2 -7
  276. package/src/sdk/host/session-runtime.test.ts +329 -8
  277. package/src/sdk/host/session-runtime.ts +202 -50
  278. package/src/sdk/host/surface-policy.ts +8 -1
  279. package/src/sdk/lifecycle/service.ts +199 -22
  280. package/src/sdk/mcp/server.ts +1 -1
  281. package/src/sdk/prompt-deadline-lease.ts +12 -4
  282. package/src/sdk/prompt-deadline-manager.ts +5 -7
  283. package/src/sdk/prompt-failure.ts +148 -0
  284. package/src/sdk/prompt-status.ts +30 -1
  285. package/src/sdk/prompt-watchdog.ts +11 -3
  286. package/src/sdk/protocol/operation-inventory.generated.json +18 -0
  287. package/src/sdk/protocol/operation-registry.ts +20 -8
  288. package/src/sdk/router/session-router.ts +8 -3
  289. package/src/sdk/service-artifact-paths.ts +26 -0
  290. package/src/sdk/session-authority.ts +10 -0
  291. package/src/sdk/session.ts +361 -194
  292. package/src/session/agent-session.ts +398 -93
  293. package/src/session/blob-store.ts +9 -9
  294. package/src/session/fallback-chain-controller.ts +3 -7
  295. package/src/session/internal/managed-session-scope.ts +445 -29
  296. package/src/session/internal/managed-session-storage.ts +38 -6
  297. package/src/session/primary-control-surface.ts +12 -0
  298. package/src/session/session-manager.ts +11 -3
  299. package/src/session/session-storage.ts +1 -1
  300. package/src/session-import/codex.ts +6 -1
  301. package/src/session-import/redact.ts +7 -0
  302. package/src/skill-state/workflow-mutation-guard.ts +645 -39
  303. package/src/slash-commands/builtin-registry.ts +7 -3
  304. package/src/system-prompt.ts +8 -0
  305. package/src/task/executor.ts +36 -3
  306. package/src/task/types.ts +27 -5
  307. package/src/tools/ask.ts +114 -34
  308. package/src/tools/browser/actions.ts +2 -2
  309. package/src/tools/browser/tab-worker.ts +11 -8
  310. package/src/tools/descriptors.ts +6 -1
  311. package/src/tools/fetch.ts +7 -2
  312. package/src/tools/image-gen.ts +33 -34
  313. package/src/tools/read.ts +78 -32
  314. package/src/tools/skill-discovery.ts +17 -7
  315. package/src/tools/tool-catalog.generated.ts +8 -8
  316. package/src/tools/ultragoal-ask-guard.ts +16 -26
  317. package/src/utils/changelog.ts +7 -1
  318. package/src/utils/git.ts +3 -1
  319. package/src/utils/markit.ts +24 -2
  320. package/src/utils/mupdf-wasm.ts +26 -0
  321. package/src/web/search/providers/openai-compatible.ts +191 -14
@@ -83,13 +83,11 @@ export declare function cappedExponentialWithFullJitter(baseDelayMs: number, max
83
83
  /**
84
84
  * Legacy auto-compaction retry delay.
85
85
  *
86
- * Deliberately the mirror image of `effectiveFallbackDelay`: this path recovers
86
+ * Unlike managed fallback, this path recovers
87
87
  * Retry-After by regex over provider error prose (`#parseRetryAfterMsFromError`),
88
88
  * so it follows the documented legacy rule — `retry.maxDelayMs` caps every
89
89
  * legacy session retry delay, including provider retry-after hints. Managed
90
- * fallback stays uncapped because it retries within its own per-entry budget;
91
- * compaction has no such budget, so the final candidate would otherwise sleep
92
- * for the full server-suggested duration.
90
+ * fallback ignores these hints when scheduling its attempt-based retries.
93
91
  *
94
92
  * `maxDelayMs <= 0` means "no cap", matching `cappedExponentialWithFullJitter`.
95
93
  * A missing, NaN, or infinite hint collapses to "no usable hint".
@@ -110,5 +108,4 @@ export interface CompactionCandidateFailure {
110
108
  * is the final error so callers that classify by type keep the same object.
111
109
  */
112
110
  export declare function describeCompactionCandidateFailures(failures: readonly CompactionCandidateFailure[], lastError: unknown): Error;
113
- /** Retry-After is intentionally uncapped. */
114
- export declare function effectiveFallbackDelay(baseDelayMs: number, maxDelayMs: number, attemptK: number, retryAfterMs: number | undefined, random?: () => number): number;
111
+ export declare function effectiveFallbackDelay(baseDelayMs: number, maxDelayMs: number, attemptK: number, random?: () => number): number;
@@ -144,6 +144,50 @@ export declare function ensureManagedScope(scope: ManagedScope, policy?: Managed
144
144
  */
145
145
  /** Re-secure owner-only modes under a managed directory (exported for legacy-local migration). */
146
146
  export declare function resecureOwnerOnlyManagedTree(directory: string): void;
147
+ /**
148
+ * Bound the synchronous mode-only self-heal walk so `session/new` latency stays
149
+ * independent of the on-disk size of a scope's `v2-<cwd>` tree. A heavily used
150
+ * scope holds every past session's transcripts plus resident-cache blobs, and an
151
+ * unbounded `lstat` walk on every prepare made `session/new` take ~16s on a 12 GB
152
+ * `~/.gjc` (#5565). This is a defense-in-depth mode self-heal, not the primary
153
+ * owner-only-on-write guarantee, so the *synchronous* detection is budgeted:
154
+ * truncating it never blocks launch. Detection walks entries in `readdir` order
155
+ * (freshest writes land near the top on most filesystems), so the common drift
156
+ * source is caught in-budget. Anything past the budget is NOT assumed
157
+ * owner-only — a bounded, streaming background self-heal
158
+ * (`runDeferredOwnerOnlySelfHeal`) finishes the tail off the critical path.
159
+ *
160
+ * The owner-only *guarantee* for managed content is not this walk: it is enforced
161
+ * per-write by the secured storage helpers (see `openManagedStore`). This walk is
162
+ * best-effort repair of drift introduced by non-managed writers. Because the tail
163
+ * repair is asynchronous, a truncated scan does not itself prove the tail is
164
+ * owner-only; the contract it upholds is that the tail is eventually repaired and
165
+ * that a *provable* failure of that repair — an unrepairable path
166
+ * (`pendingDeferredOwnerOnlyRepairFailures`) or an aborted traversal
167
+ * (`deferredOwnerOnlySelfHealTraversalFailures`) — fails the next prepare closed
168
+ * rather than reporting success over an uninspected or still-drifted tail.
169
+ */
170
+ export declare const OWNER_ONLY_SELF_HEAL_MAX_ENTRIES = 8192;
171
+ export declare const OWNER_ONLY_SELF_HEAL_MAX_DURATION_MS = 500;
172
+ /** Number of scopes with an in-flight deferred owner-only self-heal (test/shutdown observability). */
173
+ export declare function pendingDeferredOwnerOnlySelfHealCount(): number;
174
+ /** Number of scopes with a recorded deferred owner-only repair failure (test/shutdown observability). */
175
+ export declare function pendingDeferredOwnerOnlyRepairFailureCount(): number;
176
+ /** Number of scopes whose deferred walk aborted before traversing the tree (test/shutdown observability). */
177
+ export declare function pendingDeferredOwnerOnlyTraversalFailureCount(): number;
178
+ /** Await every in-flight deferred owner-only self-heal (deterministic teardown/shutdown). */
179
+ export declare function drainDeferredOwnerOnlySelfHeals(): Promise<void>;
180
+ /**
181
+ * Detect and repair owner-only mode drift under a prepared managed scope.
182
+ *
183
+ * Repair is targeted: only the specific descendants found group/other-readable
184
+ * within the budget are re-secured — never the whole scope — so one early
185
+ * readable blob cannot trigger an unbounded re-secure plus another full walk.
186
+ * When the budget truncates the scan, a bounded background self-heal finishes the
187
+ * remaining tail so a drifted file beyond the scan prefix is still repaired
188
+ * rather than silently accepted as owner-only.
189
+ */
190
+ export declare function selfHealOwnerOnlyModeDrift(directory: string, policy: ManagedSessionSecurityPolicy): void;
147
191
  /**
148
192
  * True when a managed setup error reflects a fixable owner-only *mode* drift
149
193
  * (group/other permission bits) rather than an ownership or identity change.
@@ -0,0 +1,4 @@
1
+ export type PrimaryControlSurface = "cli" | "sdk";
2
+ /** @internal Trusted CLI bootstrap hook; ordinary SDK callers remain SDK-owned. */
3
+ export declare function setPrimaryControlSurface(options: object, surface: PrimaryControlSurface): void;
4
+ export declare function primaryControlSurfaceFor(options: object): PrimaryControlSurface;
@@ -1742,6 +1742,12 @@ export declare class SessionManager {
1742
1742
  static list(cwd: string, sessionDir?: string, storage?: SessionStorage): Promise<SessionInfo[]>;
1743
1743
  /**
1744
1744
  * List all sessions across all project directories.
1745
+ *
1746
+ * Scope re-derivation is an enrichment pass, not an admission gate: a seeded
1747
+ * transcript stays listed even when its recorded workspace no longer resolves
1748
+ * (deleted, renamed, unmounted, or recorded by another platform's checkout).
1749
+ * Dropping those would hide readable sessions from `--resume` with no recovery
1750
+ * path, which is exactly when a global lookup matters most.
1745
1751
  */
1746
1752
  static listAll(storage?: SessionStorage, managedAgentDir?: string): Promise<SessionInfo[]>;
1747
1753
  /**
@@ -103,6 +103,12 @@ export interface BuildSystemPromptOptions {
103
103
  alwaysApplyRules?: AlwaysApplyRule[];
104
104
  /** Whether secret obfuscation is active. When true, explains the redaction format in the prompt. */
105
105
  secretsEnabled?: boolean;
106
+ /**
107
+ * Whether the `task` tool advertises the `isolated` parameter in this session
108
+ * (`task.isolation.mode !== "none"`). Worktree routing guidance depends on it:
109
+ * without isolation the agent must use a plain `git worktree`, never refuse.
110
+ */
111
+ taskIsolationEnabled?: boolean;
106
112
  /** Pre-loaded workspace tree (skips discovery if provided). May be a Promise to allow early kick-off. */
107
113
  workspaceTree?: WorkspaceTree | Promise<WorkspaceTree>;
108
114
  /**
@@ -45,6 +45,31 @@ export interface AskToolDetails {
45
45
  export declare const OTHER_OPTION = "Other (type your own)";
46
46
  export declare const ASK_CLARIFICATION_OPTION = "Ask about these choices";
47
47
  export declare const RECOMMENDED_SUFFIX = " (Recommended)";
48
+ /**
49
+ * Environment override bounding how long a headless ask waits for its answer, in
50
+ * milliseconds. Unset, empty, non-positive, non-integer, or larger than
51
+ * {@link MAX_ASK_ANSWER_DEADLINE_MS} disables the bound.
52
+ */
53
+ export declare const GJC_ASK_ANSWER_DEADLINE_MS_ENV = "GJC_ASK_ANSWER_DEADLINE_MS";
54
+ /**
55
+ * Largest deadline the runtime timer can represent. `setTimeout` silently clamps
56
+ * a longer delay to one millisecond, which would invert the contract and abort a
57
+ * headless ask almost immediately, so a value beyond this is not a usable bound
58
+ * and is treated as disabled exactly like any other invalid value.
59
+ */
60
+ export declare const MAX_ASK_ANSWER_DEADLINE_MS = 2147483647;
61
+ /**
62
+ * How long a headless ask may wait for an answer before it gives up.
63
+ *
64
+ * A headless ask has no local selector, so it is answered only by a remote
65
+ * answer source or by a workflow gate waiting for a remote responder. Neither
66
+ * channel reports that the question was taken up, so the only observable event
67
+ * is the answer itself: this is an answer deadline, not an acknowledgement.
68
+ * `GJC_ASK_ANSWER_DEADLINE_MS` arms it. It stays disabled by default: an
69
+ * attended remote responder may legitimately answer arbitrarily late, and
70
+ * silently cutting such a wait short would corrupt a real answer into an abort.
71
+ */
72
+ export declare function resolveAskAnswerDeadlineMs(env?: Record<string, string | undefined>): number | null;
48
73
  export declare const MAX_EMPTY_CUSTOM_ATTEMPTS = 3;
49
74
  export declare function validRecommendedIndex(recommended: number | undefined, optionCount: number): number | undefined;
50
75
  /** The only remote navigation control; labels are presentation, never protocol. */
@@ -125,8 +125,6 @@ interface InlineImageData {
125
125
  data: string;
126
126
  mimeType: string;
127
127
  }
128
- /** Provider → default image model mapping for fallbacks */
129
- export declare const IMAGE_PROVIDER_DEFAULTS: Record<string, string>;
130
128
  /**
131
129
  * Resolve the image-generation model from the `modelRoles.image` settings entry.
132
130
  * Returns the resolved Model (with provider identity) or undefined when no
@@ -136,8 +134,6 @@ export declare function resolveImageRoleModel(settings: ModelRoleSettings, model
136
134
  sessionId?: string;
137
135
  credentialSessionId?: string;
138
136
  }): Model | undefined;
139
- /** Resolve the effective image model for a configured provider */
140
- export declare function resolveImageModel(provider: string, modelOverride: string | null): string;
141
137
  /** Test seam: the Google image key fallback as resolved from trusted env. */
142
138
  export declare function googleImageApiKeyFromEnvForTest(): string | undefined;
143
139
  export declare function isOpenAIHostedImageModel(model: Model | undefined): boolean;
@@ -16,10 +16,12 @@ export interface SkillDiscoveryToolDetails {
16
16
  candidates: RuntimeSkillDiscoveryCandidate[];
17
17
  count: number;
18
18
  /**
19
- * Present only when zero candidates were returned AND discovery config gates
20
- * (`skills.enabled` / `skills.trustProjectSkills` / `skills.trustUserSkills`)
21
- * prevented some or all of the requested scope from being searched. Without
22
- * this, a disabled config is indistinguishable from "no skills exist".
19
+ * Present only when zero candidates were returned. Either discovery config
20
+ * gates (`skills.enabled` / `skills.trustProjectSkills` /
21
+ * `skills.trustUserSkills`) prevented some or all of the requested scope from
22
+ * being searched, a non-empty query filtered out every scanned skill, or
23
+ * diagnostics were produced for observed skills that were skipped or filtered.
24
+ * Without this, these cases are indistinguishable from "no skills exist".
23
25
  */
24
26
  notice?: string;
25
27
  /**
@@ -34,7 +36,7 @@ export declare class SkillDiscoveryTool implements AgentTool<typeof skillDiscove
34
36
  #private;
35
37
  readonly name = "skill_discovery";
36
38
  readonly label = "SkillDiscovery";
37
- readonly summary = "Discover project and user runtime skills by thin metadata";
39
+ readonly summary = "Discover bundled GJC workflow, project, and user runtime skills by thin metadata";
38
40
  readonly loadMode = "essential";
39
41
  readonly description: string;
40
42
  readonly parameters: z.ZodObject<{
@@ -1,10 +1,13 @@
1
1
  import type { AgentTool } from "@gajae-code/agent-core";
2
2
  import { type UltragoalAskBlockDiagnostic } from "../gjc-runtime/ultragoal-guard";
3
3
  export interface UltragoalAskGuardContext {
4
- activeSkillState?: {
5
- skill?: string;
6
- session_id?: string;
7
- } | null;
4
+ /**
5
+ * GJC session id of the session asking the question. This is the guard's only
6
+ * identity input: durable Ultragoal state and the nudge budget are bound to it
7
+ * exclusively. Active-skill metadata is deliberately NOT part of this context —
8
+ * a snapshot restored from another session carries that session's id, and
9
+ * treating it as the caller's identity leaked a foreign run into the guard.
10
+ */
8
11
  sessionId?: string | null;
9
12
  }
10
13
  export declare function formatUltragoalAskBlockMessage(diagnostic: UltragoalAskBlockDiagnostic): string;
@@ -15,15 +15,6 @@ export declare function parseChangelogContent(content: string): ChangelogEntry[]
15
15
  * Returns [] on ENOENT; logs and returns [] on other read/parse errors.
16
16
  */
17
17
  export declare function parseChangelog(changelogPath: string): Promise<ChangelogEntry[]>;
18
- /**
19
- * Return changelog entries from the CHANGELOG.md that shipped with this binary.
20
- *
21
- * The text is embedded at build time via `with { type: "text" }`, so the
22
- * displayed changelog is deterministic across compiled binaries, source-tree
23
- * dev runs, and `GJC_PACKAGE_DIR` / `PI_PACKAGE_DIR` overrides (which scope to
24
- * optional package assets like docs/examples and do not influence the
25
- * binary-identity changelog).
26
- */
27
18
  export declare function getDisplayChangelogEntries(): ChangelogEntry[];
28
19
  export declare function getInstalledVersionChangelogEntry(entries: readonly ChangelogEntry[], installedVersion: string): ChangelogEntry | undefined;
29
20
  /**
@@ -0,0 +1 @@
1
+ export declare function ensureMupdfWasmResolution(): void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@gajae-code/coding-agent",
4
- "version": "0.16.7",
4
+ "version": "0.17.1",
5
5
  "description": "Gajae Code CLI with read, bash, edit, write tools and session management",
6
6
  "homepage": "https://gajae-code.com",
7
7
  "author": "Yeachan-Heo and Gajae Code Contributors",
@@ -55,13 +55,13 @@
55
55
  "dependencies": {
56
56
  "@agentclientprotocol/sdk": "1.3.0",
57
57
  "@babel/parser": "^7.29.3",
58
+ "@gajae-code/agent-core": "0.17.1",
59
+ "@gajae-code/ai": "0.17.1",
60
+ "@gajae-code/natives": "0.17.1",
61
+ "@gajae-code/stats": "0.17.1",
62
+ "@gajae-code/tui": "0.17.1",
63
+ "@gajae-code/utils": "0.17.1",
58
64
  "@mozilla/readability": "^0.6.0",
59
- "@gajae-code/stats": "0.16.7",
60
- "@gajae-code/agent-core": "0.16.7",
61
- "@gajae-code/ai": "0.16.7",
62
- "@gajae-code/natives": "0.16.7",
63
- "@gajae-code/tui": "0.16.7",
64
- "@gajae-code/utils": "0.16.7",
65
65
  "@puppeteer/browsers": "^2.13.0",
66
66
  "@types/turndown": "5.0.6",
67
67
  "@xterm/headless": "^6.0.0",
@@ -69,10 +69,11 @@
69
69
  "diff": "^9.0.0",
70
70
  "fflate": "0.8.2",
71
71
  "handlebars": "^4.7.9",
72
+ "jsonc-parser": "3.3.1",
72
73
  "linkedom": "^0.18.12",
73
74
  "lru-cache": "11.3.6",
74
- "markit-ai": "0.5.3",
75
75
  "marked": "18.0.6",
76
+ "markit-ai": "0.5.3",
76
77
  "puppeteer-core": "^24.42.0",
77
78
  "turndown": "7.2.4",
78
79
  "turndown-plugin-gfm": "1.0.2",
@@ -18,7 +18,14 @@ const compiledDefineFlags = ['process.env.PI_COMPILED="true"'];
18
18
  const releaseDefineFlags = [...compiledDefineFlags, 'process.env.GJC_BUILD_CHANNEL="release"'];
19
19
  const devDefineFlags = [...compiledDefineFlags, 'process.env.GJC_BUILD_CHANNEL="dev"'];
20
20
 
21
- export const compiledExternalPackages = ["mupdf"];
21
+ // NOTE: mupdf must NOT be marked --external here. Compiled binaries cannot
22
+ // resolve bare "mupdf" imports (and its Emscripten loader cannot find the
23
+ // wasm asset inside the bunfs), which broke markit PDF conversion in every
24
+ // standalone release (#5433). mupdf is bundled instead: its wasm is embedded
25
+ // via `with { type: "file" }` and routed to the loader through the hook in
26
+ // packages/coding-agent/src/utils/mupdf-wasm.ts, and the bundled
27
+ // `require("mupdf")` inside markit-ai is replaced by the patch in
28
+ // patches/markit-ai@0.5.3.patch.
22
29
 
23
30
  export const releaseEntrypoints = [
24
31
  "./packages/coding-agent/src/cli.ts",
@@ -61,8 +68,6 @@ export function buildReleaseCompileArgs(target: string, outfile: string): string
61
68
  outfile,
62
69
  target,
63
70
  defines: releaseDefineFlags,
64
-
65
- externals: compiledExternalPackages,
66
71
  });
67
72
  }
68
73
 
@@ -72,7 +77,6 @@ export function buildDevCompileArgs(outfile = "dist/gjc"): string[] {
72
77
  entrypoints: devEntrypoints,
73
78
  outfile,
74
79
  defines: devDefineFlags,
75
- externals: compiledExternalPackages,
76
80
  });
77
81
  }
78
82