@gajae-code/coding-agent 0.15.5 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (272) hide show
  1. package/CHANGELOG.md +85 -1
  2. package/dist/types/async/job-manager.d.ts +83 -0
  3. package/dist/types/cli/args.d.ts +2 -0
  4. package/dist/types/cli/auth-gateway-cli.d.ts +17 -0
  5. package/dist/types/cli/model-presets-cli.d.ts +9 -0
  6. package/dist/types/cli/root-flags.d.ts +14 -0
  7. package/dist/types/cli/update-cli.d.ts +15 -0
  8. package/dist/types/cli.d.ts +7 -0
  9. package/dist/types/commands/auth-gateway.d.ts +3 -0
  10. package/dist/types/commands/gc.d.ts +13 -0
  11. package/dist/types/commands/launch.d.ts +10 -0
  12. package/dist/types/commands/model-presets.d.ts +21 -0
  13. package/dist/types/config/autorouting-tier-map.d.ts +120 -0
  14. package/dist/types/config/file-lock.d.ts +54 -2
  15. package/dist/types/config/internal/model-preset-registry-test-state.d.ts +4 -0
  16. package/dist/types/config/internal/model-preset-registry-test-support.d.ts +3 -0
  17. package/dist/types/config/keybindings.d.ts +3 -2
  18. package/dist/types/config/model-preset-registry.d.ts +368 -0
  19. package/dist/types/config/model-profile-activation.d.ts +39 -0
  20. package/dist/types/config/model-profiles.d.ts +5 -3
  21. package/dist/types/config/model-registry.d.ts +17 -5
  22. package/dist/types/config/settings-schema.d.ts +19 -1
  23. package/dist/types/config/settings.d.ts +2 -0
  24. package/dist/types/coordinator-mcp/model-preset.d.ts +7 -5
  25. package/dist/types/coordinator-mcp/projection-scan.d.ts +54 -0
  26. package/dist/types/crash/record-loader.d.ts +15 -0
  27. package/dist/types/extensibility/extensions/types.d.ts +2 -5
  28. package/dist/types/gjc-runtime/empty-delete-gc.d.ts +58 -0
  29. package/dist/types/gjc-runtime/gc-runtime.d.ts +2 -0
  30. package/dist/types/gjc-runtime/launch-worktree-reservation.d.ts +21 -0
  31. package/dist/types/gjc-runtime/managed-owner-supervisor.d.ts +2 -0
  32. package/dist/types/gjc-runtime/session-state-lock.d.ts +35 -6
  33. package/dist/types/gjc-runtime/session-state-sidecar.d.ts +72 -1
  34. package/dist/types/gjc-runtime/tmux-owner-isolation.d.ts +1 -0
  35. package/dist/types/gjc-runtime/tmux-sessions.d.ts +27 -0
  36. package/dist/types/index.d.ts +1 -0
  37. package/dist/types/main.d.ts +3 -1
  38. package/dist/types/master-mode/context.d.ts +21 -0
  39. package/dist/types/master-mode/first-request.d.ts +34 -0
  40. package/dist/types/master-mode/snapshot.d.ts +32 -0
  41. package/dist/types/modes/components/frictionless-onboarding-selector.d.ts +10 -0
  42. package/dist/types/modes/components/jobs-overlay-model.d.ts +4 -2
  43. package/dist/types/modes/components/oauth-selector.d.ts +1 -0
  44. package/dist/types/modes/components/status-line/model-name.d.ts +18 -0
  45. package/dist/types/modes/components/status-line/priority-row.d.ts +34 -0
  46. package/dist/types/modes/components/status-line/segments.d.ts +10 -0
  47. package/dist/types/modes/jobs-observer.d.ts +36 -0
  48. package/dist/types/modes/print-mode.d.ts +17 -0
  49. package/dist/types/modes/ui-language.d.ts +7 -1
  50. package/dist/types/sdk/broker/broker.d.ts +80 -1
  51. package/dist/types/sdk/broker/endpoint-authority.d.ts +24 -0
  52. package/dist/types/sdk/broker/index.d.ts +3 -0
  53. package/dist/types/sdk/broker/lifecycle.d.ts +26 -0
  54. package/dist/types/sdk/broker/master-capability.d.ts +10 -0
  55. package/dist/types/sdk/broker/session-index.d.ts +40 -11
  56. package/dist/types/sdk/broker/session-scope.d.ts +72 -0
  57. package/dist/types/sdk/broker/spawn-authority.d.ts +201 -0
  58. package/dist/types/sdk/broker/spawn-substrate.d.ts +30 -0
  59. package/dist/types/sdk/broker/state-version.d.ts +4 -1
  60. package/dist/types/sdk/broker/worktree-occupancy.d.ts +28 -0
  61. package/dist/types/sdk/bus/chat-daemon-control.d.ts +3 -0
  62. package/dist/types/sdk/bus/index.d.ts +6 -0
  63. package/dist/types/sdk/bus/kind-aware-reconciliation.d.ts +3 -0
  64. package/dist/types/sdk/bus/prompt-reconciliation.d.ts +4 -0
  65. package/dist/types/sdk/bus/telegram-daemon-contract.d.ts +1 -1
  66. package/dist/types/sdk/cli/index.d.ts +1 -0
  67. package/dist/types/sdk/cli/master-cli.d.ts +63 -0
  68. package/dist/types/sdk/cli/rows.d.ts +4 -3
  69. package/dist/types/sdk/cli/session-cli.d.ts +18 -2
  70. package/dist/types/sdk/client/client.d.ts +3 -2
  71. package/dist/types/sdk/client/discovery.d.ts +1 -0
  72. package/dist/types/sdk/host/control/dispatch.d.ts +10 -0
  73. package/dist/types/sdk/host/control/index.d.ts +1 -1
  74. package/dist/types/sdk/host/control/operations.d.ts +2 -0
  75. package/dist/types/sdk/host/control/runtime-gate.d.ts +21 -7
  76. package/dist/types/sdk/host/host.d.ts +10 -0
  77. package/dist/types/sdk/host/model-pin.d.ts +7 -2
  78. package/dist/types/sdk/host/sdk-run-capability.d.ts +1 -0
  79. package/dist/types/sdk/host/session-runtime.d.ts +67 -1
  80. package/dist/types/sdk/lifecycle/broker-client.d.ts +6 -0
  81. package/dist/types/sdk/lifecycle/service.d.ts +15 -3
  82. package/dist/types/sdk/lifecycle-session.d.ts +2 -0
  83. package/dist/types/sdk/prompt-deadline-manager.d.ts +11 -1
  84. package/dist/types/sdk/protocol/adapter-validation.d.ts +2 -0
  85. package/dist/types/sdk/router/session-router.d.ts +11 -0
  86. package/dist/types/sdk/session.d.ts +16 -0
  87. package/dist/types/sdk/startup-capability.d.ts +2 -1
  88. package/dist/types/session/account-inventory.d.ts +1 -0
  89. package/dist/types/session/agent-session.d.ts +24 -7
  90. package/dist/types/session/credential-store-errors.d.ts +1 -0
  91. package/dist/types/session/fold-coordinator.d.ts +201 -0
  92. package/dist/types/session/sdk-run-capability-internal.d.ts +7 -0
  93. package/dist/types/session/sdk-run-capability.d.ts +2 -0
  94. package/dist/types/session/session-manager.d.ts +65 -0
  95. package/dist/types/session/yield-queue.d.ts +5 -4
  96. package/dist/types/setup/frictionless-onboarding.d.ts +1 -0
  97. package/dist/types/telemetry/control.d.ts +11 -0
  98. package/dist/types/telemetry/events.d.ts +20 -0
  99. package/dist/types/telemetry/index.d.ts +3 -0
  100. package/dist/types/telemetry/transport.d.ts +22 -0
  101. package/dist/types/tools/bash-interactive.d.ts +23 -0
  102. package/dist/types/tools/bash.d.ts +4 -0
  103. package/dist/types/tools/gh.d.ts +8 -0
  104. package/dist/types/tools/index.d.ts +10 -5
  105. package/dist/types/web/search/providers/base.d.ts +9 -4
  106. package/dist/types/web/search/providers/xai.d.ts +2 -1
  107. package/dist/types/web/search/types.d.ts +14 -0
  108. package/package.json +10 -7
  109. package/scripts/generate-hotkeys-docs.ts +4 -0
  110. package/scripts/generate-sdk-operation-inventory.ts +9 -3
  111. package/scripts/verify-gjc-sdk-canonicalization.ts +35 -1
  112. package/src/async/job-manager.ts +671 -39
  113. package/src/cli/accounts-cli.ts +9 -5
  114. package/src/cli/args.ts +17 -0
  115. package/src/cli/auth-broker-cli.ts +40 -12
  116. package/src/cli/auth-gateway-cli.ts +273 -97
  117. package/src/cli/config-cli.ts +2 -2
  118. package/src/cli/fast-help.ts +4 -0
  119. package/src/cli/model-presets-cli.ts +100 -0
  120. package/src/cli/root-flags.ts +5 -0
  121. package/src/cli/update-cli.ts +117 -16
  122. package/src/cli.ts +6 -2
  123. package/src/commands/auth-gateway.ts +12 -8
  124. package/src/commands/gc.ts +19 -0
  125. package/src/commands/launch.ts +86 -18
  126. package/src/commands/model-presets.ts +24 -0
  127. package/src/commands/sdk.ts +113 -21
  128. package/src/config/autorouting-tier-map.ts +44 -0
  129. package/src/config/file-lock-gc.ts +9 -4
  130. package/src/config/file-lock.ts +890 -99
  131. package/src/config/internal/model-preset-registry-test-state.ts +28 -0
  132. package/src/config/internal/model-preset-registry-test-support.ts +11 -0
  133. package/src/config/keybindings.ts +6 -2
  134. package/src/config/model-preset-registry.ts +2795 -0
  135. package/src/config/model-profile-activation.ts +115 -28
  136. package/src/config/model-profile-contract.ts +4 -1
  137. package/src/config/model-profiles.ts +56 -14
  138. package/src/config/model-registry.ts +1044 -122
  139. package/src/config/model-resolver.ts +5 -0
  140. package/src/config/settings-schema.ts +19 -1
  141. package/src/config/settings.ts +11 -1
  142. package/src/coordinator-mcp/model-preset.ts +32 -17
  143. package/src/coordinator-mcp/projection-scan.ts +592 -0
  144. package/src/coordinator-mcp/question-state.ts +9 -11
  145. package/src/coordinator-mcp/server.ts +111 -42
  146. package/src/coordinator-mcp/session-reaper.ts +9 -3
  147. package/src/crash/index-store.ts +2 -0
  148. package/src/crash/record-loader.ts +10 -0
  149. package/src/extensibility/extensions/loader.ts +0 -1
  150. package/src/extensibility/extensions/types.ts +2 -3
  151. package/src/extensibility/gjc-plugins/runtime-adapters.ts +1 -0
  152. package/src/gjc-runtime/empty-delete-gc.ts +301 -0
  153. package/src/gjc-runtime/gc-render.ts +29 -0
  154. package/src/gjc-runtime/gc-runtime.ts +174 -11
  155. package/src/gjc-runtime/launch-worktree-reservation.ts +242 -0
  156. package/src/gjc-runtime/managed-owner-supervisor.ts +63 -51
  157. package/src/gjc-runtime/session-state-lock.ts +1321 -147
  158. package/src/gjc-runtime/session-state-sidecar.ts +1004 -25
  159. package/src/gjc-runtime/tmux-owner-isolation-cli.ts +4 -7
  160. package/src/gjc-runtime/tmux-owner-isolation.ts +2 -2
  161. package/src/gjc-runtime/tmux-sessions.ts +252 -13
  162. package/src/hooks/skill-state.ts +6 -0
  163. package/src/index.ts +1 -0
  164. package/src/internal-urls/docs-index.generated.ts +14 -13
  165. package/src/internal-urls/issue-pr-protocol.ts +4 -2
  166. package/src/lsp/config.ts +4 -3
  167. package/src/lsp/path-trust.ts +12 -6
  168. package/src/main.ts +66 -4
  169. package/src/master-mode/context.ts +50 -0
  170. package/src/master-mode/first-request.ts +65 -0
  171. package/src/master-mode/snapshot.ts +205 -0
  172. package/src/modes/acp/acp-agent.ts +616 -161
  173. package/src/modes/components/footer.ts +4 -2
  174. package/src/modes/components/frictionless-onboarding-selector.ts +48 -2
  175. package/src/modes/components/jobs-overlay-model.ts +99 -16
  176. package/src/modes/components/model-selector.ts +158 -18
  177. package/src/modes/components/oauth-selector.ts +6 -1
  178. package/src/modes/components/settings-selector.ts +1 -0
  179. package/src/modes/components/status-line/model-name.ts +53 -0
  180. package/src/modes/components/status-line/priority-row.ts +107 -0
  181. package/src/modes/components/status-line/segments.ts +29 -10
  182. package/src/modes/components/tool-status-header.ts +151 -15
  183. package/src/modes/controllers/extension-ui-controller.ts +1 -1
  184. package/src/modes/controllers/input-controller.ts +51 -6
  185. package/src/modes/controllers/selector-controller.ts +191 -96
  186. package/src/modes/interactive-mode.ts +14 -1
  187. package/src/modes/jobs-observer.ts +149 -16
  188. package/src/modes/print-mode.ts +64 -0
  189. package/src/modes/runtime-init.ts +1 -1
  190. package/src/modes/ui-language.ts +49 -2
  191. package/src/modes/utils/injected-user-submission.ts +15 -1
  192. package/src/prompts/system/master-mode.md +28 -0
  193. package/src/prompts/tools/bash.md +2 -2
  194. package/src/prompts/tools/fold-receipt.md +3 -0
  195. package/src/prompts/tools/job.md +1 -1
  196. package/src/sdk/acp/adapter.ts +17 -2
  197. package/src/sdk/broker/broker.ts +1671 -34
  198. package/src/sdk/broker/endpoint-authority.ts +86 -0
  199. package/src/sdk/broker/ensure.ts +5 -0
  200. package/src/sdk/broker/index.ts +3 -0
  201. package/src/sdk/broker/lifecycle.ts +217 -46
  202. package/src/sdk/broker/master-capability.ts +232 -0
  203. package/src/sdk/broker/session-index.ts +121 -17
  204. package/src/sdk/broker/session-scope.ts +272 -0
  205. package/src/sdk/broker/spawn-authority.ts +1031 -0
  206. package/src/sdk/broker/spawn-substrate.ts +548 -0
  207. package/src/sdk/broker/state-version.ts +26 -14
  208. package/src/sdk/broker/transport.ts +1 -0
  209. package/src/sdk/broker/worktree-occupancy.ts +90 -0
  210. package/src/sdk/bus/chat-daemon-control.ts +5 -2
  211. package/src/sdk/bus/chat-daemon-runtime.ts +46 -5
  212. package/src/sdk/bus/index.ts +51 -4
  213. package/src/sdk/bus/kind-aware-reconciliation.ts +36 -6
  214. package/src/sdk/bus/prompt-reconciliation.ts +28 -4
  215. package/src/sdk/bus/slack-conversation.ts +5 -1
  216. package/src/sdk/bus/telegram-daemon-contract.ts +1 -1
  217. package/src/sdk/cli/index.ts +1 -0
  218. package/src/sdk/cli/master-cli.ts +259 -0
  219. package/src/sdk/cli/rows.ts +11 -8
  220. package/src/sdk/cli/session-cli.ts +276 -6
  221. package/src/sdk/client/client.ts +14 -8
  222. package/src/sdk/client/discovery.ts +3 -1
  223. package/src/sdk/host/control/dispatch.ts +101 -37
  224. package/src/sdk/host/control/index.ts +2 -0
  225. package/src/sdk/host/control/operations.ts +2 -0
  226. package/src/sdk/host/control/runtime-gate.ts +203 -11
  227. package/src/sdk/host/host.ts +27 -2
  228. package/src/sdk/host/model-pin.ts +185 -25
  229. package/src/sdk/host/sdk-run-capability.ts +1 -0
  230. package/src/sdk/host/session-runtime.test.ts +581 -43
  231. package/src/sdk/host/session-runtime.ts +655 -101
  232. package/src/sdk/lifecycle/broker-client.ts +28 -0
  233. package/src/sdk/lifecycle/service.ts +279 -20
  234. package/src/sdk/lifecycle-session.ts +10 -2
  235. package/src/sdk/prompt-deadline-manager.ts +16 -1
  236. package/src/sdk/protocol/adapter-validation.ts +27 -0
  237. package/src/sdk/protocol/operation-inventory.generated.json +53 -2
  238. package/src/sdk/protocol/operation-registry.ts +17 -4
  239. package/src/sdk/router/session-router.ts +294 -154
  240. package/src/sdk/session.ts +440 -167
  241. package/src/sdk/startup-capability.ts +1 -0
  242. package/src/session/account-inventory.ts +27 -11
  243. package/src/session/agent-session.ts +1292 -180
  244. package/src/session/blob-store.ts +15 -5
  245. package/src/session/credential-store-errors.ts +2 -0
  246. package/src/session/fold-coordinator.ts +433 -0
  247. package/src/session/internal/managed-session-storage.ts +153 -78
  248. package/src/session/sdk-run-capability-internal.ts +15 -0
  249. package/src/session/sdk-run-capability.ts +2 -0
  250. package/src/session/session-manager.ts +342 -28
  251. package/src/session/yield-queue.ts +24 -10
  252. package/src/setup/frictionless-onboarding.ts +2 -0
  253. package/src/setup/provider-presets.json +1 -1
  254. package/src/slash-commands/helpers/credential-switch.ts +6 -1
  255. package/src/task/executor.ts +19 -3
  256. package/src/telemetry/control.ts +26 -0
  257. package/src/telemetry/events.ts +1268 -0
  258. package/src/telemetry/index.ts +3 -0
  259. package/src/telemetry/transport.ts +87 -0
  260. package/src/tools/bash-interactive.ts +182 -85
  261. package/src/tools/bash.ts +1028 -109
  262. package/src/tools/gh.ts +104 -48
  263. package/src/tools/github-cache.ts +2 -2
  264. package/src/tools/index.ts +11 -5
  265. package/src/tools/tool-catalog.generated.ts +1 -1
  266. package/src/web/search/provider.ts +120 -11
  267. package/src/web/search/providers/anthropic.ts +89 -17
  268. package/src/web/search/providers/base.ts +9 -4
  269. package/src/web/search/providers/gemini.ts +87 -15
  270. package/src/web/search/providers/openai-compatible.ts +23 -8
  271. package/src/web/search/providers/xai.ts +98 -12
  272. package/src/web/search/types.ts +16 -0
@@ -27,7 +27,8 @@ import {
27
27
  } from "../sdk/broker/lifecycle";
28
28
  import { processIncarnation } from "../sdk/broker/process-incarnation";
29
29
  import { writeBrokerStartupFailureMarker } from "../sdk/broker/startup-failure";
30
- import { runSdkSessionCli } from "../sdk/cli";
30
+ import { renderSdkSearchTable, runSdkSearch, runSdkSessionCli } from "../sdk/cli";
31
+ import { renderSpawnTable, runSdkSpawn, SdkMasterCliError } from "../sdk/cli/master-cli";
31
32
  import { runSdkGuidesCli } from "../sdk/guides/cli";
32
33
  import { type CreateLifecycleAgentSessionResult, createLifecycleAgentSession } from "../sdk/lifecycle-session";
33
34
  import { listManagedSessionCandidates, resolveManagedSessionScope } from "../sdk/session-directory";
@@ -582,6 +583,7 @@ export async function runSessionHost(
582
583
  ...(mcpStartupTimeoutMs !== undefined ? { mcpStartupTimeoutMs } : {}),
583
584
  ...(request.readiness ? { readiness: request.readiness } : {}),
584
585
  ...(request.modelId ? { modelId: request.modelId } : {}),
586
+ lifecycleRequestId: effectMarker,
585
587
  });
586
588
  } catch (error) {
587
589
  throw await registrationFailure(error);
@@ -838,19 +840,24 @@ class SdkSessionHelp extends Command {
838
840
  description: "Workspace directory for saved-session resolution (default: current directory)",
839
841
  }),
840
842
  op: Flags.string({ description: "Raw control or global operation" }),
841
- scope: Flags.string({
842
- description: "list scope: repo (default), cwd, worktree, or all",
843
- options: ["repo", "cwd", "worktree", "all"],
844
- }),
843
+
845
844
  query: Flags.string({ description: "Raw query name" }),
846
845
  "json-input": Flags.string({ description: "SDK request JSON object" }),
847
846
  "json-input-file": Flags.string({ description: "Read SDK request JSON from a 0600 file" }),
848
847
  "json-input-stdin": Flags.boolean({ description: "Read SDK request JSON from standard input" }),
849
- "idempotency-key": Flags.string({ description: "Caller idempotency key required for SDK lifecycle globals" }),
850
- confirm: Flags.boolean({ description: "Confirm a destructive SDK control operation" }),
848
+ "idempotency-key": Flags.string({
849
+ description: "Caller idempotency key required for lifecycle globals and terminal abort controls",
850
+ }),
851
+ confirm: Flags.boolean({ description: "Confirm a destructive local CLI control operation" }),
851
852
  cursor: Flags.string({
852
- description: "Raw query continuation cursor, or a saved checkpoint token to resume tail from",
853
+ description: "Raw query continuation cursor, saved checkpoint token, or search continuation cursor",
853
854
  }),
855
+ scope: Flags.string({
856
+ description:
857
+ "session list scope: repo (default), cwd, worktree, or all; search scope: repo (default), pwd, or global",
858
+ }),
859
+ limit: Flags.integer({ description: "Search page size from 1 to 100" }),
860
+ json: Flags.boolean({ description: "Render search as the SdkSearchResultV1 JSON envelope" }),
854
861
  text: Flags.string({ description: "Prompt text for send (alternative to --json-input)" }),
855
862
  "op-ref": Flags.string({ description: "Operation reference for send (defaults to a generated ULID)" }),
856
863
  wait: Flags.boolean({
@@ -864,6 +871,70 @@ class SdkSessionHelp extends Command {
864
871
  async run(): Promise<void> {}
865
872
  }
866
873
 
874
+ class SdkSpawnCommand extends Command {
875
+ static description = "Spawn a task-seeded background child session (local interactive master only).";
876
+ static flags = {
877
+ cwd: Flags.string({ description: "Working directory for the spawned child" }),
878
+ prompt: Flags.string({ description: "Seed task delivered once to the child" }),
879
+ model: Flags.string({ description: "Model selector for the child" }),
880
+ profile: Flags.string({ description: "Model profile name for the child" }),
881
+ "agent-dir": Flags.string({ description: "SDK broker state directory" }),
882
+ "idempotency-key": Flags.string({
883
+ description: "Idempotency key for replaying an uncertain session.spawn result",
884
+ }),
885
+ json: Flags.boolean({ description: "Render the safe spawn result as JSON" }),
886
+ };
887
+ async run(): Promise<void> {
888
+ const { flags } = await this.parse(SdkSpawnCommand);
889
+ try {
890
+ const spawn = await runSdkSpawn({
891
+ cwd: flags.cwd,
892
+ prompt: flags.prompt,
893
+ model: flags.model,
894
+ profile: flags.profile,
895
+ agentDir: flags["agent-dir"],
896
+ idempotencyKey: flags["idempotency-key"],
897
+ });
898
+ process.stdout.write(`${flags.json ? JSON.stringify(spawn.rendered) : renderSpawnTable(spawn.rendered)}\n`);
899
+ if (spawn.exitCode !== 0) process.exitCode = spawn.exitCode;
900
+ } catch (error) {
901
+ if (error instanceof SdkMasterCliError) {
902
+ process.stderr.write(`Error: ${error.code}: ${error.message}\n`);
903
+ process.exitCode = error.exitCode;
904
+ return;
905
+ }
906
+ throw error;
907
+ }
908
+ }
909
+ }
910
+
911
+ class SdkSearchCommand extends Command {
912
+ static description = "Search broker-visible SDK sessions within an exact repo, pwd, or global scope.";
913
+ static flags = {
914
+ "agent-dir": Flags.string({ description: "SDK broker state directory" }),
915
+ repo: Flags.string({ description: "Workspace directory for scope resolution (default: current directory)" }),
916
+ scope: Flags.string({ description: "Search scope: repo, pwd, or global (default: repo)" }),
917
+ limit: Flags.integer({ description: "Search page size from 1 to 100" }),
918
+ cursor: Flags.string({ description: "Frozen scoped search continuation cursor" }),
919
+ json: Flags.boolean({ description: "Render exactly the SdkSearchResultV1 JSON envelope" }),
920
+ };
921
+ async run(): Promise<void> {
922
+ const { flags } = await this.parse(SdkSearchCommand);
923
+ const scope = flags.scope;
924
+ if (scope !== undefined && scope !== "repo" && scope !== "pwd" && scope !== "global")
925
+ throw new CliParseError("--scope must be repo, pwd, or global.");
926
+ const search = await runSdkSearch({
927
+ agentDir: flags["agent-dir"],
928
+ repo: flags.repo,
929
+ scope,
930
+ limit: flags.limit,
931
+ cursor: flags.cursor,
932
+ });
933
+ process.stdout.write(`${flags.json ? JSON.stringify(search.result) : renderSdkSearchTable(search.result)}\n`);
934
+ if (search.exitCode !== 0) process.exitCode = search.exitCode;
935
+ }
936
+ }
937
+
867
938
  class SdkSessionCommand extends Command {
868
939
  static description = SdkSessionHelp.description;
869
940
  static args = SdkSessionHelp.args;
@@ -936,10 +1007,12 @@ class SdkGuidesCommand extends Command {
936
1007
 
937
1008
  export default class Sdk extends Command {
938
1009
  static description =
939
- "gjc sdk serve --stdio | --socket <path> [--session <id>]; gjc sdk session list|inspect|send|status|tail; gjc sdk guides refresh|list|show|status|trust";
1010
+ "gjc sdk serve --stdio | --socket <path> [--session <id>]; gjc sdk search [--scope repo|pwd|global] [--json] [--limit N] [--cursor ...]; gjc sdk spawn --cwd <dir> --prompt <task> (master only); gjc sdk session list|inspect|send|status|tail; gjc sdk guides refresh|list|show|status|trust";
940
1011
  static hidden = false;
941
1012
  static delegateHelp = true;
942
- static args = { action: Args.string({ required: false, options: ["serve", "session", "guides"] }) };
1013
+ static args = {
1014
+ action: Args.string({ required: false, options: ["serve", "search", "spawn", "session", "guides"] }),
1015
+ };
943
1016
  static flags = SdkServeHelp.flags;
944
1017
  async run(): Promise<void> {
945
1018
  const action = this.argv[0];
@@ -947,22 +1020,38 @@ export default class Sdk extends Command {
947
1020
  const helpAction =
948
1021
  action === "serve"
949
1022
  ? "sdk serve"
950
- : action === "session"
951
- ? "sdk session"
952
- : action === "guides"
953
- ? "sdk guides"
954
- : "sdk";
1023
+ : action === "search"
1024
+ ? "sdk search"
1025
+ : action === "spawn"
1026
+ ? "sdk spawn"
1027
+ : action === "session"
1028
+ ? "sdk session"
1029
+ : action === "guides"
1030
+ ? "sdk guides"
1031
+ : "sdk";
955
1032
  const helpCommand =
956
1033
  action === "serve"
957
1034
  ? SdkServeHelp
958
- : action === "session"
959
- ? SdkSessionCommand
960
- : action === "guides"
961
- ? SdkGuidesCommand
962
- : Sdk;
1035
+ : action === "search"
1036
+ ? SdkSearchCommand
1037
+ : action === "spawn"
1038
+ ? SdkSpawnCommand
1039
+ : action === "session"
1040
+ ? SdkSessionCommand
1041
+ : action === "guides"
1042
+ ? SdkGuidesCommand
1043
+ : Sdk;
963
1044
  renderCommandHelp("gjc", helpAction, helpCommand);
964
1045
  return;
965
1046
  }
1047
+ if (action === "search") {
1048
+ await new SdkSearchCommand(this.argv.slice(1), this.config).run();
1049
+ return;
1050
+ }
1051
+ if (action === "spawn") {
1052
+ await new SdkSpawnCommand(this.argv.slice(1), this.config).run();
1053
+ return;
1054
+ }
966
1055
  if (action === "session") {
967
1056
  await new SdkSessionCommand(this.argv.slice(1), this.config).run();
968
1057
  return;
@@ -976,7 +1065,7 @@ export default class Sdk extends Command {
976
1065
  return;
977
1066
  }
978
1067
  if (action !== "broker-internal" && action !== "session-host-internal")
979
- throw new CliParseError("Expected action to be serve, session, or guides.");
1068
+ throw new CliParseError("Expected action to be serve, search, spawn, session, or guides.");
980
1069
  const internal = parseSdkInternalArgv(this.argv);
981
1070
  if (internal.action === "session-host-internal") {
982
1071
  await runSessionHost();
@@ -985,6 +1074,9 @@ export default class Sdk extends Command {
985
1074
  const agentDir = internal.agentDir;
986
1075
  const broker = new Broker({
987
1076
  agentDir,
1077
+ masterOrphanGraceMs: (await Settings.loadForScope({ cwd: process.cwd(), agentDir })).get(
1078
+ "sdk.masterOrphanGraceMs",
1079
+ ),
988
1080
  resolveDirectoryMigration: async cwd => {
989
1081
  const settings = await Settings.loadForScope({ cwd, agentDir });
990
1082
  try {
@@ -360,8 +360,19 @@ export const TIER_MAP_SKIP_LIST = {
360
360
  "nvidia/thinkingmachines/inkling": { rationale: "post-rebase catalog addition from dev; not yet curated" },
361
361
  "nvidia/upstage/solar-10.7b-instruct": { rationale: "post-rebase catalog addition from dev; not yet curated" },
362
362
  "openai-codex/gpt-daybreak-blue-latest": { rationale: "post-rebase catalog addition from dev; not yet curated" },
363
+ "opencode-go/deepseek-v4-flash-vision-exp": {
364
+ rationale: "post-rebase catalog addition from dev; not yet curated",
365
+ },
366
+ "opencode-go/glm-5.3-flash": { rationale: "post-rebase catalog addition from dev; not yet curated" },
363
367
  "opencode-go/gpt-5.6-luna": { rationale: "post-rebase catalog addition from dev; not yet curated" },
368
+ "opencode-go/grok-4.6": { rationale: "post-rebase catalog addition from dev; not yet curated" },
364
369
  "opencode-go/hy3": { rationale: "post-rebase catalog addition from dev; not yet curated" },
370
+ "opencode-go/hy4-preview": { rationale: "post-rebase catalog addition from dev; not yet curated" },
371
+ "opencode-go/longcat-2.0": { rationale: "post-rebase catalog addition from dev; not yet curated" },
372
+ "opencode-go/muse-spark-1.2-contributor": {
373
+ rationale: "post-rebase catalog addition from dev; not yet curated",
374
+ },
375
+ "opencode-go/qwen3.8-flash": { rationale: "post-rebase catalog addition from dev; not yet curated" },
365
376
  "opencode-go/qwen3.8-max": { rationale: "post-rebase catalog addition from dev; not yet curated" },
366
377
  "opencode-zen/grok-4.6": { rationale: "post-rebase catalog addition from dev; not yet curated" },
367
378
  "opencode-zen/hy3-free": { rationale: "post-rebase catalog addition from dev; not yet curated" },
@@ -923,6 +934,7 @@ export const TIER_MAP_SKIP_LIST = {
923
934
  "anthropic/claude-3-5-sonnet-20241022": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
924
935
  "anthropic/claude-3-haiku-20240307": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
925
936
  "anthropic/claude-fable-5": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
937
+ "anthropic/claude-fable-5-1": { rationale: "post-feature catalog addition; not yet curated" },
926
938
  "anthropic/claude-haiku-4-5-20251001": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
927
939
  "anthropic/claude-opus-4-0": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
928
940
  "anthropic/claude-opus-4-1": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
@@ -5886,6 +5898,38 @@ export const TIER_MAP_SKIP_LIST = {
5886
5898
  "zenmux/z-ai/glm-5.2": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
5887
5899
  "zenmux/z-ai/glm-5.2-free": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
5888
5900
  "zenmux/z-ai/glm-5v-turbo": { baseline: true, rationale: "pre-feature baseline; not yet curated" },
5901
+ "kiro/auto": { rationale: "Kiro API-key catalog addition; not yet curated" },
5902
+ "kiro/claude-haiku-4-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5903
+ "kiro/claude-haiku-4.5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5904
+ "kiro/claude-opus-4-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5905
+ "kiro/claude-opus-4-6": { rationale: "Kiro API-key catalog addition; not yet curated" },
5906
+ "kiro/claude-opus-4-7": { rationale: "Kiro API-key catalog addition; not yet curated" },
5907
+ "kiro/claude-opus-4-8": { rationale: "Kiro API-key catalog addition; not yet curated" },
5908
+ "kiro/claude-opus-4.5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5909
+ "kiro/claude-opus-4.6": { rationale: "Kiro API-key catalog addition; not yet curated" },
5910
+ "kiro/claude-opus-4.7": { rationale: "Kiro API-key catalog addition; not yet curated" },
5911
+ "kiro/claude-opus-4.8": { rationale: "Kiro API-key catalog addition; not yet curated" },
5912
+ "kiro/claude-opus-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5913
+ "kiro/claude-sonnet-4": { rationale: "Kiro API-key catalog addition; not yet curated" },
5914
+ "kiro/claude-sonnet-4-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5915
+ "kiro/claude-sonnet-4-6": { rationale: "Kiro API-key catalog addition; not yet curated" },
5916
+ "kiro/claude-sonnet-4.5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5917
+ "kiro/claude-sonnet-4.6": { rationale: "Kiro API-key catalog addition; not yet curated" },
5918
+ "kiro/claude-sonnet-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5919
+ "kiro/deepseek-3-2": { rationale: "Kiro API-key catalog addition; not yet curated" },
5920
+ "kiro/deepseek-3.2": { rationale: "Kiro API-key catalog addition; not yet curated" },
5921
+ "kiro/glm-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5922
+ "kiro/gpt-5-6-luna": { rationale: "Kiro API-key catalog addition; not yet curated" },
5923
+ "kiro/gpt-5-6-sol": { rationale: "Kiro API-key catalog addition; not yet curated" },
5924
+ "kiro/gpt-5-6-terra": { rationale: "Kiro API-key catalog addition; not yet curated" },
5925
+ "kiro/gpt-5.6-luna": { rationale: "Kiro API-key catalog addition; not yet curated" },
5926
+ "kiro/gpt-5.6-sol": { rationale: "Kiro API-key catalog addition; not yet curated" },
5927
+ "kiro/gpt-5.6-terra": { rationale: "Kiro API-key catalog addition; not yet curated" },
5928
+ "kiro/minimax-m2-1": { rationale: "Kiro API-key catalog addition; not yet curated" },
5929
+ "kiro/minimax-m2-5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5930
+ "kiro/minimax-m2.1": { rationale: "Kiro API-key catalog addition; not yet curated" },
5931
+ "kiro/minimax-m2.5": { rationale: "Kiro API-key catalog addition; not yet curated" },
5932
+ "kiro/qwen3-coder-next": { rationale: "Kiro API-key catalog addition; not yet curated" },
5889
5933
  } as const satisfies TierMapSkipList;
5890
5934
 
5891
5935
  export const CURATED_TIER_MAP: AutoroutingCuratedTierMap = {
@@ -17,7 +17,7 @@ import type {
17
17
  } from "../gjc-runtime/gc-runtime";
18
18
  import { gcPidStatusLabel } from "../gjc-runtime/gc-runtime";
19
19
  import { resolveReceiptSpoolDir } from "../harness-control-plane/receipt-spool";
20
- import { readFileLockInfoForGc, removeFileLockDirForGc } from "./file-lock";
20
+ import { readFileLockObservationForGc, removeFileLockDirForGc } from "./file-lock";
21
21
 
22
22
  const MAX_WALK_DEPTH = 6;
23
23
  /** Default per-root walk budget. Truncation is a warning, not a hard error. */
@@ -68,7 +68,8 @@ function keptMalformedRecord(lockDir: string): GcRecord {
68
68
  }
69
69
 
70
70
  async function collectLockRecord(lockDir: string, ctx: GcContext): Promise<GcRecord> {
71
- const info = await readFileLockInfoForGc(lockDir);
71
+ const observation = await readFileLockObservationForGc(lockDir);
72
+ const info = observation?.info;
72
73
  if (!info) return keptMalformedRecord(lockDir);
73
74
  if (info.owner_host_id !== undefined) {
74
75
  return {
@@ -203,7 +204,8 @@ export const fileLocksGcAdapter: GcStoreAdapter = {
203
204
  },
204
205
  async prune(record: GcRecord, ctx: GcContext): Promise<GcPruneOutcome> {
205
206
  const lockDir = record.path ?? record.id;
206
- const info = await readFileLockInfoForGc(lockDir);
207
+ const observation = await readFileLockObservationForGc(lockDir);
208
+ const info = observation?.info;
207
209
  if (!info) return { removed: false, skipped: "lock_no_longer_dead_or_missing" };
208
210
  if (info.owner_host_id !== undefined) {
209
211
  return { removed: false, skipped: "host_qualified_lock_requires_owner_reclamation" };
@@ -220,13 +222,16 @@ export const fileLocksGcAdapter: GcStoreAdapter = {
220
222
  // so removal re-verifies the on-disk identity under the unlink and refuses
221
223
  // to delete a recreated LIVE lock (TOCTOU).
222
224
  try {
223
- const removal = await removeFileLockDirForGc(lockDir, info);
225
+ const removal = await removeFileLockDirForGc(lockDir, info, observation?.identity);
224
226
  if (removal === "owner_changed") {
225
227
  return { removed: false, skipped: "file_lock_owner_changed_before_delete" };
226
228
  }
227
229
  if (removal === "missing") {
228
230
  return { removed: false, skipped: "lock_no_longer_dead_or_missing" };
229
231
  }
232
+ if (removal === "cleanup_failed") {
233
+ return { removed: false, skipped: "lock_removal_denied_by_native_identity_guard" };
234
+ }
230
235
  return { removed: true };
231
236
  } catch (error) {
232
237
  return { removed: false, error: errorMessage(error) };