@fitlab-ai/agent-infra 0.9.1 → 0.9.3

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 (476) hide show
  1. package/README.md +24 -11
  2. package/README.zh-CN.md +24 -11
  3. package/bin/cli.ts +12 -0
  4. package/dist/bin/cli.js +14 -0
  5. package/dist/bin/internal-cli.js +30 -0
  6. package/dist/lib/agent-client.js +163 -0
  7. package/dist/lib/agent-clients/adapter.js +337 -0
  8. package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
  9. package/dist/lib/agent-clients/adapters/claude-code.js +71 -0
  10. package/dist/lib/agent-clients/adapters/codex-sandbox.js +210 -0
  11. package/dist/lib/agent-clients/adapters/codex.js +63 -0
  12. package/dist/lib/agent-clients/adapters/index.js +20 -0
  13. package/dist/lib/agent-clients/adapters/opencode.js +73 -0
  14. package/dist/lib/agent-clients/config.js +215 -0
  15. package/dist/lib/agent-clients/custom-tuis.js +99 -0
  16. package/dist/lib/agent-clients/invocation.js +9 -0
  17. package/dist/lib/agent-clients/next-steps.js +47 -0
  18. package/dist/lib/agent-clients/project-assets.js +45 -0
  19. package/dist/lib/agent-clients/reconcile.js +236 -0
  20. package/dist/lib/agent-clients/registry.js +78 -0
  21. package/dist/lib/agent-clients/schema.js +75 -0
  22. package/dist/lib/agent-clients/tokens.js +49 -0
  23. package/dist/lib/agent-clients/types.js +29 -0
  24. package/dist/lib/builtin-tuis.js +9 -14
  25. package/dist/lib/defaults.json +85 -73
  26. package/dist/lib/git/review-snapshot.js +25 -10
  27. package/dist/lib/git/reviewed-commit-equivalence.js +110 -0
  28. package/dist/lib/git/workflow.js +54 -1
  29. package/dist/lib/init.js +47 -91
  30. package/dist/lib/internal/agent-client.js +174 -0
  31. package/dist/lib/internal/git-workflow.js +7 -2
  32. package/dist/lib/internal/platform-checks.js +3 -3
  33. package/dist/lib/internal/platform-comment.js +29 -2
  34. package/dist/lib/internal/platform-issue.js +7 -0
  35. package/dist/lib/internal/platform-pr-review.js +132 -0
  36. package/dist/lib/internal/platform-pr.js +20 -2
  37. package/dist/lib/internal/platform-release-notes.js +52 -16
  38. package/dist/lib/internal/pr-review-grade.js +140 -0
  39. package/dist/lib/internal/release-workflow.js +82 -20
  40. package/dist/lib/internal/task-activity.js +73 -0
  41. package/dist/lib/internal/task-event.js +17 -1
  42. package/dist/lib/internal/task-lifecycle.js +7 -0
  43. package/dist/lib/internal/task-orchestration.js +196 -0
  44. package/dist/lib/internal/task-review.js +70 -0
  45. package/dist/lib/merge.js +2 -1
  46. package/dist/lib/platform/adapters.js +45 -1
  47. package/dist/lib/platform/change-request-git-evidence.js +113 -0
  48. package/dist/lib/platform/completion-backfill.js +122 -0
  49. package/dist/lib/platform/issue-comments.js +3 -2
  50. package/dist/lib/platform/merged-pr-equivalence.js +156 -16
  51. package/dist/lib/platform/pr-checks.js +101 -50
  52. package/dist/lib/platform/pr-review.js +166 -0
  53. package/dist/lib/platform/pull-requests.js +432 -7
  54. package/dist/lib/platform/release-notes.js +85 -3
  55. package/dist/lib/platform/releases.js +1 -1
  56. package/dist/lib/platform/verification-required.js +8 -10
  57. package/dist/lib/pr-review/evidence-grading.js +229 -0
  58. package/dist/lib/prompt.js +15 -3
  59. package/dist/lib/release/channels.js +4 -1
  60. package/dist/lib/release/workflow.js +4 -2
  61. package/dist/lib/remove-dir.js +25 -0
  62. package/dist/lib/run/tui.js +11 -7
  63. package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
  64. package/dist/lib/sandbox/clipboard/linux.js +2 -1
  65. package/dist/lib/sandbox/commands/create.js +76 -200
  66. package/dist/lib/sandbox/commands/enter.js +17 -1
  67. package/dist/lib/sandbox/commands/prune.js +2 -2
  68. package/dist/lib/sandbox/commands/rm.js +3 -2
  69. package/dist/lib/sandbox/commands/show.js +1 -1
  70. package/dist/lib/sandbox/config.js +21 -4
  71. package/dist/lib/sandbox/constants.js +3 -0
  72. package/dist/lib/sandbox/dockerfile.js +2 -1
  73. package/dist/lib/sandbox/managed-fs.js +10 -5
  74. package/dist/lib/sandbox/recovery.js +52 -36
  75. package/dist/lib/sandbox/shell.js +1 -1
  76. package/dist/lib/sandbox/tool-types.js +8 -0
  77. package/dist/lib/sandbox/tools.js +2 -126
  78. package/dist/lib/task/activity-intent.js +101 -0
  79. package/dist/lib/task/artifact-lifecycle.js +3 -50
  80. package/dist/lib/task/commands/decisions.js +50 -20
  81. package/dist/lib/task/commands/log.js +15 -14
  82. package/dist/lib/task/delegation-receipts.js +128 -0
  83. package/dist/lib/task/events.js +146 -8
  84. package/dist/lib/task/finalization-artifacts.js +35 -0
  85. package/dist/lib/task/lifecycle-execution.js +46 -0
  86. package/dist/lib/task/orchestration.js +784 -0
  87. package/dist/lib/task/review-artifacts.js +143 -59
  88. package/dist/lib/task/review-finalization.js +186 -0
  89. package/dist/lib/task/review-fingerprint.js +4 -0
  90. package/dist/lib/task/task-execution-lock.js +231 -0
  91. package/dist/lib/task/verification-checks.js +2 -1
  92. package/dist/lib/task/verification-engine.js +372 -28
  93. package/dist/lib/task/verification-review.js +1 -1
  94. package/dist/lib/task/verification.js +5 -2
  95. package/dist/lib/task/workspace-snapshot.js +46 -0
  96. package/dist/lib/update.js +42 -161
  97. package/lib/agent-client.ts +214 -0
  98. package/lib/agent-clients/adapter.ts +534 -0
  99. package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
  100. package/lib/agent-clients/adapters/claude-code.ts +79 -0
  101. package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
  102. package/lib/agent-clients/adapters/codex.ts +67 -0
  103. package/lib/agent-clients/adapters/index.ts +27 -0
  104. package/lib/agent-clients/adapters/opencode.ts +75 -0
  105. package/lib/agent-clients/config.ts +323 -0
  106. package/lib/agent-clients/custom-tuis.ts +149 -0
  107. package/lib/agent-clients/invocation.ts +19 -0
  108. package/lib/agent-clients/next-steps.ts +85 -0
  109. package/lib/agent-clients/project-assets.ts +96 -0
  110. package/lib/agent-clients/reconcile.ts +325 -0
  111. package/lib/agent-clients/registry.ts +154 -0
  112. package/lib/agent-clients/schema.ts +80 -0
  113. package/lib/agent-clients/tokens.ts +53 -0
  114. package/lib/agent-clients/types.ts +92 -0
  115. package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
  116. package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
  117. package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
  118. package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
  119. package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
  120. package/lib/builtin-tuis.ts +16 -15
  121. package/lib/defaults.json +24 -12
  122. package/lib/git/review-snapshot.ts +39 -9
  123. package/lib/git/reviewed-commit-equivalence.ts +135 -0
  124. package/lib/git/workflow.ts +66 -2
  125. package/lib/init.ts +53 -121
  126. package/lib/internal/agent-client.ts +186 -0
  127. package/lib/internal/git-workflow.ts +6 -2
  128. package/lib/internal/platform-checks.ts +4 -4
  129. package/lib/internal/platform-comment.ts +17 -2
  130. package/lib/internal/platform-issue.ts +4 -0
  131. package/lib/internal/platform-pr-review.ts +104 -0
  132. package/lib/internal/platform-pr.ts +14 -1
  133. package/lib/internal/platform-release-notes.ts +59 -16
  134. package/lib/internal/pr-review-grade.ts +130 -0
  135. package/lib/internal/release-workflow.ts +79 -20
  136. package/lib/internal/task-activity.ts +55 -0
  137. package/lib/internal/task-event.ts +9 -1
  138. package/lib/internal/task-lifecycle.ts +4 -0
  139. package/lib/internal/task-orchestration.ts +171 -0
  140. package/lib/internal/task-review.ts +70 -0
  141. package/lib/merge.ts +2 -1
  142. package/lib/platform/adapters.ts +169 -3
  143. package/lib/platform/change-request-git-evidence.ts +159 -0
  144. package/lib/platform/completion-backfill.ts +134 -0
  145. package/lib/platform/issue-comments.ts +3 -2
  146. package/lib/platform/merged-pr-equivalence.ts +178 -19
  147. package/lib/platform/pr-checks.ts +121 -66
  148. package/lib/platform/pr-review.ts +201 -0
  149. package/lib/platform/pull-requests.ts +529 -27
  150. package/lib/platform/release-notes.ts +100 -4
  151. package/lib/platform/releases.ts +1 -1
  152. package/lib/platform/verification-required.ts +12 -10
  153. package/lib/pr-review/evidence-grading.ts +318 -0
  154. package/lib/prompt.ts +16 -3
  155. package/lib/release/channels.ts +4 -1
  156. package/lib/release/workflow.ts +4 -3
  157. package/lib/remove-dir.ts +28 -0
  158. package/lib/run/tui.ts +12 -5
  159. package/lib/sandbox/agent-client-reconciler.ts +378 -0
  160. package/lib/sandbox/clipboard/linux.ts +2 -1
  161. package/lib/sandbox/commands/create.ts +111 -212
  162. package/lib/sandbox/commands/enter.ts +23 -1
  163. package/lib/sandbox/commands/prune.ts +2 -2
  164. package/lib/sandbox/commands/rm.ts +3 -2
  165. package/lib/sandbox/commands/show.ts +1 -1
  166. package/lib/sandbox/config.ts +31 -4
  167. package/lib/sandbox/constants.ts +6 -0
  168. package/lib/sandbox/dockerfile.ts +2 -1
  169. package/lib/sandbox/managed-fs.ts +18 -5
  170. package/lib/sandbox/recovery.ts +98 -67
  171. package/lib/sandbox/shell.ts +1 -1
  172. package/lib/sandbox/tool-types.ts +143 -0
  173. package/lib/sandbox/tools.ts +5 -157
  174. package/lib/server/server.schema.json +2 -2
  175. package/lib/task/activity-intent.ts +128 -0
  176. package/lib/task/artifact-lifecycle.ts +3 -39
  177. package/lib/task/commands/decisions.ts +53 -20
  178. package/lib/task/commands/log.ts +15 -14
  179. package/lib/task/delegation-receipts.ts +199 -0
  180. package/lib/task/events.ts +164 -11
  181. package/lib/task/finalization-artifacts.ts +58 -0
  182. package/lib/task/lifecycle-execution.ts +106 -0
  183. package/lib/task/orchestration.ts +1022 -0
  184. package/lib/task/review-artifacts.ts +201 -69
  185. package/lib/task/review-finalization.ts +306 -0
  186. package/lib/task/review-fingerprint.ts +5 -0
  187. package/lib/task/task-execution-lock.ts +296 -0
  188. package/lib/task/verification-checks.ts +2 -1
  189. package/lib/task/verification-engine.ts +424 -28
  190. package/lib/task/verification-review.ts +1 -0
  191. package/lib/task/verification.ts +8 -3
  192. package/lib/task/workspace-snapshot.ts +57 -0
  193. package/lib/update.ts +48 -184
  194. package/package.json +4 -4
  195. package/templates/.agents/QUICKSTART.en.md +25 -8
  196. package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
  197. package/templates/.agents/README.en.md +29 -25
  198. package/templates/.agents/README.zh-CN.md +29 -25
  199. package/templates/.agents/hooks/lifecycle-delegation.js +75 -0
  200. package/templates/.agents/rules/README.en.md +2 -0
  201. package/templates/.agents/rules/README.zh-CN.md +2 -0
  202. package/templates/.agents/rules/commit-and-pr.en.md +1 -0
  203. package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
  204. package/templates/.agents/rules/create-issue.github.en.md +4 -2
  205. package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -2
  206. package/templates/.agents/rules/human-decision-context.en.md +14 -12
  207. package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
  208. package/templates/.agents/rules/issue-fields.github.en.md +3 -1
  209. package/templates/.agents/rules/issue-fields.github.zh-CN.md +3 -1
  210. package/templates/.agents/rules/issue-pr-commands.en.md +5 -3
  211. package/templates/.agents/rules/issue-pr-commands.github.en.md +5 -3
  212. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +5 -3
  213. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -3
  214. package/templates/.agents/rules/issue-sync.github.en.md +7 -3
  215. package/templates/.agents/rules/issue-sync.github.zh-CN.md +8 -4
  216. package/templates/.agents/rules/lifecycle-orchestration.en.md +24 -0
  217. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +24 -0
  218. package/templates/.agents/rules/milestone-inference.github.en.md +4 -2
  219. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -2
  220. package/templates/.agents/rules/next-step-output.en.md +18 -0
  221. package/templates/.agents/rules/next-step-output.zh-CN.md +18 -0
  222. package/templates/.agents/rules/no-mid-flow-questions.en.md +19 -0
  223. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +19 -0
  224. package/templates/.agents/rules/pr-checks-commands.en.md +3 -3
  225. package/templates/.agents/rules/pr-checks-commands.github.en.md +2 -2
  226. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +2 -2
  227. package/templates/.agents/rules/pr-checks-commands.zh-CN.md +3 -3
  228. package/templates/.agents/rules/pr-sync.en.md +3 -1
  229. package/templates/.agents/rules/pr-sync.github.en.md +11 -1
  230. package/templates/.agents/rules/pr-sync.github.zh-CN.md +11 -1
  231. package/templates/.agents/rules/pr-sync.zh-CN.md +3 -1
  232. package/templates/.agents/rules/release-commands.en.md +1 -1
  233. package/templates/.agents/rules/release-commands.github.en.md +21 -5
  234. package/templates/.agents/rules/release-commands.github.zh-CN.md +21 -5
  235. package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
  236. package/templates/.agents/rules/review-handshake.en.md +4 -4
  237. package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
  238. package/templates/.agents/rules/review-method.en.md +113 -0
  239. package/templates/.agents/rules/review-method.zh-CN.md +98 -0
  240. package/templates/.agents/rules/task-management.en.md +11 -0
  241. package/templates/.agents/rules/task-management.zh-CN.md +11 -0
  242. package/templates/.agents/skills/analyze-task/SKILL.en.md +15 -12
  243. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +15 -12
  244. package/templates/.agents/skills/block-task/SKILL.en.md +11 -9
  245. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +11 -9
  246. package/templates/.agents/skills/cancel-task/SKILL.en.md +10 -8
  247. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +11 -9
  248. package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
  249. package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
  250. package/templates/.agents/skills/close-codescan/SKILL.en.md +7 -5
  251. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +7 -5
  252. package/templates/.agents/skills/close-dependabot/SKILL.en.md +7 -5
  253. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +7 -5
  254. package/templates/.agents/skills/code-task/SKILL.en.md +10 -7
  255. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +13 -10
  256. package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
  257. package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
  258. package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
  259. package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
  260. package/templates/.agents/skills/commit/SKILL.en.md +13 -1
  261. package/templates/.agents/skills/commit/SKILL.zh-CN.md +13 -1
  262. package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
  263. package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
  264. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  265. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  266. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  267. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  268. package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
  269. package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
  270. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +6 -4
  271. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +6 -4
  272. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  273. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  274. package/templates/.agents/skills/complete-task/SKILL.en.md +23 -8
  275. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +23 -8
  276. package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
  277. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
  278. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +17 -0
  279. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +17 -0
  280. package/templates/.agents/skills/create-pr/SKILL.en.md +13 -11
  281. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +13 -11
  282. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  283. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  284. package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
  285. package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
  286. package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -16
  287. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -16
  288. package/templates/.agents/skills/create-task/SKILL.en.md +16 -14
  289. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +16 -14
  290. package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
  291. package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
  292. package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
  293. package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
  294. package/templates/.agents/skills/import-issue/SKILL.en.md +10 -8
  295. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +10 -8
  296. package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
  297. package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
  298. package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
  299. package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
  300. package/templates/.agents/skills/plan-task/SKILL.en.md +13 -10
  301. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -10
  302. package/templates/.agents/skills/post-release/SKILL.en.md +2 -0
  303. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +2 -0
  304. package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
  305. package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
  306. package/templates/.agents/skills/release/SKILL.en.md +16 -10
  307. package/templates/.agents/skills/release/SKILL.zh-CN.md +16 -10
  308. package/templates/.agents/skills/restore-task/SKILL.en.md +4 -1
  309. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -1
  310. package/templates/.agents/skills/review-analysis/SKILL.en.md +18 -4
  311. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +19 -5
  312. package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
  313. package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
  314. package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
  315. package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
  316. package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
  317. package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
  318. package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
  319. package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
  320. package/templates/.agents/skills/review-code/SKILL.en.md +35 -12
  321. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +35 -12
  322. package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
  323. package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
  324. package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
  325. package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
  326. package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
  327. package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
  328. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
  329. package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
  330. package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
  331. package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
  332. package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
  333. package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
  334. package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
  335. package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
  336. package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
  337. package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
  338. package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
  339. package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
  340. package/templates/.agents/skills/review-plan/SKILL.en.md +18 -4
  341. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +19 -5
  342. package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
  343. package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
  344. package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
  345. package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
  346. package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
  347. package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
  348. package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
  349. package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
  350. package/templates/.agents/skills/review-pr/SKILL.en.md +158 -0
  351. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +158 -0
  352. package/templates/.agents/skills/review-pr/config/verify.en.json +37 -0
  353. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +37 -0
  354. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +65 -0
  355. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +65 -0
  356. package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +18 -0
  357. package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +18 -0
  358. package/templates/.agents/skills/review-pr/reference/report-template.en.md +85 -0
  359. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +85 -0
  360. package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
  361. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
  362. package/templates/.agents/skills/run-task/config/verify.en.json +10 -0
  363. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +10 -0
  364. package/templates/.agents/skills/run-task/reference/host-validation.en.md +20 -0
  365. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +20 -0
  366. package/templates/.agents/skills/test/SKILL.en.md +4 -4
  367. package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
  368. package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
  369. package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
  370. package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
  371. package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
  372. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +664 -246
  373. package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
  374. package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
  375. package/templates/.agents/skills/watch-pr/SKILL.en.md +21 -21
  376. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +21 -21
  377. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +27 -6
  378. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +26 -5
  379. package/templates/.agents/templates/task.en.md +1 -1
  380. package/templates/.agents/templates/task.zh-CN.md +1 -1
  381. package/templates/.agents/workflows/bug-fix.en.yaml +3 -3
  382. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +3 -3
  383. package/templates/.agents/workflows/code-review.en.yaml +1 -1
  384. package/templates/.agents/workflows/code-review.zh-CN.yaml +1 -1
  385. package/templates/.agents/workflows/feature-development.en.yaml +4 -4
  386. package/templates/.agents/workflows/feature-development.zh-CN.yaml +4 -4
  387. package/templates/.agents/workflows/refactoring.en.yaml +3 -3
  388. package/templates/.agents/workflows/refactoring.zh-CN.yaml +3 -3
  389. package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
  390. package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
  391. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
  392. package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
  393. package/templates/.claude/commands/post-release.en.md +1 -0
  394. package/templates/.claude/commands/post-release.zh-CN.md +1 -0
  395. package/templates/.claude/commands/review-pr.en.md +8 -0
  396. package/templates/.claude/commands/review-pr.zh-CN.md +8 -0
  397. package/templates/.claude/commands/run-task.en.md +8 -0
  398. package/templates/.claude/commands/run-task.zh-CN.md +8 -0
  399. package/templates/.claude/settings.json +24 -0
  400. package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
  401. package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
  402. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
  403. package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
  404. package/templates/.gemini/commands/_project_/review-pr.en.toml +10 -0
  405. package/templates/.gemini/commands/_project_/review-pr.zh-CN.toml +10 -0
  406. package/templates/.opencode/commands/post-release.en.md +2 -0
  407. package/templates/.opencode/commands/post-release.zh-CN.md +2 -0
  408. package/templates/.opencode/commands/review-pr.en.md +11 -0
  409. package/templates/.opencode/commands/review-pr.zh-CN.md +11 -0
  410. package/templates/.opencode/commands/run-task.en.md +11 -0
  411. package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
  412. package/templates/.gemini/commands/_project_/analyze-task.en.toml +0 -10
  413. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +0 -10
  414. package/templates/.gemini/commands/_project_/archive-tasks.en.toml +0 -10
  415. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +0 -10
  416. package/templates/.gemini/commands/_project_/block-task.en.toml +0 -10
  417. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +0 -10
  418. package/templates/.gemini/commands/_project_/cancel-task.en.toml +0 -10
  419. package/templates/.gemini/commands/_project_/cancel-task.zh-CN.toml +0 -10
  420. package/templates/.gemini/commands/_project_/check-task.en.toml +0 -10
  421. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +0 -10
  422. package/templates/.gemini/commands/_project_/close-codescan.en.toml +0 -8
  423. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +0 -8
  424. package/templates/.gemini/commands/_project_/close-dependabot.en.toml +0 -8
  425. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +0 -8
  426. package/templates/.gemini/commands/_project_/code-task.en.toml +0 -10
  427. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +0 -10
  428. package/templates/.gemini/commands/_project_/commit.en.toml +0 -10
  429. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +0 -10
  430. package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +0 -10
  431. package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +0 -10
  432. package/templates/.gemini/commands/_project_/complete-task.en.toml +0 -10
  433. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +0 -10
  434. package/templates/.gemini/commands/_project_/create-pr.en.toml +0 -10
  435. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +0 -10
  436. package/templates/.gemini/commands/_project_/create-release-note.en.toml +0 -8
  437. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +0 -8
  438. package/templates/.gemini/commands/_project_/create-task.en.toml +0 -8
  439. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +0 -8
  440. package/templates/.gemini/commands/_project_/import-codescan.en.toml +0 -8
  441. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +0 -8
  442. package/templates/.gemini/commands/_project_/import-dependabot.en.toml +0 -8
  443. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +0 -8
  444. package/templates/.gemini/commands/_project_/import-issue.en.toml +0 -8
  445. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +0 -8
  446. package/templates/.gemini/commands/_project_/init-labels.en.toml +0 -8
  447. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +0 -8
  448. package/templates/.gemini/commands/_project_/init-milestones.en.toml +0 -10
  449. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +0 -10
  450. package/templates/.gemini/commands/_project_/plan-task.en.toml +0 -10
  451. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +0 -10
  452. package/templates/.gemini/commands/_project_/post-release.en.toml +0 -6
  453. package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +0 -6
  454. package/templates/.gemini/commands/_project_/refine-title.en.toml +0 -8
  455. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +0 -8
  456. package/templates/.gemini/commands/_project_/release.en.toml +0 -8
  457. package/templates/.gemini/commands/_project_/release.zh-CN.toml +0 -8
  458. package/templates/.gemini/commands/_project_/restore-task.en.toml +0 -8
  459. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +0 -8
  460. package/templates/.gemini/commands/_project_/review-analysis.en.toml +0 -10
  461. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +0 -10
  462. package/templates/.gemini/commands/_project_/review-code.en.toml +0 -10
  463. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +0 -10
  464. package/templates/.gemini/commands/_project_/review-plan.en.toml +0 -10
  465. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +0 -10
  466. package/templates/.gemini/commands/_project_/test-integration.en.toml +0 -6
  467. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +0 -6
  468. package/templates/.gemini/commands/_project_/test.en.toml +0 -6
  469. package/templates/.gemini/commands/_project_/test.zh-CN.toml +0 -6
  470. package/templates/.gemini/commands/_project_/update-agent-infra.en.toml +0 -6
  471. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +0 -6
  472. package/templates/.gemini/commands/_project_/upgrade-dependency.en.toml +0 -8
  473. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +0 -8
  474. package/templates/.gemini/commands/_project_/watch-pr.en.toml +0 -10
  475. package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +0 -10
  476. package/templates/.gemini/settings.json +0 -3
package/lib/update.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import fs from 'node:fs';
2
2
  import path from 'node:path';
3
+ import { normalizeAgentClients } from './agent-clients/config.ts';
4
+ import {
5
+ applyAgentClientReconciliation,
6
+ planAgentClientReconciliation
7
+ } from './agent-clients/reconcile.ts';
3
8
  import { info, ok, err } from './log.ts';
4
9
  import { resolveTemplateDir } from './paths.ts';
5
- import { renderFile, copySkillDir, KNOWN_PLATFORMS } from './render.ts';
6
- import { isPathOwnedByDisabledTUI, resolveEnabledTUIs } from './builtin-tuis.ts';
7
- import type { BuiltinTUIId } from './builtin-tuis.ts';
10
+ import { renderFile, copySkillDir } from './render.ts';
8
11
 
9
12
  type FileRegistry = {
10
13
  managed: string[];
@@ -24,6 +27,8 @@ type UpdateConfig = {
24
27
  labels?: Record<string, unknown>;
25
28
  files?: Partial<FileRegistry>;
26
29
  tuis?: unknown;
30
+ agentClients?: unknown;
31
+ customTUIs?: unknown;
27
32
  };
28
33
 
29
34
  type Defaults = {
@@ -40,9 +45,6 @@ const defaults = JSON.parse(
40
45
 
41
46
  const CONFIG_DIR = '.agents';
42
47
  const CONFIG_PATH = path.join(CONFIG_DIR, '.airc.json');
43
- const AGENT_INFRA_SANDBOX_TOOL = 'agent-infra';
44
- const LEGACY_DEFAULT_SANDBOX_TOOLS = ['claude-code', 'codex', 'gemini-cli', 'opencode'];
45
- const DEFAULT_SANDBOX_TOOLS = [AGENT_INFRA_SANDBOX_TOOL, ...LEGACY_DEFAULT_SANDBOX_TOOLS];
46
48
 
47
49
  // One-time migration of the legacy project-level PR switch to the three-state
48
50
  // `prFlow` preference. `true` (the old default / "PR flow on") maps to the
@@ -63,83 +65,6 @@ function migratePrFlow(config: UpdateConfig): 'required' | 'disabled' | null {
63
65
  return null;
64
66
  }
65
67
 
66
- function isLegacyDefaultSandboxTools(value: unknown): value is string[] {
67
- if (!Array.isArray(value) || value.length !== LEGACY_DEFAULT_SANDBOX_TOOLS.length) {
68
- return false;
69
- }
70
- const tools = new Set(value);
71
- return LEGACY_DEFAULT_SANDBOX_TOOLS.every((tool) => tools.has(tool));
72
- }
73
-
74
- function migrateSandboxTools(config: UpdateConfig): boolean {
75
- const tools = config.sandbox?.tools;
76
- if (!isLegacyDefaultSandboxTools(tools)) {
77
- return false;
78
- }
79
- config.sandbox = {
80
- ...config.sandbox,
81
- tools: [...DEFAULT_SANDBOX_TOOLS]
82
- };
83
- return true;
84
- }
85
-
86
- function isPathOwnedByOtherPlatform(relativePath: string, platformType: string): boolean {
87
- const top = String(relativePath || '').replace(/\\/g, '/').replace(/^\.\//, '').split('/')[0] ?? '';
88
- if (!top.startsWith('.')) return false;
89
-
90
- const candidate = top.slice(1);
91
- if (!KNOWN_PLATFORMS.has(candidate)) return false;
92
- return candidate !== platformType;
93
- }
94
-
95
- function syncFileRegistry(config: UpdateConfig, platformType: string, enabledTUIs: Set<BuiltinTUIId>) {
96
- config.files ||= {};
97
- const before = JSON.stringify({
98
- files: {
99
- managed: config.files.managed || [],
100
- merged: config.files.merged || [],
101
- ejected: config.files.ejected || []
102
- }
103
- });
104
- config.files.managed = config.files.managed || [];
105
- config.files.merged = config.files.merged || [];
106
- config.files.ejected = config.files.ejected || [];
107
-
108
- const allExisting = [
109
- ...config.files.managed,
110
- ...config.files.merged,
111
- ...config.files.ejected
112
- ];
113
- const added: Pick<FileRegistry, 'managed' | 'merged'> = { managed: [], merged: [] };
114
-
115
- for (const entry of defaults.files.managed) {
116
- if (isPathOwnedByOtherPlatform(entry, platformType)) continue;
117
- if (isPathOwnedByDisabledTUI(entry, enabledTUIs)) continue;
118
- if (!allExisting.includes(entry)) {
119
- config.files.managed.push(entry);
120
- added.managed.push(entry);
121
- }
122
- }
123
- for (const entry of defaults.files.merged) {
124
- if (isPathOwnedByOtherPlatform(entry, platformType)) continue;
125
- if (isPathOwnedByDisabledTUI(entry, enabledTUIs)) continue;
126
- if (!allExisting.includes(entry)) {
127
- config.files.merged.push(entry);
128
- added.merged.push(entry);
129
- }
130
- }
131
-
132
- const after = JSON.stringify({
133
- files: {
134
- managed: config.files.managed,
135
- merged: config.files.merged,
136
- ejected: config.files.ejected
137
- }
138
- });
139
-
140
- return { added, changed: before !== after };
141
- }
142
-
143
68
  async function cmdUpdate(): Promise<void> {
144
69
  console.log('');
145
70
  console.log(' ai update');
@@ -167,24 +92,36 @@ async function cmdUpdate(): Promise<void> {
167
92
  const config = JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8')) as UpdateConfig;
168
93
  const { project, org, language } = config;
169
94
  const platformType = config.platform?.type || defaults.platform.type;
170
- const enabledTUIs = resolveEnabledTUIs(config.tuis);
171
95
  const replacements = { project, org };
172
96
 
97
+ const normalizedOriginal = normalizeAgentClients(config);
98
+ const currentRegistry: FileRegistry = {
99
+ managed: config.files?.managed || [],
100
+ merged: config.files?.merged || [],
101
+ ejected: config.files?.ejected || []
102
+ };
103
+ const platformAdded = !config.platform;
104
+ const sandboxAdded = !config.sandbox;
105
+ const taskAdded = !config.task;
106
+ const labelsAdded = !config.labels;
107
+ const prFlowMigrated = migratePrFlow(config);
108
+ if (platformAdded) config.platform = structuredClone(defaults.platform);
109
+ if (sandboxAdded) config.sandbox = structuredClone(defaults.sandbox);
110
+ if (taskAdded) config.task = structuredClone(defaults.task);
111
+ if (labelsAdded) config.labels = structuredClone(defaults.labels);
112
+
113
+ const workflowPlan = planAgentClientReconciliation({
114
+ config: config as unknown as Record<string, unknown>,
115
+ mutation: { type: 'replace-state', state: normalizedOriginal.state },
116
+ projectRoot: process.cwd(),
117
+ templateRoot: templateDir,
118
+ platformType,
119
+ language
120
+ });
121
+
173
122
  info(`Updating seed files for: ${project}`);
174
123
  console.log('');
175
124
 
176
- // select language-specific template filenames
177
- let claudeSrc, geminiSrc, opencodeSrc;
178
- if (language === 'zh-CN') {
179
- claudeSrc = 'update-agent-infra.zh-CN.md';
180
- geminiSrc = 'update-agent-infra.zh-CN.toml';
181
- opencodeSrc = 'update-agent-infra.zh-CN.md';
182
- } else {
183
- claudeSrc = 'update-agent-infra.en.md';
184
- geminiSrc = 'update-agent-infra.en.toml';
185
- opencodeSrc = 'update-agent-infra.en.md';
186
- }
187
-
188
125
  // update skill
189
126
  copySkillDir(
190
127
  path.join(templateDir, '.agents', 'skills', 'update-agent-infra'),
@@ -206,76 +143,19 @@ async function cmdUpdate(): Promise<void> {
206
143
  // Ignore missing legacy script from pre-ESM installs.
207
144
  }
208
145
 
209
- // update Claude command (only if enabled)
210
- if (enabledTUIs.has('claude-code')) {
211
- renderFile(
212
- path.join(templateDir, '.claude', 'commands', claudeSrc),
213
- path.join('.claude', 'commands', 'update-agent-infra.md'),
214
- replacements
215
- );
216
- ok('Updated .claude/commands/update-agent-infra.md');
217
- }
218
-
219
- // update Gemini command (only if enabled)
220
- if (enabledTUIs.has('gemini-cli')) {
221
- renderFile(
222
- path.join(templateDir, '.gemini', 'commands', '_project_', geminiSrc),
223
- path.join('.gemini', 'commands', project, 'update-agent-infra.toml'),
224
- replacements
225
- );
226
- ok(`Updated .gemini/commands/${project}/update-agent-infra.toml`);
227
- }
228
-
229
- // update OpenCode command (only if enabled)
230
- if (enabledTUIs.has('opencode')) {
231
- renderFile(
232
- path.join(templateDir, '.opencode', 'commands', opencodeSrc),
233
- path.join('.opencode', 'commands', 'update-agent-infra.md'),
234
- replacements
235
- );
236
- ok('Updated .opencode/commands/update-agent-infra.md');
237
- }
238
-
239
- // sync file registry
240
- const { added, changed } = syncFileRegistry(config, platformType, enabledTUIs);
146
+ const added = {
147
+ managed: workflowPlan.projectAssets.registry.managed.filter(
148
+ (entry) => !currentRegistry.managed.includes(entry)
149
+ ),
150
+ merged: workflowPlan.projectAssets.registry.merged.filter(
151
+ (entry) => !currentRegistry.merged.includes(entry)
152
+ )
153
+ };
241
154
  const hasNewEntries = added.managed.length > 0 || added.merged.length > 0;
242
- const platformAdded = !config.platform;
243
- const sandboxAdded = !config.sandbox;
244
- const taskAdded = !config.task;
245
- const labelsAdded = !config.labels;
246
- const prFlowMigrated = migratePrFlow(config);
247
- const sandboxToolsMigrated = !sandboxAdded && migrateSandboxTools(config);
248
- let configChanged = changed;
155
+ const reconcileResult = applyAgentClientReconciliation(workflowPlan);
156
+ for (const target of reconcileResult.applied) ok(`Updated ${target}`);
249
157
 
250
- if (platformAdded) {
251
- config.platform = structuredClone(defaults.platform);
252
- configChanged = true;
253
- }
254
-
255
- if (sandboxAdded) {
256
- config.sandbox = structuredClone(defaults.sandbox);
257
- configChanged = true;
258
- }
259
-
260
- if (taskAdded) {
261
- config.task = structuredClone(defaults.task);
262
- configChanged = true;
263
- }
264
-
265
- if (labelsAdded) {
266
- config.labels = structuredClone(defaults.labels);
267
- configChanged = true;
268
- }
269
-
270
- if (prFlowMigrated) {
271
- configChanged = true;
272
- }
273
-
274
- if (sandboxToolsMigrated) {
275
- configChanged = true;
276
- }
277
-
278
- if (configChanged) {
158
+ if (reconcileResult.configUpdated) {
279
159
  console.log('');
280
160
  if (hasNewEntries) {
281
161
  info(`New file entries synced to ${CONFIG_PATH}:`);
@@ -301,9 +181,6 @@ async function cmdUpdate(): Promise<void> {
301
181
  if (prFlowMigrated) {
302
182
  info(`Migrated legacy requiresPullRequest to prFlow="${prFlowMigrated}" in ${CONFIG_PATH}.`);
303
183
  }
304
- if (sandboxToolsMigrated) {
305
- info(`Migrated default sandbox.tools to include ${AGENT_INFRA_SANDBOX_TOOL} in ${CONFIG_PATH}.`);
306
- }
307
184
  } else {
308
185
  info(`File registry changed in ${CONFIG_PATH}.`);
309
186
  }
@@ -322,10 +199,6 @@ async function cmdUpdate(): Promise<void> {
322
199
  if (hasNewEntries && prFlowMigrated) {
323
200
  info(`Migrated legacy requiresPullRequest to prFlow="${prFlowMigrated}" in ${CONFIG_PATH}.`);
324
201
  }
325
- if (hasNewEntries && sandboxToolsMigrated) {
326
- info(`Migrated default sandbox.tools to include ${AGENT_INFRA_SANDBOX_TOOL} in ${CONFIG_PATH}.`);
327
- }
328
- fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2) + '\n', 'utf8');
329
202
  ok(`Updated ${CONFIG_PATH}`);
330
203
  }
331
204
 
@@ -333,24 +206,15 @@ async function cmdUpdate(): Promise<void> {
333
206
  console.log('');
334
207
  ok('Seed files updated successfully!');
335
208
  console.log('');
336
- if (enabledTUIs.size === 0) {
337
- console.log(' No built-in TUI enabled (tuis: []).');
209
+ if (workflowPlan.nextSteps.length === 0) {
210
+ console.log(' No Agent Client project integration enabled.');
338
211
  console.log(` Configure "customTUIs" in ${CONFIG_PATH} if needed.`);
339
212
  console.log('');
340
213
  } else {
341
214
  console.log(' Next step: run the full update in your AI TUI:');
342
215
  console.log('');
343
- const claudeOrOpencode: string[] = [];
344
- if (enabledTUIs.has('claude-code')) claudeOrOpencode.push('Claude Code');
345
- if (enabledTUIs.has('opencode')) claudeOrOpencode.push('OpenCode');
346
- if (claudeOrOpencode.length > 0) {
347
- console.log(` ${claudeOrOpencode.join(' / ')}: /update-agent-infra`);
348
- }
349
- if (enabledTUIs.has('gemini-cli')) {
350
- console.log(` Gemini CLI: /${project}:update-agent-infra`);
351
- }
352
- if (enabledTUIs.has('codex')) {
353
- console.log(' Codex CLI: $update-agent-infra');
216
+ for (const nextStep of workflowPlan.nextSteps) {
217
+ console.log(` ${nextStep.displayName}: ${nextStep.command}`);
354
218
  }
355
219
  console.log('');
356
220
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fitlab-ai/agent-infra",
3
- "version": "0.9.1",
4
- "description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Gemini CLI, and OpenCode",
3
+ "version": "0.9.3",
4
+ "description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex, Antigravity CLI, and OpenCode",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "author": "CodeCaster <codecaster365@outlook.com>",
@@ -38,7 +38,7 @@
38
38
  "collaboration",
39
39
  "claude-code",
40
40
  "codex",
41
- "gemini",
41
+ "antigravity",
42
42
  "opencode",
43
43
  "cli",
44
44
  "bootstrap",
@@ -73,7 +73,7 @@
73
73
  "typescript": "~7.0"
74
74
  },
75
75
  "optionalDependencies": {
76
- "@lydell/node-pty": "^1.2.0-beta.12"
76
+ "@lydell/node-pty": "^1.2.0-beta.14"
77
77
  },
78
78
  "overrides": {
79
79
  "axios": "1.18.1"
@@ -4,7 +4,7 @@ This guide walks you through using multiple AI coding assistants together on a p
4
4
 
5
5
  ## Prerequisites
6
6
 
7
- - At least one AI coding tool installed (Claude Code, Codex CLI, Gemini CLI, or OpenCode)
7
+ - At least one AI coding tool installed (Claude Code, Codex CLI, Antigravity CLI, or OpenCode)
8
8
  - A project with `.agents/` directory set up (this project)
9
9
  - Familiarity with your project's codebase
10
10
 
@@ -18,6 +18,23 @@ git config core.hooksPath .git-hooks
18
18
 
19
19
  This makes Git invoke the hooks in the project repository's `.git-hooks/` directory, including `pre-commit` and `check-version-format.sh`.
20
20
 
21
+ ## Development Checkout CLI Alignment
22
+
23
+ When developing agent-infra from a source checkout, install dependencies and rebuild the local CLI before running lifecycle orchestration:
24
+
25
+ ```bash
26
+ npm install
27
+ npm run build
28
+ ```
29
+
30
+ Lifecycle hooks prefer the checkout's `dist/bin/internal-cli.js` when it exists and fall back to `agent-infra-internal` on `PATH` otherwise. Rebuild after CLI source changes. If shell commands must also resolve to this checkout, link it and compare the active version with the package version:
31
+
32
+ ```bash
33
+ npm link
34
+ ai version --raw
35
+ node -p "'v' + require('./package.json').version"
36
+ ```
37
+
21
38
  ## External Templates And Skills
22
39
 
23
40
  If your team maintains private platform templates or shared custom skills, configure local sources in `.agents/.airc.json`:
@@ -49,7 +66,7 @@ cp .agents/templates/task.md .agents/workspace/active/task-001.md
49
66
  id: task-001
50
67
  type: feature # feature | bugfix | refactor | docs | review
51
68
  status: open # open | in-progress | review | blocked | completed
52
- assigned_to: claude # claude | codex | gemini | opencode | human
69
+ assigned_to: claude # claude | codex | antigravity | opencode | human
53
70
  ```
54
71
 
55
72
  3. Describe the task in the body of the document.
@@ -69,11 +86,11 @@ claude
69
86
 
70
87
  Claude Code excels at codebase exploration and understanding complex relationships between files.
71
88
 
72
- ### Phase 2: Design (Recommended: Claude Code or Gemini CLI)
89
+ ### Phase 2: Design (Recommended: Claude Code or Antigravity CLI)
73
90
 
74
91
  ```bash
75
- # Continue with Claude Code or switch to Gemini CLI for large codebases
76
- gemini
92
+ # Continue with Claude Code or switch to Antigravity CLI for large codebases
93
+ agy
77
94
 
78
95
  # Example prompt:
79
96
  # "Based on the analysis in .agents/workspace/active/task-001.md,
@@ -134,7 +151,7 @@ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
134
151
 
135
152
  ### Refactoring
136
153
 
137
- 1. **Analyze Scope** (Claude Code / Gemini CLI): Map all affected areas.
154
+ 1. **Analyze Scope** (Claude Code / Antigravity CLI): Map all affected areas.
138
155
  2. **Design** (Claude Code): Plan the refactoring approach.
139
156
  3. **Implement** (Codex CLI / OpenCode): Execute the refactoring.
140
157
  4. **Verify** (Claude Code): Ensure no regressions, run tests.
@@ -172,9 +189,9 @@ Even if you're switching between AIs quickly, a brief handoff note saves time an
172
189
 
173
190
  ### 3. Use the Right Tool for the Job
174
191
 
175
- - Complex analysis? Use Claude Code or Gemini CLI.
192
+ - Complex analysis? Use Claude Code or Antigravity CLI.
176
193
  - Straightforward implementation? Use Codex CLI or OpenCode.
177
- - Large file review? Use Gemini CLI.
194
+ - Large file review? Use Antigravity CLI.
178
195
 
179
196
  ### 4. Keep Tasks Small
180
197
 
@@ -4,7 +4,7 @@
4
4
 
5
5
  ## 前提条件
6
6
 
7
- - 至少安装一个 AI 编程工具(Claude Code、Codex CLI、Gemini CLI 或 OpenCode)
7
+ - 至少安装一个 AI 编程工具(Claude Code、Codex CLI、Antigravity CLI 或 OpenCode)
8
8
  - 项目已设置 `.agents/` 目录(本项目已就绪)
9
9
  - 熟悉你的项目代码库
10
10
 
@@ -18,6 +18,23 @@ git config core.hooksPath .git-hooks
18
18
 
19
19
  这样 Git 才会调用项目仓库 `.git-hooks/` 目录下的 hook,包括 `pre-commit` 和 `check-version-format.sh`。
20
20
 
21
+ ## 开发检出中的 CLI 对齐
22
+
23
+ 从源码检出开发 agent-infra 时,请先安装依赖并重新构建本地 CLI,再运行生命周期编排:
24
+
25
+ ```bash
26
+ npm install
27
+ npm run build
28
+ ```
29
+
30
+ 本地 `dist/bin/internal-cli.js` 存在时,生命周期 hook 会优先使用它;不存在时则回退到 `PATH` 上的 `agent-infra-internal`。修改 CLI 源码后需要重新构建。如果 shell 命令也必须解析到当前检出,请建立链接并比较当前版本与包版本:
31
+
32
+ ```bash
33
+ npm link
34
+ ai version --raw
35
+ node -p "'v' + require('./package.json').version"
36
+ ```
37
+
21
38
  ## 外部模板与 Skill
22
39
 
23
40
  如果团队维护私有平台模板或共享自定义 skill,可在 `.agents/.airc.json` 中配置本地源:
@@ -49,7 +66,7 @@ cp .agents/templates/task.md .agents/workspace/active/task-001.md
49
66
  id: task-001
50
67
  type: feature # feature | bugfix | refactor | docs | chore
51
68
  status: active # active | blocked | completed
52
- assigned_to: claude # claude | codex | gemini | opencode | human
69
+ assigned_to: claude # claude | codex | antigravity | opencode | human
53
70
  ```
54
71
 
55
72
  3. 在文档正文中描述任务。
@@ -69,11 +86,11 @@ claude
69
86
 
70
87
  Claude Code 擅长代码库探索和理解文件间的复杂关系。
71
88
 
72
- ### 阶段 2:设计(推荐:Claude Code 或 Gemini CLI)
89
+ ### 阶段 2:设计(推荐:Claude Code 或 Antigravity CLI)
73
90
 
74
91
  ```bash
75
- # 继续使用 Claude Code 或切换到 Gemini CLI 处理大型代码库
76
- gemini
92
+ # 继续使用 Claude Code 或切换到 Antigravity CLI 处理大型代码库
93
+ agy
77
94
 
78
95
  # 示例提示:
79
96
  # "基于 .agents/workspace/active/task-001.md 中的分析结果,
@@ -134,7 +151,7 @@ cp .agents/templates/review-report.md .agents/workspace/active/review-pr-42.md
134
151
 
135
152
  ### 重构
136
153
 
137
- 1. **分析范围**(Claude Code / Gemini CLI):映射所有受影响区域。
154
+ 1. **分析范围**(Claude Code / Antigravity CLI):映射所有受影响区域。
138
155
  2. **设计**(Claude Code):规划重构方案。
139
156
  3. **实现**(Codex CLI / OpenCode):执行重构。
140
157
  4. **验证**(Claude Code):确保没有回归问题,运行测试。
@@ -172,9 +189,9 @@ cp .agents/templates/handoff.md .agents/workspace/active/handoff-task-001-phase2
172
189
 
173
190
  ### 3. 选择合适的工具
174
191
 
175
- - 复杂分析?使用 Claude Code 或 Gemini CLI。
192
+ - 复杂分析?使用 Claude Code 或 Antigravity CLI。
176
193
  - 直接的实现工作?使用 Codex CLI 或 OpenCode。
177
- - 大文件审查?使用 Gemini CLI。
194
+ - 大文件审查?使用 Antigravity CLI。
178
195
 
179
196
  ### 4. 保持任务小而精
180
197
 
@@ -1,6 +1,6 @@
1
1
  # Multi-AI Collaboration Guide
2
2
 
3
- This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI, Gemini CLI, OpenCode, and others.
3
+ This project supports collaboration across multiple AI coding assistants, including Claude Code, OpenAI Codex CLI, Antigravity CLI, OpenCode, and others.
4
4
 
5
5
  ## Dual-Config Architecture
6
6
 
@@ -10,7 +10,7 @@ Different AI tools read configuration from different locations:
10
10
  |---------|---------------|----------|
11
11
  | Claude Code | `.claude/` (CLAUDE.md, commands/, settings.json) | - |
12
12
  | OpenAI Codex CLI | `AGENTS.md` | - |
13
- | Gemini CLI | `AGENTS.md` | - |
13
+ | Antigravity CLI | `AGENTS.md`, `.agents/skills/` | - |
14
14
  | OpenCode | `AGENTS.md` | - |
15
15
  | Other AI Tools | `AGENTS.md` | Project README |
16
16
 
@@ -75,7 +75,7 @@ When one AI completes a phase, it produces a **handoff document** (see `.agents/
75
75
 
76
76
  Each AI tool has different strengths. Use them accordingly:
77
77
 
78
- | Capability | Claude Code | Codex CLI | Gemini CLI | OpenCode |
78
+ | Capability | Claude Code | Codex CLI | Antigravity CLI | OpenCode |
79
79
  |-----------|-------------|-----------|------------|----------|
80
80
  | Codebase analysis | Excellent | Good | Excellent | Good |
81
81
  | Code review | Excellent | Good | Good | Good |
@@ -88,7 +88,7 @@ Each AI tool has different strengths. Use them accordingly:
88
88
 
89
89
  - **Analysis & Review** - Claude Code (strong reasoning, thorough exploration)
90
90
  - **Implementation** - Codex CLI or OpenCode (fast code generation, command-driven editing)
91
- - **Large Context Tasks** - Gemini CLI (large context window for cross-file analysis)
91
+ - **Large Context Tasks** - Antigravity CLI (large context window for cross-file analysis)
92
92
  - **Command-Driven Iteration** - OpenCode (workflow-friendly TUI execution)
93
93
 
94
94
  ## Quick Start
@@ -173,7 +173,7 @@ Write `description` as "one-line responsibility + scenario clause": after the sh
173
173
 
174
174
  Set the generic optional `disable-model-invocation` field to `true` when generated TUI commands should disable model invocation; each TUI adapter consumes it according to its capabilities. To preserve line breaks in a multiline `description`, use a YAML literal block (`|`); sync emits the corresponding multiline metadata format for each TUI.
175
175
 
176
- After adding or updating a custom skill, run `update-agent-infra` again. The sync step detects non-built-in skills and generates matching commands for Claude Code, Gemini CLI, and OpenCode automatically.
176
+ After adding or updating a custom skill, run `update-agent-infra` again. The sync step detects non-built-in skills, generates matching commands for Claude Code and OpenCode, and lets Antigravity CLI discover the shared skills directly.
177
177
 
178
178
  ### Shared skill sources
179
179
 
@@ -218,37 +218,41 @@ Ordinary `managed` files keep their overwrite semantics. A small set of platform
218
218
 
219
219
  `ejected` entries support literal paths or globs, using the same matching rules as `merged`.
220
220
 
221
- ## Built-in TUI Selection
221
+ ## Agent Client Configuration
222
222
 
223
- Use the top-level `.agents/.airc.json` `tuis` array to pick which built-in TUIs (`claude-code`, `codex`, `gemini-cli`, `opencode`) agent-infra should install command files for and keep in sync.
223
+ Use the top-level `.agents/.airc.json` `agentClients` array to configure all four built-in clients (`claude-code`, `codex`, `antigravity-cli`, `opencode`). Each canonical entry has three required fields and one optional orchestration policy:
224
224
 
225
- | Value | Meaning |
225
+ | Field | Meaning |
226
226
  |-------|---------|
227
- | `tuis` missing or `null` | All four built-in TUIs are enabled (backward-compatible default for legacy `.airc.json` predating this field). |
228
- | `tuis: []` | No built-in TUI is managed. Use this when the project only relies on `customTUIs` and does not need any built-in command files installed. |
229
- | `tuis: [<subset>]` | Only the listed TUIs are managed. Unknown ids are ignored. |
227
+ | `id` | Built-in Agent Client id. The canonical array contains exactly one entry for each built-in client. |
228
+ | `enabled` | Whether agent-infra writes and maintains that client's project integration and seed command. |
229
+ | `installInSandbox` | Whether the sandbox image installs that client's CLI. This is independent from `enabled`. |
230
+ | `orchestration` | Optional `run-task` default. It must include executor/reviewer `model` and host-native `reasoningEffort`; both roles may use the same model. |
231
+
232
+ Explicit `run-task` model/effort flags are atomic: any one requires all four role fields and configuration never fills omissions. With no explicit policy, only the current client's `orchestration` is used. Query model-selection context with `agent-infra-internal agent-client model-selection --client <id>`; it labels results complete, partial, or interactive-only and never presents a local override list as a complete catalog.
230
233
 
231
- `ai init` includes an interactive multi-select for this field:
234
+ Manage these settings without hand-editing JSON:
232
235
 
233
- - Press Enter to accept the default (all built-in TUIs enabled).
234
- - Type comma-separated numbers or ids (e.g. `1,3` or `claude-code,opencode`) to keep a subset.
235
- - Type `none` to explicitly disable every built-in TUI (typically combined with a `customTUIs` entry added later).
236
- - Invalid input (duplicate, out-of-range, unknown id, whitespace-only) aborts init with a non-zero exit code.
236
+ ```bash
237
+ ai agent-client list
238
+ ai agent-client status
239
+ ai agent-client enable codex
240
+ ai agent-client disable antigravity-cli
241
+ ai agent-client configure
242
+ ```
237
243
 
238
- ### Side effects of disabling a TUI
244
+ `enable` and `disable` only change `enabled`; `configure` edits both dimensions. `ai init` asks which clients to enable and preserves the displayed defaults when you press Enter. All clients default to `installInSandbox: true`.
239
245
 
240
- When you disable a built-in TUI (either via `ai init` or by hand-editing `.airc.json`), the next `ai update` / `update-agent-infra` will:
246
+ Legacy `tuis` and built-in client ids in `sandbox.tools` are migration inputs only. The next config-writing command converts them into the canonical `agentClients` array and removes the legacy fields. If canonical and legacy values conflict, the command stops without modifying files so the conflict can be resolved explicitly.
241
247
 
242
- - skip seed command writes for that TUI (e.g. `.gemini/commands/<project>/update-agent-infra.toml`);
243
- - skip the TUI's owned default entries when backfilling `files.managed` / `files.merged`;
244
- - **clean up existing files** under the TUI's owned path prefix (`.claude/`, `.codex/`, `.gemini/`, `.opencode/`) — these are listed in `report.managed.removed`, mirroring the cleanup behavior when switching `platform`.
248
+ ### Side effects of disabling an Agent Client
245
249
 
246
- To opt a specific file out of this cleanup, list it in `files.ejected`; ejected entries owned by disabled TUIs are preserved as-is and are not re-created by sync.
250
+ When you disable a built-in client, reconciliation stops maintaining its seed command and owned registry entries. An unchanged generated seed may be removed; a locally modified seed is protected and reported instead. Files listed in `files.ejected` remain project-owned and are preserved.
247
251
 
248
252
  ### Relation to other config fields
249
253
 
250
- - `tuis` controls **which TUI command files agent-infra writes and maintains**. It is independent from `sandbox.tools`, which controls **which CLIs the sandbox image installs**. Toggling one does not affect the other; the README for `sandbox.tools` lives in the Sandbox section.
251
- - `tuis` is independent from `customTUIs` (see below). CustomTUI command files are not removed when you disable a built-in TUI, even if the customTUI's `dir` falls under that TUI's owned prefix (e.g. a customTUI configured with `dir: ".codex/commands"` is preserved when `codex` is disabled).
254
+ - `sandbox.tools` now lists non-client tools such as `agent-infra` and custom tools. Built-in client installation belongs in `agentClients[].installInSandbox`.
255
+ - `agentClients` is independent from `customTUIs` (see below). Custom TUI command files are preserved even when their directory is under a disabled built-in client's path prefix.
252
256
 
253
257
  ## Custom TUI Configuration
254
258
 
@@ -300,7 +304,7 @@ Namespaced custom TUI:
300
304
 
301
305
  ## Sandbox Custom Tools
302
306
 
303
- `customTUIs` generates slash-command files but does not change the sandbox image. To install a non-npm CLI or tool (pip / cargo / curl-based / pre-built binary) into the sandbox image and live-mount its credentials, declare it under `sandbox.customTools` in `.agents/.airc.json`. Built-in sandbox tools (`claude-code`, `codex`, `opencode`, `gemini-cli`, `agent-infra`) keep working unchanged; `agent-infra` only provides the in-sandbox `ai` / `agent-infra` CLI and is not part of `tuis` or `customTUIs`.
307
+ `customTUIs` generates slash-command files but does not change the sandbox image. To install a non-npm CLI or tool (pip / cargo / curl-based / pre-built binary) into the sandbox image and live-mount its credentials, declare it under `sandbox.customTools` in `.agents/.airc.json`. Built-in Agent Clients are installed according to `agentClients[].installInSandbox`; `agent-infra` remains a non-client entry in `sandbox.tools` and only provides the in-sandbox `ai` / `agent-infra` CLI.
304
308
 
305
309
  ### Required fields
306
310