@fitlab-ai/agent-infra 0.9.10 → 0.9.12

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 (375) hide show
  1. package/README.md +19 -9
  2. package/README.zh-CN.md +19 -9
  3. package/bin/cli.ts +17 -4
  4. package/dist/bin/cli.js +19 -4
  5. package/dist/bin/internal-cli.js +55 -4
  6. package/dist/lib/agent-client.js +0 -1
  7. package/dist/lib/agent-clients/adapters/codex-lifecycle/build-identity.js +71 -10
  8. package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
  9. package/dist/lib/agent-clients/adapters/traecli.js +7 -8
  10. package/dist/lib/agent-clients/config.js +14 -99
  11. package/dist/lib/agent-clients/reconcile.js +1 -11
  12. package/dist/lib/agent-clients/schema.js +5 -4
  13. package/dist/lib/agent-clients/tokens.js +5 -15
  14. package/dist/lib/decide.js +14 -30
  15. package/dist/lib/defaults.json +8 -0
  16. package/dist/lib/git/workflow.js +43 -1
  17. package/dist/lib/init.js +3 -2
  18. package/dist/lib/internal/git-workflow.js +8 -1
  19. package/dist/lib/internal/platform-pr.js +8 -2
  20. package/dist/lib/internal/release-workflow.js +0 -1
  21. package/dist/lib/internal/task-delivery.js +59 -0
  22. package/dist/lib/internal/task-finalization.js +19 -9
  23. package/dist/lib/internal/task-ledger.js +8 -2
  24. package/dist/lib/internal/task-lifecycle.js +17 -93
  25. package/dist/lib/internal/task-orchestration.js +30 -216
  26. package/dist/lib/internal/task-validate.js +2 -1
  27. package/dist/lib/merge.js +205 -103
  28. package/dist/lib/platform/github-client.js +7 -1
  29. package/dist/lib/platform/pr-checks.js +8 -5
  30. package/dist/lib/platform/pr-summary.js +12 -8
  31. package/dist/lib/platform/pull-requests.js +393 -91
  32. package/dist/lib/platform/verification-required.js +13 -2
  33. package/dist/lib/platform/verification-sync.js +9 -4
  34. package/dist/lib/pr-review/evidence-grading.js +12 -4
  35. package/dist/lib/process-data/normalize.js +2 -9
  36. package/dist/lib/run/host.js +46 -16
  37. package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
  38. package/dist/lib/sandbox/commands/create.js +3 -3
  39. package/dist/lib/sandbox/commands/enter.js +18 -4
  40. package/dist/lib/sandbox/config.js +8 -12
  41. package/dist/lib/sandbox/control/executor.js +131 -39
  42. package/dist/lib/sandbox/control/lifecycle.js +55 -24
  43. package/dist/lib/sandbox/control/server.js +18 -16
  44. package/dist/lib/sandbox/mounts.js +3 -2
  45. package/dist/lib/sandbox/recovery.js +123 -22
  46. package/dist/lib/sandbox/workspace-identity.js +14 -0
  47. package/dist/lib/sandbox/workspace-view.js +8 -9
  48. package/dist/lib/self-update.js +278 -0
  49. package/dist/lib/server/process-state.js +2 -2
  50. package/dist/lib/server/protocol.js +5 -5
  51. package/dist/lib/task/activity-log.js +4 -1
  52. package/dist/lib/task/artifact-lifecycle.js +6 -4
  53. package/dist/lib/task/codex-orchestration.js +1 -1
  54. package/dist/lib/task/command-options.js +1 -3
  55. package/dist/lib/task/commands/cat.js +0 -5
  56. package/dist/lib/task/commands/decisions.js +76 -92
  57. package/dist/lib/task/commands/files.js +6 -6
  58. package/dist/lib/task/commands/grep.js +25 -61
  59. package/dist/lib/task/commands/issue-body.js +6 -6
  60. package/dist/lib/task/commands/log.js +25 -10
  61. package/dist/lib/task/commands/show.js +5 -6
  62. package/dist/lib/task/commands/status.js +8 -8
  63. package/dist/lib/task/commit-intent.js +100 -0
  64. package/dist/lib/task/commit-operation.js +181 -91
  65. package/dist/lib/task/commit-policy.js +1 -1
  66. package/dist/lib/task/control-authority.js +431 -0
  67. package/dist/lib/task/create.js +39 -8
  68. package/dist/lib/task/current-contract.js +35 -0
  69. package/dist/lib/task/decision-details.js +218 -0
  70. package/dist/lib/task/decision-intents.js +5 -2
  71. package/dist/lib/task/delivery-target.js +97 -0
  72. package/dist/lib/task/delivery.js +153 -0
  73. package/dist/lib/task/events.js +11 -5
  74. package/dist/lib/task/human-override.js +5 -2
  75. package/dist/lib/task/index.js +19 -20
  76. package/dist/lib/task/ledger-intents.js +8 -9
  77. package/dist/lib/task/ledger.js +13 -6
  78. package/dist/lib/task/lifecycle.js +122 -9
  79. package/dist/lib/task/orchestration.js +105 -75
  80. package/dist/lib/task/pr-delivery-fact.js +182 -0
  81. package/dist/lib/task/review-artifacts.js +31 -12
  82. package/dist/lib/task/review-finalization.js +13 -4
  83. package/dist/lib/task/review-fingerprint.js +8 -0
  84. package/dist/lib/task/verification-engine.js +86 -39
  85. package/dist/lib/task/verification-review.js +2 -2
  86. package/dist/lib/task/workspace-snapshot.js +5 -11
  87. package/dist/lib/task/write.js +11 -1
  88. package/dist/lib/update.js +13 -35
  89. package/dist/lib/version.js +5 -1
  90. package/dist/lifecycle-build-manifest.json +3 -3
  91. package/lib/agent-client.ts +0 -1
  92. package/lib/agent-clients/adapters/codex-lifecycle/build-identity.ts +105 -10
  93. package/lib/agent-clients/adapters/codex-lifecycle/manifest-files.json +12 -1
  94. package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
  95. package/lib/agent-clients/adapters/traecli.ts +7 -8
  96. package/lib/agent-clients/config.ts +14 -144
  97. package/lib/agent-clients/reconcile.ts +1 -12
  98. package/lib/agent-clients/schema.ts +5 -4
  99. package/lib/agent-clients/tokens.ts +5 -18
  100. package/lib/decide.ts +12 -22
  101. package/lib/defaults.json +8 -0
  102. package/lib/git/workflow.ts +38 -1
  103. package/lib/init.ts +5 -2
  104. package/lib/internal/git-workflow.ts +7 -1
  105. package/lib/internal/platform-pr.ts +8 -1
  106. package/lib/internal/release-workflow.ts +0 -1
  107. package/lib/internal/task-delivery.ts +53 -0
  108. package/lib/internal/task-finalization.ts +27 -13
  109. package/lib/internal/task-ledger.ts +8 -2
  110. package/lib/internal/task-lifecycle.ts +33 -76
  111. package/lib/internal/task-orchestration.ts +33 -190
  112. package/lib/internal/task-validate.ts +3 -2
  113. package/lib/merge.ts +236 -120
  114. package/lib/platform/github-client.ts +8 -1
  115. package/lib/platform/pr-checks.ts +7 -5
  116. package/lib/platform/pr-summary.ts +10 -7
  117. package/lib/platform/pull-requests.ts +425 -87
  118. package/lib/platform/verification-required.ts +12 -2
  119. package/lib/platform/verification-sync.ts +9 -4
  120. package/lib/pr-review/evidence-grading.ts +7 -4
  121. package/lib/process-data/normalize.ts +2 -8
  122. package/lib/run/host.ts +63 -14
  123. package/lib/sandbox/agent-client-reconciler.ts +5 -15
  124. package/lib/sandbox/commands/create.ts +4 -4
  125. package/lib/sandbox/commands/enter.ts +24 -4
  126. package/lib/sandbox/config.ts +9 -14
  127. package/lib/sandbox/control/container-identity.ts +2 -2
  128. package/lib/sandbox/control/executor.ts +148 -51
  129. package/lib/sandbox/control/lifecycle.ts +59 -31
  130. package/lib/sandbox/control/protocol.ts +1 -3
  131. package/lib/sandbox/control/server.ts +15 -12
  132. package/lib/sandbox/control/state.ts +7 -7
  133. package/lib/sandbox/mounts.ts +4 -3
  134. package/lib/sandbox/recovery.ts +162 -34
  135. package/lib/sandbox/tools.ts +1 -1
  136. package/lib/sandbox/workspace-identity.ts +28 -0
  137. package/lib/sandbox/workspace-view.ts +14 -10
  138. package/lib/self-update.ts +341 -0
  139. package/lib/server/process-state.ts +2 -2
  140. package/lib/server/protocol.ts +5 -5
  141. package/lib/task/activity-log.ts +6 -1
  142. package/lib/task/artifact-lifecycle.ts +7 -5
  143. package/lib/task/codex-orchestration.ts +2 -1
  144. package/lib/task/command-options.ts +1 -2
  145. package/lib/task/commands/cat.ts +0 -4
  146. package/lib/task/commands/decisions.ts +80 -75
  147. package/lib/task/commands/files.ts +6 -6
  148. package/lib/task/commands/grep.ts +23 -51
  149. package/lib/task/commands/issue-body.ts +6 -6
  150. package/lib/task/commands/log.ts +22 -10
  151. package/lib/task/commands/show.ts +5 -6
  152. package/lib/task/commands/status.ts +8 -8
  153. package/lib/task/commit-intent.ts +137 -0
  154. package/lib/task/commit-operation.ts +161 -79
  155. package/lib/task/commit-policy.ts +1 -2
  156. package/lib/task/control-authority.ts +563 -0
  157. package/lib/task/create.ts +40 -10
  158. package/lib/task/current-contract.ts +49 -0
  159. package/lib/task/decision-details.ts +280 -0
  160. package/lib/task/decision-intents.ts +7 -2
  161. package/lib/task/delivery-target.ts +130 -0
  162. package/lib/task/delivery.ts +160 -0
  163. package/lib/task/events.ts +10 -5
  164. package/lib/task/human-override.ts +5 -2
  165. package/lib/task/index.ts +19 -20
  166. package/lib/task/ledger-intents.ts +6 -8
  167. package/lib/task/ledger.ts +17 -7
  168. package/lib/task/lifecycle.ts +113 -4
  169. package/lib/task/orchestration.ts +102 -80
  170. package/lib/task/pr-delivery-fact.ts +254 -0
  171. package/lib/task/review-artifacts.ts +53 -15
  172. package/lib/task/review-finalization.ts +21 -5
  173. package/lib/task/review-fingerprint.ts +10 -0
  174. package/lib/task/verification-engine.ts +78 -46
  175. package/lib/task/verification-review.ts +3 -1
  176. package/lib/task/workspace-snapshot.ts +4 -13
  177. package/lib/task/write.ts +20 -1
  178. package/lib/update.ts +14 -38
  179. package/lib/version.ts +6 -1
  180. package/package.json +1 -1
  181. package/templates/.agents/README.en.md +5 -3
  182. package/templates/.agents/README.zh-CN.md +5 -3
  183. package/templates/.agents/rules/README.en.md +4 -2
  184. package/templates/.agents/rules/README.zh-CN.md +4 -2
  185. package/templates/.agents/rules/compatibility-policy.en.md +5 -4
  186. package/templates/.agents/rules/compatibility-policy.zh-CN.md +5 -4
  187. package/templates/.agents/rules/create-issue.en.md +11 -2
  188. package/templates/.agents/rules/create-issue.zh-CN.md +24 -2
  189. package/templates/.agents/rules/human-decision-context.en.md +9 -7
  190. package/templates/.agents/rules/human-decision-context.zh-CN.md +9 -7
  191. package/templates/.agents/rules/{issue-fields.github.en.md → issue-fields.en.md} +1 -1
  192. package/templates/.agents/rules/{issue-fields.github.zh-CN.md → issue-fields.zh-CN.md} +1 -1
  193. package/templates/.agents/rules/issue-pr-commands.en.md +5 -18
  194. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
  195. package/templates/.agents/rules/issue-sync.en.md +26 -5
  196. package/templates/.agents/rules/issue-sync.zh-CN.md +62 -5
  197. package/templates/.agents/rules/label-milestone-setup.en.md +15 -2
  198. package/templates/.agents/rules/label-milestone-setup.zh-CN.md +15 -2
  199. package/templates/.agents/rules/local-artifact-repair.en.md +46 -0
  200. package/templates/.agents/rules/local-artifact-repair.zh-CN.md +46 -0
  201. package/templates/.agents/rules/milestone-inference.en.md +12 -2
  202. package/templates/.agents/rules/milestone-inference.zh-CN.md +25 -3
  203. package/templates/.agents/rules/next-step-output.en.md +3 -3
  204. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -3
  205. package/templates/.agents/rules/no-mid-flow-questions.en.md +1 -1
  206. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +1 -1
  207. package/templates/.agents/rules/pr-sync.en.md +23 -14
  208. package/templates/.agents/rules/pr-sync.zh-CN.md +23 -2
  209. package/templates/.agents/rules/release-commands.en.md +42 -3
  210. package/templates/.agents/rules/release-commands.zh-CN.md +42 -3
  211. package/templates/.agents/rules/review-handshake.en.md +1 -1
  212. package/templates/.agents/rules/review-handshake.zh-CN.md +1 -1
  213. package/templates/.agents/rules/security-alerts.en.md +17 -2
  214. package/templates/.agents/rules/security-alerts.zh-CN.md +17 -2
  215. package/templates/.agents/rules/sync-content-generation.en.md +8 -0
  216. package/templates/.agents/rules/sync-content-generation.zh-CN.md +8 -0
  217. package/templates/.agents/rules/task-management.en.md +2 -3
  218. package/templates/.agents/rules/task-management.zh-CN.md +2 -3
  219. package/templates/.agents/scripts/security-alerts.github.sh +151 -0
  220. package/templates/.agents/scripts/security-alerts.sh +31 -0
  221. package/templates/.agents/skills/analyze-task/SKILL.en.md +4 -3
  222. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +4 -3
  223. package/templates/.agents/skills/block-task/SKILL.en.md +2 -2
  224. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +2 -2
  225. package/templates/.agents/skills/cancel-task/SKILL.en.md +2 -2
  226. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +2 -2
  227. package/templates/.agents/skills/check-task/SKILL.en.md +2 -2
  228. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +2 -2
  229. package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -3
  230. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -3
  231. package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -3
  232. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -3
  233. package/templates/.agents/skills/code-task/SKILL.en.md +8 -5
  234. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +9 -6
  235. package/templates/.agents/skills/commit/SKILL.en.md +30 -10
  236. package/templates/.agents/skills/commit/SKILL.zh-CN.md +6 -7
  237. package/templates/.agents/skills/commit/config/verify.json +1 -1
  238. package/templates/.agents/skills/commit/reference/commit-orchestration.en.md +3 -3
  239. package/templates/.agents/skills/commit/reference/commit-orchestration.zh-CN.md +3 -3
  240. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  241. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  242. package/templates/.agents/skills/commit/reference/task-status-update.en.md +2 -2
  243. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +2 -2
  244. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +7 -6
  245. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +7 -6
  246. package/templates/.agents/skills/complete-manual-validation/config/verify.en.json +1 -1
  247. package/templates/.agents/skills/complete-manual-validation/config/verify.zh-CN.json +1 -1
  248. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  249. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  250. package/templates/.agents/skills/complete-task/SKILL.en.md +13 -13
  251. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +13 -13
  252. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +2 -2
  253. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +2 -2
  254. package/templates/.agents/skills/create-pr/SKILL.en.md +9 -11
  255. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +9 -11
  256. package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -4
  257. package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -4
  258. package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
  259. package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
  260. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
  261. package/templates/.agents/skills/create-task/SKILL.en.md +2 -1
  262. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +2 -1
  263. package/templates/.agents/skills/import-codescan/SKILL.en.md +1 -1
  264. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +1 -1
  265. package/templates/.agents/skills/import-dependabot/SKILL.en.md +1 -1
  266. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +1 -1
  267. package/templates/.agents/skills/import-issue/SKILL.en.md +1 -1
  268. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +1 -1
  269. package/templates/.agents/skills/init-labels/SKILL.en.md +9 -10
  270. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +9 -10
  271. package/templates/.agents/skills/init-labels/scripts/init-labels.github.sh +57 -1
  272. package/templates/.agents/skills/init-labels/scripts/init-labels.sh +27 -1
  273. package/templates/.agents/skills/init-milestones/SKILL.en.md +3 -5
  274. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +3 -5
  275. package/templates/.agents/skills/plan-task/SKILL.en.md +4 -3
  276. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +4 -3
  277. package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
  278. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
  279. package/templates/.agents/skills/review-analysis/SKILL.en.md +8 -5
  280. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +8 -5
  281. package/templates/.agents/skills/review-analysis/config/verify.en.json +1 -0
  282. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +1 -0
  283. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +18 -0
  284. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +18 -0
  285. package/templates/.agents/skills/review-code/SKILL.en.md +11 -8
  286. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +11 -8
  287. package/templates/.agents/skills/review-code/config/verify.en.json +1 -0
  288. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +1 -0
  289. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +2 -1
  290. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +2 -1
  291. package/templates/.agents/skills/review-code/reference/output-templates.en.md +19 -1
  292. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +19 -1
  293. package/templates/.agents/skills/review-code/reference/report-template.en.md +4 -2
  294. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +4 -2
  295. package/templates/.agents/skills/review-plan/SKILL.en.md +8 -5
  296. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +8 -5
  297. package/templates/.agents/skills/review-plan/config/verify.en.json +1 -0
  298. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +1 -0
  299. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +18 -0
  300. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +18 -0
  301. package/templates/.agents/skills/review-pr/SKILL.en.md +1 -0
  302. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +1 -0
  303. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +2 -2
  304. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +2 -2
  305. package/templates/.agents/skills/run-manual-validation/SKILL.en.md +5 -0
  306. package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +5 -0
  307. package/templates/.agents/skills/run-task/SKILL.en.md +5 -1
  308. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +5 -1
  309. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +2 -2
  310. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +2 -2
  311. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +144 -109
  312. package/templates/.agents/skills/watch-pr/SKILL.en.md +5 -5
  313. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +5 -5
  314. package/templates/.agents/templates/task.en.md +6 -2
  315. package/templates/.agents/templates/task.zh-CN.md +6 -2
  316. package/templates/.agents/workflows/bug-fix.en.yaml +9 -8
  317. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +9 -8
  318. package/templates/.agents/workflows/feature-development.en.yaml +9 -8
  319. package/templates/.agents/workflows/feature-development.zh-CN.yaml +9 -8
  320. package/templates/.agents/workflows/refactoring.en.yaml +9 -8
  321. package/templates/.agents/workflows/refactoring.zh-CN.yaml +9 -8
  322. package/templates/.claude/commands/analyze-task.en.md +1 -1
  323. package/templates/.claude/commands/analyze-task.zh-CN.md +1 -1
  324. package/templates/.claude/commands/block-task.en.md +1 -1
  325. package/templates/.claude/commands/block-task.zh-CN.md +1 -1
  326. package/templates/.claude/commands/cancel-task.en.md +1 -1
  327. package/templates/.claude/commands/cancel-task.zh-CN.md +1 -1
  328. package/templates/.claude/commands/check-task.en.md +1 -1
  329. package/templates/.claude/commands/check-task.zh-CN.md +1 -1
  330. package/templates/.claude/commands/code-task.en.md +1 -1
  331. package/templates/.claude/commands/code-task.zh-CN.md +1 -1
  332. package/templates/.claude/commands/commit.en.md +1 -1
  333. package/templates/.claude/commands/commit.zh-CN.md +1 -1
  334. package/templates/.claude/commands/complete-manual-validation.en.md +1 -1
  335. package/templates/.claude/commands/complete-manual-validation.zh-CN.md +1 -1
  336. package/templates/.claude/commands/complete-task.en.md +1 -1
  337. package/templates/.claude/commands/complete-task.zh-CN.md +1 -1
  338. package/templates/.claude/commands/create-pr.en.md +1 -1
  339. package/templates/.claude/commands/create-pr.zh-CN.md +1 -1
  340. package/templates/.claude/commands/plan-task.en.md +1 -1
  341. package/templates/.claude/commands/plan-task.zh-CN.md +1 -1
  342. package/templates/.claude/commands/review-analysis.en.md +1 -1
  343. package/templates/.claude/commands/review-analysis.zh-CN.md +1 -1
  344. package/templates/.claude/commands/review-code.en.md +1 -1
  345. package/templates/.claude/commands/review-code.zh-CN.md +1 -1
  346. package/templates/.claude/commands/review-plan.en.md +1 -1
  347. package/templates/.claude/commands/review-plan.zh-CN.md +1 -1
  348. package/templates/.claude/commands/run-manual-validation.en.md +1 -1
  349. package/templates/.claude/commands/run-manual-validation.zh-CN.md +1 -1
  350. package/templates/.claude/commands/run-task.en.md +1 -1
  351. package/templates/.claude/commands/run-task.zh-CN.md +1 -1
  352. package/templates/.claude/commands/watch-pr.en.md +1 -1
  353. package/templates/.claude/commands/watch-pr.zh-CN.md +1 -1
  354. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.en.md +0 -1
  355. package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.zh-CN.md +0 -1
  356. package/dist/lib/builtin-tuis.js +0 -40
  357. package/lib/builtin-tuis.ts +0 -56
  358. package/templates/.agents/rules/create-issue.github.en.md +0 -14
  359. package/templates/.agents/rules/create-issue.github.zh-CN.md +0 -27
  360. package/templates/.agents/rules/issue-pr-commands.github.en.md +0 -34
  361. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +0 -49
  362. package/templates/.agents/rules/issue-sync.github.en.md +0 -40
  363. package/templates/.agents/rules/issue-sync.github.zh-CN.md +0 -76
  364. package/templates/.agents/rules/label-milestone-setup.github.en.md +0 -60
  365. package/templates/.agents/rules/label-milestone-setup.github.zh-CN.md +0 -60
  366. package/templates/.agents/rules/milestone-inference.github.en.md +0 -15
  367. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +0 -27
  368. package/templates/.agents/rules/pr-checks-commands.github.en.md +0 -18
  369. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +0 -34
  370. package/templates/.agents/rules/pr-sync.github.en.md +0 -43
  371. package/templates/.agents/rules/pr-sync.github.zh-CN.md +0 -69
  372. package/templates/.agents/rules/release-commands.github.en.md +0 -38
  373. package/templates/.agents/rules/release-commands.github.zh-CN.md +0 -38
  374. package/templates/.agents/rules/security-alerts.github.en.md +0 -43
  375. package/templates/.agents/rules/security-alerts.github.zh-CN.md +0 -43
@@ -6,6 +6,7 @@ import { hasPlatformCapability } from "./adapters.ts";
6
6
  import { inspectRequiredChecks } from "./pr-checks.ts";
7
7
  import { resolvePlatformContext } from "./context.ts";
8
8
  import { resolveReviewedHeadRelation } from "./merged-pr-equivalence.ts";
9
+ import { readPrDeliveryFact } from "../task/pr-delivery-fact.ts";
9
10
 
10
11
  const CHECK_TYPE = "required-checks";
11
12
  const SHA_PATTERN = /^[0-9a-f]{7,40}$/i;
@@ -34,7 +35,13 @@ function readHead(repoRoot: any): any {
34
35
 
35
36
  export function evaluateRequiredChecks(context: any, shared: any): any {
36
37
  const { metadata, localHead, inspection, prFlow } = context;
37
- if (prFlow === "disabled" || metadata.pr_status === "skipped" || !validPrNumber(metadata.pr_number)) {
38
+ const factRead = readPrDeliveryFact(metadata);
39
+ if (factRead.status === "invalid") {
40
+ return shared.failResult(CHECK_TYPE, factRead.error.message, "check_failed");
41
+ }
42
+ const fact = factRead.status === "valid" ? factRead.fact : null;
43
+ const prNumber = fact?.state === "bound" ? fact.identity.number : null;
44
+ if (prFlow === "disabled" || fact?.state === "skipped" || !validPrNumber(prNumber)) {
38
45
  return shared.passResult(CHECK_TYPE, "Skipped: required checks are not applicable to this task");
39
46
  }
40
47
 
@@ -87,7 +94,10 @@ export function check({ taskDir }: any, shared: any): any {
87
94
  const task = shared.loadTask(taskDir);
88
95
  if (!task.ok) return shared.failResult(CHECK_TYPE, task.message);
89
96
  const prFlow = readPrFlow(shared.repoRoot);
90
- if (prFlow === "disabled" || task.metadata.pr_status === "skipped" || !validPrNumber(task.metadata.pr_number)) {
97
+ const factRead = readPrDeliveryFact(task.metadata);
98
+ if (factRead.status === "invalid") return shared.failResult(CHECK_TYPE, factRead.error.message, "check_failed");
99
+ const bound = factRead.status === "valid" && factRead.fact.state === "bound";
100
+ if (prFlow === "disabled" || (factRead.status === "valid" && factRead.fact.state === "skipped") || !bound) {
91
101
  return evaluateRequiredChecks({ metadata: task.metadata, localHead: null, inspection: null, prFlow }, shared);
92
102
  }
93
103
  const platform = resolvePlatformContext({ cwd: shared.repoRoot });
@@ -10,6 +10,7 @@ import { inspectGitHubIssueMetadata, requirementSectionAnchors } from "./issues.
10
10
  import { listRemoteComments } from "./issue-comments.ts";
11
11
  import { taskTypeLabel } from "./metadata-labels.ts";
12
12
  import { inspectGitHubPullRequest } from "./pull-requests.ts";
13
+ import { readPrDeliveryFact } from "../task/pr-delivery-fact.ts";
13
14
 
14
15
  const CHECK_TYPE = "platform-sync";
15
16
  const VERSION_LINE_REGEX = /^[0-9]+\.[0-9]+\.x$/;
@@ -151,12 +152,16 @@ function buildSyncContext({ taskDir, config, artifactFile }: any): any {
151
152
  }
152
153
 
153
154
  const issueNumber = parseIssueNumber(task.metadata.issue_number);
154
- const prNumber = parsePrNumber(task.metadata.pr_number);
155
+ const fact = readPrDeliveryFact(task.metadata);
156
+ if (fact.status === "invalid") {
157
+ return { earlyReturn: failResult(CHECK_TYPE, fact.error.message, "check_failed") };
158
+ }
159
+ const prNumber = fact.status === "valid" && fact.fact.state === "bound" ? fact.fact.identity.number : null;
155
160
  if (config.when === "issue_number_exists" && !issueNumber) {
156
161
  return { earlyReturn: passResult(CHECK_TYPE, "Skipped: task has no issue_number") };
157
162
  }
158
- if (config.when === "pr_number_exists" && !prNumber) {
159
- return { earlyReturn: passResult(CHECK_TYPE, "Skipped: task has no pr_number") };
163
+ if (config.when === "pr_fact_bound" && !prNumber) {
164
+ return { earlyReturn: passResult(CHECK_TYPE, "Skipped: task has no verified bound pull request") };
160
165
  }
161
166
 
162
167
  if (!issueNumber) {
@@ -322,7 +327,7 @@ function fetchRemoteData(context: any): any {
322
327
  if (context.prMarker) {
323
328
  if (!context.prNumber) {
324
329
  return {
325
- earlyReturn: failResult(CHECK_TYPE, "Expected a valid pr_number for PR comment verification", "check_failed")
330
+ earlyReturn: failResult(CHECK_TYPE, "Expected a verified bound pull request for PR comment verification", "check_failed")
326
331
  };
327
332
  }
328
333
 
@@ -1,7 +1,8 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
3
 
4
- import { parseTaskFrontmatter } from '../task/frontmatter.ts';
4
+ import { parseTypedTaskFrontmatter } from '../task/frontmatter.ts';
5
+ import { readPrDeliveryFact } from '../task/pr-delivery-fact.ts';
5
6
 
6
7
  // ---------------------------------------------------------------------------
7
8
  // Host resolution (PL-4): PR -> unique / ambiguous / none.
@@ -62,7 +63,7 @@ export function extractClosingIssueNumbers(body: string): number[] {
62
63
  /**
63
64
  * Scan `.agents/workspace/active/{task-id}/task.md` files for tasks bound to the
64
65
  * PR number or to one of the PR's closing issues. A task is emitted at most once;
65
- * a direct `pr_number` hit takes priority over the issue-number reverse lookup.
66
+ * a verified fact identity hit takes priority over the issue-number reverse lookup.
66
67
  */
67
68
  export function collectHostCandidates(input: {
68
69
  prNumber: number;
@@ -87,9 +88,11 @@ export function collectHostCandidates(input: {
87
88
  } catch {
88
89
  continue;
89
90
  }
90
- const frontmatter = parseTaskFrontmatter(content);
91
+ let frontmatter: ReturnType<typeof parseTypedTaskFrontmatter>;
92
+ try { frontmatter = parseTypedTaskFrontmatter(content); } catch { continue; }
91
93
  const issueNumber = toPositiveNumber(frontmatter.issue_number);
92
- const prNumber = toPositiveNumber(frontmatter.pr_number);
94
+ const fact = readPrDeliveryFact(frontmatter);
95
+ const prNumber = fact.status === 'valid' && fact.fact.state === 'bound' ? fact.fact.identity.number : null;
93
96
  if (prNumber === input.prNumber) {
94
97
  candidates.push({ taskId: entry.name, taskDir, issueNumber, prNumber });
95
98
  } else if (issueNumber !== null && input.closingIssues.includes(issueNumber)) {
@@ -1,4 +1,5 @@
1
1
  import { sha256 } from './store.ts';
2
+ import { normalizeAgentToken } from '../agent-clients/tokens.ts';
2
3
 
3
4
  import type { CapturedObject, JsonValue, NormalizedKind, NormalizedRecord } from './types.ts';
4
5
 
@@ -14,14 +15,7 @@ function recordId(kind: NormalizedKind, identity: string, suffix = ''): string {
14
15
 
15
16
  function canonicalActor(raw: string): string | null {
16
17
  const lowered = raw.toLowerCase();
17
- const aliases: Record<string, string> = {
18
- 'claude-code': 'claude',
19
- 'antigravity-cli': 'antigravity',
20
- 'gemini-cli': 'gemini',
21
- gemini: 'gemini'
22
- };
23
- if (['claude', 'codex', 'antigravity', 'opencode', 'cursor', 'human'].includes(lowered)) return lowered;
24
- return aliases[lowered] ?? null;
18
+ return normalizeAgentToken(lowered);
25
19
  }
26
20
 
27
21
  function nextOccurrence(occurrences: Map<string, number>, identity: string): string {
package/lib/run/host.ts CHANGED
@@ -9,27 +9,74 @@ export type RunProcessResult = {
9
9
  stderr?: string;
10
10
  };
11
11
 
12
- function resolveCommand(file: string): string {
13
- if (process.platform !== 'win32' || path.extname(file)) {
14
- return file;
15
- }
12
+ type CommandResolution = Readonly<{
13
+ path: string;
14
+ source: 'absolute' | 'path' | 'current-directory' | 'unresolved';
15
+ pathEntry?: string;
16
+ }>;
17
+
18
+ function resolveCommandDetails(
19
+ file: string,
20
+ platform: NodeJS.Platform = process.platform,
21
+ env: NodeJS.ProcessEnv = process.env
22
+ ): CommandResolution {
23
+ if (path.isAbsolute(file)) return { path: file, source: 'absolute' };
16
24
 
17
- const pathValue = process.env.Path || process.env.PATH || '';
18
- const extensions = (process.env.PATHEXT || '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean);
19
- for (const dir of pathValue.split(path.delimiter).filter(Boolean)) {
25
+ const pathValue = platform === 'win32'
26
+ ? env.Path || env.PATH || ''
27
+ : env.PATH || '';
28
+ const extensions = platform === 'win32'
29
+ ? (path.extname(file)
30
+ ? ['']
31
+ : (env.PATHEXT || '.COM;.EXE;.BAT;.CMD').split(';').filter(Boolean))
32
+ : [''];
33
+ for (const dir of pathValue.split(path.delimiter)) {
20
34
  for (const extension of extensions) {
21
- const lowerCandidate = path.join(dir, `${file}${extension.toLowerCase()}`);
22
- if (fs.existsSync(lowerCandidate)) return lowerCandidate;
23
- const upperCandidate = path.join(dir, `${file}${extension.toUpperCase()}`);
24
- if (fs.existsSync(upperCandidate)) return upperCandidate;
35
+ const candidates = extension
36
+ ? [`${file}${extension.toLowerCase()}`, `${file}${extension.toUpperCase()}`]
37
+ : [file];
38
+ for (const candidateName of candidates) {
39
+ const candidate = path.resolve(dir || '.', candidateName);
40
+ try {
41
+ const stat = fs.statSync(candidate);
42
+ if (!stat.isFile()) continue;
43
+ if (platform !== 'win32' && (stat.mode & 0o111) === 0) continue;
44
+ return {
45
+ path: candidate,
46
+ source: dir ? 'path' : 'current-directory',
47
+ pathEntry: dir
48
+ };
49
+ } catch {
50
+ // Keep searching the remaining PATH entries.
51
+ }
52
+ }
25
53
  }
26
54
  }
27
55
 
28
- return file;
56
+ return { path: file, source: 'unresolved' };
57
+ }
58
+
59
+ function resolveCommand(
60
+ file: string,
61
+ platform: NodeJS.Platform = process.platform,
62
+ env: NodeJS.ProcessEnv = process.env
63
+ ): string {
64
+ return resolveCommandDetails(file, platform, env).path;
29
65
  }
30
66
 
31
- function needsShell(file: string): boolean {
32
- return process.platform === 'win32' && /\.(?:bat|cmd)$/i.test(file);
67
+ function resolveCommandFromAbsolutePath(
68
+ file: string,
69
+ platform: NodeJS.Platform = process.platform,
70
+ env: NodeJS.ProcessEnv = process.env
71
+ ): string | null {
72
+ const resolution = resolveCommandDetails(file, platform, env);
73
+ return resolution.source === 'path' && resolution.pathEntry && path.isAbsolute(resolution.pathEntry)
74
+ ? resolution.path
75
+ : null;
76
+ }
77
+
78
+ function needsShell(file: string, platform: NodeJS.Platform = process.platform): boolean {
79
+ return platform === 'win32' && /\.(?:bat|cmd)$/i.test(file);
33
80
  }
34
81
 
35
82
  export async function runHostCommand(command: string[]): Promise<RunProcessResult> {
@@ -45,3 +92,5 @@ export async function runHostCommand(command: string[]): Promise<RunProcessResul
45
92
  child.on('close', (exitCode, signal) => resolve({ exitCode, signal }));
46
93
  });
47
94
  }
95
+
96
+ export { needsShell, resolveCommand, resolveCommandFromAbsolutePath };
@@ -28,7 +28,7 @@ type SandboxCapabilityConfig = Readonly<{
28
28
  project: string;
29
29
  tools: readonly string[];
30
30
  customTools?: readonly SandboxTool[];
31
- agentClientState?: AgentClientState;
31
+ agentClientState: AgentClientState;
32
32
  }>;
33
33
 
34
34
  type SandboxRuntimeCapabilityProjection = Readonly<{
@@ -98,18 +98,6 @@ function agentInfraTool(home: string): SandboxTool {
98
98
  };
99
99
  }
100
100
 
101
- function compatAgentClientState(tools: readonly string[]): AgentClientState {
102
- return Object.fromEntries(
103
- listAgentClientAdapters().map((adapter) => [
104
- adapter.id,
105
- {
106
- enabled: true,
107
- installInSandbox: tools.includes(adapter.id)
108
- }
109
- ])
110
- ) as AgentClientState;
111
- }
112
-
113
101
  function stableValue(value: unknown): unknown {
114
102
  if (Array.isArray(value)) {
115
103
  return value.map(stableValue);
@@ -206,7 +194,7 @@ function hooksByPhase(
206
194
  function createSandboxCapabilityPlan(
207
195
  config: SandboxCapabilityConfig
208
196
  ): SandboxCapabilityPlan {
209
- const state = config.agentClientState ?? compatAgentClientState(config.tools);
197
+ const state = config.agentClientState;
210
198
  const selectedAgentClients = listInstalledAgentClientAdapters(state);
211
199
  const context = { home: config.home, project: config.project };
212
200
  const selectedTools = selectedAgentClients.map((adapter) =>
@@ -228,7 +216,9 @@ function createSandboxCapabilityPlan(
228
216
  const nonClientTools: SandboxTool[] = [];
229
217
  const selectedCustomTools: SandboxTool[] = [];
230
218
  for (const id of config.tools) {
231
- if (isAgentClientId(id)) continue;
219
+ if (isAgentClientId(id)) {
220
+ throw new Error(`Agent Client '${id}' must be provided by agentClientState`);
221
+ }
232
222
  if (id === 'agent-infra') {
233
223
  if (!nonClientTools.some((tool) => tool.id === id)) {
234
224
  nonClientTools.push(agentInfraTool(config.home));
@@ -77,7 +77,7 @@ import {
77
77
  commitSandboxControlReplacement,
78
78
  quiesceSandboxControlRoot,
79
79
  recoverSandboxControlReplacement,
80
- readSandboxControlManifestForTransition
80
+ readSandboxControlManifest
81
81
  } from '../control/lifecycle.ts';
82
82
  import { inspectSandboxControlContainer } from '../control/container-identity.ts';
83
83
  import { hostJoin, toEnginePath, volumeArg } from '../engines/wsl2-paths.ts';
@@ -1250,7 +1250,7 @@ export async function create(args: string[]): Promise<void> {
1250
1250
  const recoveryResult = await recoverSandboxControlReplacement(controlPaths.root, replacementLease);
1251
1251
  const hadExistingControlRoot = hadControlRootBeforeAcquire || recoveryResult === 'restored';
1252
1252
  const previousManifest = fs.existsSync(controlPaths.manifestPath)
1253
- ? readSandboxControlManifestForTransition(controlPaths.manifestPath)
1253
+ ? readSandboxControlManifest(controlPaths.manifestPath)
1254
1254
  : null;
1255
1255
  if (hadExistingControlRoot) {
1256
1256
  await quiesceSandboxControlRoot(controlPaths.root);
@@ -1423,10 +1423,10 @@ export async function create(args: string[]): Promise<void> {
1423
1423
  ...(target.workspace.mode === 'task-bound' ? { runtimeDir: control.runtimeDir } : {}),
1424
1424
  ...(target.workspace.mode === 'task-bound'
1425
1425
  ? {
1426
- taskSource: assertSandboxTaskSource(
1426
+ taskSources: [assertSandboxTaskSource(
1427
1427
  effectiveConfig.repoRoot,
1428
1428
  target.workspace.taskId
1429
- ),
1429
+ )],
1430
1430
  taskId: target.workspace.taskId
1431
1431
  }
1432
1432
  : {})
@@ -3,7 +3,9 @@ import {
3
3
  assertValidBranchName,
4
4
  containerNameCandidates,
5
5
  sandboxBranchLabel,
6
- sandboxLabel
6
+ sandboxLabel,
7
+ sandboxTaskIdLabel,
8
+ sandboxWorkspaceModeLabel
7
9
  } from '../constants.ts';
8
10
  import { detectEngine } from '../engine.ts';
9
11
  import { ensureSandboxReady } from '../recovery.ts';
@@ -21,7 +23,10 @@ import {
21
23
  fetchSandboxRows,
22
24
  selectSandboxContainer,
23
25
  } from './list-running.ts';
24
- import { resolveSandboxTarget } from '../workspace-identity.ts';
26
+ import {
27
+ resolveSandboxReentryContext,
28
+ resolveSandboxTarget
29
+ } from '../workspace-identity.ts';
25
30
 
26
31
  const USAGE = `Usage: ai sandbox exec [--recreate] <branch | TASK-id | N> [cmd...]
27
32
 
@@ -128,7 +133,11 @@ export async function enter(args: string[]): Promise<number> {
128
133
  const { running, nonRunning } = fetchSandboxRows(
129
134
  engine,
130
135
  sandboxLabel(config),
131
- sandboxBranchLabel(config)
136
+ sandboxBranchLabel(config),
137
+ {
138
+ mode: sandboxWorkspaceModeLabel(config),
139
+ taskId: sandboxTaskIdLabel(config)
140
+ }
132
141
  );
133
142
  const found = selectSandboxContainer(
134
143
  [...running, ...nonRunning],
@@ -140,11 +149,22 @@ export async function enter(args: string[]): Promise<number> {
140
149
  `No sandbox found for branch '${branch}'. Run 'ai sandbox create ${branch}' to create one.`
141
150
  );
142
151
  }
152
+ const containerWorkspace = found.workspaceMode === 'task-bound' && found.taskId
153
+ ? { mode: 'task-bound' as const, taskId: found.taskId }
154
+ : found.workspaceMode === 'branch-only'
155
+ ? { mode: 'branch-only' as const }
156
+ : { mode: 'legacy-invalid' as const };
157
+ const reentry = resolveSandboxReentryContext({
158
+ target,
159
+ containerWorkspace,
160
+ repoRoot: config.repoRoot
161
+ });
143
162
  const ready = await ensureSandboxReady({
144
163
  config,
145
164
  engine,
146
165
  branch,
147
- workspace: target.workspace,
166
+ workspace: reentry.workspace,
167
+ reentry: reentry.reentry,
148
168
  row: found,
149
169
  allowRecreate: parsed.recreate,
150
170
  recreate: async () => {
@@ -4,7 +4,6 @@ import { homedir, platform } from 'node:os';
4
4
  import { execFileSync } from 'node:child_process';
5
5
  import pc from 'picocolors';
6
6
  import { normalizeAgentClients } from '../agent-clients/config.ts';
7
- import { isAgentClientId } from '../agent-clients/types.ts';
8
7
  import type { AgentClientState } from '../agent-clients/types.ts';
9
8
  import { validateSandboxEngine } from './engine.ts';
10
9
  import type { SandboxEngineInput } from './engine.ts';
@@ -64,7 +63,7 @@ export type SandboxConfig = {
64
63
  tools: string[];
65
64
  customTools: SandboxTool[];
66
65
  agentClientState: AgentClientState;
67
- agentClientSource: 'canonical' | 'legacy';
66
+ delivery?: { remote: string; baseRef: string };
68
67
  refreshIntervalDays: number;
69
68
  dockerfile: string | null;
70
69
  vm: SandboxVmConfig;
@@ -74,8 +73,8 @@ type AircConfig = {
74
73
  project?: unknown;
75
74
  org?: unknown;
76
75
  agentClients?: unknown;
77
- tuis?: unknown;
78
76
  sandbox?: SandboxConfigInput;
77
+ delivery?: { remote?: unknown; baseRef?: unknown };
79
78
  };
80
79
 
81
80
  function detectRepoRoot(): string {
@@ -110,17 +109,10 @@ function cloneDefaults(): SandboxConfigInput & { vm: SandboxVmConfig; runtimes:
110
109
 
111
110
  function resolveSandboxToolIds(
112
111
  sandbox: SandboxConfigInput,
113
- agentClients: ReturnType<typeof normalizeAgentClients>,
114
112
  defaults: readonly string[]
115
113
  ): string[] {
116
114
  if (Array.isArray(sandbox.tools)) {
117
- const tools = sandbox.tools.filter((tool): tool is string => typeof tool === 'string');
118
- return agentClients.source === 'canonical'
119
- ? tools.filter((tool) => !isAgentClientId(tool))
120
- : tools;
121
- }
122
- if (agentClients.remainingSandboxTools !== undefined) {
123
- return [...agentClients.remainingSandboxTools];
115
+ return sandbox.tools.filter((tool): tool is string => typeof tool === 'string');
124
116
  }
125
117
  return [...defaults];
126
118
  }
@@ -142,10 +134,10 @@ export function loadConfig({
142
134
  }
143
135
 
144
136
  const airc = JSON.parse(fs.readFileSync(configPath, 'utf8')) as AircConfig;
145
- const sandboxInput = airc.sandbox;
146
137
  const agentClients = normalizeAgentClients(airc);
147
138
  const defaults = cloneDefaults();
148
139
  const sandbox = airc.sandbox ?? {};
140
+ const delivery = airc.delivery ?? {};
149
141
  const engine = validateSandboxEngine(sandbox.engine ?? defaults.engine, { platformFn });
150
142
  const project = airc.project;
151
143
 
@@ -178,7 +170,7 @@ export function loadConfig({
178
170
  }
179
171
 
180
172
  const customTools = parseCustomTools(sandbox.customTools, { home });
181
- const tools = resolveSandboxToolIds(sandbox, agentClients, defaults.tools);
173
+ const tools = resolveSandboxToolIds(sandbox, defaults.tools);
182
174
 
183
175
  return {
184
176
  repoRoot,
@@ -199,7 +191,10 @@ export function loadConfig({
199
191
  tools,
200
192
  customTools,
201
193
  agentClientState: agentClients.state,
202
- agentClientSource: agentClients.source,
194
+ delivery: {
195
+ remote: typeof delivery.remote === 'string' ? delivery.remote : 'origin',
196
+ baseRef: typeof delivery.baseRef === 'string' ? delivery.baseRef : 'main'
197
+ },
203
198
  refreshIntervalDays: asNonNegativeIntegerOrDefault(
204
199
  sandbox.refreshIntervalDays,
205
200
  defaults.refreshIntervalDays
@@ -1,4 +1,4 @@
1
- import type { SandboxControlManifest, SandboxControlManifestLike } from './protocol.ts';
1
+ import type { SandboxControlManifest } from './protocol.ts';
2
2
  import { commandForEngine, runEngine, runProbe } from '../shell.ts';
3
3
 
4
4
  export type ContainerObservation =
@@ -48,7 +48,7 @@ export function classifySandboxContainerInspection(
48
48
  }
49
49
 
50
50
  export async function inspectSandboxControlContainer(
51
- manifest: SandboxControlManifestLike,
51
+ manifest: SandboxControlManifest,
52
52
  options: { run?: typeof runEngine; probe?: typeof runProbe; timeoutMs?: number } = {}
53
53
  ): Promise<ContainerObservation> {
54
54
  try {