@elie-laloum/outpost 9.1.1 → 11.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (480) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/README.md +4 -0
  3. package/SECURITY.md +10 -2
  4. package/dist/adapters/agents/antigravity/antigravity-adapter.js +2 -0
  5. package/dist/adapters/agents/antigravity/antigravity-adapter.js.map +1 -1
  6. package/dist/adapters/agents/antigravity/antigravity-request.js +4 -4
  7. package/dist/adapters/agents/antigravity/antigravity-request.js.map +1 -1
  8. package/dist/adapters/agents/antigravity/antigravity.types.d.ts +2 -0
  9. package/dist/adapters/agents/antigravity/antigravity.types.js.map +1 -1
  10. package/dist/adapters/agents/claude/claude-adapter.js +3 -0
  11. package/dist/adapters/agents/claude/claude-adapter.js.map +1 -1
  12. package/dist/adapters/agents/claude/claude-profile.constants.d.ts +6 -0
  13. package/dist/adapters/agents/claude/claude-profile.constants.js +25 -0
  14. package/dist/adapters/agents/claude/claude-profile.constants.js.map +1 -0
  15. package/dist/adapters/agents/claude/claude-profile.d.ts +3 -0
  16. package/dist/adapters/agents/claude/claude-profile.js +69 -0
  17. package/dist/adapters/agents/claude/claude-profile.js.map +1 -0
  18. package/dist/adapters/agents/claude/claude-request.js +9 -3
  19. package/dist/adapters/agents/claude/claude-request.js.map +1 -1
  20. package/dist/adapters/agents/codex/codex-adapter.js +2 -0
  21. package/dist/adapters/agents/codex/codex-adapter.js.map +1 -1
  22. package/dist/adapters/agents/codex/codex-app-session.js +3 -0
  23. package/dist/adapters/agents/codex/codex-app-session.js.map +1 -1
  24. package/dist/adapters/agents/codex/codex-profile.d.ts +2 -0
  25. package/dist/adapters/agents/codex/codex-profile.js +9 -0
  26. package/dist/adapters/agents/codex/codex-profile.js.map +1 -0
  27. package/dist/adapters/agents/codex/codex-request.js +5 -1
  28. package/dist/adapters/agents/codex/codex-request.js.map +1 -1
  29. package/dist/adapters/agents/copilot/copilot-adapter.js +2 -0
  30. package/dist/adapters/agents/copilot/copilot-adapter.js.map +1 -1
  31. package/dist/adapters/agents/copilot/copilot-request.js +4 -2
  32. package/dist/adapters/agents/copilot/copilot-request.js.map +1 -1
  33. package/dist/adapters/agents/copilot/copilot.types.d.ts +2 -0
  34. package/dist/adapters/agents/copilot/copilot.types.js.map +1 -1
  35. package/dist/adapters/agents/kimi/kimi-adapter.js +3 -0
  36. package/dist/adapters/agents/kimi/kimi-adapter.js.map +1 -1
  37. package/dist/adapters/agents/kimi/kimi-request.js +4 -2
  38. package/dist/adapters/agents/kimi/kimi-request.js.map +1 -1
  39. package/dist/adapters/agents/kimi/kimi.types.d.ts +2 -0
  40. package/dist/adapters/agents/kimi/kimi.types.js.map +1 -1
  41. package/dist/adapters/agents/model-support.js +5 -3
  42. package/dist/adapters/agents/model-support.js.map +1 -1
  43. package/dist/adapters/agents/profile-support.d.ts +3 -0
  44. package/dist/adapters/agents/profile-support.js +10 -0
  45. package/dist/adapters/agents/profile-support.js.map +1 -0
  46. package/dist/adapters/agents/settings.types.d.ts +3 -0
  47. package/dist/adapters/agents/settings.types.js.map +1 -1
  48. package/dist/adapters/models/model-prices.constants.d.ts +10 -0
  49. package/dist/adapters/models/model-prices.constants.js +11 -0
  50. package/dist/adapters/models/model-prices.constants.js.map +1 -0
  51. package/dist/adapters/models/model-prices.d.ts +3 -0
  52. package/dist/adapters/models/model-prices.js +105 -0
  53. package/dist/adapters/models/model-prices.js.map +1 -0
  54. package/dist/adapters/models/model-prices.types.d.ts +11 -0
  55. package/dist/adapters/models/model-prices.types.js +2 -0
  56. package/dist/adapters/models/model-prices.types.js.map +1 -0
  57. package/dist/adapters/secrets/aws.d.ts +4 -0
  58. package/dist/adapters/secrets/aws.js +43 -0
  59. package/dist/adapters/secrets/aws.js.map +1 -0
  60. package/dist/adapters/secrets/aws.types.d.ts +11 -0
  61. package/dist/adapters/secrets/aws.types.js +2 -0
  62. package/dist/adapters/secrets/aws.types.js.map +1 -0
  63. package/dist/adapters/secrets/azure.d.ts +4 -0
  64. package/dist/adapters/secrets/azure.js +23 -0
  65. package/dist/adapters/secrets/azure.js.map +1 -0
  66. package/dist/adapters/secrets/azure.types.d.ts +9 -0
  67. package/dist/adapters/secrets/azure.types.js +2 -0
  68. package/dist/adapters/secrets/azure.types.js.map +1 -0
  69. package/dist/adapters/secrets/gcp.d.ts +4 -0
  70. package/dist/adapters/secrets/gcp.js +28 -0
  71. package/dist/adapters/secrets/gcp.js.map +1 -0
  72. package/dist/adapters/secrets/gcp.types.d.ts +5 -0
  73. package/dist/adapters/secrets/gcp.types.js +2 -0
  74. package/dist/adapters/secrets/gcp.types.js.map +1 -0
  75. package/dist/adapters/secrets/infisical.d.ts +4 -0
  76. package/dist/adapters/secrets/infisical.js +40 -0
  77. package/dist/adapters/secrets/infisical.js.map +1 -0
  78. package/dist/adapters/secrets/infisical.types.d.ts +11 -0
  79. package/dist/adapters/secrets/infisical.types.js +2 -0
  80. package/dist/adapters/secrets/infisical.types.js.map +1 -0
  81. package/dist/adapters/secrets/onepassword.d.ts +4 -0
  82. package/dist/adapters/secrets/onepassword.js +12 -0
  83. package/dist/adapters/secrets/onepassword.js.map +1 -0
  84. package/dist/adapters/secrets/onepassword.types.d.ts +7 -0
  85. package/dist/adapters/secrets/onepassword.types.js +2 -0
  86. package/dist/adapters/secrets/onepassword.types.js.map +1 -0
  87. package/dist/adapters/secrets/secret-source.d.ts +4 -0
  88. package/dist/adapters/secrets/secret-source.js +29 -0
  89. package/dist/adapters/secrets/secret-source.js.map +1 -0
  90. package/dist/adapters/secrets/secret-source.types.d.ts +2 -0
  91. package/dist/adapters/secrets/secret-source.types.js +2 -0
  92. package/dist/adapters/secrets/secret-source.types.js.map +1 -0
  93. package/dist/adapters/secrets/vault-response.d.ts +1 -0
  94. package/dist/adapters/secrets/vault-response.js +43 -0
  95. package/dist/adapters/secrets/vault-response.js.map +1 -0
  96. package/dist/adapters/secrets/vault.constants.d.ts +1 -0
  97. package/dist/adapters/secrets/vault.constants.js +2 -0
  98. package/dist/adapters/secrets/vault.constants.js.map +1 -0
  99. package/dist/adapters/secrets/vault.d.ts +4 -0
  100. package/dist/adapters/secrets/vault.js +63 -0
  101. package/dist/adapters/secrets/vault.js.map +1 -0
  102. package/dist/adapters/secrets/vault.types.d.ts +8 -0
  103. package/dist/adapters/secrets/vault.types.js +2 -0
  104. package/dist/adapters/secrets/vault.types.js.map +1 -0
  105. package/dist/adapters/testing/scripted-agent.d.ts +3 -0
  106. package/dist/adapters/testing/scripted-agent.js +72 -0
  107. package/dist/adapters/testing/scripted-agent.js.map +1 -0
  108. package/dist/adapters/testing/scripted-agent.types.d.ts +17 -0
  109. package/dist/adapters/testing/scripted-agent.types.js +2 -0
  110. package/dist/adapters/testing/scripted-agent.types.js.map +1 -0
  111. package/dist/application/activity-watchdog.d.ts +2 -1
  112. package/dist/application/activity-watchdog.js +2 -1
  113. package/dist/application/activity-watchdog.js.map +1 -1
  114. package/dist/application/agent-conflict-resolver.d.ts +3 -0
  115. package/dist/application/agent-conflict-resolver.js +71 -0
  116. package/dist/application/agent-conflict-resolver.js.map +1 -0
  117. package/dist/application/agent-turn.js +17 -2
  118. package/dist/application/agent-turn.js.map +1 -1
  119. package/dist/application/conflict-merge.d.ts +5 -0
  120. package/dist/application/conflict-merge.js +31 -0
  121. package/dist/application/conflict-merge.js.map +1 -0
  122. package/dist/application/conflict-resolution.constants.d.ts +4 -0
  123. package/dist/application/conflict-resolution.constants.js +5 -0
  124. package/dist/application/conflict-resolution.constants.js.map +1 -0
  125. package/dist/application/conflict-resolution.types.d.ts +35 -0
  126. package/dist/application/conflict-resolution.types.js +2 -0
  127. package/dist/application/conflict-resolution.types.js.map +1 -0
  128. package/dist/application/conflict-verification.d.ts +4 -0
  129. package/dist/application/conflict-verification.js +45 -0
  130. package/dist/application/conflict-verification.js.map +1 -0
  131. package/dist/application/custom-turn.js +12 -6
  132. package/dist/application/custom-turn.js.map +1 -1
  133. package/dist/application/decision-task.js +4 -1
  134. package/dist/application/decision-task.js.map +1 -1
  135. package/dist/application/dispatch-observation.js +49 -5
  136. package/dist/application/dispatch-observation.js.map +1 -1
  137. package/dist/application/dispatch-observation.types.d.ts +3 -0
  138. package/dist/application/dispatch-observation.types.js.map +1 -1
  139. package/dist/application/dispatch-validation.js +16 -7
  140. package/dist/application/dispatch-validation.js.map +1 -1
  141. package/dist/application/dispatch.js +14 -0
  142. package/dist/application/dispatch.js.map +1 -1
  143. package/dist/application/execution.js +35 -18
  144. package/dist/application/execution.js.map +1 -1
  145. package/dist/application/execution.types.d.ts +8 -0
  146. package/dist/application/execution.types.js.map +1 -1
  147. package/dist/application/harness-budget.js +2 -1
  148. package/dist/application/harness-budget.js.map +1 -1
  149. package/dist/application/harness-model-provider.js +18 -3
  150. package/dist/application/harness-model-provider.js.map +1 -1
  151. package/dist/application/harness-model-provider.types.d.ts +1 -0
  152. package/dist/application/harness-model-provider.types.js.map +1 -1
  153. package/dist/application/harness-routing.js +7 -1
  154. package/dist/application/harness-routing.js.map +1 -1
  155. package/dist/application/harness-subagent.js +3 -0
  156. package/dist/application/harness-subagent.js.map +1 -1
  157. package/dist/application/harness.types.d.ts +1 -1
  158. package/dist/application/harness.types.js.map +1 -1
  159. package/dist/application/interactive-task-execution.js +1 -0
  160. package/dist/application/interactive-task-execution.js.map +1 -1
  161. package/dist/application/interactive-task-protocol.js +2 -0
  162. package/dist/application/interactive-task-protocol.js.map +1 -1
  163. package/dist/application/interactive-task.constants.d.ts +53 -0
  164. package/dist/application/interactive-task.constants.js +29 -0
  165. package/dist/application/interactive-task.constants.js.map +1 -1
  166. package/dist/application/lifecycle-hooks.d.ts +4 -2
  167. package/dist/application/lifecycle-hooks.js +46 -12
  168. package/dist/application/lifecycle-hooks.js.map +1 -1
  169. package/dist/application/lifecycle.constants.d.ts +1 -1
  170. package/dist/application/lifecycle.constants.js +1 -0
  171. package/dist/application/lifecycle.constants.js.map +1 -1
  172. package/dist/application/outpost.types.d.ts +6 -0
  173. package/dist/application/outpost.types.js.map +1 -1
  174. package/dist/application/repetition-watchdog.d.ts +3 -0
  175. package/dist/application/repetition-watchdog.js +118 -0
  176. package/dist/application/repetition-watchdog.js.map +1 -0
  177. package/dist/application/repetition-watchdog.types.d.ts +12 -0
  178. package/dist/application/repetition-watchdog.types.js +2 -0
  179. package/dist/application/repetition-watchdog.types.js.map +1 -0
  180. package/dist/application/run-report-events.d.ts +2 -0
  181. package/dist/application/run-report-events.js +72 -0
  182. package/dist/application/run-report-events.js.map +1 -0
  183. package/dist/application/run-report.d.ts +5 -0
  184. package/dist/application/run-report.js +32 -0
  185. package/dist/application/run-report.js.map +1 -0
  186. package/dist/application/run-report.types.d.ts +13 -0
  187. package/dist/application/run-report.types.js +2 -0
  188. package/dist/application/run-report.types.js.map +1 -0
  189. package/dist/application/sandbox-attach.js +3 -0
  190. package/dist/application/sandbox-attach.js.map +1 -1
  191. package/dist/application/sandbox-dispatch.js +51 -2
  192. package/dist/application/sandbox-dispatch.js.map +1 -1
  193. package/dist/application/sandbox-provision.js +38 -13
  194. package/dist/application/sandbox-provision.js.map +1 -1
  195. package/dist/application/sandbox-session.types.d.ts +1 -0
  196. package/dist/application/sandbox-session.types.js.map +1 -1
  197. package/dist/application/sandbox.d.ts +2 -0
  198. package/dist/application/sandbox.js +17 -3
  199. package/dist/application/sandbox.js.map +1 -1
  200. package/dist/application/secrets.d.ts +2 -0
  201. package/dist/application/secrets.js +67 -0
  202. package/dist/application/secrets.js.map +1 -0
  203. package/dist/application/speculation-checkpoint.d.ts +1 -1
  204. package/dist/application/speculation-checkpoint.js +21 -4
  205. package/dist/application/speculation-checkpoint.js.map +1 -1
  206. package/dist/application/speculation-resume.js +1 -1
  207. package/dist/application/speculation-resume.js.map +1 -1
  208. package/dist/application/speculation-run.js +59 -8
  209. package/dist/application/speculation-run.js.map +1 -1
  210. package/dist/application/speculation.js +7 -1
  211. package/dist/application/speculation.js.map +1 -1
  212. package/dist/application/speculation.types.d.ts +4 -1
  213. package/dist/application/speculation.types.js.map +1 -1
  214. package/dist/application/steering-turns.js +12 -1
  215. package/dist/application/steering-turns.js.map +1 -1
  216. package/dist/application/stop-reason.js +2 -0
  217. package/dist/application/stop-reason.js.map +1 -1
  218. package/dist/application/task-usage.d.ts +2 -0
  219. package/dist/application/task-usage.js +34 -15
  220. package/dist/application/task-usage.js.map +1 -1
  221. package/dist/application/task-usage.types.d.ts +4 -0
  222. package/dist/application/task-usage.types.js.map +1 -1
  223. package/dist/application/tasks.js +3 -1
  224. package/dist/application/tasks.js.map +1 -1
  225. package/dist/application/transport-inspection.constants.js +1 -0
  226. package/dist/application/transport-inspection.constants.js.map +1 -1
  227. package/dist/application/workflow-job.js +5 -9
  228. package/dist/application/workflow-job.js.map +1 -1
  229. package/dist/application/workspace-integration.d.ts +4 -0
  230. package/dist/application/workspace-integration.js +94 -0
  231. package/dist/application/workspace-integration.js.map +1 -0
  232. package/dist/application/workspace.js +7 -1
  233. package/dist/application/workspace.js.map +1 -1
  234. package/dist/domain/agent-profile-permissions.d.ts +4 -0
  235. package/dist/domain/agent-profile-permissions.js +38 -0
  236. package/dist/domain/agent-profile-permissions.js.map +1 -0
  237. package/dist/domain/agent-profile.constants.d.ts +7 -0
  238. package/dist/domain/agent-profile.constants.js +16 -0
  239. package/dist/domain/agent-profile.constants.js.map +1 -0
  240. package/dist/domain/agent-profile.d.ts +5 -0
  241. package/dist/domain/agent-profile.js +45 -0
  242. package/dist/domain/agent-profile.js.map +1 -0
  243. package/dist/domain/agent-profile.types.d.ts +10 -0
  244. package/dist/domain/agent-profile.types.js +2 -0
  245. package/dist/domain/agent-profile.types.js.map +1 -0
  246. package/dist/domain/agent.types.d.ts +6 -2
  247. package/dist/domain/agent.types.js.map +1 -1
  248. package/dist/domain/conversation.types.d.ts +2 -0
  249. package/dist/domain/conversation.types.js.map +1 -1
  250. package/dist/domain/diff-guard.d.ts +4 -0
  251. package/dist/domain/diff-guard.js +56 -0
  252. package/dist/domain/diff-guard.js.map +1 -0
  253. package/dist/domain/diff-guard.types.d.ts +10 -0
  254. package/dist/domain/diff-guard.types.js +2 -0
  255. package/dist/domain/diff-guard.types.js.map +1 -0
  256. package/dist/domain/errors.types.d.ts +1 -1
  257. package/dist/domain/errors.types.js.map +1 -1
  258. package/dist/domain/harness.constants.js +1 -0
  259. package/dist/domain/harness.constants.js.map +1 -1
  260. package/dist/domain/harness.js +7 -2
  261. package/dist/domain/harness.js.map +1 -1
  262. package/dist/domain/harness.types.d.ts +4 -1
  263. package/dist/domain/harness.types.js.map +1 -1
  264. package/dist/domain/lifecycle.d.ts +2 -0
  265. package/dist/domain/lifecycle.js +17 -0
  266. package/dist/domain/lifecycle.js.map +1 -0
  267. package/dist/domain/lifecycle.types.d.ts +8 -0
  268. package/dist/domain/lifecycle.types.js +2 -0
  269. package/dist/domain/lifecycle.types.js.map +1 -0
  270. package/dist/domain/observation.js +12 -6
  271. package/dist/domain/observation.js.map +1 -1
  272. package/dist/domain/observation.types.d.ts +4 -1
  273. package/dist/domain/observation.types.js.map +1 -1
  274. package/dist/domain/pricing.constants.d.ts +1 -0
  275. package/dist/domain/pricing.constants.js +2 -0
  276. package/dist/domain/pricing.constants.js.map +1 -0
  277. package/dist/domain/pricing.d.ts +4 -0
  278. package/dist/domain/pricing.js +60 -0
  279. package/dist/domain/pricing.js.map +1 -0
  280. package/dist/domain/pricing.types.d.ts +20 -0
  281. package/dist/domain/pricing.types.js +2 -0
  282. package/dist/domain/pricing.types.js.map +1 -0
  283. package/dist/domain/redaction.constants.d.ts +1 -0
  284. package/dist/domain/redaction.constants.js +2 -0
  285. package/dist/domain/redaction.constants.js.map +1 -0
  286. package/dist/domain/redaction.d.ts +1 -0
  287. package/dist/domain/redaction.js +74 -0
  288. package/dist/domain/redaction.js.map +1 -0
  289. package/dist/domain/replay.constants.js +2 -0
  290. package/dist/domain/replay.constants.js.map +1 -1
  291. package/dist/domain/replay.js +7 -1
  292. package/dist/domain/replay.js.map +1 -1
  293. package/dist/domain/response-instructions.d.ts +2 -0
  294. package/dist/domain/response-instructions.js +20 -0
  295. package/dist/domain/response-instructions.js.map +1 -0
  296. package/dist/domain/response-schema.d.ts +4 -0
  297. package/dist/domain/response-schema.js +46 -0
  298. package/dist/domain/response-schema.js.map +1 -0
  299. package/dist/domain/response.js +8 -3
  300. package/dist/domain/response.js.map +1 -1
  301. package/dist/domain/response.types.d.ts +10 -2
  302. package/dist/domain/response.types.js.map +1 -1
  303. package/dist/domain/run-report.constants.d.ts +5 -0
  304. package/dist/domain/run-report.constants.js +6 -0
  305. package/dist/domain/run-report.constants.js.map +1 -0
  306. package/dist/domain/run-report.d.ts +2 -0
  307. package/dist/domain/run-report.js +84 -0
  308. package/dist/domain/run-report.js.map +1 -0
  309. package/dist/domain/run-report.types.d.ts +42 -0
  310. package/dist/domain/run-report.types.js +2 -0
  311. package/dist/domain/run-report.types.js.map +1 -0
  312. package/dist/domain/run.constants.d.ts +9 -0
  313. package/dist/domain/run.constants.js +34 -0
  314. package/dist/domain/run.constants.js.map +1 -0
  315. package/dist/domain/run.d.ts +8 -0
  316. package/dist/domain/run.js +154 -0
  317. package/dist/domain/run.js.map +1 -0
  318. package/dist/domain/run.types.d.ts +90 -0
  319. package/dist/domain/run.types.js +2 -0
  320. package/dist/domain/run.types.js.map +1 -0
  321. package/dist/domain/secrets.constants.d.ts +4 -0
  322. package/dist/domain/secrets.constants.js +5 -0
  323. package/dist/domain/secrets.constants.js.map +1 -0
  324. package/dist/domain/secrets.d.ts +2 -0
  325. package/dist/domain/secrets.js +18 -0
  326. package/dist/domain/secrets.js.map +1 -0
  327. package/dist/domain/secrets.types.d.ts +10 -0
  328. package/dist/domain/secrets.types.js +2 -0
  329. package/dist/domain/secrets.types.js.map +1 -0
  330. package/dist/domain/standard-schema.constants.d.ts +1 -0
  331. package/dist/domain/standard-schema.constants.js +2 -0
  332. package/dist/domain/standard-schema.constants.js.map +1 -0
  333. package/dist/domain/standard-schema.js +1 -1
  334. package/dist/domain/standard-schema.js.map +1 -1
  335. package/dist/domain/task-queue.js +4 -12
  336. package/dist/domain/task-queue.js.map +1 -1
  337. package/dist/domain/tool.constants.d.ts +0 -1
  338. package/dist/domain/tool.constants.js +0 -1
  339. package/dist/domain/tool.constants.js.map +1 -1
  340. package/dist/domain/usage.d.ts +2 -0
  341. package/dist/domain/usage.js +83 -0
  342. package/dist/domain/usage.js.map +1 -1
  343. package/dist/domain/watchdog.constants.d.ts +2 -0
  344. package/dist/domain/watchdog.constants.js +3 -0
  345. package/dist/domain/watchdog.constants.js.map +1 -0
  346. package/dist/domain/watchdog.d.ts +2 -0
  347. package/dist/domain/watchdog.js +15 -0
  348. package/dist/domain/watchdog.js.map +1 -0
  349. package/dist/domain/watchdog.types.d.ts +20 -0
  350. package/dist/domain/watchdog.types.js +2 -0
  351. package/dist/domain/watchdog.types.js.map +1 -0
  352. package/dist/domain/workflow/budget.d.ts +7 -3
  353. package/dist/domain/workflow/budget.js +48 -12
  354. package/dist/domain/workflow/budget.js.map +1 -1
  355. package/dist/domain/workflow/budget.types.d.ts +8 -1
  356. package/dist/domain/workflow/budget.types.js.map +1 -1
  357. package/dist/domain/workflow/checkpoint-validation.js +9 -0
  358. package/dist/domain/workflow/checkpoint-validation.js.map +1 -1
  359. package/dist/domain/workflow/failure.d.ts +2 -1
  360. package/dist/domain/workflow/failure.js +2 -0
  361. package/dist/domain/workflow/failure.js.map +1 -1
  362. package/dist/domain/workflow/gates.js +6 -1
  363. package/dist/domain/workflow/gates.js.map +1 -1
  364. package/dist/domain/workflow/loop-runner.js +8 -1
  365. package/dist/domain/workflow/loop-runner.js.map +1 -1
  366. package/dist/domain/workflow/task-runner.js +9 -4
  367. package/dist/domain/workflow/task-runner.js.map +1 -1
  368. package/dist/domain/workflow/termination.d.ts +3 -0
  369. package/dist/domain/workflow/termination.js +31 -0
  370. package/dist/domain/workflow/termination.js.map +1 -0
  371. package/dist/domain/workflow/workflow-scheduler.js +21 -18
  372. package/dist/domain/workflow/workflow-scheduler.js.map +1 -1
  373. package/dist/domain/workflow/workflow-state.js +13 -2
  374. package/dist/domain/workflow/workflow-state.js.map +1 -1
  375. package/dist/domain/workflow.d.ts +1 -1
  376. package/dist/domain/workflow.js.map +1 -1
  377. package/dist/domain/workflow.types.d.ts +10 -1
  378. package/dist/domain/workflow.types.js.map +1 -1
  379. package/dist/domain/workspace.types.d.ts +4 -4
  380. package/dist/domain/workspace.types.js.map +1 -1
  381. package/dist/index.d.ts +20 -1
  382. package/dist/index.js +9 -0
  383. package/dist/index.js.map +1 -1
  384. package/dist/infrastructure/conversations/harness-transcript.js +5 -3
  385. package/dist/infrastructure/conversations/harness-transcript.js.map +1 -1
  386. package/dist/infrastructure/conversations/harness-transcript.types.d.ts +2 -0
  387. package/dist/infrastructure/conversations/harness-transcript.types.js.map +1 -1
  388. package/dist/infrastructure/conversations/redaction.d.ts +3 -0
  389. package/dist/infrastructure/conversations/redaction.js +45 -0
  390. package/dist/infrastructure/conversations/redaction.js.map +1 -0
  391. package/dist/infrastructure/conversations/session-bundle.js +4 -1
  392. package/dist/infrastructure/conversations/session-bundle.js.map +1 -1
  393. package/dist/infrastructure/conversations/transcript-store.js +3 -2
  394. package/dist/infrastructure/conversations/transcript-store.js.map +1 -1
  395. package/dist/infrastructure/file-fingerprint.constants.d.ts +2 -0
  396. package/dist/infrastructure/file-fingerprint.constants.js +20 -0
  397. package/dist/infrastructure/file-fingerprint.constants.js.map +1 -0
  398. package/dist/infrastructure/file-fingerprint.d.ts +3 -0
  399. package/dist/infrastructure/file-fingerprint.js +23 -0
  400. package/dist/infrastructure/file-fingerprint.js.map +1 -0
  401. package/dist/infrastructure/git/diff-guard.d.ts +5 -0
  402. package/dist/infrastructure/git/diff-guard.js +76 -0
  403. package/dist/infrastructure/git/diff-guard.js.map +1 -0
  404. package/dist/infrastructure/git/diff-guard.types.d.ts +5 -0
  405. package/dist/infrastructure/git/diff-guard.types.js +2 -0
  406. package/dist/infrastructure/git/diff-guard.types.js.map +1 -0
  407. package/dist/infrastructure/git/diff-statistics.d.ts +4 -0
  408. package/dist/infrastructure/git/diff-statistics.js +79 -0
  409. package/dist/infrastructure/git/diff-statistics.js.map +1 -0
  410. package/dist/infrastructure/git/integration-candidate.d.ts +3 -0
  411. package/dist/infrastructure/git/integration-candidate.js +91 -0
  412. package/dist/infrastructure/git/integration-candidate.js.map +1 -0
  413. package/dist/infrastructure/git/workspace-lease.js +55 -4
  414. package/dist/infrastructure/git/workspace-lease.js.map +1 -1
  415. package/dist/infrastructure/git/workspace.js +2 -0
  416. package/dist/infrastructure/git/workspace.js.map +1 -1
  417. package/dist/infrastructure/git/workspace.types.d.ts +14 -1
  418. package/dist/infrastructure/git/workspace.types.js.map +1 -1
  419. package/dist/infrastructure/inspection-file.d.ts +2 -1
  420. package/dist/infrastructure/inspection-file.js +3 -1
  421. package/dist/infrastructure/inspection-file.js.map +1 -1
  422. package/dist/infrastructure/local-transport.js +1 -1
  423. package/dist/infrastructure/local-transport.js.map +1 -1
  424. package/dist/infrastructure/reporter.js +3 -0
  425. package/dist/infrastructure/reporter.js.map +1 -1
  426. package/dist/infrastructure/run-observer.d.ts +2 -0
  427. package/dist/infrastructure/run-observer.js +143 -0
  428. package/dist/infrastructure/run-observer.js.map +1 -0
  429. package/dist/infrastructure/run-reader.d.ts +3 -0
  430. package/dist/infrastructure/run-reader.js +47 -0
  431. package/dist/infrastructure/run-reader.js.map +1 -0
  432. package/dist/infrastructure/run-storage.d.ts +6 -0
  433. package/dist/infrastructure/run-storage.js +200 -0
  434. package/dist/infrastructure/run-storage.js.map +1 -0
  435. package/dist/infrastructure/scripted-commit.d.ts +3 -0
  436. package/dist/infrastructure/scripted-commit.js +62 -0
  437. package/dist/infrastructure/scripted-commit.js.map +1 -0
  438. package/dist/infrastructure/scripted-turn.constants.d.ts +1 -0
  439. package/dist/infrastructure/scripted-turn.constants.js +2 -0
  440. package/dist/infrastructure/scripted-turn.constants.js.map +1 -0
  441. package/dist/infrastructure/scripted-turn.d.ts +3 -0
  442. package/dist/infrastructure/scripted-turn.js +53 -0
  443. package/dist/infrastructure/scripted-turn.js.map +1 -0
  444. package/dist/infrastructure/scripted-turn.types.d.ts +9 -0
  445. package/dist/infrastructure/scripted-turn.types.js +2 -0
  446. package/dist/infrastructure/scripted-turn.types.js.map +1 -0
  447. package/dist/infrastructure/storage-inventory.types.d.ts +1 -1
  448. package/dist/infrastructure/storage-inventory.types.js.map +1 -1
  449. package/dist/providers/cloud-cache.constants.d.ts +6 -0
  450. package/dist/providers/cloud-cache.constants.js +7 -0
  451. package/dist/providers/cloud-cache.constants.js.map +1 -0
  452. package/dist/providers/cloud-cache.d.ts +5 -0
  453. package/dist/providers/cloud-cache.js +151 -0
  454. package/dist/providers/cloud-cache.js.map +1 -0
  455. package/dist/providers/cloud-cache.types.d.ts +5 -0
  456. package/dist/providers/cloud-cache.types.js +2 -0
  457. package/dist/providers/cloud-cache.types.js.map +1 -0
  458. package/dist/providers/container-cache.d.ts +1 -0
  459. package/dist/providers/container-cache.js +6 -3
  460. package/dist/providers/container-cache.js.map +1 -1
  461. package/dist/providers/daytona.d.ts +1 -0
  462. package/dist/providers/daytona.js +28 -6
  463. package/dist/providers/daytona.js.map +1 -1
  464. package/dist/providers/daytona.types.d.ts +3 -0
  465. package/dist/providers/daytona.types.js.map +1 -1
  466. package/dist/providers/memory.d.ts +3 -0
  467. package/dist/providers/memory.js +119 -0
  468. package/dist/providers/memory.js.map +1 -0
  469. package/dist/providers/memory.types.d.ts +8 -0
  470. package/dist/providers/memory.types.js +2 -0
  471. package/dist/providers/memory.types.js.map +1 -0
  472. package/dist/providers/vercel.d.ts +1 -0
  473. package/dist/providers/vercel.js +28 -7
  474. package/dist/providers/vercel.js.map +1 -1
  475. package/dist/providers/vercel.types.d.ts +3 -0
  476. package/dist/providers/vercel.types.js.map +1 -1
  477. package/dist/testing.d.ts +4 -0
  478. package/dist/testing.js +3 -0
  479. package/dist/testing.js.map +1 -0
  480. package/package.json +61 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,39 @@
1
1
  # Changelog
2
2
 
3
+ ## 11.0.1
4
+
5
+ This major release adds workspace integration safeguards, portable agent profiles, execution reports and state tracking, monetary budgets, incremental preparation, cloud dependency caches, offline workflow testing and optional secret sources. Update exhaustive consumers for `FaultCode` (`guard`, `stuck`), `AgentEvent` and `ObservationEvent` (`stuck`), stopped reasons (`stuck`), `StorageCategoryName` (`runs`) and `WorkflowBudgetExceeded.dimension` (`cost`). Implementations and test doubles of `DispatchResult` and `WarmDispatchResult` must provide `report()`; custom `ObservationHub` implementations must provide `redacting` and `redact()`. Existing entry points remain available. Best-of-N speculation remains experimental, and the live-validation limits below still apply.
6
+
7
+ - Add `SecretSource` and bounded `fromSecrets()` startup resolution with optional adapters for Vault/OpenBao KV v2, 1Password, Infisical, AWS Secrets Manager, Google Cloud Secret Manager and Azure Key Vault. Resolve declared names into immutable variables without writing values to disk or changing the host environment; sanitize vendor errors and retain caller ownership of host SDK clients. Add bilingual Guide/API documentation and a selectable service example. Deterministic HTTP and SDK-boundary tests cover behavior; live service authentication remains unvalidated.
8
+ - Add `@elie-laloum/outpost/testing` with `scriptedAgent()` and `createMemorySandboxProvider()` for offline workflow CI: predefined events, usage, real Git commits, response repairs and strict command fixtures. Add bilingual Guide/API documentation and an executable workflow example; Git workspaces remain on disk and transfers, cold conversation resume and arbitrary command execution are unsupported.
9
+ - Add opt-in Vercel and Daytona dependency download caches backed by a caller-owned Transport: restore before preparation, archive before disposal, retain compatibility hashing and fence concurrent publishers. Add bilingual Guide/API documentation and a cloud example. Deterministic SDK and filesystem fixtures cover binary transfers, permissions, concurrency and cleanup failures; live cloud/S3 validation remains pending.
10
+ - Add incremental lifecycle preparation with `when: changed(files)`: fingerprint exact file contents in the hook environment and rerun conditional hooks before operations on a reused sandbox. Save fingerprints only after success and retry failed preparations without closing a warm sandbox. Add bilingual Guide/API documentation and an offline `npm ci` example. Deterministic local-process and simulated-remote tests cover reuse, failures, cancellation and deadlines; real Docker checks the live sandbox files. Live cloud validation remains pending.
11
+ - Add opt-in dispatch repetition watchdogs over decoded tool calls and file changes, with `stuck` events, explicit stop/warn policies and bounded steering instructions. Preserve sandbox reuse, recovery, response instructions and synchronous policy enforcement independently of observer delivery. Add bilingual Guide/API documentation and an offline example; deterministic process, simulated-model and real Docker tests cover behavior. Live native CLI and cloud validation remains pending.
12
+ - Add portable `defineAgentProfile()` declarations for literal instructions, built-in tool allowlists and MCP servers across CLI presets and the Outpost harness. Project native Claude/Codex instructions, preserve request-prefix guidance on other CLIs, enforce exact shell commands through Claude hooks and intersected harness permissions, and refuse unsupported allowlists explicitly. Add bilingual Guide/API documentation and an offline local/MCP example. Deterministic protocol, command-hook and local-model tests cover behavior; paid CLI/model runs and native CLI continuation remain unvalidated.
13
+ - Fix lock-free local transport reads when an atomic replacement grows between size sampling and inspection. Retry changed snapshots while preserving caller byte limits and bounded allocation; a deterministic race regression covers the failure.
14
+ - Add synchronous `result.report()` to cold and warm dispatch results, with Markdown and versioned JSON snapshots of committed Git changes, observed failed commands/tools, duration, tokens and optional estimated cost. Preserve reports after workspace cleanup, aggregate cold passes as a net diff, apply inherited redaction and report collection limits without changing execution outcomes. Add bilingual Guide/API documentation and an offline local example; deterministic Git, process and simulated-model tests cover behavior, with no paid model calls.
15
+ - Add transport-backed execution projections by ID with `createRunObserver()`, `readRun()` and cursor-based `watchRun()`. Record tasks, dispatch agents, branches, commits, errors and cumulative workflow usage; detect suspected abandonment through heartbeats without changing ownership. Fence writers, preserve cursors across settled workflow resumes and expose detected observation gaps. Deterministic local-process and HTTP S3-fixture tests cover behavior; live AWS validation remains pending.
16
+ - Add optional EUR/USD workflow cost budgets, per-model token pricing, explicit Models.dev/OpenRouter catalog loading and inherited observation/conversation redaction. Preserve cumulative model counters through checkpoints; stop strict monetary budgets on unknown charges. Deterministic mock-model, local-process and HTTP-fixture tests cover behavior; public Models.dev and OpenRouter catalog loading was checked; paid-model billing and native CLI resume with masked reasoning remain unvalidated.
17
+ - Add experimental best-of-N speculation with `select: "best"` and a required finite `score`. Let admitted candidates finish, choose the highest score with declaration-order ties, preserve cancellation, budgets and cleanup ownership, and persist scores for durable recovery. Keep first-valid selection as the default. Deterministic local-agent and crash-recovery tests cover the behavior; live judge-agent and cloud validation remains pending.
18
+ - Add opt-in agent conflict resolution through `workspace.integrate({ onConflict: createAgentConflictResolver(...) })`. Resolve in a separate branch and sandbox, require verification, recheck final diff guards and frozen input commits, and preserve both workspaces on failure. Return resolution usage and verification output separately. Deterministic tests use real temporary Git repositories, a simulated remote provider and real Docker in mounted and isolated modes; live agent and cloud validation remains pending.
19
+ - Add workspace diff guards (`guard.protectedPaths`, `guard.maxChangedLines`) for named and integration branches, independently of the agent. Check the final committed diff after synchronization and again before merging the inspected commit; reject protected paths, oversized text changes, uncountable binaries with a line limit and incomplete inspection with code `guard`. Retain rejected branches and worktrees; refuse `current` before execution. Deterministic tests use real temporary Git repositories, local agents and a simulated remote provider; no paid model calls are required.
20
+
21
+ - Make the simulated Daytona dependency-cache sandbox provide its own Linux `setsid --wait` wrapper so its host-process fixtures also run on macOS. Production sandbox process supervision is unchanged.
22
+ - Freeze the queue clock in the scheduler deduplication fixture so slow Windows runners cannot expire the first claim between assertions. Queue lease expiry remains covered separately.
23
+
24
+ The v11.0.0 release was blocked by the macOS dependency-cache fixture and a timing-sensitive Windows scheduler fixture and was not published.
25
+
26
+ ## 10.0.1
27
+
28
+ - **Breaking:** Report gate refusals as workflow status `rejected`. Add typed `terminationCode` to workflow results, finish events and queued workflow summaries, and expose it on `WorkflowFailure.code`; preserve classified faults, deadlines, budget stops and checkpointed rejection audit trails. Consumers checking only `failed` must also handle `rejected`. Deterministic regression tests cover the termination semantics; no live agent or provider calls are required.
29
+ - Accept explicit `repositoryMode: "isolated"` on Vercel and Daytona, matching their existing private-checkout default. Reject unsupported modes before allocation. Deterministic provider fixtures verify Git metadata separation, commit/file synchronization and recovery after concurrent host edits; live cloud validation of this explicit option remains outstanding.
30
+ - Automatically append tagged final-answer instructions and input JSON Schema for typed responses, including repairs and resumed turns. **Breaking:** `defineJsonResponse()` now requires Standard JSON Schema conversion or an explicit `jsonSchema`; parsing functions and validation-only schemas must declare their input schema. Existing parsing and validation behavior is preserved.
31
+ - Update the bilingual guides, API reference and offline examples. Deterministic tests do not establish live agent compliance with the injected instructions.
32
+ - Pin the transitive `shell-quote` dependency to 1.11.0 and documentation `sharp` to 0.35.5 to resolve the dependency audits blocking CI.
33
+ - Resume quota-interrupted workflow fixtures explicitly from durable checkpoints, preserving conversation continuation and fallback checks without relying on process startup completing before a simulated reset.
34
+
35
+ The v10.0.0 release was blocked by a timing-sensitive Windows fixture and was not published.
36
+
3
37
  ## 9.1.1
4
38
 
5
39
  - Add typed System One decisions (`defineDecision`, `decide`, `defineDecisionTask`) and one bounded HTTP provider for Jev and compatible Laya endpoints. Preserve native distributions, metadata and input-truncation diagnostics.
package/README.md CHANGED
@@ -84,13 +84,17 @@ const result = await dispatch({
84
84
 
85
85
  | You want to… | Start here |
86
86
  | --------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
87
+ | Share instructions, tools and MCP configuration | [Portable agent profiles](https://elie-laloum.github.io/outpost/guide/agent-profiles/) |
87
88
  | Choose an agent, model and credentials | [Agent configuration](https://elie-laloum.github.io/outpost/guide/choose-an-agent/) |
88
89
  | Run locally in containers or in the cloud | [Execution backends](https://elie-laloum.github.io/outpost/guide/choose-a-sandbox/) |
89
90
  | Reuse a sandbox across commands and agent turns | [Sandbox sessions](https://elie-laloum.github.io/outpost/guide/sandbox-sessions/) |
90
91
  | Connect tasks and run independent work in parallel | [Task dependencies](https://elie-laloum.github.io/outpost/guide/task-dependencies/) |
91
92
  | Coordinate changes across repositories | [Multi-repository workflows](https://elie-laloum.github.io/outpost/guide/multiple-repositories/) |
93
+ | Export a run summary for review | [Run reports](https://elie-laloum.github.io/outpost/guide/run-reports/) |
92
94
  | Return data your application can validate | [Validated output](https://elie-laloum.github.io/outpost/guide/typed-responses/) |
93
95
  | Build an agent with your own tools and instructions | [Custom harness](https://elie-laloum.github.io/outpost/guide/harness/) |
96
+ | Read execution state by ID | [Execution state](https://elie-laloum.github.io/outpost/guide/run-state/) |
97
+ | Test workflows without accounts or model calls | [Workflow testing](https://elie-laloum.github.io/outpost/guide/testing-workflows/) |
94
98
  | Resume or recover interrupted work | [Failure recovery](https://elie-laloum.github.io/outpost/guide/recovery/) |
95
99
 
96
100
  The [Guide](https://elie-laloum.github.io/outpost/guide/introduction/) explains behavior with focused examples. The [Reference](https://elie-laloum.github.io/outpost/reference/) documents exact contracts. Both are available in English and French.
package/SECURITY.md CHANGED
@@ -6,6 +6,8 @@ By default, Docker/Podman expose the selected checkout, Git metadata and explici
6
6
 
7
7
  Shared Git metadata is writable by the agent. A mounted sandbox is not an adversarial boundary protecting the host repository or its configuration. Outpost disables host Git hooks for its own Git commands, but a malicious repository can contain other executable configuration or project tooling. Do not run untrusted repositories with valuable host credentials. Host `local()` provides no isolation.
8
8
 
9
+ Workspace diff guards are integration checks, not filesystem permissions or an adversarial security boundary. They inspect only the final committed diff: an agent can modify files and restore them before the check, and uncommitted files are excluded. Use named or integration workspaces to retain refused work separately from the host checkout.
10
+
9
11
  The opt-in Docker/Podman `repositoryMode: "isolated"` prototype uses a private container checkout and Git directory, without mounting the host checkout or Git metadata. Bundle transfer and validated synchronization import changes into the host workspace; host hooks, configuration and unrelated refs are not copied back. Explicit mounts overlapping canonical host repository/workspace/Git paths or container workspace/control paths are rejected, including read-only mounts. Dependency caches remain separate engine-managed volumes. Trust the container image, engine and host mount configuration: custom devices, external mounts, credentials, network access and shared caches expand the boundary. This is not a certified hostile-agent sandbox or protection against container/kernel escapes, malicious host path replacement during allocation, or dangerous project code later executed on the host.
10
12
 
11
13
  Remote providers upload repository history and inputs to the selected cloud account. Explicit credentials and environment files are sent to that environment. Review the cloud provider's own storage/network policy. Concurrent host changes stop synchronization; recovery files preserve prior and incoming state when available.
@@ -14,13 +16,15 @@ Prompt command expansion only recognizes commands present in the original prompt
14
16
 
15
17
  Agent authentication is explicit. `account` reads only the selected CLI's own session file (or the file or profile named by `account.file`) on the host, refuses links, directories and files above 1 MiB, and never reads a system keychain. Isolated providers receive a copy in the private sandbox home through stdin, with 0700 directories and 0600 files; `createLocalSandboxProvider()` receives credential variables only and no host file is written. A sandbox copy can refresh and rotate a subscription refresh token, invalidating the host login; use a dedicated profile through `account.file` when that matters. Agents can read every credential they receive, so give them only the access their task requires. Generated images and remote bootstrap install pinned CLI versions. Antigravity archives use versioned Google URLs and SHA-512 digests recorded in Outpost; installation rejects mismatches before extraction. Generated images and Outpost's Antigravity requests and diagnostics disable automatic updates. Bootstrap reuses an existing executable without replacing or verifying its bytes; `outpost doctor --agent antigravity` compares its reported version with `agentVersions.antigravity`. A checksum verifies the selected archive's integrity, not the safety of its code.
16
18
 
19
+ Portable agent profiles carry literal guidance and protocol tool restrictions, not filesystem or network isolation. A permitted shell command or MCP tool can have arbitrary side effects. Claude allowlists use native tool selection and an in-sandbox Node.js command hook, with inherited user/project/local setting sources disabled for that request; trust the CLI, managed policy and hook execution environment. The Outpost harness intersects profile restrictions with its permissions and inherited subagent policies. Adapters that cannot enforce a built-in allowlist refuse it when composing the agent.
20
+
17
21
  MCP servers are programs or endpoints you choose; they receive the variables you name and act with the agent's authority. Outpost writes MCP configuration with variable references only, never secret values. Kimi and Antigravity configuration is merged into the agent home file, which is the user's own home with `createLocalSandboxProvider()`. Built-in harness servers and their HTTP bridge run inside the sandbox, so egress policies apply to them; CLI agents contact HTTP servers themselves from the sandbox. `oauth: "login"` copies the selected MCP OAuth tokens of Claude Code, Codex or Kimi from the host into the private sandbox home; a refresh there can rotate the refresh token and invalidate the host login. OAuth client secrets for the built-in harness stay in the sandbox environment.
18
22
 
19
- Conversation transcripts, logs, bundles and patches may contain secrets. Runtime files are ignored by Git and sensitive files are created with restrictive permissions where supported. Keep API keys in environment variables or ignored `.env` files. Never embed tokens in tracked configuration, remote URLs or examples.
23
+ Conversation transcripts, logs, bundles and patches may contain secrets. Optional `redact` expressions mask matching strings before Outpost observation receivers and supported conversation captures, including decoded text session bundles. They do not detect unknown secrets, join fragments across event boundaries, rewrite native sandbox files or temporary staging, sanitize checkpoints, returned values other than run reports or existing archives, or make arbitrary binary content safe. A masked transcript can lose data needed for native resume or signed reasoning replay. Runtime files are ignored by Git and sensitive files are created with restrictive permissions where supported. Keep API keys in environment variables or ignored `.env` files. Never embed tokens in tracked configuration, remote URLs or examples.
20
24
 
21
25
  Report vulnerabilities privately using the repository's security reporting channel when enabled, or contact the maintainer through the hosting profile. Do not include live credentials in reports. V1 receives fixes for reproducible security defects.
22
26
 
23
- Explicit storage transports can send artifacts, journals, transcripts, recovery payloads and operational metadata to the configured object store. The caller owns the S3 client and credentials; they are not forwarded to agents. Use a dedicated private bucket prefix and access policy. Object revisions fence cooperating writers but do not authenticate artifact producers or operators. Stop an abandoned runner independently before releasing its checkpoint ownership; a remote PID is not proof of inactivity.
27
+ Explicit storage transports can send artifacts, journals, transcripts, recovery payloads, execution snapshots, observation events and operational metadata to the configured object store. Run projections share the bounded delivery and redaction limits of other observation sinks; an expired heartbeat is suspected abandonment and never authorizes replay or resource recovery. The caller owns the S3 client and credentials; they are not forwarded to agents. Use a dedicated private bucket prefix and access policy. Object revisions fence cooperating writers but do not authenticate artifact producers or operators. Stop an abandoned runner independently before releasing its checkpoint ownership; a remote PID is not proof of inactivity.
24
28
 
25
29
  The optional Firecracker jailer mode requires a trusted root supervisor and root-owned boot assets, executables, SSH trust files, jail base and cgroup v2 parent. Outpost does not elevate privileges. The VMM drops to the explicitly selected non-root UID/GID, uses the jailer's mount namespace and receives CPU, memory, swap and process limits. The supervisor remains privileged and outside the VMM cgroup; its workflow code, configuration, dependencies and transfer destinations must be trusted. Guest file downloads currently buffer individual files in the supervisor, so the VMM memory limit is not a total host-resource budget. Kernel work outside that cgroup is likewise not charged to its CPU quota. Operators own TAP setup, network filtering, parent resources and crash recovery. Control-plane resource accounting and adversarial validation of this mode remain open.
26
30
 
@@ -29,3 +33,7 @@ Egress policies restrict sandbox outbound connections, not host model-provider o
29
33
  Daytona egress is sent at creation and confirmed through its network-update API before Outpost prepares the workspace or exposes the lease. A rejected confirmation fails acquisition and triggers deletion. Tier 3/4 and WRITE_SANDBOXES are required; native creation options alone do not establish this guarantee. Autonomous image startup precedes confirmation and must be trusted, without embedded secrets or startup workloads. Unsupported combinations and wildcard patterns that would implicitly grant apex access are rejected. Docker/Podman allowlists remain unsupported; local and Firecracker execution reject Outpost egress policies. See the bilingual outbound-network guide for capabilities and live-validation limits.
30
34
 
31
35
  Signed workflow gates verify an Ed25519 key bound to an approver, not a human login. The signing service must authenticate the user and their intent. Keep private keys outside worker sandboxes; trust the configured verifier and public-key source. Gate authentication requirements participate in checkpoint identity, but signatures do not authenticate checkpoint storage. Revocation rejects new proofs and does not undo already persisted decisions. HTTP queue bearer tokens authorize all queue operations; dynamic token sources allow rotation, not tenant isolation. Use trusted TLS termination for remote connections. Idempotency keys only prevent duplicate external effects when the effect service atomically deduplicates them and retains receipts throughout the replay window.
36
+
37
+ Cloud dependency caches archive only the declared download directories through a host-side Transport. Storage credentials are not installed in the sandbox. Later runs trust the bytes written by previous agents and transport writers; keep credentials out of caches and use a private prefix. Immutable cache snapshots persist until explicitly removed, including superseded or unpublished snapshots. Compatibility hashes and chunk digests provide isolation and integrity, not producer authentication.
38
+
39
+ Secret-source resolution runs on the host before sandbox allocation. Outpost reads only requested names and returns immutable variables without writing the values to disk or changing process.env. Vault/OpenBao KV v2 and AWS JSON fields require fetching an enclosing document; split unrelated secrets when they must not be fetched together. Injected SDK clients are caller-owned, and their authentication configuration and caching remain the caller’s responsibility. fromSecrets discards vendor exception messages and causes; never log the returned object. The selected values become readable by every process receiving those variables. Startup snapshots do not rotate inside a running sandbox.
@@ -1,3 +1,4 @@
1
+ import { rejectProfileTools } from "../profile-support.js";
1
2
  import { mcpConfigurationPlanner, supportMcpServers, } from "../mcp-configuration.js";
2
3
  import { antigravityMcpFile } from "./antigravity-mcp.js";
3
4
  import { textMatcher } from "../text-matcher.js";
@@ -11,6 +12,7 @@ import { credentialPlanner } from "../authentication.js";
11
12
  import { configuredSettings, harnessSettings, supportModel, } from "../model-support.js";
12
13
  function bindAntigravity(settings) {
13
14
  supportModel(antigravityModelSupport, settings.model);
15
+ rejectProfileTools(antigravityLabel, settings.profile);
14
16
  supportMcpServers(antigravityMcpSupport, settings.mcpServers);
15
17
  const credentials = credentialPlanner(antigravityLabel, antigravityCredentials, settings.authentication, settings.model);
16
18
  const configuration = mcpConfigurationPlanner(antigravityLabel, settings.mcpServers, antigravityMcpFile);
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,GACb,MAAM,qBAAqB,CAAC;AAG7B,SAAS,eAAe,CAAC,QAAoC;IAC3D,YAAY,CAAC,uBAAuB,EAAE,Q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CAAC;IACF,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,eAAe,CAAC;YACd,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n mcpConfigurationPlanner,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { antigravityMcpFile } from \"./antigravity-mcp.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../../domain/agent.types.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { antigravityCredentials } from \"./antigravity-authentication.ts\";\nimport {\n antigravityVariables,\n antigravityLabel,\n antigravityMcpSupport,\n antigravityModelSupport,\n antigravityQuotaPatterns,\n antigravityUnavailablePatterns,\n} from \"./antigravity.constants.ts\";\nimport { antigravityEvents } from \"./antigravity-events.ts\";\nimport { antigravityRequest } from \"./antigravity-request.ts\";\nimport type { AntigravitySettings } from \"./antigravity.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound } from \"../settings.types.ts\";\n\nfunction bindAntigravity(settings: Bound<AntigravitySettings>): AgentAdapter {\n supportModel(antigravityModelSupport, settings.model);\n supportMcpServers(antigravityMcpSupport, settings.mcpServers);\n const credentials = credentialPlanner(\n antigravityLabel,\n antigravityCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n antigravityLabel,\n settings.mcpServers,\n antigravityMcpFile,\n );\n return Object.freeze({\n name: \"antigravity\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"antigravity\",\n resumable: true,\n forkable: false,\n capture: false,\n requiresFinishedEvent: true,\n variables: Object.freeze({\n ...antigravityVariables,\n ...settings.variables,\n }),\n request: (input) => antigravityRequest(settings, input),\n events: antigravityEvents,\n quota: textMatcher(antigravityQuotaPatterns),\n unavailable: textMatcher(\n antigravityUnavailablePatterns,\n transientNoticePatterns,\n ),\n } satisfies AgentAdapter);\n}\n\nexport function createAntigravityHarness(\n settings: AntigravitySettings = {},\n): CliHarness {\n harnessSettings(settings);\n invariant(\n !(\"conversations\" in settings) || settings.conversations === undefined,\n \"Antigravity has no portable conversation capture; conversations cannot be stored\",\n );\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindAntigravity({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
1
+ {"version":3,"file":"antigravity-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AACzE,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,qBAAqB,EACrB,uBAAuB,EACvB,wBAAwB,EACxB,8BAA8B,GAC/B,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,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AM,EAAE,iBAAiB;QACzB,KAAK,EAAE,WAAW,CAAC,wBAAwB,CAAC;QAC5C,WAAW,EAAE,WAAW,CACtB,8BAA8B,EAC9B,uBAAuB,CACxB;KACqB,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,WAAgC,EAAE;IAElC,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,SAAS,CACP,CAAC,CAAC,eAAe,IAAI,QAAQ,CAAC,IAAI,QAAQ,CAAC,aAAa,KAAK,SAAS,EACtE,kFAAkF,CACnF,CAAC;IACF,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,eAAe,CAAC;YACd,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { rejectProfileTools } from \"../profile-support.ts\";\nimport {\n mcpConfigurationPlanner,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { antigravityMcpFile } from \"./antigravity-mcp.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../../domain/agent.types.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { antigravityCredentials } from \"./antigravity-authentication.ts\";\nimport {\n antigravityVariables,\n antigravityLabel,\n antigravityMcpSupport,\n antigravityModelSupport,\n antigravityQuotaPatterns,\n antigravityUnavailablePatterns,\n} from \"./antigravity.constants.ts\";\nimport { antigravityEvents } from \"./antigravity-events.ts\";\nimport { antigravityRequest } from \"./antigravity-request.ts\";\nimport type { AntigravitySettings } from \"./antigravity.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound } from \"../settings.types.ts\";\n\nfunction bindAntigravity(settings: Bound<AntigravitySettings>): AgentAdapter {\n supportModel(antigravityModelSupport, settings.model);\n rejectProfileTools(antigravityLabel, settings.profile);\n supportMcpServers(antigravityMcpSupport, settings.mcpServers);\n const credentials = credentialPlanner(\n antigravityLabel,\n antigravityCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n antigravityLabel,\n settings.mcpServers,\n antigravityMcpFile,\n );\n return Object.freeze({\n name: \"antigravity\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"antigravity\",\n resumable: true,\n forkable: false,\n capture: false,\n requiresFinishedEvent: true,\n variables: Object.freeze({\n ...antigravityVariables,\n ...settings.variables,\n }),\n request: (input) => antigravityRequest(settings, input),\n events: antigravityEvents,\n quota: textMatcher(antigravityQuotaPatterns),\n unavailable: textMatcher(\n antigravityUnavailablePatterns,\n transientNoticePatterns,\n ),\n } satisfies AgentAdapter);\n}\n\nexport function createAntigravityHarness(\n settings: AntigravitySettings = {},\n): CliHarness {\n harnessSettings(settings);\n invariant(\n !(\"conversations\" in settings) || settings.conversations === undefined,\n \"Antigravity has no portable conversation capture; conversations cannot be stored\",\n );\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindAntigravity({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
@@ -1,7 +1,9 @@
1
+ import { profileText } from "../profile-support.js";
1
2
  import { validId } from "../../../infrastructure/conversations/identity.js";
2
3
  import { invariant } from "../../../domain/errors.js";
3
4
  import { antigravityVariables } from "./antigravity.constants.js";
4
5
  export function antigravityRequest(settings, input) {
6
+ const text = profileText(settings.profile, input.text);
5
7
  invariant(!input.continuation?.fork, "Antigravity does not support automated fork in Outpost");
6
8
  const args = [];
7
9
  if (input.continuation) {
@@ -18,9 +20,7 @@ export function antigravityRequest(settings, input) {
18
20
  variables: antigravityVariables,
19
21
  arguments: [
20
22
  ...args,
21
- ...(input.text === undefined
22
- ? []
23
- : ["--prompt-interactive", input.text]),
23
+ ...(text === undefined ? [] : ["--prompt-interactive", text]),
24
24
  ],
25
25
  interactive: true,
26
26
  };
@@ -31,7 +31,7 @@ export function antigravityRequest(settings, input) {
31
31
  executable: "agy",
32
32
  variables: antigravityVariables,
33
33
  arguments: args,
34
- stdin: `${JSON.stringify({ event: "user", message: { content: input.text ?? "" } })}\n`,
34
+ stdin: `${JSON.stringify({ event: "user", message: { content: text ?? "" } })}\n`,
35
35
  };
36
36
  }
37
37
  //# sourceMappingURL=antigravity-request.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity-request.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAG5E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,MAAM,UAAU,kBAAkB,CAChC,QAAoC,EACpC,KAAiB;IAEjB,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EACzB,wDAAwD,CACzD,CAAC;IACF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,KAAK,CAAC,WAAW;QACnB,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,oBAAoB;YAC/B,SAAS,EAAE;gBACT,GAAG,IAAI;gBACP,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,SAAS;oBAC1B,CAAC,CAAC,EAAE;oBACJ,CAAC,CAAC,CAAC,sBAAsB,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;aAC1C;YACD,WAAW,EAAE,IAAI;SAClB,CAAC;IACJ,IAAI,CAAC,QAAQ,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC7E,OAAO;QACL,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,oBAAoB;QAC/B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;KACxF,CAAC;AACJ,CAAC","sourcesContent":["import { validId } from \"../../../infrastructure/conversations/identity.ts\";\nimport type { AgentInput } from \"../../../domain/agent.types.ts\";\nimport type { Command } from \"../../../domain/command.types.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport { antigravityVariables } from \"./antigravity.constants.ts\";\nimport type { AntigravitySettings } from \"./antigravity.types.ts\";\nimport type { Bound } from \"../settings.types.ts\";\n\nexport function antigravityRequest(\n settings: Bound<AntigravitySettings>,\n input: AgentInput,\n): Command {\n invariant(\n !input.continuation?.fork,\n \"Antigravity does not support automated fork in Outpost\",\n );\n const args: string[] = [];\n if (input.continuation) {\n validId(input.continuation.id);\n args.push(\"--conversation\", input.continuation.id);\n }\n if (settings.model) args.push(\"--model\", settings.model.name);\n if (settings.mode) args.push(\"--mode\", settings.mode);\n if (input.interactive)\n return {\n executable: \"agy\",\n variables: antigravityVariables,\n arguments: [\n ...args,\n ...(input.text === undefined\n ? []\n : [\"--prompt-interactive\", input.text]),\n ],\n interactive: true,\n };\n if (!settings.mode) args.push(\"--dangerously-skip-permissions\");\n args.push(\"--input-format\", \"stream-json\", \"--output-format\", \"stream-json\");\n return {\n executable: \"agy\",\n variables: antigravityVariables,\n arguments: args,\n stdin: `${JSON.stringify({ event: \"user\", message: { content: input.text ?? \"\" } })}\\n`,\n };\n}\n"]}
1
+ {"version":3,"file":"antigravity-request.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity-request.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,mDAAmD,CAAC;AAG5E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAIlE,MAAM,UAAU,kBAAkB,CAChC,QAAoC,EACpC,KAAiB;IAEjB,MAAM,IAAI,GAAG,WAAW,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,SAAS,CACP,CAAC,KAAK,CAAC,YAAY,EAAE,IAAI,EACzB,wDAAwD,CACzD,CAAC;IACF,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,KAAK,CAAC,YAAY,EAAE,CAAC;QACvB,OAAO,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IACrD,CAAC;IACD,IAAI,QAAQ,CAAC,KAAK;QAAE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9D,IAAI,QAAQ,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACtD,IAAI,KAAK,CAAC,WAAW;QACnB,OAAO;YACL,UAAU,EAAE,KAAK;YACjB,SAAS,EAAE,oBAAoB;YAC/B,SAAS,EAAE;gBACT,GAAG,IAAI;gBACP,GAAG,CAAC,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,sBAAsB,EAAE,IAAI,CAAC,CAAC;aAC9D;YACD,WAAW,EAAE,IAAI;SAClB,CAAC;IACJ,IAAI,CAAC,QAAQ,CAAC,IAAI;QAAE,IAAI,CAAC,IAAI,CAAC,gCAAgC,CAAC,CAAC;IAChE,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;IAC7E,OAAO;QACL,UAAU,EAAE,KAAK;QACjB,SAAS,EAAE,oBAAoB;QAC/B,SAAS,EAAE,IAAI;QACf,KAAK,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI;KAClF,CAAC;AACJ,CAAC","sourcesContent":["import { profileText } from \"../profile-support.ts\";\nimport { validId } from \"../../../infrastructure/conversations/identity.ts\";\nimport type { AgentInput } from \"../../../domain/agent.types.ts\";\nimport type { Command } from \"../../../domain/command.types.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport { antigravityVariables } from \"./antigravity.constants.ts\";\nimport type { AntigravitySettings } from \"./antigravity.types.ts\";\nimport type { Bound } from \"../settings.types.ts\";\n\nexport function antigravityRequest(\n settings: Bound<AntigravitySettings>,\n input: AgentInput,\n): Command {\n const text = profileText(settings.profile, input.text);\n invariant(\n !input.continuation?.fork,\n \"Antigravity does not support automated fork in Outpost\",\n );\n const args: string[] = [];\n if (input.continuation) {\n validId(input.continuation.id);\n args.push(\"--conversation\", input.continuation.id);\n }\n if (settings.model) args.push(\"--model\", settings.model.name);\n if (settings.mode) args.push(\"--mode\", settings.mode);\n if (input.interactive)\n return {\n executable: \"agy\",\n variables: antigravityVariables,\n arguments: [\n ...args,\n ...(text === undefined ? [] : [\"--prompt-interactive\", text]),\n ],\n interactive: true,\n };\n if (!settings.mode) args.push(\"--dangerously-skip-permissions\");\n args.push(\"--input-format\", \"stream-json\", \"--output-format\", \"stream-json\");\n return {\n executable: \"agy\",\n variables: antigravityVariables,\n arguments: args,\n stdin: `${JSON.stringify({ event: \"user\", message: { content: text ?? \"\" } })}\\n`,\n };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import type { AgentProfile } from "../../../domain/agent-profile.types.ts";
1
2
  import type { AgentAuthentication } from "../../../domain/agent.types.ts";
2
3
  import type { Variables } from "../../../domain/command.types.ts";
3
4
  import type { McpServers } from "../../../domain/mcp-server.types.ts";
@@ -5,5 +6,6 @@ export interface AntigravitySettings {
5
6
  readonly authentication?: AgentAuthentication;
6
7
  readonly variables?: Variables;
7
8
  readonly mcpServers?: McpServers;
9
+ readonly profile?: AgentProfile;
8
10
  readonly mode?: "accept-edits" | "plan";
9
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"antigravity.types.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentAuthentication } from \"../../../domain/agent.types.ts\";\nimport type { Variables } from \"../../../domain/command.types.ts\";\nimport type { McpServers } from \"../../../domain/mcp-server.types.ts\";\n\nexport interface AntigravitySettings {\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n readonly mcpServers?: McpServers;\n readonly mode?: \"accept-edits\" | \"plan\";\n}\n"]}
1
+ {"version":3,"file":"antigravity.types.js","sourceRoot":"","sources":["../../../../src/adapters/agents/antigravity/antigravity.types.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentProfile } from \"../../../domain/agent-profile.types.ts\";\nimport type { AgentAuthentication } from \"../../../domain/agent.types.ts\";\nimport type { Variables } from \"../../../domain/command.types.ts\";\nimport type { McpServers } from \"../../../domain/mcp-server.types.ts\";\n\nexport interface AntigravitySettings {\n readonly authentication?: AgentAuthentication;\n readonly variables?: Variables;\n readonly mcpServers?: McpServers;\n readonly profile?: AgentProfile;\n readonly mode?: \"accept-edits\" | \"plan\";\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { supportClaudeProfile } from "./claude-profile.js";
1
2
  import { createClaudeConversations, claudeConversationLayout, } from "./claude-conversations.js";
2
3
  import { claudeLabel, claudeMcpSupport, claudeModelSupport, claudeQuotaPatterns, claudeUnavailablePatterns, CLAUDE_MAX_OUTPUT_VARIABLE, CLAUDE_MCP_TIMEOUT_VARIABLE, } from "./claude.constants.js";
3
4
  import { claudeMcpLogins } from "./claude-mcp.js";
@@ -14,6 +15,7 @@ import { claudeRequest } from "./claude-request.js";
14
15
  import { configuredSettings, harnessSettings, supportModel, } from "../model-support.js";
15
16
  function bindClaude(settings) {
16
17
  supportModel(claudeModelSupport, settings.model);
18
+ supportClaudeProfile(settings);
17
19
  supportMcpServers(claudeMcpSupport, settings.mcpServers);
18
20
  const maxOutputTokens = settings.model?.maxOutputTokens;
19
21
  invariant(maxOutputTokens === undefined ||
@@ -24,6 +26,7 @@ function bindClaude(settings) {
24
26
  const credentials = credentialPlanner(claudeLabel, claudeCredentials, settings.authentication, settings.model);
25
27
  const configuration = mcpConfigurationPlanner(claudeLabel, settings.mcpServers, undefined, claudeMcpLogins);
26
28
  return Object.freeze({
29
+ usageInput: "uncached",
27
30
  name: "claude",
28
31
  ...(credentials ? { credentials } : {}),
29
32
  ...(configuration ? { configuration } : {}),
@@ -1 +1 @@
1
- {"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAE/D,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,kBAAkB,EAClB,eAAe,EACf,YAAY,GACb,MAAM,qBAAqB,CAAC;AAG7B,SAAS,UAAU,CAAC,QAA+B;IACjD,YAAY,CAAC,kBAAkB,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjD,iBAAiB,CAAC,gBAAgB,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IACzD,MAAM,eAAe,GAAG,QAAQ,CAAC,KAAK,EAAE,eAAe,CA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EAAE,CAAC;YAC9D,GAAG,CAAC,UAAU,KAAK,SAAS;gBAC1B,CAAC,CAAC,EAAE;gBACJ,CAAC,CAAC,EAAE,CAAC,2BAA2B,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;SAC3D,CAAC;QACF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC;QAClD,MAAM,EAAE,YAAY;QACpB,SAAS,EAAE,eAAe;QAC1B,KAAK,EAAE,WAAW,CAAC,mBAAmB,CAAC;QACvC,WAAW,EAAE,WAAW,CACtB,yBAAyB,EACzB,uBAAuB,CACxB;QACD,eAAe,EAAE,qBAAqB;KAChB,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA2B,EAAE;IAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,oBAAoB,CAAC,WAAW,EAAE,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,UAAU,CAAC;YACT,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import {\n createClaudeConversations,\n claudeConversationLayout,\n} from \"./claude-conversations.ts\";\nimport {\n claudeLabel,\n claudeMcpSupport,\n claudeModelSupport,\n claudeQuotaPatterns,\n claudeUnavailablePatterns,\n CLAUDE_MAX_OUTPUT_VARIABLE,\n CLAUDE_MCP_TIMEOUT_VARIABLE,\n} from \"./claude.constants.ts\";\nimport { claudeMcpLogins } from \"./claude-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n sharedStartupTimeout,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport { claudeCredentials } from \"./claude-authentication.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../../domain/agent.types.ts\";\nimport { claudeEvents, claudeTranscriptUsage } from \"./claude-events.ts\";\nimport { claudeLiveInput } from \"./claude-input.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound, ClaudeSettings } from \"../settings.types.ts\";\n\nfunction bindClaude(settings: Bound<ClaudeSettings>): AgentAdapter {\n supportModel(claudeModelSupport, settings.model);\n supportMcpServers(claudeMcpSupport, settings.mcpServers);\n const maxOutputTokens = settings.model?.maxOutputTokens;\n invariant(\n maxOutputTokens === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MAX_OUTPUT_VARIABLE),\n `Set maxOutputTokens on the agent model or ${CLAUDE_MAX_OUTPUT_VARIABLE}, not both`,\n );\n const mcpTimeout = sharedStartupTimeout(settings.mcpServers);\n invariant(\n mcpTimeout === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MCP_TIMEOUT_VARIABLE),\n `Set startupTimeoutMs on MCP servers or ${CLAUDE_MCP_TIMEOUT_VARIABLE}, not both`,\n );\n const credentials = credentialPlanner(\n claudeLabel,\n claudeCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n claudeLabel,\n settings.mcpServers,\n undefined,\n claudeMcpLogins,\n );\n return Object.freeze({\n name: \"claude\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"claude\",\n ...conversationStorage(settings, createClaudeConversations),\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({\n ...settings.variables,\n ...(maxOutputTokens === undefined\n ? {}\n : { [CLAUDE_MAX_OUTPUT_VARIABLE]: String(maxOutputTokens) }),\n ...(mcpTimeout === undefined\n ? {}\n : { [CLAUDE_MCP_TIMEOUT_VARIABLE]: String(mcpTimeout) }),\n }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n liveInput: claudeLiveInput,\n quota: textMatcher(claudeQuotaPatterns),\n unavailable: textMatcher(\n claudeUnavailablePatterns,\n transientNoticePatterns,\n ),\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n\nexport function createClaudeHarness(settings: ClaudeSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(claudeLabel, claudeConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindClaude({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
1
+ {"version":3,"file":"claude-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC3D,OAAO,EACL,yBAAyB,EACzB,wBAAwB,GACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,GAC5B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACL,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,O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B;KAChB,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,WAA2B,EAAE;IAC/D,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,oBAAoB,CAAC,WAAW,EAAE,wBAAwB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC7E,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,UAAU,CAAC;YACT,GAAG,UAAU;YACb,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC;SAC1C,CAAC;KACL,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { supportClaudeProfile } from \"./claude-profile.ts\";\nimport {\n createClaudeConversations,\n claudeConversationLayout,\n} from \"./claude-conversations.ts\";\nimport {\n claudeLabel,\n claudeMcpSupport,\n claudeModelSupport,\n claudeQuotaPatterns,\n claudeUnavailablePatterns,\n CLAUDE_MAX_OUTPUT_VARIABLE,\n CLAUDE_MCP_TIMEOUT_VARIABLE,\n} from \"./claude.constants.ts\";\nimport { claudeMcpLogins } from \"./claude-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n sharedStartupTimeout,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport { invariant } from \"../../../domain/errors.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport { claudeCredentials } from \"./claude-authentication.ts\";\nimport type { AgentAdapter, CliHarness } from \"../../../domain/agent.types.ts\";\nimport { claudeEvents, claudeTranscriptUsage } from \"./claude-events.ts\";\nimport { claudeLiveInput } from \"./claude-input.ts\";\nimport { claudeRequest } from \"./claude-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound, ClaudeSettings } from \"../settings.types.ts\";\n\nfunction bindClaude(settings: Bound<ClaudeSettings>): AgentAdapter {\n supportModel(claudeModelSupport, settings.model);\n supportClaudeProfile(settings);\n supportMcpServers(claudeMcpSupport, settings.mcpServers);\n const maxOutputTokens = settings.model?.maxOutputTokens;\n invariant(\n maxOutputTokens === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MAX_OUTPUT_VARIABLE),\n `Set maxOutputTokens on the agent model or ${CLAUDE_MAX_OUTPUT_VARIABLE}, not both`,\n );\n const mcpTimeout = sharedStartupTimeout(settings.mcpServers);\n invariant(\n mcpTimeout === undefined ||\n !Object.hasOwn(settings.variables ?? {}, CLAUDE_MCP_TIMEOUT_VARIABLE),\n `Set startupTimeoutMs on MCP servers or ${CLAUDE_MCP_TIMEOUT_VARIABLE}, not both`,\n );\n const credentials = credentialPlanner(\n claudeLabel,\n claudeCredentials,\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n claudeLabel,\n settings.mcpServers,\n undefined,\n claudeMcpLogins,\n );\n return Object.freeze({\n usageInput: \"uncached\",\n name: \"claude\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"claude\",\n ...conversationStorage(settings, createClaudeConversations),\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({\n ...settings.variables,\n ...(maxOutputTokens === undefined\n ? {}\n : { [CLAUDE_MAX_OUTPUT_VARIABLE]: String(maxOutputTokens) }),\n ...(mcpTimeout === undefined\n ? {}\n : { [CLAUDE_MCP_TIMEOUT_VARIABLE]: String(mcpTimeout) }),\n }),\n request: (input) => claudeRequest(settings, input),\n events: claudeEvents,\n liveInput: claudeLiveInput,\n quota: textMatcher(claudeQuotaPatterns),\n unavailable: textMatcher(\n claudeUnavailablePatterns,\n transientNoticePatterns,\n ),\n transcriptUsage: claudeTranscriptUsage,\n } satisfies AgentAdapter);\n}\n\nexport function createClaudeHarness(settings: ClaudeSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(claudeLabel, claudeConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindClaude({\n ...configured,\n ...(model === undefined ? {} : { model }),\n }),\n });\n}\n"]}
@@ -0,0 +1,6 @@
1
+ export declare const CLAUDE_PROFILE_TOOLS: Readonly<{
2
+ read: readonly string[];
3
+ edit: readonly string[];
4
+ shell: readonly string[];
5
+ }>;
6
+ export declare const CLAUDE_PROFILE_HOOK = "let data = \"\";\nprocess.stdin.setEncoding(\"utf8\");\nprocess.stdin.on(\"data\", (chunk) => { data += chunk; });\nprocess.stdin.on(\"end\", () => {\n try {\n const input = JSON.parse(data);\n const name = input.tool_name;\n const permitted = tools.includes(name) &&\n (name !== \"Bash\" || shell || commands.includes(input.tool_input?.command));\n const mcp = servers.some((server) => typeof name === \"string\" && name.startsWith(\"mcp__\" + server + \"__\"));\n if (excluded.includes(name) || (!permitted && !mcp)) throw new Error(\"Denied by agent profile allowedTools\");\n process.stdout.write(JSON.stringify({ hookSpecificOutput: {\n hookEventName: \"PreToolUse\", permissionDecision: \"allow\"\n } }));\n } catch {\n process.stderr.write(\"Denied by agent profile allowedTools\");\n process.exitCode = 2;\n }\n});";
@@ -0,0 +1,25 @@
1
+ export const CLAUDE_PROFILE_TOOLS = Object.freeze({
2
+ read: Object.freeze(["Read", "Glob", "Grep"]),
3
+ edit: Object.freeze(["Edit", "Write", "NotebookEdit"]),
4
+ shell: Object.freeze(["Bash"]),
5
+ });
6
+ export const CLAUDE_PROFILE_HOOK = `let data = "";
7
+ process.stdin.setEncoding("utf8");
8
+ process.stdin.on("data", (chunk) => { data += chunk; });
9
+ process.stdin.on("end", () => {
10
+ try {
11
+ const input = JSON.parse(data);
12
+ const name = input.tool_name;
13
+ const permitted = tools.includes(name) &&
14
+ (name !== "Bash" || shell || commands.includes(input.tool_input?.command));
15
+ const mcp = servers.some((server) => typeof name === "string" && name.startsWith("mcp__" + server + "__"));
16
+ if (excluded.includes(name) || (!permitted && !mcp)) throw new Error("Denied by agent profile allowedTools");
17
+ process.stdout.write(JSON.stringify({ hookSpecificOutput: {
18
+ hookEventName: "PreToolUse", permissionDecision: "allow"
19
+ } }));
20
+ } catch {
21
+ process.stderr.write("Denied by agent profile allowedTools");
22
+ process.exitCode = 2;
23
+ }
24
+ });`;
25
+ //# sourceMappingURL=claude-profile.constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-profile.constants.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-profile.constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC,MAAM,CAAC;IAChD,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC;IACtD,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG;;;;;;;;;;;;;;;;;;IAkB/B,CAAC","sourcesContent":["export const CLAUDE_PROFILE_TOOLS = Object.freeze({\n read: Object.freeze([\"Read\", \"Glob\", \"Grep\"]),\n edit: Object.freeze([\"Edit\", \"Write\", \"NotebookEdit\"]),\n shell: Object.freeze([\"Bash\"]),\n});\n\nexport const CLAUDE_PROFILE_HOOK = `let data = \"\";\nprocess.stdin.setEncoding(\"utf8\");\nprocess.stdin.on(\"data\", (chunk) => { data += chunk; });\nprocess.stdin.on(\"end\", () => {\n try {\n const input = JSON.parse(data);\n const name = input.tool_name;\n const permitted = tools.includes(name) &&\n (name !== \"Bash\" || shell || commands.includes(input.tool_input?.command));\n const mcp = servers.some((server) => typeof name === \"string\" && name.startsWith(\"mcp__\" + server + \"__\"));\n if (excluded.includes(name) || (!permitted && !mcp)) throw new Error(\"Denied by agent profile allowedTools\");\n process.stdout.write(JSON.stringify({ hookSpecificOutput: {\n hookEventName: \"PreToolUse\", permissionDecision: \"allow\"\n } }));\n } catch {\n process.stderr.write(\"Denied by agent profile allowedTools\");\n process.exitCode = 2;\n }\n});`;\n"]}
@@ -0,0 +1,3 @@
1
+ import type { ClaudeSettings } from "../settings.types.ts";
2
+ export declare function supportClaudeProfile(settings: ClaudeSettings): void;
3
+ export declare function claudeProfileArguments(settings: ClaudeSettings): readonly string[];
@@ -0,0 +1,69 @@
1
+ import { invariant } from "../../../domain/errors.js";
2
+ import { quote } from "../../../infrastructure/process.js";
3
+ import { CLAUDE_PROFILE_HOOK, CLAUDE_PROFILE_TOOLS, } from "./claude-profile.constants.js";
4
+ export function supportClaudeProfile(settings) {
5
+ invariant(settings.profile?.allowedTools === undefined ||
6
+ settings.permissions === undefined ||
7
+ settings.permissions === "dontAsk", "Claude Code agent profile allowedTools requires permission mode dontAsk; remove conflicting permissions");
8
+ }
9
+ export function claudeProfileArguments(settings) {
10
+ const profile = settings.profile;
11
+ if (!profile)
12
+ return [];
13
+ const instructions = profile.instructions === undefined
14
+ ? []
15
+ : [
16
+ "--append-system-prompt",
17
+ profile.instructions,
18
+ "--system-prompt-snapshot",
19
+ "off",
20
+ ];
21
+ if (profile.allowedTools === undefined)
22
+ return instructions;
23
+ const tools = [
24
+ ...new Set(profile.allowedTools.flatMap((tool) => {
25
+ if (tool.startsWith("shell:"))
26
+ return ["Bash"];
27
+ if (tool === "read" || tool === "edit" || tool === "shell")
28
+ return CLAUDE_PROFILE_TOOLS[tool];
29
+ return [];
30
+ })),
31
+ ];
32
+ const commands = profile.allowedTools
33
+ .filter((tool) => tool.startsWith("shell:"))
34
+ .map((tool) => tool.slice(6));
35
+ const script = [
36
+ `const tools = ${JSON.stringify(tools)};`,
37
+ `const commands = ${JSON.stringify(commands)};`,
38
+ `const shell = ${profile.allowedTools.includes("shell")};`,
39
+ `const servers = ${JSON.stringify(Object.keys(settings.mcpServers ?? {}))};`,
40
+ `const excluded = ${JSON.stringify(Object.entries(settings.mcpServers ?? {}).flatMap(([server, entry]) => (entry.tools?.exclude ?? []).map((tool) => `mcp__${server}__${tool}`)))};`,
41
+ CLAUDE_PROFILE_HOOK,
42
+ ].join("\n");
43
+ return [
44
+ ...instructions,
45
+ `--tools=${tools.join(",")}`,
46
+ "--permission-mode",
47
+ "dontAsk",
48
+ "--setting-sources",
49
+ "",
50
+ "--strict-mcp-config",
51
+ "--settings",
52
+ JSON.stringify({
53
+ hooks: {
54
+ PreToolUse: [
55
+ {
56
+ matcher: "*",
57
+ hooks: [
58
+ {
59
+ type: "command",
60
+ command: `node -e ${quote(script)} || exit 2`,
61
+ },
62
+ ],
63
+ },
64
+ ],
65
+ },
66
+ }),
67
+ ];
68
+ }
69
+ //# sourceMappingURL=claude-profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"claude-profile.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,KAAK,EAAE,MAAM,oCAAoC,CAAC;AAC3D,OAAO,EACL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,+BAA+B,CAAC;AAGvC,MAAM,UAAU,oBAAoB,CAAC,QAAwB;IAC3D,SAAS,CACP,QAAQ,CAAC,OAAO,EAAE,YAAY,KAAK,SAAS;QAC1C,QAAQ,CAAC,WAAW,KAAK,SAAS;QAClC,QAAQ,CAAC,WAAW,KAAK,SAAS,EACpC,yGAAyG,CAC1G,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,sBAAsB,CACpC,QAAwB;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C,UAAU,IAAI,EAAE,CAAC,CAAC,GAAG;QAC5E,oBAAoB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,MAAM,KAAK,IAAI,EAAE,CAAC,CAAC,CAAC,GAAG;QACpL,mBAAmB;KACpB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACb,OAAO;QACL,GAAG,YAAY;QACf,WAAW,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;QAC5B,mBAAmB;QACnB,SAAS;QACT,mBAAmB;QACnB,EAAE;QACF,qBAAqB;QACrB,YAAY;QACZ,IAAI,CAAC,SAAS,CAAC;YACb,KAAK,EAAE;gBACL,UAAU,EAAE;oBACV;wBACE,OAAO,EAAE,GAAG;wBACZ,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,SAAS;gCACf,OAAO,EAAE,WAAW,KAAK,CAAC,MAAM,CAAC,YAAY;6BAC9C;yBACF;qBACF;iBACF;aACF;SACF,CAAC;KACH,CAAC;AACJ,CAAC","sourcesContent":["import { invariant } from \"../../../domain/errors.ts\";\nimport { quote } from \"../../../infrastructure/process.ts\";\nimport {\n CLAUDE_PROFILE_HOOK,\n CLAUDE_PROFILE_TOOLS,\n} from \"./claude-profile.constants.ts\";\nimport type { ClaudeSettings } from \"../settings.types.ts\";\n\nexport function supportClaudeProfile(settings: ClaudeSettings): void {\n invariant(\n settings.profile?.allowedTools === undefined ||\n settings.permissions === undefined ||\n settings.permissions === \"dontAsk\",\n \"Claude Code agent profile allowedTools requires permission mode dontAsk; remove conflicting permissions\",\n );\n}\n\nexport function claudeProfileArguments(\n settings: ClaudeSettings,\n): readonly string[] {\n const profile = settings.profile;\n if (!profile) return [];\n const instructions =\n profile.instructions === undefined\n ? []\n : [\n \"--append-system-prompt\",\n profile.instructions,\n \"--system-prompt-snapshot\",\n \"off\",\n ];\n if (profile.allowedTools === undefined) return instructions;\n const tools = [\n ...new Set(\n profile.allowedTools.flatMap((tool) => {\n if (tool.startsWith(\"shell:\")) return [\"Bash\"];\n if (tool === \"read\" || tool === \"edit\" || tool === \"shell\")\n return CLAUDE_PROFILE_TOOLS[tool];\n return [];\n }),\n ),\n ];\n const commands = profile.allowedTools\n .filter((tool) => tool.startsWith(\"shell:\"))\n .map((tool) => tool.slice(6));\n const script = [\n `const tools = ${JSON.stringify(tools)};`,\n `const commands = ${JSON.stringify(commands)};`,\n `const shell = ${profile.allowedTools.includes(\"shell\")};`,\n `const servers = ${JSON.stringify(Object.keys(settings.mcpServers ?? {}))};`,\n `const excluded = ${JSON.stringify(Object.entries(settings.mcpServers ?? {}).flatMap(([server, entry]) => (entry.tools?.exclude ?? []).map((tool) => `mcp__${server}__${tool}`)))};`,\n CLAUDE_PROFILE_HOOK,\n ].join(\"\\n\");\n return [\n ...instructions,\n `--tools=${tools.join(\",\")}`,\n \"--permission-mode\",\n \"dontAsk\",\n \"--setting-sources\",\n \"\",\n \"--strict-mcp-config\",\n \"--settings\",\n JSON.stringify({\n hooks: {\n PreToolUse: [\n {\n matcher: \"*\",\n hooks: [\n {\n type: \"command\",\n command: `node -e ${quote(script)} || exit 2`,\n },\n ],\n },\n ],\n },\n }),\n ];\n}\n"]}
@@ -1,9 +1,13 @@
1
+ import { claudeProfileArguments } from "./claude-profile.js";
1
2
  import { claudeUserMessage } from "./claude-input.js";
2
3
  import { claudeMcpArguments } from "./claude-mcp.js";
3
4
  import { validateContinuation } from "../continuation.js";
4
5
  export function claudeRequest(settings, input) {
5
6
  validateContinuation(input);
6
- const args = [...claudeMcpArguments(settings.mcpServers)];
7
+ const args = [
8
+ ...claudeMcpArguments(settings.mcpServers),
9
+ ...claudeProfileArguments(settings),
10
+ ];
7
11
  if (!input.interactive)
8
12
  args.push("--print", "--verbose", "--output-format", "stream-json");
9
13
  if (!input.interactive && input.liveInput)
@@ -14,9 +18,11 @@ export function claudeRequest(settings, input) {
14
18
  args.push("--model", settings.model.name);
15
19
  if (settings.model?.reasoning)
16
20
  args.push("--effort", settings.model.reasoning);
17
- if (settings.permissions)
21
+ if (settings.profile?.allowedTools === undefined && settings.permissions)
18
22
  args.push("--permission-mode", settings.permissions);
19
- if (!settings.permissions && !input.interactive)
23
+ if (settings.profile?.allowedTools === undefined &&
24
+ !settings.permissions &&
25
+ !input.interactive)
20
26
  args.push("--dangerously-skip-permissions");
21
27
  if (input.continuation) {
22
28
  args.push("--resume", input.continuation.id);
@@ -1 +1 @@
1
- {"version":3,"file":"claude-request.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,MAAM,UAAU,aAAa,CAC3B,QAA+B,EAC/B,KAAiB;IAEjB,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAC5B,MAAM,IAAI,GAAa,CAAC,GAAG,kBAAkB,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAAC;IACpE,IAAI,CAAC,KAAK,CAAC,WAAW;QACpB,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,CAAC,CAAC;IACtE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,SAAS;QACvC,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,aAAa,EAAE,wBAAwB,CAAC,CAAC;IACvE,IAAI,CAAC,KAAK,CAAC,WAAW,IAAI,QAAQ,CAAC,eAAe;QAChD,IAAI,C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CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../../domain/agent.types.ts\";\nimport type { Command } from \"../../../domain/command.types.ts\";\nimport { claudeUserMessage } from \"./claude-input.ts\";\nimport { claudeMcpArguments } from \"./claude-mcp.ts\";\nimport { validateContinuation } from \"../continuation.ts\";\nimport type { Bound, ClaudeSettings } from \"../settings.types.ts\";\n\nexport function claudeRequest(\n settings: Bound<ClaudeSettings>,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [...claudeMcpArguments(settings.mcpServers)];\n if (!input.interactive)\n args.push(\"--print\", \"--verbose\", \"--output-format\", \"stream-json\");\n if (!input.interactive && input.liveInput)\n args.push(\"--input-format\", \"stream-json\", \"--replay-user-messages\");\n if (!input.interactive && settings.partialMessages)\n args.push(\"--include-partial-messages\");\n if (settings.model) args.push(\"--model\", settings.model.name);\n if (settings.model?.reasoning)\n args.push(\"--effort\", settings.model.reasoning);\n if (settings.permissions)\n args.push(\"--permission-mode\", settings.permissions);\n if (!settings.permissions && !input.interactive)\n args.push(\"--dangerously-skip-permissions\");\n if (input.continuation) {\n args.push(\"--resume\", input.continuation.id);\n if (input.continuation.fork) args.push(\"--fork-session\");\n }\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"claude\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : {\n stdin: input.liveInput\n ? claudeUserMessage(input.text ?? \"\")\n : (input.text ?? \"\"),\n }),\n };\n}\n"]}
1
+ {"version":3,"file":"claude-request.js","sourceRoot":"","sources":["../../../../src/adapters/agents/claude/claude-request.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG1D,MAAM,U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EAAE,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;QAC7C,IAAI,KAAK,CAAC,YAAY,CAAC,IAAI;YAAE,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAC3D,CAAC;IACD,IAAI,KAAK,CAAC,WAAW,IAAI,KAAK,CAAC,IAAI,KAAK,SAAS;QAC/C,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;IAC9B,OAAO;QACL,UAAU,EAAE,QAAQ;QACpB,SAAS,EAAE,IAAI;QACf,GAAG,CAAC,KAAK,CAAC,WAAW;YACnB,CAAC,CAAC,EAAE,WAAW,EAAE,IAAI,EAAE;YACvB,CAAC,CAAC;gBACE,KAAK,EAAE,KAAK,CAAC,SAAS;oBACpB,CAAC,CAAC,iBAAiB,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;oBACrC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,IAAI,EAAE,CAAC;aACvB,CAAC;KACP,CAAC;AACJ,CAAC","sourcesContent":["import type { AgentInput } from \"../../../domain/agent.types.ts\";\nimport type { Command } from \"../../../domain/command.types.ts\";\nimport { claudeProfileArguments } from \"./claude-profile.ts\";\nimport { claudeUserMessage } from \"./claude-input.ts\";\nimport { claudeMcpArguments } from \"./claude-mcp.ts\";\nimport { validateContinuation } from \"../continuation.ts\";\nimport type { Bound, ClaudeSettings } from \"../settings.types.ts\";\n\nexport function claudeRequest(\n settings: Bound<ClaudeSettings>,\n input: AgentInput,\n): Command {\n validateContinuation(input);\n const args: string[] = [\n ...claudeMcpArguments(settings.mcpServers),\n ...claudeProfileArguments(settings),\n ];\n if (!input.interactive)\n args.push(\"--print\", \"--verbose\", \"--output-format\", \"stream-json\");\n if (!input.interactive && input.liveInput)\n args.push(\"--input-format\", \"stream-json\", \"--replay-user-messages\");\n if (!input.interactive && settings.partialMessages)\n args.push(\"--include-partial-messages\");\n if (settings.model) args.push(\"--model\", settings.model.name);\n if (settings.model?.reasoning)\n args.push(\"--effort\", settings.model.reasoning);\n if (settings.profile?.allowedTools === undefined && settings.permissions)\n args.push(\"--permission-mode\", settings.permissions);\n if (\n settings.profile?.allowedTools === undefined &&\n !settings.permissions &&\n !input.interactive\n )\n args.push(\"--dangerously-skip-permissions\");\n if (input.continuation) {\n args.push(\"--resume\", input.continuation.id);\n if (input.continuation.fork) args.push(\"--fork-session\");\n }\n if (input.interactive && input.text !== undefined)\n args.push(\"--\", input.text);\n return {\n executable: \"claude\",\n arguments: args,\n ...(input.interactive\n ? { interactive: true }\n : {\n stdin: input.liveInput\n ? claudeUserMessage(input.text ?? \"\")\n : (input.text ?? \"\"),\n }),\n };\n}\n"]}
@@ -1,3 +1,4 @@
1
+ import { rejectProfileTools } from "../profile-support.js";
1
2
  import { createCodexConversations, codexConversationLayout, } from "./codex-conversations.js";
2
3
  import { codexLabel, codexMcpSupport, codexModelSupport, codexQuotaPatterns, codexUnavailablePatterns, } from "./codex.constants.js";
3
4
  import { codexMcpLogins } from "./codex-mcp.js";
@@ -14,6 +15,7 @@ import { codexRequest } from "./codex-request.js";
14
15
  import { configuredSettings, harnessSettings, supportModel, } from "../model-support.js";
15
16
  function bindCodex(settings) {
16
17
  supportModel(codexModelSupport, settings.model);
18
+ rejectProfileTools(codexLabel, settings.profile);
17
19
  supportMcpServers(codexMcpSupport, settings.mcpServers);
18
20
  codexProvider(settings);
19
21
  const credentials = credentialPlanner(codexLabel, codexCredentials(settings.modelProvider), settings.authentication, settings.model);
@@ -1 +1 @@
1
- {"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/codex/codex-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,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ACL,CAAC","sourcesContent":["import {\n createCodexConversations,\n codexConversationLayout,\n} from \"./codex-conversations.ts\";\nimport {\n codexLabel,\n codexMcpSupport,\n codexModelSupport,\n codexQuotaPatterns,\n codexUnavailablePatterns,\n} from \"./codex.constants.ts\";\nimport { codexMcpLogins } from \"./codex-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport { codexCredentials } from \"./codex-authentication.ts\";\nimport type {\n AgentAdapter,\n AgentInput,\n CliHarness,\n} from \"../../../domain/agent.types.ts\";\nimport { codexAppSession } from \"./codex-app-session.ts\";\nimport { codexProvider } from \"./codex-provider.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound, CodexSettings } from \"../settings.types.ts\";\n\nfunction bindCodex(settings: Bound<CodexSettings>): AgentAdapter {\n supportModel(codexModelSupport, settings.model);\n supportMcpServers(codexMcpSupport, settings.mcpServers);\n codexProvider(settings);\n const credentials = credentialPlanner(\n codexLabel,\n codexCredentials(settings.modelProvider),\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n codexLabel,\n settings.mcpServers,\n undefined,\n codexMcpLogins,\n );\n return Object.freeze({\n name: \"codex\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"codex\",\n ...conversationStorage(settings, createCodexConversations),\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => codexRequest(settings, input),\n events: codexEvents,\n liveInput: Object.freeze({\n open: (input: AgentInput) => codexAppSession(settings, input),\n }),\n quota: textMatcher(codexQuotaPatterns),\n unavailable: textMatcher(codexUnavailablePatterns, transientNoticePatterns),\n } satisfies AgentAdapter);\n}\n\nexport function createCodexHarness(settings: CodexSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(codexLabel, codexConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindCodex({ ...configured, ...(model === undefined ? {} : { model }) }),\n });\n}\n"]}
1
+ {"version":3,"file":"codex-adapter.js","sourceRoot":"","sources":["../../../../src/adapters/agents/codex/codex-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EACL,wBAAwB,EACxB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,UAAU,EACV,eAAe,EACf,iBAAiB,EACjB,kBAAkB,EAClB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EACL,uBAAuB,EACvB,iBAAiB,GAClB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EACL,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAM7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,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IAAI,EAAE,CAAC,KAAiB,EAAE,EAAE,CAAC,eAAe,CAAC,QAAQ,EAAE,KAAK,CAAC;SAC9D,CAAC;QACF,KAAK,EAAE,WAAW,CAAC,kBAAkB,CAAC;QACtC,WAAW,EAAE,WAAW,CAAC,wBAAwB,EAAE,uBAAuB,CAAC;KACrD,CAAC,CAAC;AAC5B,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,WAA0B,EAAE;IAC7D,eAAe,CAAC,QAAQ,CAAC,CAAC;IAC1B,oBAAoB,CAAC,UAAU,EAAE,uBAAuB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAC3E,MAAM,UAAU,GAAG,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAChD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,IAAI,EAAE,CAAC,KAAkB,EAAE,EAAE,CAC3B,SAAS,CAAC,EAAE,GAAG,UAAU,EAAE,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;KAC1E,CAAC,CAAC;AACL,CAAC","sourcesContent":["import { rejectProfileTools } from \"../profile-support.ts\";\nimport {\n createCodexConversations,\n codexConversationLayout,\n} from \"./codex-conversations.ts\";\nimport {\n codexLabel,\n codexMcpSupport,\n codexModelSupport,\n codexQuotaPatterns,\n codexUnavailablePatterns,\n} from \"./codex.constants.ts\";\nimport { codexMcpLogins } from \"./codex-mcp.ts\";\nimport {\n mcpConfigurationPlanner,\n supportMcpServers,\n} from \"../mcp-configuration.ts\";\nimport { textMatcher } from \"../text-matcher.ts\";\nimport {\n conversationSettings,\n conversationStorage,\n} from \"../conversation-settings.ts\";\nimport { transientNoticePatterns } from \"../unavailable.constants.ts\";\nimport type { AgentModel } from \"../../../domain/model.types.ts\";\nimport { credentialPlanner } from \"../authentication.ts\";\nimport { codexCredentials } from \"./codex-authentication.ts\";\nimport type {\n AgentAdapter,\n AgentInput,\n CliHarness,\n} from \"../../../domain/agent.types.ts\";\nimport { codexAppSession } from \"./codex-app-session.ts\";\nimport { codexProvider } from \"./codex-provider.ts\";\nimport { codexEvents } from \"./codex-events.ts\";\nimport { codexRequest } from \"./codex-request.ts\";\nimport {\n configuredSettings,\n harnessSettings,\n supportModel,\n} from \"../model-support.ts\";\nimport type { Bound, CodexSettings } from \"../settings.types.ts\";\n\nfunction bindCodex(settings: Bound<CodexSettings>): AgentAdapter {\n supportModel(codexModelSupport, settings.model);\n rejectProfileTools(codexLabel, settings.profile);\n supportMcpServers(codexMcpSupport, settings.mcpServers);\n codexProvider(settings);\n const credentials = credentialPlanner(\n codexLabel,\n codexCredentials(settings.modelProvider),\n settings.authentication,\n settings.model,\n );\n const configuration = mcpConfigurationPlanner(\n codexLabel,\n settings.mcpServers,\n undefined,\n codexMcpLogins,\n );\n return Object.freeze({\n name: \"codex\",\n ...(credentials ? { credentials } : {}),\n ...(configuration ? { configuration } : {}),\n bootstrap: \"codex\",\n ...conversationStorage(settings, createCodexConversations),\n resumable: true,\n capture: settings.saveConversations ?? true,\n variables: Object.freeze({ ...settings.variables }),\n request: (input) => codexRequest(settings, input),\n events: codexEvents,\n liveInput: Object.freeze({\n open: (input: AgentInput) => codexAppSession(settings, input),\n }),\n quota: textMatcher(codexQuotaPatterns),\n unavailable: textMatcher(codexUnavailablePatterns, transientNoticePatterns),\n } satisfies AgentAdapter);\n}\n\nexport function createCodexHarness(settings: CodexSettings = {}): CliHarness {\n harnessSettings(settings);\n conversationSettings(codexLabel, codexConversationLayout.format, settings);\n const configured = configuredSettings(settings);\n return Object.freeze({\n kind: \"cli\",\n bind: (model?: AgentModel) =>\n bindCodex({ ...configured, ...(model === undefined ? {} : { model }) }),\n });\n}\n"]}
@@ -26,6 +26,9 @@ export function codexAppSession(settings, input) {
26
26
  return { id, data: line({ id, method, params }) };
27
27
  };
28
28
  const policy = {
29
+ ...(settings.profile?.instructions === undefined
30
+ ? {}
31
+ : { developerInstructions: settings.profile.instructions }),
29
32
  approvalPolicy: settings.approvalReviewer === "auto_review" ? "on-request" : "never",
30
33
  sandbox: "danger-full-access",
31
34
  ...(settings.approvalReviewer === "auto_review"
@@ -1 +1 @@
1
- {"version":3,"file":"codex-app-session.js","sourceRoot":"","sources":["../../../../src/adapters/agents/codex/codex-app-session.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;AACjE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC9B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE;CACjD,CAAC;AACF,MAAM,IAAI,GAAkB,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AAExE,sEAAsE;AACtE,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAAC;QACV,EAAE,EAAE,GAAG,gBAAgB,CAAC,UAAU,IAAI;QACtC,MAAM,EAAE,YAAY;QACpB,MAAM,EAAE,EAAE,UAAU,EAAE,cAAc,EAAE,YAAY,EAAE,IAAI,EAAE;KAC3D,CAAC,CAAC;AACL,CAAC;AAED,qFAAqF;AACrF,MAAM,UAAU,eAAe,CAC7B,QAA8B,EAC9B,KAAiB;IAEjB,IAAI,QAAQ,GAAG,CAAC,CAAC;IACjB,IAAI,MAA0B,CAAC;IAC/B,IAAI,IAAwB,CAAC;IAC7B,IAAI,QAAQ,GAAG,KAAK,CAAC;IACrB,MAAM,MAAM,GAAa,EAAE,CAAC;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,OAAO,IAAI,CAAC;YAClC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5D,EAAE,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAC3B,CAAC;YACF,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACvD,OAAO,CACL,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,EAAE,CAAC;gBACpE,IAAI,CACL,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AgentInput,\n AgentLiveRead,\n AgentLiveSession,\n} from \"../../../domain/agent.types.ts\";\nimport {\n codexAppClient,\n codexAppRequests,\n codexAppUnsupportedRequest,\n} from \"./codex-app.constants.ts\";\nimport { asRecord, decodeRecord } from \"../protocol.ts\";\nimport type { Bound, CodexSettings } from \"../settings.types.ts\";\n\nconst line = (message: object) => `${JSON.stringify(message)}\\n`;\nconst text = (value: string) => [\n { type: \"text\", text: value, text_elements: [] },\n];\nconst none: AgentLiveRead = Object.freeze({ consumed: 0, replies: [] });\n\n/** First stdin line of `codex app-server`: the initialize request. */\nexport function codexAppInitialize(): string {\n return line({\n id: `${codexAppRequests.initialize}-0`,\n method: \"initialize\",\n params: { clientInfo: codexAppClient, capabilities: null },\n });\n}\n\n/** Drives one `codex app-server` turn: thread, turn, then steering by turn/steer. */\nexport function codexAppSession(\n settings: Bound<CodexSettings>,\n input: AgentInput,\n): AgentLiveSession {\n let sequence = 0;\n let thread: string | undefined;\n let turn: string | undefined;\n let accepted = false;\n const queued: string[] = [];\n const steering = new Map<string, string>();\n const request = (prefix: string, method: string, params: object) => {\n const id = `${prefix}-${++sequence}`;\n return { id, data: line({ id, method, params }) };\n };\n const policy = {\n approvalPolicy:\n settings.approvalReviewer === \"auto_review\" ? \"on-request\" : \"never\",\n sandbox: \"danger-full-access\",\n ...(settings.approvalReviewer === \"auto_review\"\n ? { approvalsReviewer: \"auto_review\" }\n : {}),\n ...(settings.model ? { model: settings.model.name } : {}),\n };\n const openThread = () => {\n const continuation = input.continuation;\n if (!continuation)\n return request(codexAppRequests.thread, \"thread/start\", policy).data;\n return request(\n codexAppRequests.thread,\n continuation.fork ? \"thread/fork\" : \"thread/resume\",\n { threadId: continuation.id, ...policy },\n ).data;\n };\n const startTurn = (value: string) =>\n request(codexAppRequests.turn, \"turn/start\", {\n threadId: thread,\n input: text(value),\n ...(settings.model?.reasoning\n ? { effort: settings.model.reasoning }\n : {}),\n }).data;\n // Without an active turn, an instruction starts the next turn of the thread.\n const steer = (value: string) => {\n if (!turn) return startTurn(value);\n const sent = request(codexAppRequests.steer, \"turn/steer\", {\n threadId: thread,\n expectedTurnId: turn,\n input: text(value),\n });\n steering.set(sent.id, value);\n return sent.data;\n };\n const responses: Readonly<\n Record<\n string,\n (\n result: Record<string, unknown>,\n failed: boolean,\n id: string,\n ) => AgentLiveRead\n >\n > = {\n [codexAppRequests.initialize]: () => ({\n consumed: 0,\n replies: [line({ method: \"initialized\" }), openThread()],\n }),\n [codexAppRequests.thread]: (result) => {\n const id = asRecord(result.thread).id;\n thread = typeof id === \"string\" ? id : undefined;\n return {\n consumed: 0,\n replies: thread ? [startTurn(input.text ?? \"\")] : [],\n };\n },\n [codexAppRequests.turn]: (result, failed) => {\n if (failed) return none;\n const id = asRecord(result.turn).id;\n if (typeof id === \"string\") turn = id;\n accepted = true;\n return { consumed: 1, replies: queued.splice(0).map(steer) };\n },\n [codexAppRequests.steer]: (_result, failed, id) => {\n const value = steering.get(id);\n steering.delete(id);\n if (!failed) return { consumed: 1, replies: [] };\n turn = undefined;\n return { consumed: 0, replies: value ? [startTurn(value)] : [] };\n },\n };\n const notifications: Readonly<\n Record<string, (params: Record<string, unknown>) => void>\n > = {\n \"turn/started\": (params) => {\n const id = asRecord(params.turn).id;\n if (typeof id === \"string\") turn = id;\n },\n \"turn/completed\": () => {\n turn = undefined;\n },\n };\n return {\n encode(value) {\n if (!thread || !accepted) {\n queued.push(value);\n return \"\";\n }\n return steer(value);\n },\n read(output) {\n const message = decodeRecord(output);\n if (!message) return none;\n const method =\n typeof message.method === \"string\" ? message.method : undefined;\n if (message.id !== undefined && method)\n return {\n consumed: 0,\n replies: [\n line({ id: message.id, error: codexAppUnsupportedRequest }),\n ],\n };\n const id = typeof message.id === \"string\" ? message.id : undefined;\n if (method) {\n notifications[method]?.(asRecord(message.params));\n return none;\n }\n if (id === undefined) return none;\n const prefix = Object.values(codexAppRequests).find((value) =>\n id.startsWith(`${value}-`),\n );\n const handler = prefix ? responses[prefix] : undefined;\n return (\n handler?.(asRecord(message.result), message.error !== undefined, id) ??\n none\n );\n },\n };\n}\n"]}
1
+ {"version":3,"file":"codex-app-session.js","sourceRoot":"","sources":["../../../../src/adapters/agents/codex/codex-app-session.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAGxD,MAAM,IAAI,GAAG,CAAC,OAAe,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC;AACjE,MAAM,IAAI,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC;IAC9B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,aAAa,EAAE,EAAE,EAAE;CACjD,CAAC;AACF,MAAM,IAAI,GAAkB,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAC;AAExE,sEAAsE;AACtE,MAAM,UAAU,kBAAkB;IAChC,OAAO,IAAI,CAA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AAM,CAAC,CAAC,CAAC,SAAS,CAAC;YAClE,IAAI,OAAO,CAAC,EAAE,KAAK,SAAS,IAAI,MAAM;gBACpC,OAAO;oBACL,QAAQ,EAAE,CAAC;oBACX,OAAO,EAAE;wBACP,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,KAAK,EAAE,0BAA0B,EAAE,CAAC;qBAC5D;iBACF,CAAC;YACJ,MAAM,EAAE,GAAG,OAAO,OAAO,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;YACnE,IAAI,MAAM,EAAE,CAAC;gBACX,aAAa,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;gBAClD,OAAO,IAAI,CAAC;YACd,CAAC;YACD,IAAI,EAAE,KAAK,SAAS;gBAAE,OAAO,IAAI,CAAC;YAClC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAC5D,EAAE,CAAC,UAAU,CAAC,GAAG,KAAK,GAAG,CAAC,CAC3B,CAAC;YACF,MAAM,OAAO,GAAG,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACvD,OAAO,CACL,OAAO,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,KAAK,KAAK,SAAS,EAAE,EAAE,CAAC;gBACpE,IAAI,CACL,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["import type {\n AgentInput,\n AgentLiveRead,\n AgentLiveSession,\n} from \"../../../domain/agent.types.ts\";\nimport {\n codexAppClient,\n codexAppRequests,\n codexAppUnsupportedRequest,\n} from \"./codex-app.constants.ts\";\nimport { asRecord, decodeRecord } from \"../protocol.ts\";\nimport type { Bound, CodexSettings } from \"../settings.types.ts\";\n\nconst line = (message: object) => `${JSON.stringify(message)}\\n`;\nconst text = (value: string) => [\n { type: \"text\", text: value, text_elements: [] },\n];\nconst none: AgentLiveRead = Object.freeze({ consumed: 0, replies: [] });\n\n/** First stdin line of `codex app-server`: the initialize request. */\nexport function codexAppInitialize(): string {\n return line({\n id: `${codexAppRequests.initialize}-0`,\n method: \"initialize\",\n params: { clientInfo: codexAppClient, capabilities: null },\n });\n}\n\n/** Drives one `codex app-server` turn: thread, turn, then steering by turn/steer. */\nexport function codexAppSession(\n settings: Bound<CodexSettings>,\n input: AgentInput,\n): AgentLiveSession {\n let sequence = 0;\n let thread: string | undefined;\n let turn: string | undefined;\n let accepted = false;\n const queued: string[] = [];\n const steering = new Map<string, string>();\n const request = (prefix: string, method: string, params: object) => {\n const id = `${prefix}-${++sequence}`;\n return { id, data: line({ id, method, params }) };\n };\n const policy = {\n ...(settings.profile?.instructions === undefined\n ? {}\n : { developerInstructions: settings.profile.instructions }),\n approvalPolicy:\n settings.approvalReviewer === \"auto_review\" ? \"on-request\" : \"never\",\n sandbox: \"danger-full-access\",\n ...(settings.approvalReviewer === \"auto_review\"\n ? { approvalsReviewer: \"auto_review\" }\n : {}),\n ...(settings.model ? { model: settings.model.name } : {}),\n };\n const openThread = () => {\n const continuation = input.continuation;\n if (!continuation)\n return request(codexAppRequests.thread, \"thread/start\", policy).data;\n return request(\n codexAppRequests.thread,\n continuation.fork ? \"thread/fork\" : \"thread/resume\",\n { threadId: continuation.id, ...policy },\n ).data;\n };\n const startTurn = (value: string) =>\n request(codexAppRequests.turn, \"turn/start\", {\n threadId: thread,\n input: text(value),\n ...(settings.model?.reasoning\n ? { effort: settings.model.reasoning }\n : {}),\n }).data;\n // Without an active turn, an instruction starts the next turn of the thread.\n const steer = (value: string) => {\n if (!turn) return startTurn(value);\n const sent = request(codexAppRequests.steer, \"turn/steer\", {\n threadId: thread,\n expectedTurnId: turn,\n input: text(value),\n });\n steering.set(sent.id, value);\n return sent.data;\n };\n const responses: Readonly<\n Record<\n string,\n (\n result: Record<string, unknown>,\n failed: boolean,\n id: string,\n ) => AgentLiveRead\n >\n > = {\n [codexAppRequests.initialize]: () => ({\n consumed: 0,\n replies: [line({ method: \"initialized\" }), openThread()],\n }),\n [codexAppRequests.thread]: (result) => {\n const id = asRecord(result.thread).id;\n thread = typeof id === \"string\" ? id : undefined;\n return {\n consumed: 0,\n replies: thread ? [startTurn(input.text ?? \"\")] : [],\n };\n },\n [codexAppRequests.turn]: (result, failed) => {\n if (failed) return none;\n const id = asRecord(result.turn).id;\n if (typeof id === \"string\") turn = id;\n accepted = true;\n return { consumed: 1, replies: queued.splice(0).map(steer) };\n },\n [codexAppRequests.steer]: (_result, failed, id) => {\n const value = steering.get(id);\n steering.delete(id);\n if (!failed) return { consumed: 1, replies: [] };\n turn = undefined;\n return { consumed: 0, replies: value ? [startTurn(value)] : [] };\n },\n };\n const notifications: Readonly<\n Record<string, (params: Record<string, unknown>) => void>\n > = {\n \"turn/started\": (params) => {\n const id = asRecord(params.turn).id;\n if (typeof id === \"string\") turn = id;\n },\n \"turn/completed\": () => {\n turn = undefined;\n },\n };\n return {\n encode(value) {\n if (!thread || !accepted) {\n queued.push(value);\n return \"\";\n }\n return steer(value);\n },\n read(output) {\n const message = decodeRecord(output);\n if (!message) return none;\n const method =\n typeof message.method === \"string\" ? message.method : undefined;\n if (message.id !== undefined && method)\n return {\n consumed: 0,\n replies: [\n line({ id: message.id, error: codexAppUnsupportedRequest }),\n ],\n };\n const id = typeof message.id === \"string\" ? message.id : undefined;\n if (method) {\n notifications[method]?.(asRecord(message.params));\n return none;\n }\n if (id === undefined) return none;\n const prefix = Object.values(codexAppRequests).find((value) =>\n id.startsWith(`${value}-`),\n );\n const handler = prefix ? responses[prefix] : undefined;\n return (\n handler?.(asRecord(message.result), message.error !== undefined, id) ??\n none\n );\n },\n };\n}\n"]}