Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

chore(pr): merge latest main into skill discovery

yuxinod742fa192f94
diff --cc docs/spec/06-delivery/04-e2e-test-plan.md
index deb7881ed,633af017f..c31f55e74
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@@ -14348,26 -14378,18 +14378,42 @@@ the latest destination. These assertion
scripts/e2e-scheduled-workspace.mjs`, using production Electron dispatch and
real Rust/stdio/SQLite. Only external inference is replaced with an observer.
+### E2E-PLUGIN-pi-npm-skill-discovery
+
+- **Preconditions:** Isolated npm package directory and plugin import storage;
+ a package declaring `pi.skills`, optionally executable extensions. No provider.
+- **Steps:** Open Skills, discover the candidate, cancel import, confirm import,
+ read the registered skill body and resources, reload, and attempt a duplicate.
+ Change metadata during confirmation; retry discovery after an error; discover
+ with more than 256 hoisted dependencies and an unreadable scope. Simulate a
+ runtime load failure after host registration and inspect the refreshed state.
+- **Expected:** No implicit import/execution, native explicit consent, preserved
+ resources and runtime skill body, stable imported state, no duplicate import,
+ stale consent refusal, and visible/recoverable errors. Unregistered leftover
+ directories do not count as imports; scoped packages are discovered. Unrelated
+ dependencies and unreadable scopes do not hide healthy skills. A registered
+ import remains marked imported after runtime failure while its error stays visible.
+- **Specs:** 07-plugins/16-trusted-extensions; ADR pi-npm-skill-discovery.
+- **Acceptance:** Plugin skill discovery and explicit trust boundary.
+- **Milestone:** Post-MVP compatibility.
+- **Status:** Automated via `apps/desktop/test/pi-skill-discovery.test.mjs` (real
+ import and plugin child process, native dialog boundary controlled) and
+ `node scripts/e2e-pi-skill-discovery-ui.mjs` (real React/Chromium panel with
+ controlled IPC results). Optional `PI_SKILL_PACKAGE_FIXTURE` points to an
+ unpacked published package for the reported planning-with-files path.
++
+ ### E2E-SESSION-temporary-attachment-fork: Preview and independent branch inputs
+
+ - **Steps**: In a task without a project, paste text above the long-paste
+ threshold, send it, and click its transcript attachment. Return from the
+ preview, create a branch, and open the same attachment in the child. Delete
+ the source task and reopen the child attachment; branch the child again.
+ - **Expected**: Every preview shows the original saved bytes. Each branch path
+ belongs to that branch's scratch input directory. No project is required, and
+ no access to another task's scratch directory is granted. A bounded fork
+ excludes later-only and unreferenced inputs.
+ - **Automation**: `scripts/e2e-composer-paste.mjs` covers long-text save, real
+ Electron file read, temporary-task preview, and back navigation. Host tests
+ `fork_preserves_referenced_pasted_files_independently` and `sessions::fork_files`
+ cover ownership, deletion, repeated/bounded forks, retained checkpoint paths,
+ expired inputs, rollback, and symlink rejection.
diff --cc docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
index 2e1d5f713,75ac12b71..8b849d637
--- a/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/zh-CN/spec/06-delivery/04-e2e-test-plan.md
@@@ -8514,26 -8538,15 +8538,39 @@@ the latest destination. These assertion
宿主 RPC 路径由 `scripts/e2e-smoke.mjs` 覆盖提供商的创建与列举,但没有套件
驱动手工编辑的 `config_json`。
+### E2E-PLUGIN-pi-npm-skill-discovery
+
+- **Preconditions:** Isolated npm package directory and plugin import storage;
+ a package declaring `pi.skills`, optionally executable extensions. No provider.
+- **Steps:** Open Skills, discover the candidate, cancel import, confirm import,
+ read the registered skill body and resources, reload, and attempt a duplicate.
+ Change metadata during confirmation; retry discovery after an error; discover
+ with more than 256 hoisted dependencies and an unreadable scope. Simulate a
+ runtime load failure after host registration and inspect the refreshed state.
+- **Expected:** No implicit import/execution, native explicit consent, preserved
+ resources and runtime skill body, stable imported state, no duplicate import,
+ stale consent refusal, and visible/recoverable errors. Unregistered leftover
+ directories do not count as imports; scoped packages are discovered. Unrelated
+ dependencies and unreadable scopes do not hide healthy skills. A registered
+ import remains marked imported after runtime failure while its error stays visible.
+- **Specs:** 07-plugins/16-trusted-extensions; ADR pi-npm-skill-discovery.
+- **Acceptance:** Plugin skill discovery and explicit trust boundary.
+- **Milestone:** Post-MVP compatibility.
+- **Status:** Automated via `apps/desktop/test/pi-skill-discovery.test.mjs` (real
+ import and plugin child process, native dialog boundary controlled) and
+ `node scripts/e2e-pi-skill-discovery-ui.mjs` (real React/Chromium panel with
+ controlled IPC results). Optional `PI_SKILL_PACKAGE_FIXTURE` points to an
+ unpacked published package for the reported planning-with-files path.
++
+ ### E2E-SESSION-temporary-attachment-fork:临时任务预览与独立分支附件
+
+ - **步骤**:在没有项目的任务中粘贴超过长文本阈值的内容并发送,点击对话中的附件。
+ 返回后创建分支并打开同一附件;删除原任务,再打开分支附件,并继续创建分支。
+ - **预期**:每次预览均显示原始文件内容;各分支引用自身的 scratch 输入目录,
+ 不需要打开项目,也不授予跨任务读取权限。按消息截断的分支不复制后续消息独有
+ 或未引用的输入文件。
+ - **自动化**:`scripts/e2e-composer-paste.mjs` 覆盖长文本保存、真实 Electron
+ 文件读取、临时任务预览及返回。主机测试
+ `fork_preserves_referenced_pasted_files_independently` 和 `sessions::fork_files`
+ 覆盖附件归属、删除、重复与截断分支、保留的压缩检查点引用、过期输入、失败回滚
+ 及符号链接拒绝。