pi-cowboy 0.17.2 → 0.19.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 (326) hide show
  1. package/README.md +3 -3
  2. package/dist/agents/agent-assets.d.ts +0 -57
  3. package/dist/agents/agent-cleanup.d.ts +0 -25
  4. package/dist/agents/agent-discovery.d.ts +0 -15
  5. package/dist/agents/agent-host.d.ts +2 -121
  6. package/dist/agents/agent-manager.d.ts +0 -54
  7. package/dist/agents/agent-reviver.d.ts +0 -23
  8. package/dist/agents/agent-runner.d.ts +0 -24
  9. package/dist/agents/agent-spawn-store.d.ts +0 -26
  10. package/dist/agents/agent-template.d.ts +5 -9
  11. package/dist/agents/agent-types.d.ts +0 -22
  12. package/dist/agents/batch.d.ts +0 -35
  13. package/dist/agents/cleanup-policy.d.ts +1 -90
  14. package/dist/agents/cleanup-report.d.ts +0 -9
  15. package/dist/agents/default-agents.d.ts +0 -6
  16. package/dist/agents/harness/claude/index.d.ts +0 -38
  17. package/dist/agents/harness/claude/staging.d.ts +0 -39
  18. package/dist/agents/harness/codex.d.ts +0 -40
  19. package/dist/agents/harness/harness-registry.d.ts +8 -103
  20. package/dist/agents/harness/opencode/config.d.ts +0 -30
  21. package/dist/agents/harness/opencode/definition.d.ts +0 -12
  22. package/dist/agents/harness/opencode/index.d.ts +1 -31
  23. package/dist/agents/harness/opencode/permissions.d.ts +0 -20
  24. package/dist/agents/harness/opencode/staging.d.ts +0 -36
  25. package/dist/agents/harness/opencode/user-config.d.ts +0 -29
  26. package/dist/agents/harness/opencode/version.d.ts +2 -24
  27. package/dist/agents/harness/pane-launcher.d.ts +0 -72
  28. package/dist/agents/harness/pi-bolt.d.ts +0 -8
  29. package/dist/agents/harness/pi-compatible.d.ts +0 -39
  30. package/dist/agents/harness/pig.d.ts +0 -9
  31. package/dist/agents/harness.d.ts +26 -323
  32. package/dist/agents/multiplexer-registry.d.ts +0 -82
  33. package/dist/agents/result-file-permissions.d.ts +0 -15
  34. package/dist/agents/run-state.d.ts +0 -64
  35. package/dist/agents/schemas/cleanup-batch.schema.d.ts +0 -12
  36. package/dist/agents/schemas/cowboy-agents.schema.d.ts +0 -30
  37. package/dist/agents/schemas/merge-batch.schema.d.ts +0 -14
  38. package/dist/agents/schemas/steer-batch.schema.d.ts +0 -13
  39. package/dist/agents/schemas/stop-batch.schema.d.ts +0 -11
  40. package/dist/agents/spawn-defaults.d.ts +0 -37
  41. package/dist/agents/subagent-session.d.ts +1 -80
  42. package/dist/agents/tool-cleanup.d.ts +0 -24
  43. package/dist/agents/tool-execution.d.ts +0 -31
  44. package/dist/agents/tool-merge.d.ts +0 -27
  45. package/dist/agents/tool-result.d.ts +0 -12
  46. package/dist/agents/tool-steer.d.ts +1 -21
  47. package/dist/agents/types.d.ts +4 -58
  48. package/dist/availability.d.ts +0 -31
  49. package/dist/chunk-6YO5MFLJ.js +15 -0
  50. package/dist/chunk-C4LB3YEQ.js +2 -0
  51. package/dist/chunk-DPYRC7JC.js +10 -0
  52. package/dist/chunk-OBX2DB6I.js +2 -0
  53. package/dist/chunk-OO54ZZLJ.js +2 -0
  54. package/dist/chunk-VHFNXQY4.js +24 -0
  55. package/dist/concurrency-pools.d.ts +0 -108
  56. package/dist/config/concurrency-limit.d.ts +0 -8
  57. package/dist/config/config-io.d.ts +0 -20
  58. package/dist/config/config-store.d.ts +22 -93
  59. package/dist/config/config-validation.d.ts +0 -3
  60. package/dist/config/layered-config.d.ts +0 -27
  61. package/dist/config/types.d.ts +7 -6
  62. package/dist/cow-support-launch.d.ts +0 -15
  63. package/dist/events.d.ts +0 -7
  64. package/dist/extension-toggle.d.ts +0 -9
  65. package/dist/harness-availability-launch.d.ts +0 -37
  66. package/dist/host-multiplexer.d.ts +0 -36
  67. package/dist/index.d.ts +0 -8
  68. package/dist/index.js +33 -54
  69. package/dist/infrastructure/exec-path.d.ts +0 -11
  70. package/dist/infrastructure/exec-sync.d.ts +0 -17
  71. package/dist/infrastructure/git/cow-clone.d.ts +0 -60
  72. package/dist/infrastructure/git/git-materializer.d.ts +3 -109
  73. package/dist/infrastructure/git/git-merger.d.ts +0 -74
  74. package/dist/infrastructure/git/git-retention.d.ts +0 -15
  75. package/dist/infrastructure/git/git-runner.d.ts +0 -53
  76. package/dist/infrastructure/git/git-worktree.d.ts +4 -57
  77. package/dist/infrastructure/git/index.d.ts +0 -6
  78. package/dist/infrastructure/git-client.d.ts +0 -10
  79. package/dist/infrastructure/herdr/agent-stopper.d.ts +0 -19
  80. package/dist/infrastructure/herdr/agents.d.ts +0 -77
  81. package/dist/infrastructure/herdr/herdr-client.d.ts +0 -10
  82. package/dist/infrastructure/herdr/herdr-transport.d.ts +0 -33
  83. package/dist/infrastructure/herdr/index.d.ts +0 -8
  84. package/dist/infrastructure/herdr/panes.d.ts +0 -45
  85. package/dist/infrastructure/herdr/polling.d.ts +0 -22
  86. package/dist/infrastructure/herdr/worktrees.d.ts +0 -14
  87. package/dist/infrastructure/herdr-client.d.ts +0 -5
  88. package/dist/infrastructure/herdr-host.d.ts +0 -7
  89. package/dist/logger.d.ts +0 -4
  90. package/dist/menu-worktree-command-JOT3F3SK.js +3 -0
  91. package/dist/menus-QMIIYRHM.js +9 -0
  92. package/dist/model-picker-EU2MA3II.js +2 -0
  93. package/dist/models/foreign-model-resolver.d.ts +3 -33
  94. package/dist/models/model-groups.d.ts +23 -31
  95. package/dist/models/model-precedence.d.ts +26 -80
  96. package/dist/models/model-request-types.d.ts +14 -27
  97. package/dist/models/model-request.d.ts +3 -34
  98. package/dist/models/pi-model-resolver.d.ts +7 -30
  99. package/dist/models/thinking-offering.d.ts +19 -0
  100. package/dist/orchestrators/briefing-section.d.ts +0 -8
  101. package/dist/orchestrators/context.d.ts +0 -57
  102. package/dist/orchestrators/cues.d.ts +0 -19
  103. package/dist/orchestrators/default-orchestrators.d.ts +0 -8
  104. package/dist/orchestrators/orchestrator-discovery.d.ts +0 -20
  105. package/dist/orchestrators/orchestrator-template.d.ts +0 -10
  106. package/dist/orchestrators/orchestrator-types.d.ts +0 -15
  107. package/dist/orchestrators/protocol.d.ts +4 -74
  108. package/dist/orchestrators/types.d.ts +0 -10
  109. package/dist/paths.d.ts +0 -34
  110. package/dist/pi-settings.d.ts +0 -1
  111. package/dist/plugin/contract.d.ts +0 -43
  112. package/dist/plugin/discovery.d.ts +0 -47
  113. package/dist/plugin/index.d.ts +2 -14
  114. package/dist/plugin/index.js +2 -14
  115. package/dist/plugin/loader.d.ts +0 -36
  116. package/dist/plugin/manifest.d.ts +0 -20
  117. package/dist/predicates.d.ts +0 -16
  118. package/dist/prompt/prompts.d.ts +0 -21
  119. package/dist/prompt/skill-loader.d.ts +0 -15
  120. package/dist/prompt/subagent-system-prompt.d.ts +0 -30
  121. package/dist/registration.d.ts +0 -25
  122. package/dist/session-runtime.d.ts +0 -30
  123. package/dist/shell.d.ts +7 -84
  124. package/dist/spawn/cow-support.d.ts +0 -21
  125. package/dist/spawn/crockford-base32.d.ts +0 -12
  126. package/dist/spawn/herdr-launcher.d.ts +0 -14
  127. package/dist/spawn/repo-lock.d.ts +0 -17
  128. package/dist/spawn/sandbox.d.ts +0 -60
  129. package/dist/spawn/spawn-coordinator.d.ts +0 -45
  130. package/dist/spawn/spawn-id.d.ts +0 -15
  131. package/dist/spawn/worktree-policy.d.ts +0 -48
  132. package/dist/status-note.d.ts +0 -5
  133. package/dist/subagent/deliverable.d.ts +0 -28
  134. package/dist/subagent/pane-supervisor.d.ts +0 -16
  135. package/dist/subagent/result-artifacts.d.ts +0 -15
  136. package/dist/subagent/supervisor.d.ts +0 -97
  137. package/dist/task-registry.d.ts +0 -34
  138. package/dist/templates/template-files.d.ts +0 -25
  139. package/dist/types.d.ts +26 -127
  140. package/dist/ui/action-report.d.ts +0 -17
  141. package/dist/ui/format.d.ts +0 -8
  142. package/dist/ui/indicator.d.ts +0 -140
  143. package/dist/ui/menu/helpers.d.ts +0 -54
  144. package/dist/ui/menu/menu-agent-settings.d.ts +0 -6
  145. package/dist/ui/menu/menu-agent-status-cleanup.d.ts +0 -24
  146. package/dist/ui/menu/menu-agent-status.d.ts +0 -14
  147. package/dist/ui/menu/menu-concurrency.d.ts +1 -6
  148. package/dist/ui/menu/menu-model-settings.d.ts +1 -16
  149. package/dist/ui/menu/menu-spawn-defaults.d.ts +0 -9
  150. package/dist/ui/menu/menu-spawn-options.d.ts +15 -0
  151. package/dist/ui/menu/menu-spawn-wizard.d.ts +0 -4
  152. package/dist/ui/menu/menu-spawn-worktree.d.ts +0 -23
  153. package/dist/ui/menu/menu-system-prompt.d.ts +0 -4
  154. package/dist/ui/menu/menu-worktree-command.d.ts +0 -15
  155. package/dist/ui/menu/menus.d.ts +0 -15
  156. package/dist/ui/menu/model-pairing.d.ts +19 -0
  157. package/dist/ui/menu/model-picker.d.ts +0 -12
  158. package/dist/ui/menu/screen-host.d.ts +0 -50
  159. package/dist/ui/menu/spawn-choice.d.ts +36 -0
  160. package/dist/ui/menu/submenus/confirm.d.ts +0 -10
  161. package/dist/ui/menu/submenus/model-select.d.ts +18 -17
  162. package/dist/ui/menu/submenus/name-field.d.ts +0 -19
  163. package/dist/ui/menu/submenus/numeric-input.d.ts +0 -4
  164. package/dist/ui/menu/submenus/target-select.d.ts +2 -45
  165. package/dist/ui/menu/submenus/text-editor.d.ts +0 -21
  166. package/dist/ui/menu/submenus/thinking-select.d.ts +13 -0
  167. package/dist/ui/menu/submenus/worktree-command-name.d.ts +0 -19
  168. package/dist/ui/menu/submenus/worktree-name.d.ts +0 -18
  169. package/dist/ui/menu/wrappers/settings-list.d.ts +0 -13
  170. package/dist/ui/searchable-select.d.ts +0 -8
  171. package/dist/ui/types.d.ts +0 -1
  172. package/dist/utils.d.ts +3 -26
  173. package/package.json +5 -3
  174. package/dist/agents/agent-assets.js +0 -278
  175. package/dist/agents/agent-cleanup.js +0 -323
  176. package/dist/agents/agent-discovery.js +0 -118
  177. package/dist/agents/agent-host.js +0 -13
  178. package/dist/agents/agent-manager.js +0 -325
  179. package/dist/agents/agent-reviver.js +0 -59
  180. package/dist/agents/agent-runner.js +0 -321
  181. package/dist/agents/agent-spawn-store.js +0 -57
  182. package/dist/agents/agent-template.js +0 -152
  183. package/dist/agents/agent-types.js +0 -159
  184. package/dist/agents/batch.js +0 -92
  185. package/dist/agents/cleanup-policy.js +0 -218
  186. package/dist/agents/cleanup-report.js +0 -135
  187. package/dist/agents/default-agents.js +0 -19
  188. package/dist/agents/harness/claude/index.js +0 -263
  189. package/dist/agents/harness/claude/staging.js +0 -103
  190. package/dist/agents/harness/codex.js +0 -250
  191. package/dist/agents/harness/harness-registry.js +0 -272
  192. package/dist/agents/harness/opencode/config.js +0 -85
  193. package/dist/agents/harness/opencode/definition.js +0 -63
  194. package/dist/agents/harness/opencode/index.js +0 -297
  195. package/dist/agents/harness/opencode/permissions.js +0 -48
  196. package/dist/agents/harness/opencode/staging.js +0 -72
  197. package/dist/agents/harness/opencode/user-config.js +0 -172
  198. package/dist/agents/harness/opencode/version.js +0 -43
  199. package/dist/agents/harness/pane-launcher.js +0 -97
  200. package/dist/agents/harness/pi-bolt.js +0 -14
  201. package/dist/agents/harness/pi-compatible.js +0 -112
  202. package/dist/agents/harness/pig.js +0 -15
  203. package/dist/agents/harness.js +0 -99
  204. package/dist/agents/multiplexer-registry.js +0 -125
  205. package/dist/agents/result-file-permissions.js +0 -29
  206. package/dist/agents/run-state.js +0 -270
  207. package/dist/agents/schemas/cleanup-batch.schema.js +0 -19
  208. package/dist/agents/schemas/cowboy-agents.schema.js +0 -50
  209. package/dist/agents/schemas/merge-batch.schema.js +0 -25
  210. package/dist/agents/schemas/steer-batch.schema.js +0 -22
  211. package/dist/agents/schemas/stop-batch.schema.js +0 -18
  212. package/dist/agents/spawn-defaults.js +0 -113
  213. package/dist/agents/subagent-session.js +0 -578
  214. package/dist/agents/tool-cleanup.js +0 -57
  215. package/dist/agents/tool-execution.js +0 -132
  216. package/dist/agents/tool-merge.js +0 -190
  217. package/dist/agents/tool-result.js +0 -17
  218. package/dist/agents/tool-steer.js +0 -89
  219. package/dist/agents/types.js +0 -1
  220. package/dist/availability.js +0 -45
  221. package/dist/concurrency-pools.js +0 -272
  222. package/dist/config/concurrency-limit.js +0 -14
  223. package/dist/config/config-io.js +0 -270
  224. package/dist/config/config-store.js +0 -487
  225. package/dist/config/config-validation.js +0 -280
  226. package/dist/config/layered-config.js +0 -121
  227. package/dist/config/types.js +0 -25
  228. package/dist/cow-support-launch.js +0 -43
  229. package/dist/events.js +0 -204
  230. package/dist/extension-toggle.js +0 -28
  231. package/dist/harness-availability-launch.js +0 -85
  232. package/dist/host-multiplexer.js +0 -62
  233. package/dist/infrastructure/exec-path.js +0 -35
  234. package/dist/infrastructure/exec-sync.js +0 -30
  235. package/dist/infrastructure/git/cow-clone.js +0 -406
  236. package/dist/infrastructure/git/git-materializer.js +0 -342
  237. package/dist/infrastructure/git/git-merger.js +0 -234
  238. package/dist/infrastructure/git/git-retention.js +0 -43
  239. package/dist/infrastructure/git/git-runner.js +0 -173
  240. package/dist/infrastructure/git/git-worktree.js +0 -145
  241. package/dist/infrastructure/git/index.js +0 -11
  242. package/dist/infrastructure/git-client.js +0 -11
  243. package/dist/infrastructure/herdr/agent-stopper.js +0 -60
  244. package/dist/infrastructure/herdr/agents.js +0 -330
  245. package/dist/infrastructure/herdr/herdr-client.js +0 -36
  246. package/dist/infrastructure/herdr/herdr-transport.js +0 -158
  247. package/dist/infrastructure/herdr/index.js +0 -15
  248. package/dist/infrastructure/herdr/panes.js +0 -174
  249. package/dist/infrastructure/herdr/polling.js +0 -44
  250. package/dist/infrastructure/herdr/worktrees.js +0 -76
  251. package/dist/infrastructure/herdr-client.js +0 -6
  252. package/dist/infrastructure/herdr-host.js +0 -214
  253. package/dist/logger.js +0 -77
  254. package/dist/models/foreign-model-resolver.js +0 -55
  255. package/dist/models/model-groups.js +0 -74
  256. package/dist/models/model-precedence.js +0 -90
  257. package/dist/models/model-request-types.js +0 -46
  258. package/dist/models/model-request.js +0 -39
  259. package/dist/models/pi-model-resolver.js +0 -88
  260. package/dist/orchestrators/briefing-section.js +0 -14
  261. package/dist/orchestrators/context.js +0 -122
  262. package/dist/orchestrators/cues.js +0 -90
  263. package/dist/orchestrators/default-orchestrators.js +0 -41
  264. package/dist/orchestrators/orchestrator-discovery.js +0 -68
  265. package/dist/orchestrators/orchestrator-template.js +0 -43
  266. package/dist/orchestrators/orchestrator-types.js +0 -78
  267. package/dist/orchestrators/protocol.js +0 -325
  268. package/dist/orchestrators/types.js +0 -7
  269. package/dist/paths.js +0 -104
  270. package/dist/pi-settings.js +0 -7
  271. package/dist/plugin/contract.js +0 -17
  272. package/dist/plugin/discovery.js +0 -67
  273. package/dist/plugin/loader.js +0 -181
  274. package/dist/plugin/manifest.js +0 -47
  275. package/dist/predicates.js +0 -25
  276. package/dist/prompt/prompts.js +0 -110
  277. package/dist/prompt/skill-loader.js +0 -153
  278. package/dist/prompt/subagent-system-prompt.js +0 -180
  279. package/dist/registration.js +0 -246
  280. package/dist/session-runtime.js +0 -92
  281. package/dist/shell.js +0 -223
  282. package/dist/spawn/cow-support.js +0 -53
  283. package/dist/spawn/crockford-base32.js +0 -252
  284. package/dist/spawn/herdr-launcher.js +0 -80
  285. package/dist/spawn/repo-lock.js +0 -34
  286. package/dist/spawn/sandbox.js +0 -289
  287. package/dist/spawn/spawn-coordinator.js +0 -257
  288. package/dist/spawn/spawn-id.js +0 -39
  289. package/dist/spawn/worktree-policy.js +0 -137
  290. package/dist/status-note.js +0 -30
  291. package/dist/subagent/deliverable.js +0 -40
  292. package/dist/subagent/pane-supervisor.js +0 -15
  293. package/dist/subagent/result-artifacts.js +0 -25
  294. package/dist/subagent/supervisor.js +0 -317
  295. package/dist/task-registry.js +0 -112
  296. package/dist/templates/template-files.js +0 -88
  297. package/dist/types.js +0 -77
  298. package/dist/ui/action-report.js +0 -21
  299. package/dist/ui/format.js +0 -54
  300. package/dist/ui/indicator.js +0 -495
  301. package/dist/ui/menu/helpers.js +0 -245
  302. package/dist/ui/menu/menu-agent-settings.js +0 -191
  303. package/dist/ui/menu/menu-agent-status-cleanup.js +0 -203
  304. package/dist/ui/menu/menu-agent-status.js +0 -364
  305. package/dist/ui/menu/menu-concurrency.js +0 -410
  306. package/dist/ui/menu/menu-model-settings.js +0 -330
  307. package/dist/ui/menu/menu-spawn-defaults.js +0 -73
  308. package/dist/ui/menu/menu-spawn-wizard.js +0 -371
  309. package/dist/ui/menu/menu-spawn-worktree.js +0 -107
  310. package/dist/ui/menu/menu-system-prompt.js +0 -104
  311. package/dist/ui/menu/menu-worktree-command.js +0 -150
  312. package/dist/ui/menu/menus.js +0 -187
  313. package/dist/ui/menu/model-picker.js +0 -175
  314. package/dist/ui/menu/screen-host.js +0 -87
  315. package/dist/ui/menu/submenus/confirm.js +0 -60
  316. package/dist/ui/menu/submenus/model-select.js +0 -39
  317. package/dist/ui/menu/submenus/name-field.js +0 -43
  318. package/dist/ui/menu/submenus/numeric-input.js +0 -61
  319. package/dist/ui/menu/submenus/target-select.js +0 -129
  320. package/dist/ui/menu/submenus/text-editor.js +0 -49
  321. package/dist/ui/menu/submenus/worktree-command-name.js +0 -73
  322. package/dist/ui/menu/submenus/worktree-name.js +0 -53
  323. package/dist/ui/menu/wrappers/settings-list.js +0 -101
  324. package/dist/ui/searchable-select.js +0 -147
  325. package/dist/ui/types.js +0 -1
  326. package/dist/utils.js +0 -80
@@ -1,10 +1,3 @@
1
- /**
2
- * agent-template.ts — The Zod schema for one agent template file.
3
- *
4
- * Single source of truth for the `.toml` format: snake_case keys, values
5
- * typed exactly as written, unknown keys rejected so typos fail at load.
6
- * The type derives via `z.infer`.
7
- */
8
1
  import { z } from "zod";
9
2
  import type { HarnessFamily } from "./harness.js";
10
3
  import type { ToolFilter } from "./types.js";
@@ -63,17 +56,18 @@ export declare const AgentTemplateSchema: z.ZodObject<{
63
56
  }, z.core.$strict>>;
64
57
  codex: z.ZodOptional<z.ZodObject<{
65
58
  model: z.ZodOptional<z.ZodString>;
59
+ thinking: z.ZodOptional<z.ZodString>;
66
60
  }, z.core.$strict>>;
67
61
  claude: z.ZodOptional<z.ZodObject<{
68
62
  model: z.ZodOptional<z.ZodString>;
63
+ thinking: z.ZodOptional<z.ZodString>;
69
64
  tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
70
65
  exclude_tools: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
66
  }, z.core.$strict>>;
72
67
  }, z.core.$strict>, z.ZodTransform<{
68
+ thinkingByFamily?: Partial<Record<HarnessFamily, string>> | undefined;
73
69
  toolsByFamily?: Partial<Record<HarnessFamily, ToolFilter>> | undefined;
74
70
  modelsByFamily?: Partial<Record<HarnessFamily, string>> | undefined;
75
- variant?: string | undefined;
76
- thinking?: "off" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | undefined;
77
71
  extensions?: boolean | string[] | undefined;
78
72
  skills?: boolean | string[] | undefined;
79
73
  inlined_skills?: string[] | undefined;
@@ -107,9 +101,11 @@ export declare const AgentTemplateSchema: z.ZodObject<{
107
101
  } | undefined;
108
102
  codex?: {
109
103
  model?: string | undefined;
104
+ thinking?: string | undefined;
110
105
  } | undefined;
111
106
  claude?: {
112
107
  model?: string | undefined;
108
+ thinking?: string | undefined;
113
109
  tools?: string[] | undefined;
114
110
  exclude_tools?: string[] | undefined;
115
111
  } | undefined;
@@ -1,17 +1,7 @@
1
- /**
2
- * agent-types.ts — Unified agent type registry.
3
- *
4
- * Precedence: default < extension < user < shared < project. Hidden agents
5
- * stay registered but are excluded from spawning.
6
- *
7
- * The registry is session state; it lives in the shell and is read and written
8
- * here through the shell getters.
9
- */
10
1
  import type { AgentConfig } from "./types.js";
11
2
  interface RegisterAgentsOptions {
12
3
  disableDefaultAgents?: boolean;
13
4
  }
14
- /** Warning sink for unloadable agent files; injected so the scan layer stays shell-free. */
15
5
  type DiscoveryNotify = (message: string, kind: "warning") => void;
16
6
  export declare function registerAgents(userAgents: Map<string, AgentConfig>, options?: RegisterAgentsOptions): void;
17
7
  export declare function setAgentScanDirs(userDir: string, projectDir: string, sharedDir?: string): void;
@@ -19,21 +9,10 @@ export declare function scanAndMerge(options?: {
19
9
  disableDefaultAgents?: boolean;
20
10
  notify?: DiscoveryNotify;
21
11
  }): Promise<Map<string, AgentConfig>>;
22
- /** Worktree agents follow the parent project's uniqueness rules. */
23
12
  export declare function discoverNewAgents(worktreeDir?: string, options?: {
24
13
  disableDefaultAgents?: boolean;
25
14
  notify?: DiscoveryNotify;
26
15
  }): Promise<number>;
27
- /**
28
- * Result of resolving a type name against the registry.
29
- *
30
- * - resolved: exact match, or one case-insensitive match (key is canonical).
31
- * - ambiguous: several names differ only by case; never a silent pick.
32
- * - not-found: nothing matches, even after case folding.
33
- *
34
- * Only registered names resolve (displayName is display-only). Hidden agents
35
- * still resolve by name.
36
- */
37
16
  type TypeResolution = {
38
17
  kind: "resolved";
39
18
  key: string;
@@ -44,7 +23,6 @@ type TypeResolution = {
44
23
  kind: "not-found";
45
24
  };
46
25
  export declare function resolveType(name: string): TypeResolution;
47
- /** Resolve a type, discovering from worktreeDir on miss. Trust/validation checks stay in the caller. */
48
26
  export declare function resolveTypeOrDiscover(type: string, worktreeDir?: string, notify?: DiscoveryNotify): Promise<TypeResolution>;
49
27
  export declare function getAgentConfig(name: string): AgentConfig | undefined;
50
28
  export declare function getAvailableTypes(): string[];
@@ -1,38 +1,14 @@
1
- /**
2
- * batch.ts — the batch pipeline every Cowboy batch tool runs.
3
- *
4
- * A batch tool handles one or more items of the same kind, and the sequence is
5
- * the same for all of them: reject a repeated key before touching anything, run
6
- * the tool's remaining whole-call guards, handle the items one at a time in
7
- * input order, and return one text block per item next to the per-item
8
- * outcomes. A tool supplies only its own parts — which parameter it walks, the
9
- * per-item work, and the rule for a halted batch.
10
- */
11
1
  import { type ToolResult } from "./tool-result.js";
12
- /** Between the per-item blocks of a batch result: one batch reads as one document of item blocks. */
13
2
  export declare const BATCH_ITEM_SEPARATOR = "\n\n---\n\n";
14
- /** The array parameter a batch walks. */
15
3
  export type BatchParam = "agent_ids" | "branches";
16
- /** One handled item: its outcome for `details`, and the text block for its slot in the batch text. */
17
4
  export interface BatchItem<TOutcome> {
18
5
  outcome: TOutcome;
19
6
  text: string;
20
7
  }
21
- /** One item an outcome halted the batch on, and how every later item is skipped. */
22
8
  type HaltRule<TOutcome, TUnit> = {
23
9
  on: (outcome: TOutcome) => boolean;
24
10
  skip: (item: string, haltedBy: string) => TUnit;
25
11
  };
26
- /**
27
- * How a tool produces one item's block. Usually the block reads off the outcome
28
- * alone, and `render` says how; where it carries per-item state the outcome
29
- * does not — steer's pre-delivery status, merge's raw git message and
30
- * outside-repo banner — the handler pairs the outcome with its block instead.
31
- *
32
- * The pairing shape comes first because inference does not revisit a union
33
- * member: a pairing tool's spec has to be matched against it before the
34
- * renderer's `handleItem`, which would otherwise pin the outcome to the pair.
35
- */
36
12
  type ItemHandler<TOutcome> = {
37
13
  handleItem: (item: string) => Promise<BatchItem<TOutcome>>;
38
14
  halt?: HaltRule<TOutcome, BatchItem<TOutcome>>;
@@ -41,23 +17,12 @@ type ItemHandler<TOutcome> = {
41
17
  handleItem: (item: string) => Promise<TOutcome>;
42
18
  halt?: HaltRule<TOutcome, TOutcome>;
43
19
  };
44
- /** One batch tool's own parts of the pipeline. */
45
20
  export type BatchSpec<TOutcome, TKey extends string> = ItemHandler<TOutcome> & {
46
- /** Tool name as the model sees it, which opens the duplicate-key error. */
47
21
  toolName: string;
48
- /** The parameter the tool walks, e.g. `agent_ids`. */
49
22
  param: BatchParam;
50
- /** The whole call's items, in input order. */
51
23
  items: readonly string[];
52
- /** The `details` key the outcomes are returned under, e.g. `agents`. */
53
24
  detailsKey: TKey;
54
- /** The tool's whole-call guards beyond the duplicate check; runs before the first item, so a refusal mutates nothing. */
55
25
  prepare?: () => void | Promise<void>;
56
26
  };
57
- /**
58
- * Runs one batch: the duplicate-key guard, the tool's remaining guards, then
59
- * the items sequentially in input order. Each item contributes exactly one
60
- * outcome and one text block, so `details` and the text always line up.
61
- */
62
27
  export declare function runBatch<TOutcome, TKey extends string>(spec: BatchSpec<TOutcome, TKey>): Promise<ToolResult<Record<TKey, TOutcome[]>>>;
63
28
  export {};
@@ -1,35 +1,20 @@
1
- /**
2
- * cleanup-policy.ts — pure cleanup decisions (no I/O).
3
- * Located artifacts: LocatedWorktree/LocatedPane/LocatedArtifacts.
4
- * Plan: CleanupPlan/planRecovered. Gate: GateOutcome/assessRemovability.
5
- * Settlement: SettlementVerdict/recordedSettlement/recoveryGate/recoveryRefusalReason.
6
- * Report: CleanupReport/keptReport/ambiguousReport/assembleReport/forcedFields/isForceableRefusal/shouldDropSpawn.
7
- * Removal: RemovalOutcomes/RemovablePlan/WorktreeRemovalMechanism/PaneDisposition/removalMechanismOf/paneDispositionFor.
8
- * Probes: WorktreeDirtyProbe. Options: CleanupOptions. Source: CleanupSource. Basis: DiscoveryBasis.
9
- */
10
1
  import type { ActivePhase, AgentPhase, AgentSpawn, WorktreeRetentionReason } from "../types.js";
11
2
  import type { BranchCleanupResult } from "../infrastructure/git-client.js";
12
3
  import type { HostObservation } from "./agent-host.js";
13
- /** Refusal for a live run: cleanup never stops an agent (a stale registry entry is not evidence work is over; see stop_cowboy_agent). */
14
4
  type AgentActiveReason = {
15
5
  kind: "agent-active";
16
6
  phase: ActivePhase;
17
7
  };
18
- /** Refusal for a recovered run: pane still `working`, or unreadable (never evidence the run is over); basis says which. */
19
8
  type RecoveredRefusalReason = {
20
9
  kind: "recovered-refusal";
21
10
  basis: DiscoveryBasis;
22
11
  };
23
- /** Refusal for a contested id: cleanup picks neither artifact, the report lists both. */
24
12
  type AmbiguousArtifactsReason = {
25
13
  kind: "ambiguous-artifacts";
26
14
  candidates: readonly string[];
27
15
  };
28
- /** Why a worktree was kept instead of removed. */
29
16
  export type WorktreeKeptReason = WorktreeRetentionReason | AgentActiveReason | RecoveredRefusalReason | AmbiguousArtifactsReason;
30
- /** Artifact provenance: `tracked` (spawn record named them) or `recovered` (discovery found them). */
31
17
  export type CleanupSource = "tracked" | "recovered";
32
- /** What the multiplexer's live read showed for a recovered run (`forced` is the operator override). */
33
18
  export type DiscoveryBasis = {
34
19
  kind: "pane-absent";
35
20
  } | {
@@ -45,33 +30,21 @@ export type DiscoveryBasis = {
45
30
  } | {
46
31
  kind: "artifacts-ambiguous";
47
32
  };
48
- /** Recovered run's deliverable; reported, never deleted (nobody has read it). */
49
33
  export interface RecoveredDeliverable {
50
34
  path: string;
51
- /** Whether a deliverable was actually written (an agent may have died first). */
52
35
  present: boolean;
53
36
  }
54
- /** The tracked-path verdict: memory's recorded lifecycle phase is the answer. */
55
37
  interface RecordedSettlement {
56
38
  kind: "recorded";
57
39
  phase: AgentPhase;
58
40
  }
59
- /** Recovered-path verdict: the multiplexer's live read plus the unread deliverable. */
60
41
  interface DiscoveredSettlement {
61
42
  kind: "discovered";
62
43
  basis: DiscoveryBasis;
63
44
  deliverable: RecoveredDeliverable;
64
45
  }
65
- /** How cleanup established the run is over: `recorded` (memory is the only settlement witness) or `discovered` (the multiplexer's live read + unread deliverable). */
66
46
  export type SettlementVerdict = RecordedSettlement | DiscoveredSettlement;
67
47
  export declare function recordedSettlement(spawn: AgentSpawn): RecordedSettlement;
68
- /**
69
- * What cleanup reports for the run's pane. `open` is stated only for a pane
70
- * the seam observed live; `gone` is stated only for an address the multiplexer no
71
- * longer answers (never `closed`: the extension did not close it);
72
- * `unknown` is stated only when the read itself failed (never evidence
73
- * either way); `none` means the run never had a pane address.
74
- */
75
48
  export type PaneOutcome = {
76
49
  kind: "closed";
77
50
  paneId: string;
@@ -94,9 +67,7 @@ export type WorktreeOutcome = {
94
67
  kind: "removal-failed";
95
68
  path: string;
96
69
  detail: string;
97
- }
98
- /** `path` null when the run never recorded one; the reason to keep it rides the report's verdict. */
99
- | {
70
+ } | {
100
71
  kind: "kept";
101
72
  path: string | null;
102
73
  } | {
@@ -105,17 +76,9 @@ export type WorktreeOutcome = {
105
76
  } | {
106
77
  kind: "none";
107
78
  };
108
- /** The override a forced teardown carries: the refusal it bypassed (menu-only; the tool never forces). */
109
79
  export type ForcedOverride = {
110
80
  reason?: WorktreeKeptReason;
111
81
  };
112
- /**
113
- * What cleanup did with the run as a whole: tore down its artifacts, or refused
114
- * to touch them and says why. Only a teardown can carry `forced`; only a refusal
115
- * carries `forceable` — whether the operator override (`CleanupOptions.force`)
116
- * can change the answer. The menu offers Force only for a forceable refusal;
117
- * every other refusal is final.
118
- */
119
82
  export type CleanupVerdictOutcome = {
120
83
  kind: "torn-down";
121
84
  forced?: ForcedOverride;
@@ -124,68 +87,47 @@ export type CleanupVerdictOutcome = {
124
87
  reason: WorktreeKeptReason;
125
88
  forceable: boolean;
126
89
  };
127
- /** Structured cleanup result for the orchestrator (not prose); report-gated and best effort — unsettled runs are refused, the rest reports what it could not remove. */
128
90
  export interface CleanupReport {
129
91
  agentId: string;
130
- /** Where the plan's artifacts came from (see CleanupSource). */
131
92
  source: CleanupSource;
132
- /** The verdict itself: a refusal always names its reason, whether or not a worktree was at stake. */
133
93
  outcome: CleanupVerdictOutcome;
134
- /** The run's established end-state; cleanup never changes run state, only tears down ended runs. */
135
94
  settlement: SettlementVerdict;
136
- /** The subagent's pane after cleanup (none = never had one). */
137
95
  pane: PaneOutcome;
138
- /** The extension-owned worktree after cleanup (none = never created one; absent = already gone from disk). */
139
96
  worktree: WorktreeOutcome;
140
- /** What happened to the agent's branch. */
141
97
  branch: BranchCleanupResult;
142
- /** Branch ref; invariant: present iff the worktree existed (pinned at worktree-create time). */
143
98
  branchName?: string;
144
99
  }
145
100
  export interface CleanupOptions {
146
- /** Skip the removability gate: remove the worktree even when dirty/unverifiable. `reason` is the refusal this override bypassed. */
147
101
  force?: ForcedOverride;
148
102
  }
149
- /** Checkout for one agent id. `repoCwd` derives from the checkout itself — a wrong-repo cwd would delete a same-named branch elsewhere; absent means unresolvable (a refusal, not a fallback). */
150
103
  interface LocatedWorktree {
151
104
  path: string;
152
105
  repoCwd?: string;
153
106
  workspaceId?: string;
154
107
  }
155
- /** Pane addressing a run: a live placement record or memory's address. */
156
108
  export interface LocatedPane {
157
109
  paneId: string;
158
110
  tabId?: string;
159
111
  workspaceId?: string;
160
112
  }
161
- /** Locator answer for one agent id. Provenance is memory-only; addresses are live probes, which may correct a stale record. */
162
113
  export interface LocatedArtifacts {
163
114
  id: string;
164
- /** The run's branch (`cow-<slug>-<id>`), from memory or the discovered checkout. */
165
115
  branch: string;
166
- /** Provenance: the extension created this tree (memory, or the extension-worktree rule). */
167
116
  worktreeManaged: boolean;
168
- /** Provenance: the extension created this pane. Never claimed for a recovered run. */
169
117
  paneCreated: boolean;
170
- /** The checkout memory named or discovery found; null when nothing on disk answers. */
171
118
  worktree: LocatedWorktree | null;
172
- /** The pane addressing this run; null when nothing addresses one. */
173
119
  pane: LocatedPane | null;
174
120
  }
175
- /** Pane as cleanup sees it; only `self-created` may be closed. */
176
121
  export interface PaneTarget {
177
122
  paneId: string;
178
- /** Self-created panes are closed by cleanup; adopted panes never are. */
179
123
  origin: "self-created" | "adopted";
180
124
  }
181
125
  export interface WorktreeTarget {
182
- /** Absent for a git-only checkout or a reconstructed spawn without a placement identity. */
183
126
  workspaceId?: string;
184
127
  worktreePath: string;
185
128
  repoCwd: string;
186
129
  branchName: string;
187
130
  }
188
- /** What a run owns: no partial worktree state — an unresolved managed tree is `worktree-unlocatable`, never `no-worktree`; `null` is genuine absence. */
189
131
  export type CleanupPlan = {
190
132
  kind: "worktree";
191
133
  worktree: WorktreeTarget;
@@ -193,14 +135,12 @@ export type CleanupPlan = {
193
135
  } | {
194
136
  kind: "worktree-unlocatable";
195
137
  branchName: string;
196
- /** null = no path was ever recorded or discovered for the worktree. */
197
138
  worktreePath: string | null;
198
139
  pane: PaneTarget | null;
199
140
  } | {
200
141
  kind: "no-worktree";
201
142
  pane: PaneTarget | null;
202
143
  };
203
- /** Narrow located artifacts into a plan (pure): resolved managed tree → worktree (missing workspace still goes via git); unresolved managed tree → worktree-unlocatable (never no-worktree, so nothing leaks); recovered panes are never self-created. */
204
144
  export declare function planRecovered(artifacts: LocatedArtifacts): CleanupPlan;
205
145
  export type GateOutcome = {
206
146
  kind: "removable";
@@ -209,23 +149,15 @@ export type GateOutcome = {
209
149
  reason: WorktreeRetentionReason;
210
150
  };
211
151
  type WorktreeDirtyProbe = (worktreePath: string) => Promise<boolean | undefined>;
212
- /** Removability gate: dirty/unverifiable blocks (the only way removal loses work); unmerged does not (the branch survives in the repo); force skips the probe. */
213
152
  export declare function assessRemovability(isDirty: WorktreeDirtyProbe, opts: CleanupOptions | undefined, worktree: WorktreeTarget): Promise<GateOutcome>;
214
153
  export type RemovalOutcomes = {
215
154
  pane: PaneOutcome;
216
155
  worktree: WorktreeOutcome;
217
156
  branch: BranchCleanupResult;
218
157
  };
219
- /** The plan kinds that can actually be removed (unlocatable never reaches removal). */
220
158
  export type RemovablePlan = Extract<CleanupPlan, {
221
159
  kind: "worktree" | "no-worktree";
222
160
  }>;
223
- /**
224
- * Recovered-path settlement: tear down only when the multiplexer's read cannot show
225
- * live work (pane gone or non-working); `working` refuses. Unreadable reads
226
- * never reach here — the caller refuses on a throw. (Refusing anything but
227
- * gone panes would be a one-line change to the second branch.)
228
- */
229
161
  export type RecoveryGate = {
230
162
  kind: "allow";
231
163
  basis: DiscoveryBasis;
@@ -235,43 +167,22 @@ export type RecoveryGate = {
235
167
  };
236
168
  export declare function recoveryGate(observation: HostObservation | undefined): RecoveryGate;
237
169
  export declare function recoveryRefusalReason(basis: DiscoveryBasis): WorktreeKeptReason;
238
- /** Refusal report shared by all early returns; the reason rides the verdict, so it survives even with no worktree to name. `refusal.forceable` marks a refusal the operator override can change (see CleanupVerdictOutcome). A refusal closes nothing, so its pane is always reported open. */
239
170
  export declare function keptReport(agentId: string, source: CleanupSource, plan: CleanupPlan, settlement: SettlementVerdict, refusal: {
240
171
  reason: WorktreeKeptReason;
241
172
  forceable: boolean;
242
173
  }): CleanupReport;
243
- /** Contested-id report: cleanup removes nothing (not even the branch) and lists candidates for the orchestrator. */
244
174
  export declare function ambiguousReport(agentId: string, source: CleanupSource, settlement: SettlementVerdict, candidates: readonly string[]): CleanupReport;
245
- /**
246
- * The `forced` marker a teardown earned by overriding a removability gate, as a
247
- * fragment for its `torn-down` outcome (`{}` for a routine teardown). The tool
248
- * never forces, so only the menu sets it — and every teardown path spreads this,
249
- * so the marker is invariant.
250
- */
251
175
  export declare function forcedFields(opts?: CleanupOptions): {
252
176
  forced?: ForcedOverride;
253
177
  };
254
178
  export declare function assembleReport(agentId: string, source: CleanupSource, plan: CleanupPlan, settlement: SettlementVerdict, removal: RemovalOutcomes, opts?: CleanupOptions): CleanupReport;
255
- /** A report whose refusal the operator override can change — `isForceableRefusal` narrows to it. */
256
179
  export type ForceableRefusedReport = CleanupReport & {
257
180
  outcome: {
258
181
  kind: "refused";
259
182
  forceable: true;
260
183
  };
261
184
  };
262
- /**
263
- * Whether the operator override can change a refusal's answer. The menu offers
264
- * Force only for these: a live run, a contested id, and a tree with no address
265
- * force can reach are final refusals, not candidates for a second attempt.
266
- */
267
185
  export declare function isForceableRefusal(report: CleanupReport): report is ForceableRefusedReport;
268
- /**
269
- * Drop a spawn once its tracked resources are gone; a kept/failed tree
270
- * keeps its spawn so status still shows why. An absent tree drops too: a
271
- * checkout that is not on disk cannot be removed and holds no work, and the
272
- * branch is deliberately NOT deleted on that path (its commits live in the
273
- * object store), so nothing recordable is lost by forgetting the record.
274
- */
275
186
  export declare function shouldDropSpawn(report: CleanupReport): boolean;
276
187
  export type WorktreeRemovalMechanism = "multiplexer" | "git";
277
188
  type PaneDisposition = {
@@ -1,14 +1,5 @@
1
- /**
2
- * cleanup-report.ts — a CleanupReport as prose: the summary the cleanup tool
3
- * returns and the one line the menus notify. Each artifact's wording is
4
- * written once here, so the tool's report and the menu's toast agree.
5
- */
6
1
  import type { CleanupReport, WorktreeKeptReason } from "./cleanup-policy.js";
7
- /** The refusal wording, shared by the report and the menu's force dialog. */
8
2
  export declare function formatKeptReason(reason: WorktreeKeptReason): string;
9
- /** The tool's report: what happened to the run, its pane, worktree and branch. */
10
3
  export declare function renderCleanupReport(report: CleanupReport): string;
11
- /** The same report as one notification-sized line. */
12
4
  export declare function summarizeCleanupReport(report: CleanupReport): string;
13
- /** Whether the teardown left something behind that only the operator can settle. */
14
5
  export declare function cleanupNeedsAttention(report: CleanupReport): boolean;
@@ -1,8 +1,2 @@
1
- /**
2
- * default-agents.ts — Embedded default agent configurations.
3
- *
4
- * Always available; overridable by same-named .toml files. Only
5
- * general-purpose is embedded — other types are scanned .toml templates.
6
- */
7
1
  import type { AgentConfig } from "./types.js";
8
2
  export declare const DEFAULT_AGENTS: Map<string, AgentConfig>;
@@ -1,41 +1,3 @@
1
- /**
2
- * harness/claude/index.ts — the claude harness: a binary of its own, staged
3
- * and launched behind the pane's `claude`.
4
- *
5
- * claude is not a pi-compatible binary: its task cannot ride the argv at all
6
- * (herdr rejects multi-line arguments, and a task is multi-line text), so the
7
- * launcher appends it as the positional initial prompt — past a `--` that ends
8
- * option parsing, `"$(cat '<taskFile>')"` expands inside the pane's shell, where herdr's single-line
9
- * argv encoding never reaches. `prepare` stages the config directory claude is
10
- * pointed at (staging.ts), installs that launcher into the pane, and then
11
- * proves the pane can see the staged files and resolve the binary; `buildArgs`
12
- * is claude's interactive CLI with the task deliberately absent;
13
- * `teardown` removes the staged tree.
14
- *
15
- * `listModels` is a curated constant: claude has no CLI enumeration, and a
16
- * wrong list is worse than a short one, so it names only the aliases a real
17
- * run was seen to answer (`haiku`, `sonnet`, `opus`) and nothing it was seen
18
- * to refuse.
19
- *
20
- * The strict `[harness.claude]` table carries only `model` and the tool pair,
21
- * both in claude's own vocabulary: the tool names ride `--tools` /
22
- * `--disallowedTools` exactly as written, with no translation, and the model
23
- * key's `anthropic/` prefix is stripped at the argv boundary because the CLI
24
- * takes a bare alias or full model name.
25
- */
26
1
  import type { ClaudeLaunchRequest, Harness } from "../../harness.js";
27
- /**
28
- * The value a spawn exports for its credential store.
29
- *
30
- * macOS keeps credentials in the Keychain, and the service name is
31
- * `Claude Code-credentials` for an empty value and
32
- * `Claude Code-credentials-<sha256(value)[:8]>` otherwise. The value is hashed
33
- * verbatim, so the parent's value is forwarded unchanged; substituting
34
- * `~/.claude` would select a different, empty item.
35
- *
36
- * Linux keeps `.credentials.json` under the value, so an empty value means
37
- * `~/.claude` and the parent's directory is resolved. The value itself is not
38
- * tilde-expanded, so the expansion happens here.
39
- */
40
2
  export declare function spawnCredentialStore(platform: NodeJS.Platform): string;
41
3
  export declare const claudeHarness: Harness<ClaudeLaunchRequest>;
@@ -1,46 +1,7 @@
1
- /**
2
- * claude/staging.ts — the config directory a spawn is pointed at: its path,
3
- * its assembly, and its removal.
4
- *
5
- * claude launches with `CLAUDE_CONFIG_DIR` naming this directory, so every
6
- * answers-everything dialog the interactive TUI would otherwise park at is
7
- * decided here, before the pane exists: the theme picker (`theme`), the
8
- * first-run bypass-permissions acceptance (`skipDangerousModePermissionPrompt`,
9
- * the persisted half of `--dangerously-skip-permissions`), the onboarding
10
- * marker (`hasCompletedOnboarding`), and the workspace trust for the spawn's
11
- * own directory (`hasTrustDialogAccepted`). claude resolves the workspace to
12
- * its real path before the trust lookup (`/tmp` reads as `/private/tmp`), so
13
- * the seeded entry is keyed by the canonical path, and trust is inherited
14
- * downward — one entry covers the spawn whatever its worktree is named.
15
- * Nothing here launches anything or knows which pane the process will live in.
16
- *
17
- * What is deliberately absent is the custom-API-key approval
18
- * (`customApiKeyResponses`): it names the tail of the `ANTHROPIC_API_KEY` in
19
- * the launching environment, and the harness neither sets nor reads
20
- * credentials — a spawn inherits whatever environment the parent session has.
21
- * A session that authenticates through that variable therefore still meets the
22
- * consent dialog once per spawn; OAuth/keychain sessions have no such dialog,
23
- * because the launcher pins their credential store independently of the
24
- * staged config directory.
25
- */
26
- /**
27
- * `<subagentResultDirFor(id)>/claude` — the config dir claude is pointed at.
28
- */
29
1
  export declare function claudeConfigDir(subagentId: string): string;
30
- /** The staged user settings file inside a config directory. */
31
2
  export declare function claudeSettingsFile(configDir: string): string;
32
- /**
33
- * Write the whole staging tree and return the config dir. Nothing here is
34
- * best-effort: every write throws, so a spawn that cannot stage its answers
35
- * fails its launch instead of starting into the dialogs the staging exists
36
- * to skip.
37
- */
38
3
  export declare function writeClaudeStaging(input: {
39
4
  subagentId: string;
40
5
  cwd: string;
41
6
  }): string;
42
- /**
43
- * Remove the staging tree. Best effort and idempotent — a no-op when its
44
- * target is already gone (a launch that failed before prepare staged nothing).
45
- */
46
7
  export declare function removeClaudeStaging(subagentId: string): void;
@@ -1,42 +1,2 @@
1
- /**
2
- * harness/codex.ts — the codex harness: a binary of its own, launched as the
3
- * interactive TUI behind the pane's `codex`.
4
- *
5
- * codex is not a pi-compatible binary, so nothing here can reuse the
6
- * pi-compatible factory: it takes no system prompt on its argv (the prompt is
7
- * read from the file `model_instructions_file` names), and its task arrives
8
- * differently too. A multi-line task cannot ride the argv — herdr
9
- * single-quotes every argument it passes and refuses multi-line ones outright —
10
- * so the launcher appends it as the positional prompt the TUI starts its
11
- * session with. The stdin form is unusable here: the TUI exits when stdin
12
- * reaches EOF instead of reopening the terminal for input, so the task must
13
- * not ride a redirect.
14
- *
15
- * The launch is the minimal *interactive* UI and is load-bearing: `codex exec`
16
- * exits when its turn ends and never reads the terminal again, so a later
17
- * steer would be typed into a pty nobody reads. Steering stays possible
18
- * because the TUI keeps reading the pane.
19
- *
20
- * `prepare` installs that launcher into the pane and nothing else: every
21
- * switch the launch needs rides the argv as a flag, so there is no staged
22
- * directory to prove live and nothing to remove in `teardown`. `prepare`
23
- * proves no system-prompt state either — a missing or empty instructions file
24
- * is a loud `codex` hard error at boot, not a silent fallback, so there is no
25
- * quiet mislaunch to catch early.
26
- *
27
- * `listModels` shells `codex debug models --bundled` through `pi.exec`
28
- * (children inherit the session environment, as every other child here does)
29
- * and parses the output defensively. The real format — verified against the
30
- * installed CLI by test/codex-harness.integration.test.ts — is a JSON object
31
- * with a `models` array of `{ slug, visibility, display_name }` entries. Only
32
- * `visibility: "list"` entries are offered; any other shape resolves to an
33
- * empty list with a warning rather than an exception, because a settings menu
34
- * must never fail to open when a list command misbehaves. The integration
35
- * test is what keeps the verified shape true as codex changes.
36
- *
37
- * The strict `[harness.codex]` table carries `model` alone: codex has no tools
38
- * flag, so there is no tool pair to stage, and the shared `toolSelection` a
39
- * codex launch receives is left unread.
40
- */
41
1
  import type { CodexLaunchRequest, Harness } from "../harness.js";
42
2
  export declare const codexHarness: Harness<CodexLaunchRequest>;