@minonl/dia 0.0.19 → 0.0.20

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 CHANGED
@@ -51,12 +51,16 @@ Python 原型已完成使命(行为对齐后删除);其基线数字保留
51
51
  ### npm(全局 CLI)
52
52
 
53
53
  ```bash
54
- npm i -g @minonl/dia
54
+ npm i -g @minonl/dia --allow-scripts=@minonl/dia # npm ≥ 11 默认屏蔽安装脚本,显式放行一次
55
55
  dia version && dia doctor
56
- dia update --check # 查 npm 最新版;dia update 按安装方式升级(npm 包 / 脚本安装)
56
+ dia update --check # 查 npm 最新版;dia update 走 npm 升级并补齐内置能力
57
57
  ```
58
58
 
59
- > 包里带 `dist` + `packages/{wt,job}`;persona 仍需单独 `dia persona add …`。
59
+ > npm ≥ 11 起默认不跑依赖的安装脚本(allowScripts)。放行后 `postinstall` 自动装配内置能力;
60
+ > 没放行也没关系,补一条 `dia postinstall` 即可(幂等)。也可长期放行:
61
+ > `npm config set allow-scripts=@minonl/dia --location=user`。
62
+ >
63
+ > 包里带 `dist` + `packages/{wt,job}` + `kits`;persona 仍需单独 `dia persona add …`。
60
64
  >
61
65
  > **发布方式**:GitHub Actions + npm **Trusted Publishing**(OIDC,仓库里不放 token);
62
66
  > 打 release 即触发 `.github/workflows/publish.yml`。npmjs 侧需配 Trusted Publisher:
package/dist/cli.js CHANGED
@@ -7461,9 +7461,9 @@ function bootstrapCheck() {
7461
7461
  const stamp = readStamp();
7462
7462
  const pkg = pkgVersion();
7463
7463
  if (!stamp)
7464
- return { name: "bootstrap", status: "warn", detail: "内置能力尚未装配(首次 persona add/render 或 dia collab enable 会自动装)" };
7464
+ return { name: "bootstrap", status: "warn", detail: "内置能力尚未装配(修复:dia postinstall;或安装时允许脚本 --allow-scripts=@minonl/dia)" };
7465
7465
  if (stamp.pkg !== pkg) {
7466
- return { name: "bootstrap", status: "warn", detail: `内置能力可能过期:自举戳 pkg=${stamp.pkg},当前 ${pkg};修复:dia collab enable` };
7466
+ return { name: "bootstrap", status: "warn", detail: `内置能力可能过期:自举戳 pkg=${stamp.pkg},当前 ${pkg};修复:dia postinstall` };
7467
7467
  }
7468
7468
  return { name: "bootstrap", status: "ok", detail: `内置能力已装配(pkg=${pkg},kit=${stamp.kit ?? "-"})` };
7469
7469
  }
@@ -12384,6 +12384,10 @@ async function main(rawArgv) {
12384
12384
  return r.status || 1;
12385
12385
  }
12386
12386
  out(`已更新到 ${latest}(重新打开终端/会话生效)`);
12387
+ try {
12388
+ const b = ensure(undefined, { force: true });
12389
+ out(b.ok ? `内置能力已同步(${b.kit})` : `! 内置能力未装配:${b.reason}(修复:dia postinstall)`);
12390
+ } catch {}
12387
12391
  return 0;
12388
12392
  }
12389
12393
  if (cmd === "kb") {
package/docs/status.md CHANGED
@@ -91,6 +91,7 @@
91
91
  | D0.21 | worktree 抽取 `packages/wt` | **完成** | 7 处 python→node;`dia wt`;4 套测试原样迁移全绿 |
92
92
  | D0.23 | doctor 平台版本自检 | **完成** | `platform:opencode` / `platform:dsh` 报版本(缺宿主 = warn,不判红);`tests/active-doctor.test.ts` |
93
93
  | D0.44 | 配置迁移走 LLM 任务 | **完成** | `docs/migrations/llm-migration.md`:升级只改声明;迁移=任务+判据+回滚;禁止代码里堆版本分支(安全敏感/原子场景例外) |
94
+ | D0.69 | npm ≥ 11 allowScripts 兜底 | **完成** | 文档给出 `--allow-scripts=@minonl/dia` 一次性放行 + 长期 config;`dia update` 成功后在进程内补一次 `defaultMsg.ensure(force)`;doctor 的 bootstrap 两条文案都指向 `dia postinstall` |
94
95
  | D0.68 | postinstall 自举 + 删除 install.sh | **完成** | npm 全局安装自动跑 `postinstall`(装配内置 kit + 自举戳;CI/非全局/`--ignore-scripts` 安全跳过);`dia postinstall` 手动补跑;`dia migrate data` 取代 `--migrate`;删除 `install.sh` 与 3 个守卫测试 |
95
96
  | D0.67 | npm 单一安装通道(收口) | **完成** | `dia update` 脚本安装分支统一引导 `npm i -g` + 回链;`E_WT`/`job`/`doctor wt` 报错不再让人跑 `install.sh`;`install_shadow` 修复命令统一 npm;README 主流程只留 npm,`install.sh` 降为开发/离线 |
96
97
  | D0.66 | 内置能力分层(dia-msg 用户零操作) | **完成** | `kit.install` 原子换入 + 数据根锁;版本 semver 排序;`installDir()` 校验;`collab enable` 失败退 32;自举戳 `~/.dia/state/bootstrap.json` + `doctor bootstrap` 检查;`install_shadow` 降 warn;设计见 [builtin-kit-design.md](builtin-kit-design.md) |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@minonl/dia",
3
- "version": "0.0.19",
3
+ "version": "0.0.20",
4
4
  "type": "module",
5
5
  "description": "dia (嗲) — lightweight agent framework: knowledge index, audit, session ingest",
6
6
  "bin": {