@fitlab-ai/agent-infra 0.9.10 → 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 +50 -4
- package/dist/lib/agent-client.js +0 -1
- package/dist/lib/agent-clients/adapters/opencode-sandbox.js +0 -4
- package/dist/lib/agent-clients/adapters/traecli.js +7 -8
- package/dist/lib/agent-clients/config.js +14 -99
- package/dist/lib/agent-clients/reconcile.js +1 -11
- package/dist/lib/agent-clients/schema.js +5 -4
- package/dist/lib/agent-clients/tokens.js +5 -15
- package/dist/lib/decide.js +14 -30
- package/dist/lib/defaults.json +4 -0
- package/dist/lib/init.js +2 -2
- package/dist/lib/internal/release-workflow.js +0 -1
- package/dist/lib/internal/task-finalization.js +19 -9
- package/dist/lib/internal/task-ledger.js +8 -2
- package/dist/lib/internal/task-lifecycle.js +17 -93
- package/dist/lib/internal/task-orchestration.js +30 -216
- package/dist/lib/internal/task-validate.js +2 -1
- package/dist/lib/merge.js +205 -103
- package/dist/lib/process-data/normalize.js +2 -9
- package/dist/lib/run/host.js +46 -16
- package/dist/lib/sandbox/agent-client-reconciler.js +4 -12
- package/dist/lib/sandbox/commands/create.js +3 -3
- package/dist/lib/sandbox/commands/enter.js +18 -4
- package/dist/lib/sandbox/config.js +3 -12
- package/dist/lib/sandbox/control/executor.js +131 -39
- 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 +1 -1
- package/dist/lib/task/command-options.js +1 -3
- package/dist/lib/task/commands/cat.js +0 -5
- package/dist/lib/task/commands/decisions.js +76 -92
- package/dist/lib/task/commands/files.js +6 -6
- package/dist/lib/task/commands/grep.js +25 -61
- package/dist/lib/task/commands/issue-body.js +6 -6
- package/dist/lib/task/commands/log.js +25 -10
- package/dist/lib/task/commands/show.js +5 -6
- package/dist/lib/task/commands/status.js +8 -8
- package/dist/lib/task/commit-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/events.js +11 -5
- package/dist/lib/task/index.js +19 -20
- package/dist/lib/task/ledger-intents.js +8 -9
- package/dist/lib/task/ledger.js +13 -6
- package/dist/lib/task/lifecycle.js +16 -0
- package/dist/lib/task/orchestration.js +50 -13
- 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 -15
- 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/opencode-sandbox.ts +0 -5
- package/lib/agent-clients/adapters/traecli.ts +7 -8
- package/lib/agent-clients/config.ts +14 -144
- package/lib/agent-clients/reconcile.ts +1 -12
- package/lib/agent-clients/schema.ts +5 -4
- package/lib/agent-clients/tokens.ts +5 -18
- package/lib/decide.ts +12 -22
- package/lib/defaults.json +4 -0
- package/lib/init.ts +2 -2
- package/lib/internal/release-workflow.ts +0 -1
- package/lib/internal/task-finalization.ts +27 -13
- package/lib/internal/task-ledger.ts +8 -2
- package/lib/internal/task-lifecycle.ts +33 -76
- package/lib/internal/task-orchestration.ts +33 -190
- package/lib/internal/task-validate.ts +3 -2
- package/lib/merge.ts +236 -120
- package/lib/process-data/normalize.ts +2 -8
- package/lib/run/host.ts +63 -14
- package/lib/sandbox/agent-client-reconciler.ts +5 -15
- package/lib/sandbox/commands/create.ts +4 -4
- package/lib/sandbox/commands/enter.ts +24 -4
- package/lib/sandbox/config.ts +2 -14
- package/lib/sandbox/control/container-identity.ts +2 -2
- package/lib/sandbox/control/executor.ts +148 -51
- 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 +2 -1
- package/lib/task/command-options.ts +1 -2
- package/lib/task/commands/cat.ts +0 -4
- package/lib/task/commands/decisions.ts +80 -75
- package/lib/task/commands/files.ts +6 -6
- package/lib/task/commands/grep.ts +23 -51
- package/lib/task/commands/issue-body.ts +6 -6
- package/lib/task/commands/log.ts +22 -10
- package/lib/task/commands/show.ts +5 -6
- package/lib/task/commands/status.ts +8 -8
- package/lib/task/commit-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/events.ts +10 -5
- package/lib/task/index.ts +19 -20
- package/lib/task/ledger-intents.ts +6 -8
- package/lib/task/ledger.ts +17 -7
- package/lib/task/lifecycle.ts +20 -0
- package/lib/task/orchestration.ts +40 -15
- package/lib/task/review-artifacts.ts +53 -15
- package/lib/task/review-finalization.ts +33 -7
- package/lib/task/verification-engine.ts +33 -18
- 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/README.en.md +5 -3
- package/templates/.agents/README.zh-CN.md +5 -3
- package/templates/.agents/rules/compatibility-policy.en.md +5 -4
- package/templates/.agents/rules/compatibility-policy.zh-CN.md +5 -4
- package/templates/.agents/rules/create-issue.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/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 +1 -1
- package/templates/.agents/rules/pr-sync.github.en.md +1 -1
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +1 -1
- package/templates/.agents/rules/pr-sync.zh-CN.md +1 -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/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 +3 -3
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +3 -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 +3 -3
- package/templates/.agents/skills/code-task/SKILL.zh-CN.md +3 -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 +5 -7
- package/templates/.agents/skills/create-pr/SKILL.zh-CN.md +5 -7
- package/templates/.agents/skills/create-pr/reference/change-report.en.md +9 -4
- package/templates/.agents/skills/create-pr/reference/change-report.zh-CN.md +9 -4
- package/templates/.agents/skills/create-pr/scripts/change-report.mjs +203 -0
- package/templates/.agents/skills/create-release-note/SKILL.en.md +5 -6
- package/templates/.agents/skills/create-release-note/SKILL.zh-CN.md +5 -6
- package/templates/.agents/skills/create-task/SKILL.en.md +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 +3 -3
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +3 -3
- package/templates/.agents/skills/restore-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/restore-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/review-analysis/SKILL.en.md +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 +2 -1
- package/templates/.agents/skills/review-code/reference/migration-risks.zh-CN.md +2 -1
- 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 +4 -0
- package/templates/.agents/skills/run-manual-validation/SKILL.zh-CN.md +4 -0
- package/templates/.agents/skills/run-task/SKILL.en.md +4 -0
- package/templates/.agents/skills/run-task/SKILL.zh-CN.md +4 -0
- 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 +140 -109
- 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/{.trae/skills → .traecli/commands}/update-agent-infra.en.md +0 -1
- package/templates/{.trae/skills → .traecli/commands}/update-agent-infra.zh-CN.md +0 -1
- package/dist/lib/builtin-tuis.js +0 -40
- package/lib/builtin-tuis.ts +0 -56
package/README.md
CHANGED
|
@@ -121,6 +121,15 @@ brew install fitlab-ai/tap/agent-infra
|
|
|
121
121
|
|
|
122
122
|
### Updating agent-infra
|
|
123
123
|
|
|
124
|
+
```bash
|
|
125
|
+
ai update
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
`ai update` updates the installed agent-infra CLI. In an initialized project,
|
|
129
|
+
use `ai sync` to refresh project seed files and the file registry.
|
|
130
|
+
|
|
131
|
+
The equivalent package-manager commands remain:
|
|
132
|
+
|
|
124
133
|
```bash
|
|
125
134
|
npm update -g @fitlab-ai/agent-infra
|
|
126
135
|
# or, if installed via Homebrew:
|
|
@@ -142,7 +151,7 @@ ai init
|
|
|
142
151
|
# or: agent-infra init
|
|
143
152
|
```
|
|
144
153
|
|
|
145
|
-
The CLI collects project metadata, lets you select the enabled Agent Clients, installs
|
|
154
|
+
The CLI collects project metadata, lets you select the enabled Agent Clients, installs any client-specific `update-agent-infra` seed commands, and generates `.agents/.airc.json`.
|
|
146
155
|
|
|
147
156
|
> `ai` is a shorthand for `agent-infra`. Both commands are equivalent.
|
|
148
157
|
|
|
@@ -156,12 +165,13 @@ Open the project in any AI TUI and run `update-agent-infra`:
|
|
|
156
165
|
| Codex | `$update-agent-infra` |
|
|
157
166
|
| Antigravity CLI | `/update-agent-infra` |
|
|
158
167
|
| OpenCode | `/update-agent-infra` |
|
|
168
|
+
| TraeCode CLI | `/update-agent-infra` |
|
|
159
169
|
|
|
160
170
|
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.
|
|
161
171
|
|
|
162
172
|
## Core Commands
|
|
163
173
|
|
|
164
|
-
Manage the
|
|
174
|
+
Manage the five built-in Agent Clients independently from the project lifecycle:
|
|
165
175
|
|
|
166
176
|
```bash
|
|
167
177
|
ai agent-client list
|
|
@@ -171,7 +181,7 @@ ai agent-client disable antigravity-cli
|
|
|
171
181
|
ai agent-client configure
|
|
172
182
|
```
|
|
173
183
|
|
|
174
|
-
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.
|
|
184
|
+
The most-used lifecycle commands, in delivery order. The command prefix varies by TUI (`/skill` in Claude Code/Antigravity/OpenCode/TraeCode and `$skill` in Codex); the workflow semantics stay the same.
|
|
175
185
|
|
|
176
186
|
| Command | Purpose |
|
|
177
187
|
|---------|---------|
|
package/README.zh-CN.md
CHANGED
|
@@ -120,6 +120,15 @@ brew install fitlab-ai/tap/agent-infra
|
|
|
120
120
|
|
|
121
121
|
### 更新 agent-infra
|
|
122
122
|
|
|
123
|
+
```bash
|
|
124
|
+
ai update
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
`ai update` 用于更新已安装的 agent-infra CLI。在已初始化项目中,使用
|
|
128
|
+
`ai sync` 刷新项目 seed files 和文件注册表。
|
|
129
|
+
|
|
130
|
+
对应的包管理器命令仍然是:
|
|
131
|
+
|
|
123
132
|
```bash
|
|
124
133
|
npm update -g @fitlab-ai/agent-infra
|
|
125
134
|
# 或者通过 Homebrew 安装时:
|
|
@@ -141,7 +150,7 @@ ai init
|
|
|
141
150
|
# 或:agent-infra init
|
|
142
151
|
```
|
|
143
152
|
|
|
144
|
-
CLI 会收集项目元数据,让你选择启用的 Agent Client
|
|
153
|
+
CLI 会收集项目元数据,让你选择启用的 Agent Client,安装该客户端需要的 `update-agent-infra` 种子命令,并生成 `.agents/.airc.json`。
|
|
145
154
|
|
|
146
155
|
> `ai` 是 `agent-infra` 的简写命令,两者等价。
|
|
147
156
|
|
|
@@ -155,12 +164,13 @@ CLI 会收集项目元数据,让你选择启用的 Agent Client,为其安装
|
|
|
155
164
|
| Codex | `$update-agent-infra` |
|
|
156
165
|
| Antigravity CLI | `/update-agent-infra` |
|
|
157
166
|
| OpenCode | `/update-agent-infra` |
|
|
167
|
+
| TraeCode CLI | `/update-agent-infra` |
|
|
158
168
|
|
|
159
169
|
该命令会检测当前打包模板版本并渲染所有受管理文件。首次安装和后续升级都使用同一条命令。
|
|
160
170
|
|
|
161
171
|
## 核心命令
|
|
162
172
|
|
|
163
|
-
|
|
173
|
+
以下命令用于独立管理五个内建 Agent Client:
|
|
164
174
|
|
|
165
175
|
```bash
|
|
166
176
|
ai agent-client list
|
|
@@ -170,7 +180,7 @@ ai agent-client disable antigravity-cli
|
|
|
170
180
|
ai agent-client configure
|
|
171
181
|
```
|
|
172
182
|
|
|
173
|
-
最常用的生命周期命令,按交付顺序排列。命令前缀因 TUI 而异(Claude Code/Antigravity/OpenCode 用 `/skill`,Codex 用 `$skill`),工作流语义保持一致。
|
|
183
|
+
最常用的生命周期命令,按交付顺序排列。命令前缀因 TUI 而异(Claude Code/Antigravity/OpenCode/TraeCode 用 `/skill`,Codex 用 `$skill`),工作流语义保持一致。
|
|
174
184
|
|
|
175
185
|
| 命令 | 用途 |
|
|
176
186
|
|------|------|
|
package/bin/cli.ts
CHANGED
|
@@ -21,12 +21,13 @@ Commands:
|
|
|
21
21
|
decide Record a ruling; code-stage decisions require explicit implementation intent
|
|
22
22
|
help Show this help message
|
|
23
23
|
init Initialize a new project with update-agent-infra seed command
|
|
24
|
-
merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
24
|
+
merge Merge tasks from another current workspace directory (active/blocked/completed/archive)
|
|
25
25
|
run Schedule a lifecycle skill in the task sandbox tmux session
|
|
26
26
|
sandbox, s Manage Docker-based AI sandboxes
|
|
27
27
|
server Run the local AI collaboration daemon (start/stop/status/logs)
|
|
28
28
|
task, t Read-only views of .agents/workspace tasks
|
|
29
|
-
|
|
29
|
+
sync Update seed files and sync file registry for an existing project
|
|
30
|
+
update Update the agent-infra CLI itself
|
|
30
31
|
version Show version
|
|
31
32
|
|
|
32
33
|
'ai' and 'agent-infra' are interchangeable; 'ai' is the shorter form.
|
|
@@ -171,10 +172,22 @@ switch (command) {
|
|
|
171
172
|
break;
|
|
172
173
|
}
|
|
173
174
|
case 'update': {
|
|
174
|
-
const imported = await importCommand('../lib/update.ts');
|
|
175
|
+
const imported = await importCommand('../lib/self-update.ts');
|
|
175
176
|
if (!imported) break;
|
|
176
177
|
const { cmdUpdate } = imported;
|
|
177
|
-
await cmdUpdate().catch((e: unknown) => {
|
|
178
|
+
const code = await cmdUpdate().catch((e: unknown) => {
|
|
179
|
+
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
180
|
+
process.exitCode = 1;
|
|
181
|
+
return 1;
|
|
182
|
+
});
|
|
183
|
+
if (code !== 0) process.exitCode = code;
|
|
184
|
+
break;
|
|
185
|
+
}
|
|
186
|
+
case 'sync': {
|
|
187
|
+
const imported = await importCommand('../lib/update.ts');
|
|
188
|
+
if (!imported) break;
|
|
189
|
+
const { cmdSync } = imported;
|
|
190
|
+
await cmdSync().catch((e: unknown) => {
|
|
178
191
|
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
179
192
|
process.exitCode = 1;
|
|
180
193
|
});
|
package/dist/bin/cli.js
CHANGED
|
@@ -25,12 +25,13 @@ Commands:
|
|
|
25
25
|
decide Record a ruling; code-stage decisions require explicit implementation intent
|
|
26
26
|
help Show this help message
|
|
27
27
|
init Initialize a new project with update-agent-infra seed command
|
|
28
|
-
merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
28
|
+
merge Merge tasks from another current workspace directory (active/blocked/completed/archive)
|
|
29
29
|
run Schedule a lifecycle skill in the task sandbox tmux session
|
|
30
30
|
sandbox, s Manage Docker-based AI sandboxes
|
|
31
31
|
server Run the local AI collaboration daemon (start/stop/status/logs)
|
|
32
32
|
task, t Read-only views of .agents/workspace tasks
|
|
33
|
-
|
|
33
|
+
sync Update seed files and sync file registry for an existing project
|
|
34
|
+
update Update the agent-infra CLI itself
|
|
34
35
|
version Show version
|
|
35
36
|
|
|
36
37
|
'ai' and 'agent-infra' are interchangeable; 'ai' is the shorter form.
|
|
@@ -182,11 +183,25 @@ switch (command) {
|
|
|
182
183
|
break;
|
|
183
184
|
}
|
|
184
185
|
case 'update': {
|
|
185
|
-
const imported = await importCommand('../lib/update.ts');
|
|
186
|
+
const imported = await importCommand('../lib/self-update.ts');
|
|
186
187
|
if (!imported)
|
|
187
188
|
break;
|
|
188
189
|
const { cmdUpdate } = imported;
|
|
189
|
-
await cmdUpdate().catch((e) => {
|
|
190
|
+
const code = await cmdUpdate().catch((e) => {
|
|
191
|
+
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
192
|
+
process.exitCode = 1;
|
|
193
|
+
return 1;
|
|
194
|
+
});
|
|
195
|
+
if (code !== 0)
|
|
196
|
+
process.exitCode = code;
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
case 'sync': {
|
|
200
|
+
const imported = await importCommand('../lib/update.ts');
|
|
201
|
+
if (!imported)
|
|
202
|
+
break;
|
|
203
|
+
const { cmdSync } = imported;
|
|
204
|
+
await cmdSync().catch((e) => {
|
|
190
205
|
process.stderr.write(`Error: ${errorMessage(e)}\n`);
|
|
191
206
|
process.exitCode = 1;
|
|
192
207
|
});
|
package/dist/bin/internal-cli.js
CHANGED
|
@@ -5,10 +5,56 @@ if (major < 22 || (major === 22 && minor < 9)) {
|
|
|
5
5
|
process.exit(1);
|
|
6
6
|
}
|
|
7
7
|
const command = process.argv[2] || '';
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
const taskControlCommand = command === 'task-lifecycle' || command === 'task-orchestration' || command === 'task-finalization';
|
|
9
|
+
function taskControlTransportFailure(message) {
|
|
10
|
+
process.stdout.write(`${JSON.stringify({
|
|
11
|
+
status: 'failed', changed: false,
|
|
12
|
+
error: { code: 'TASK_CONTROL_TRANSPORT_INVALID', message }
|
|
13
|
+
})}\n`);
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
if (taskControlCommand) {
|
|
17
|
+
const env = process.env;
|
|
18
|
+
const executorMarked = Boolean(env.AGENT_INFRA_EXECUTOR_MANIFEST);
|
|
19
|
+
const controlKeys = [
|
|
20
|
+
'AGENT_INFRA_CONTROL_TOKEN', 'AGENT_INFRA_CONTROL_GENERATION',
|
|
21
|
+
'AGENT_INFRA_CONTROL_DIR', 'AGENT_INFRA_CONTROL_STATUS_DIR'
|
|
22
|
+
];
|
|
23
|
+
const hasControlMarker = controlKeys.some((key) => Boolean(env[key]))
|
|
24
|
+
|| Boolean(env.AGENT_INFRA_CONTROL_CONTROLLER_BINDING);
|
|
25
|
+
const taskBindingMarker = hasControlMarker && Boolean(env.AGENT_INFRA_TASK_ID);
|
|
26
|
+
const hasCompleteClientConfig = controlKeys.every((key) => Boolean(env[key]))
|
|
27
|
+
&& !env.AGENT_INFRA_CONTROL_CONTROLLER_BINDING
|
|
28
|
+
&& (!taskBindingMarker || Boolean(env.AGENT_INFRA_RUNTIME_DIR));
|
|
29
|
+
if (executorMarked) {
|
|
30
|
+
taskControlTransportFailure('executor context is only valid for sandbox-control execute');
|
|
31
|
+
}
|
|
32
|
+
if ((hasControlMarker || taskBindingMarker) && !hasCompleteClientConfig) {
|
|
33
|
+
taskControlTransportFailure('sandbox client control configuration is incomplete or conflicting');
|
|
34
|
+
}
|
|
35
|
+
if (hasCompleteClientConfig) {
|
|
36
|
+
const { sandboxControl } = await import('../lib/internal/sandbox-control.js');
|
|
37
|
+
await sandboxControl(['client', command, ...process.argv.slice(3)]);
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
switch (command) {
|
|
41
|
+
case 'task-orchestration': {
|
|
42
|
+
const { taskOrchestration } = await import('../lib/internal/task-orchestration.js');
|
|
43
|
+
await taskOrchestration(process.argv.slice(3));
|
|
44
|
+
break;
|
|
45
|
+
}
|
|
46
|
+
case 'task-lifecycle': {
|
|
47
|
+
const { taskLifecycle } = await import('../lib/internal/task-lifecycle.js');
|
|
48
|
+
taskLifecycle(process.argv.slice(3));
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
case 'task-finalization': {
|
|
52
|
+
const { taskFinalization } = await import('../lib/internal/task-finalization.js');
|
|
53
|
+
taskFinalization(process.argv.slice(3));
|
|
54
|
+
break;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
12
58
|
}
|
|
13
59
|
else
|
|
14
60
|
switch (command) {
|
package/dist/lib/agent-client.js
CHANGED
|
@@ -96,7 +96,6 @@ async function cmdAgentClient(args) {
|
|
|
96
96
|
throw new AgentClientCommandError('AGENT_CLIENT_ARGUMENT_INVALID', 'status accepts no arguments');
|
|
97
97
|
}
|
|
98
98
|
const plan = workflowPlan(projectRoot, config, { type: 'none' });
|
|
99
|
-
process.stdout.write(`source: ${plan.source}\n`);
|
|
100
99
|
printState(plan.desired);
|
|
101
100
|
for (const seed of plan.seedOperations) {
|
|
102
101
|
process.stdout.write(` seed ${seed.target}: ${seed.kind}\n`);
|
|
@@ -20,12 +20,8 @@ function ensureOpenCodeSandboxState(toolDir, hostHome, hostEnv = {}) {
|
|
|
20
20
|
const canonicalConfigDir = path.join(toolDir, '.xdg', 'config', 'opencode');
|
|
21
21
|
const canonicalStateDir = path.join(toolDir, '.xdg', 'state', 'opencode');
|
|
22
22
|
const canonicalConfigPath = path.join(canonicalConfigDir, 'opencode.json');
|
|
23
|
-
const legacyConfigPath = path.join(toolDir, 'opencode.json');
|
|
24
23
|
fs.mkdirSync(canonicalConfigDir, { recursive: true });
|
|
25
24
|
fs.mkdirSync(canonicalStateDir, { recursive: true });
|
|
26
|
-
if (!fs.existsSync(canonicalConfigPath) && fs.existsSync(legacyConfigPath)) {
|
|
27
|
-
fs.copyFileSync(legacyConfigPath, canonicalConfigPath, fs.constants.COPYFILE_EXCL);
|
|
28
|
-
}
|
|
29
25
|
const hostConfigRoot = resolveXdgRoot(hostEnv.XDG_CONFIG_HOME, path.join(hostHome, '.config'));
|
|
30
26
|
const hostConfig = readJsonObject(path.join(hostConfigRoot, 'opencode', 'opencode.json'));
|
|
31
27
|
if (!hostConfig) {
|
|
@@ -24,22 +24,21 @@ const traecliAdapter = defineAgentClientAdapter({
|
|
|
24
24
|
actualReasoningEffort: 'unavailable'
|
|
25
25
|
},
|
|
26
26
|
project: {
|
|
27
|
-
ownedPathPrefixes: ['.
|
|
28
|
-
managed: ['.
|
|
27
|
+
ownedPathPrefixes: ['.traecli/'],
|
|
28
|
+
managed: ['.traecli/commands/'],
|
|
29
29
|
merged: [],
|
|
30
30
|
ejected: [],
|
|
31
31
|
seedCommands: [{
|
|
32
32
|
templates: {
|
|
33
|
-
en: '.
|
|
34
|
-
'zh-CN': '.
|
|
33
|
+
en: '.traecli/commands/update-agent-infra.en.md',
|
|
34
|
+
'zh-CN': '.traecli/commands/update-agent-infra.zh-CN.md'
|
|
35
35
|
},
|
|
36
|
-
target: '.
|
|
36
|
+
target: '.traecli/commands/update-agent-infra.md'
|
|
37
37
|
}],
|
|
38
38
|
customCommand: {
|
|
39
|
-
target: '.
|
|
39
|
+
target: '.traecli/commands/${skillName}.md',
|
|
40
40
|
frontmatter: {},
|
|
41
|
-
|
|
42
|
-
inheritDisableModelInvocation: true
|
|
41
|
+
argumentsToken: '$ARGUMENTS'
|
|
43
42
|
}
|
|
44
43
|
},
|
|
45
44
|
sandbox: {
|
|
@@ -101,114 +101,29 @@ function serializeAgentClients(state) {
|
|
|
101
101
|
: {})
|
|
102
102
|
}));
|
|
103
103
|
}
|
|
104
|
-
function projectLegacyTuis(value, diagnostics) {
|
|
105
|
-
if (!Array.isArray(value)) {
|
|
106
|
-
return Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, true]));
|
|
107
|
-
}
|
|
108
|
-
const enabled = new Set();
|
|
109
|
-
for (const [index, candidate] of value.entries()) {
|
|
110
|
-
if (isAgentClientId(candidate)) {
|
|
111
|
-
enabled.add(candidate);
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
diagnostics.push({
|
|
115
|
-
code: 'LEGACY_VALUE_IGNORED',
|
|
116
|
-
path: `tuis[${index}]`
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
return Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, enabled.has(id)]));
|
|
121
|
-
}
|
|
122
|
-
function projectLegacySandbox(value, diagnostics) {
|
|
123
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
124
|
-
return {
|
|
125
|
-
installed: Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, true])),
|
|
126
|
-
clientSignals: new Set(),
|
|
127
|
-
remainingTools: Array.isArray(value) ? [] : undefined
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
const installed = new Set();
|
|
131
|
-
const remainingTools = [];
|
|
132
|
-
for (const [index, candidate] of value.entries()) {
|
|
133
|
-
if (isAgentClientId(candidate)) {
|
|
134
|
-
installed.add(candidate);
|
|
135
|
-
}
|
|
136
|
-
else if (typeof candidate === 'string') {
|
|
137
|
-
remainingTools.push(candidate);
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
diagnostics.push({
|
|
141
|
-
code: 'LEGACY_VALUE_IGNORED',
|
|
142
|
-
path: `sandbox.tools[${index}]`
|
|
143
|
-
});
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
return {
|
|
147
|
-
installed: Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [id, installed.has(id)])),
|
|
148
|
-
clientSignals: installed,
|
|
149
|
-
remainingTools
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function stateFromLegacy(enabled, installed) {
|
|
153
|
-
return Object.fromEntries(AGENT_CLIENT_IDS.map((id) => [
|
|
154
|
-
id,
|
|
155
|
-
{
|
|
156
|
-
enabled: enabled[id],
|
|
157
|
-
installInSandbox: installed[id]
|
|
158
|
-
}
|
|
159
|
-
]));
|
|
160
|
-
}
|
|
161
|
-
function sameCanonicalOrder(value) {
|
|
162
|
-
return Array.isArray(value)
|
|
163
|
-
&& value.every((entry, index) => isRecord(entry) && entry.id === AGENT_CLIENT_IDS[index]);
|
|
164
|
-
}
|
|
165
104
|
function normalizeAgentClients(input) {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
const hasLegacyTuis = hasOwn(input, 'tuis');
|
|
169
|
-
const sandbox = isRecord(input.sandbox) ? input.sandbox : undefined;
|
|
170
|
-
const hasLegacySandboxTools = sandbox !== undefined && hasOwn(sandbox, 'tools');
|
|
171
|
-
const tuiProjection = projectLegacyTuis(input.tuis, diagnostics);
|
|
172
|
-
const sandboxProjection = projectLegacySandbox(sandbox?.tools, diagnostics);
|
|
173
|
-
if (!hasCanonical) {
|
|
174
|
-
const state = stateFromLegacy(tuiProjection, sandboxProjection.installed);
|
|
175
|
-
return {
|
|
176
|
-
source: 'legacy',
|
|
177
|
-
state,
|
|
178
|
-
canonical: serializeAgentClients(state),
|
|
179
|
-
remainingSandboxTools: sandboxProjection.remainingTools,
|
|
180
|
-
removeLegacyTuis: hasLegacyTuis,
|
|
181
|
-
changed: true,
|
|
182
|
-
diagnostics
|
|
183
|
-
};
|
|
184
|
-
}
|
|
105
|
+
if (!hasOwn(input, 'agentClients'))
|
|
106
|
+
fail('MISSING_AGENT_CLIENT', 'agentClients');
|
|
185
107
|
const state = parseCanonical(input.agentClients);
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
108
|
+
for (const [index, id] of AGENT_CLIENT_IDS.entries()) {
|
|
109
|
+
const entry = Array.isArray(input.agentClients) ? input.agentClients[index] : undefined;
|
|
110
|
+
if (!isRecord(entry) || entry.id !== id) {
|
|
111
|
+
fail('INVALID_AGENT_CLIENTS', `agentClients[${index}].id`);
|
|
191
112
|
}
|
|
192
113
|
}
|
|
193
|
-
if (
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
114
|
+
if (hasOwn(input, 'tuis'))
|
|
115
|
+
fail('INVALID_AGENT_CLIENTS', 'tuis');
|
|
116
|
+
const sandbox = isRecord(input.sandbox) ? input.sandbox : undefined;
|
|
117
|
+
if (Array.isArray(sandbox?.tools)) {
|
|
118
|
+
for (const [index, tool] of sandbox.tools.entries()) {
|
|
119
|
+
if (isAgentClientId(tool)) {
|
|
120
|
+
fail('INVALID_AGENT_CLIENTS', `sandbox.tools[${index}]`);
|
|
197
121
|
}
|
|
198
122
|
}
|
|
199
123
|
}
|
|
200
124
|
return {
|
|
201
|
-
source: 'canonical',
|
|
202
125
|
state,
|
|
203
|
-
canonical: serializeAgentClients(state)
|
|
204
|
-
remainingSandboxTools: hasLegacySandboxTools
|
|
205
|
-
? sandboxProjection.remainingTools
|
|
206
|
-
: undefined,
|
|
207
|
-
removeLegacyTuis: hasLegacyTuis,
|
|
208
|
-
changed: hasLegacyTuis
|
|
209
|
-
|| sandboxProjection.clientSignals.size > 0
|
|
210
|
-
|| !sameCanonicalOrder(input.agentClients),
|
|
211
|
-
diagnostics
|
|
126
|
+
canonical: serializeAgentClients(state)
|
|
212
127
|
};
|
|
213
128
|
}
|
|
214
129
|
export { AgentClientConfigError, normalizeAgentClients, serializeAgentClients };
|
|
@@ -71,15 +71,6 @@ function planAgentClientReconciliation(input) {
|
|
|
71
71
|
});
|
|
72
72
|
const nextConfig = structuredClone(input.config);
|
|
73
73
|
nextConfig.agentClients = serializeAgentClients(desired);
|
|
74
|
-
delete nextConfig.tuis;
|
|
75
|
-
if (normalized.remainingSandboxTools !== undefined) {
|
|
76
|
-
const sandbox = isRecord(nextConfig.sandbox) ? { ...nextConfig.sandbox } : {};
|
|
77
|
-
sandbox.tools = [
|
|
78
|
-
'agent-infra',
|
|
79
|
-
...normalized.remainingSandboxTools.filter((tool) => tool !== 'agent-infra')
|
|
80
|
-
];
|
|
81
|
-
nextConfig.sandbox = sandbox;
|
|
82
|
-
}
|
|
83
74
|
const existingFiles = isRecord(nextConfig.files) ? nextConfig.files : {};
|
|
84
75
|
const existingBaselines = isRecord(existingFiles.managedBaselines)
|
|
85
76
|
? existingFiles.managedBaselines
|
|
@@ -161,14 +152,13 @@ function planAgentClientReconciliation(input) {
|
|
|
161
152
|
const changed = JSON.stringify(nextConfig) !== JSON.stringify(input.config)
|
|
162
153
|
|| actionableSeed;
|
|
163
154
|
return Object.freeze({
|
|
164
|
-
source: normalized.source,
|
|
165
155
|
before: normalized.state,
|
|
166
156
|
desired,
|
|
167
157
|
nextConfig,
|
|
168
158
|
projectAssets,
|
|
169
159
|
seedOperations: Object.freeze(seedOperations),
|
|
170
160
|
nextSteps,
|
|
171
|
-
diagnostics: Object.freeze([...
|
|
161
|
+
diagnostics: Object.freeze([...custom.diagnostics]),
|
|
172
162
|
changed,
|
|
173
163
|
projectRoot: input.projectRoot,
|
|
174
164
|
configPath: path.join(input.projectRoot, '.agents', '.airc.json')
|
|
@@ -10,14 +10,15 @@ const AGENT_CLIENTS_SCHEMA = {
|
|
|
10
10
|
maxItems: AGENT_CLIENT_IDS.length,
|
|
11
11
|
uniqueItems: true,
|
|
12
12
|
description: 'Canonical Agent Client configuration. Object ID completeness and uniqueness are enforced by the runtime normalizer.',
|
|
13
|
-
|
|
13
|
+
additionalItems: false,
|
|
14
|
+
items: AGENT_CLIENT_IDS.map((id) => ({
|
|
14
15
|
type: 'object',
|
|
15
16
|
additionalProperties: false,
|
|
16
17
|
required: ['id', 'enabled', 'installInSandbox'],
|
|
17
18
|
properties: {
|
|
18
19
|
id: {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
const: id,
|
|
21
|
+
type: 'string'
|
|
21
22
|
},
|
|
22
23
|
enabled: {
|
|
23
24
|
type: 'boolean'
|
|
@@ -35,7 +36,7 @@ const AGENT_CLIENTS_SCHEMA = {
|
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
}
|
|
39
|
+
}))
|
|
39
40
|
},
|
|
40
41
|
customTUIs: {
|
|
41
42
|
type: 'array',
|
|
@@ -1,25 +1,15 @@
|
|
|
1
1
|
// Active AI collaborator short tokens — the write-side whitelist for the
|
|
2
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.
|
|
4
|
-
// Gemini tokens remain read-only and are handled by classifyAgent below.
|
|
3
|
+
// internal commands and the rendering side share one definition.
|
|
5
4
|
export const KNOWN_AI_AGENTS = new Set(['claude', 'codex', 'antigravity', 'opencode', 'cursor', 'traecli']);
|
|
6
|
-
// Long name -> short name mapping
|
|
7
|
-
//
|
|
8
|
-
// client. `gemini-cli` is intentionally not writable.
|
|
5
|
+
// Long name -> short name mapping: `claude-code` reuses the existing
|
|
6
|
+
// orchestration precedent, and `antigravity-cli` is the active client.
|
|
9
7
|
export const AGENT_LONG_NAMES = {
|
|
10
8
|
'claude-code': 'claude',
|
|
11
9
|
'antigravity-cli': 'antigravity'
|
|
12
10
|
};
|
|
13
11
|
export const AGENT_USAGE_HINT = "agent must be a short token (claude/codex/antigravity/opencode/cursor/traecli), " +
|
|
14
12
|
"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
13
|
// Strict write-side validation: the value must be exactly a short token, a
|
|
24
14
|
// long name, or 'human'; returns the normalized short token, or null when
|
|
25
15
|
// the value is not a recognized agent.
|
|
@@ -41,9 +31,9 @@ export function classifyAgent(raw) {
|
|
|
41
31
|
return { status: 'unknown', display: 'human' };
|
|
42
32
|
if (token === 'human')
|
|
43
33
|
return { status: 'human', display: 'human' };
|
|
44
|
-
if (
|
|
34
|
+
if (KNOWN_AI_AGENTS.has(token))
|
|
45
35
|
return { status: 'ai', display: token };
|
|
46
|
-
const short =
|
|
36
|
+
const short = AGENT_LONG_NAMES[token];
|
|
47
37
|
return short ? { status: 'ai', display: short } : { status: 'unknown', display: 'human' };
|
|
48
38
|
}
|
|
49
39
|
//# sourceMappingURL=tokens.js.map
|
package/dist/lib/decide.js
CHANGED
|
@@ -3,7 +3,7 @@ import { parseTaskScope } from './task/command-options.js';
|
|
|
3
3
|
import { applyHumanDecision } from './task/decision-intents.js';
|
|
4
4
|
import { canonicalTimestamp } from './task/write.js';
|
|
5
5
|
import { consumeHumanOverride, failureId } from './task/human-override.js';
|
|
6
|
-
import {
|
|
6
|
+
import { resolveTaskContext } from './task/resolve-ref.js';
|
|
7
7
|
import { TaskExecutionLockError, withTaskExecutionLock } from './task/task-execution-lock.js';
|
|
8
8
|
function parseDecisionParts(parts) {
|
|
9
9
|
const decision = [];
|
|
@@ -66,47 +66,33 @@ export async function decide(args, options = {}) {
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
else if (arg.startsWith('--item=')) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return 1;
|
|
72
|
-
}
|
|
73
|
-
item = arg.slice('--item='.length);
|
|
74
|
-
if (item === '') {
|
|
75
|
-
process.stderr.write('Error: --item requires a value\n');
|
|
76
|
-
return 1;
|
|
77
|
-
}
|
|
69
|
+
process.stderr.write('Error: --item=... is not supported; use --item <selector> or -i <selector>\n');
|
|
70
|
+
return 1;
|
|
78
71
|
}
|
|
79
72
|
else
|
|
80
73
|
operands.push(arg);
|
|
81
74
|
}
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (item !== undefined) {
|
|
86
|
-
decisionParts = operands;
|
|
87
|
-
}
|
|
88
|
-
else if (!scope.explicit) {
|
|
89
|
-
[taskRef, selector, ...decisionParts] = operands;
|
|
90
|
-
}
|
|
91
|
-
else {
|
|
92
|
-
decisionParts = [];
|
|
93
|
-
}
|
|
75
|
+
const taskRef = scope.taskRef;
|
|
76
|
+
const selector = item;
|
|
77
|
+
const decisionParts = operands;
|
|
94
78
|
if (!selector || decisionParts.length === 0) {
|
|
95
|
-
process.stderr.write('Usage: ai decide [--task <ref>] --item <ordinal|ledger-id>
|
|
79
|
+
process.stderr.write('Usage: ai decide [--task <ref> | -t <ref>] (--item <ordinal|ledger-id> | -i <ordinal|ledger-id>) [--needs-implementation true|false] <decision>\n');
|
|
96
80
|
return 1;
|
|
97
81
|
}
|
|
98
82
|
try {
|
|
99
83
|
const parsedDecision = parseDecisionParts(decisionParts);
|
|
100
84
|
const now = (options.now ?? canonicalTimestamp)();
|
|
85
|
+
const resolved = resolveTaskContext(taskRef, { repoRoot: options.repoRoot });
|
|
86
|
+
if (!resolved.ok)
|
|
87
|
+
throw new Error(resolved.message);
|
|
101
88
|
const request = {
|
|
102
|
-
taskRef, selector, decision: parsedDecision.decision,
|
|
89
|
+
taskRef: resolved.taskId, selector, decision: parsedDecision.decision,
|
|
103
90
|
needsImplementation: parsedDecision.needsImplementation
|
|
104
91
|
};
|
|
105
92
|
const writeOptions = {
|
|
106
|
-
repoRoot:
|
|
93
|
+
repoRoot: resolved.repoRoot,
|
|
107
94
|
metadataProvider: () => ({ timestamp: now, agentInfraVersion: options.version ?? VERSION })
|
|
108
95
|
};
|
|
109
|
-
const resolved = taskRef ? resolveTaskRef(taskRef, { repoRoot: options.repoRoot }) : null;
|
|
110
96
|
let result;
|
|
111
97
|
const execute = () => {
|
|
112
98
|
let current = applyHumanDecision(request, writeOptions);
|
|
@@ -115,7 +101,7 @@ export async function decide(args, options = {}) {
|
|
|
115
101
|
if (!parsedDecision.overrideTarget || !parsedDecision.overrideScope)
|
|
116
102
|
throw new Error('override ticket requires --override-target and --override-scope');
|
|
117
103
|
const consumed = consumeHumanOverride({
|
|
118
|
-
taskRef: resolved
|
|
104
|
+
taskRef: resolved.taskId,
|
|
119
105
|
ticketId: parsedDecision.overrideTicket,
|
|
120
106
|
failureId: failureId('decision-intent', current.error?.code ?? 'TASK_STATE_MISMATCH'),
|
|
121
107
|
target: parsedDecision.overrideTarget,
|
|
@@ -134,9 +120,7 @@ export async function decide(args, options = {}) {
|
|
|
134
120
|
throw new Error(consumed.error.message);
|
|
135
121
|
return current;
|
|
136
122
|
};
|
|
137
|
-
result = resolved
|
|
138
|
-
? withTaskExecutionLock(resolved.repoRoot, resolved.taskId, 'task-decision', execute)
|
|
139
|
-
: execute();
|
|
123
|
+
result = withTaskExecutionLock(resolved.repoRoot, resolved.taskId, 'task-decision', execute);
|
|
140
124
|
if (result.error)
|
|
141
125
|
throw new Error(result.error.message);
|
|
142
126
|
return 0;
|
package/dist/lib/defaults.json
CHANGED
package/dist/lib/init.js
CHANGED
|
@@ -71,7 +71,7 @@ async function cmdInit() {
|
|
|
71
71
|
// check existing config
|
|
72
72
|
if (fs.existsSync(configPath)) {
|
|
73
73
|
err('This project already has agent-infra configuration.');
|
|
74
|
-
err('Use /update-agent-infra in your AI TUI to
|
|
74
|
+
err('Use /update-agent-infra in your AI TUI to sync project files.');
|
|
75
75
|
process.exitCode = 1;
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
@@ -214,7 +214,7 @@ async function cmdInit() {
|
|
|
214
214
|
console.log('');
|
|
215
215
|
ok('Project initialized successfully!');
|
|
216
216
|
console.log('');
|
|
217
|
-
console.log(' If this init used npx, install agent-infra persistently before update or validation:');
|
|
217
|
+
console.log(' If this init used npx, install agent-infra persistently before ai update or validation:');
|
|
218
218
|
console.log(' npm install -g @fitlab-ai/agent-infra');
|
|
219
219
|
console.log('');
|
|
220
220
|
if (workflowPlan.nextSteps.length === 0) {
|