alanbox 0.1.2 → 0.1.4
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/0boxer/AGENTS.md +26 -0
- package/0boxer/src/AGENTS.md +16 -0
- package/0boxer/src/cli.js +53 -0
- package/0boxer/src/commands/AGENTS.md +16 -0
- package/{0commondflowv1 → 0boxer}/src/commands/install.js +56 -0
- package/{0commondflowv1 → 1swarmer}/AGENTS.md +14 -12
- package/1swarmer/src/AGENTS.md +28 -0
- package/{0commondflowv1 → 1swarmer}/src/args.js +8 -1
- package/{0commondflowv1 → 1swarmer}/src/cli.js +27 -17
- package/1swarmer/src/commands/AGENTS.md +31 -0
- package/{0commondflowv1 → 1swarmer}/src/commands/doctor.js +2 -2
- package/1swarmer/src/commands/review-file.js +997 -0
- package/{0commondflowv1 → 1swarmer}/src/core/AGENTS.md +2 -2
- package/{0commondflowv1 → 1swarmer}/src/core/prompt-templates.js +1 -1
- package/{0commondflowv1 → 1swarmer}/src/core/storage.js +1 -1
- package/{0commondflowv1 → 1swarmer}/src/prompt/AGENTS.md +1 -1
- package/{0commondflowv1 → 1swarmer}/src/prompt/default.md +1 -1
- package/{0commondflowv1 → 1swarmer}/src/prompt/synthesizer.md +1 -1
- package/{0commondflowv1 → 1swarmer}/src/prompt/verifier.md +1 -1
- package/{0commondflowv1 → 1swarmer}/src/runner/AGENTS.md +4 -3
- package/{0commondflowv1 → 1swarmer}/src/runner/codex-runner.js +23 -3
- package/2designer/README.md +42 -0
- package/2designer/dist/cdp-engine-4AIWSWXO.js +314 -0
- package/2designer/dist/cdp-engine-4AIWSWXO.js.map +1 -0
- package/2designer/dist/cdp-engine-SG4K2BCX.js +10 -0
- package/2designer/dist/cdp-engine-SG4K2BCX.js.map +1 -0
- package/2designer/dist/chunk-7X7PTLZH.js +185 -0
- package/2designer/dist/chunk-7X7PTLZH.js.map +1 -0
- package/2designer/dist/chunk-DPOWNFOH.js +313 -0
- package/2designer/dist/chunk-DPOWNFOH.js.map +1 -0
- package/2designer/dist/chunk-ISUUIOO7.js +58 -0
- package/2designer/dist/chunk-ISUUIOO7.js.map +1 -0
- package/2designer/dist/chunk-NLYFLQ3C.js +74 -0
- package/2designer/dist/chunk-NLYFLQ3C.js.map +1 -0
- package/2designer/dist/chunk-UVKSRKXR.js +71 -0
- package/2designer/dist/chunk-UVKSRKXR.js.map +1 -0
- package/2designer/dist/cli.js +748 -0
- package/2designer/dist/cli.js.map +1 -0
- package/2designer/dist/index.d.ts +118 -0
- package/2designer/dist/index.js +37 -0
- package/2designer/dist/index.js.map +1 -0
- package/2designer/dist/playwright-engine-YXBY3KEN.js +186 -0
- package/2designer/dist/playwright-engine-YXBY3KEN.js.map +1 -0
- package/2designer/dist/playwright-engine-YXGDTSZ5.js +8 -0
- package/2designer/dist/playwright-engine-YXGDTSZ5.js.map +1 -0
- package/2designer/dist/tint-UD4CJ7S2.js +7 -0
- package/2designer/dist/tint-UD4CJ7S2.js.map +1 -0
- package/2designer/dist/tint-YN63MLVN.js +60 -0
- package/2designer/dist/tint-YN63MLVN.js.map +1 -0
- package/2designer/package.json +56 -0
- package/4reporter/README.md +24 -0
- package/4reporter/dist/cli.js +464 -0
- package/4reporter/dist/cli.js.map +1 -0
- package/4reporter/dist/index.d.ts +108 -0
- package/4reporter/dist/index.js +445 -0
- package/4reporter/dist/index.js.map +1 -0
- package/4reporter/package.json +39 -0
- package/README.md +20 -9
- package/bin/alanbox.js +11 -0
- package/bin/designer.js +10 -0
- package/bin/reporter.js +11 -0
- package/bin/swarmer.js +11 -0
- package/cli.js +178 -0
- package/hooks/hooks.json +1 -1
- package/mcp/README.md +7 -1
- package/mcp/config.toml +4 -0
- package/package.json +28 -11
- package/plugin/AGENTS.md +2 -2
- package/plugin/plugin.json +7 -7
- package/shared/AGENTS.md +15 -0
- package/shared/package-args.js +68 -0
- package/skills/AGENTS.md +9 -5
- package/skills/aitool/SKILL.md +36 -0
- package/skills/desginer/SKILL.md +142 -0
- package/skills/swarmer/SKILL.md +146 -0
- package/0commondflowv1/src/AGENTS.md +0 -26
- package/0commondflowv1/src/commands/AGENTS.md +0 -29
- package/bin/multirunagent.js +0 -15
- package/skills/aibox-swam/SKILL.md +0 -77
- package/skills/sub-codex-doctor/SKILL.md +0 -27
- package/skills/sub-codex-swarm/SKILL.md +0 -56
- /package/{0commondflowv1 → 1swarmer}/res/three-lens-review.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/commands/info.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/commands/swarm/auto.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/commands/swarm/custom.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/commands/swarm/index.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/handoff.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/prompt-builder.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/swarm-executor.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/workers.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/workflow-planner.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/core/workflow-storage.js +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/prompt/reviewer.md +0 -0
- /package/{0commondflowv1 → 1swarmer}/src/runner/config.json +0 -0
package/README.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# alanbox
|
|
2
2
|
|
|
3
|
-
`alanbox` is a local worker orchestration
|
|
3
|
+
`alanbox` is a local AI-tool command package. It routes package resource commands to `0boxer`, worker orchestration to `1swarmer`, runtime UI measurement to `2designer`, and Git weekly report generation to `4reporter`.
|
|
4
4
|
|
|
5
|
-
The
|
|
5
|
+
The stable worker workflow is still `swarmer` / `swarm` from `1swarmer`.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -13,21 +13,32 @@ npm install -g alanbox
|
|
|
13
13
|
## Commands
|
|
14
14
|
|
|
15
15
|
```powershell
|
|
16
|
-
|
|
16
|
+
swarmer info
|
|
17
17
|
alanbox doctor
|
|
18
18
|
alanbox init
|
|
19
19
|
alanbox update
|
|
20
20
|
alanbox install --target codex
|
|
21
21
|
alanbox install --target claude
|
|
22
22
|
alanbox install --target both
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
alanbox designer measure --url "http://localhost:3000" --selector ".dialog"
|
|
24
|
+
designer screenshot --url "http://localhost:3000" --output page.png
|
|
25
|
+
designer changelist --design design.png --runtime runtime.png --output changes.json --annotated changes.png
|
|
26
|
+
reporter weekly --path "C:\path\to\repo-or-file" --user "Your Git Name" --output weekly.md
|
|
27
|
+
alanbox reporter weekly --path "C:\path\to\repo-or-file" --user "you@example.com"
|
|
28
|
+
swarmer --namespace run-name --worker "codex:reviewer:检查当前改动"
|
|
29
|
+
swarmer --namespace run-name --worker "claude:reviewer:检查当前改动"
|
|
30
|
+
swarmer review-file "C:\path\to\file-or-dir"
|
|
31
|
+
swarmer review-file "C:\path\to\file-or-dir" --review-kind improvements
|
|
25
32
|
```
|
|
26
33
|
|
|
27
|
-
`alanbox init` and `alanbox update` prompt you to choose Codex, Claude, or both. The package also exposes `
|
|
34
|
+
`alanbox init` and `alanbox update` prompt you to choose Codex, Claude, or both. The package also exposes `swarmer`, `designer`, and `reporter` as direct bins, so those flows do not need the `alanbox` prefix.
|
|
28
35
|
|
|
29
36
|
## Notes
|
|
30
37
|
|
|
31
|
-
- `init`, `update`, and `install` explicitly copy bundled skills, hooks, scripts, and MCP
|
|
32
|
-
- `
|
|
33
|
-
- `
|
|
38
|
+
- `init`, `update`, and `install` explicitly copy bundled skills, hooks, scripts, and MCP resources to Codex and/or Claude homes. Codex installs also append the bundled `mcp/config.toml` Playwright MCP entry when `mcp_servers.playwright` is missing.
|
|
39
|
+
- `cli.js` is the package-level command router. Keep package resource command parsing inside `0boxer/src/cli.js`, worker parsing inside `1swarmer/src/cli.js`, UI parsing inside `2designer/dist/cli.js`, and Git weekly report parsing inside `4reporter/dist/cli.js`.
|
|
40
|
+
- `aibox/skills` is the package-level skill installation source. It can include `2designer` workflow guidance. `designer` is now bundled as a direct bin and as `alanbox designer ...`. `reporter` is bundled as a direct bin and as `alanbox reporter ...`. `3apiflower` is maintained as a separate local `alan-utils` API flow and is not exposed by this npm package yet.
|
|
41
|
+
- `reporter weekly --path <file-or-repo> --user <name-or-email>` scans local Git history for the current week by default and writes a Chinese Markdown weekly report; use `--since`, `--until`, `--current-branch`, `--format json`, and `--include-uncommitted` for narrower runs.
|
|
42
|
+
- `swarmer` is a compatibility alias for `swarm`.
|
|
43
|
+
- `swarmer review-file <file-or-dir>` first asks Codex and Claude to write separate initial Markdown sidecars such as `*.codex.initial.md` and `*.claude.initial.md`, then merges `[codex√]` and `[claude√]` findings into one consensus-chain Markdown report under `C:\Users\lenovo\Desktop\all-project\.tmp\swarm\<yyyy-mm-dd-HHmmss>-<hash>.md` when that workspace exists. Items use tags such as `[codex√]`, `[codex√claude❌]`, and `[codex√claude❌codex√]`; unresolved `❌` items keep being reviewed and finally end with `√`.
|
|
44
|
+
- Use `--phase initial|cross-check|all`, `--report-file <path>`, `--report-dir <path>`, `--providers codex,claude`, and `--review-kind defects|improvements` to resume, split long review runs, or switch between blocker-bug review and actionable-improvement review.
|
package/bin/alanbox.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* alanbox package command entry.
|
|
5
|
+
* Keep bin launchers thin and route command handling to package-level cli.js.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
require('../cli').main().catch((error) => {
|
|
9
|
+
console.error(error.message || error);
|
|
10
|
+
process.exitCode = 1;
|
|
11
|
+
});
|
package/bin/designer.js
ADDED
package/bin/reporter.js
ADDED
package/bin/swarmer.js
ADDED
package/cli.js
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* alanbox 包级命令路由器。
|
|
5
|
+
* 这里只判断进入哪个子流程;各子流程自己的参数解析留在各自实现里。
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const { existsSync } = require('fs');
|
|
9
|
+
const path = require('path');
|
|
10
|
+
const { spawn } = require('child_process');
|
|
11
|
+
|
|
12
|
+
const BOXER_COMMANDS = new Set(['install', 'init', 'update']);
|
|
13
|
+
const SWARMER_COMMANDS = new Set(['swarm', 'doctor', 'review-file']);
|
|
14
|
+
const DESIGNER_COMMANDS = new Set(['designer']);
|
|
15
|
+
const REPORTER_COMMANDS = new Set(['reporter']);
|
|
16
|
+
|
|
17
|
+
async function main(argv = process.argv.slice(2)) {
|
|
18
|
+
const command = argv[0] && !argv[0].startsWith('-') ? argv[0] : '';
|
|
19
|
+
|
|
20
|
+
if (!command) {
|
|
21
|
+
if (argv.includes('-h') || argv.includes('--help')) {
|
|
22
|
+
printUsage();
|
|
23
|
+
return;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
await runCommonFlow(argv);
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (command === 'help') {
|
|
31
|
+
printUsage();
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
if (command === 'swarmer') {
|
|
36
|
+
await runSwarmer(argv.slice(1));
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
if (BOXER_COMMANDS.has(command)) {
|
|
41
|
+
await runBoxer(argv);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (SWARMER_COMMANDS.has(command)) {
|
|
46
|
+
await runSwarmerFlow(argv);
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (DESIGNER_COMMANDS.has(command)) {
|
|
51
|
+
await runDesigner(argv.slice(1));
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (REPORTER_COMMANDS.has(command)) {
|
|
56
|
+
await runReporter(argv.slice(1));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
throw new Error(`unknown alanbox command: ${command}`);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async function runSwarmer(argv = process.argv.slice(2)) {
|
|
64
|
+
if (argv[0] === 'info' || argv[0] === 'doctor' || argv[0] === 'review-file') {
|
|
65
|
+
await runSwarmerFlow(argv);
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
await runSwarmerFlow(['swarm', ...argv]);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
async function runBoxer(argv) {
|
|
73
|
+
await require('./0boxer/src/cli').main(argv);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async function runSwarmerFlow(argv) {
|
|
77
|
+
await require('./1swarmer/src/cli').main(argv);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
async function runCommonFlow(argv) {
|
|
81
|
+
await runSwarmerFlow(argv);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async function runDesigner(argv = process.argv.slice(2)) {
|
|
85
|
+
const cliPath = path.join(__dirname, '2designer', 'dist', 'cli.js');
|
|
86
|
+
if (!existsSync(cliPath)) {
|
|
87
|
+
throw new Error(
|
|
88
|
+
'designer dist/cli.js not found. Build it from 2designer before running this command.',
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
await runNodeCli('designer', cliPath, argv);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function runReporter(argv = process.argv.slice(2)) {
|
|
96
|
+
const cliPath = path.join(__dirname, '4reporter', 'dist', 'cli.js');
|
|
97
|
+
if (!existsSync(cliPath)) {
|
|
98
|
+
throw new Error(
|
|
99
|
+
'reporter dist/cli.js not found. Build it from 4reporter before running this command.',
|
|
100
|
+
);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
await runNodeCli('reporter', cliPath, argv);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function runNodeCli(label, cliPath, argv) {
|
|
107
|
+
return new Promise((resolve, reject) => {
|
|
108
|
+
const child = spawn(process.execPath, [cliPath, ...argv], {
|
|
109
|
+
stdio: 'inherit',
|
|
110
|
+
env: process.env,
|
|
111
|
+
});
|
|
112
|
+
|
|
113
|
+
child.on('error', reject);
|
|
114
|
+
child.on('exit', (code, signal) => {
|
|
115
|
+
if (signal) {
|
|
116
|
+
reject(new Error(`${label} exited with signal ${signal}`));
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (code && code !== 0) {
|
|
121
|
+
const error = new Error(`${label} exited with code ${code}`);
|
|
122
|
+
error.exitCode = code;
|
|
123
|
+
reject(error);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
resolve();
|
|
128
|
+
});
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function printUsage() {
|
|
133
|
+
console.log(`
|
|
134
|
+
alanbox command router
|
|
135
|
+
|
|
136
|
+
Usage:
|
|
137
|
+
alanbox doctor
|
|
138
|
+
alanbox install --target codex|claude|both
|
|
139
|
+
swarmer info
|
|
140
|
+
swarmer doctor
|
|
141
|
+
swarmer review-file C:\\path\\to\\file.ts
|
|
142
|
+
alanbox swarmer [options] --worker "codex:<role>:<prompt>"
|
|
143
|
+
alanbox swarm [options] --worker "codex:<role>:<prompt>"
|
|
144
|
+
alanbox review-file C:\\path\\to\\file.ts
|
|
145
|
+
swarmer [options] --worker "codex:<role>:<prompt>"
|
|
146
|
+
alanbox designer <command> [options]
|
|
147
|
+
designer <command> [options]
|
|
148
|
+
alanbox reporter weekly --path C:\\repo --user "Your Git Name"
|
|
149
|
+
reporter weekly --path C:\\repo --user "Your Git Name"
|
|
150
|
+
|
|
151
|
+
Command groups:
|
|
152
|
+
install, init, update 0boxer package/resource commands
|
|
153
|
+
swarmer, swarm, doctor 1swarmer worker orchestration and provider diagnostics
|
|
154
|
+
swarmer info 1swarmer worker execution config check
|
|
155
|
+
designer 2designer runtime UI measurement CLI
|
|
156
|
+
reporter 4reporter Git weekly report CLI
|
|
157
|
+
|
|
158
|
+
Examples:
|
|
159
|
+
swarmer info
|
|
160
|
+
swarmer doctor
|
|
161
|
+
swarmer review-file C:\\repo\\src\\index.ts
|
|
162
|
+
swarmer --namespace run-name --worker "codex:reviewer:检查当前改动"
|
|
163
|
+
alanbox designer measure --url http://localhost:3000 --selector ".dialog"
|
|
164
|
+
alanbox designer screenshot --url http://localhost:3000 --output page.png
|
|
165
|
+
reporter weekly --path C:\\repo --user "Your Git Name" --output weekly.md
|
|
166
|
+
`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
module.exports = {
|
|
170
|
+
main,
|
|
171
|
+
printUsage,
|
|
172
|
+
runBoxer,
|
|
173
|
+
runCommonFlow,
|
|
174
|
+
runSwarmerFlow,
|
|
175
|
+
runSwarmer,
|
|
176
|
+
runDesigner,
|
|
177
|
+
runReporter,
|
|
178
|
+
};
|
package/hooks/hooks.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"description": "Optional Codex hook examples for
|
|
2
|
+
"description": "Optional Codex hook examples for alanbox. Keep disabled unless the local Codex hook schema is explicitly configured.",
|
|
3
3
|
"hooks": {
|
|
4
4
|
"SessionStart": [
|
|
5
5
|
{
|
package/mcp/README.md
CHANGED
|
@@ -2,4 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
This directory is reserved for optional alanbox MCP resources.
|
|
4
4
|
|
|
5
|
-
The installer copies this directory to Codex and Claude resource homes when present. No MCP server is implemented here yet; keep this placeholder so packaged installs still create the target `mcp/alanbox` directory.
|
|
5
|
+
The installer copies this directory to Codex and Claude resource homes when present. No alanbox-owned MCP server is implemented here yet; keep this placeholder so packaged installs still create the target `mcp/alanbox` directory.
|
|
6
|
+
|
|
7
|
+
For Codex installs, `alanbox install/init/update --target codex` also ensures the user's Codex MCP config has the bundled `mcp_servers.playwright` entry from `config.toml`. Existing Playwright MCP entries are left untouched.
|
|
8
|
+
|
|
9
|
+
### Important files
|
|
10
|
+
|
|
11
|
+
- `config.toml` — source MCP config fragment copied into Codex config only when `[mcp_servers.playwright]` is missing.
|
package/mcp/config.toml
ADDED
package/package.json
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alanbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Run isolated child Codex or Claude workers with serial, parallel, and auto swarm orchestration.",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"alanbox": "bin/
|
|
8
|
-
"
|
|
9
|
-
"
|
|
7
|
+
"alanbox": "bin/alanbox.js",
|
|
8
|
+
"swarmer": "bin/swarmer.js",
|
|
9
|
+
"designer": "bin/designer.js",
|
|
10
|
+
"reporter": "bin/reporter.js"
|
|
10
11
|
},
|
|
11
12
|
"files": [
|
|
13
|
+
"cli.js",
|
|
12
14
|
"bin/**",
|
|
13
|
-
"
|
|
15
|
+
"shared/**",
|
|
16
|
+
"0boxer/**",
|
|
17
|
+
"1swarmer/**",
|
|
18
|
+
"2designer/package.json",
|
|
19
|
+
"2designer/dist/**",
|
|
20
|
+
"4reporter/package.json",
|
|
21
|
+
"4reporter/dist/**",
|
|
14
22
|
"skills/**",
|
|
15
23
|
"plugin/**",
|
|
16
24
|
"hooks/**",
|
|
@@ -20,10 +28,12 @@
|
|
|
20
28
|
"LICENSE"
|
|
21
29
|
],
|
|
22
30
|
"scripts": {
|
|
23
|
-
"swarm": "node bin/
|
|
24
|
-
"doctor": "node bin/
|
|
25
|
-
"
|
|
26
|
-
"
|
|
31
|
+
"swarm": "node bin/swarmer.js",
|
|
32
|
+
"doctor": "node bin/alanbox.js doctor",
|
|
33
|
+
"designer": "node bin/designer.js",
|
|
34
|
+
"reporter": "node bin/reporter.js",
|
|
35
|
+
"test": "node bin/alanbox.js --help && node bin/alanbox.js swarmer info && node bin/swarmer.js info && node bin/swarmer.js doctor --help && node bin/designer.js --help && node bin/reporter.js --help",
|
|
36
|
+
"validate": "node bin/swarmer.js info && node bin/designer.js --help && node bin/reporter.js --help"
|
|
27
37
|
},
|
|
28
38
|
"keywords": [
|
|
29
39
|
"codex",
|
|
@@ -41,6 +51,13 @@
|
|
|
41
51
|
},
|
|
42
52
|
"engines": {
|
|
43
53
|
"node": ">=20.0.0"
|
|
54
|
+
},
|
|
55
|
+
"dependencies": {
|
|
56
|
+
"commander": "^14.0.3",
|
|
57
|
+
"sharp": "^0.34.5",
|
|
58
|
+
"ws": "^8.20.0"
|
|
59
|
+
},
|
|
60
|
+
"optionalDependencies": {
|
|
61
|
+
"playwright": "^1.59.1"
|
|
44
62
|
}
|
|
45
63
|
}
|
|
46
|
-
|
package/plugin/AGENTS.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
## alanbox plugin
|
|
2
2
|
|
|
3
|
-
`C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\plugin` 存放源码侧 Codex plugin manifest。安装时 `
|
|
3
|
+
`C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\plugin` 存放源码侧 Codex plugin manifest。安装时 `0boxer/src/commands/install.js` 会把本目录复制到用户插件目录的 `plugins/alanbox/.codex-plugin/`,所以源码目录名是 `plugin/`,安装目标目录名才是 `.codex-plugin/`。
|
|
4
4
|
|
|
5
5
|
**Important:** 这里是 Codex 插件展示与 skill 发现配置,不是 Claude 配置。Claude 侧只复用 `skills/`、`hooks/`、`scripts/`、`mcp/` 资源,不读取 `plugin.json`。
|
|
6
6
|
|
|
7
7
|
### Important files
|
|
8
8
|
|
|
9
|
-
- `plugin.json` — Codex plugin manifest;`skills` 必须继续指向 `./skills/`,默认提示词应只描述当前真实入口 `
|
|
9
|
+
- `plugin.json` — Codex plugin manifest;`skills` 必须继续指向 `./skills/`,默认提示词应只描述当前真实入口 `aitool`、`swarmer`/`swarm`、`info`、`doctor` 和 `designer`。
|
|
10
10
|
|
|
11
11
|
### Implementation notes
|
|
12
12
|
|
package/plugin/plugin.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alanbox",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Codex skills for using alanbox
|
|
3
|
+
"version": "0.1.2",
|
|
4
|
+
"description": "Codex skills for using alanbox AI tools, swarmer worker orchestration, and designer UI measurement.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "local"
|
|
7
7
|
},
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
"skills": "./skills/",
|
|
17
17
|
"interface": {
|
|
18
18
|
"displayName": "alanbox",
|
|
19
|
-
"shortDescription": "Use alanbox
|
|
20
|
-
"longDescription": "Provides concise skills that explain how to
|
|
19
|
+
"shortDescription": "Use alanbox for swarmer workers, diagnostics, and designer UI measurement.",
|
|
20
|
+
"longDescription": "Provides concise skills that explain how to choose alanbox tools, call swarmer/swarm for child workers, run parallel or auto workflows, diagnose with info/doctor, and use designer for UI measurement.",
|
|
21
21
|
"developerName": "local",
|
|
22
22
|
"category": "Productivity",
|
|
23
23
|
"capabilities": [
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
"Automation"
|
|
26
26
|
],
|
|
27
27
|
"defaultPrompt": [
|
|
28
|
-
"
|
|
29
|
-
"Use
|
|
30
|
-
"
|
|
28
|
+
"Choose the correct alanbox tool for this task.",
|
|
29
|
+
"Use swarmer to run child Codex or Claude workers.",
|
|
30
|
+
"Use designer to measure or compare runtime UI when needed."
|
|
31
31
|
]
|
|
32
32
|
}
|
|
33
33
|
}
|
package/shared/AGENTS.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
## shared
|
|
2
|
+
|
|
3
|
+
`C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\shared` 存放 `alanbox` 包级共享工具。这里的代码可以被 `0boxer`、根 CLI 或其他流程复用,但必须保持轻量、无副作用,不应放具体业务流程的 runner、安装写入逻辑或 provider 调用。
|
|
4
|
+
|
|
5
|
+
**Important:** 共享工具被发布包使用时,必须确认 `package.json.files` 包含 `shared/**`。不要把 `1swarmer` 的 worker/swarm 参数解析搬到这里,除非后续明确要做跨流程统一参数模型。
|
|
6
|
+
|
|
7
|
+
### Important files
|
|
8
|
+
|
|
9
|
+
- `package-args.js` — 包级资源命令参数解析器;当前服务 `0boxer` 的 `install/init/update`,只解析 target 相关选项。
|
|
10
|
+
|
|
11
|
+
### Implementation notes
|
|
12
|
+
|
|
13
|
+
- 共享模块不要在 require 时读写用户目录、启动 provider、读取个人配置或修改环境变量。
|
|
14
|
+
- 新增共享工具时,优先让命名表达所属语义,例如 `package-*`、`path-*`,避免和 `1swarmer/src/args.js` 这种流程专属模块混淆。
|
|
15
|
+
- 修改共享模块后,从包根目录运行 `npm test` 和 `npm run validate`;涉及发布包内容时再跑 `npm pack --json --dry-run`。
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Package-resource command argument parser.
|
|
3
|
+
* This parser is intentionally separate from 1swarmer worker/swarm args.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const VALUE_FLAGS = new Set(['target', 'to', 'platform']);
|
|
7
|
+
const BOOLEAN_FLAGS = new Set(['codex', 'claude', 'both']);
|
|
8
|
+
|
|
9
|
+
function parsePackageArgs(argv = []) {
|
|
10
|
+
const result = { _: [] };
|
|
11
|
+
|
|
12
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
13
|
+
const arg = argv[i];
|
|
14
|
+
|
|
15
|
+
if (arg === '--') {
|
|
16
|
+
result._.push(...argv.slice(i + 1));
|
|
17
|
+
break;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
if (!arg.startsWith('-') || arg === '-') {
|
|
21
|
+
result._.push(arg);
|
|
22
|
+
continue;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const { key, inlineValue } = splitFlag(arg);
|
|
26
|
+
|
|
27
|
+
if (BOOLEAN_FLAGS.has(key)) {
|
|
28
|
+
if (inlineValue !== undefined) {
|
|
29
|
+
throw new Error(`${formatFlag(key)} does not take a value`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
result[key] = true;
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
if (VALUE_FLAGS.has(key)) {
|
|
37
|
+
const value = inlineValue !== undefined ? inlineValue : argv[i + 1];
|
|
38
|
+
if (inlineValue === undefined) i += 1;
|
|
39
|
+
|
|
40
|
+
if (!value || String(value).startsWith('-')) {
|
|
41
|
+
throw new Error(`missing value for ${formatFlag(key)}`);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
result[key] = value;
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
throw new Error(`unknown package option: ${arg}`);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
return result;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function splitFlag(arg) {
|
|
55
|
+
const [keyPart, inlineValue] = arg.split('=', 2);
|
|
56
|
+
return {
|
|
57
|
+
key: keyPart.replace(/^--?/, ''),
|
|
58
|
+
inlineValue,
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function formatFlag(key) {
|
|
63
|
+
return `--${key}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = {
|
|
67
|
+
parsePackageArgs,
|
|
68
|
+
};
|
package/skills/AGENTS.md
CHANGED
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
## aibox skills
|
|
2
2
|
|
|
3
|
-
`C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\skills` 存放随 `alanbox` 分发的 agent skills
|
|
3
|
+
`C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\skills` 存放随 `alanbox` 分发的 agent skills,按 `0boxer` 的安装命令作为统一安装源。当前用 `swarmer` 承载 `1swarmer` 的 `swarmer`/`swarm`、`info` 用法,用 `aitool` 作为 alanbox 总入口说明,并保留用户明确要求接入的 `2designer` UI 高精度还原 workflow;不要在这里接入 `3apiflower` 的 `alan-utils` / `st`,除非用户重新明确要求。
|
|
4
4
|
|
|
5
|
-
**Important:** skills 只写调用 workflow,不实现业务逻辑。worker 执行示例优先使用裸 `
|
|
5
|
+
**Important:** skills 只写调用 workflow,不实现业务逻辑。worker 执行示例优先使用裸 `swarmer ...`;初始化和资源更新使用 `alanbox init` / `alanbox update`;本地源码调试才使用 `node bin/alanbox.js ...`。
|
|
6
|
+
|
|
7
|
+
**Important:** 本目录是 `alanbox install/init/update` 的安装源;`2designer` 不再维护 standalone skill 发布入口。`designer` 相关 agent workflow 以本目录 `desginer/SKILL.md` 为准。
|
|
6
8
|
|
|
7
9
|
### Important files
|
|
8
10
|
|
|
9
|
-
- `
|
|
10
|
-
- `
|
|
11
|
-
- `
|
|
11
|
+
- `aitool/SKILL.md` — `alanbox` 总入口 skill;用于在 `swarmer`、`designer` 和安装/更新命令之间选择正确入口。
|
|
12
|
+
- `swarmer/SKILL.md` — 合并后的 worker 编排、配置检查与 provider 诊断 skill;同时覆盖 `codex:`、`claude:` worker、串行/并行/auto workflow、`info` 和 `doctor`。
|
|
13
|
+
- `desginer/SKILL.md` — `2designer` 的 UI 高精度还原 workflow;目录名当前按现状保留,内容通过 `designer` 的 `measure` / `screenshot` / `overlay` / `changelist` 命令做设计稿网站与运行页的像素级对比,并要求用 `all/message.md` 固定截图坐标、用 `regions\word\<id>` 调用 `codex:` 或 `claude:` 子 agent 并发生成组件树 TODO。
|
|
12
14
|
|
|
13
15
|
### Implementation notes
|
|
14
16
|
|
|
15
17
|
- 新增或修改 CLI 参数时,同步检查对应 `SKILL.md` 示例。
|
|
16
18
|
- `install` 会把本目录中含 `SKILL.md` 的子目录安装到 Codex 的 `~/.codex/skills`,以及 Claude 的 `~/.claude/skill`。
|
|
19
|
+
- `desginer` 调用的是 `designer` CLI;更新 `2designer` 的命令名、参数或产物路径约定时,同步更新本目录同名 skill。UI 对齐流程的长期产物约定包括 `all\message.md`、每轮 `changelist.json`、`regions\word|graphic\<id>` 和合并后的组件树 `todo.json`。
|
|
20
|
+
- `aibox-swarmer`、`sub-codex-swarmer`、`sub-codex-doctor` 已合并进 `swarmer`;安装/更新逻辑会清理这些旧 skill 名,避免用户环境里出现重复入口。
|
|
17
21
|
- 不要把一次性本机 runId、账号、token、私有服务地址写进 skill。
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: aitool
|
|
3
|
+
description: 当需要使用 alanbox 这个本地 AI 工具包,并需要在 swarmer worker 编排、designer UI 测量或安装/更新资源之间选择正确入口时使用。
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# aitool
|
|
7
|
+
|
|
8
|
+
`alanbox` 是本机 AI 工具包的总入口。先判断任务属于哪一类,再调用对应 CLI 或 skill;不要把所有参数解析都塞到一个命令里。
|
|
9
|
+
|
|
10
|
+
## 入口选择
|
|
11
|
+
|
|
12
|
+
- 子 worker 编排、串行/并行复核、自动 workflow 和 `info` 配置检查:使用 `swarmer` skill 和 `swarmer` / `alanbox swarm` 命令。
|
|
13
|
+
- provider 健康检查:使用 `alanbox doctor` 或 `swarmer doctor`,该命令归 `1swarmer`。
|
|
14
|
+
- UI 高精度还原、运行页测量、截图、overlay 对比:使用 `designer` CLI;如果任务是按设计稿精修页面,优先使用当前安装的 UI 还原 skill。
|
|
15
|
+
- 安装或更新 Codex/Claude 资源:使用 `alanbox init`、`alanbox update` 或 `alanbox install --target codex|claude|both`。
|
|
16
|
+
- `3apiflower` API flow 当前作为独立本地 `alan-utils` / `st` 工作区维护,不作为 `alanbox` npm 包公开命令;除非用户明确要求,不要把它接进 skills 或默认入口。
|
|
17
|
+
|
|
18
|
+
## 常用命令
|
|
19
|
+
|
|
20
|
+
```powershell
|
|
21
|
+
alanbox --help
|
|
22
|
+
swarmer info
|
|
23
|
+
alanbox doctor
|
|
24
|
+
alanbox install --target codex
|
|
25
|
+
alanbox install --target claude
|
|
26
|
+
swarmer --namespace run-name --worker "codex:reviewer:检查当前改动"
|
|
27
|
+
designer measure --url "http://localhost:3000" --selector ".dialog"
|
|
28
|
+
designer screenshot --url "http://localhost:3000" --output page.png
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## 维护边界
|
|
32
|
+
|
|
33
|
+
- CLI 负责真实执行;skills 只负责指导调用。
|
|
34
|
+
- `swarmer` 是 worker 编排稳定入口;内部 `swarm` 是同一条执行链路。
|
|
35
|
+
- `designer` 只采集运行时 UI 数据和图片,不替 agent 做判断。
|
|
36
|
+
- 安装命令会复制 bundled skills、hooks、scripts 和 MCP 占位资源;普通 `npm install` / `npx` 不应隐式注入用户 agent skills。
|