alanbox 0.1.1 → 0.1.2

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.
@@ -2,13 +2,13 @@
2
2
 
3
3
  `C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\0commondflowv1` 是 `alanbox` 当前主实现层,承接 CLI 命令、参数解析、Codex/Claude 子进程 runner、worker 编排、handoff、用户级 `.multirunagent` 存储、prompt 构造和 Codex/Claude 资源安装。根目录 `bin/multirunagent.js` 和 `index.js` 只负责转发到 `0commondflowv1/src/cli.js`。
4
4
 
5
- **Important:** `0commondflowv1` 是当前稳定入口;npm 包名是 `alanbox`,CLI bin 同时暴露 `alanbox` 和兼容名 `multirunagent`。不要在没有迁移计划的情况下重命名用户级 `.multirunagent` 存储目录。
5
+ **Important:** `0commondflowv1` 是当前稳定入口;npm 包名是 `alanbox`,CLI bin 暴露 `alanbox`、裸 `swam` 和兼容名 `multirunagent`。不要在没有迁移计划的情况下重命名用户级 `.multirunagent` 存储目录。
6
6
 
7
7
  **Important:** `src/runner/config.json` 默认 provider 是系统 `codex` CLI;Claude CLI 只能作为可选 provider/worker 配置启用。不要把个人 Antigravity cockpit 路径、全局 npm 安装路径或私有 home 写成通用默认配置。
8
8
 
9
9
  ### Important files
10
10
 
11
- - `src/cli.js` — 0commondflowv1 主命令分发器;加载配置、解析运行上下文,并路由到 `doctor`、`info`、`install/init`、`swarm`;`swam` 是 `swarm` 的兼容别名。
11
+ - `src/cli.js` — 0commondflowv1 主命令分发器;加载配置、解析运行上下文,并路由到 `doctor`、`info`、`install/init/update`、`swarm`;`swam` 是 `swarm` 的兼容别名,也作为 npm 独立 bin 暴露。
12
12
  - `src/args.js` — CLI 参数解析器;新增 flag 或命令参数时优先在这里统一处理。
13
13
  - `src/commands/swarm/index.js` — `swarm` 命令入口与路由;`cli.js` 通过 `require('./commands/swarm')` 解析到此,`--auto` / `--resume` 委托 `swarm/auto.js`,否则走 `swarm/custom.js`。
14
14
  - `src/commands/swarm/custom.js` — 多 worker 编排主流程;负责 worker spec 执行。
@@ -33,7 +33,7 @@
33
33
  - CLI 的 `--worker` 输入和未来 workflow JSON 最终都应转换为统一 task 数组,再交给同一个执行器处理。
34
34
  - 调整参数解析时,同步检查 `src/cli.js` 的 usage 文案、README 命令示例和相关 skills。
35
35
  - 调整 worker/handoff/storage 协议时,同步检查根目录 `skills/aibox-swam` 和 `skills/sub-codex-*` 的说明,避免 skill 仍指导旧参数或旧输出格式。
36
- - `install --target codex|claude|both` 是安装入口;未传 target 时只在交互终端询问,非交互模式必须显式传 target,避免误写用户目录。
36
+ - `install`、`init`、`update` 都会安装或更新 agent 资源;`--target codex|claude|both` 可跳过询问,未传 target 时只在交互终端询问,非交互模式必须显式传 target,避免误写用户目录。
37
37
  - `%USERPROFILE%\.multirunagent\<namespace>` 是运行结果和 handoff 的持久化位置;改写存储格式前要考虑旧 run 的读取兼容。项目内 `.sub-codex` 是旧位置,不应再作为默认输出目录。
38
38
  - scheduler、retry、resume、workflow JSON 等能力如果新增,应先复用现有 `swarm` 执行链路,再扩展状态机;当前 `swarm --auto` 已通过 `swarm/auto.js` + `swarm-executor.js` 复用普通 swarm 执行链路。
39
39
  - 默认不隔离 CLI home:不设置 `CODEX_HOME` / `CLAUDE_CONFIG_DIR`,让 Codex/Claude 使用原生登录态;只有显式配置 `accountsDir`、worker account 或 home 时才启用隔离。
@@ -46,7 +46,7 @@ async function main(argv = process.argv.slice(2)) {
46
46
  return;
47
47
  }
48
48
 
49
- if (command === 'install' || command === 'init') {
49
+ if (command === 'install' || command === 'init' || command === 'update') {
50
50
  await runInstall(context);
51
51
  return;
52
52
  }
@@ -67,6 +67,8 @@ Usage:
67
67
  node index.js info [--account 30428]
68
68
  node index.js doctor [--account 30428]
69
69
  node index.js install [--target codex|claude|both]
70
+ node index.js init
71
+ node index.js update
70
72
  node index.js swarm [options] --worker "codex:<role>:<prompt>" --worker "claude:<role>:<prompt>"
71
73
  node index.js swam [options] --worker "codex:<role>:<prompt>"
72
74
  node index.js swarm --worker "codex:a:先做 A" --worker "[codex:c:并行 C,codex:d:并行 D]" --worker "codex:e:最后汇总"
@@ -99,6 +101,7 @@ Install options:
99
101
  --codex Install only Codex resources
100
102
  --claude Install only Claude resources
101
103
  --both Install Codex and Claude resources
104
+ init/update Aliases of install; use them when you want an interactive target choice.
102
105
 
103
106
  Auto workflow options:
104
107
  --auto Let GOAP planner recommend workflow before execution
@@ -11,14 +11,14 @@
11
11
  - `swarm/auto.js` — `swarm --auto` 状态机;负责 GOAP workflow 推荐、确认门、pending/resume、执行和失败重规划。
12
12
  - `doctor.js` — 环境和 provider 健康检查;用于诊断 CLI 命令、home、认证和 dry-run。
13
13
  - `info.js` — 输出当前配置和运行信息;应避免泄露 secret 或本机敏感路径之外的无关细节。
14
- - `install.js` — 显式安装 Codex/Claude skills、hooks、mcp 和 scriptsCodex 额外维护 plugin manifest 与 marketplace。不要让普通包加载隐式安装资源。
14
+ - `install.js` — 显式安装或更新 Codex/Claude skills、hooks、mcp 和 scripts;`install`、`init`、`update` 都会进入这里,Codex 额外维护 plugin manifest 与 marketplace。不要让普通包加载隐式安装资源。
15
15
 
16
16
  ### Implementation notes
17
17
 
18
18
  - `swarm` 的 runDir 应来自 `core/storage.js`,默认在 `%USERPROFILE%\.multirunagent\<namespace>`;auto workflow run 使用 `%USERPROFILE%\.multirunagent\<namespace>\runs\<runId>`。
19
19
  - `swarm --auto` 中 `-a` 表示 repeatable agent spec、`-p` 表示 plan hint;非 auto 命令仍保持旧 account/profile 语义,文档和 usage 必须同步说明。
20
20
  - worker 执行统一通过 `swam`/`swarm` 开启;单 worker 使用一个 `--worker`,全并行多 worker 使用 `swarm --parallel-workers`,混合串行/并行用 `--worker "[spec1,spec2]"` 表达同一阶段并行。不要恢复独立 `exec` / `parallel` 命令或复制执行链路。
21
- - `install` 支持 `--target codex|claude|both`、`--codex`、`--claude`、`--both`;未传目标时只在交互终端询问,脚本/CI 中必须显式传目标。
21
+ - `install`、`init`、`update` 支持 `--target codex|claude|both`、`--codex`、`--claude`、`--both`;未传目标时只在交互终端询问,脚本/CI 中必须显式传目标。
22
22
  - `alanbox info` 输出解析后的 provider、command、env 和 worker 配置,是用户排查的重要依据;改动 provider、env、args 解析时要实际运行 `info` 检查(本地源码可用 `node bin/multirunagent.js info`,`--dry-run` 预览已移除)。
23
23
 
24
24
  ### Verification
package/README.md CHANGED
@@ -15,17 +15,19 @@ npm install -g alanbox
15
15
  ```powershell
16
16
  alanbox info
17
17
  alanbox doctor
18
+ alanbox init
19
+ alanbox update
18
20
  alanbox install --target codex
19
21
  alanbox install --target claude
20
22
  alanbox install --target both
21
- alanbox swam --namespace run-name --worker "codex:reviewer:检查当前改动"
22
- alanbox swam --namespace run-name --worker "claude:reviewer:检查当前改动"
23
+ swam --namespace run-name --worker "codex:reviewer:检查当前改动"
24
+ swam --namespace run-name --worker "claude:reviewer:检查当前改动"
23
25
  ```
24
26
 
25
- `multirunagent` remains available as a compatibility bin name.
27
+ `alanbox init` and `alanbox update` prompt you to choose Codex, Claude, or both. The package also exposes `swam` as a direct bin, so worker runs do not need the `alanbox` prefix. `multirunagent` remains available as a compatibility bin name.
26
28
 
27
29
  ## Notes
28
30
 
29
- - `install` explicitly copies bundled skills, hooks, scripts, and MCP resource placeholders to Codex and/or Claude homes.
31
+ - `init`, `update`, and `install` explicitly copy bundled skills, hooks, scripts, and MCP resource placeholders to Codex and/or Claude homes.
30
32
  - `1uiflowv1` measure and `2apiflowv1` getapi are not exposed by this npm package yet.
31
33
  - `swam` is a compatibility alias for `swarm`.
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "alanbox",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Run isolated child Codex or Claude workers with serial, parallel, and auto swarm orchestration.",
5
5
  "main": "0commondflowv1/src/cli.js",
6
6
  "bin": {
7
7
  "alanbox": "bin/multirunagent.js",
8
- "multirunagent": "bin/multirunagent.js"
8
+ "multirunagent": "bin/multirunagent.js",
9
+ "swam": "bin/multirunagent.js"
9
10
  },
10
11
  "files": [
11
12
  "bin/**",
package/skills/AGENTS.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  `C:\Users\lenovo\Desktop\my-project\101my-aitool\aibox\skills` 存放随 `alanbox` 分发的 agent skills。当前只描述 `0commondflowv1` 的 `swam`/`swarm`、`info` 和 `doctor` 用法;不要在这里接入 `1uiflowv1` 的 measure 或 `2apiflowv1` 的 getapi,除非用户重新明确要求。
4
4
 
5
- **Important:** skills 只写调用 workflow,不实现业务逻辑。发布包中的示例优先使用 `alanbox ...`;本地源码调试才使用 `node bin/multirunagent.js ...`。
5
+ **Important:** skills 只写调用 workflow,不实现业务逻辑。worker 执行示例优先使用裸 `swam ...`;初始化和资源更新使用 `alanbox init` / `alanbox update`;本地源码调试才使用 `node bin/multirunagent.js ...`。
6
6
 
7
7
  ### Important files
8
8
 
@@ -10,7 +10,7 @@ description: 当 Codex 或 Claude 需要通过 alanbox 调用 swam/swarm 执行
10
10
  ## 入口
11
11
 
12
12
  ```powershell
13
- alanbox swam --namespace run-name --worker "codex:reviewer:检查当前改动"
13
+ swam --namespace run-name --worker "codex:reviewer:检查当前改动"
14
14
  ```
15
15
 
16
16
  `swam` 是 `swarm` 的兼容别名;两者走同一条执行链路。
@@ -18,13 +18,13 @@ alanbox swam --namespace run-name --worker "codex:reviewer:检查当前改动"
18
18
  ## 调用 Codex worker
19
19
 
20
20
  ```powershell
21
- alanbox swam --namespace codex-check --worker "codex:reviewer:复核 src 目录的正确性问题"
21
+ swam --namespace codex-check --worker "codex:reviewer:复核 src 目录的正确性问题"
22
22
  ```
23
23
 
24
24
  ## 调用 Claude worker
25
25
 
26
26
  ```powershell
27
- alanbox swam --namespace claude-check --worker "claude:reviewer:复核 src 目录的正确性问题"
27
+ swam --namespace claude-check --worker "claude:reviewer:复核 src 目录的正确性问题"
28
28
  ```
29
29
 
30
30
  ## 串行和并行
@@ -32,19 +32,19 @@ alanbox swam --namespace claude-check --worker "claude:reviewer:复核 src 目
32
32
  后一个 worker 需要读取前一个 worker 的结论时,重复传 `--worker`:
33
33
 
34
34
  ```powershell
35
- alanbox swam --namespace staged-review --worker "codex:lead:先分析问题范围" --worker "claude:reviewer:基于上游结论复核"
35
+ swam --namespace staged-review --worker "codex:lead:先分析问题范围" --worker "claude:reviewer:基于上游结论复核"
36
36
  ```
37
37
 
38
38
  多个 worker 可以独立执行时,使用 `--parallel-workers`:
39
39
 
40
40
  ```powershell
41
- alanbox swam --namespace parallel-review --parallel-workers --worker "codex:a:检查前端" --worker "claude:b:检查脚本"
41
+ swam --namespace parallel-review --parallel-workers --worker "codex:a:检查前端" --worker "claude:b:检查脚本"
42
42
  ```
43
43
 
44
44
  混合串行/并行阶段时,用方括号表示同一阶段并行:
45
45
 
46
46
  ```powershell
47
- alanbox swam --namespace mixed-review --worker "codex:lead:先拆分任务" --worker "[codex:frontend:检查前端,claude:backend:检查后端]" --worker "codex:summary:汇总结论"
47
+ swam --namespace mixed-review --worker "codex:lead:先拆分任务" --worker "[codex:frontend:检查前端,claude:backend:检查后端]" --worker "codex:summary:汇总结论"
48
48
  ```
49
49
 
50
50
  ## 自动 workflow
@@ -52,13 +52,13 @@ alanbox swam --namespace mixed-review --worker "codex:lead:先拆分任务" --wo
52
52
  需要 CLI 先推荐 workflow,再确认执行时:
53
53
 
54
54
  ```powershell
55
- alanbox swam --auto "检查这个项目的主要风险" -a "codex:reviewer:检查代码正确性" -a "claude:reviewer:检查可维护性" -p "优先按目录拆分"
55
+ swam --auto "检查这个项目的主要风险" -a "codex:reviewer:检查代码正确性" -a "claude:reviewer:检查可维护性" -p "优先按目录拆分"
56
56
  ```
57
57
 
58
58
  非交互恢复待执行 workflow:
59
59
 
60
60
  ```powershell
61
- alanbox swam --resume <runId> --namespace <namespace> -y
61
+ swam --resume <runId> --namespace <namespace> -y
62
62
  ```
63
63
 
64
64
  ## 读取结果
@@ -8,7 +8,7 @@ description: 当 Codex 或 Claude 需要使用 alanbox 的 swam/swarm 串行、
8
8
  当后续 worker 必须基于先前结果展开时,使用串行 swarm:
9
9
 
10
10
  ```powershell
11
- alanbox swam --namespace run-name --worker "codex:lead:主分析任务" --worker "claude:reviewer:基于上游结果复核"
11
+ swam --namespace run-name --worker "codex:lead:主分析任务" --worker "claude:reviewer:基于上游结果复核"
12
12
  ```
13
13
 
14
14
  `swam` 是 `swarm` 的兼容别名,两者走同一条执行链路。
@@ -16,7 +16,7 @@ alanbox swam --namespace run-name --worker "codex:lead:主分析任务" --worker
16
16
  需要混合串行和并行阶段时,在一个 `--worker` 参数中用方括号包住同一阶段的多个 worker:
17
17
 
18
18
  ```powershell
19
- alanbox swam --namespace run-name --worker "codex:a:先分析 A" --worker "[codex:c:并行检查 C,claude:d:并行检查 D]" --worker "codex:e:基于 C 和 D 汇总"
19
+ swam --namespace run-name --worker "codex:a:先分析 A" --worker "[codex:c:并行检查 C,claude:d:并行检查 D]" --worker "codex:e:基于 C 和 D 汇总"
20
20
  ```
21
21
 
22
22
  上例执行顺序是 `a -> [c,d] -> e`。方括号内用英文逗号分隔;如果 prompt 里必须出现字面逗号,写成 `\,`。
@@ -30,7 +30,7 @@ Worker 规格格式:
30
30
  当用户给出自然语言目标、并希望 CLI 先推荐一个工作流时,使用自动工作流:
31
31
 
32
32
  ```powershell
33
- alanbox swam --auto "帮我检查我的项目有问题" -a "codex:reviewer:复核当前项目代码" -a "claude:reviewer:复核可维护性" -p "最好每个子文件夹一个子agent并行"
33
+ swam --auto "帮我检查我的项目有问题" -a "codex:reviewer:复核当前项目代码" -a "claude:reviewer:复核可维护性" -p "最好每个子文件夹一个子agent并行"
34
34
  ```
35
35
 
36
36
  自动工作流规则:
@@ -42,7 +42,7 @@ alanbox swam --auto "帮我检查我的项目有问题" -a "codex:reviewer:复
42
42
  - 在非交互模式下,可通过以下方式恢复一个待处理的运行:
43
43
 
44
44
  ```powershell
45
- alanbox swam --resume <runId> --namespace <namespace> -y
45
+ swam --resume <runId> --namespace <namespace> -y
46
46
  ```
47
47
 
48
48
  真实运行后读取输出: