@ours.network/fleet 1.2.0-nightly.6 → 1.2.0-nightly.60

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 (389) hide show
  1. package/README.md +287 -65
  2. package/dist/account-origin.d.ts +2 -0
  3. package/dist/account-origin.js +6 -0
  4. package/dist/agent-ours/bridge.js +35 -9
  5. package/dist/agent-ours/correspondence.d.ts +10 -0
  6. package/dist/agent-ours/correspondence.js +1 -0
  7. package/dist/agent-ours/file-rpc.d.ts +12 -0
  8. package/dist/agent-ours/file-rpc.js +18 -4
  9. package/dist/agent-ours/harness.js +9 -1
  10. package/dist/agent-ours/mcp-endpoint.d.ts +4 -0
  11. package/dist/agent-ours/mcp-endpoint.js +5 -0
  12. package/dist/agent-ours/runtime.d.ts +9 -1
  13. package/dist/agent-ours/runtime.js +50 -2
  14. package/dist/agent-ours/service.d.ts +21 -1
  15. package/dist/agent-ours/service.js +94 -14
  16. package/dist/application/codex-models.d.ts +15 -0
  17. package/dist/application/codex-models.js +56 -0
  18. package/dist/application/conversation-history.d.ts +27 -0
  19. package/dist/application/conversation-history.js +212 -0
  20. package/dist/application/fleet-query-service.d.ts +1 -1
  21. package/dist/application/fleet-query-service.js +2 -2
  22. package/dist/application/legacy-supervisor-identity.d.ts +7 -0
  23. package/dist/application/legacy-supervisor-identity.js +43 -0
  24. package/dist/application/log-service.js +8 -8
  25. package/dist/application/model-catalog.d.ts +1 -1
  26. package/dist/application/model-catalog.js +5 -2
  27. package/dist/application/preset-provenance.d.ts +19 -0
  28. package/dist/application/preset-provenance.js +59 -0
  29. package/dist/application/role-creation-service.js +3 -2
  30. package/dist/application/role-removal-service.js +9 -1
  31. package/dist/application/role-repository.js +19 -2
  32. package/dist/application/room-layout-definitions.d.ts +45 -0
  33. package/dist/application/room-layout-definitions.js +130 -0
  34. package/dist/application/session-control.d.ts +30 -0
  35. package/dist/application/session-control.js +72 -3
  36. package/dist/application/supervisor-ours-tools.d.ts +159 -0
  37. package/dist/application/supervisor-ours-tools.js +115 -0
  38. package/dist/application/task-layouts.d.ts +91 -0
  39. package/dist/application/task-layouts.js +259 -0
  40. package/dist/application/task-room-service.d.ts +99 -3
  41. package/dist/application/task-room-service.js +285 -32
  42. package/dist/application/types.d.ts +2 -0
  43. package/dist/atomic-file.d.ts +5 -0
  44. package/dist/atomic-file.js +62 -1
  45. package/dist/briefing.d.ts +3 -1
  46. package/dist/briefing.js +70 -30
  47. package/dist/build-info.json +7 -4
  48. package/dist/capabilities.d.ts +6 -1
  49. package/dist/capabilities.js +8 -0
  50. package/dist/cli.js +407 -37
  51. package/dist/client-profile.d.ts +5 -17
  52. package/dist/client-profile.js +4 -127
  53. package/dist/config.d.ts +45 -0
  54. package/dist/config.js +57 -6
  55. package/dist/creation.d.ts +1 -1
  56. package/dist/creation.js +4 -4
  57. package/dist/daemon-recovery.d.ts +1 -8
  58. package/dist/daemon-recovery.js +8 -113
  59. package/dist/docs.d.ts +1 -1
  60. package/dist/docs.js +123 -19
  61. package/dist/doctor.d.ts +1 -1
  62. package/dist/doctor.js +55 -60
  63. package/dist/erased-resources.d.ts +9 -0
  64. package/dist/erased-resources.js +87 -0
  65. package/dist/file-delivery/reader.d.ts +15 -0
  66. package/dist/file-delivery/reader.js +63 -0
  67. package/dist/file-delivery/store.d.ts +15 -0
  68. package/dist/file-delivery/store.js +124 -0
  69. package/dist/file-delivery/types.d.ts +19 -0
  70. package/dist/file-delivery/types.js +1 -0
  71. package/dist/fleet-command-audit.d.ts +7 -0
  72. package/dist/fleet-command-audit.js +26 -9
  73. package/dist/harness/agent-session.d.ts +2 -0
  74. package/dist/harness/claude-code-session.js +1 -1
  75. package/dist/harness/claude-code.js +20 -11
  76. package/dist/harness/claude-runtime.d.ts +12 -0
  77. package/dist/harness/claude-runtime.js +43 -0
  78. package/dist/harness/codex-app-server-proxy.d.ts +4 -1
  79. package/dist/harness/codex-app-server-proxy.js +41 -5
  80. package/dist/harness/codex-reasoning.d.ts +5 -0
  81. package/dist/harness/codex-reasoning.js +12 -0
  82. package/dist/harness/codex-runtime.d.ts +11 -1
  83. package/dist/harness/codex-runtime.js +31 -4
  84. package/dist/harness/codex-session.js +2 -2
  85. package/dist/harness/codex.js +23 -12
  86. package/dist/init-wizard.d.ts +2 -0
  87. package/dist/init-wizard.js +38 -19
  88. package/dist/isolation/policy.js +6 -1
  89. package/dist/isolation/types.d.ts +5 -0
  90. package/dist/managed-cli.d.ts +253 -0
  91. package/dist/managed-cli.js +923 -0
  92. package/dist/managed-recovery.d.ts +13 -0
  93. package/dist/managed-recovery.js +31 -0
  94. package/dist/minimal-setup.d.ts +2 -0
  95. package/dist/minimal-setup.js +44 -0
  96. package/dist/monitor.d.ts +8 -34
  97. package/dist/monitor.js +89 -152
  98. package/dist/notifications/fleet-producer.d.ts +19 -0
  99. package/dist/notifications/fleet-producer.js +208 -0
  100. package/dist/notifications/outbox.d.ts +46 -0
  101. package/dist/notifications/outbox.js +158 -0
  102. package/dist/notifications/target-cleanup.d.ts +8 -0
  103. package/dist/notifications/target-cleanup.js +41 -0
  104. package/dist/notifications/task-producer.d.ts +18 -0
  105. package/dist/notifications/task-producer.js +67 -0
  106. package/dist/ops.d.ts +2 -0
  107. package/dist/ops.js +20 -3
  108. package/dist/owner-channel/channel.js +17 -6
  109. package/dist/owner-channel/commands.d.ts +4 -0
  110. package/dist/owner-channel/commands.js +8 -0
  111. package/dist/owner-channel/lifecycle-outbox.js +4 -3
  112. package/dist/owner-channel/ours-client.js +2 -17
  113. package/dist/paths.d.ts +2 -0
  114. package/dist/paths.js +2 -0
  115. package/dist/preset-migration.js +25 -0
  116. package/dist/resolved-plan.js +1 -0
  117. package/dist/rooms-tasks/add-member.d.ts +48 -0
  118. package/dist/rooms-tasks/add-member.js +83 -0
  119. package/dist/rooms-tasks/archived-absence.d.ts +8 -0
  120. package/dist/rooms-tasks/archived-absence.js +48 -0
  121. package/dist/rooms-tasks/cli.js +65 -5
  122. package/dist/rooms-tasks/close.d.ts +6 -2
  123. package/dist/rooms-tasks/close.js +246 -37
  124. package/dist/rooms-tasks/config.d.ts +1 -1
  125. package/dist/rooms-tasks/config.js +11 -4
  126. package/dist/rooms-tasks/cowork-adapter.d.ts +2 -4
  127. package/dist/rooms-tasks/cowork-adapter.js +7 -121
  128. package/dist/rooms-tasks/cowork-http.js +29 -1
  129. package/dist/rooms-tasks/deletion.d.ts +1 -1
  130. package/dist/rooms-tasks/deletion.js +84 -5
  131. package/dist/rooms-tasks/erasure.d.ts +6 -0
  132. package/dist/rooms-tasks/erasure.js +173 -0
  133. package/dist/rooms-tasks/external-worker.d.ts +1 -1
  134. package/dist/rooms-tasks/external-worker.js +3 -4
  135. package/dist/rooms-tasks/layout-binding-client.d.ts +11 -0
  136. package/dist/rooms-tasks/layout-binding-client.js +56 -0
  137. package/dist/rooms-tasks/layout-binding-grants.d.ts +21 -0
  138. package/dist/rooms-tasks/layout-binding-grants.js +128 -0
  139. package/dist/rooms-tasks/layout-cli.d.ts +4 -0
  140. package/dist/rooms-tasks/layout-cli.js +107 -0
  141. package/dist/rooms-tasks/layout-config.d.ts +11 -0
  142. package/dist/rooms-tasks/layout-config.js +89 -0
  143. package/dist/rooms-tasks/layout-control.d.ts +21 -0
  144. package/dist/rooms-tasks/layout-control.js +52 -0
  145. package/dist/rooms-tasks/layout-member-retirement.d.ts +10 -0
  146. package/dist/rooms-tasks/layout-member-retirement.js +90 -0
  147. package/dist/rooms-tasks/layout-service.d.ts +43 -0
  148. package/dist/rooms-tasks/layout-service.js +203 -0
  149. package/dist/rooms-tasks/layout.d.ts +121 -0
  150. package/dist/rooms-tasks/layout.js +285 -0
  151. package/dist/rooms-tasks/legacy-task-member.d.ts +19 -0
  152. package/dist/rooms-tasks/legacy-task-member.js +116 -0
  153. package/dist/rooms-tasks/live-readiness.d.ts +18 -0
  154. package/dist/rooms-tasks/live-readiness.js +85 -0
  155. package/dist/rooms-tasks/member-ownership.d.ts +5 -0
  156. package/dist/rooms-tasks/member-ownership.js +40 -0
  157. package/dist/rooms-tasks/member-startup.d.ts +1 -0
  158. package/dist/rooms-tasks/member-startup.js +2 -0
  159. package/dist/rooms-tasks/provision.d.ts +3 -0
  160. package/dist/rooms-tasks/provision.js +101 -49
  161. package/dist/rooms-tasks/recovery.d.ts +19 -0
  162. package/dist/rooms-tasks/recovery.js +110 -0
  163. package/dist/rooms-tasks/room-state.d.ts +4 -2
  164. package/dist/rooms-tasks/room-state.js +47 -8
  165. package/dist/rooms-tasks/task-service-retirement.d.ts +11 -0
  166. package/dist/rooms-tasks/task-service-retirement.js +21 -0
  167. package/dist/rooms-tasks/task-state.d.ts +51 -8
  168. package/dist/rooms-tasks/task-state.js +245 -25
  169. package/dist/rooms-tasks/types.d.ts +40 -0
  170. package/dist/rooms-tasks/workspace-artifacts.d.ts +6 -0
  171. package/dist/rooms-tasks/workspace-artifacts.js +93 -0
  172. package/dist/rooms-tasks/workspace.d.ts +35 -0
  173. package/dist/rooms-tasks/workspace.js +325 -0
  174. package/dist/runner.d.ts +25 -3
  175. package/dist/runner.js +291 -49
  176. package/dist/session/acp.d.ts +53 -1
  177. package/dist/session/acp.js +216 -40
  178. package/dist/session/arbiter.d.ts +11 -0
  179. package/dist/session/arbiter.js +43 -2
  180. package/dist/session/codex-app-server.d.ts +32 -0
  181. package/dist/session/codex-app-server.js +137 -23
  182. package/dist/session/control.d.ts +12 -1
  183. package/dist/session/control.js +68 -3
  184. package/dist/session/conversation-normalizer.d.ts +2 -1
  185. package/dist/session/conversation-normalizer.js +1 -1
  186. package/dist/session/conversation-store.d.ts +1 -1
  187. package/dist/session/conversation-store.js +7 -11
  188. package/dist/session/conversation-types.d.ts +28 -3
  189. package/dist/session/prompt-batch.d.ts +63 -0
  190. package/dist/session/prompt-batch.js +86 -0
  191. package/dist/session/task-notice.d.ts +14 -0
  192. package/dist/session/task-notice.js +13 -0
  193. package/dist/session/types.d.ts +14 -0
  194. package/dist/setup-tunnel-preflight.d.ts +34 -0
  195. package/dist/setup-tunnel-preflight.js +62 -0
  196. package/dist/socket-path.d.ts +2 -0
  197. package/dist/socket-path.js +22 -0
  198. package/dist/spawn.d.ts +5 -1
  199. package/dist/spawn.js +40 -4
  200. package/dist/startup-prompt.d.ts +4 -0
  201. package/dist/startup-prompt.js +36 -0
  202. package/dist/startup-readiness.d.ts +13 -0
  203. package/dist/startup-readiness.js +38 -0
  204. package/dist/startup-telemetry.d.ts +16 -0
  205. package/dist/startup-telemetry.js +46 -0
  206. package/dist/subscriptions/cli.d.ts +91 -0
  207. package/dist/subscriptions/cli.js +223 -0
  208. package/dist/subscriptions/launch.d.ts +37 -0
  209. package/dist/subscriptions/launch.js +93 -0
  210. package/dist/subscriptions/login.d.ts +75 -0
  211. package/dist/subscriptions/login.js +182 -0
  212. package/dist/subscriptions/observed.d.ts +7 -0
  213. package/dist/subscriptions/observed.js +44 -0
  214. package/dist/subscriptions/probe.d.ts +10 -0
  215. package/dist/subscriptions/probe.js +73 -0
  216. package/dist/subscriptions/service.d.ts +102 -0
  217. package/dist/subscriptions/service.js +364 -0
  218. package/dist/subscriptions/store.d.ts +71 -0
  219. package/dist/subscriptions/store.js +140 -0
  220. package/dist/supervisor/adoption.d.ts +8 -0
  221. package/dist/supervisor/adoption.js +78 -0
  222. package/dist/supervisor/catalog.d.ts +62 -0
  223. package/dist/supervisor/catalog.js +254 -0
  224. package/dist/supervisor/fleet.d.ts +8 -0
  225. package/dist/supervisor/fleet.js +89 -0
  226. package/dist/supervisor/index.js +3 -6
  227. package/dist/supervisor/launchd.d.ts +1 -1
  228. package/dist/supervisor/launchd.js +26 -13
  229. package/dist/supervisor/legacy.d.ts +35 -0
  230. package/dist/supervisor/legacy.js +524 -0
  231. package/dist/supervisor/manager.d.ts +15 -0
  232. package/dist/supervisor/manager.js +270 -0
  233. package/dist/supervisor/scope.d.ts +4 -0
  234. package/dist/supervisor/scope.js +10 -0
  235. package/dist/supervisor/systemd.d.ts +2 -2
  236. package/dist/supervisor/systemd.js +19 -33
  237. package/dist/task-supervision.d.ts +9 -0
  238. package/dist/task-supervision.js +145 -0
  239. package/dist/temp-idle.d.ts +17 -0
  240. package/dist/temp-idle.js +42 -0
  241. package/dist/temp-lifecycle.d.ts +23 -8
  242. package/dist/temp-lifecycle.js +113 -65
  243. package/dist/temp-supervisor-recovery.d.ts +1 -1
  244. package/dist/temp-supervisor-recovery.js +2 -2
  245. package/dist/tunnel-setup-completion.d.ts +7 -0
  246. package/dist/tunnel-setup-completion.js +13 -0
  247. package/dist/tunnel-setup-input.d.ts +19 -0
  248. package/dist/tunnel-setup-input.js +124 -0
  249. package/dist/web/agent-attachments.d.ts +29 -0
  250. package/dist/web/agent-attachments.js +162 -0
  251. package/dist/web/auth.d.ts +63 -2
  252. package/dist/web/auth.js +191 -10
  253. package/dist/web/available-port.d.ts +2 -0
  254. package/dist/web/available-port.js +23 -0
  255. package/dist/web/control.d.ts +3 -3
  256. package/dist/web/control.js +10 -8
  257. package/dist/web/fleet-config-service.d.ts +4 -1
  258. package/dist/web/fleet-config-service.js +46 -15
  259. package/dist/web/prefix-gateway.d.ts +32 -0
  260. package/dist/web/prefix-gateway.js +238 -0
  261. package/dist/web/runtime.d.ts +3 -1
  262. package/dist/web/runtime.js +116 -31
  263. package/dist/web/server.d.ts +16 -0
  264. package/dist/web/server.js +654 -55
  265. package/dist/web/service.d.ts +11 -2
  266. package/dist/web/service.js +30 -4
  267. package/dist/web/workspace-devices.d.ts +107 -0
  268. package/dist/web/workspace-devices.js +277 -0
  269. package/dist/web/workspace-tunnel.d.ts +1 -0
  270. package/dist/web/workspace-tunnel.js +34 -0
  271. package/dist/workspace-enrollment.d.ts +82 -0
  272. package/dist/workspace-enrollment.js +566 -0
  273. package/dist/workspace-replacement.d.ts +66 -0
  274. package/dist/workspace-replacement.js +220 -0
  275. package/docs/acp-files.md +146 -0
  276. package/docs/fleet-migration.md +54 -0
  277. package/docs/live-voice.md +13 -0
  278. package/docs/room-layouts.md +227 -0
  279. package/docs/task-workspaces.md +225 -0
  280. package/docs/validation/managed-cli-permissions.md +421 -0
  281. package/examples/room-layouts/fresh.yaml +27 -0
  282. package/examples/room-layouts/scoped.yaml +21 -0
  283. package/examples/room-layouts/shared.yaml +19 -0
  284. package/package.json +20 -19
  285. package/presets/README.md +78 -0
  286. package/presets/brain-catalog.json +8 -2
  287. package/presets/fleet/agent_templates/Critic.yaml +1 -1
  288. package/presets/fleet/agent_templates/Developer.yaml +1 -1
  289. package/presets/fleet/agent_templates/Engineer.yaml +5 -0
  290. package/presets/fleet/agent_templates/LocalCoordinator.yaml +1 -1
  291. package/presets/fleet/agents/FleetCoordinator.yaml +1 -1
  292. package/presets/fleet/brains/claude-fable-5-1-high.yaml +5 -0
  293. package/presets/fleet/brains/claude-fable-5-1-low.yaml +5 -0
  294. package/presets/fleet/brains/claude-fable-5-1-max.yaml +5 -0
  295. package/presets/fleet/brains/claude-fable-5-1-medium.yaml +5 -0
  296. package/presets/fleet/brains/claude-fable-5-1-xhigh.yaml +5 -0
  297. package/presets/fleet/brains/claude-fable-5-high.yaml +1 -1
  298. package/presets/fleet/brains/claude-fable-5-low.yaml +1 -1
  299. package/presets/fleet/brains/claude-fable-5-max.yaml +1 -1
  300. package/presets/fleet/brains/claude-fable-5-medium.yaml +1 -1
  301. package/presets/fleet/brains/claude-fable-5-xhigh.yaml +1 -1
  302. package/presets/fleet/brains/claude-haiku-4-5-20251001-default.yaml +4 -0
  303. package/presets/fleet/brains/claude-opus-5-5-high.yaml +5 -0
  304. package/presets/fleet/brains/claude-opus-5-5-low.yaml +5 -0
  305. package/presets/fleet/brains/claude-opus-5-5-max.yaml +5 -0
  306. package/presets/fleet/brains/claude-opus-5-5-medium.yaml +5 -0
  307. package/presets/fleet/brains/claude-opus-5-5-xhigh.yaml +5 -0
  308. package/presets/fleet/brains/claude-opus-5-high.yaml +1 -1
  309. package/presets/fleet/brains/claude-opus-5-low.yaml +1 -1
  310. package/presets/fleet/brains/claude-opus-5-max.yaml +1 -1
  311. package/presets/fleet/brains/claude-opus-5-medium.yaml +1 -1
  312. package/presets/fleet/brains/claude-opus-5-xhigh.yaml +1 -1
  313. package/presets/fleet/brains/claude-sonnet-5-high.yaml +1 -1
  314. package/presets/fleet/brains/claude-sonnet-5-low.yaml +1 -1
  315. package/presets/fleet/brains/claude-sonnet-5-max.yaml +1 -1
  316. package/presets/fleet/brains/claude-sonnet-5-medium.yaml +1 -1
  317. package/presets/fleet/brains/claude-sonnet-5-xhigh.yaml +1 -1
  318. package/presets/fleet/brains/codex-gpt-5-3-codex-spark-high.yaml +1 -1
  319. package/presets/fleet/brains/codex-gpt-5-3-codex-spark-low.yaml +1 -1
  320. package/presets/fleet/brains/codex-gpt-5-3-codex-spark-medium.yaml +1 -1
  321. package/presets/fleet/brains/codex-gpt-5-3-codex-spark-xhigh.yaml +1 -1
  322. package/presets/fleet/brains/codex-gpt-5-4-high.yaml +1 -1
  323. package/presets/fleet/brains/codex-gpt-5-4-low.yaml +1 -1
  324. package/presets/fleet/brains/codex-gpt-5-4-medium.yaml +1 -1
  325. package/presets/fleet/brains/codex-gpt-5-4-mini-high.yaml +1 -1
  326. package/presets/fleet/brains/codex-gpt-5-4-mini-low.yaml +1 -1
  327. package/presets/fleet/brains/codex-gpt-5-4-mini-medium.yaml +1 -1
  328. package/presets/fleet/brains/codex-gpt-5-4-mini-xhigh.yaml +1 -1
  329. package/presets/fleet/brains/codex-gpt-5-4-xhigh.yaml +1 -1
  330. package/presets/fleet/brains/codex-gpt-5-5-high.yaml +1 -1
  331. package/presets/fleet/brains/codex-gpt-5-5-low.yaml +1 -1
  332. package/presets/fleet/brains/codex-gpt-5-5-medium.yaml +1 -1
  333. package/presets/fleet/brains/codex-gpt-5-5-xhigh.yaml +1 -1
  334. package/presets/fleet/brains/codex-gpt-5-6-luna-high.yaml +1 -1
  335. package/presets/fleet/brains/codex-gpt-5-6-luna-low.yaml +1 -1
  336. package/presets/fleet/brains/codex-gpt-5-6-luna-max.yaml +1 -1
  337. package/presets/fleet/brains/codex-gpt-5-6-luna-medium.yaml +1 -1
  338. package/presets/fleet/brains/codex-gpt-5-6-luna-xhigh.yaml +1 -1
  339. package/presets/fleet/brains/codex-gpt-5-6-sol-high.yaml +1 -1
  340. package/presets/fleet/brains/codex-gpt-5-6-sol-low.yaml +1 -1
  341. package/presets/fleet/brains/codex-gpt-5-6-sol-max.yaml +1 -1
  342. package/presets/fleet/brains/codex-gpt-5-6-sol-medium.yaml +1 -1
  343. package/presets/fleet/brains/codex-gpt-5-6-sol-ultra.yaml +1 -1
  344. package/presets/fleet/brains/codex-gpt-5-6-sol-xhigh.yaml +1 -1
  345. package/presets/fleet/brains/codex-gpt-5-6-terra-high.yaml +1 -1
  346. package/presets/fleet/brains/codex-gpt-5-6-terra-low.yaml +1 -1
  347. package/presets/fleet/brains/codex-gpt-5-6-terra-max.yaml +1 -1
  348. package/presets/fleet/brains/codex-gpt-5-6-terra-medium.yaml +1 -1
  349. package/presets/fleet/brains/codex-gpt-5-6-terra-ultra.yaml +1 -1
  350. package/presets/fleet/brains/codex-gpt-5-6-terra-xhigh.yaml +1 -1
  351. package/presets/fleet/brains/codex-gpt-6-1-sol-high.yaml +5 -0
  352. package/presets/fleet/brains/codex-gpt-6-1-sol-low.yaml +5 -0
  353. package/presets/fleet/brains/codex-gpt-6-1-sol-max.yaml +5 -0
  354. package/presets/fleet/brains/codex-gpt-6-1-sol-medium.yaml +5 -0
  355. package/presets/fleet/brains/codex-gpt-6-1-sol-ultra.yaml +5 -0
  356. package/presets/fleet/brains/codex-gpt-6-1-sol-xhigh.yaml +5 -0
  357. package/presets/fleet/brains/codex-gpt-6-astra-high.yaml +1 -1
  358. package/presets/fleet/brains/codex-gpt-6-astra-low.yaml +1 -1
  359. package/presets/fleet/brains/codex-gpt-6-astra-max.yaml +1 -1
  360. package/presets/fleet/brains/codex-gpt-6-astra-medium.yaml +1 -1
  361. package/presets/fleet/brains/codex-gpt-6-astra-ultra.yaml +1 -1
  362. package/presets/fleet/brains/codex-gpt-6-astra-xhigh.yaml +1 -1
  363. package/presets/fleet/brains/codex-gpt-6-luna-high.yaml +5 -0
  364. package/presets/fleet/brains/codex-gpt-6-luna-low.yaml +5 -0
  365. package/presets/fleet/brains/codex-gpt-6-luna-max.yaml +5 -0
  366. package/presets/fleet/brains/codex-gpt-6-luna-medium.yaml +5 -0
  367. package/presets/fleet/brains/codex-gpt-6-luna-xhigh.yaml +5 -0
  368. package/presets/fleet/brains/codex-gpt-6-sol-high.yaml +5 -0
  369. package/presets/fleet/brains/codex-gpt-6-sol-low.yaml +5 -0
  370. package/presets/fleet/brains/codex-gpt-6-sol-max.yaml +5 -0
  371. package/presets/fleet/brains/codex-gpt-6-sol-medium.yaml +5 -0
  372. package/presets/fleet/brains/codex-gpt-6-sol-ultra.yaml +5 -0
  373. package/presets/fleet/brains/codex-gpt-6-sol-xhigh.yaml +5 -0
  374. package/presets/fleet/roles/Coordinator.yaml +34 -11
  375. package/presets/fleet/roles/Engineer.yaml +40 -0
  376. package/presets/fleet/room_layouts/engineering.yaml +25 -0
  377. package/presets/fleet/room_layouts/pair.yaml +24 -0
  378. package/presets/fleet/room_layouts/single.yaml +17 -0
  379. package/presets/fleet/room_layouts/team.yaml +30 -0
  380. package/presets/fleet/room_templates/engineering.yaml +19 -0
  381. package/presets/manifest.json +2 -2
  382. package/dist/web-app/assets/index-59GF-gsZ.css +0 -1
  383. package/dist/web-app/assets/index-C0h3ALvs.js +0 -10
  384. package/dist/web-app/icons/ours-fleet-maskable.svg +0 -4
  385. package/dist/web-app/icons/ours-fleet.svg +0 -4
  386. package/dist/web-app/index.html +0 -17
  387. package/dist/web-app/manifest.webmanifest +0 -15
  388. package/dist/web-app/offline.html +0 -18
  389. package/dist/web-app/sw.js +0 -51
@@ -1,7 +1,7 @@
1
+ import { erasedArg, redactErasedContent, writePrivacyFilteredLedger } from './erased-resources.js';
1
2
  import { existsSync, readFileSync } from 'node:fs';
2
- import { randomUUID } from 'node:crypto';
3
+ import { createHash, randomUUID } from 'node:crypto';
3
4
  import { Buffer } from 'node:buffer';
4
- import { replaceFileAtomically } from './atomic-file.js';
5
5
  import { isSensitiveConfigKey } from './sensitive-config.js';
6
6
  import { mandatoryConfigurationFits } from './lifecycle-summary.js';
7
7
  import { MARKDOWN_MAX_BYTES, MARKDOWN_MAX_CODE_POINTS, markdownCode, markdownProse, } from './rooms-tasks/markdown.js';
@@ -91,7 +91,7 @@ export function recordFleetAuditPresentation(value) {
91
91
  : value.kind === 'lifecycle_failure'
92
92
  ? { label: fleetPresentationLabel(value.label) }
93
93
  : {};
94
- const presentation = structuredClone({ ...value, ...labels, eventId: basis });
94
+ const presentation = redactErasedContent(structuredClone({ ...value, ...labels, eventId: basis }));
95
95
  const digest = lifecycleEventDigestBasis(presentation);
96
96
  if (!collection.presentations.some(existing => lifecycleEventDigestBasis(existing) === digest))
97
97
  collection.presentations.push(presentation);
@@ -117,6 +117,7 @@ export function consumeFleetAuditCollection() {
117
117
  const SAFE_READ = new Set(['docs', 'version', 'config', 'ls', 'peek', 'logs', 'status', 'doctor']);
118
118
  const AGENT_SURFACES = {
119
119
  spawn: new Set(['<none>']),
120
+ ours: new Set(['tools', 'call']),
120
121
  template: new Set(['list', 'show', 'validate']),
121
122
  task: new Set(['create', 'list', 'lists', 'list-create', 'list-rename', 'list-delete', 'move',
122
123
  'show', 'start', 'block', 'unblock', 'review', 'done', 'cancel', 'delete', 'work', 'finish']),
@@ -134,7 +135,8 @@ export const fleetProxyTopLevelInventory = Object.freeze({
134
135
  ], denied: [...DENIED],
135
136
  hidden: ['_run', '_run-temp', '_run-temp-worker', '_run-watchdog', '_run-watchdogs'], aliases: ['man'],
136
137
  });
137
- const globalValueOptions = new Set(['-c', '--configuration']);
138
+ // `--managed-configuration <file>` is the pinned managed entry form (src/managed-cli.ts).
139
+ const globalValueOptions = new Set(['-c', '--configuration', '--managed-configuration']);
138
140
  /** Classify before Commander parsing. Unknown and internal paths fail closed. */
139
141
  export function classifyFleetArgv(argv) {
140
142
  let command = '';
@@ -185,11 +187,17 @@ export function classifyFleetArgv(argv) {
185
187
  return { command, route: 'supervisor-proxy/public', decision: 'allow' };
186
188
  }
187
189
  const marker = (value) => value === '' ? '[REDACTED:empty]' : '[REDACTED:value]';
190
+ /**
191
+ * The pinned configuration of a managed entry (src/managed-cli.ts) is recorded
192
+ * as a fingerprint, not as its path: diagnostics must tell which configuration a
193
+ * row ran under without the ledger holding the path itself.
194
+ */
195
+ export const managedPinMarker = (configuration) => `[PIN:${createHash('sha256').update(configuration).digest('hex').slice(0, 16)}]`;
188
196
  const sensitiveValueFlags = new Set([
189
197
  '--identity', '--invite', '--token', '--api-token', '--password', '--password-file',
190
198
  '--env', '--brief', '--brief-file', '--bio-file', '--persona-file', '--isolation-file', '--loops-file',
191
- '--configuration', '-c', '--public-invite', '--public-invite-file', '--invite-file',
192
- '--summary-file', '--text', '--message', '--summary', '--reason', '--goal', '--cwd',
199
+ '--configuration', '-c', '--managed-configuration', '--public-invite', '--public-invite-file', '--invite-file',
200
+ '--args-file', '--summary-file', '--text', '--message', '--summary', '--reason', '--goal', '--cwd',
193
201
  '--identity-cid', '--owner-cid', '--contact-cid', '--codex-config', '--add-dir',
194
202
  ]);
195
203
  function redactUrl(value) {
@@ -248,6 +256,11 @@ export function redactFleetArgv(argv) {
248
256
  result[index] = `${equal[1]}=${marker(equal[2])}`;
249
257
  continue;
250
258
  }
259
+ if (index === 0 && arg === '--managed-configuration' && result.length > 1) {
260
+ result[1] = managedPinMarker(result[1]);
261
+ index++;
262
+ continue;
263
+ }
251
264
  if (sensitiveValueFlags.has(arg) && index + 1 < result.length) {
252
265
  result[index + 1] = marker(result[index + 1]);
253
266
  index++;
@@ -304,11 +317,12 @@ export class FleetCommandAuditStore {
304
317
  if (recovered)
305
318
  this.persist();
306
319
  }
307
- list() { return this.attempts.map(item => structuredClone(item)); }
320
+ list() { return redactErasedContent(this.attempts).map(item => structuredClone(item)); }
308
321
  begin(requestId, caller, argv) {
322
+ this.attempts = redactErasedContent(this.attempts);
309
323
  const existing = this.attempts.find(item => item.caller === caller && item.requestId === requestId);
310
324
  if (existing) {
311
- if (JSON.stringify(existing.argv) !== JSON.stringify(redactFleetArgv(argv)))
325
+ if (JSON.stringify(existing.argv) !== JSON.stringify(existing.erased ? redactFleetArgv(argv).map(erasedArg) : redactFleetArgv(argv)))
312
326
  throw new Error('fleet command request ID was reused with different argv');
313
327
  return structuredClone(existing);
314
328
  }
@@ -328,6 +342,8 @@ export class FleetCommandAuditStore {
328
342
  return structuredClone(attempt);
329
343
  }
330
344
  finish(correlationId, caller, outcome) {
345
+ this.attempts = redactErasedContent(this.attempts);
346
+ outcome = redactErasedContent({ outcome }).outcome;
331
347
  const attempt = this.owned(correlationId, caller);
332
348
  if (!attempt.outcome)
333
349
  attempt.outcome = { ...outcome, completedAt: this.deps.now().toISOString(), delivery: 'sending' };
@@ -359,7 +375,8 @@ export class FleetCommandAuditStore {
359
375
  return attempt;
360
376
  }
361
377
  persist() {
362
- replaceFileAtomically(this.path, `${JSON.stringify({ version: 1, attempts: this.attempts })}\n`, 0o600);
378
+ this.attempts = redactErasedContent(this.attempts);
379
+ writePrivacyFilteredLedger(this.path, { version: 1, attempts: this.attempts });
363
380
  }
364
381
  }
365
382
  const UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/iu;
@@ -30,6 +30,8 @@ export interface AgentSessionStartOptions {
30
30
  cwd: string;
31
31
  stateDir: string;
32
32
  mode: 'fresh' | 'resume';
33
+ /** Durable task context must never silently fall back to a fresh session. */
34
+ requireResume?: boolean;
33
35
  permissions: CommonPermissions;
34
36
  permissionMode: {
35
37
  fleetMode: FleetPermissionMode;
@@ -24,7 +24,7 @@ export class ClaudeCodeAgentSessionAdapter {
24
24
  return this.transport({
25
25
  name: role.name, harness: role.harness,
26
26
  argv: launch.argv, cwd: options.cwd, env: launch.env,
27
- stateDir: options.stateDir, mode: options.mode, permissions: options.permissions,
27
+ stateDir: options.stateDir, mode: options.mode, requireResume: options.requireResume, permissions: options.permissions,
28
28
  modeId: this.strategy.permissionModeId(role),
29
29
  mcpServers: options.managedOurs ? [...(this.strategy.mcpServers(role) ?? []).filter(s => s.name !== 'ours'), options.managedOurs.server] : this.strategy.mcpServers(role),
30
30
  inheritEnvironment: options.managedOurs ? false : undefined,
@@ -6,7 +6,8 @@ import { realExec } from '../exec.js';
6
6
  import { registerAdapter } from './registry.js';
7
7
  import { replaceFileAtomically, withFileLock } from '../atomic-file.js';
8
8
  import { harnessRuntimeDir } from '../isolation/policy.js';
9
- import { bundledAcpAgent } from './acp-agent.js';
9
+ import { bundledAcpAgent, resolveBundledAcpAgent } from './acp-agent.js';
10
+ import { hostClaude } from './claude-runtime.js';
10
11
  import { ClaudeCodeAgentSessionAdapter } from './claude-code-session.js';
11
12
  const OPTION_KEYS = [
12
13
  'plugins', 'mem_palace', 'mem_palace_midsession_autosave', 'permission_mode', 'effort',
@@ -283,6 +284,13 @@ export function makeClaudeCodeAdapter(exec = realExec, transport) {
283
284
  };
284
285
  if (!memPalace)
285
286
  env.MEMPALACE_DISABLED = 'true';
287
+ // The bundled adapter runs the Claude Code shipped with its SDK unless told otherwise. A host
288
+ // Claude Code at least as new as that copy is the one the person updates, so sessions run it.
289
+ if (!customAcpCommand(role)) {
290
+ const host = hostClaude(resolveBundledAcpAgent('@agentclientprotocol/claude-agent-acp', 'claude-agent-acp', 'claude-agent-acp').manifestPath, { ...process.env, ...role.env }, dirs.runCwd);
291
+ if (host)
292
+ env.CLAUDE_CODE_EXECUTABLE = host.path;
293
+ }
286
294
  // Per-role harness runtime home. Created before sandbox entry so the
287
295
  // bind has something to mount; harmless for un-isolated roles.
288
296
  // Only a role that declares `isolation:` gets a sandbox, and only a
@@ -377,16 +385,17 @@ export function makeClaudeCodeAdapter(exec = realExec, transport) {
377
385
  supervisedWakeNote: () => 'Your mail wake-ups are delivered by the fleet supervisor directly into this console as ' +
378
386
  '`[fleet-monitor]` lines — do NOT arm an in-session Monitor. When such a line appears, run ' +
379
387
  '**get_messages** to drain the mail.',
380
- launchNote: name => `You were launched with \`--remote-control ${name}\`. Confirm you are running.`,
381
- restartPrompt: (id, worklog, role) => `Session restarted. Re-bind your ours identity now (choose_identity name "${id}" force=true), ` +
382
- (role?.monitor?.mode === 'fleet'
383
- ? 'then continue from '
384
- : `then ${armMonitor(id)}, then continue from `) +
385
- `${worklog}. Do not re-run whatever crashed you.` +
386
- (role?.monitor?.mode === 'fleet'
387
- ? ' Your mail wakes arrive as `[fleet-monitor]` console lines from the supervisor — ' +
388
- 'do NOT arm an in-session Monitor.'
389
- : ''),
388
+ launchNote: name => `You were launched as Fleet role \`${name}\` under a Claude session. Announce console readiness before task details.`,
389
+ restartPrompt: (id, worklog, role) => role?.monitor?.mode === 'fleet'
390
+ ? `Session restarted. The supervisor has verified assigned identity "${id}"; ` +
391
+ 'accept that readiness and continue without rebinding or profile reconciliation. ' +
392
+ 'Your mail wakes arrive as `[fleet-monitor]` console lines from the supervisor — ' +
393
+ 'do NOT arm an in-session Monitor. ' +
394
+ 'Announce console readiness first without tools, then end that readiness turn. ' +
395
+ `For a separate continuation task, read ${worklog} once for continuity and reuse it in that wake. ` +
396
+ 'Do not re-run whatever crashed you.'
397
+ : `Session restarted. Re-bind your ours identity now (choose_identity name "${id}" force=true), ` +
398
+ `then ${armMonitor(id)}, then continue from ${worklog}. Do not re-run whatever crashed you.`,
390
399
  },
391
400
  exitPolicy: { cleanExitIsFresh: true, fastFailSecs: 20 },
392
401
  };
@@ -0,0 +1,12 @@
1
+ /** The Claude Code version shipped inside the adapter's own SDK dependency. */
2
+ export declare function bundledClaudeVersion(adapterManifest: string): string | undefined;
3
+ /**
4
+ * The host's own Claude Code, when ACP sessions should run it instead of the copy bundled with the adapter.
5
+ * The person signs in to, updates and checks the host Claude Code, and a newer one knows models the bundled
6
+ * one does not. It is used only when it is at least as new as the bundled copy; an explicit
7
+ * CLAUDE_CODE_EXECUTABLE, in the role or the service environment, always decides instead.
8
+ */
9
+ export declare function hostClaude(adapterManifest: string | undefined, env: NodeJS.ProcessEnv, cwd?: string, version?: (path: string, env: NodeJS.ProcessEnv) => string | undefined): {
10
+ path: string;
11
+ version: string;
12
+ } | undefined;
@@ -0,0 +1,43 @@
1
+ import { readFileSync } from 'node:fs';
2
+ import { createRequire } from 'node:module';
3
+ import { dirname, join } from 'node:path';
4
+ import { spawnSync } from 'node:child_process';
5
+ import { codexVersionAtLeast, executableOnPath } from './codex-runtime.js';
6
+ const versionOf = (text) => text.match(/\b(\d+\.\d+\.\d+)\b/)?.[1];
7
+ function installedClaudeVersion(path, env) {
8
+ const result = spawnSync(path, ['--version'], { env, encoding: 'utf8', timeout: 5_000, stdio: ['ignore', 'pipe', 'ignore'] });
9
+ return result.status === 0 ? versionOf(result.stdout ?? '') : undefined;
10
+ }
11
+ /** The Claude Code version shipped inside the adapter's own SDK dependency. */
12
+ export function bundledClaudeVersion(adapterManifest) {
13
+ try {
14
+ const sdk = dirname(createRequire(adapterManifest).resolve('@anthropic-ai/claude-agent-sdk'));
15
+ const version = JSON.parse(readFileSync(join(sdk, 'package.json'), 'utf8')).claudeCodeVersion;
16
+ return typeof version === 'string' ? version : undefined;
17
+ }
18
+ catch {
19
+ return undefined;
20
+ }
21
+ }
22
+ /**
23
+ * The host's own Claude Code, when ACP sessions should run it instead of the copy bundled with the adapter.
24
+ * The person signs in to, updates and checks the host Claude Code, and a newer one knows models the bundled
25
+ * one does not. It is used only when it is at least as new as the bundled copy; an explicit
26
+ * CLAUDE_CODE_EXECUTABLE, in the role or the service environment, always decides instead.
27
+ */
28
+ export function hostClaude(adapterManifest, env, cwd = process.cwd(), version = installedClaudeVersion) {
29
+ if (env.CLAUDE_CODE_EXECUTABLE !== undefined || !adapterManifest)
30
+ return undefined;
31
+ const bundled = bundledClaudeVersion(adapterManifest);
32
+ if (!bundled)
33
+ return undefined;
34
+ let path;
35
+ try {
36
+ path = executableOnPath('claude', env, cwd);
37
+ }
38
+ catch {
39
+ return undefined;
40
+ }
41
+ const found = version(path, env);
42
+ return found && codexVersionAtLeast(found, bundled) ? { path, version: found } : undefined;
43
+ }
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ type JsonObject = Record<string, unknown>;
2
3
  interface TerminalRecoveryOptions {
3
4
  sendToCodex(line: string): void;
4
5
  emitToClient(line: string): void;
@@ -39,6 +40,8 @@ export declare class CodexTerminalRecovery {
39
40
  private finishTurn;
40
41
  }
41
42
  /** Transform one app-server NDJSON request; malformed input passes through. */
42
- export declare function rewriteCodexAppServerRequest(line: string, approval: string, expectedSandbox: string, disableInheritedMcp?: boolean): string;
43
+ export declare function rewriteCodexAppServerRequest(line: string, approval: string, expectedSandbox: string, disableInheritedMcp?: boolean, managedOursTools?: JsonObject): string;
44
+ /** ACP only carries transport fields; read policy from Fleet's complete config. */
45
+ export declare function managedCodexToolPolicy(env: NodeJS.ProcessEnv): JsonObject | undefined;
43
46
  export declare function runCodexAppServerProxy(): void;
44
47
  export {};
@@ -300,9 +300,9 @@ function sandboxMode(policy) {
300
300
  * Fleet keeps the preset's sandbox policy, but restores the independently
301
301
  * configured approval policy on the request Codex actually executes.
302
302
  */
303
- function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp) {
303
+ function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp, managedOursTools) {
304
304
  if (Array.isArray(value))
305
- return value.map(candidate => rewriteMessage(candidate, approval, expectedSandbox, disableInheritedMcp));
305
+ return value.map(candidate => rewriteMessage(candidate, approval, expectedSandbox, disableInheritedMcp, managedOursTools));
306
306
  if (!isObject(value) || !isObject(value.params))
307
307
  return value;
308
308
  if (value.method === 'turn/start') {
@@ -318,17 +318,52 @@ function rewriteMessage(value, approval, expectedSandbox, disableInheritedMcp) {
318
318
  params: { ...value.params, config: { ...config, mcp_servers: {} } },
319
319
  };
320
320
  }
321
+ if (managedOursTools
322
+ && (value.method === 'thread/start' || value.method === 'thread/resume')) {
323
+ const config = isObject(value.params.config) ? value.params.config : {};
324
+ const servers = isObject(config.mcp_servers) ? config.mcp_servers : {};
325
+ const ours = servers.ours;
326
+ // Policy cannot create or re-enable a connector that ACP did not inject.
327
+ if (!isObject(ours) || ours.enabled === false)
328
+ return value;
329
+ const tools = isObject(ours.tools) ? { ...ours.tools } : {};
330
+ for (const [name, policy] of Object.entries(managedOursTools)) {
331
+ if (isObject(policy))
332
+ tools[name] = {
333
+ ...(isObject(tools[name]) ? tools[name] : {}), ...policy,
334
+ };
335
+ }
336
+ return { ...value, params: { ...value.params, config: { ...config,
337
+ mcp_servers: { ...servers, ours: { ...ours, tools } },
338
+ } } };
339
+ }
321
340
  return value;
322
341
  }
323
342
  /** Transform one app-server NDJSON request; malformed input passes through. */
324
- export function rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp = false) {
343
+ export function rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp = false, managedOursTools) {
325
344
  try {
326
- return JSON.stringify(rewriteMessage(JSON.parse(line), approval, expectedSandbox, disableInheritedMcp));
345
+ return JSON.stringify(rewriteMessage(JSON.parse(line), approval, expectedSandbox, disableInheritedMcp, managedOursTools));
327
346
  }
328
347
  catch {
329
348
  return line;
330
349
  }
331
350
  }
351
+ /** ACP only carries transport fields; read policy from Fleet's complete config. */
352
+ export function managedCodexToolPolicy(env) {
353
+ if (env.FLEET_OURS_MANAGED !== '1')
354
+ return undefined;
355
+ try {
356
+ const config = JSON.parse(env.CODEX_CONFIG ?? '{}');
357
+ const servers = isObject(config) ? config.mcp_servers : undefined;
358
+ const ours = isObject(servers) ? servers.ours : undefined;
359
+ return isObject(ours) && ours.enabled !== false && isObject(ours.tools)
360
+ ? ours.tools : undefined;
361
+ }
362
+ catch {
363
+ // Invalid config never grants tool approval. ACP owns config diagnostics.
364
+ return undefined;
365
+ }
366
+ }
332
367
  function requiredChoice(name, allowed) {
333
368
  const value = process.env[name];
334
369
  if (value && allowed.has(value))
@@ -355,6 +390,7 @@ export function runCodexAppServerProxy() {
355
390
  const approval = requiredChoice(APPROVAL_ENV, APPROVAL_POLICIES);
356
391
  const expectedSandbox = requiredChoice(SANDBOX_ENV, SANDBOX_MODES);
357
392
  const disableInheritedMcp = process.env[DISABLE_INHERITED_MCP_ENV] === '1';
393
+ const managedOursTools = managedCodexToolPolicy(process.env);
358
394
  const launch = realCodexLaunch();
359
395
  const env = { ...process.env };
360
396
  delete env.CODEX_PATH;
@@ -450,7 +486,7 @@ export function runCodexAppServerProxy() {
450
486
  input.on('line', line => {
451
487
  if (finished)
452
488
  return;
453
- const rewritten = rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp);
489
+ const rewritten = rewriteCodexAppServerRequest(line, approval, expectedSandbox, disableInheritedMcp, managedOursTools);
454
490
  recovery.observeClientLine(rewritten);
455
491
  writeToChild(rewritten);
456
492
  });
@@ -0,0 +1,5 @@
1
+ /** Efforts supported by Fleet's Codex Brain contract. Keep native eligibility in sync. */
2
+ export declare const CODEX_REASONING_EFFORTS: readonly ["low", "medium", "high", "xhigh", "max", "ultra"];
3
+ export declare function isCodexReasoningEffort(value: unknown): value is string;
4
+ /** Only inspected model tuning may bypass the managed CLI native-config guard. */
5
+ export declare function isManagedCliCodexConfig(config: unknown): boolean;
@@ -0,0 +1,12 @@
1
+ /** Efforts supported by Fleet's Codex Brain contract. Keep native eligibility in sync. */
2
+ export const CODEX_REASONING_EFFORTS = ['low', 'medium', 'high', 'xhigh', 'max', 'ultra'];
3
+ export function isCodexReasoningEffort(value) {
4
+ return typeof value === 'string' && CODEX_REASONING_EFFORTS.includes(value);
5
+ }
6
+ /** Only inspected model tuning may bypass the managed CLI native-config guard. */
7
+ export function isManagedCliCodexConfig(config) {
8
+ if (config == null)
9
+ return true;
10
+ return typeof config === 'object' && !Array.isArray(config)
11
+ && Object.entries(config).every(([key, value]) => key === 'model_reasoning_effort' && isCodexReasoningEffort(value));
12
+ }
@@ -4,8 +4,18 @@ export declare const VERIFIED_CODEX_ACP_VERSIONS: Set<string>;
4
4
  export declare function executableOnPath(command: string, env: NodeJS.ProcessEnv, cwd?: string): string;
5
5
  /** Match the npm Codex wrapper's platform-package/vendor selection. */
6
6
  export declare function codexExecutable(entry: string): string;
7
+ /**
8
+ * The host's own Codex, when ACP sessions should run it instead of the copy bundled with the adapter.
9
+ * The person signs in to, updates and checks the host Codex, and a newer Codex knows models the bundled
10
+ * one does not. It is used only when it is at least as new as the bundled copy; an explicit CODEX_PATH
11
+ * (including an empty one, which selects the bundled copy) always decides instead.
12
+ */
13
+ export declare function hostCodex(adapterManifest: string | undefined, env: NodeJS.ProcessEnv, cwd?: string, version?: (path: string, env: NodeJS.ProcessEnv) => string | undefined): {
14
+ path: string;
15
+ version: string;
16
+ } | undefined;
7
17
  export interface CodexRuntime {
8
- source: 'CODEX_PATH' | 'bundled';
18
+ source: 'CODEX_PATH' | 'host' | 'bundled';
9
19
  entry: string;
10
20
  executable: string;
11
21
  version: string;
@@ -1,5 +1,6 @@
1
1
  import { createRequire } from 'node:module';
2
- import { accessSync, constants, existsSync, realpathSync } from 'node:fs';
2
+ import { spawnSync } from 'node:child_process';
3
+ import { accessSync, constants, existsSync, readFileSync, realpathSync } from 'node:fs';
3
4
  import { dirname, join, isAbsolute, resolve, delimiter } from 'node:path';
4
5
  import { realExec } from '../exec.js';
5
6
  export const VERIFIED_CODEX_ACP_VERSIONS = new Set(['1.1.7', '1.10.0']);
@@ -46,18 +47,44 @@ export function codexExecutable(entry) {
46
47
  }
47
48
  throw new Error(`Codex platform binary missing under ${vendor}; reinstall Fleet with optional dependencies`);
48
49
  }
50
+ const versionOf = (text) => text.match(/\b(\d+\.\d+\.\d+)\b/)?.[1];
51
+ function installedCodexVersion(path, env) {
52
+ const result = spawnSync(path, ['--version'], { env, encoding: 'utf8', timeout: 5_000, stdio: ['ignore', 'pipe', 'ignore'] });
53
+ return result.status === 0 ? versionOf(result.stdout ?? '') : undefined;
54
+ }
55
+ /**
56
+ * The host's own Codex, when ACP sessions should run it instead of the copy bundled with the adapter.
57
+ * The person signs in to, updates and checks the host Codex, and a newer Codex knows models the bundled
58
+ * one does not. It is used only when it is at least as new as the bundled copy; an explicit CODEX_PATH
59
+ * (including an empty one, which selects the bundled copy) always decides instead.
60
+ */
61
+ export function hostCodex(adapterManifest, env, cwd = process.cwd(), version = installedCodexVersion) {
62
+ if (env.CODEX_PATH !== undefined || !adapterManifest)
63
+ return undefined;
64
+ let path, bundled;
65
+ try {
66
+ path = executableOnPath('codex', env, cwd);
67
+ bundled = JSON.parse(readFileSync(createRequire(adapterManifest).resolve('@openai/codex/package.json'), 'utf8')).version;
68
+ }
69
+ catch {
70
+ return undefined;
71
+ }
72
+ const found = version(path, env);
73
+ return found && typeof bundled === 'string' && codexVersionAtLeast(found, bundled) ? { path, version: found } : undefined;
74
+ }
49
75
  export async function probeCodexRuntime(adapter, env, exec = realExec, cwd = process.cwd()) {
50
- const configured = env.CODEX_PATH;
76
+ const host = hostCodex(adapter.manifestPath, env, cwd);
77
+ const configured = env.CODEX_PATH || host?.path;
51
78
  if (!configured && !adapter.manifestPath)
52
79
  throw new Error('ACP runtime is unknown for a PATH/custom adapter; set CODEX_PATH to an absolute executable or use the bundled adapter');
53
80
  const entry = configured ? executableOnPath(configured, env, cwd)
54
81
  : createRequire(adapter.manifestPath).resolve('@openai/codex/bin/codex.js');
55
82
  const executable = codexExecutable(entry);
56
83
  const result = await exec(!configured ? process.execPath : entry, !configured ? [entry, '--version'] : ['--version'], { env, timeout: 5_000 });
57
- const version = result.stdout.match(/\b(\d+\.\d+\.\d+)\b/)?.[1];
84
+ const version = versionOf(result.stdout);
58
85
  if (result.code !== 0 || !version)
59
86
  throw new Error(`Cannot read Codex version from ${entry}; check CODEX_PATH and executable permissions`);
60
- return { source: configured ? 'CODEX_PATH' : 'bundled', entry, executable, version };
87
+ return { source: host ? 'host' : configured ? 'CODEX_PATH' : 'bundled', entry, executable, version };
61
88
  }
62
89
  export function codexVersionAtLeast(version, minimum) {
63
90
  const actual = version.split('.').map(Number);
@@ -32,7 +32,7 @@ export class CodexAgentSessionAdapter {
32
32
  if (role.session === 'codex-app-server')
33
33
  return this.nativeTransport({
34
34
  name: role.name, argv: launch.argv, cwd: options.cwd, env: launch.env,
35
- stateDir: options.stateDir, mode: options.mode, permissions: options.permissions,
35
+ stateDir: options.stateDir, mode: options.mode, requireResume: options.requireResume, permissions: options.permissions,
36
36
  permissionMode: options.permissionMode,
37
37
  model: role.model, effort: role.effort,
38
38
  approvalPolicy: this.strategy.approvalPolicy(role),
@@ -44,7 +44,7 @@ export class CodexAgentSessionAdapter {
44
44
  return this.transport({
45
45
  name: role.name, harness: role.harness,
46
46
  argv: launch.argv, cwd: options.cwd, env: launch.env,
47
- stateDir: options.stateDir, mode: options.mode, permissions: options.permissions,
47
+ stateDir: options.stateDir, mode: options.mode, requireResume: options.requireResume, permissions: options.permissions,
48
48
  modeId: this.strategy.permissionModeId(role),
49
49
  mcpServers: options.managedOurs ? [...(this.strategy.mcpServers(role) ?? []).filter(s => s.name !== 'ours'), options.managedOurs.server] : this.strategy.mcpServers(role),
50
50
  inheritEnvironment: options.managedOurs ? false : undefined,
@@ -6,8 +6,9 @@ import { realExec } from '../exec.js';
6
6
  import { registerAdapter } from './registry.js';
7
7
  import { harnessRuntimeDir } from '../isolation/policy.js';
8
8
  import { resolveBundledAcpAgent, } from './acp-agent.js';
9
- import { VERIFIED_CODEX_ACP_VERSIONS, probeCodexRuntime, codexVersionAtLeast } from './codex-runtime.js';
9
+ import { VERIFIED_CODEX_ACP_VERSIONS, probeCodexRuntime, codexVersionAtLeast, hostCodex } from './codex-runtime.js';
10
10
  import { CodexAgentSessionAdapter } from './codex-session.js';
11
+ import { CODEX_REASONING_EFFORTS, isCodexReasoningEffort } from './codex-reasoning.js';
11
12
  const OPTION_KEYS = [
12
13
  'launcher', 'sandbox', 'approval', 'permission_mode', 'search', 'profile', 'config', 'add_dirs',
13
14
  'monitor',
@@ -141,6 +142,13 @@ function neutralSandboxMode(role) {
141
142
  function isNativeConfigKeyAllowed(key) {
142
143
  return NATIVE_CONFIG_ALLOWLIST.has(key);
143
144
  }
145
+ /** Brain wins; a validated native effort also needs delivery through ACP's selection API. */
146
+ function reasoningEffort(role) {
147
+ if (typeof role.effort === 'string')
148
+ return role.effort;
149
+ const value = role.harness_options?.config?.model_reasoning_effort;
150
+ return isCodexReasoningEffort(value) ? value : undefined;
151
+ }
144
152
  /** Defense in depth for callers which launch a role after validation was bypassed. */
145
153
  export function nativeCodexConfig(role) {
146
154
  const options = role.harness_options;
@@ -266,7 +274,9 @@ function codexAcpEnvironment(role, dirs) {
266
274
  [CODEX_PROXY_APPROVAL_ENV]: approvalPolicy(role) ?? 'on-request',
267
275
  [CODEX_PROXY_SANDBOX_ENV]: acpRuntimeSandbox(role),
268
276
  [CODEX_PROXY_MANIFEST_ENV]: resolution.manifestPath,
269
- [CODEX_PROXY_REAL_PATH_ENV]: role.env?.CODEX_PATH ?? process.env.CODEX_PATH ?? '',
277
+ // Same choice as probeCodexRuntime: an explicit CODEX_PATH, else a host Codex at least as new as the bundled one.
278
+ [CODEX_PROXY_REAL_PATH_ENV]: role.env?.CODEX_PATH ?? process.env.CODEX_PATH
279
+ ?? hostCodex(resolution.manifestPath, { ...process.env, ...role.env }, dirs.runCwd)?.path ?? '',
270
280
  };
271
281
  }
272
282
  function encodeTomlValue(value) {
@@ -316,10 +326,8 @@ export function makeCodexAdapter(exec = realExec, transport, nativeTransport) {
316
326
  id: 'codex',
317
327
  agentSession: new CodexAgentSessionAdapter({
318
328
  resolveBrain(brain) {
319
- const levels = ['low', 'medium', 'high', 'xhigh', 'max', 'ultra'];
320
- if (brain.effort != null
321
- && (typeof brain.effort !== 'string' || !levels.includes(brain.effort)))
322
- throw new Error(`Codex Brain effort must be one of: ${levels.join(', ')}`);
329
+ if (brain.effort != null && !isCodexReasoningEffort(brain.effort))
330
+ throw new Error(`Codex Brain effort must be one of: ${CODEX_REASONING_EFFORTS.join(', ')}`);
323
331
  const harnessOptions = { ...(brain.harnessOptions ?? {}) };
324
332
  if (brain.effort)
325
333
  harnessOptions.config = {
@@ -341,8 +349,8 @@ export function makeCodexAdapter(exec = realExec, transport, nativeTransport) {
341
349
  sessionConfigSelections: role => [
342
350
  ...(typeof role.model === 'string'
343
351
  ? [{ configId: 'model', value: role.model }] : []),
344
- ...(typeof role.effort === 'string'
345
- ? [{ configId: 'reasoning_effort', value: role.effort }] : []),
352
+ ...(reasoningEffort(role)
353
+ ? [{ configId: 'reasoning_effort', value: reasoningEffort(role) }] : []),
346
354
  ],
347
355
  permissionModeId: role => acpAgentMode(role),
348
356
  mcpServers: () => undefined,
@@ -613,12 +621,15 @@ export function makeCodexAdapter(exec = realExec, transport, nativeTransport) {
613
621
  supervisedWakeNote: () => 'Your mail wake-ups are delivered by the fleet supervisor directly into this console as ' +
614
622
  '`[fleet-monitor]` lines — do NOT arm arm_monitor or foreground_monitor. When such a line ' +
615
623
  'appears, call **get_messages**, handle the mail, and reply with send_message.',
616
- launchNote: name => `You were launched as the fleet role \`${name}\` under a Codex session. Confirm you are running.`,
624
+ launchNote: name => `You were launched as the fleet role \`${name}\` under a Codex session. Announce console readiness before task details.`,
617
625
  restartPrompt: (id, worklog, configuredRole) => {
618
626
  if (configuredRole?.monitor?.mode === 'fleet')
619
- return `Session restarted. Re-bind your ours identity now (choose_identity name "${id}" force=true); ` +
620
- 'your mail wakes are delivered by the fleet supervisor as `[fleet-monitor]` console lines, so do ' +
621
- `NOT arm arm_monitor/foreground_monitor. Continue from ${worklog}. Do not re-run whatever crashed you.`;
627
+ return `Session restarted. The supervisor has verified assigned identity "${id}"; ` +
628
+ 'accept that readiness and continue without rebinding or profile reconciliation. ' +
629
+ 'Mail wakes arrive as `[fleet-monitor]` lines; do NOT arm arm_monitor/foreground_monitor. ' +
630
+ 'Announce console readiness first without tools, then end that readiness turn. ' +
631
+ `For a separate continuation task, read ${worklog} once for continuity and reuse it in that wake. ` +
632
+ 'Do not re-run whatever crashed you.';
622
633
  const consented = configuredRole?.harness_options?.monitor === true;
623
634
  return `Session restarted. Re-bind your ours identity now (choose_identity name "${id}" force=true), ` +
624
635
  (consented
@@ -53,6 +53,8 @@ export declare function validateCatalog(value: BrainCatalog, path?: string): Bra
53
53
  export declare function readInitSettings(path: string): InitAnswers;
54
54
  export declare function askInitQuestions(prompter: InitPrompter, configuration: string): Promise<InitAnswers | undefined>;
55
55
  export declare function formatSetupSummary(answers: InitAnswers, configuration: string): string;
56
+ /** The packaged Brain preset for a catalog model at one effort; the same naming the presets are generated with. */
57
+ export declare function brainPresetId(model: Pick<CatalogModel, 'harness' | 'model'>, effort: string): string;
56
58
  /** Build the exact, deterministic default experience without writing to disk. */
57
59
  export declare function generateSetup(answers: InitAnswers): GeneratedSetup;
58
60
  /** Run the mutation boundary only after the complete questionnaire is accepted. */