pi-scenes 0.11.0 → 0.11.1

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
@@ -266,6 +266,10 @@ Before uninstalling, `/scene off` and prune entries you don't want to keep from
266
266
 
267
267
  ## Changelog
268
268
 
269
+ ### v0.11.1 (2026-09-24)
270
+
271
+ - **Anchor-form fix for borrowed detection** — a pre-existing zero-exposure anchor entry (`{source, autoload:false, skills:[]}`) in user settings (e.g. written by ≤v0.10 without being recorded in the anchors ledger) is no longer misjudged as a user-configured global: re-activation now normalizes it back into the anchor ledger and lands the project delta instead of skipping it as borrowed
272
+
269
273
  ### v0.11.0 (2026-09-24)
270
274
 
271
275
  - **Full spatial isolation for scene packages** — plain `npm:` scene packages now land in the *project* layer as a universal delta (`{source, autoload:false, skills:["**"], extensions:["**"], prompts:["**"], themes:["**"]}`) with a zero-exposure global anchor, exactly like filtered git bundles since v0.7. One shared install (no per-project node_modules), and a fresh directory now loads **only the common layer**. Fixes the v0.7–v0.10 leak where scene npm packages sat in global settings and loaded in *every* project while the scene was active somewhere. Re-activating an existing scene migrates leaked entries automatically; user-configured global packages keep borrowed semantics
@@ -562,6 +566,10 @@ managed 注入的条目在卸载前建议先 `/scene off` + 手工清理 `packag
562
566
 
563
567
  ## 版本历史
564
568
 
569
+ ### v0.11.1(2026-09-24)
570
+
571
+ - **锚点形态借用误判修复**——全局层既有的零暴露锚点条目(`{source, autoload:false, skills:[]}`,≤v0.10 写入但 anchors 账本未记录)不再被误判为用户手配的全局配置:重新激活时归一化补入账本并正常落项目 delta,而非按借用跳过
572
+
565
573
  ### v0.11.0(2026-09-24)
566
574
 
567
575
  - **场景包全面空间隔离**——裸 `npm:` 场景包与 v0.7 起的 git 白名单包同等待遇:统一落项目层通用 delta(`{source, autoload:false, skills:["**"], extensions:["**"], prompts:["**"], themes:["**"]}`)+ 全局零暴露锚点。共享一份全局安装(零磁盘复制),新目录只加载**通用层**。修复 v0.7~v0.10 期间裸 npm 场景包写入全局 settings、场景激活期间所有项目都加载的泄漏;重新激活场景即自动迁移修复,用户手配的全局同包保持借用语义
@@ -695,21 +695,28 @@ export function makeCore(baseDir: string, projectDir?: string) {
695
695
  : { source: specOf(raw), autoload: false, skills: ["**"], extensions: ["**"], prompts: ["**"], themes: ["**"] }
696
696
  : raw;
697
697
  if (landed) {
698
- // 用户先前手配的同包全局条目(摘旧后仍在 = 非本次 pi install 写入、非旧版 managed 遗留)
699
- // → 借用语义:全局已覆盖所有项目,不落项目 delta、不加锚点
698
+ // 零暴露锚点形态判定:autoload:false 且四类资源过滤全空 —— 什么也不加载,
699
+ // 不构成「用户的全局选择」;旧版未入账的锚点也走归一化补账而非借用
700
+ const isAnchorForm = (x: PackageEntry | undefined): boolean =>
701
+ typeof x === "object" &&
702
+ x !== null &&
703
+ (x as Record<string, unknown>).autoload === false &&
704
+ ["skills", "extensions", "prompts", "themes"].every((k) => {
705
+ const v = (x as Record<string, unknown>)[k];
706
+ return !Array.isArray(v) || v.length === 0;
707
+ });
700
708
  const preUserList = preInstallPackages ?? oldUserPkgs;
701
- const inCurrentUser = userPkgs.some((x) => sameResource(x, raw));
702
- const userOwn = inCurrentUser && preUserList.some((x) => sameResource(x, raw));
703
- if (userOwn) {
709
+ const existing = userPkgs.find((x) => sameResource(x, raw));
710
+ // 用户手配 = 摘旧后仍在、pre 快照已有、且非锚点形态(功能性全局条目才算用户选择)
711
+ if (existing !== undefined && !isAnchorForm(existing) && preUserList.some((x) => sameResource(x, raw))) {
704
712
  result.borrowedPackages.push(raw);
705
713
  continue;
706
714
  }
707
- if (inCurrentUser) userPkgs = userPkgs.filter((x) => !sameResource(x, raw)); // 摘 pi install 刚写入的裸串
715
+ // 锚点归一化:裸串/旧形态 → 唯一锚点形态,并补入 anchors 账本(旧版未入账自愈)
708
716
  const anchor: PackageEntry = { source: specOf(raw), autoload: false, skills: [] };
709
- if (!anchors.some((a) => sameResource(a, anchor))) {
710
- userPkgs.push(anchor);
711
- anchors.push(anchor);
712
- }
717
+ if (!anchors.some((a) => sameResource(a, anchor))) anchors.push(anchor);
718
+ userPkgs = userPkgs.filter((x) => x !== existing && !sameEntry(x, anchor));
719
+ userPkgs.push(anchor);
713
720
  }
714
721
  let pkgsRef = landed ? projPkgs : userPkgs;
715
722
  const sink = landed ? newProjManagedPkgs : newUserManagedPkgs;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-scenes",
3
- "version": "0.11.0",
3
+ "version": "0.11.1",
4
4
  "description": "Scene switcher for pi: bundle extensions, skills, and prompt templates into a common layer + per-scene layers. /scene hot-switches with live reload (project-scoped, zero settings residue); scene-scoped workflow templates arrive via resources_discover with no config writes; scene definitions self-evolve from real usage (tool-call attribution + session-end LLM reflection).",
5
5
  "keywords": [
6
6
  "pi-package"