@fitlab-ai/agent-infra 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/README.zh-CN.md +10 -9
- package/dist/bin/internal-cli.js +15 -0
- package/dist/lib/agent-clients/adapter.js +45 -2
- package/dist/lib/agent-clients/adapters/antigravity-cli.js +64 -0
- package/dist/lib/agent-clients/adapters/claude-code.js +10 -1
- package/dist/lib/agent-clients/adapters/codex.js +9 -0
- package/dist/lib/agent-clients/adapters/index.js +2 -2
- package/dist/lib/agent-clients/adapters/opencode.js +9 -0
- package/dist/lib/agent-clients/config.js +42 -4
- package/dist/lib/agent-clients/next-steps.js +11 -2
- package/dist/lib/agent-clients/reconcile.js +2 -1
- package/dist/lib/agent-clients/registry.js +7 -1
- package/dist/lib/agent-clients/schema.js +18 -0
- package/dist/lib/agent-clients/tokens.js +49 -0
- package/dist/lib/agent-clients/types.js +1 -1
- package/dist/lib/defaults.json +1 -1
- package/dist/lib/git/workflow.js +54 -1
- package/dist/lib/internal/agent-client.js +61 -4
- package/dist/lib/internal/git-workflow.js +6 -1
- 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 +13 -6
- 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 +51 -6
- package/dist/lib/internal/task-review.js +8 -3
- package/dist/lib/platform/adapters.js +8 -1
- 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 +115 -5
- package/dist/lib/platform/pr-checks.js +64 -41
- package/dist/lib/platform/pr-review.js +166 -0
- package/dist/lib/platform/pull-requests.js +324 -3
- package/dist/lib/platform/release-notes.js +85 -3
- package/dist/lib/pr-review/evidence-grading.js +229 -0
- package/dist/lib/run/tui.js +3 -5
- package/dist/lib/sandbox/commands/create.js +0 -20
- package/dist/lib/sandbox/commands/show.js +1 -1
- package/dist/lib/task/activity-intent.js +101 -0
- package/dist/lib/task/artifact-lifecycle.js +2 -1
- package/dist/lib/task/commands/log.js +15 -14
- package/dist/lib/task/delegation-receipts.js +23 -2
- package/dist/lib/task/events.js +67 -28
- package/dist/lib/task/finalization-artifacts.js +35 -0
- package/dist/lib/task/lifecycle-execution.js +46 -0
- package/dist/lib/task/orchestration.js +408 -44
- package/dist/lib/task/review-finalization.js +29 -9
- package/dist/lib/task/task-execution-lock.js +231 -0
- package/dist/lib/task/verification-checks.js +1 -1
- package/dist/lib/task/verification-engine.js +218 -2
- package/dist/lib/task/verification.js +4 -3
- package/dist/lib/task/workspace-snapshot.js +17 -5
- package/lib/agent-clients/adapter.ts +75 -2
- package/lib/agent-clients/adapters/antigravity-cli.ts +65 -0
- package/lib/agent-clients/adapters/claude-code.ts +10 -1
- package/lib/agent-clients/adapters/codex.ts +9 -0
- package/lib/agent-clients/adapters/index.ts +2 -2
- package/lib/agent-clients/adapters/opencode.ts +9 -0
- package/lib/agent-clients/config.ts +49 -4
- package/lib/agent-clients/next-steps.ts +15 -2
- package/lib/agent-clients/reconcile.ts +2 -1
- package/lib/agent-clients/registry.ts +10 -0
- package/lib/agent-clients/schema.ts +18 -0
- package/lib/agent-clients/tokens.ts +53 -0
- package/lib/agent-clients/types.ts +15 -1
- package/lib/defaults.json +1 -1
- package/lib/git/workflow.ts +66 -2
- package/lib/internal/agent-client.ts +59 -4
- package/lib/internal/git-workflow.ts +5 -1
- 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 +13 -6
- 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 +45 -6
- package/lib/internal/task-review.ts +8 -3
- package/lib/platform/adapters.ts +29 -2
- package/lib/platform/completion-backfill.ts +134 -0
- package/lib/platform/issue-comments.ts +3 -2
- package/lib/platform/merged-pr-equivalence.ts +127 -5
- package/lib/platform/pr-checks.ts +72 -45
- package/lib/platform/pr-review.ts +201 -0
- package/lib/platform/pull-requests.ts +395 -2
- package/lib/platform/release-notes.ts +100 -4
- package/lib/pr-review/evidence-grading.ts +318 -0
- package/lib/run/tui.ts +3 -4
- package/lib/sandbox/commands/create.ts +0 -20
- package/lib/sandbox/commands/show.ts +1 -1
- package/lib/server/server.schema.json +2 -2
- package/lib/task/activity-intent.ts +128 -0
- package/lib/task/artifact-lifecycle.ts +2 -1
- package/lib/task/commands/log.ts +15 -14
- package/lib/task/delegation-receipts.ts +32 -3
- package/lib/task/events.ts +75 -30
- package/lib/task/finalization-artifacts.ts +58 -0
- package/lib/task/lifecycle-execution.ts +106 -0
- package/lib/task/orchestration.ts +543 -64
- package/lib/task/review-finalization.ts +40 -9
- package/lib/task/task-execution-lock.ts +296 -0
- package/lib/task/verification-checks.ts +1 -1
- package/lib/task/verification-engine.ts +249 -2
- package/lib/task/verification.ts +5 -3
- package/lib/task/workspace-snapshot.ts +26 -5
- package/package.json +3 -3
- package/templates/.agents/QUICKSTART.en.md +25 -8
- package/templates/.agents/QUICKSTART.zh-CN.md +25 -8
- package/templates/.agents/README.en.md +10 -7
- package/templates/.agents/README.zh-CN.md +10 -7
- package/templates/.agents/hooks/lifecycle-delegation.js +15 -4
- 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/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 +5 -2
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +5 -2
- 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 +3 -1
- package/templates/.agents/rules/next-step-output.zh-CN.md +3 -1
- package/templates/.agents/rules/no-mid-flow-questions.en.md +17 -0
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +17 -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 +12 -2
- package/templates/.agents/rules/release-commands.github.zh-CN.md +12 -2
- package/templates/.agents/rules/release-commands.zh-CN.md +1 -1
- 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 +10 -7
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +10 -7
- package/templates/.agents/skills/block-task/SKILL.en.md +7 -5
- package/templates/.agents/skills/block-task/SKILL.zh-CN.md +7 -5
- package/templates/.agents/skills/cancel-task/SKILL.en.md +6 -4
- package/templates/.agents/skills/cancel-task/SKILL.zh-CN.md +6 -4
- package/templates/.agents/skills/close-codescan/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +3 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +3 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +9 -6
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +11 -8
- package/templates/.agents/skills/commit/SKILL.en.md +3 -1
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -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/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 +21 -6
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +21 -6
- 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 +3 -1
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +3 -1
- 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-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 +5 -3
- package/templates/.agents/skills/create-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/import-issue/SKILL.en.md +5 -3
- package/templates/.agents/skills/import-issue/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/plan-task/SKILL.en.md +8 -5
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +8 -5
- 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/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 +7 -4
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +7 -4
- package/templates/.agents/skills/review-code/SKILL.en.md +9 -6
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +9 -6
- package/templates/.agents/skills/review-plan/SKILL.en.md +7 -4
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +7 -4
- 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 +8 -8
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +8 -8
- package/templates/.agents/skills/run-task/config/verify.en.json +2 -1
- package/templates/.agents/skills/run-task/config/verify.zh-CN.json +2 -1
- 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/update-agent-infra/scripts/sync-templates.js +35 -61
- package/templates/.agents/skills/watch-pr/SKILL.en.md +13 -13
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +13 -13
- 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/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/.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/dist/lib/agent-clients/adapters/gemini-cli.js +0 -64
- package/lib/agent-clients/adapters/gemini-cli.ts +0 -65
- 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_/run-task.en.toml +0 -8
- package/templates/.gemini/commands/_project_/run-task.zh-CN.toml +0 -8
- 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/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<h1 align="center">Agent Infra</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
Collaboration infrastructure for AI coding agents — skills, workflows, and sandboxes for Claude Code, Codex,
|
|
8
|
+
Collaboration infrastructure for AI coding agents — skills, workflows, and sandboxes for Claude Code, Codex, Antigravity CLI, and OpenCode.
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
## Why agent-infra?
|
|
30
30
|
|
|
31
|
-
Teams increasingly mix Claude Code, Codex,
|
|
31
|
+
Teams increasingly mix Claude Code, Codex, Antigravity CLI, OpenCode, and other AI TUIs in the same repository, but each tool tends to introduce its own commands, prompts, and local conventions. Without a shared layer, the result is fragmented workflows, duplicated setup, and task history that is difficult to audit.
|
|
32
32
|
|
|
33
33
|
agent-infra standardizes that shared infrastructure. It gives every supported AI TUI the same task lifecycle, the same skill vocabulary, the same project governance files, isolated development sandboxes, and the same upgrade path, so teams can switch tools without rebuilding process from scratch.
|
|
34
34
|
|
|
@@ -81,11 +81,11 @@ Just fix it at the application layer in LoginService.
|
|
|
81
81
|
|
|
82
82
|
**11 commands. 1 natural-language correction. From issue to merged PR.** That is the entire SOP — programming can have a standard operating procedure too.
|
|
83
83
|
|
|
84
|
-
Every command above works the same way in Claude Code, Codex,
|
|
84
|
+
Every command above works the same way in Claude Code, Codex, Antigravity CLI, and OpenCode. Switch tools mid-task — the workflow state follows. For what each skill does under the hood, see [Built-in AI Skills](./docs/en/skills.md).
|
|
85
85
|
|
|
86
86
|
## Key Features
|
|
87
87
|
|
|
88
|
-
- **Multi-AI collaboration**: one shared operating model for Claude Code, Codex,
|
|
88
|
+
- **Multi-AI collaboration**: one shared operating model for Claude Code, Codex, Antigravity CLI, and OpenCode
|
|
89
89
|
- **Bootstrap CLI + skill-driven execution**: initialize once, then let AI skills drive day-to-day work
|
|
90
90
|
- **IM command bridge**: route Feishu messages to built-ins, read-only task views, sandbox management, and controlled lifecycle skill runs
|
|
91
91
|
- **Bilingual project docs**: English-first docs with synchronized Chinese translations
|
|
@@ -153,7 +153,7 @@ Open the project in any AI TUI and run `update-agent-infra`:
|
|
|
153
153
|
|-----|---------|
|
|
154
154
|
| Claude Code | `/update-agent-infra` |
|
|
155
155
|
| Codex | `$update-agent-infra` |
|
|
156
|
-
|
|
|
156
|
+
| Antigravity CLI | `/update-agent-infra` |
|
|
157
157
|
| OpenCode | `/update-agent-infra` |
|
|
158
158
|
|
|
159
159
|
This detects the packaged template version and renders all managed files. The same command is used both for first-time setup and for future template upgrades.
|
|
@@ -166,21 +166,23 @@ Manage the four built-in Agent Clients independently from the project lifecycle:
|
|
|
166
166
|
ai agent-client list
|
|
167
167
|
ai agent-client status
|
|
168
168
|
ai agent-client enable codex
|
|
169
|
-
ai agent-client disable
|
|
169
|
+
ai agent-client disable antigravity-cli
|
|
170
170
|
ai agent-client configure
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
-
The most-used lifecycle commands, in delivery order. The command prefix varies by TUI (`/skill` in Claude Code/OpenCode
|
|
173
|
+
The most-used lifecycle commands, in delivery order. The command prefix varies by TUI (`/skill` in Claude Code/Antigravity/OpenCode and `$skill` in Codex); the workflow semantics stay the same.
|
|
174
174
|
|
|
175
175
|
| Command | Purpose |
|
|
176
176
|
|---------|---------|
|
|
177
177
|
| `create-task` / `import-issue` | Start a task from a description or a GitHub Issue |
|
|
178
|
-
| `run-task` | Resume
|
|
178
|
+
| `run-task` | Resume the lifecycle with fresh isolated executors/reviewers when the selected client exposes verified actual model/effort evidence; current built-in clients, including Claude Code and Codex, fail closed before delegation because their native start events do not expose all required evidence |
|
|
179
179
|
| `analyze-task` → `review-analysis` | Capture scope and risks, then review the analysis |
|
|
180
180
|
| `plan-task` → `review-plan` | Design the approach, then review the plan |
|
|
181
181
|
| `code-task` → `review-code` | Implement and test, then run a structured code review |
|
|
182
182
|
| `commit` → `create-pr` → `complete-task` | Commit, open a PR, and archive the task |
|
|
183
183
|
|
|
184
|
+
Start with one atomic role policy, for example: `$run-task 42 --executor-model <id> --executor-reasoning-effort <value> --reviewer-model <id> --reviewer-reasoning-effort <value>`. Both roles may use the same model. With no explicit policy, `run-task` reads the current Agent Client's optional `agentClients[].orchestration`; if neither source is complete, it shows the host model-selection guidance before creating any run. Re-entry uses the persisted v2 policy.
|
|
185
|
+
|
|
184
186
|
See the full catalog — task status, release, security, and project-maintenance skills — in [Built-in AI Skills](./docs/en/skills.md).
|
|
185
187
|
|
|
186
188
|
## What You Get
|
|
@@ -196,7 +198,6 @@ my-project/
|
|
|
196
198
|
│ ├── workflows/ # 4 prebuilt workflows
|
|
197
199
|
│ └── templates/ # Task and artifact templates
|
|
198
200
|
├── .claude/ # Claude Code config and commands
|
|
199
|
-
├── .gemini/ # Gemini CLI config and commands
|
|
200
201
|
├── .opencode/ # OpenCode config and commands
|
|
201
202
|
└── AGENTS.md # Universal AI agent instructions
|
|
202
203
|
```
|
package/README.zh-CN.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<h1 align="center">Agent Infra</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
AI 编程代理的协作基础设施 —— 为 Claude Code、Codex、
|
|
8
|
+
AI 编程代理的协作基础设施 —— 为 Claude Code、Codex、Antigravity CLI、OpenCode 提供 skills、工作流和沙箱。
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
|
|
29
29
|
## 为什么需要 agent-infra?
|
|
30
30
|
|
|
31
|
-
越来越多的团队会在同一个仓库里混用 Claude Code、Codex、
|
|
31
|
+
越来越多的团队会在同一个仓库里混用 Claude Code、Codex、Antigravity CLI、OpenCode 等 AI TUI,但每个工具往往都会带来自己的命令体系、提示词习惯和本地约定。缺少共享层时,结果通常是工作流割裂、初始化重复、任务历史难以追踪。
|
|
32
32
|
|
|
33
33
|
agent-infra 的目标就是把这层共享基础设施标准化。它为所有支持的 AI TUI 提供统一的任务生命周期、统一的 skill 词汇、统一的项目治理文件、隔离的开发沙箱以及统一的升级路径,让团队切换工具时不必重新发明流程。
|
|
34
34
|
|
|
@@ -80,11 +80,11 @@ agent-infra 的目标就是把这层共享基础设施标准化。它为所有
|
|
|
80
80
|
|
|
81
81
|
**11 条命令,1 次自然语言纠正,从 Issue 到合并 PR。** 这就是完整的 SOP —— 编程也可以有标准作业流程。
|
|
82
82
|
|
|
83
|
-
以上每条命令在 Claude Code、Codex、
|
|
83
|
+
以上每条命令在 Claude Code、Codex、Antigravity CLI、OpenCode 中完全通用。任务进行到一半切换工具,工作流状态照常延续。每个 skill 背后做了什么,见 [内置 AI Skills](./docs/zh-CN/skills.md)。
|
|
84
84
|
|
|
85
85
|
## 核心特性
|
|
86
86
|
|
|
87
|
-
- **多 AI 协作**:为 Claude Code、Codex、
|
|
87
|
+
- **多 AI 协作**:为 Claude Code、Codex、Antigravity CLI、OpenCode 提供统一的协作模型
|
|
88
88
|
- **引导 CLI + skill 驱动执行**:初始化一次,后续日常操作交给 AI skills
|
|
89
89
|
- **IM 命令桥接**:把飞书消息路由到内置命令、任务只读视图、沙箱管理和受控生命周期 skill 执行
|
|
90
90
|
- **双语文档**:英文为主文档,配套同步的中文版本
|
|
@@ -152,7 +152,7 @@ CLI 会收集项目元数据,让你选择启用的 Agent Client,为其安装
|
|
|
152
152
|
|-----|------|
|
|
153
153
|
| Claude Code | `/update-agent-infra` |
|
|
154
154
|
| Codex | `$update-agent-infra` |
|
|
155
|
-
|
|
|
155
|
+
| Antigravity CLI | `/update-agent-infra` |
|
|
156
156
|
| OpenCode | `/update-agent-infra` |
|
|
157
157
|
|
|
158
158
|
该命令会检测当前打包模板版本并渲染所有受管理文件。首次安装和后续升级都使用同一条命令。
|
|
@@ -165,21 +165,23 @@ CLI 会收集项目元数据,让你选择启用的 Agent Client,为其安装
|
|
|
165
165
|
ai agent-client list
|
|
166
166
|
ai agent-client status
|
|
167
167
|
ai agent-client enable codex
|
|
168
|
-
ai agent-client disable
|
|
168
|
+
ai agent-client disable antigravity-cli
|
|
169
169
|
ai agent-client configure
|
|
170
170
|
```
|
|
171
171
|
|
|
172
|
-
最常用的生命周期命令,按交付顺序排列。命令前缀因 TUI 而异(Claude Code/OpenCode 用 `/skill`,Codex 用 `$skill
|
|
172
|
+
最常用的生命周期命令,按交付顺序排列。命令前缀因 TUI 而异(Claude Code/Antigravity/OpenCode 用 `/skill`,Codex 用 `$skill`),工作流语义保持一致。
|
|
173
173
|
|
|
174
174
|
| 命令 | 用途 |
|
|
175
175
|
|------|------|
|
|
176
176
|
| `create-task` / `import-issue` | 从描述或 GitHub Issue 创建任务 |
|
|
177
|
-
| `run-task` |
|
|
177
|
+
| `run-task` | 当所选客户端能提供已验证的 actual model/effort 证据时,用 fresh 隔离 executor/reviewer 续跑生命周期;当前内建客户端(含 Claude Code 与 Codex)因原生 start 事件未暴露全部必需证据,会在委派前失败关闭 |
|
|
178
178
|
| `analyze-task` → `review-analysis` | 明确范围与风险,再审查分析 |
|
|
179
179
|
| `plan-task` → `review-plan` | 设计实现路径,再审查方案 |
|
|
180
180
|
| `code-task` → `review-code` | 实现并测试,再执行结构化代码审查 |
|
|
181
181
|
| `commit` → `create-pr` → `complete-task` | 提交、创建 PR、归档任务 |
|
|
182
182
|
|
|
183
|
+
启动时可提供原子角色策略,例如:`$run-task 42 --executor-model <id> --executor-reasoning-effort <值> --reviewer-model <id> --reviewer-reasoning-effort <值>`。两个角色可以使用同一模型。完全没有显式策略时,`run-task` 读取当前 Agent Client 可选的 `agentClients[].orchestration`;两个来源都不完整时,会在创建任何 run 前展示宿主模型选择指引。重入使用已持久化的 v2 策略。
|
|
184
|
+
|
|
183
185
|
完整清单(任务状态、发布、安全、项目维护等 skill)见 [内置 AI Skills](./docs/zh-CN/skills.md)。
|
|
184
186
|
|
|
185
187
|
## 安装效果
|
|
@@ -195,7 +197,6 @@ my-project/
|
|
|
195
197
|
│ ├── workflows/ # 4 个预置工作流
|
|
196
198
|
│ └── templates/ # 任务与产物模板
|
|
197
199
|
├── .claude/ # Claude Code 配置与命令
|
|
198
|
-
├── .gemini/ # Gemini CLI 配置与命令
|
|
199
200
|
├── .opencode/ # OpenCode 配置与命令
|
|
200
201
|
└── AGENTS.md # 通用 AI agent 指令
|
|
201
202
|
```
|
package/dist/bin/internal-cli.js
CHANGED
|
@@ -46,6 +46,16 @@ switch (command) {
|
|
|
46
46
|
platformPr(process.argv.slice(3));
|
|
47
47
|
break;
|
|
48
48
|
}
|
|
49
|
+
case 'platform-pr-review': {
|
|
50
|
+
const { platformPrReview } = await import('../lib/internal/platform-pr-review.js');
|
|
51
|
+
platformPrReview(process.argv.slice(3));
|
|
52
|
+
break;
|
|
53
|
+
}
|
|
54
|
+
case 'pr-review-grade': {
|
|
55
|
+
const { prReviewGrade } = await import('../lib/internal/pr-review-grade.js');
|
|
56
|
+
prReviewGrade(process.argv.slice(3));
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
49
59
|
case 'platform-checks': {
|
|
50
60
|
const { platformChecks } = await import('../lib/internal/platform-checks.js');
|
|
51
61
|
await platformChecks(process.argv.slice(3));
|
|
@@ -66,6 +76,11 @@ switch (command) {
|
|
|
66
76
|
taskWarning(process.argv.slice(3));
|
|
67
77
|
break;
|
|
68
78
|
}
|
|
79
|
+
case 'task-activity': {
|
|
80
|
+
const { taskActivity } = await import('../lib/internal/task-activity.js');
|
|
81
|
+
taskActivity(process.argv.slice(3));
|
|
82
|
+
break;
|
|
83
|
+
}
|
|
69
84
|
case 'task-artifact': {
|
|
70
85
|
const { taskArtifact } = await import('../lib/internal/task-artifact.js');
|
|
71
86
|
taskArtifact(process.argv.slice(3));
|
|
@@ -116,14 +116,55 @@ function defineAgentClientAdapter(candidate) {
|
|
|
116
116
|
}
|
|
117
117
|
return [capability, Object.freeze({ level: support.level })];
|
|
118
118
|
}));
|
|
119
|
+
const modelSelection = candidate.modelSelection;
|
|
120
|
+
if (!modelSelection || typeof modelSelection !== 'object') {
|
|
121
|
+
throw new Error(`Agent Client '${candidate.id}' has an invalid model-selection context`);
|
|
122
|
+
}
|
|
123
|
+
let frozenModelSelection;
|
|
124
|
+
if (modelSelection.kind === 'interactive-only') {
|
|
125
|
+
if (!modelSelection.command?.trim() || !modelSelection.guidance?.trim()) {
|
|
126
|
+
throw new Error(`Agent Client '${candidate.id}' has an invalid model-selection context`);
|
|
127
|
+
}
|
|
128
|
+
frozenModelSelection = Object.freeze({ ...modelSelection });
|
|
129
|
+
}
|
|
130
|
+
else if (modelSelection.kind === 'catalog'
|
|
131
|
+
&& ['complete', 'partial'].includes(modelSelection.completeness)
|
|
132
|
+
&& typeof modelSelection.source === 'string'
|
|
133
|
+
&& modelSelection.source.trim() !== ''
|
|
134
|
+
&& Array.isArray(modelSelection.models)) {
|
|
135
|
+
const models = modelSelection.models.map((model) => {
|
|
136
|
+
if (!model?.id?.trim() || (model.reasoningEfforts && !Array.isArray(model.reasoningEfforts))) {
|
|
137
|
+
throw new Error(`Agent Client '${candidate.id}' has an invalid model-selection context`);
|
|
138
|
+
}
|
|
139
|
+
return Object.freeze({
|
|
140
|
+
id: model.id,
|
|
141
|
+
...(model.reasoningEfforts
|
|
142
|
+
? { reasoningEfforts: Object.freeze([...model.reasoningEfforts]) }
|
|
143
|
+
: {})
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
frozenModelSelection = Object.freeze({
|
|
147
|
+
...modelSelection,
|
|
148
|
+
models: Object.freeze(models)
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
throw new Error(`Agent Client '${candidate.id}' has an invalid model-selection context`);
|
|
153
|
+
}
|
|
154
|
+
const evidence = candidate.delegationEvidence;
|
|
155
|
+
if (!evidence
|
|
156
|
+
|| !['host-event', 'unavailable'].includes(evidence.actualModel)
|
|
157
|
+
|| !['host-event', 'spawn-ack', 'unavailable'].includes(evidence.actualReasoningEffort)) {
|
|
158
|
+
throw new Error(`Agent Client '${candidate.id}' has invalid delegation evidence`);
|
|
159
|
+
}
|
|
119
160
|
if (typeof candidate.project !== 'object'
|
|
120
161
|
|| candidate.project === null
|
|
121
162
|
|| Array.isArray(candidate.project)) {
|
|
122
163
|
throw new Error(`Agent Client '${candidate.id}' has an invalid project descriptor`);
|
|
123
164
|
}
|
|
124
165
|
const ownedPathPrefixes = candidate.project.ownedPathPrefixes;
|
|
125
|
-
if (!Array.isArray(ownedPathPrefixes)
|
|
126
|
-
throw new Error(`Agent Client '${candidate.id}'
|
|
166
|
+
if (!Array.isArray(ownedPathPrefixes)) {
|
|
167
|
+
throw new Error(`Agent Client '${candidate.id}' has invalid owned path prefixes`);
|
|
127
168
|
}
|
|
128
169
|
const paths = ownedPathPrefixes.map((prefix) => {
|
|
129
170
|
if (typeof prefix !== 'string'
|
|
@@ -282,6 +323,8 @@ function defineAgentClientAdapter(candidate) {
|
|
|
282
323
|
displayName: candidate.displayName,
|
|
283
324
|
invocation: candidate.invocation,
|
|
284
325
|
capabilities: Object.freeze(capabilities),
|
|
326
|
+
modelSelection: frozenModelSelection,
|
|
327
|
+
delegationEvidence: Object.freeze({ ...evidence }),
|
|
285
328
|
project: Object.freeze({
|
|
286
329
|
ownedPathPrefixes: Object.freeze(paths),
|
|
287
330
|
...projectAssets,
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { defineAgentClientAdapter } from '../adapter.js';
|
|
2
|
+
import { hostJoin } from '../../sandbox/engines/wsl2-paths.js';
|
|
3
|
+
const antigravityCliAdapter = defineAgentClientAdapter({
|
|
4
|
+
id: 'antigravity-cli',
|
|
5
|
+
displayName: 'Antigravity CLI',
|
|
6
|
+
invocation: '/${skillName}',
|
|
7
|
+
capabilities: {
|
|
8
|
+
instructions: { level: 'compatible' },
|
|
9
|
+
skills: { level: 'integrated' },
|
|
10
|
+
commands: { level: 'integrated' },
|
|
11
|
+
hooks: { level: 'compatible' },
|
|
12
|
+
subagents: { level: 'unsupported' },
|
|
13
|
+
orchestration: { level: 'unsupported' },
|
|
14
|
+
sandbox: { level: 'integrated' },
|
|
15
|
+
verification: { level: 'compatible' }
|
|
16
|
+
},
|
|
17
|
+
modelSelection: {
|
|
18
|
+
kind: 'interactive-only',
|
|
19
|
+
command: '/model',
|
|
20
|
+
guidance: 'Use the host model picker for the complete model and reasoning-effort catalog.'
|
|
21
|
+
},
|
|
22
|
+
delegationEvidence: {
|
|
23
|
+
actualModel: 'unavailable',
|
|
24
|
+
actualReasoningEffort: 'unavailable'
|
|
25
|
+
},
|
|
26
|
+
project: {
|
|
27
|
+
ownedPathPrefixes: [],
|
|
28
|
+
managed: [],
|
|
29
|
+
merged: [],
|
|
30
|
+
ejected: [],
|
|
31
|
+
seedCommands: []
|
|
32
|
+
},
|
|
33
|
+
sandbox: {
|
|
34
|
+
createTool: ({ home }) => ({
|
|
35
|
+
id: 'antigravity-cli',
|
|
36
|
+
name: 'Antigravity CLI',
|
|
37
|
+
install: {
|
|
38
|
+
type: 'shell',
|
|
39
|
+
cmd: 'curl -fsSL https://antigravity.google/cli/install.sh | bash -s -- --dir /home/devuser/.npm-global/bin'
|
|
40
|
+
},
|
|
41
|
+
sandboxBase: hostJoin(home, '.agent-infra', 'sandboxes', 'antigravity-cli'),
|
|
42
|
+
containerMount: '/home/devuser/.gemini',
|
|
43
|
+
versionCmd: 'agy --version',
|
|
44
|
+
setupHint: 'Run agy inside the container to finish authentication.',
|
|
45
|
+
hostPreSeedFiles: [
|
|
46
|
+
{
|
|
47
|
+
hostPath: hostJoin(home, '.gemini', 'antigravity-cli', 'keybindings.json'),
|
|
48
|
+
sandboxName: 'antigravity-cli/keybindings.json'
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
hostPath: hostJoin(home, '.gemini', 'config', 'mcp_config.json'),
|
|
52
|
+
sandboxName: 'config/mcp_config.json'
|
|
53
|
+
}
|
|
54
|
+
]
|
|
55
|
+
}),
|
|
56
|
+
aliases: [
|
|
57
|
+
{ name: 'antigravity-yolo', command: 'agy --dangerously-skip-permissions; tput ed' },
|
|
58
|
+
{ name: 'agy-yolo', command: 'agy --dangerously-skip-permissions; tput ed' }
|
|
59
|
+
],
|
|
60
|
+
hooks: []
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
export { antigravityCliAdapter };
|
|
64
|
+
//# sourceMappingURL=antigravity-cli.js.map
|
|
@@ -10,10 +10,19 @@ const claudeCodeAdapter = defineAgentClientAdapter({
|
|
|
10
10
|
commands: { level: 'integrated' },
|
|
11
11
|
hooks: { level: 'integrated' },
|
|
12
12
|
subagents: { level: 'experimental' },
|
|
13
|
-
orchestration: { level: '
|
|
13
|
+
orchestration: { level: 'unsupported' },
|
|
14
14
|
sandbox: { level: 'integrated' },
|
|
15
15
|
verification: { level: 'compatible' }
|
|
16
16
|
},
|
|
17
|
+
modelSelection: {
|
|
18
|
+
kind: 'interactive-only',
|
|
19
|
+
command: '/model',
|
|
20
|
+
guidance: 'Use the host model picker for the complete model and reasoning-effort catalog.'
|
|
21
|
+
},
|
|
22
|
+
delegationEvidence: {
|
|
23
|
+
actualModel: 'unavailable',
|
|
24
|
+
actualReasoningEffort: 'unavailable'
|
|
25
|
+
},
|
|
17
26
|
project: {
|
|
18
27
|
ownedPathPrefixes: ['.claude/'],
|
|
19
28
|
managed: ['.claude/commands/', '.claude/agents/'],
|
|
@@ -15,6 +15,15 @@ const codexAdapter = defineAgentClientAdapter({
|
|
|
15
15
|
sandbox: { level: 'integrated' },
|
|
16
16
|
verification: { level: 'compatible' }
|
|
17
17
|
},
|
|
18
|
+
modelSelection: {
|
|
19
|
+
kind: 'interactive-only',
|
|
20
|
+
command: '/model',
|
|
21
|
+
guidance: 'Use the host model picker for the complete model and reasoning-effort catalog.'
|
|
22
|
+
},
|
|
23
|
+
delegationEvidence: {
|
|
24
|
+
actualModel: 'unavailable',
|
|
25
|
+
actualReasoningEffort: 'unavailable'
|
|
26
|
+
},
|
|
18
27
|
project: {
|
|
19
28
|
ownedPathPrefixes: ['.codex/'],
|
|
20
29
|
managed: ['.codex/hooks.json', '.codex/agents/'],
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { AGENT_CLIENT_IDS } from '../types.js';
|
|
2
2
|
import { claudeCodeAdapter } from './claude-code.js';
|
|
3
3
|
import { codexAdapter } from './codex.js';
|
|
4
|
-
import {
|
|
4
|
+
import { antigravityCliAdapter } from './antigravity-cli.js';
|
|
5
5
|
import { opencodeAdapter } from './opencode.js';
|
|
6
6
|
const adaptersById = new Map([
|
|
7
7
|
claudeCodeAdapter,
|
|
8
8
|
codexAdapter,
|
|
9
|
-
|
|
9
|
+
antigravityCliAdapter,
|
|
10
10
|
opencodeAdapter
|
|
11
11
|
].map((adapter) => [adapter.id, adapter]));
|
|
12
12
|
const BUILTIN_AGENT_CLIENT_ADAPTERS = Object.freeze(AGENT_CLIENT_IDS.map((id) => {
|
|
@@ -15,6 +15,15 @@ const opencodeAdapter = defineAgentClientAdapter({
|
|
|
15
15
|
sandbox: { level: 'integrated' },
|
|
16
16
|
verification: { level: 'compatible' }
|
|
17
17
|
},
|
|
18
|
+
modelSelection: {
|
|
19
|
+
kind: 'interactive-only',
|
|
20
|
+
command: '/models',
|
|
21
|
+
guidance: 'Use the host model picker for the complete model and reasoning-effort catalog.'
|
|
22
|
+
},
|
|
23
|
+
delegationEvidence: {
|
|
24
|
+
actualModel: 'unavailable',
|
|
25
|
+
actualReasoningEffort: 'unavailable'
|
|
26
|
+
},
|
|
18
27
|
project: {
|
|
19
28
|
ownedPathPrefixes: ['.opencode/'],
|
|
20
29
|
managed: ['.opencode/commands/'],
|
|
@@ -20,6 +20,37 @@ function isRecord(value) {
|
|
|
20
20
|
function fail(code, path) {
|
|
21
21
|
throw new AgentClientConfigError({ code, path });
|
|
22
22
|
}
|
|
23
|
+
function parseExactText(value, path) {
|
|
24
|
+
if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
|
|
25
|
+
fail('INVALID_AGENT_CLIENTS', path);
|
|
26
|
+
}
|
|
27
|
+
return value;
|
|
28
|
+
}
|
|
29
|
+
function parseOrchestrationPolicy(value, path) {
|
|
30
|
+
if (!isRecord(value))
|
|
31
|
+
fail('INVALID_AGENT_CLIENTS', path);
|
|
32
|
+
const keys = Object.keys(value);
|
|
33
|
+
if (keys.length !== 2
|
|
34
|
+
|| !hasOwn(value, 'executor')
|
|
35
|
+
|| !hasOwn(value, 'reviewer')) {
|
|
36
|
+
fail('INVALID_AGENT_CLIENTS', path);
|
|
37
|
+
}
|
|
38
|
+
const parseRole = (candidate, rolePath) => {
|
|
39
|
+
if (!isRecord(candidate)
|
|
40
|
+
|| Object.keys(candidate).length !== 2
|
|
41
|
+
|| !hasOwn(candidate, 'model')
|
|
42
|
+
|| !hasOwn(candidate, 'reasoningEffort')) {
|
|
43
|
+
fail('INVALID_AGENT_CLIENTS', rolePath);
|
|
44
|
+
}
|
|
45
|
+
return Object.freeze({
|
|
46
|
+
model: parseExactText(candidate.model, `${rolePath}.model`),
|
|
47
|
+
reasoningEffort: parseExactText(candidate.reasoningEffort, `${rolePath}.reasoningEffort`)
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
const executor = parseRole(value.executor, `${path}.executor`);
|
|
51
|
+
const reviewer = parseRole(value.reviewer, `${path}.reviewer`);
|
|
52
|
+
return Object.freeze({ executor, reviewer });
|
|
53
|
+
}
|
|
23
54
|
function parseCanonical(value) {
|
|
24
55
|
if (!Array.isArray(value))
|
|
25
56
|
fail('INVALID_AGENT_CLIENTS', 'agentClients');
|
|
@@ -29,10 +60,11 @@ function parseCanonical(value) {
|
|
|
29
60
|
if (!isRecord(candidate))
|
|
30
61
|
fail('INVALID_AGENT_CLIENTS', path);
|
|
31
62
|
const keys = Object.keys(candidate);
|
|
32
|
-
if (keys.length !== 3
|
|
63
|
+
if ((keys.length !== 3 && keys.length !== 4)
|
|
33
64
|
|| !hasOwn(candidate, 'id')
|
|
34
65
|
|| !hasOwn(candidate, 'enabled')
|
|
35
|
-
|| !hasOwn(candidate, 'installInSandbox')
|
|
66
|
+
|| !hasOwn(candidate, 'installInSandbox')
|
|
67
|
+
|| (keys.length === 4 && !hasOwn(candidate, 'orchestration'))) {
|
|
36
68
|
fail('INVALID_AGENT_CLIENTS', path);
|
|
37
69
|
}
|
|
38
70
|
if (!isAgentClientId(candidate.id)) {
|
|
@@ -47,7 +79,10 @@ function parseCanonical(value) {
|
|
|
47
79
|
}
|
|
48
80
|
entries.set(candidate.id, {
|
|
49
81
|
enabled: candidate.enabled,
|
|
50
|
-
installInSandbox: candidate.installInSandbox
|
|
82
|
+
installInSandbox: candidate.installInSandbox,
|
|
83
|
+
...(hasOwn(candidate, 'orchestration')
|
|
84
|
+
? { orchestration: parseOrchestrationPolicy(candidate.orchestration, `${path}.orchestration`) }
|
|
85
|
+
: {})
|
|
51
86
|
});
|
|
52
87
|
}
|
|
53
88
|
for (const id of AGENT_CLIENT_IDS) {
|
|
@@ -60,7 +95,10 @@ function serializeAgentClients(state) {
|
|
|
60
95
|
return AGENT_CLIENT_IDS.map((id) => ({
|
|
61
96
|
id,
|
|
62
97
|
enabled: state[id].enabled,
|
|
63
|
-
installInSandbox: state[id].installInSandbox
|
|
98
|
+
installInSandbox: state[id].installInSandbox,
|
|
99
|
+
...(state[id].orchestration
|
|
100
|
+
? { orchestration: structuredClone(state[id].orchestration) }
|
|
101
|
+
: {})
|
|
64
102
|
}));
|
|
65
103
|
}
|
|
66
104
|
function projectLegacyTuis(value, diagnostics) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { listEnabledAgentClientAdapters } from './registry.js';
|
|
2
2
|
import { renderAgentClientInvocation } from './invocation.js';
|
|
3
|
+
import semver from 'semver';
|
|
3
4
|
const SAFE_NAME = /^[a-zA-Z0-9][a-zA-Z0-9._-]*$/;
|
|
4
5
|
const SAFE_TASK_REF = /^(?:\d+|TASK-\d{8}-\d{6})$/;
|
|
5
6
|
function requireSafeName(value, field) {
|
|
@@ -13,6 +14,14 @@ function renderNextStepCommands(input) {
|
|
|
13
14
|
if (input.taskRef !== undefined && !SAFE_TASK_REF.test(input.taskRef)) {
|
|
14
15
|
throw new Error('Invalid task ref');
|
|
15
16
|
}
|
|
17
|
+
if (input.version !== undefined
|
|
18
|
+
&& (!/^[0-9]/.test(input.version) || semver.valid(input.version) !== input.version)) {
|
|
19
|
+
throw new Error('Invalid version');
|
|
20
|
+
}
|
|
21
|
+
const args = [
|
|
22
|
+
...(input.taskRef === undefined ? [] : [input.taskRef]),
|
|
23
|
+
...(input.version === undefined ? [] : [input.version])
|
|
24
|
+
];
|
|
16
25
|
const builtins = listEnabledAgentClientAdapters(input.state).map((adapter) => Object.freeze({
|
|
17
26
|
source: 'builtin',
|
|
18
27
|
clientId: adapter.id,
|
|
@@ -20,7 +29,7 @@ function renderNextStepCommands(input) {
|
|
|
20
29
|
command: renderAgentClientInvocation(adapter.invocation, {
|
|
21
30
|
projectName: input.projectName,
|
|
22
31
|
skillName: input.skillName,
|
|
23
|
-
args
|
|
32
|
+
args
|
|
24
33
|
})
|
|
25
34
|
}));
|
|
26
35
|
const custom = input.customTUIs.map((tool) => Object.freeze({
|
|
@@ -29,7 +38,7 @@ function renderNextStepCommands(input) {
|
|
|
29
38
|
command: renderAgentClientInvocation(tool.invocation, {
|
|
30
39
|
projectName: input.projectName,
|
|
31
40
|
skillName: input.skillName,
|
|
32
|
-
args
|
|
41
|
+
args
|
|
33
42
|
})
|
|
34
43
|
}));
|
|
35
44
|
return Object.freeze([...builtins, ...custom]);
|
|
@@ -158,7 +158,8 @@ function planAgentClientReconciliation(input) {
|
|
|
158
158
|
skillName: 'update-agent-infra'
|
|
159
159
|
});
|
|
160
160
|
const actionableSeed = seedOperations.some((operation) => operation.kind === 'write' || operation.kind === 'remove');
|
|
161
|
-
const changed = JSON.stringify(nextConfig) !== JSON.stringify(input.config)
|
|
161
|
+
const changed = JSON.stringify(nextConfig) !== JSON.stringify(input.config)
|
|
162
|
+
|| actionableSeed;
|
|
162
163
|
return Object.freeze({
|
|
163
164
|
source: normalized.source,
|
|
164
165
|
before: normalized.state,
|
|
@@ -52,6 +52,12 @@ function listInstalledAgentClientAdapters(state) {
|
|
|
52
52
|
function getAgentClientCapability(id, capability) {
|
|
53
53
|
return getAgentClientAdapter(id).capabilities[capability];
|
|
54
54
|
}
|
|
55
|
+
function getAgentClientModelSelection(id) {
|
|
56
|
+
return getAgentClientAdapter(id).modelSelection;
|
|
57
|
+
}
|
|
58
|
+
function getAgentClientDelegationEvidence(id) {
|
|
59
|
+
return getAgentClientAdapter(id).delegationEvidence;
|
|
60
|
+
}
|
|
55
61
|
function listEnabledAgentClientAdaptersByCapability(state, capability, acceptedLevels) {
|
|
56
62
|
const accepted = new Set(acceptedLevels);
|
|
57
63
|
return Object.freeze(AGENT_CLIENT_ADAPTERS.filter((adapter) => state[adapter.id].enabled
|
|
@@ -68,5 +74,5 @@ function createAgentClientManifest() {
|
|
|
68
74
|
ejected: Object.freeze([...adapter.project.ejected])
|
|
69
75
|
})));
|
|
70
76
|
}
|
|
71
|
-
export { AGENT_CLIENT_REGISTRY, createAgentClientManifest, getAgentClientAdapter, getAgentClientCapability, listAgentClientAdapters, listEnabledAgentClientAdapters, listEnabledAgentClientAdaptersByCapability, listInstalledAgentClientAdapters };
|
|
77
|
+
export { AGENT_CLIENT_REGISTRY, createAgentClientManifest, getAgentClientAdapter, getAgentClientCapability, getAgentClientDelegationEvidence, getAgentClientModelSelection, listAgentClientAdapters, listEnabledAgentClientAdapters, listEnabledAgentClientAdaptersByCapability, listInstalledAgentClientAdapters };
|
|
72
78
|
//# sourceMappingURL=registry.js.map
|
|
@@ -24,6 +24,15 @@ const AGENT_CLIENTS_SCHEMA = {
|
|
|
24
24
|
},
|
|
25
25
|
installInSandbox: {
|
|
26
26
|
type: 'boolean'
|
|
27
|
+
},
|
|
28
|
+
orchestration: {
|
|
29
|
+
type: 'object',
|
|
30
|
+
additionalProperties: false,
|
|
31
|
+
required: ['executor', 'reviewer'],
|
|
32
|
+
properties: {
|
|
33
|
+
executor: { $ref: '#/definitions/orchestrationRolePolicy' },
|
|
34
|
+
reviewer: { $ref: '#/definitions/orchestrationRolePolicy' }
|
|
35
|
+
}
|
|
27
36
|
}
|
|
28
37
|
}
|
|
29
38
|
}
|
|
@@ -43,6 +52,15 @@ const AGENT_CLIENTS_SCHEMA = {
|
|
|
43
52
|
}
|
|
44
53
|
},
|
|
45
54
|
definitions: {
|
|
55
|
+
orchestrationRolePolicy: {
|
|
56
|
+
type: 'object',
|
|
57
|
+
additionalProperties: false,
|
|
58
|
+
required: ['model', 'reasoningEffort'],
|
|
59
|
+
properties: {
|
|
60
|
+
model: { type: 'string', minLength: 1 },
|
|
61
|
+
reasoningEffort: { type: 'string', minLength: 1 }
|
|
62
|
+
}
|
|
63
|
+
},
|
|
46
64
|
agentClientCapabilityId: {
|
|
47
65
|
type: 'string',
|
|
48
66
|
enum: [...AGENT_CLIENT_CAPABILITY_IDS]
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Active AI collaborator short tokens — the write-side whitelist for the
|
|
2
|
+
// activity log. Migrated from lib/task/commands/log.ts so that the write-side
|
|
3
|
+
// internal commands and the rendering side share one definition. Historical
|
|
4
|
+
// Gemini tokens remain read-only and are handled by classifyAgent below.
|
|
5
|
+
export const KNOWN_AI_AGENTS = new Set(['claude', 'codex', 'antigravity', 'opencode', 'cursor']);
|
|
6
|
+
// Long name -> short name mapping (HD-4, decision A): `claude-code` reuses the
|
|
7
|
+
// existing orchestration precedent, and `antigravity-cli` is the active
|
|
8
|
+
// client. `gemini-cli` is intentionally not writable.
|
|
9
|
+
export const AGENT_LONG_NAMES = {
|
|
10
|
+
'claude-code': 'claude',
|
|
11
|
+
'antigravity-cli': 'antigravity'
|
|
12
|
+
};
|
|
13
|
+
export const AGENT_USAGE_HINT = "agent must be a short token (claude/codex/antigravity/opencode/cursor), " +
|
|
14
|
+
"a long name (claude-code -> claude, antigravity-cli -> antigravity), or 'human'";
|
|
15
|
+
// Read-side historical compatibility for activity-log rendering: `gemini` and
|
|
16
|
+
// `gemini-cli` stay recognizable when displaying old logs, but are never
|
|
17
|
+
// accepted by normalizeAgentToken (write side).
|
|
18
|
+
const READ_KNOWN_AI_AGENTS = new Set([...KNOWN_AI_AGENTS, 'gemini']);
|
|
19
|
+
const READ_AGENT_LONG_NAMES = {
|
|
20
|
+
...AGENT_LONG_NAMES,
|
|
21
|
+
'gemini-cli': 'gemini'
|
|
22
|
+
};
|
|
23
|
+
// Strict write-side validation: the value must be exactly a short token, a
|
|
24
|
+
// long name, or 'human'; returns the normalized short token, or null when
|
|
25
|
+
// the value is not a recognized agent.
|
|
26
|
+
export function normalizeAgentToken(value) {
|
|
27
|
+
const trimmed = value.trim();
|
|
28
|
+
if (trimmed === 'human')
|
|
29
|
+
return 'human';
|
|
30
|
+
if (KNOWN_AI_AGENTS.has(trimmed))
|
|
31
|
+
return trimmed;
|
|
32
|
+
const short = AGENT_LONG_NAMES[trimmed];
|
|
33
|
+
return short ?? null;
|
|
34
|
+
}
|
|
35
|
+
// Loose rendering-side classification: tolerates historical parenthetical
|
|
36
|
+
// annotations; unknown tokens keep the `human` grouping but get a visible
|
|
37
|
+
// signal. The "known AI token" test is `classifyAgent(value).status === 'ai'`.
|
|
38
|
+
export function classifyAgent(raw) {
|
|
39
|
+
const token = raw.trim().split(/\s+/)[0]?.replace(/\(.*$/, '') ?? '';
|
|
40
|
+
if (token === '')
|
|
41
|
+
return { status: 'unknown', display: 'human' };
|
|
42
|
+
if (token === 'human')
|
|
43
|
+
return { status: 'human', display: 'human' };
|
|
44
|
+
if (READ_KNOWN_AI_AGENTS.has(token))
|
|
45
|
+
return { status: 'ai', display: token };
|
|
46
|
+
const short = READ_AGENT_LONG_NAMES[token];
|
|
47
|
+
return short ? { status: 'ai', display: short } : { status: 'unknown', display: 'human' };
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=tokens.js.map
|