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