@fitlab-ai/agent-infra 0.9.9 → 0.9.11
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 +13 -3
- package/README.zh-CN.md +13 -3
- 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 +17 -10
- package/dist/lib/agent-clients/adapters/codex-lifecycle/controller-context.js +11 -31
- package/dist/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.js +15 -33
- package/dist/lib/agent-clients/adapters/codex-sandbox.js +72 -11
- package/dist/lib/agent-clients/adapters/index.js +3 -1
- package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
- package/dist/lib/agent-clients/adapters/traecli.js +65 -0
- 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 +7 -17
- package/dist/lib/agent-clients/types.js +2 -1
- package/dist/lib/decide.js +14 -30
- package/dist/lib/defaults.json +9 -0
- package/dist/lib/init.js +2 -2
- package/dist/lib/internal/codex-lifecycle.js +2 -2
- package/dist/lib/internal/codex-sandbox-controller.js +4 -3
- package/dist/lib/internal/release-workflow.js +0 -1
- package/dist/lib/internal/sandbox-control.js +2 -2
- 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/{task/commands/validate.js → internal/task-validate.js} +77 -43
- package/dist/lib/merge.js +205 -103
- package/dist/lib/process-data/normalize.js +2 -9
- package/dist/lib/run/host.js +46 -16
- package/dist/lib/run/tui.js +5 -2
- 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 +3 -12
- package/dist/lib/sandbox/control/controller-registration.js +4 -2
- package/dist/lib/sandbox/control/executor.js +135 -40
- package/dist/lib/sandbox/control/lifecycle.js +29 -20
- 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/protocol.js +5 -5
- package/dist/lib/task/activity-log.js +4 -1
- package/dist/lib/task/artifact-lifecycle.js +4 -2
- package/dist/lib/task/codex-orchestration.js +32 -35
- 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-operation.js +21 -25
- package/dist/lib/task/commit-policy.js +1 -1
- package/dist/lib/task/control-authority.js +431 -0
- package/dist/lib/task/create.js +6 -1
- package/dist/lib/task/current-contract.js +35 -0
- package/dist/lib/task/decision-details.js +263 -0
- package/dist/lib/task/decision-intents.js +5 -2
- package/dist/lib/task/delegation-receipts.js +8 -7
- package/dist/lib/task/events.js +11 -5
- package/dist/lib/task/finalization.js +72 -46
- package/dist/lib/task/index.js +19 -29
- package/dist/lib/task/ledger-intents.js +8 -9
- package/dist/lib/task/ledger.js +13 -6
- package/dist/lib/task/lifecycle.js +16 -0
- package/dist/lib/task/orchestration.js +51 -14
- package/dist/lib/task/review-artifacts.js +31 -12
- package/dist/lib/task/review-finalization.js +19 -6
- package/dist/lib/task/verification-engine.js +38 -18
- package/dist/lib/task/verification-review.js +1 -1
- package/dist/lib/task/workspace-snapshot.js +5 -11
- package/dist/lib/task/write.js +11 -1
- package/dist/lib/update.js +6 -37
- 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 +25 -10
- package/lib/agent-clients/adapters/codex-lifecycle/controller-context.ts +16 -33
- package/lib/agent-clients/adapters/codex-lifecycle/sandbox-controller.ts +16 -35
- package/lib/agent-clients/adapters/codex-sandbox.ts +89 -14
- package/lib/agent-clients/adapters/index.ts +3 -1
- package/lib/agent-clients/adapters/opencode-sandbox.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +66 -0
- 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 +7 -20
- package/lib/agent-clients/types.ts +2 -1
- package/lib/decide.ts +12 -22
- package/lib/defaults.json +9 -0
- package/lib/init.ts +2 -2
- package/lib/internal/codex-lifecycle.ts +2 -2
- package/lib/internal/codex-sandbox-controller.ts +4 -3
- package/lib/internal/release-workflow.ts +0 -1
- package/lib/internal/sandbox-control.ts +2 -2
- 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/{task/commands/validate.ts → internal/task-validate.ts} +77 -41
- package/lib/merge.ts +236 -120
- package/lib/process-data/normalize.ts +2 -8
- package/lib/run/host.ts +63 -14
- package/lib/run/tui.ts +5 -3
- 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 +2 -14
- package/lib/sandbox/control/container-identity.ts +2 -2
- package/lib/sandbox/control/controller-registration.ts +8 -3
- package/lib/sandbox/control/executor.ts +156 -53
- package/lib/sandbox/control/lifecycle.ts +34 -28
- 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/protocol.ts +5 -5
- package/lib/task/activity-log.ts +6 -1
- package/lib/task/artifact-lifecycle.ts +5 -3
- package/lib/task/codex-orchestration.ts +40 -45
- 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-operation.ts +25 -30
- package/lib/task/commit-policy.ts +1 -2
- package/lib/task/control-authority.ts +563 -0
- package/lib/task/create.ts +6 -1
- package/lib/task/current-contract.ts +49 -0
- package/lib/task/decision-details.ts +340 -0
- package/lib/task/decision-intents.ts +7 -2
- package/lib/task/delegation-receipts.ts +8 -6
- package/lib/task/events.ts +10 -5
- package/lib/task/finalization.ts +84 -42
- package/lib/task/index.ts +19 -28
- package/lib/task/ledger-intents.ts +6 -8
- package/lib/task/ledger.ts +17 -7
- package/lib/task/lifecycle.ts +20 -0
- package/lib/task/orchestration.ts +42 -16
- package/lib/task/review-artifacts.ts +53 -15
- package/lib/task/review-finalization.ts +33 -7
- package/lib/task/verification-engine.ts +33 -21
- package/lib/task/verification-review.ts +1 -1
- package/lib/task/workspace-snapshot.ts +4 -13
- package/lib/task/write.ts +20 -1
- package/lib/update.ts +6 -40
- package/lib/version.ts +6 -1
- package/package.json +1 -1
- package/templates/.agents/QUICKSTART.en.md +2 -3
- package/templates/.agents/QUICKSTART.zh-CN.md +2 -3
- package/templates/.agents/README.en.md +5 -3
- package/templates/.agents/README.zh-CN.md +5 -3
- package/templates/.agents/rules/README.en.md +1 -0
- package/templates/.agents/rules/README.zh-CN.md +1 -0
- package/templates/.agents/rules/compatibility-policy.en.md +40 -0
- package/templates/.agents/rules/compatibility-policy.zh-CN.md +40 -0
- package/templates/.agents/rules/create-issue.github.en.md +1 -1
- package/templates/.agents/rules/create-issue.github.zh-CN.md +1 -1
- 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 +1 -1
- package/templates/.agents/rules/issue-fields.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.en.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.github.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-pr-commands.zh-CN.md +1 -1
- package/templates/.agents/rules/issue-sync.github.en.md +1 -1
- package/templates/.agents/rules/issue-sync.github.zh-CN.md +2 -2
- package/templates/.agents/rules/lifecycle-orchestration.en.md +4 -4
- package/templates/.agents/rules/lifecycle-orchestration.zh-CN.md +4 -4
- package/templates/.agents/rules/milestone-inference.github.en.md +1 -1
- package/templates/.agents/rules/milestone-inference.github.zh-CN.md +1 -1
- 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 +2 -2
- package/templates/.agents/rules/pr-sync.github.en.md +3 -2
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +3 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +2 -1
- package/templates/.agents/rules/release-commands.github.en.md +6 -0
- package/templates/.agents/rules/release-commands.github.zh-CN.md +6 -0
- 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/review-method.en.md +1 -0
- package/templates/.agents/rules/review-method.zh-CN.md +1 -0
- package/templates/.agents/rules/task-management.en.md +1 -2
- package/templates/.agents/rules/task-management.zh-CN.md +1 -2
- 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 +1 -1
- package/templates/.agents/skills/close-codescan/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.en.md +1 -1
- package/templates/.agents/skills/close-dependabot/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/code-task/SKILL.en.md +4 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +5 -3
- package/templates/.agents/skills/commit/SKILL.en.md +27 -7
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +3 -4
- package/templates/.agents/skills/complete-manual-validation/SKILL.en.md +5 -5
- package/templates/.agents/skills/complete-manual-validation/SKILL.zh-CN.md +5 -5
- package/templates/.agents/skills/complete-task/SKILL.en.md +3 -3
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/create-pr/SKILL.en.md +15 -11
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +15 -11
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +46 -0
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +46 -0
- 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 +1 -1
- package/templates/.agents/skills/create-task/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/plan-task/SKILL.en.md +5 -4
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +5 -4
- 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 +5 -3
- package/templates/.agents/skills/review-analysis/SKILL.zh-CN.md +5 -3
- 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-code/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +5 -3
- 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 +9 -6
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +9 -6
- package/templates/.agents/skills/review-plan/SKILL.en.md +5 -3
- package/templates/.agents/skills/review-plan/SKILL.zh-CN.md +5 -3
- 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/run-manual-validation/SKILL.en.md +7 -3
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +7 -3
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.en.md +1 -1
- package/templates/.agents/skills/run-manual-validation/reference/discovery-and-execution.zh-CN.md +1 -1
- package/templates/.agents/skills/run-manual-validation/reference/report-template.en.md +2 -2
- package/templates/.agents/skills/run-manual-validation/reference/report-template.zh-CN.md +2 -2
- package/templates/.agents/skills/run-task/SKILL.en.md +6 -2
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +6 -2
- package/templates/.agents/skills/run-task/reference/host-validation.en.md +2 -2
- package/templates/.agents/skills/run-task/reference/host-validation.zh-CN.md +2 -2
- 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 +159 -104
- package/templates/.agents/skills/watch-pr/SKILL.en.md +2 -2
- package/templates/.agents/skills/watch-pr/SKILL.zh-CN.md +2 -2
- package/templates/.agents/templates/task.en.md +1 -1
- package/templates/.agents/templates/task.zh-CN.md +1 -1
- 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/.traecli/commands/update-agent-infra.en.md +7 -0
- package/templates/.traecli/commands/update-agent-infra.zh-CN.md +7 -0
- package/dist/lib/builtin-tuis.js +0 -40
- package/lib/builtin-tuis.ts +0 -56
|
@@ -51,7 +51,7 @@ The script outputs JSON to stdout. Parse and record the report.
|
|
|
51
51
|
- `managed.conflicts`: guarded managed files with unknown origin, two-sided changes, or ownership that cannot be proven during a platform switch; list each target, reason, and three-way hash
|
|
52
52
|
- `managed.removed`: deleted managed files (including old paths removed during template migrations)
|
|
53
53
|
- `managed.skippedPlatform`: managed / merged entries skipped because they belong to a different platform
|
|
54
|
-
- `managed.skippedTUI`: managed / merged entries skipped because they are owned by a built-in Agent Client whose `agentClients[].enabled` is `false` (
|
|
54
|
+
- `managed.skippedTUI`: managed / merged entries skipped because they are owned by a built-in Agent Client whose `agentClients[].enabled` is `false` (customTUI command files under the same path prefix are preserved)
|
|
55
55
|
- `merged.pending`: list of merged files for AI to process
|
|
56
56
|
- Each item has `target` (project-relative path) and `template` (template-root-relative path)
|
|
57
57
|
- `registryAdded`: newly added file registry entries
|
|
@@ -131,7 +131,7 @@ warning to the end of the report:
|
|
|
131
131
|
> **Rationale**: The current execution used the old skill logic; the new version
|
|
132
132
|
> may contain additional processing steps. Running again ensures the new logic
|
|
133
133
|
> is fully applied.
|
|
134
|
-
> Alternatively, users can run `ai
|
|
134
|
+
> Alternatively, users can run `ai sync` before executing the skill to
|
|
135
135
|
> pre-update the seed files and avoid the need for a second run.
|
|
136
136
|
|
|
137
137
|
### Output report
|
|
@@ -43,7 +43,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
|
43
43
|
- `managed.conflicts`:来源未知、双边修改或平台切换时无法证明官方所有权的 guarded managed 冲突;必须逐项展示 target、reason 与三方哈希
|
|
44
44
|
- `managed.removed`:被删除的 managed 文件(包括模板迁移时移除的旧路径)
|
|
45
45
|
- `managed.skippedPlatform`:因归属其他平台而被跳过的 managed / merged 条目
|
|
46
|
-
- `managed.skippedTUI`:因对应内建 Agent Client 的 `agentClients[].enabled` 为 `false` 而被跳过的 managed / merged
|
|
46
|
+
- `managed.skippedTUI`:因对应内建 Agent Client 的 `agentClients[].enabled` 为 `false` 而被跳过的 managed / merged 条目(落在同一路径前缀下的 customTUI 命令文件会被保留)
|
|
47
47
|
- `merged.pending`:需要 AI 处理的 merged 文件列表
|
|
48
48
|
- 每项包含 `target`(项目中的目标路径)和 `template`(模板根目录下的相对路径)
|
|
49
49
|
- `registryAdded`:新增的文件注册条目
|
|
@@ -116,7 +116,7 @@ node .agents/skills/update-agent-infra/scripts/sync-templates.js
|
|
|
116
116
|
|
|
117
117
|
> **原因**:本次执行使用的是旧版技能逻辑,新版技能可能包含额外的处理步骤。
|
|
118
118
|
> 再次执行可确保新逻辑完整应用。
|
|
119
|
-
> 用户也可以在执行前先运行 `ai
|
|
119
|
+
> 用户也可以在执行前先运行 `ai sync` 来预先更新技能文件,避免需要两次执行。
|
|
120
120
|
|
|
121
121
|
### 输出报告
|
|
122
122
|
|
|
@@ -48,6 +48,11 @@ const DEFAULTS = {
|
|
|
48
48
|
"id": "opencode",
|
|
49
49
|
"enabled": true,
|
|
50
50
|
"installInSandbox": true
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"id": "traecli",
|
|
54
|
+
"enabled": true,
|
|
55
|
+
"installInSandbox": true
|
|
51
56
|
}
|
|
52
57
|
],
|
|
53
58
|
"sandbox": {
|
|
@@ -111,6 +116,10 @@ const DEFAULTS = {
|
|
|
111
116
|
],
|
|
112
117
|
"ejected": [],
|
|
113
118
|
"retiredManaged": [
|
|
119
|
+
{
|
|
120
|
+
"path": ".trae/skills/",
|
|
121
|
+
"templateHashes": []
|
|
122
|
+
},
|
|
114
123
|
{
|
|
115
124
|
"path": ".agents/workspace/README.md",
|
|
116
125
|
"templateHashes": [
|
|
@@ -189,6 +198,24 @@ const AGENT_CLIENT_MANIFEST = [
|
|
|
189
198
|
},
|
|
190
199
|
"argumentsToken": "$ARGUMENTS"
|
|
191
200
|
}
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
"id": "traecli",
|
|
204
|
+
"displayName": "TraeCode CLI",
|
|
205
|
+
"invocation": "/${skillName}",
|
|
206
|
+
"ownedPathPrefixes": [
|
|
207
|
+
".traecli/"
|
|
208
|
+
],
|
|
209
|
+
"managed": [
|
|
210
|
+
".traecli/commands/"
|
|
211
|
+
],
|
|
212
|
+
"merged": [],
|
|
213
|
+
"ejected": [],
|
|
214
|
+
"customCommand": {
|
|
215
|
+
"target": ".traecli/commands/${skillName}.md",
|
|
216
|
+
"frontmatter": {},
|
|
217
|
+
"argumentsToken": "$ARGUMENTS"
|
|
218
|
+
}
|
|
192
219
|
}
|
|
193
220
|
];
|
|
194
221
|
const CUSTOM_TUI_CONTRACT = {
|
|
@@ -206,84 +233,19 @@ const CUSTOM_TUI_CONTRACT = {
|
|
|
206
233
|
const KNOWN_PLATFORMS = new Set(['github', 'none']);
|
|
207
234
|
const KNOWN_LANGUAGES = new Set(['en', 'zh-CN']);
|
|
208
235
|
|
|
209
|
-
const
|
|
236
|
+
const AGENT_CLIENT_IDS = AGENT_CLIENT_MANIFEST.map((entry) => entry.id);
|
|
210
237
|
|
|
211
238
|
function normalizeAgentClientConfig(cfg) {
|
|
212
239
|
const own = (value, key) => Object.prototype.hasOwnProperty.call(value, key);
|
|
213
|
-
const diagnostics = [];
|
|
214
240
|
const failure = (code, path) => ({
|
|
215
|
-
source: null,
|
|
216
241
|
state: null,
|
|
217
242
|
canonical: null,
|
|
218
|
-
remainingSandboxTools: undefined,
|
|
219
|
-
removeLegacyTuis: false,
|
|
220
|
-
changed: false,
|
|
221
|
-
diagnostics,
|
|
222
243
|
error: `${code} at ${path}`,
|
|
223
244
|
errorCode: code,
|
|
224
245
|
errorPath: path
|
|
225
246
|
});
|
|
226
|
-
const
|
|
227
|
-
|
|
228
|
-
return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true]));
|
|
229
|
-
}
|
|
230
|
-
const enabled = new Set();
|
|
231
|
-
for (const [index, candidate] of value.entries()) {
|
|
232
|
-
if (BUILTIN_TUI_IDS.includes(candidate)) enabled.add(candidate);
|
|
233
|
-
else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `tuis[${index}]` });
|
|
234
|
-
}
|
|
235
|
-
return Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, enabled.has(id)]));
|
|
236
|
-
};
|
|
237
|
-
const projectSandbox = (value) => {
|
|
238
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
239
|
-
return {
|
|
240
|
-
installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, true])),
|
|
241
|
-
clientSignals: new Set(),
|
|
242
|
-
remainingTools: Array.isArray(value) ? [] : undefined
|
|
243
|
-
};
|
|
244
|
-
}
|
|
245
|
-
const installed = new Set();
|
|
246
|
-
const remainingTools = [];
|
|
247
|
-
for (const [index, candidate] of value.entries()) {
|
|
248
|
-
if (BUILTIN_TUI_IDS.includes(candidate)) installed.add(candidate);
|
|
249
|
-
else if (typeof candidate === 'string') remainingTools.push(candidate);
|
|
250
|
-
else diagnostics.push({ code: 'LEGACY_VALUE_IGNORED', path: `sandbox.tools[${index}]` });
|
|
251
|
-
}
|
|
252
|
-
return {
|
|
253
|
-
installed: Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, installed.has(id)])),
|
|
254
|
-
clientSignals: installed,
|
|
255
|
-
remainingTools
|
|
256
|
-
};
|
|
257
|
-
};
|
|
258
|
-
const serialize = (state) => BUILTIN_TUI_IDS.map((id) => ({ id, ...state[id] }));
|
|
259
|
-
const hasCanonical = own(cfg, 'agentClients');
|
|
260
|
-
const hasLegacyTuis = own(cfg, 'tuis');
|
|
261
|
-
const sandbox = cfg.sandbox && typeof cfg.sandbox === 'object' && !Array.isArray(cfg.sandbox)
|
|
262
|
-
? cfg.sandbox
|
|
263
|
-
: undefined;
|
|
264
|
-
const hasSandboxTools = sandbox !== undefined && own(sandbox, 'tools');
|
|
265
|
-
const tuiProjection = projectTuis(cfg.tuis);
|
|
266
|
-
const sandboxProjection = projectSandbox(sandbox?.tools);
|
|
267
|
-
|
|
268
|
-
if (!hasCanonical) {
|
|
269
|
-
const state = Object.fromEntries(BUILTIN_TUI_IDS.map((id) => [id, {
|
|
270
|
-
enabled: tuiProjection[id],
|
|
271
|
-
installInSandbox: sandboxProjection.installed[id]
|
|
272
|
-
}]));
|
|
273
|
-
return {
|
|
274
|
-
source: 'legacy',
|
|
275
|
-
state,
|
|
276
|
-
canonical: serialize(state),
|
|
277
|
-
remainingSandboxTools: sandboxProjection.remainingTools,
|
|
278
|
-
removeLegacyTuis: hasLegacyTuis,
|
|
279
|
-
changed: true,
|
|
280
|
-
diagnostics,
|
|
281
|
-
error: null,
|
|
282
|
-
errorCode: null,
|
|
283
|
-
errorPath: null
|
|
284
|
-
};
|
|
285
|
-
}
|
|
286
|
-
|
|
247
|
+
const serialize = (state) => AGENT_CLIENT_IDS.map((id) => ({ id, ...state[id] }));
|
|
248
|
+
if (!own(cfg, 'agentClients')) return failure('MISSING_AGENT_CLIENT', 'agentClients');
|
|
287
249
|
if (!Array.isArray(cfg.agentClients)) return failure('INVALID_AGENT_CLIENTS', 'agentClients');
|
|
288
250
|
const entries = new Map();
|
|
289
251
|
for (const [index, candidate] of cfg.agentClients.entries()) {
|
|
@@ -301,7 +263,7 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
301
263
|
) {
|
|
302
264
|
return failure('INVALID_AGENT_CLIENTS', entryPath);
|
|
303
265
|
}
|
|
304
|
-
if (!
|
|
266
|
+
if (!AGENT_CLIENT_IDS.includes(candidate.id)) {
|
|
305
267
|
return failure('UNKNOWN_AGENT_CLIENT', `${entryPath}.id`);
|
|
306
268
|
}
|
|
307
269
|
if (entries.has(candidate.id)) return failure('DUPLICATE_AGENT_CLIENT', `${entryPath}.id`);
|
|
@@ -311,24 +273,44 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
311
273
|
let orchestration;
|
|
312
274
|
if (own(candidate, 'orchestration')) {
|
|
313
275
|
const policy = candidate.orchestration;
|
|
314
|
-
const exact = (value) => typeof value === 'string' && value.length > 0 && value.trim() === value;
|
|
315
|
-
const validRole = (role) => role
|
|
316
|
-
&& typeof role === 'object'
|
|
317
|
-
&& !Array.isArray(role)
|
|
318
|
-
&& Object.keys(role).length === 2
|
|
319
|
-
&& exact(role.model)
|
|
320
|
-
&& exact(role.reasoningEffort);
|
|
321
276
|
if (
|
|
322
277
|
!policy
|
|
323
278
|
|| typeof policy !== 'object'
|
|
324
279
|
|| Array.isArray(policy)
|
|
325
280
|
|| Object.keys(policy).length !== 2
|
|
326
|
-
|| !
|
|
327
|
-
|| !
|
|
281
|
+
|| !own(policy, 'executor')
|
|
282
|
+
|| !own(policy, 'reviewer')
|
|
328
283
|
) {
|
|
329
284
|
return failure('INVALID_AGENT_CLIENTS', `${entryPath}.orchestration`);
|
|
330
285
|
}
|
|
331
|
-
|
|
286
|
+
const parseExact = (value, path) => {
|
|
287
|
+
if (typeof value !== 'string' || value.length === 0 || value.trim() !== value) {
|
|
288
|
+
return failure('INVALID_AGENT_CLIENTS', path);
|
|
289
|
+
}
|
|
290
|
+
return value;
|
|
291
|
+
};
|
|
292
|
+
const parseRole = (role, rolePath) => {
|
|
293
|
+
if (
|
|
294
|
+
!role
|
|
295
|
+
|| typeof role !== 'object'
|
|
296
|
+
|| Array.isArray(role)
|
|
297
|
+
|| Object.keys(role).length !== 2
|
|
298
|
+
|| !own(role, 'model')
|
|
299
|
+
|| !own(role, 'reasoningEffort')
|
|
300
|
+
) {
|
|
301
|
+
return failure('INVALID_AGENT_CLIENTS', rolePath);
|
|
302
|
+
}
|
|
303
|
+
const model = parseExact(role.model, `${rolePath}.model`);
|
|
304
|
+
if (typeof model !== 'string') return model;
|
|
305
|
+
const reasoningEffort = parseExact(role.reasoningEffort, `${rolePath}.reasoningEffort`);
|
|
306
|
+
if (typeof reasoningEffort !== 'string') return reasoningEffort;
|
|
307
|
+
return { model, reasoningEffort };
|
|
308
|
+
};
|
|
309
|
+
const executor = parseRole(policy.executor, `${entryPath}.orchestration.executor`);
|
|
310
|
+
if (executor.errorCode) return executor;
|
|
311
|
+
const reviewer = parseRole(policy.reviewer, `${entryPath}.orchestration.reviewer`);
|
|
312
|
+
if (reviewer.errorCode) return reviewer;
|
|
313
|
+
orchestration = { executor, reviewer };
|
|
332
314
|
}
|
|
333
315
|
entries.set(candidate.id, {
|
|
334
316
|
enabled: candidate.enabled,
|
|
@@ -336,25 +318,29 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
336
318
|
...(orchestration ? { orchestration } : {})
|
|
337
319
|
});
|
|
338
320
|
}
|
|
339
|
-
if (
|
|
321
|
+
if (AGENT_CLIENT_IDS.some((id) => !entries.has(id))) {
|
|
340
322
|
return failure('MISSING_AGENT_CLIENT', 'agentClients');
|
|
341
323
|
}
|
|
342
|
-
const
|
|
343
|
-
|
|
344
|
-
|
|
324
|
+
for (const [index, id] of AGENT_CLIENT_IDS.entries()) {
|
|
325
|
+
if (cfg.agentClients[index]?.id !== id) {
|
|
326
|
+
return failure('INVALID_AGENT_CLIENTS', `agentClients[${index}].id`);
|
|
327
|
+
}
|
|
345
328
|
}
|
|
346
|
-
if (
|
|
347
|
-
|
|
329
|
+
if (own(cfg, 'tuis')) return failure('INVALID_AGENT_CLIENTS', 'tuis');
|
|
330
|
+
const sandbox = cfg.sandbox && typeof cfg.sandbox === 'object' && !Array.isArray(cfg.sandbox)
|
|
331
|
+
? cfg.sandbox
|
|
332
|
+
: undefined;
|
|
333
|
+
if (Array.isArray(sandbox?.tools)) {
|
|
334
|
+
for (const [index, tool] of sandbox.tools.entries()) {
|
|
335
|
+
if (AGENT_CLIENT_IDS.includes(tool)) {
|
|
336
|
+
return failure('INVALID_AGENT_CLIENTS', `sandbox.tools[${index}]`);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
348
339
|
}
|
|
349
|
-
const
|
|
340
|
+
const state = Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, entries.get(id)]));
|
|
350
341
|
return {
|
|
351
|
-
source: 'canonical',
|
|
352
342
|
state,
|
|
353
343
|
canonical: serialize(state),
|
|
354
|
-
remainingSandboxTools: hasSandboxTools ? sandboxProjection.remainingTools : undefined,
|
|
355
|
-
removeLegacyTuis: hasLegacyTuis,
|
|
356
|
-
changed: hasLegacyTuis || sandboxProjection.clientSignals.size > 0 || !sameOrder,
|
|
357
|
-
diagnostics,
|
|
358
344
|
error: null,
|
|
359
345
|
errorCode: null,
|
|
360
346
|
errorPath: null
|
|
@@ -363,16 +349,6 @@ function normalizeAgentClientConfig(cfg) {
|
|
|
363
349
|
|
|
364
350
|
function materializeAgentClientConfig(cfg, normalized) {
|
|
365
351
|
cfg.agentClients = normalized.canonical;
|
|
366
|
-
delete cfg.tuis;
|
|
367
|
-
if (normalized.remainingSandboxTools !== undefined) {
|
|
368
|
-
cfg.sandbox = {
|
|
369
|
-
...(cfg.sandbox || {}),
|
|
370
|
-
tools: [
|
|
371
|
-
'agent-infra',
|
|
372
|
-
...normalized.remainingSandboxTools.filter((tool) => tool !== 'agent-infra')
|
|
373
|
-
]
|
|
374
|
-
};
|
|
375
|
-
}
|
|
376
352
|
}
|
|
377
353
|
|
|
378
354
|
function assetMatches(entry, target) {
|
|
@@ -459,6 +435,17 @@ function isInsideProject(projectRoot, relativePath) {
|
|
|
459
435
|
return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
|
|
460
436
|
}
|
|
461
437
|
|
|
438
|
+
function isInsideProjectDirectory(projectRoot, directory, relativePath) {
|
|
439
|
+
if (!isInsideProject(projectRoot, directory) || !isInsideProject(projectRoot, relativePath)) {
|
|
440
|
+
return false;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
const root = path.resolve(projectRoot, directory);
|
|
444
|
+
const resolved = path.resolve(projectRoot, relativePath);
|
|
445
|
+
const rel = path.relative(root, resolved);
|
|
446
|
+
return rel !== '' && !rel.startsWith('..') && !path.isAbsolute(rel);
|
|
447
|
+
}
|
|
448
|
+
|
|
462
449
|
function isPathOwnedByOtherPlatform(relativePath, platformType) {
|
|
463
450
|
const normalized = norm(relativePath).replace(/^\.\//, '');
|
|
464
451
|
const top = normalized.split('/')[0];
|
|
@@ -1286,7 +1273,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1286
1273
|
return { error: enabledResolution.error };
|
|
1287
1274
|
}
|
|
1288
1275
|
const enabledTUIs = new Set(
|
|
1289
|
-
|
|
1276
|
+
AGENT_CLIENT_IDS.filter((id) => enabledResolution.state[id].enabled)
|
|
1290
1277
|
);
|
|
1291
1278
|
materializeAgentClientConfig(cfg, enabledResolution);
|
|
1292
1279
|
const customTUIsConfig = Array.isArray(cfg.customTUIs) ? cfg.customTUIs : [];
|
|
@@ -1306,6 +1293,10 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1306
1293
|
(descriptor.templateHashes || []).map(trustedBaseline).filter(Boolean)
|
|
1307
1294
|
)];
|
|
1308
1295
|
}));
|
|
1296
|
+
const retiredManagedForTarget = (target) => [...retiredManaged.entries()].find(
|
|
1297
|
+
([entry]) => assetMatches(entry, target)
|
|
1298
|
+
&& (!entry.endsWith('/') || isInsideProjectDirectory(projectRoot, entry, target))
|
|
1299
|
+
);
|
|
1309
1300
|
const planningRegistry = {
|
|
1310
1301
|
...currentRegistry,
|
|
1311
1302
|
managed: currentRegistry.managed.filter((entry) => !retiredManaged.has(norm(entry)))
|
|
@@ -1334,7 +1325,7 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1334
1325
|
for (const target of Object.keys(managedBaselines)) {
|
|
1335
1326
|
if (
|
|
1336
1327
|
!guardedManaged.has(norm(target))
|
|
1337
|
-
&& !
|
|
1328
|
+
&& !retiredManagedForTarget(target)
|
|
1338
1329
|
&& !allClientManaged.some((entry) => assetMatches(entry, target))
|
|
1339
1330
|
) {
|
|
1340
1331
|
delete managedBaselines[target];
|
|
@@ -1410,8 +1401,72 @@ function syncTemplates(projectRoot, templateRootOverride) {
|
|
|
1410
1401
|
);
|
|
1411
1402
|
|
|
1412
1403
|
for (const [entry, historicalTemplateHashes] of retiredManaged) {
|
|
1413
|
-
const target = path.join(projectRoot, entry);
|
|
1404
|
+
const target = path.join(projectRoot, entry.endsWith('/') ? entry.slice(0, -1) : entry);
|
|
1414
1405
|
const owned = currentRegistry.managed.some((candidate) => norm(candidate) === entry);
|
|
1406
|
+
if (entry.endsWith('/')) {
|
|
1407
|
+
if (fs.existsSync(target)) {
|
|
1408
|
+
const targetStat = fs.lstatSync(target);
|
|
1409
|
+
if (!targetStat.isDirectory() || targetStat.isSymbolicLink()) {
|
|
1410
|
+
report.managed.protected.push({
|
|
1411
|
+
target: entry,
|
|
1412
|
+
reason: 'invalid-type',
|
|
1413
|
+
baseline: null,
|
|
1414
|
+
local: null,
|
|
1415
|
+
template: null
|
|
1416
|
+
});
|
|
1417
|
+
continue;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
const candidates = new Set(
|
|
1421
|
+
Object.keys(managedBaselines).filter((candidate) =>
|
|
1422
|
+
assetMatches(entry, candidate)
|
|
1423
|
+
&& isInsideProjectDirectory(projectRoot, entry, candidate)
|
|
1424
|
+
)
|
|
1425
|
+
);
|
|
1426
|
+
if (owned && fs.existsSync(target)) {
|
|
1427
|
+
for (const filePath of walkDir(target)) {
|
|
1428
|
+
candidates.add(norm(path.relative(projectRoot, filePath)));
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
for (const candidate of candidates) {
|
|
1433
|
+
const candidatePath = path.join(projectRoot, candidate);
|
|
1434
|
+
const baseline = trustedBaseline(managedBaselines[candidate]);
|
|
1435
|
+
if (!fs.existsSync(candidatePath)) {
|
|
1436
|
+
if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
|
|
1437
|
+
delete managedBaselines[candidate];
|
|
1438
|
+
baselinesChanged = true;
|
|
1439
|
+
}
|
|
1440
|
+
continue;
|
|
1441
|
+
}
|
|
1442
|
+
const stat = fs.lstatSync(candidatePath);
|
|
1443
|
+
const localHash = stat.isFile() && !stat.isSymbolicLink()
|
|
1444
|
+
? sha256(fs.readFileSync(candidatePath))
|
|
1445
|
+
: null;
|
|
1446
|
+
const safeToRemove = localHash !== null
|
|
1447
|
+
&& (localHash === baseline || historicalTemplateHashes.has(localHash));
|
|
1448
|
+
if (safeToRemove) {
|
|
1449
|
+
fs.unlinkSync(candidatePath);
|
|
1450
|
+
report.managed.removed.push(candidate);
|
|
1451
|
+
} else {
|
|
1452
|
+
report.managed.protected.push({
|
|
1453
|
+
target: candidate,
|
|
1454
|
+
reason: localHash === null
|
|
1455
|
+
? 'invalid-type'
|
|
1456
|
+
: (baseline !== null ? 'user-modified' : 'unknown-origin'),
|
|
1457
|
+
baseline,
|
|
1458
|
+
local: localHash,
|
|
1459
|
+
template: null
|
|
1460
|
+
});
|
|
1461
|
+
}
|
|
1462
|
+
if (Object.prototype.hasOwnProperty.call(managedBaselines, candidate)) {
|
|
1463
|
+
delete managedBaselines[candidate];
|
|
1464
|
+
baselinesChanged = true;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
1467
|
+
removeEmptyDirs(target);
|
|
1468
|
+
continue;
|
|
1469
|
+
}
|
|
1415
1470
|
if (!fs.existsSync(target)) continue;
|
|
1416
1471
|
const stat = fs.lstatSync(target);
|
|
1417
1472
|
const baseline = trustedBaseline(managedBaselines[entry]);
|
|
@@ -21,7 +21,7 @@ Version stamp rule: before creating or updating `task.md` frontmatter, read `.ag
|
|
|
21
21
|
|
|
22
22
|
## Task Context Resolution
|
|
23
23
|
|
|
24
|
-
> Keep `--pr <number>` and PR URLs on the existing PR-anchored path. Otherwise, the task path may omit the task ref
|
|
24
|
+
> Keep `--pr <number>` and PR URLs on the existing PR-anchored path. Otherwise, the task path may omit the task ref; explicit task scope accepts only `--task <ref>` or `-t <ref>`, and positional task refs are not interpreted. Separate task scope from the full arguments, then call `agent-infra-internal task-context resolve {task-scope}` and bind `{task-id}` to the returned full `taskId`. A PR anchor and task scope are mutually exclusive.
|
|
25
25
|
|
|
26
26
|
## Step Start: Write the started Marker
|
|
27
27
|
|
|
@@ -40,7 +40,7 @@ After prerequisites pass and before this round's first artifact action, append a
|
|
|
40
40
|
Resolve the target PR number `{pr#}` and an optional `{task-id}` via these deterministic branches:
|
|
41
41
|
|
|
42
42
|
- Scenario A (argument omitted): reverse-lookup the active task from the current branch, then read its `pr_number`.
|
|
43
|
-
- Scenario B (omitted task ref
|
|
43
|
+
- Scenario B (omitted task ref or `--task/-t`, **task-anchored primary path**): resolve the full `{task-id}` via "Task Context Resolution" and read `.agents/workspace/active/{task-id}/task.md` for `pr_number` as `{pr#}`; if `pr_number` is empty, follow "Error Handling" to prompt running `create-pr` first, then stop.
|
|
44
44
|
- Scenario C (`--pr <number>` or a PR URL): use that PR number directly as `{pr#}`; then determine `{task-id}` via "Reverse-lookup task".
|
|
45
45
|
- Reverse-lookup task (scenarios A / C): use task context/query capabilities to find the unique active task bound to `{pr#}`. If none exists, stop and request binding first; the typed checks intent does not create a second taskless state machine.
|
|
46
46
|
|
|
@@ -21,7 +21,7 @@ description: >
|
|
|
21
21
|
|
|
22
22
|
## 任务上下文解析
|
|
23
23
|
|
|
24
|
-
> 入口允许省略 task ref
|
|
24
|
+
> 入口允许省略 task ref,也接受 `--task <ref>` / `-t <ref>`。先从完整参数中分离 task scope 并原样保留其他业务操作数,再调用 `agent-infra-internal task-context resolve {task-scope}`;`{task-scope}` 为空或 task flag 之一。只读取结构化结果的 `taskId`,后续把 `{task-id}` 绑定为该完整 `TASK-YYYYMMDD-HHMMSS`。解析失败时透传非零退出码,不自行扫描任务。
|
|
25
25
|
|
|
26
26
|
## 步骤开始:写入 started 标记
|
|
27
27
|
|
|
@@ -40,7 +40,7 @@ description: >
|
|
|
40
40
|
按以下确定性分支解析出目标 PR 号 `{pr#}` 与可选 `{task-id}`:
|
|
41
41
|
|
|
42
42
|
- 场景 A(省略入参):从当前分支反查 active task;定位后读取其 `pr_number`。
|
|
43
|
-
- 场景 B(省略 task ref
|
|
43
|
+
- 场景 B(省略 task ref 或 `--task/-t`,**任务锚定主路径**):按「任务上下文解析」取得完整 `{task-id}`。读 `.agents/workspace/active/{task-id}/task.md` 取 `pr_number` 作为 `{pr#}`;`pr_number` 为空时按「错误处理」提示先 `create-pr`,停止。
|
|
44
44
|
- 场景 C(`--pr <number>` 或 PR URL):直接取该 PR 号为 `{pr#}`;随后按「反查任务」确定 `{task-id}`。
|
|
45
45
|
- 反查任务(场景 A / C):通过任务上下文/任务查询取得与 `{pr#}` 唯一绑定的 active task。未命中时停止并提示先绑定 PR;typed checks intent 不建立第二套无任务状态机。
|
|
46
46
|
|
|
@@ -80,7 +80,7 @@ pr_status: pending # PR status: pending (default) | created (PR crea
|
|
|
80
80
|
|
|
81
81
|
## Human Rulings
|
|
82
82
|
|
|
83
|
-
<!-- Use ai decide <
|
|
83
|
+
<!-- Use ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) [--needs-implementation true|false] <decision> for needs-human-decision rulings; upstream AI predeclares implementation intent for new code decisions, while the explicit option remains for legacy tasks or consistency checks. -->
|
|
84
84
|
|
|
85
85
|
## Implementation Inputs
|
|
86
86
|
|
|
@@ -80,7 +80,7 @@ pr_status: pending # PR 状态:pending(默认)| created(已
|
|
|
80
80
|
|
|
81
81
|
## 人工裁决
|
|
82
82
|
|
|
83
|
-
<!-- 使用 ai decide <
|
|
83
|
+
<!-- 使用 ai decide [--task <ref> | -t <ref>] (--item <序号|账本ID> | -i <序号|账本ID>) [--needs-implementation true|false] <裁决内容> 写入 needs-human-decision 裁定;新建 code 裁决的实现意图由上游 AI 预先声明,显式参数仅用于历史任务兼容或一致性复核。 -->
|
|
84
84
|
|
|
85
85
|
## 实现输入
|
|
86
86
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Analyze a task and produce a requirements document"
|
|
3
|
-
usage: "/analyze-task [task
|
|
3
|
+
usage: "/analyze-task [--task <ref> | -t <ref>]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Read and execute the analyze-task skill from `.agents/skills/analyze-task/SKILL.md`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Mark PR manual validation as completed and update the summary comment"
|
|
3
|
-
usage: "/complete-manual-validation [task
|
|
3
|
+
usage: "/complete-manual-validation [--task <ref> | -t <ref>] [pr-ref] <verification-summary>"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "标记 PR 人工验证已完成并更新摘要评论"
|
|
3
|
-
usage: "/complete-manual-validation [task
|
|
3
|
+
usage: "/complete-manual-validation [--task <ref> | -t <ref>] [pr-ref] <verification-summary>"
|
|
4
4
|
disable-model-invocation: true
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Mark a task as completed and archive it"
|
|
3
|
-
usage: "/complete-task [task
|
|
3
|
+
usage: "/complete-task [--task <ref> | -t <ref>] [--skip-pr] [--force]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Read and execute the complete-task skill from `.agents/skills/complete-task/SKILL.md`.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
description: "Create a Pull Request to a target branch"
|
|
3
|
-
usage: "/create-pr [task
|
|
3
|
+
usage: "/create-pr [--task <ref> | -t <ref>] [target-branch]"
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
Read and execute the create-pr skill from `.agents/skills/create-pr/SKILL.md`.
|