@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.
- package/README.md +24 -11
- package/README.zh-CN.md +24 -11
- package/bin/cli.ts +12 -0
- package/dist/bin/cli.js +14 -0
- package/dist/bin/internal-cli.js +30 -0
- package/dist/lib/agent-client.js +163 -0
- package/dist/lib/agent-clients/adapter.js +337 -0
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +71 -0
- package/dist/lib/agent-clients/adapters/codex-sandbox.js +210 -0
- package/dist/lib/agent-clients/adapters/codex.js +63 -0
- package/dist/lib/agent-clients/adapters/index.js +20 -0
- package/dist/lib/agent-clients/adapters/opencode.js +73 -0
- package/dist/lib/agent-clients/config.js +215 -0
- package/dist/lib/agent-clients/custom-tuis.js +99 -0
- package/dist/lib/agent-clients/invocation.js +9 -0
- package/dist/lib/agent-clients/next-steps.js +47 -0
- package/dist/lib/agent-clients/project-assets.js +45 -0
- package/dist/lib/agent-clients/reconcile.js +236 -0
- package/dist/lib/agent-clients/registry.js +78 -0
- package/dist/lib/agent-clients/schema.js +75 -0
- package/dist/lib/agent-clients/tokens.js +49 -0
- package/dist/lib/agent-clients/types.js +29 -0
- package/dist/lib/builtin-tuis.js +9 -14
- package/dist/lib/defaults.json +85 -73
- package/dist/lib/git/review-snapshot.js +25 -10
- package/dist/lib/git/reviewed-commit-equivalence.js +110 -0
- package/dist/lib/git/workflow.js +54 -1
- package/dist/lib/init.js +47 -91
- package/dist/lib/internal/agent-client.js +174 -0
- package/dist/lib/internal/git-workflow.js +7 -2
- package/dist/lib/internal/platform-checks.js +3 -3
- package/dist/lib/internal/platform-comment.js +29 -2
- package/dist/lib/internal/platform-issue.js +7 -0
- package/dist/lib/internal/platform-pr-review.js +132 -0
- package/dist/lib/internal/platform-pr.js +20 -2
- package/dist/lib/internal/platform-release-notes.js +52 -16
- package/dist/lib/internal/pr-review-grade.js +140 -0
- package/dist/lib/internal/release-workflow.js +82 -20
- package/dist/lib/internal/task-activity.js +73 -0
- package/dist/lib/internal/task-event.js +17 -1
- package/dist/lib/internal/task-lifecycle.js +7 -0
- package/dist/lib/internal/task-orchestration.js +196 -0
- package/dist/lib/internal/task-review.js +70 -0
- package/dist/lib/merge.js +2 -1
- package/dist/lib/platform/adapters.js +45 -1
- package/dist/lib/platform/change-request-git-evidence.js +113 -0
- package/dist/lib/platform/completion-backfill.js +122 -0
- package/dist/lib/platform/issue-comments.js +3 -2
- package/dist/lib/platform/merged-pr-equivalence.js +156 -16
- package/dist/lib/platform/pr-checks.js +101 -50
- package/dist/lib/platform/pr-review.js +166 -0
- package/dist/lib/platform/pull-requests.js +432 -7
- package/dist/lib/platform/release-notes.js +85 -3
- package/dist/lib/platform/releases.js +1 -1
- package/dist/lib/platform/verification-required.js +8 -10
- package/dist/lib/pr-review/evidence-grading.js +229 -0
- package/dist/lib/prompt.js +15 -3
- package/dist/lib/release/channels.js +4 -1
- package/dist/lib/release/workflow.js +4 -2
- package/dist/lib/remove-dir.js +25 -0
- package/dist/lib/run/tui.js +11 -7
- package/dist/lib/sandbox/agent-client-reconciler.js +234 -0
- package/dist/lib/sandbox/clipboard/linux.js +2 -1
- package/dist/lib/sandbox/commands/create.js +76 -200
- package/dist/lib/sandbox/commands/enter.js +17 -1
- package/dist/lib/sandbox/commands/prune.js +2 -2
- package/dist/lib/sandbox/commands/rm.js +3 -2
- package/dist/lib/sandbox/commands/show.js +1 -1
- package/dist/lib/sandbox/config.js +21 -4
- package/dist/lib/sandbox/constants.js +3 -0
- package/dist/lib/sandbox/dockerfile.js +2 -1
- package/dist/lib/sandbox/managed-fs.js +10 -5
- package/dist/lib/sandbox/recovery.js +52 -36
- package/dist/lib/sandbox/shell.js +1 -1
- package/dist/lib/sandbox/tool-types.js +8 -0
- package/dist/lib/sandbox/tools.js +2 -126
- package/dist/lib/task/activity-intent.js +101 -0
- package/dist/lib/task/artifact-lifecycle.js +3 -50
- package/dist/lib/task/commands/decisions.js +50 -20
- package/dist/lib/task/commands/log.js +15 -14
- package/dist/lib/task/delegation-receipts.js +128 -0
- package/dist/lib/task/events.js +146 -8
- package/dist/lib/task/finalization-artifacts.js +35 -0
- package/dist/lib/task/lifecycle-execution.js +46 -0
- package/dist/lib/task/orchestration.js +784 -0
- package/dist/lib/task/review-artifacts.js +143 -59
- package/dist/lib/task/review-finalization.js +186 -0
- package/dist/lib/task/review-fingerprint.js +4 -0
- package/dist/lib/task/task-execution-lock.js +231 -0
- package/dist/lib/task/verification-checks.js +2 -1
- package/dist/lib/task/verification-engine.js +372 -28
- package/dist/lib/task/verification-review.js +1 -1
- package/dist/lib/task/verification.js +5 -2
- package/dist/lib/task/workspace-snapshot.js +46 -0
- package/dist/lib/update.js +42 -161
- package/lib/agent-client.ts +214 -0
- package/lib/agent-clients/adapter.ts +534 -0
- package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
- package/lib/agent-clients/adapters/claude-code.ts +79 -0
- package/lib/agent-clients/adapters/codex-sandbox.ts +245 -0
- package/lib/agent-clients/adapters/codex.ts +67 -0
- package/lib/agent-clients/adapters/index.ts +27 -0
- package/lib/agent-clients/adapters/opencode.ts +75 -0
- package/lib/agent-clients/config.ts +323 -0
- package/lib/agent-clients/custom-tuis.ts +149 -0
- package/lib/agent-clients/invocation.ts +19 -0
- package/lib/agent-clients/next-steps.ts +85 -0
- package/lib/agent-clients/project-assets.ts +96 -0
- package/lib/agent-clients/reconcile.ts +325 -0
- package/lib/agent-clients/registry.ts +154 -0
- package/lib/agent-clients/schema.ts +80 -0
- package/lib/agent-clients/tokens.ts +53 -0
- package/lib/agent-clients/types.ts +92 -0
- package/lib/benchmark/schemas/v1.0.0/case-manifest.schema.json +120 -0
- package/lib/benchmark/schemas/v1.0.0/common.schema.json +109 -0
- package/lib/benchmark/schemas/v1.0.0/grader-result.schema.json +160 -0
- package/lib/benchmark/schemas/v1.0.0/run-manifest.schema.json +122 -0
- package/lib/benchmark/schemas/v1.0.0/subject.schema.json +227 -0
- package/lib/builtin-tuis.ts +16 -15
- package/lib/defaults.json +24 -12
- package/lib/git/review-snapshot.ts +39 -9
- package/lib/git/reviewed-commit-equivalence.ts +135 -0
- package/lib/git/workflow.ts +66 -2
- package/lib/init.ts +53 -121
- package/lib/internal/agent-client.ts +186 -0
- package/lib/internal/git-workflow.ts +6 -2
- package/lib/internal/platform-checks.ts +4 -4
- package/lib/internal/platform-comment.ts +17 -2
- package/lib/internal/platform-issue.ts +4 -0
- package/lib/internal/platform-pr-review.ts +104 -0
- package/lib/internal/platform-pr.ts +14 -1
- package/lib/internal/platform-release-notes.ts +59 -16
- package/lib/internal/pr-review-grade.ts +130 -0
- package/lib/internal/release-workflow.ts +79 -20
- package/lib/internal/task-activity.ts +55 -0
- package/lib/internal/task-event.ts +9 -1
- package/lib/internal/task-lifecycle.ts +4 -0
- package/lib/internal/task-orchestration.ts +171 -0
- package/lib/internal/task-review.ts +70 -0
- package/lib/merge.ts +2 -1
- package/lib/platform/adapters.ts +169 -3
- package/lib/platform/change-request-git-evidence.ts +159 -0
- package/lib/platform/completion-backfill.ts +134 -0
- package/lib/platform/issue-comments.ts +3 -2
- package/lib/platform/merged-pr-equivalence.ts +178 -19
- package/lib/platform/pr-checks.ts +121 -66
- package/lib/platform/pr-review.ts +201 -0
- package/lib/platform/pull-requests.ts +529 -27
- package/lib/platform/release-notes.ts +100 -4
- package/lib/platform/releases.ts +1 -1
- package/lib/platform/verification-required.ts +12 -10
- package/lib/pr-review/evidence-grading.ts +318 -0
- package/lib/prompt.ts +16 -3
- package/lib/release/channels.ts +4 -1
- package/lib/release/workflow.ts +4 -3
- package/lib/remove-dir.ts +28 -0
- package/lib/run/tui.ts +12 -5
- package/lib/sandbox/agent-client-reconciler.ts +378 -0
- package/lib/sandbox/clipboard/linux.ts +2 -1
- package/lib/sandbox/commands/create.ts +111 -212
- package/lib/sandbox/commands/enter.ts +23 -1
- package/lib/sandbox/commands/prune.ts +2 -2
- package/lib/sandbox/commands/rm.ts +3 -2
- package/lib/sandbox/commands/show.ts +1 -1
- package/lib/sandbox/config.ts +31 -4
- package/lib/sandbox/constants.ts +6 -0
- package/lib/sandbox/dockerfile.ts +2 -1
- package/lib/sandbox/managed-fs.ts +18 -5
- package/lib/sandbox/recovery.ts +98 -67
- package/lib/sandbox/shell.ts +1 -1
- package/lib/sandbox/tool-types.ts +143 -0
- package/lib/sandbox/tools.ts +5 -157
- package/lib/server/server.schema.json +2 -2
- package/lib/task/activity-intent.ts +128 -0
- package/lib/task/artifact-lifecycle.ts +3 -39
- package/lib/task/commands/decisions.ts +53 -20
- package/lib/task/commands/log.ts +15 -14
- package/lib/task/delegation-receipts.ts +199 -0
- package/lib/task/events.ts +164 -11
- package/lib/task/finalization-artifacts.ts +58 -0
- package/lib/task/lifecycle-execution.ts +106 -0
- package/lib/task/orchestration.ts +1022 -0
- package/lib/task/review-artifacts.ts +201 -69
- package/lib/task/review-finalization.ts +306 -0
- package/lib/task/review-fingerprint.ts +5 -0
- package/lib/task/task-execution-lock.ts +296 -0
- package/lib/task/verification-checks.ts +2 -1
- package/lib/task/verification-engine.ts +424 -28
- package/lib/task/verification-review.ts +1 -0
- package/lib/task/verification.ts +8 -3
- package/lib/task/workspace-snapshot.ts +57 -0
- package/lib/update.ts +48 -184
- package/package.json +4 -4
- package/templates/.agents/QUICKSTART.en.md +25 -8
- package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
- package/templates/.agents/README.en.md +29 -25
- package/templates/.agents/README.zh-CN.md +29 -25
- package/templates/.agents/hooks/lifecycle-delegation.js +75 -0
- package/templates/.agents/rules/README.en.md +2 -0
- package/templates/.agents/rules/README.zh-CN.md +2 -0
- package/templates/.agents/rules/commit-and-pr.en.md +1 -0
- package/templates/.agents/rules/commit-and-pr.zh-CN.md +1 -0
- package/templates/.agents/rules/create-issue.github.en.md +4 -2
- package/templates/.agents/rules/create-issue.github.zh-CN.md +4 -2
- package/templates/.agents/rules/human-decision-context.en.md +14 -12
- package/templates/.agents/rules/human-decision-context.zh-CN.md +14 -12
- package/templates/.agents/rules/issue-fields.github.en.md +3 -1
- package/templates/.agents/rules/issue-fields.github.zh-CN.md +3 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.github.en.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +5 -3
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +5 -3
- package/templates/.agents/rules/issue-sync.github.en.md +7 -3
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +8 -4
- package/templates/.agents/rules/lifecycle-orchestration.en.md +24 -0
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +24 -0
- package/templates/.agents/rules/milestone-inference.github.en.md +4 -2
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +4 -2
- package/templates/.agents/rules/next-step-output.en.md +18 -0
- package/templates/.agents/rules/next-step-output.zh-CN.md +18 -0
- package/templates/.agents/rules/no-mid-flow-questions.en.md +19 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +19 -0
- package/templates/.agents/rules/pr-checks-commands.en.md +3 -3
- package/templates/.agents/rules/pr-checks-commands.github.en.md +2 -2
- package/templates/.agents/rules/pr-checks-commands.github.zh-CN.md +2 -2
- package/templates/.agents/rules/pr-checks-commands.zh-CN.md +3 -3
- package/templates/.agents/rules/pr-sync.en.md +3 -1
- package/templates/.agents/rules/pr-sync.github.en.md +11 -1
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +11 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +3 -1
- package/templates/.agents/rules/release-commands.en.md +1 -1
- package/templates/.agents/rules/release-commands.github.en.md +21 -5
- package/templates/.agents/rules/release-commands.github.zh-CN.md +21 -5
- package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/review-handshake.en.md +4 -4
- package/templates/.agents/rules/review-handshake.zh-CN.md +4 -4
- package/templates/.agents/rules/review-method.en.md +113 -0
- package/templates/.agents/rules/review-method.zh-CN.md +98 -0
- package/templates/.agents/rules/task-management.en.md +11 -0
- package/templates/.agents/rules/task-management.zh-CN.md +11 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +15 -12
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +15 -12
- package/templates/.agents/skills/block-task/SKILL.en.md +11 -9
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +11 -9
- package/templates/.agents/skills/cancel-task/SKILL.en.md +10 -8
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +11 -9
- package/templates/.agents/skills/check-task/SKILL.en.md +16 -16
- package/templates/.agents/skills/check-task/SKILL.zh-CN.md +16 -16
- package/templates/.agents/skills/close-codescan/SKILL.en.md +7 -5
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +7 -5
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +7 -5
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +7 -5
- package/templates/.agents/skills/code-task/SKILL.en.md +10 -7
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +13 -10
- package/templates/.agents/skills/code-task/reference/fix-mode.en.md +14 -16
- package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +14 -16
- package/templates/.agents/skills/code-task/reference/output-template.en.md +3 -3
- package/templates/.agents/skills/code-task/reference/output-template.zh-CN.md +3 -3
- package/templates/.agents/skills/commit/SKILL.en.md +13 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +13 -1
- package/templates/.agents/skills/commit/reference/commit-message.en.md +1 -1
- package/templates/.agents/skills/commit/reference/commit-message.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/issue-metadata-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/pr-summary-sync.en.md +1 -1
- package/templates/.agents/skills/commit/reference/pr-summary-sync.zh-CN.md +1 -1
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +24 -28
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +24 -28
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +6 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.en.md +1 -1
- package/templates/.agents/skills/complete-manual-validation/reference/summary-update.zh-CN.md +1 -1
- package/templates/.agents/skills/complete-task/SKILL.en.md +23 -8
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +23 -8
- package/templates/.agents/skills/complete-task/config/verify.en.json +1 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +1 -0
- package/templates/.agents/skills/complete-task/reference/external-delivery.en.md +17 -0
- package/templates/.agents/skills/complete-task/reference/external-delivery.zh-CN.md +17 -0
- package/templates/.agents/skills/create-pr/SKILL.en.md +13 -11
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +13 -11
- package/templates/.agents/skills/create-pr/reference/comment-publish.en.md +1 -1
- package/templates/.agents/skills/create-pr/reference/comment-publish.zh-CN.md +1 -1
- package/templates/.agents/skills/create-pr/reference/pr-body-template.en.md +3 -3
- package/templates/.agents/skills/create-pr/reference/pr-body-template.zh-CN.md +3 -3
- package/templates/.agents/skills/create-release-note/SKILL.en.md +17 -16
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +17 -16
- package/templates/.agents/skills/create-task/SKILL.en.md +16 -14
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +16 -14
- package/templates/.agents/skills/import-codescan/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-codescan/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/import-dependabot/SKILL.en.md +5 -5
- package/templates/.agents/skills/import-dependabot/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/import-issue/SKILL.en.md +10 -8
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +10 -8
- package/templates/.agents/skills/init-labels/SKILL.en.md +4 -4
- package/templates/.agents/skills/init-labels/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/init-milestones/SKILL.en.md +4 -4
- package/templates/.agents/skills/init-milestones/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/plan-task/SKILL.en.md +13 -10
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +13 -10
- package/templates/.agents/skills/post-release/SKILL.en.md +2 -0
- package/templates/.agents/skills/post-release/SKILL.zh-CN.md +2 -0
- package/templates/.agents/skills/refine-title/SKILL.en.md +1 -1
- package/templates/.agents/skills/refine-title/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/release/SKILL.en.md +16 -10
- package/templates/.agents/skills/release/SKILL.zh-CN.md +16 -10
- package/templates/.agents/skills/restore-task/SKILL.en.md +4 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +18 -4
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +19 -5
- package/templates/.agents/skills/review-analysis/config/verify.en.json +6 -0
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +6 -0
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +13 -15
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +13 -15
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +51 -5
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +52 -6
- package/templates/.agents/skills/review-analysis/reference/review-criteria.en.md +25 -22
- package/templates/.agents/skills/review-analysis/reference/review-criteria.zh-CN.md +25 -22
- package/templates/.agents/skills/review-code/SKILL.en.md +35 -12
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +35 -12
- package/templates/.agents/skills/review-code/config/verify.en.json +7 -0
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +7 -0
- package/templates/.agents/skills/review-code/reference/concurrency-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/concurrency-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-code/reference/cross-platform-risks.en.md +27 -0
- package/templates/.agents/skills/review-code/reference/cross-platform-risks.zh-CN.md +27 -0
- package/templates/.agents/skills/review-code/reference/documentation-antipatterns.en.md +13 -0
- package/templates/.agents/skills/review-code/reference/documentation-antipatterns.zh-CN.md +13 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +22 -24
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +22 -24
- package/templates/.agents/skills/review-code/reference/report-template.en.md +54 -7
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +54 -7
- package/templates/.agents/skills/review-code/reference/review-criteria.en.md +29 -24
- package/templates/.agents/skills/review-code/reference/review-criteria.zh-CN.md +29 -24
- package/templates/.agents/skills/review-code/reference/security-risks.en.md +25 -0
- package/templates/.agents/skills/review-code/reference/security-risks.zh-CN.md +25 -0
- package/templates/.agents/skills/review-plan/SKILL.en.md +18 -4
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +19 -5
- package/templates/.agents/skills/review-plan/config/verify.en.json +6 -0
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +6 -0
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +13 -15
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +13 -15
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +61 -5
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +61 -5
- package/templates/.agents/skills/review-plan/reference/review-criteria.en.md +21 -24
- package/templates/.agents/skills/review-plan/reference/review-criteria.zh-CN.md +21 -24
- package/templates/.agents/skills/review-pr/SKILL.en.md +158 -0
- package/templates/.agents/skills/review-pr/SKILL.zh-CN.md +158 -0
- package/templates/.agents/skills/review-pr/config/verify.en.json +37 -0
- package/templates/.agents/skills/review-pr/config/verify.zh-CN.json +37 -0
- package/templates/.agents/skills/review-pr/reference/evidence-grading.en.md +65 -0
- package/templates/.agents/skills/review-pr/reference/evidence-grading.zh-CN.md +65 -0
- package/templates/.agents/skills/review-pr/reference/output-guidance.en.md +18 -0
- package/templates/.agents/skills/review-pr/reference/output-guidance.zh-CN.md +18 -0
- package/templates/.agents/skills/review-pr/reference/report-template.en.md +85 -0
- package/templates/.agents/skills/review-pr/reference/report-template.zh-CN.md +85 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +22 -0
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +22 -0
- package/templates/.agents/skills/run-task/config/verify.en.json +10 -0
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +10 -0
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +20 -0
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +20 -0
- package/templates/.agents/skills/test/SKILL.en.md +4 -4
- package/templates/.agents/skills/test/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/test-integration/SKILL.en.md +4 -4
- package/templates/.agents/skills/test-integration/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/update-agent-infra/SKILL.en.md +5 -5
- package/templates/.agents/skills/update-agent-infra/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/update-agent-infra/scripts/sync-templates.js +664 -246
- package/templates/.agents/skills/upgrade-dependency/SKILL.en.md +4 -4
- package/templates/.agents/skills/upgrade-dependency/SKILL.zh-CN.md +4 -4
- package/templates/.agents/skills/watch-pr/SKILL.en.md +21 -21
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +21 -21
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.en.md +27 -6
- package/templates/.agents/skills/watch-pr/reference/monitor-and-heal.zh-CN.md +26 -5
- package/templates/.agents/templates/task.en.md +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- package/templates/.agents/workflows/bug-fix.en.yaml +3 -3
- package/templates/.agents/workflows/bug-fix.zh-CN.yaml +3 -3
- package/templates/.agents/workflows/code-review.en.yaml +1 -1
- package/templates/.agents/workflows/code-review.zh-CN.yaml +1 -1
- package/templates/.agents/workflows/feature-development.en.yaml +4 -4
- package/templates/.agents/workflows/feature-development.zh-CN.yaml +4 -4
- package/templates/.agents/workflows/refactoring.en.yaml +3 -3
- package/templates/.agents/workflows/refactoring.zh-CN.yaml +3 -3
- package/templates/.claude/agents/agent-infra-lifecycle-executor.en.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-executor.zh-CN.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.en.md +6 -0
- package/templates/.claude/agents/agent-infra-lifecycle-reviewer.zh-CN.md +6 -0
- package/templates/.claude/commands/post-release.en.md +1 -0
- package/templates/.claude/commands/post-release.zh-CN.md +1 -0
- package/templates/.claude/commands/review-pr.en.md +8 -0
- package/templates/.claude/commands/review-pr.zh-CN.md +8 -0
- package/templates/.claude/commands/run-task.en.md +8 -0
- package/templates/.claude/commands/run-task.zh-CN.md +8 -0
- package/templates/.claude/settings.json +24 -0
- package/templates/.codex/agents/agent-infra-lifecycle-executor.en.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-executor.zh-CN.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.en.toml +3 -0
- package/templates/.codex/agents/agent-infra-lifecycle-reviewer.zh-CN.toml +3 -0
- package/templates/.gemini/commands/_project_/review-pr.en.toml +10 -0
- package/templates/.gemini/commands/_project_/review-pr.zh-CN.toml +10 -0
- package/templates/.opencode/commands/post-release.en.md +2 -0
- package/templates/.opencode/commands/post-release.zh-CN.md +2 -0
- package/templates/.opencode/commands/review-pr.en.md +11 -0
- package/templates/.opencode/commands/review-pr.zh-CN.md +11 -0
- package/templates/.opencode/commands/run-task.en.md +11 -0
- package/templates/.opencode/commands/run-task.zh-CN.md +11 -0
- package/templates/.gemini/commands/_project_/analyze-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/analyze-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/archive-tasks.en.toml +0 -10
- package/templates/.gemini/commands/_project_/archive-tasks.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/block-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/block-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/cancel-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/cancel-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/check-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/check-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/close-codescan.en.toml +0 -8
- package/templates/.gemini/commands/_project_/close-codescan.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/close-dependabot.en.toml +0 -8
- package/templates/.gemini/commands/_project_/close-dependabot.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/code-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/code-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/commit.en.toml +0 -10
- package/templates/.gemini/commands/_project_/commit.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-manual-validation.en.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-manual-validation.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/complete-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/create-pr.en.toml +0 -10
- package/templates/.gemini/commands/_project_/create-pr.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/create-release-note.en.toml +0 -8
- package/templates/.gemini/commands/_project_/create-release-note.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/create-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/create-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-codescan.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-codescan.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-dependabot.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-dependabot.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/import-issue.en.toml +0 -8
- package/templates/.gemini/commands/_project_/import-issue.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/init-labels.en.toml +0 -8
- package/templates/.gemini/commands/_project_/init-labels.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/init-milestones.en.toml +0 -10
- package/templates/.gemini/commands/_project_/init-milestones.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/plan-task.en.toml +0 -10
- package/templates/.gemini/commands/_project_/plan-task.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/post-release.en.toml +0 -6
- package/templates/.gemini/commands/_project_/post-release.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/refine-title.en.toml +0 -8
- package/templates/.gemini/commands/_project_/refine-title.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/release.en.toml +0 -8
- package/templates/.gemini/commands/_project_/release.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/restore-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/restore-task.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/review-analysis.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-analysis.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/review-code.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-code.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/review-plan.en.toml +0 -10
- package/templates/.gemini/commands/_project_/review-plan.zh-CN.toml +0 -10
- package/templates/.gemini/commands/_project_/test-integration.en.toml +0 -6
- package/templates/.gemini/commands/_project_/test-integration.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/test.en.toml +0 -6
- package/templates/.gemini/commands/_project_/test.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/update-agent-infra.en.toml +0 -6
- package/templates/.gemini/commands/_project_/update-agent-infra.zh-CN.toml +0 -6
- package/templates/.gemini/commands/_project_/upgrade-dependency.en.toml +0 -8
- package/templates/.gemini/commands/_project_/upgrade-dependency.zh-CN.toml +0 -8
- package/templates/.gemini/commands/_project_/watch-pr.en.toml +0 -10
- package/templates/.gemini/commands/_project_/watch-pr.zh-CN.toml +0 -10
- 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
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
)
|
|
216
|
-
|
|
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
|
|
243
|
-
const
|
|
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 (
|
|
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 (
|
|
337
|
-
console.log(' No
|
|
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
|
|
344
|
-
|
|
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.
|
|
4
|
-
"description": "Bootstrap tool for AI multi-tool collaboration infrastructure — works with Claude Code, Codex,
|
|
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
|
-
"
|
|
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.
|
|
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,
|
|
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 |
|
|
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
|
|
89
|
+
### Phase 2: Design (Recommended: Claude Code or Antigravity CLI)
|
|
73
90
|
|
|
74
91
|
```bash
|
|
75
|
-
# Continue with Claude Code or switch to
|
|
76
|
-
|
|
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 /
|
|
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
|
|
192
|
+
- Complex analysis? Use Claude Code or Antigravity CLI.
|
|
176
193
|
- Straightforward implementation? Use Codex CLI or OpenCode.
|
|
177
|
-
- Large file review? Use
|
|
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、
|
|
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 |
|
|
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 或
|
|
89
|
+
### 阶段 2:设计(推荐:Claude Code 或 Antigravity CLI)
|
|
73
90
|
|
|
74
91
|
```bash
|
|
75
|
-
# 继续使用 Claude Code 或切换到
|
|
76
|
-
|
|
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 /
|
|
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 或
|
|
192
|
+
- 复杂分析?使用 Claude Code 或 Antigravity CLI。
|
|
176
193
|
- 直接的实现工作?使用 Codex CLI 或 OpenCode。
|
|
177
|
-
- 大文件审查?使用
|
|
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,
|
|
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
|
-
|
|
|
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 |
|
|
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** -
|
|
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
|
|
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
|
-
##
|
|
221
|
+
## Agent Client Configuration
|
|
222
222
|
|
|
223
|
-
Use the top-level `.agents/.airc.json` `
|
|
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
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `
|
|
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
|
-
|
|
234
|
+
Manage these settings without hand-editing JSON:
|
|
232
235
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
- `
|
|
251
|
-
- `
|
|
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
|
|
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
|
|