@fitlab-ai/agent-infra 0.9.2 → 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 (318) hide show
  1. package/README.md +10 -9
  2. package/README.zh-CN.md +10 -9
  3. package/dist/bin/internal-cli.js +15 -0
  4. package/dist/lib/agent-clients/adapter.js +45 -2
  5. package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
  6. package/dist/lib/agent-clients/adapters/claude-code.js +10 -1
  7. package/dist/lib/agent-clients/adapters/codex.js +9 -0
  8. package/dist/lib/agent-clients/adapters/index.js +2 -2
  9. package/dist/lib/agent-clients/adapters/opencode.js +9 -0
  10. package/dist/lib/agent-clients/config.js +42 -4
  11. package/dist/lib/agent-clients/next-steps.js +11 -2
  12. package/dist/lib/agent-clients/reconcile.js +2 -1
  13. package/dist/lib/agent-clients/registry.js +7 -1
  14. package/dist/lib/agent-clients/schema.js +18 -0
  15. package/dist/lib/agent-clients/tokens.js +49 -0
  16. package/dist/lib/agent-clients/types.js +1 -1
  17. package/dist/lib/defaults.json +1 -1
  18. package/dist/lib/git/workflow.js +54 -1
  19. package/dist/lib/internal/agent-client.js +61 -4
  20. package/dist/lib/internal/git-workflow.js +6 -1
  21. package/dist/lib/internal/platform-checks.js +3 -3
  22. package/dist/lib/internal/platform-comment.js +29 -2
  23. package/dist/lib/internal/platform-issue.js +7 -0
  24. package/dist/lib/internal/platform-pr-review.js +132 -0
  25. package/dist/lib/internal/platform-pr.js +20 -2
  26. package/dist/lib/internal/platform-release-notes.js +52 -16
  27. package/dist/lib/internal/pr-review-grade.js +140 -0
  28. package/dist/lib/internal/release-workflow.js +13 -6
  29. package/dist/lib/internal/task-activity.js +73 -0
  30. package/dist/lib/internal/task-event.js +17 -1
  31. package/dist/lib/internal/task-lifecycle.js +7 -0
  32. package/dist/lib/internal/task-orchestration.js +51 -6
  33. package/dist/lib/internal/task-review.js +8 -3
  34. package/dist/lib/platform/adapters.js +8 -1
  35. package/dist/lib/platform/completion-backfill.js +122 -0
  36. package/dist/lib/platform/issue-comments.js +3 -2
  37. package/dist/lib/platform/merged-pr-equivalence.js +115 -5
  38. package/dist/lib/platform/pr-checks.js +64 -41
  39. package/dist/lib/platform/pr-review.js +166 -0
  40. package/dist/lib/platform/pull-requests.js +324 -3
  41. package/dist/lib/platform/release-notes.js +85 -3
  42. package/dist/lib/pr-review/evidence-grading.js +229 -0
  43. package/dist/lib/run/tui.js +3 -5
  44. package/dist/lib/sandbox/commands/create.js +0 -20
  45. package/dist/lib/sandbox/commands/show.js +1 -1
  46. package/dist/lib/task/activity-intent.js +101 -0
  47. package/dist/lib/task/artifact-lifecycle.js +2 -1
  48. package/dist/lib/task/commands/log.js +15 -14
  49. package/dist/lib/task/delegation-receipts.js +23 -2
  50. package/dist/lib/task/events.js +67 -28
  51. package/dist/lib/task/finalization-artifacts.js +35 -0
  52. package/dist/lib/task/lifecycle-execution.js +46 -0
  53. package/dist/lib/task/orchestration.js +408 -44
  54. package/dist/lib/task/review-finalization.js +29 -9
  55. package/dist/lib/task/task-execution-lock.js +231 -0
  56. package/dist/lib/task/verification-checks.js +1 -1
  57. package/dist/lib/task/verification-engine.js +218 -2
  58. package/dist/lib/task/verification.js +4 -3
  59. package/dist/lib/task/workspace-snapshot.js +17 -5
  60. package/lib/agent-clients/adapter.ts +75 -2
  61. package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
  62. package/lib/agent-clients/adapters/claude-code.ts +10 -1
  63. package/lib/agent-clients/adapters/codex.ts +9 -0
  64. package/lib/agent-clients/adapters/index.ts +2 -2
  65. package/lib/agent-clients/adapters/opencode.ts +9 -0
  66. package/lib/agent-clients/config.ts +49 -4
  67. package/lib/agent-clients/next-steps.ts +15 -2
  68. package/lib/agent-clients/reconcile.ts +2 -1
  69. package/lib/agent-clients/registry.ts +10 -0
  70. package/lib/agent-clients/schema.ts +18 -0
  71. package/lib/agent-clients/tokens.ts +53 -0
  72. package/lib/agent-clients/types.ts +15 -1
  73. package/lib/defaults.json +1 -1
  74. package/lib/git/workflow.ts +66 -2
  75. package/lib/internal/agent-client.ts +59 -4
  76. package/lib/internal/git-workflow.ts +5 -1
  77. package/lib/internal/platform-checks.ts +4 -4
  78. package/lib/internal/platform-comment.ts +17 -2
  79. package/lib/internal/platform-issue.ts +4 -0
  80. package/lib/internal/platform-pr-review.ts +104 -0
  81. package/lib/internal/platform-pr.ts +14 -1
  82. package/lib/internal/platform-release-notes.ts +59 -16
  83. package/lib/internal/pr-review-grade.ts +130 -0
  84. package/lib/internal/release-workflow.ts +13 -6
  85. package/lib/internal/task-activity.ts +55 -0
  86. package/lib/internal/task-event.ts +9 -1
  87. package/lib/internal/task-lifecycle.ts +4 -0
  88. package/lib/internal/task-orchestration.ts +45 -6
  89. package/lib/internal/task-review.ts +8 -3
  90. package/lib/platform/adapters.ts +29 -2
  91. package/lib/platform/completion-backfill.ts +134 -0
  92. package/lib/platform/issue-comments.ts +3 -2
  93. package/lib/platform/merged-pr-equivalence.ts +127 -5
  94. package/lib/platform/pr-checks.ts +72 -45
  95. package/lib/platform/pr-review.ts +201 -0
  96. package/lib/platform/pull-requests.ts +395 -2
  97. package/lib/platform/release-notes.ts +100 -4
  98. package/lib/pr-review/evidence-grading.ts +318 -0
  99. package/lib/run/tui.ts +3 -4
  100. package/lib/sandbox/commands/create.ts +0 -20
  101. package/lib/sandbox/commands/show.ts +1 -1
  102. package/lib/server/server.schema.json +2 -2
  103. package/lib/task/activity-intent.ts +128 -0
  104. package/lib/task/artifact-lifecycle.ts +2 -1
  105. package/lib/task/commands/log.ts +15 -14
  106. package/lib/task/delegation-receipts.ts +32 -3
  107. package/lib/task/events.ts +75 -30
  108. package/lib/task/finalization-artifacts.ts +58 -0
  109. package/lib/task/lifecycle-execution.ts +106 -0
  110. package/lib/task/orchestration.ts +543 -64
  111. package/lib/task/review-finalization.ts +40 -9
  112. package/lib/task/task-execution-lock.ts +296 -0
  113. package/lib/task/verification-checks.ts +1 -1
  114. package/lib/task/verification-engine.ts +249 -2
  115. package/lib/task/verification.ts +5 -3
  116. package/lib/task/workspace-snapshot.ts +26 -5
  117. package/package.json +3 -3
  118. package/templates/.agents/QUICKSTART.en.md +25 -8
  119. package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
  120. package/templates/.agents/README.en.md +10 -7
  121. package/templates/.agents/README.zh-CN.md +10 -7
  122. package/templates/.agents/hooks/lifecycle-delegation.js +15 -4
  123. package/templates/.agents/rules/create-issue.github.en.md +4 -2
  124. package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -2
  125. package/templates/.agents/rules/issue-fields.github.en.md +3 -1
  126. package/templates/.agents/rules/issue-fields.github.zh-CN.md +3 -1
  127. package/templates/.agents/rules/issue-pr-commands.en.md +5 -3
  128. package/templates/.agents/rules/issue-pr-commands.github.en.md +5 -3
  129. package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +5 -3
  130. package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -3
  131. package/templates/.agents/rules/issue-sync.github.en.md +7 -3
  132. package/templates/.agents/rules/issue-sync.github.zh-CN.md +8 -4
  133. package/templates/.agents/rules/lifecycle-orchestration.en.md +5 -2
  134. package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +5 -2
  135. package/templates/.agents/rules/milestone-inference.github.en.md +4 -2
  136. package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -2
  137. package/templates/.agents/rules/next-step-output.en.md +3 -1
  138. package/templates/.agents/rules/next-step-output.zh-CN.md +3 -1
  139. package/templates/.agents/rules/no-mid-flow-questions.en.md +17 -0
  140. package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +17 -0
  141. package/templates/.agents/rules/pr-checks-commands.en.md +3 -3
  142. package/templates/.agents/rules/pr-checks-commands.github.en.md +2 -2
  143. package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +2 -2
  144. package/templates/.agents/rules/pr-checks-commands.zh-CN.md +3 -3
  145. package/templates/.agents/rules/pr-sync.en.md +3 -1
  146. package/templates/.agents/rules/pr-sync.github.en.md +11 -1
  147. package/templates/.agents/rules/pr-sync.github.zh-CN.md +11 -1
  148. package/templates/.agents/rules/pr-sync.zh-CN.md +3 -1
  149. package/templates/.agents/rules/release-commands.en.md +1 -1
  150. package/templates/.agents/rules/release-commands.github.en.md +12 -2
  151. package/templates/.agents/rules/release-commands.github.zh-CN.md +12 -2
  152. package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
  153. package/templates/.agents/rules/task-management.en.md +11 -0
  154. package/templates/.agents/rules/task-management.zh-CN.md +11 -0
  155. package/templates/.agents/skills/analyze-task/SKILL.en.md +10 -7
  156. package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -7
  157. package/templates/.agents/skills/block-task/SKILL.en.md +7 -5
  158. package/templates/.agents/skills/block-task/SKILL.zh-CN.md +7 -5
  159. package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -4
  160. package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +6 -4
  161. package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -1
  162. package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -1
  163. package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -1
  164. package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -1
  165. package/templates/.agents/skills/code-task/SKILL.en.md +9 -6
  166. package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -8
  167. package/templates/.agents/skills/commit/SKILL.en.md +3 -1
  168. package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -1
  169. package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
  170. package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
  171. package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
  172. package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
  173. package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
  174. package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
  175. package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +6 -4
  176. package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +6 -4
  177. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
  178. package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
  179. package/templates/.agents/skills/complete-task/SKILL.en.md +21 -6
  180. package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +21 -6
  181. package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
  182. package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
  183. package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +17 -0
  184. package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +17 -0
  185. package/templates/.agents/skills/create-pr/SKILL.en.md +3 -1
  186. package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -1
  187. package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
  188. package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
  189. package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -16
  190. package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -16
  191. package/templates/.agents/skills/create-task/SKILL.en.md +5 -3
  192. package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -3
  193. package/templates/.agents/skills/import-issue/SKILL.en.md +5 -3
  194. package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -3
  195. package/templates/.agents/skills/plan-task/SKILL.en.md +8 -5
  196. package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +8 -5
  197. package/templates/.agents/skills/post-release/SKILL.en.md +2 -0
  198. package/templates/.agents/skills/post-release/SKILL.zh-CN.md +2 -0
  199. package/templates/.agents/skills/release/SKILL.en.md +16 -10
  200. package/templates/.agents/skills/release/SKILL.zh-CN.md +16 -10
  201. package/templates/.agents/skills/restore-task/SKILL.en.md +4 -1
  202. package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -1
  203. package/templates/.agents/skills/review-analysis/SKILL.en.md +7 -4
  204. package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +7 -4
  205. package/templates/.agents/skills/review-code/SKILL.en.md +9 -6
  206. package/templates/.agents/skills/review-code/SKILL.zh-CN.md +9 -6
  207. package/templates/.agents/skills/review-plan/SKILL.en.md +7 -4
  208. package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +7 -4
  209. package/templates/.agents/skills/review-pr/SKILL.en.md +158 -0
  210. package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +158 -0
  211. package/templates/.agents/skills/review-pr/config/verify.en.json +37 -0
  212. package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +37 -0
  213. package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +65 -0
  214. package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +65 -0
  215. package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +18 -0
  216. package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +18 -0
  217. package/templates/.agents/skills/review-pr/reference/report-template.en.md +85 -0
  218. package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +85 -0
  219. package/templates/.agents/skills/run-task/SKILL.en.md +8 -8
  220. package/templates/.agents/skills/run-task/SKILL.zh-CN.md +8 -8
  221. package/templates/.agents/skills/run-task/config/verify.en.json +2 -1
  222. package/templates/.agents/skills/run-task/config/verify.zh-CN.json +2 -1
  223. package/templates/.agents/skills/run-task/reference/host-validation.en.md +20 -0
  224. package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +20 -0
  225. package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +35 -61
  226. package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -13
  227. package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -13
  228. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +27 -6
  229. package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +26 -5
  230. package/templates/.agents/templates/task.en.md +1 -1
  231. package/templates/.agents/templates/task.zh-CN.md +1 -1
  232. package/templates/.agents/workflows/bug-fix.en.yaml +3 -3
  233. package/templates/.agents/workflows/bug-fix.zh-CN.yaml +3 -3
  234. package/templates/.agents/workflows/code-review.en.yaml +1 -1
  235. package/templates/.agents/workflows/code-review.zh-CN.yaml +1 -1
  236. package/templates/.agents/workflows/feature-development.en.yaml +4 -4
  237. package/templates/.agents/workflows/feature-development.zh-CN.yaml +4 -4
  238. package/templates/.agents/workflows/refactoring.en.yaml +3 -3
  239. package/templates/.agents/workflows/refactoring.zh-CN.yaml +3 -3
  240. package/templates/.claude/commands/post-release.en.md +1 -0
  241. package/templates/.claude/commands/post-release.zh-CN.md +1 -0
  242. package/templates/.claude/commands/review-pr.en.md +8 -0
  243. package/templates/.claude/commands/review-pr.zh-CN.md +8 -0
  244. package/templates/.gemini/commands/_project_/review-pr.en.toml +10 -0
  245. package/templates/.gemini/commands/_project_/review-pr.zh-CN.toml +10 -0
  246. package/templates/.opencode/commands/post-release.en.md +2 -0
  247. package/templates/.opencode/commands/post-release.zh-CN.md +2 -0
  248. package/templates/.opencode/commands/review-pr.en.md +11 -0
  249. package/templates/.opencode/commands/review-pr.zh-CN.md +11 -0
  250. package/dist/lib/agent-clients/adapters/gemini-cli.js +0 -64
  251. package/lib/agent-clients/adapters/gemini-cli.ts +0 -65
  252. package/templates/.gemini/commands/_project_/analyze-task.en.toml +0 -10
  253. package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +0 -10
  254. package/templates/.gemini/commands/_project_/archive-tasks.en.toml +0 -10
  255. package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +0 -10
  256. package/templates/.gemini/commands/_project_/block-task.en.toml +0 -10
  257. package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +0 -10
  258. package/templates/.gemini/commands/_project_/cancel-task.en.toml +0 -10
  259. package/templates/.gemini/commands/_project_/cancel-task.zh-CN.toml +0 -10
  260. package/templates/.gemini/commands/_project_/check-task.en.toml +0 -10
  261. package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +0 -10
  262. package/templates/.gemini/commands/_project_/close-codescan.en.toml +0 -8
  263. package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +0 -8
  264. package/templates/.gemini/commands/_project_/close-dependabot.en.toml +0 -8
  265. package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +0 -8
  266. package/templates/.gemini/commands/_project_/code-task.en.toml +0 -10
  267. package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +0 -10
  268. package/templates/.gemini/commands/_project_/commit.en.toml +0 -10
  269. package/templates/.gemini/commands/_project_/commit.zh-CN.toml +0 -10
  270. package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +0 -10
  271. package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +0 -10
  272. package/templates/.gemini/commands/_project_/complete-task.en.toml +0 -10
  273. package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +0 -10
  274. package/templates/.gemini/commands/_project_/create-pr.en.toml +0 -10
  275. package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +0 -10
  276. package/templates/.gemini/commands/_project_/create-release-note.en.toml +0 -8
  277. package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +0 -8
  278. package/templates/.gemini/commands/_project_/create-task.en.toml +0 -8
  279. package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +0 -8
  280. package/templates/.gemini/commands/_project_/import-codescan.en.toml +0 -8
  281. package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +0 -8
  282. package/templates/.gemini/commands/_project_/import-dependabot.en.toml +0 -8
  283. package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +0 -8
  284. package/templates/.gemini/commands/_project_/import-issue.en.toml +0 -8
  285. package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +0 -8
  286. package/templates/.gemini/commands/_project_/init-labels.en.toml +0 -8
  287. package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +0 -8
  288. package/templates/.gemini/commands/_project_/init-milestones.en.toml +0 -10
  289. package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +0 -10
  290. package/templates/.gemini/commands/_project_/plan-task.en.toml +0 -10
  291. package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +0 -10
  292. package/templates/.gemini/commands/_project_/post-release.en.toml +0 -6
  293. package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +0 -6
  294. package/templates/.gemini/commands/_project_/refine-title.en.toml +0 -8
  295. package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +0 -8
  296. package/templates/.gemini/commands/_project_/release.en.toml +0 -8
  297. package/templates/.gemini/commands/_project_/release.zh-CN.toml +0 -8
  298. package/templates/.gemini/commands/_project_/restore-task.en.toml +0 -8
  299. package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +0 -8
  300. package/templates/.gemini/commands/_project_/review-analysis.en.toml +0 -10
  301. package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +0 -10
  302. package/templates/.gemini/commands/_project_/review-code.en.toml +0 -10
  303. package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +0 -10
  304. package/templates/.gemini/commands/_project_/review-plan.en.toml +0 -10
  305. package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +0 -10
  306. package/templates/.gemini/commands/_project_/run-task.en.toml +0 -8
  307. package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +0 -8
  308. package/templates/.gemini/commands/_project_/test-integration.en.toml +0 -6
  309. package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +0 -6
  310. package/templates/.gemini/commands/_project_/test.en.toml +0 -6
  311. package/templates/.gemini/commands/_project_/test.zh-CN.toml +0 -6
  312. package/templates/.gemini/commands/_project_/update-agent-infra.en.toml +0 -6
  313. package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +0 -6
  314. package/templates/.gemini/commands/_project_/upgrade-dependency.en.toml +0 -8
  315. package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +0 -8
  316. package/templates/.gemini/commands/_project_/watch-pr.en.toml +0 -10
  317. package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +0 -10
  318. package/templates/.gemini/settings.json +0 -3
@@ -17,6 +17,7 @@ type VerificationEvent =
17
17
  | 'create-pr.completed' | 'create-task.completed'
18
18
  | 'import-codescan.completed' | 'import-dependabot.completed'
19
19
  | 'import-issue.completed' | 'watch-pr.completed'
20
+ | 'review-pr.completed'
20
21
  | 'run-task.paused' | 'run-task.completed';
21
22
  type VerificationSpec = {
22
23
  skill: string;
@@ -64,7 +65,7 @@ const VERIFICATION_CATALOG: Readonly<Record<VerificationEvent, VerificationSpec>
64
65
  'block-task.completed': gate('block-task', 'blocked'),
65
66
  'cancel-task.completed': gate('cancel-task', 'completed'),
66
67
  'commit.completed': gate('commit', 'active'),
67
- 'complete-task.preflight': { skill: 'complete-task', expectedState: 'active', mode: 'checks', checks: ['review-ledger', 'post-review-commit', 'platform-sync-preflight'] },
68
+ 'complete-task.preflight': { skill: 'complete-task', expectedState: 'active', mode: 'checks', checks: ['review-ledger', 'manual-validation', 'post-review-commit', 'platform-sync-preflight'] },
68
69
  'complete-task.completed': gate('complete-task', 'completed'),
69
70
  'create-pr.completed': gate('create-pr', 'active'),
70
71
  'create-task.completed': gate('create-task', 'active'),
@@ -72,8 +73,9 @@ const VERIFICATION_CATALOG: Readonly<Record<VerificationEvent, VerificationSpec>
72
73
  'import-dependabot.completed': gate('import-dependabot', 'active'),
73
74
  'import-issue.completed': gate('import-issue', 'active'),
74
75
  'watch-pr.completed': gate('watch-pr', 'active'),
75
- 'run-task.paused': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state'] },
76
- 'run-task.completed': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state'] }
76
+ 'review-pr.completed': gate('review-pr', 'active', 'pr-review'),
77
+ 'run-task.paused': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] },
78
+ 'run-task.completed': { skill: 'run-task', expectedState: 'active', mode: 'checks', checks: ['orchestration-state', 'orchestration-evidence'] }
77
79
  };
78
80
 
79
81
  function failure(request: { taskRef: string; event: string; artifact?: string }, code: string, message: string, extra: Partial<TaskVerificationResult> = {}): TaskVerificationResult {
@@ -12,15 +12,20 @@ function git(repoRoot: string, indexFile: string | null, args: string[]): string
12
12
  return result.stdout;
13
13
  }
14
14
 
15
- function captureWorkspaceSnapshot(repoRoot: string): string {
15
+ type RepositorySnapshot = Readonly<{
16
+ head: string;
17
+ headTree: string;
18
+ worktreeTree: string;
19
+ }>;
20
+
21
+ function captureWorktreeTree(repoRoot: string, forcedPath: string | null): string {
16
22
  const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'agent-infra-orchestration-index-'));
17
23
  const indexFile = path.join(tempDir, 'index');
18
24
  try {
19
25
  git(repoRoot, indexFile, ['read-tree', 'HEAD']);
20
26
  git(repoRoot, indexFile, ['add', '-A', '--', ':/']);
21
- const workspace = path.join(repoRoot, '.agents', 'workspace', 'active');
22
- if (fs.existsSync(workspace)) {
23
- git(repoRoot, indexFile, ['add', '-f', '--', '.agents/workspace/active']);
27
+ if (forcedPath && fs.existsSync(path.join(repoRoot, forcedPath))) {
28
+ git(repoRoot, indexFile, ['add', '-f', '--', forcedPath]);
24
29
  }
25
30
  return git(repoRoot, indexFile, ['write-tree']).trim();
26
31
  } finally {
@@ -28,9 +33,25 @@ function captureWorkspaceSnapshot(repoRoot: string): string {
28
33
  }
29
34
  }
30
35
 
36
+ function captureWorkspaceSnapshot(repoRoot: string, taskId: string | null): string {
37
+ const workspaceRelative = taskId
38
+ ? `.agents/workspace/active/${taskId}`
39
+ : '.agents/workspace/active';
40
+ return captureWorktreeTree(repoRoot, workspaceRelative);
41
+ }
42
+
43
+ function captureRepositorySnapshot(repoRoot: string): RepositorySnapshot {
44
+ return {
45
+ head: git(repoRoot, null, ['rev-parse', 'HEAD']).trim(),
46
+ headTree: git(repoRoot, null, ['rev-parse', 'HEAD^{tree}']).trim(),
47
+ worktreeTree: captureWorktreeTree(repoRoot, null)
48
+ };
49
+ }
50
+
31
51
  function diffWorkspaceSnapshots(repoRoot: string, before: string, after: string): string[] {
32
52
  const output = git(repoRoot, null, ['diff', '--name-only', '-z', before, after]);
33
53
  return output.split('\0').filter(Boolean);
34
54
  }
35
55
 
36
- export { captureWorkspaceSnapshot, diffWorkspaceSnapshots };
56
+ export { captureRepositorySnapshot, captureWorkspaceSnapshot, diffWorkspaceSnapshots };
57
+ export type { RepositorySnapshot };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fitlab-ai/agent-infra",
3
- "version": "0.9.2",
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",
@@ -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
 
@@ -220,13 +220,16 @@ Ordinary `managed` files keep their overwrite semantics. A small set of platform
220
220
 
221
221
  ## Agent Client Configuration
222
222
 
223
- Use the top-level `.agents/.airc.json` `agentClients` array to configure all four built-in clients (`claude-code`, `codex`, `gemini-cli`, `opencode`). Each canonical entry has three fields:
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
225
  | Field | Meaning |
226
226
  |-------|---------|
227
227
  | `id` | Built-in Agent Client id. The canonical array contains exactly one entry for each built-in client. |
228
228
  | `enabled` | Whether agent-infra writes and maintains that client's project integration and seed command. |
229
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
234
  Manage these settings without hand-editing JSON:
232
235
 
@@ -234,7 +237,7 @@ Manage these settings without hand-editing JSON:
234
237
  ai agent-client list
235
238
  ai agent-client status
236
239
  ai agent-client enable codex
237
- ai agent-client disable gemini-cli
240
+ ai agent-client disable antigravity-cli
238
241
  ai agent-client configure
239
242
  ```
240
243
 
@@ -1,6 +1,6 @@
1
1
  # 多 AI 协作指南
2
2
 
3
- 本项目支持多个 AI 编程助手协同工作,包括 Claude Code、OpenAI Codex CLI、Gemini CLI、OpenCode 等。
3
+ 本项目支持多个 AI 编程助手协同工作,包括 Claude Code、OpenAI Codex CLI、Antigravity CLI、OpenCode 等。
4
4
 
5
5
  ## 双配置架构
6
6
 
@@ -10,7 +10,7 @@
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
  | 其他 AI 工具 | `AGENTS.md` | 项目 README |
16
16
 
@@ -75,7 +75,7 @@
75
75
 
76
76
  每个 AI 工具有不同的优势,请据此分配任务:
77
77
 
78
- | 能力 | Claude Code | Codex CLI | Gemini CLI | OpenCode |
78
+ | 能力 | Claude Code | Codex CLI | Antigravity CLI | OpenCode |
79
79
  |-----|-------------|-----------|------------|----------|
80
80
  | 代码库分析 | 优秀 | 良好 | 优秀 | 良好 |
81
81
  | 代码审查 | 优秀 | 良好 | 良好 | 良好 |
@@ -88,7 +88,7 @@
88
88
 
89
89
  - **分析和审查** - Claude Code(推理能力强,探索全面)
90
90
  - **代码实现** - Codex CLI 或 OpenCode(代码生成快,命令式工作流顺手)
91
- - **大上下文任务** - Gemini CLI(大上下文窗口,适合跨文件分析)
91
+ - **大上下文任务** - Antigravity CLI(大上下文窗口,适合跨文件分析)
92
92
  - **命令式迭代** - OpenCode(适合按工作流连续推进)
93
93
 
94
94
  ## 快速入门
@@ -173,7 +173,7 @@ disable-model-invocation: true # 可选;由支持该能力的 TUI 适配器
173
173
 
174
174
  当生成的 TUI 命令需要禁用模型调用时,将通用可选字段 `disable-model-invocation` 设为 `true`;各 TUI 适配器按自身能力决定是否消费。多行 `description` 如需保留换行,使用 YAML literal block(`|`);同步器会为各 TUI 输出对应的多行元数据格式。
175
175
 
176
- 新增或修改自定义 skill 后,再执行一次 `update-agent-infra`。同步过程会自动检测非内置 skill,并为 Claude Code、Gemini CLI、OpenCode 生成对应命令。
176
+ 新增或修改自定义 skill 后,再执行一次 `update-agent-infra`。同步过程会自动检测非内置 skill,为 Claude Code 和 OpenCode 生成对应命令;Antigravity CLI 则直接发现共享 skill。
177
177
 
178
178
  ### 共享 skill 源
179
179
 
@@ -220,13 +220,16 @@ disable-model-invocation: true # 可选;由支持该能力的 TUI 适配器
220
220
 
221
221
  ## Agent Client 配置
222
222
 
223
- `.agents/.airc.json` 顶层 `agentClients` 数组用于配置全部四个内建客户端(`claude-code`、`codex`、`gemini-cli`、`opencode`)。规范化后的每个条目包含三个字段:
223
+ `.agents/.airc.json` 顶层 `agentClients` 数组用于配置全部四个内建客户端(`claude-code`、`codex`、`antigravity-cli`、`opencode`)。每个规范条目包含三个必填字段和一个可选编排策略:
224
224
 
225
225
  | 字段 | 含义 |
226
226
  |------|------|
227
227
  | `id` | 内建 Agent Client id。规范数组为每个内建客户端保留且仅保留一个条目。 |
228
228
  | `enabled` | agent-infra 是否写入并维护该客户端的项目集成与种子命令。 |
229
229
  | `installInSandbox` | 沙箱镜像是否安装该客户端 CLI;此字段与 `enabled` 相互独立。 |
230
+ | `orchestration` | `run-task` 可选默认策略;必须同时提供 executor/reviewer 的 `model` 与宿主原生 `reasoningEffort`,两个角色可以使用同一模型。 |
231
+
232
+ `run-task` 的显式 model/effort 参数是原子输入:只要提供其中任一字段,就必须完整提供四个 role 字段,不能从配置补齐。完全没有显式策略时,只读取当前客户端的 `orchestration`。模型目录通过 `agent-infra-internal agent-client model-selection --client <id>` 查询,并明确标记 complete、partial 或 interactive-only;局部 override 列表不能当作完整目录。
230
233
 
231
234
  无需手工编辑 JSON,可使用:
232
235
 
@@ -234,7 +237,7 @@ disable-model-invocation: true # 可选;由支持该能力的 TUI 适配器
234
237
  ai agent-client list
235
238
  ai agent-client status
236
239
  ai agent-client enable codex
237
- ai agent-client disable gemini-cli
240
+ ai agent-client disable antigravity-cli
238
241
  ai agent-client configure
239
242
  ```
240
243
 
@@ -1,6 +1,9 @@
1
1
  import { execFileSync } from 'node:child_process';
2
+ import { existsSync } from 'node:fs';
3
+ import { fileURLToPath } from 'node:url';
2
4
 
3
5
  const MAX_INPUT_BYTES = 64 * 1024;
6
+ const localInternalCli = fileURLToPath(new URL('../../dist/bin/internal-cli.js', import.meta.url));
4
7
  const clientIndex = process.argv.indexOf('--client');
5
8
  const client = clientIndex >= 0 ? process.argv[clientIndex + 1] : '';
6
9
  if (client !== 'claude-code') {
@@ -39,10 +42,15 @@ process.stdin.on('end', () => {
39
42
  '--native-agent', String(nativeAgent),
40
43
  '--child-id', String(event.child_id || event.agent_id || event.thread_id || ''),
41
44
  '--parent-id', String(event.parent_id || event.parent_session_id || event.session_id || ''),
42
- '--spawn-mode', String(event.spawn_mode || 'fresh')
45
+ '--spawn-mode', String(event.spawn_mode || (client === 'claude-code' ? 'fresh' : ''))
43
46
  );
44
47
  if (event.model) args.push('--actual-model', String(event.model));
45
- if (event.model_fallback_reason) args.push('--fallback-reason', String(event.model_fallback_reason));
48
+ const actualEffort = event.actual_reasoning_effort || event.reasoning_effort || event.model_reasoning_effort;
49
+ if (actualEffort) args.push('--actual-reasoning-effort', String(actualEffort));
50
+ if (event.model_fallback_reason) args.push('--model-fallback-reason', String(event.model_fallback_reason));
51
+ if (event.reasoning_effort_fallback_reason) {
52
+ args.push('--reasoning-effort-fallback-reason', String(event.reasoning_effort_fallback_reason));
53
+ }
46
54
  } else {
47
55
  args.push(
48
56
  '--native-agent', String(nativeAgent),
@@ -50,9 +58,12 @@ process.stdin.on('end', () => {
50
58
  );
51
59
  }
52
60
  try {
53
- const output = execFileSync('agent-infra-internal', args, {
61
+ const useLocal = existsSync(localInternalCli);
62
+ const command = useLocal ? process.execPath : 'agent-infra-internal';
63
+ const commandArgs = useLocal ? [localInternalCli, ...args] : args;
64
+ const output = execFileSync(command, commandArgs, {
54
65
  encoding: 'utf8',
55
- shell: process.platform === 'win32',
66
+ shell: !useLocal && process.platform === 'win32',
56
67
  stdio: ['ignore', 'pipe', 'pipe']
57
68
  });
58
69
  process.stdout.write(output);
@@ -1,10 +1,12 @@
1
1
  # Issue Creation
2
2
 
3
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
4
+
3
5
  After `create-task` writes task.md, create and initialize the Issue through declarative internal intents:
4
6
 
5
7
  ```bash
6
- agent-infra-internal platform-issue create {task-id} --agent {agent}
7
- agent-infra-internal platform-issue sync {task-id} --agent {agent} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
8
+ agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
9
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
8
10
  ```
9
11
 
10
12
  The core reads only persisted task identity, title, type, description, and requirements, and reuses deterministic `ai task issue-body` rendering. It owns template selection, upstream/capabilities, duplicate prevention, POST outcome boundaries, response validation, and atomic `issue_number` binding.
@@ -1,9 +1,11 @@
1
1
  # Issue 创建
2
2
 
3
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
+
3
5
  当 `create-task` 完成本地 `task.md` 落盘后,通过声明式内部命令创建 Issue:
4
6
 
5
7
  ```bash
6
- agent-infra-internal platform-issue create {task-id} --agent {agent}
8
+ agent-infra-internal platform-issue create {task-id} --agent {standard-agent-token}
7
9
  ```
8
10
 
9
11
  命令只从已落盘 task.md 读取身份、标题、类型、描述与需求,并复用 `ai task issue-body` 的确定性正文渲染。它负责模板选择、upstream/capability、已有绑定检查、非幂等 POST 边界、响应身份校验及通过任务写入内核回写 `issue_number`。
@@ -11,7 +13,7 @@ agent-infra-internal platform-issue create {task-id} --agent {agent}
11
13
  创建后的初始元数据使用同一适配层同步:
12
14
 
13
15
  ```bash
14
- agent-infra-internal platform-issue sync {task-id} --agent {agent} \
16
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} \
15
17
  --status waiting-for-triage --assignees current --milestone initial --issue-type --fields
16
18
  ```
17
19
 
@@ -1,9 +1,11 @@
1
1
  # Issue Fields
2
2
 
3
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
4
+
3
5
  Synchronize Issue Type and pinned fields through one intent:
4
6
 
5
7
  ```bash
6
- agent-infra-internal platform-issue sync {task-id} --agent {agent} --issue-type --fields
8
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --issue-type --fields
7
9
  ```
8
10
 
9
11
  Supported task.md mappings are `priority` → `Priority`, `effort` → `Effort`, `start_date` → `Start date`, and `target_date` → `Target date`. The core normalizes localized priority/effort options and validates `YYYY-MM-DD` dates.
@@ -1,9 +1,11 @@
1
1
  # Issue 字段
2
2
 
3
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
+
3
5
  Issue Type 与 pinned fields 统一由 `platform-issue` intent 动态读取组织 schema 并同步:
4
6
 
5
7
  ```bash
6
- agent-infra-internal platform-issue sync {task-id} --agent {agent} --issue-type --fields
8
+ agent-infra-internal platform-issue sync {task-id} --agent {standard-agent-token} --issue-type --fields
7
9
  ```
8
10
 
9
11
  ## 支持字段
@@ -1,5 +1,7 @@
1
1
  # PR Platform Intents
2
2
 
3
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
4
+
3
5
  PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
4
6
 
5
7
  ## Inspect
@@ -14,7 +16,7 @@ Write the title and body to files, then run:
14
16
 
15
17
  ```bash
16
18
  agent-infra-internal platform-pr create {task-id} \
17
- --agent {agent} --base {target-branch} --head {current-branch} \
19
+ --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
18
20
  --title-file {title-file} --body-file {body-file}
19
21
  ```
20
22
 
@@ -23,7 +25,7 @@ The core performs exact upstream/head/base lookup first. One match is reused, ze
23
25
  ## Bind
24
26
 
25
27
  ```bash
26
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
28
+ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
27
29
  ```
28
30
 
29
31
  Conflicting bindings fail without changing `task.md`.
@@ -32,7 +34,7 @@ Conflicting bindings fail without changing `task.md`.
32
34
 
33
35
  ```bash
34
36
  agent-infra-internal platform-pr sync {task-id} \
35
- --agent {agent} --metadata --closing-issue
37
+ --agent {standard-agent-token} --metadata --closing-issue
36
38
  ```
37
39
 
38
40
  The core copies type / `in:` labels, assignee, a specific milestone, and the closing association from the linked Issue. Permission-bound operations report `skipped` under top-level `degraded`; the Issue is never updated in reverse.
@@ -1,5 +1,7 @@
1
1
  # PR Platform Intents
2
2
 
3
+ > `--agent` values follow the "Collaborator Token Specification" in `.agents/rules/task-management.md`: standard AI short tokens (`claude`/`codex`/`antigravity`/`opencode`/`cursor`), long-name normalization (`claude-code`->`claude`, `antigravity-cli`->`antigravity`), or the `human` manual exception.
4
+
3
5
  PR lookup, creation, binding, and metadata synchronization go through typed internal intents. Skills decide branches and write titles/bodies; they do not assemble platform commands.
4
6
 
5
7
  ## Inspect
@@ -12,7 +14,7 @@ agent-infra-internal platform-pr inspect {task-id}
12
14
 
13
15
  ```bash
14
16
  agent-infra-internal platform-pr create {task-id} \
15
- --agent {agent} --base {target-branch} --head {current-branch} \
17
+ --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
16
18
  --title-file {title-file} --body-file {body-file}
17
19
  ```
18
20
 
@@ -21,10 +23,10 @@ The core performs exact upstream/head/base lookup. One match is reused, zero cre
21
23
  ## Bind and synchronize
22
24
 
23
25
  ```bash
24
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
26
+ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
25
27
 
26
28
  agent-infra-internal platform-pr sync {task-id} \
27
- --agent {agent} --metadata --closing-issue
29
+ --agent {standard-agent-token} --metadata --closing-issue
28
30
  ```
29
31
 
30
32
  Conflicting bindings do not change `task.md`. Metadata comes from the linked Issue, permission-bound items degrade independently, and an already-created PR is never rolled back.
@@ -1,5 +1,7 @@
1
1
  # PR 平台意图命令
2
2
 
3
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
+
3
5
  PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
4
6
 
5
7
  ## 定位
@@ -16,7 +18,7 @@ agent-infra-internal platform-pr inspect {task-id}
16
18
 
17
19
  ```bash
18
20
  agent-infra-internal platform-pr create {task-id} \
19
- --agent {agent} --base {target-branch} --head {current-branch} \
21
+ --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
20
22
  --title-file {title-file} --body-file {body-file}
21
23
  ```
22
24
 
@@ -25,7 +27,7 @@ core 会先按 upstream、head 和 base 精确定位;唯一既有 PR 会复用
25
27
  ## 显式绑定
26
28
 
27
29
  ```bash
28
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
30
+ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
29
31
  ```
30
32
 
31
33
  冲突绑定稳定失败且不修改 `task.md`。
@@ -34,7 +36,7 @@ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
34
36
 
35
37
  ```bash
36
38
  agent-infra-internal platform-pr sync {task-id} \
37
- --agent {agent} --metadata --closing-issue
39
+ --agent {standard-agent-token} --metadata --closing-issue
38
40
  ```
39
41
 
40
42
  core 从关联 Issue 复制 type / `in:` labels、assignee、具体 milestone,并确保 closing association。权限不足返回逐项 `skipped` 和顶层 `degraded`;不得反向修改 Issue。
@@ -1,5 +1,7 @@
1
1
  # PR 平台意图命令
2
2
 
3
+ > `--agent` 取值见 `.agents/rules/task-management.md`「合作者 token 规范」:标准 AI 短名(`claude`/`codex`/`antigravity`/`opencode`/`cursor`)、长名归一化(`claude-code`→`claude`、`antigravity-cli`→`antigravity`)或人工例外 `human`。
4
+
3
5
  PR 资源的定位、创建、绑定和元数据同步统一通过 typed internal intent;SKILL 只负责决定分支、标题、正文和调用时机,不直接拼装平台命令。
4
6
 
5
7
  ## 定位
@@ -16,7 +18,7 @@ agent-infra-internal platform-pr inspect {task-id}
16
18
 
17
19
  ```bash
18
20
  agent-infra-internal platform-pr create {task-id} \
19
- --agent {agent} --base {target-branch} --head {current-branch} \
21
+ --agent {standard-agent-token} --base {target-branch} --head {current-branch} \
20
22
  --title-file {title-file} --body-file {body-file}
21
23
  ```
22
24
 
@@ -25,7 +27,7 @@ core 会先按 upstream、head 和 base 精确定位;唯一既有 PR 会复用
25
27
  ## 显式绑定
26
28
 
27
29
  ```bash
28
- agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
30
+ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {standard-agent-token}
29
31
  ```
30
32
 
31
33
  冲突绑定稳定失败且不修改 `task.md`。
@@ -34,7 +36,7 @@ agent-infra-internal platform-pr bind {task-id} --pr {pr-number} --agent {agent}
34
36
 
35
37
  ```bash
36
38
  agent-infra-internal platform-pr sync {task-id} \
37
- --agent {agent} --metadata --closing-issue
39
+ --agent {standard-agent-token} --metadata --closing-issue
38
40
  ```
39
41
 
40
42
  core 从关联 Issue 复制 type / `in:` labels、assignee、具体 milestone,并确保 closing association。权限不足返回逐项 `skipped` 和顶层 `degraded`;不得反向修改 Issue。