@fitlab-ai/agent-infra 0.7.4 → 0.7.5
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/bin/cli.ts +13 -11
- package/dist/bin/cli.js +13 -11
- package/dist/lib/init.js +1 -1
- package/dist/lib/merge.js +1 -1
- package/dist/lib/sandbox/index.js +21 -21
- package/dist/lib/task/index.js +13 -13
- package/dist/lib/update.js +1 -1
- package/lib/init.ts +1 -1
- package/lib/merge.ts +1 -1
- package/lib/sandbox/index.ts +21 -21
- package/lib/task/index.ts +13 -13
- package/lib/update.ts +1 -1
- package/package.json +1 -1
- package/templates/.agents/rules/README.en.md +7 -3
- package/templates/.agents/rules/README.zh-CN.md +7 -3
- package/templates/.agents/rules/cli-help-format.en.md +49 -0
- package/templates/.agents/rules/cli-help-format.zh-CN.md +49 -0
- package/templates/.agents/rules/no-mid-flow-questions.en.md +14 -2
- package/templates/.agents/rules/no-mid-flow-questions.zh-CN.md +14 -2
- package/templates/.agents/rules/pr-sync.github.en.md +8 -6
- package/templates/.agents/rules/pr-sync.github.zh-CN.md +8 -6
- package/templates/.agents/rules/review-handshake.en.md +83 -0
- package/templates/.agents/rules/review-handshake.zh-CN.md +83 -0
- package/templates/.agents/scripts/lib/post-review-commit.js +56 -0
- package/templates/.agents/scripts/lib/review-artifacts.js +117 -0
- package/templates/.agents/scripts/review-diff-fingerprint.js +99 -0
- package/templates/.agents/scripts/validate-artifact.js +240 -0
- package/templates/.agents/skills/analyze-task/SKILL.en.md +52 -6
- package/templates/.agents/skills/analyze-task/SKILL.zh-CN.md +52 -6
- package/templates/.agents/skills/code-task/config/verify.en.json +3 -0
- package/templates/.agents/skills/code-task/config/verify.zh-CN.json +3 -0
- package/templates/.agents/skills/code-task/reference/fix-mode.en.md +5 -3
- package/templates/.agents/skills/code-task/reference/fix-mode.zh-CN.md +5 -3
- package/templates/.agents/skills/code-task/reference/report-template.en.md +4 -4
- package/templates/.agents/skills/code-task/reference/report-template.zh-CN.md +4 -4
- package/templates/.agents/skills/code-task/scripts/detect-mode.js +2 -107
- package/templates/.agents/skills/commit/SKILL.en.md +6 -0
- package/templates/.agents/skills/commit/SKILL.zh-CN.md +6 -0
- package/templates/.agents/skills/commit/reference/task-status-update.en.md +8 -0
- package/templates/.agents/skills/commit/reference/task-status-update.zh-CN.md +8 -0
- package/templates/.agents/skills/complete-task/SKILL.en.md +10 -0
- package/templates/.agents/skills/complete-task/SKILL.zh-CN.md +10 -0
- package/templates/.agents/skills/complete-task/config/verify.en.json +2 -0
- package/templates/.agents/skills/complete-task/config/verify.zh-CN.json +2 -0
- 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/plan-task/SKILL.en.md +1 -1
- package/templates/.agents/skills/plan-task/SKILL.zh-CN.md +1 -1
- package/templates/.agents/skills/plan-task/config/verify.en.json +3 -0
- package/templates/.agents/skills/plan-task/config/verify.zh-CN.json +3 -0
- package/templates/.agents/skills/review-analysis/config/verify.en.json +2 -1
- package/templates/.agents/skills/review-analysis/config/verify.zh-CN.json +2 -1
- package/templates/.agents/skills/review-analysis/reference/output-templates.en.md +5 -4
- package/templates/.agents/skills/review-analysis/reference/output-templates.zh-CN.md +5 -4
- package/templates/.agents/skills/review-analysis/reference/report-template.en.md +4 -0
- package/templates/.agents/skills/review-analysis/reference/report-template.zh-CN.md +4 -0
- package/templates/.agents/skills/review-code/SKILL.en.md +4 -1
- package/templates/.agents/skills/review-code/SKILL.zh-CN.md +4 -1
- package/templates/.agents/skills/review-code/config/verify.en.json +5 -2
- package/templates/.agents/skills/review-code/config/verify.zh-CN.json +5 -2
- package/templates/.agents/skills/review-code/reference/output-templates.en.md +5 -4
- package/templates/.agents/skills/review-code/reference/output-templates.zh-CN.md +5 -4
- package/templates/.agents/skills/review-code/reference/report-template.en.md +6 -0
- package/templates/.agents/skills/review-code/reference/report-template.zh-CN.md +6 -0
- package/templates/.agents/skills/review-plan/config/verify.en.json +2 -1
- package/templates/.agents/skills/review-plan/config/verify.zh-CN.json +2 -1
- package/templates/.agents/skills/review-plan/reference/output-templates.en.md +5 -4
- package/templates/.agents/skills/review-plan/reference/output-templates.zh-CN.md +5 -4
- package/templates/.agents/skills/review-plan/reference/report-template.en.md +4 -0
- package/templates/.agents/skills/review-plan/reference/report-template.zh-CN.md +4 -0
- package/templates/.agents/templates/task.en.md +7 -0
- package/templates/.agents/templates/task.zh-CN.md +7 -0
- package/templates/.github/workflows/metadata-sync.yml +1 -1
- package/templates/.github/workflows/pr-label.yml +1 -1
- package/templates/.github/workflows/status-label.yml +1 -1
package/bin/cli.ts
CHANGED
|
@@ -12,17 +12,19 @@ if (major < 22) {
|
|
|
12
12
|
|
|
13
13
|
const USAGE = `agent-infra ${VERSION} - bootstrap AI collaboration infrastructure
|
|
14
14
|
|
|
15
|
-
Usage:
|
|
16
|
-
agent-infra cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
17
|
-
agent-infra help Show this help message
|
|
18
|
-
agent-infra init Initialize a new project with update-agent-infra seed command
|
|
19
|
-
agent-infra merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
20
|
-
agent-infra sandbox Manage Docker-based AI sandboxes
|
|
21
|
-
agent-infra task Read-only views over .agents/workspace tasks (ls / show / files / cat / status / log / grep)
|
|
22
|
-
agent-infra update Update seed files and sync file registry for an existing project
|
|
23
|
-
agent-infra version Show version
|
|
15
|
+
Usage: ai <command> [options]
|
|
24
16
|
|
|
25
|
-
|
|
17
|
+
Commands:
|
|
18
|
+
cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
19
|
+
help Show this help message
|
|
20
|
+
init Initialize a new project with update-agent-infra seed command
|
|
21
|
+
merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
22
|
+
sandbox Manage Docker-based AI sandboxes
|
|
23
|
+
task Read-only views over .agents/workspace tasks (cat / files / grep / log / ls / show / status)
|
|
24
|
+
update Update seed files and sync file registry for an existing project
|
|
25
|
+
version Show version
|
|
26
|
+
|
|
27
|
+
'ai' and 'agent-infra' are interchangeable; 'ai' is the shorter form.
|
|
26
28
|
|
|
27
29
|
Install methods:
|
|
28
30
|
npm: npm install -g @fitlab-ai/agent-infra
|
|
@@ -31,7 +33,7 @@ Install methods:
|
|
|
31
33
|
curl: curl -fsSL https://raw.githubusercontent.com/fitlab-ai/agent-infra/main/install.sh | sh (runs npm install -g internally)
|
|
32
34
|
|
|
33
35
|
Examples:
|
|
34
|
-
cd my-project &&
|
|
36
|
+
cd my-project && ai init
|
|
35
37
|
npx @fitlab-ai/agent-infra init
|
|
36
38
|
`;
|
|
37
39
|
|
package/dist/bin/cli.js
CHANGED
|
@@ -16,17 +16,19 @@ if (major < 22) {
|
|
|
16
16
|
}
|
|
17
17
|
const USAGE = `agent-infra ${VERSION} - bootstrap AI collaboration infrastructure
|
|
18
18
|
|
|
19
|
-
Usage:
|
|
20
|
-
agent-infra cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
21
|
-
agent-infra help Show this help message
|
|
22
|
-
agent-infra init Initialize a new project with update-agent-infra seed command
|
|
23
|
-
agent-infra merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
24
|
-
agent-infra sandbox Manage Docker-based AI sandboxes
|
|
25
|
-
agent-infra task Read-only views over .agents/workspace tasks (ls / show / files / cat / status / log / grep)
|
|
26
|
-
agent-infra update Update seed files and sync file registry for an existing project
|
|
27
|
-
agent-infra version Show version
|
|
19
|
+
Usage: ai <command> [options]
|
|
28
20
|
|
|
29
|
-
|
|
21
|
+
Commands:
|
|
22
|
+
cp <ssh-alias> Copy local clipboard image to a remote macOS NSPasteboard
|
|
23
|
+
help Show this help message
|
|
24
|
+
init Initialize a new project with update-agent-infra seed command
|
|
25
|
+
merge Merge tasks from another workspace directory (active/blocked/completed/archive)
|
|
26
|
+
sandbox Manage Docker-based AI sandboxes
|
|
27
|
+
task Read-only views over .agents/workspace tasks (cat / files / grep / log / ls / show / status)
|
|
28
|
+
update Update seed files and sync file registry for an existing project
|
|
29
|
+
version Show version
|
|
30
|
+
|
|
31
|
+
'ai' and 'agent-infra' are interchangeable; 'ai' is the shorter form.
|
|
30
32
|
|
|
31
33
|
Install methods:
|
|
32
34
|
npm: npm install -g @fitlab-ai/agent-infra
|
|
@@ -35,7 +37,7 @@ Install methods:
|
|
|
35
37
|
curl: curl -fsSL https://raw.githubusercontent.com/fitlab-ai/agent-infra/main/install.sh | sh (runs npm install -g internally)
|
|
36
38
|
|
|
37
39
|
Examples:
|
|
38
|
-
cd my-project &&
|
|
40
|
+
cd my-project && ai init
|
|
39
41
|
npx @fitlab-ai/agent-infra init
|
|
40
42
|
`;
|
|
41
43
|
const command = process.argv[2] || '';
|
package/dist/lib/init.js
CHANGED
|
@@ -70,7 +70,7 @@ function parseLocalSources(input) {
|
|
|
70
70
|
}
|
|
71
71
|
async function cmdInit() {
|
|
72
72
|
console.log('');
|
|
73
|
-
console.log('
|
|
73
|
+
console.log(' ai init');
|
|
74
74
|
console.log(' ================================');
|
|
75
75
|
console.log(' Optional template and skill sources can be added now or later in .agents/.airc.json.');
|
|
76
76
|
console.log('');
|
package/dist/lib/merge.js
CHANGED
|
@@ -702,7 +702,7 @@ function printReport(report) {
|
|
|
702
702
|
async function cmdMerge(args) {
|
|
703
703
|
const sourcePath = args[0];
|
|
704
704
|
if (!sourcePath) {
|
|
705
|
-
throw new Error('Usage:
|
|
705
|
+
throw new Error('Usage: ai merge <source-path>');
|
|
706
706
|
}
|
|
707
707
|
const resolvedSource = path.resolve(sourcePath);
|
|
708
708
|
if (!fs.existsSync(resolvedSource)) {
|
|
@@ -6,9 +6,6 @@ Commands:
|
|
|
6
6
|
Enter sandbox or run a command. N (bare) is the
|
|
7
7
|
recommended form for task short ids (e.g.
|
|
8
8
|
'ai sandbox exec 11'); '#N' is also accepted.
|
|
9
|
-
start <branch | TASK-id | N | '#N'>
|
|
10
|
-
Start an existing stopped sandbox container
|
|
11
|
-
(e.g. after the Docker daemon restarted)
|
|
12
9
|
ls List sandboxes for the current project (the '#'
|
|
13
10
|
column is a display-only row number; the 'SHORT'
|
|
14
11
|
column shows the active task short id, '-' if none)
|
|
@@ -19,6 +16,9 @@ Commands:
|
|
|
19
16
|
rm <branch> | --all | --purge
|
|
20
17
|
Remove one sandbox, all sandboxes not bound to an
|
|
21
18
|
active task (--all), or tear down everything (--purge)
|
|
19
|
+
start <branch | TASK-id | N | '#N'>
|
|
20
|
+
Start an existing stopped sandbox container
|
|
21
|
+
(e.g. after the Docker daemon restarted)
|
|
22
22
|
vm status|start|stop Manage the sandbox VM (macOS) or check the backend (Windows)
|
|
23
23
|
|
|
24
24
|
Run 'ai sandbox <command> --help' for details.`;
|
|
@@ -47,6 +47,21 @@ export async function runSandbox(args) {
|
|
|
47
47
|
}
|
|
48
48
|
break;
|
|
49
49
|
}
|
|
50
|
+
case 'ls': {
|
|
51
|
+
const { ls } = await import("./commands/ls.js");
|
|
52
|
+
ls(rest);
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
case 'prune': {
|
|
56
|
+
const { prune } = await import("./commands/prune.js");
|
|
57
|
+
await prune(rest);
|
|
58
|
+
break;
|
|
59
|
+
}
|
|
60
|
+
case 'rebuild': {
|
|
61
|
+
const { rebuild } = await import("./commands/rebuild.js");
|
|
62
|
+
await rebuild(rest);
|
|
63
|
+
break;
|
|
64
|
+
}
|
|
50
65
|
case 'refresh': {
|
|
51
66
|
const { refresh } = await import("./commands/refresh.js");
|
|
52
67
|
const exitCode = await refresh(rest);
|
|
@@ -55,24 +70,14 @@ export async function runSandbox(args) {
|
|
|
55
70
|
}
|
|
56
71
|
break;
|
|
57
72
|
}
|
|
58
|
-
case 'start': {
|
|
59
|
-
const { start } = await import("./commands/start.js");
|
|
60
|
-
await start(rest);
|
|
61
|
-
break;
|
|
62
|
-
}
|
|
63
|
-
case 'ls': {
|
|
64
|
-
const { ls } = await import("./commands/ls.js");
|
|
65
|
-
ls(rest);
|
|
66
|
-
break;
|
|
67
|
-
}
|
|
68
73
|
case 'rm': {
|
|
69
74
|
const { rm } = await import("./commands/rm.js");
|
|
70
75
|
await rm(rest);
|
|
71
76
|
break;
|
|
72
77
|
}
|
|
73
|
-
case '
|
|
74
|
-
const {
|
|
75
|
-
await
|
|
78
|
+
case 'start': {
|
|
79
|
+
const { start } = await import("./commands/start.js");
|
|
80
|
+
await start(rest);
|
|
76
81
|
break;
|
|
77
82
|
}
|
|
78
83
|
case 'vm': {
|
|
@@ -80,11 +85,6 @@ export async function runSandbox(args) {
|
|
|
80
85
|
await vm(rest);
|
|
81
86
|
break;
|
|
82
87
|
}
|
|
83
|
-
case 'rebuild': {
|
|
84
|
-
const { rebuild } = await import("./commands/rebuild.js");
|
|
85
|
-
await rebuild(rest);
|
|
86
|
-
break;
|
|
87
|
-
}
|
|
88
88
|
default:
|
|
89
89
|
throw new Error(`Unknown sandbox command: ${subcommand}`);
|
|
90
90
|
}
|
package/dist/lib/task/index.js
CHANGED
|
@@ -34,14 +34,9 @@ export async function runTask(args) {
|
|
|
34
34
|
return;
|
|
35
35
|
}
|
|
36
36
|
switch (subcommand) {
|
|
37
|
-
case '
|
|
38
|
-
const {
|
|
39
|
-
|
|
40
|
-
break;
|
|
41
|
-
}
|
|
42
|
-
case 'show': {
|
|
43
|
-
const { show } = await import("./commands/show.js");
|
|
44
|
-
show(rest);
|
|
37
|
+
case 'cat': {
|
|
38
|
+
const { cat } = await import("./commands/cat.js");
|
|
39
|
+
cat(rest);
|
|
45
40
|
break;
|
|
46
41
|
}
|
|
47
42
|
case 'files': {
|
|
@@ -49,11 +44,6 @@ export async function runTask(args) {
|
|
|
49
44
|
files(rest);
|
|
50
45
|
break;
|
|
51
46
|
}
|
|
52
|
-
case 'cat': {
|
|
53
|
-
const { cat } = await import("./commands/cat.js");
|
|
54
|
-
cat(rest);
|
|
55
|
-
break;
|
|
56
|
-
}
|
|
57
47
|
case 'grep': {
|
|
58
48
|
const { grep } = await import("./commands/grep.js");
|
|
59
49
|
grep(rest);
|
|
@@ -64,6 +54,16 @@ export async function runTask(args) {
|
|
|
64
54
|
log(rest);
|
|
65
55
|
break;
|
|
66
56
|
}
|
|
57
|
+
case 'ls': {
|
|
58
|
+
const { ls } = await import("./commands/ls.js");
|
|
59
|
+
ls(rest);
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
case 'show': {
|
|
63
|
+
const { show } = await import("./commands/show.js");
|
|
64
|
+
show(rest);
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
67
|
case 'status': {
|
|
68
68
|
const { status } = await import("./commands/status.js");
|
|
69
69
|
status(rest);
|
package/dist/lib/update.js
CHANGED
|
@@ -83,7 +83,7 @@ function syncFileRegistry(config, platformType, enabledTUIs) {
|
|
|
83
83
|
}
|
|
84
84
|
async function cmdUpdate() {
|
|
85
85
|
console.log('');
|
|
86
|
-
console.log('
|
|
86
|
+
console.log(' ai update');
|
|
87
87
|
console.log(' ==================================');
|
|
88
88
|
console.log('');
|
|
89
89
|
// check config exists
|
package/lib/init.ts
CHANGED
|
@@ -119,7 +119,7 @@ function parseLocalSources(input: string): SourceEntry[] {
|
|
|
119
119
|
|
|
120
120
|
async function cmdInit(): Promise<void> {
|
|
121
121
|
console.log('');
|
|
122
|
-
console.log('
|
|
122
|
+
console.log(' ai init');
|
|
123
123
|
console.log(' ================================');
|
|
124
124
|
console.log(' Optional template and skill sources can be added now or later in .agents/.airc.json.');
|
|
125
125
|
console.log('');
|
package/lib/merge.ts
CHANGED
|
@@ -901,7 +901,7 @@ function printReport(report: MergeReport): void {
|
|
|
901
901
|
async function cmdMerge(args: string[]): Promise<void> {
|
|
902
902
|
const sourcePath = args[0];
|
|
903
903
|
if (!sourcePath) {
|
|
904
|
-
throw new Error('Usage:
|
|
904
|
+
throw new Error('Usage: ai merge <source-path>');
|
|
905
905
|
}
|
|
906
906
|
|
|
907
907
|
const resolvedSource = path.resolve(sourcePath);
|
package/lib/sandbox/index.ts
CHANGED
|
@@ -6,9 +6,6 @@ Commands:
|
|
|
6
6
|
Enter sandbox or run a command. N (bare) is the
|
|
7
7
|
recommended form for task short ids (e.g.
|
|
8
8
|
'ai sandbox exec 11'); '#N' is also accepted.
|
|
9
|
-
start <branch | TASK-id | N | '#N'>
|
|
10
|
-
Start an existing stopped sandbox container
|
|
11
|
-
(e.g. after the Docker daemon restarted)
|
|
12
9
|
ls List sandboxes for the current project (the '#'
|
|
13
10
|
column is a display-only row number; the 'SHORT'
|
|
14
11
|
column shows the active task short id, '-' if none)
|
|
@@ -19,6 +16,9 @@ Commands:
|
|
|
19
16
|
rm <branch> | --all | --purge
|
|
20
17
|
Remove one sandbox, all sandboxes not bound to an
|
|
21
18
|
active task (--all), or tear down everything (--purge)
|
|
19
|
+
start <branch | TASK-id | N | '#N'>
|
|
20
|
+
Start an existing stopped sandbox container
|
|
21
|
+
(e.g. after the Docker daemon restarted)
|
|
22
22
|
vm status|start|stop Manage the sandbox VM (macOS) or check the backend (Windows)
|
|
23
23
|
|
|
24
24
|
Run 'ai sandbox <command> --help' for details.`;
|
|
@@ -51,6 +51,21 @@ export async function runSandbox(args: string[]): Promise<void> {
|
|
|
51
51
|
}
|
|
52
52
|
break;
|
|
53
53
|
}
|
|
54
|
+
case 'ls': {
|
|
55
|
+
const { ls } = await import('./commands/ls.ts');
|
|
56
|
+
ls(rest);
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case 'prune': {
|
|
60
|
+
const { prune } = await import('./commands/prune.ts');
|
|
61
|
+
await prune(rest);
|
|
62
|
+
break;
|
|
63
|
+
}
|
|
64
|
+
case 'rebuild': {
|
|
65
|
+
const { rebuild } = await import('./commands/rebuild.ts');
|
|
66
|
+
await rebuild(rest);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
54
69
|
case 'refresh': {
|
|
55
70
|
const { refresh } = await import('./commands/refresh.ts');
|
|
56
71
|
const exitCode = await refresh(rest);
|
|
@@ -59,24 +74,14 @@ export async function runSandbox(args: string[]): Promise<void> {
|
|
|
59
74
|
}
|
|
60
75
|
break;
|
|
61
76
|
}
|
|
62
|
-
case 'start': {
|
|
63
|
-
const { start } = await import('./commands/start.ts');
|
|
64
|
-
await start(rest);
|
|
65
|
-
break;
|
|
66
|
-
}
|
|
67
|
-
case 'ls': {
|
|
68
|
-
const { ls } = await import('./commands/ls.ts');
|
|
69
|
-
ls(rest);
|
|
70
|
-
break;
|
|
71
|
-
}
|
|
72
77
|
case 'rm': {
|
|
73
78
|
const { rm } = await import('./commands/rm.ts');
|
|
74
79
|
await rm(rest);
|
|
75
80
|
break;
|
|
76
81
|
}
|
|
77
|
-
case '
|
|
78
|
-
const {
|
|
79
|
-
await
|
|
82
|
+
case 'start': {
|
|
83
|
+
const { start } = await import('./commands/start.ts');
|
|
84
|
+
await start(rest);
|
|
80
85
|
break;
|
|
81
86
|
}
|
|
82
87
|
case 'vm': {
|
|
@@ -84,11 +89,6 @@ export async function runSandbox(args: string[]): Promise<void> {
|
|
|
84
89
|
await vm(rest);
|
|
85
90
|
break;
|
|
86
91
|
}
|
|
87
|
-
case 'rebuild': {
|
|
88
|
-
const { rebuild } = await import('./commands/rebuild.ts');
|
|
89
|
-
await rebuild(rest);
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
92
|
default:
|
|
93
93
|
throw new Error(`Unknown sandbox command: ${subcommand}`);
|
|
94
94
|
}
|
package/lib/task/index.ts
CHANGED
|
@@ -38,14 +38,9 @@ export async function runTask(args: string[]): Promise<void> {
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
switch (subcommand) {
|
|
41
|
-
case '
|
|
42
|
-
const {
|
|
43
|
-
|
|
44
|
-
break;
|
|
45
|
-
}
|
|
46
|
-
case 'show': {
|
|
47
|
-
const { show } = await import('./commands/show.ts');
|
|
48
|
-
show(rest);
|
|
41
|
+
case 'cat': {
|
|
42
|
+
const { cat } = await import('./commands/cat.ts');
|
|
43
|
+
cat(rest);
|
|
49
44
|
break;
|
|
50
45
|
}
|
|
51
46
|
case 'files': {
|
|
@@ -53,11 +48,6 @@ export async function runTask(args: string[]): Promise<void> {
|
|
|
53
48
|
files(rest);
|
|
54
49
|
break;
|
|
55
50
|
}
|
|
56
|
-
case 'cat': {
|
|
57
|
-
const { cat } = await import('./commands/cat.ts');
|
|
58
|
-
cat(rest);
|
|
59
|
-
break;
|
|
60
|
-
}
|
|
61
51
|
case 'grep': {
|
|
62
52
|
const { grep } = await import('./commands/grep.ts');
|
|
63
53
|
grep(rest);
|
|
@@ -68,6 +58,16 @@ export async function runTask(args: string[]): Promise<void> {
|
|
|
68
58
|
log(rest);
|
|
69
59
|
break;
|
|
70
60
|
}
|
|
61
|
+
case 'ls': {
|
|
62
|
+
const { ls } = await import('./commands/ls.ts');
|
|
63
|
+
ls(rest);
|
|
64
|
+
break;
|
|
65
|
+
}
|
|
66
|
+
case 'show': {
|
|
67
|
+
const { show } = await import('./commands/show.ts');
|
|
68
|
+
show(rest);
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
71
|
case 'status': {
|
|
72
72
|
const { status } = await import('./commands/status.ts');
|
|
73
73
|
status(rest);
|
package/lib/update.ts
CHANGED
|
@@ -119,7 +119,7 @@ function syncFileRegistry(config: UpdateConfig, platformType: string, enabledTUI
|
|
|
119
119
|
|
|
120
120
|
async function cmdUpdate(): Promise<void> {
|
|
121
121
|
console.log('');
|
|
122
|
-
console.log('
|
|
122
|
+
console.log(' ai update');
|
|
123
123
|
console.log(' ==================================');
|
|
124
124
|
console.log('');
|
|
125
125
|
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
8
8
|
|
|
9
9
|
## General Principles
|
|
10
10
|
|
|
11
|
-
- [`no-mid-flow-questions.md`](no-mid-flow-questions.md) — Silence during SKILL runs: no user questions by default, plus
|
|
11
|
+
- [`no-mid-flow-questions.md`](no-mid-flow-questions.md) — Silence during SKILL runs: no user questions by default, plus the exceptions the rule lists.
|
|
12
12
|
- [`next-step-output.md`](next-step-output.md) — "Next step" output rules: task short-id rendering and the `Completed at` trailer.
|
|
13
13
|
- [`version-stamp.md`](version-stamp.md) — How and when to stamp `agent_infra_version`.
|
|
14
14
|
- [`debugging-guide.md`](debugging-guide.md) — Structured debugging flow: gather evidence → form hypothesis → verify hypothesis → fix the root cause; no blind patch-and-retry.
|
|
@@ -25,6 +25,7 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
25
25
|
## Task Workflow
|
|
26
26
|
|
|
27
27
|
- [`task-management.md`](task-management.md) — Task intent detection and workflow-command mapping.
|
|
28
|
+
- [`review-handshake.md`](review-handshake.md) — Three-stage bidirectional review handshake: four-state disposition, symmetric evidence, disagreement ledger, convergence and post-review commit gate.
|
|
28
29
|
- [`task-short-id.md`](task-short-id.md) — Resolution, allocation and lifecycle of `#NN` / bare-number short ids.
|
|
29
30
|
- [`milestone-inference.md`](milestone-inference.md) — Milestone inference for create-task / code-task / create-pr.
|
|
30
31
|
- [`label-milestone-setup.md`](label-milestone-setup.md) — Platform commands to initialize labels / milestones.
|
|
@@ -35,7 +36,10 @@ so you can quickly find "which ones to read" without opening each file.
|
|
|
35
36
|
- [`commit-and-pr.md`](commit-and-pr.md) — Conventional Commits message and PR conventions.
|
|
36
37
|
- [`release-commands.md`](release-commands.md) — Read past releases, query merged PRs, publish release notes.
|
|
37
38
|
|
|
38
|
-
## Testing
|
|
39
|
+
## Testing
|
|
39
40
|
|
|
40
41
|
- [`testing-discipline.md`](testing-discipline.md) — Test-writing discipline: prefer structural asserts, no brittle wording matches.
|
|
41
|
-
|
|
42
|
+
|
|
43
|
+
## CLI
|
|
44
|
+
|
|
45
|
+
- [`cli-help-format.md`](cli-help-format.md) — CLI help text conventions: unify display name on `ai`, `Usage:`+`Commands:` structure, alphabetical command order (top-level and namespace-level help only).
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
## 通用准则
|
|
9
9
|
|
|
10
|
-
- [`no-mid-flow-questions.md`](no-mid-flow-questions.md) — SKILL
|
|
10
|
+
- [`no-mid-flow-questions.md`](no-mid-flow-questions.md) — SKILL 执行期禁言:默认不向用户提问,及规则列明的例外。
|
|
11
11
|
- [`next-step-output.md`](next-step-output.md) — 「下一步」输出规则:任务短号渲染与 `Completed at` 收尾行。
|
|
12
12
|
- [`version-stamp.md`](version-stamp.md) — `agent_infra_version` 版本戳的取值命令与写入时机。
|
|
13
13
|
- [`debugging-guide.md`](debugging-guide.md) — 结构化调试流程:收集证据→形成假设→验证假设→修复根因,禁止盲目改代码重试。
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
## 任务工作流
|
|
25
25
|
|
|
26
26
|
- [`task-management.md`](task-management.md) — 任务语义识别与工作流命令映射。
|
|
27
|
+
- [`review-handshake.md`](review-handshake.md) — 三阶段双向审查握手协议:四态处置、对称证据、分歧账本、收敛与 post-review commit 门禁。
|
|
27
28
|
- [`task-short-id.md`](task-short-id.md) — 任务短号 `#NN` / 裸数字的解析、分配与生命周期。
|
|
28
29
|
- [`milestone-inference.md`](milestone-inference.md) — create-task / code-task / create-pr 的 milestone 推断。
|
|
29
30
|
- [`label-milestone-setup.md`](label-milestone-setup.md) — 初始化 label / milestone 的平台命令集。
|
|
@@ -34,7 +35,10 @@
|
|
|
34
35
|
- [`commit-and-pr.md`](commit-and-pr.md) — Conventional Commits 提交信息与 PR 规范。
|
|
35
36
|
- [`release-commands.md`](release-commands.md) — 读取历史 release、查询已合并 PR、发布 Release notes。
|
|
36
37
|
|
|
37
|
-
##
|
|
38
|
+
## 测试
|
|
38
39
|
|
|
39
40
|
- [`testing-discipline.md`](testing-discipline.md) — 测试编写纪律:结构性断言优先,禁止脆弱的措辞匹配。
|
|
40
|
-
|
|
41
|
+
|
|
42
|
+
## CLI
|
|
43
|
+
|
|
44
|
+
- [`cli-help-format.md`](cli-help-format.md) — CLI help 文案约定:展示名统一 `ai`、`Usage:`+`Commands:` 结构、命令按字母序(仅顶层与命名空间级 help)。
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# CLI help text conventions
|
|
2
|
+
|
|
3
|
+
Unify the help text display structure, display name, and command ordering of the `ai` / `agent-infra` CLI so newly added subcommands follow them automatically and never drift across levels again. Read this file before adding or changing CLI help text.
|
|
4
|
+
|
|
5
|
+
## Scope
|
|
6
|
+
|
|
7
|
+
- **Display name `ai`**: applies to **all** user-facing help / usage / banner text — top-level, namespace-level, and the single-line usage / startup banners of leaf commands such as `merge` / `init` / `update`. The only exceptions: the top-level help first line keeps the brand + version line `agent-infra ${VERSION}`, and `@fitlab-ai/agent-infra` in package names / install commands / repo URLs stays as-is.
|
|
8
|
+
- **Structure & ordering** (`Usage:` + `Commands:` structure, alphabetical command order): applies only to levels that carry a `Commands:` listing — top-level help (`bin/cli.ts`) and namespace-level help (e.g. `ai sandbox` / `ai task`). Leaf commands have only a single-line usage and need no `Commands:` structure.
|
|
9
|
+
|
|
10
|
+
## Display name
|
|
11
|
+
|
|
12
|
+
- Use **`ai`** as the command display name in help text (the recommended short form; `package.json`'s `bin` registers both `ai` and `agent-infra`).
|
|
13
|
+
- Keep the top-level help first line as the brand + version line `agent-infra ${VERSION} - bootstrap ...` (it is the brand and version marker that several tests anchor on).
|
|
14
|
+
- Keep `@fitlab-ai/agent-infra` in install methods, package names, and repo URLs as-is (those are package names, not command display names).
|
|
15
|
+
|
|
16
|
+
## List structure
|
|
17
|
+
|
|
18
|
+
Namespace-level and top-level help follow:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Usage: ai <ns> <command> [options]
|
|
22
|
+
|
|
23
|
+
Commands:
|
|
24
|
+
<command> <description aligned from two spaces>
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
Run 'ai <ns> <command> --help' for details.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- The `Commands:` block uses bare command names (no repeated binary name), two-space indent, descriptions aligned to the longest command name.
|
|
31
|
+
- Namespace-level help ends with a `Run 'ai <ns> <command> --help' for details.` footer.
|
|
32
|
+
- Top-level help has no uniform subcommand `--help` convention, so the footer is not required there; if an `Examples:` section exists, its command display name is also `ai`.
|
|
33
|
+
|
|
34
|
+
## Ordering
|
|
35
|
+
|
|
36
|
+
Command lists, `Examples`, and command enumerations embedded in descriptions are all sorted by the **first token of the command, in ascending alphabetical order**:
|
|
37
|
+
|
|
38
|
+
- Multi-token commands (e.g. `vm status|start|stop`) sort by the first token (`vm`).
|
|
39
|
+
- Commands with angle/square-bracket parameters sort by the command name (the bare word before the parameters).
|
|
40
|
+
- Case-insensitive.
|
|
41
|
+
|
|
42
|
+
## Checklist for adding a subcommand
|
|
43
|
+
|
|
44
|
+
When adding a subcommand:
|
|
45
|
+
|
|
46
|
+
1. Insert the command at the correct alphabetical position in `Commands:`.
|
|
47
|
+
2. If it has examples, insert them at the alphabetical position in `Examples:`.
|
|
48
|
+
3. If a top-level `task` / `sandbox` description has an embedded command enumeration, update its alphabetical order too.
|
|
49
|
+
4. Sync the corresponding help test's **structural** assertions (whether the command appears, whether the `Usage:` / `Commands:` header exists); do not bind to full sentences (see [`testing-discipline.md`](testing-discipline.md)).
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# CLI help 文案约定
|
|
2
|
+
|
|
3
|
+
统一 `ai` / `agent-infra` CLI 的 help 文案展示结构、展示名与命令排序,让后续新增子命令自动遵守,避免跨层级再次漂移。新增或调整 CLI help 文案前先读取本文件。
|
|
4
|
+
|
|
5
|
+
## 适用范围
|
|
6
|
+
|
|
7
|
+
- **展示名 `ai`**:适用于**所有**面向用户的 help / usage / 交互横幅文案——顶层、命名空间级,以及 `merge` / `init` / `update` 等叶子命令的单行 usage 与启动横幅,统一用 `ai`。唯一例外:顶层 help 首行保留品牌 + 版本行 `agent-infra ${VERSION}`;包名 / 安装命令 / 仓库 URL 中的 `@fitlab-ai/agent-infra` 保持原样。
|
|
8
|
+
- **结构与排序**(`Usage:` + `Commands:` 结构、命令按字母序):仅适用于带 `Commands:` 子清单的层级——顶层 help(`bin/cli.ts`)与命名空间级 help(如 `ai sandbox` / `ai task`)。叶子命令只有单行 usage,无需 `Commands:` 结构。
|
|
9
|
+
|
|
10
|
+
## 展示名
|
|
11
|
+
|
|
12
|
+
- help 文案中的命令展示名统一用 **`ai`**(推荐简写,`package.json` 的 `bin` 同时注册 `ai` 与 `agent-infra`)。
|
|
13
|
+
- 顶层 help 首行保留品牌 + 版本行 `agent-infra ${VERSION} - bootstrap ...`(这是品牌与版本标识,多处测试锚定它)。
|
|
14
|
+
- 安装方式、包名、仓库 URL 中的 `@fitlab-ai/agent-infra` 等保持原样(是包名而非命令展示名)。
|
|
15
|
+
|
|
16
|
+
## 列表结构
|
|
17
|
+
|
|
18
|
+
命名空间级与顶层 help 统一为:
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
Usage: ai <ns> <command> [options]
|
|
22
|
+
|
|
23
|
+
Commands:
|
|
24
|
+
<command> <两空格起对齐的描述>
|
|
25
|
+
...
|
|
26
|
+
|
|
27
|
+
Run 'ai <ns> <command> --help' for details.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
- `Commands:` 块用裸命令名(不重复二进制名),两空格缩进,描述按最长命令名对齐。
|
|
31
|
+
- 命名空间级 help 末尾加 `Run 'ai <ns> <command> --help' for details.` footer。
|
|
32
|
+
- 顶层 help 无统一子命令 `--help` 约定,故不强制加该 footer;如有 `Examples:` 段,命令展示名同样用 `ai`。
|
|
33
|
+
|
|
34
|
+
## 排序
|
|
35
|
+
|
|
36
|
+
命令清单、`Examples`、描述中内嵌的命令枚举,一律按**命令首 token 的字母升序**排列:
|
|
37
|
+
|
|
38
|
+
- 多 token 命令(如 `vm status|start|stop`)按首 token(`vm`)排序。
|
|
39
|
+
- 带尖括号 / 方括号参数的命令按命令名(参数前的裸词)排序。
|
|
40
|
+
- 大小写不敏感。
|
|
41
|
+
|
|
42
|
+
## 新增子命令检查清单
|
|
43
|
+
|
|
44
|
+
新增一个子命令时:
|
|
45
|
+
|
|
46
|
+
1. 把命令插入 `Commands:` 的字母序正确位置。
|
|
47
|
+
2. 如有示例,插入 `Examples:` 的字母序位置。
|
|
48
|
+
3. 若顶层 `task` / `sandbox` 等描述中有内嵌命令枚举,同步更新其字母序。
|
|
49
|
+
4. 同步对应 help 测试的**结构性**断言(命令是否出现、`Usage:` / `Commands:` 头是否存在),不要绑定整句文案(见 [`testing-discipline.md`](testing-discipline.md))。
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# General Rule - No Mid-Flow Questions During SKILL Execution
|
|
2
2
|
|
|
3
3
|
> **Scope**: this rule applies to **all SKILL** executions.
|
|
4
|
-
> Only the
|
|
4
|
+
> Only the exemption categories listed below may ask the user; any other mid-flow question is a violation.
|
|
5
5
|
|
|
6
6
|
## Exemption Categories
|
|
7
7
|
|
|
@@ -27,9 +27,21 @@ SKILLs currently covered by this exemption:
|
|
|
27
27
|
- `init-labels`: may confirm before deleting legacy labels not in the final mapping
|
|
28
28
|
- `commit`: may stop and confirm when its plan conflicts with the user's uncommitted changes
|
|
29
29
|
|
|
30
|
+
### Exemption 3: Entry-point requirement-sufficiency clarification
|
|
31
|
+
|
|
32
|
+
Allowed only when a SKILL judges, **at its entry point**, whether the current task's requirement information is sufficient for a reliable analysis; it may then ask the user about the **missing requirement information** to converge the requirements. Constraints:
|
|
33
|
+
|
|
34
|
+
- Limited to the `analyze-task` entry point; ask one question at a time and wait for the answer before asking the next;
|
|
35
|
+
- Used only to fill requirement-sufficiency gaps; it must **not** be used to solicit implementation / technical-choice preferences (those still go into the artifact's `## Open Questions` per the default clause);
|
|
36
|
+
- Exit the questioning and proceed to normal analysis once the question budget is reached or the user says "just analyze / skip".
|
|
37
|
+
|
|
38
|
+
SKILLs currently covered by this exemption:
|
|
39
|
+
|
|
40
|
+
- `analyze-task`: when the task description/requirements are insufficient for a reliable analysis, it may ask questions one at a time at the entry point to converge the requirements
|
|
41
|
+
|
|
30
42
|
## No-Mid-Flow-Questions Clause (default behavior)
|
|
31
43
|
|
|
32
|
-
For every SKILL execution context not covered by
|
|
44
|
+
For every SKILL execution context not covered by any exemption above, the default behavior is:
|
|
33
45
|
|
|
34
46
|
1. Do not call any user-question tool, including but not limited to `AskUserQuestion` and equivalent mechanisms that ask the user to choose.
|
|
35
47
|
2. When uncertain, proceed with the most robust option without interrupting the flow. Use this priority order:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# 通用规则 - SKILL 执行禁言
|
|
2
2
|
|
|
3
3
|
> **适用范围**:本规则适用于**所有 SKILL** 的执行过程。
|
|
4
|
-
>
|
|
4
|
+
> 仅以下列出的例外可向用户提问;不属于这些例外的发问一律按违规处理。
|
|
5
5
|
|
|
6
6
|
## 例外类型
|
|
7
7
|
|
|
@@ -27,9 +27,21 @@
|
|
|
27
27
|
- `init-labels`:删除不在最终映射中的旧 label 前可确认
|
|
28
28
|
- `commit`:检测到与用户未提交改动冲突时可停下确认
|
|
29
29
|
|
|
30
|
+
### 例外 3:入口式需求充分性澄清
|
|
31
|
+
|
|
32
|
+
仅当 SKILL 在**入口处**判断「当前任务的需求信息是否充分到可以可靠分析」时,可就**缺失的需求信息**向用户提问以收敛需求。约束:
|
|
33
|
+
|
|
34
|
+
- 仅限 `analyze-task` 入口;一次只问一个问题,等用户回答后再问下一个;
|
|
35
|
+
- 仅用于补齐需求充分性,**不得**借此征求实现方案 / 技术选型偏好(这些仍按禁言铁律写入产物的 `## 未决问题`);
|
|
36
|
+
- 达到提问预算上限或用户表示「直接分析 / skip」即退出提问,进入正常分析。
|
|
37
|
+
|
|
38
|
+
当前归入本例外的 SKILL:
|
|
39
|
+
|
|
40
|
+
- `analyze-task`:任务描述/需求信息不足以支撑可靠分析时,可在入口处逐个提问收敛需求
|
|
41
|
+
|
|
30
42
|
## 禁言条款(默认行为)
|
|
31
43
|
|
|
32
|
-
|
|
44
|
+
不属于上述任一例外的所有 SKILL 执行场景,遵循以下默认行为:
|
|
33
45
|
|
|
34
46
|
1. **禁止调用**任何向用户发问的工具(包括但不限于 `AskUserQuestion` 及等价的「征求用户选择」机制)。
|
|
35
47
|
2. **不确定时**,按「最稳健方案」自主推进,不中断对话。最稳健方案的判定优先级:
|