pi-webapp 0.1.55-alpha.2 → 0.1.55-alpha.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.
Files changed (36) hide show
  1. package/README.md +18 -3
  2. package/README.zh-CN.md +19 -4
  3. package/assets/readme/README.md +14 -1
  4. package/assets/readme/openpencil.png +0 -0
  5. package/dist/extension.js +48 -48
  6. package/dist/hosted-recovery.js +3 -3
  7. package/dist/hosted-worker.js +2 -2
  8. package/docs/hosted-plugin-capabilities-rfc.md +3 -2
  9. package/docs/hosted-plugin-installation.md +13 -1
  10. package/package.json +14 -4
  11. package/web/dist/.vite/manifest.json +33 -33
  12. package/web/dist/assets/{MarkdownText-DF8BJV5i.js → MarkdownText-B0lTkHnh.js} +4 -4
  13. package/web/dist/assets/{app-DwYC983k.js → app-BmaB_3Fk.js} +6 -6
  14. package/web/dist/assets/app.js +4 -4
  15. package/web/dist/assets/{code-editor-Njczr4Aq.js → code-editor-C6H898SO.js} +4 -4
  16. package/web/dist/assets/{dist-BFaxoH5a.js → dist-B0PC9_Nt.js} +2 -2
  17. package/web/dist/assets/{dist-D2xI7N8L.js → dist-B13-0-xd.js} +2 -2
  18. package/web/dist/assets/{dist-BSEV8UWP.js → dist-B7el5Xxf.js} +2 -2
  19. package/web/dist/assets/{dist-BpfysUin.js → dist-BC5rhbA9.js} +2 -2
  20. package/web/dist/assets/{dist-xLBkmO57.js → dist-BDYcNjGw.js} +2 -2
  21. package/web/dist/assets/{dist-l9rzcKKN.js → dist-Bk-i0mDA.js} +2 -2
  22. package/web/dist/assets/{dist-CjWP7qLx.js → dist-CCRolIbm.js} +2 -2
  23. package/web/dist/assets/{dist-DEGJW0Al.js → dist-CJ51vQxV.js} +2 -2
  24. package/web/dist/assets/{dist-CLXF6v7a.js → dist-CsB02yZG.js} +2 -2
  25. package/web/dist/assets/{dist-B88A-0-q.js → dist-DJHsuvn-.js} +2 -2
  26. package/web/dist/assets/{dist-B-bd7VCM.js → dist-tUJ9MRsj.js} +2 -2
  27. package/web/dist/assets/{graphql-a_9GNzod.js → graphql-BF2oJ7rL.js} +2 -2
  28. package/web/dist/assets/{http-DokH81pJ.js → http-DAsDLqNF.js} +2 -2
  29. package/web/dist/assets/{php-BYAot5gz.js → php-9gqNKxQq.js} +2 -2
  30. package/web/dist/assets/{plugin-BZPaYR4m.js → plugin-11j8L285.js} +2 -2
  31. package/web/dist/assets/{plugin-BGIBdp5R.js → plugin-Brtr3RkZ.js} +3 -3
  32. package/web/dist/assets/{plugin-AWio_je_.js → plugin-DmtAnobQ.js} +2 -2
  33. package/web/dist/assets/{rst-CUsouaiW.js → rst-C7qSPPW4.js} +2 -2
  34. package/web/dist/assets/{ruby-eGmSFUio.js → ruby-oaMY0UVj.js} +2 -2
  35. package/web/dist/assets/{svelte-CEoWEKJ2.js → svelte-P19aQrs9.js} +2 -2
  36. package/web/dist/assets/{vue-SlhNqE3a.js → vue-BXooeCPT.js} +2 -2
package/README.md CHANGED
@@ -50,6 +50,21 @@ npx pi-webapp
50
50
 
51
51
  **Optional plugin:** explicitly install and enable `@chengzhiyi/pi-excalidraw` in **Plugins → Official plugins**, using an available compatible release. It is not bundled or auto-installed, and needs no drawing-service account. [Setup, saving & recovery](docs/diagrams.md).
52
52
 
53
+ ## OpenPencil: design screens with Pi, on a real design canvas
54
+
55
+ **Ask → see it land → undo or refine.** Ask Pi for a login screen, a dashboard, or a component. Its changes appear on the [OpenPencil](https://github.com/open-pencil/open-pencil) canvas as it makes them, with the changed frames selected and an **Undo** for the latest one.
56
+
57
+ [![The OpenPencil plugin beside a conversation: Pi has added a sign-in screen and a dashboard to the canvas, and a toast offers Undo](assets/readme/openpencil.png)](assets/readme/openpencil.png)
58
+
59
+ *Real plugin UI with a scripted agent turn, not a live model transcript. Click the image for full size.*
60
+
61
+ - **A full design editor:** frames, auto layout, components, pen, text, boolean operations, pages and layers, plus Code (JSX / React + Tailwind / HTML) and Lint (design check) panels and PNG/JPG/WebP/SVG export.
62
+ - **Stay in charge:** Pi sends typed operations, never code. Lock layers or limit Pi to the selection; undo, saving and locking are yours only, and Pi can't overwrite edits it hasn't seen.
63
+ - **Preview it live:** **Preview** runs the design on the canvas, with buttons, switches, sliders, tabs and text fields working as real controls.
64
+ - **Keep it in your repo:** save designs as `.fig` files under `designs/` in the workspace and commit them with the rest of your code.
65
+
66
+ **Optional plugin:** install and enable `@chengzhiyi/pi-pencil` (**OpenPencil**) in **Plugins → Official plugins**. It is not bundled or auto-installed, runs locally, and needs no account; OpenPencil's own AI chat is left out because Pi does that job. Not in a stable release yet. [Install, design & save](docs/en/design.md).
67
+
53
68
  ## Core features
54
69
 
55
70
  | Capability | What you can do |
@@ -60,7 +75,7 @@ npx pi-webapp
60
75
  | **Real integrated terminals** | Run interactive shells in the workspace, use Ctrl+C, and keep processes and output when switching chats or panels. |
61
76
  | **Git review and workflow** | Review changes and inline diffs, stage/unstage files, commit the staged index, create/switch local branches, and explore commit history with a branch graph. |
62
77
  | **A flexible workbench** | Resize, split, or expand tool panels; use workspace focus mode while keeping navigation within reach. Each chat retains its own tool tabs until the page reloads. |
63
- | **Models, skills, and plugins** | Configure providers and models, manage Pi packages/extensions/skills, and toggle bundled Files, Terminal, and Git capabilities. Supported Web plugins can add their own UI. |
78
+ | **Models, skills, and plugins** | Configure providers and models, manage Pi packages/extensions/skills, and toggle bundled Files, Terminal, and Git capabilities. Optional official plugins add Excalidraw diagrams and OpenPencil UI design, and supported Web plugins can add their own UI. |
64
79
  | **Browser and desktop entry points** | Use the background launcher, open `/web` from Pi's terminal, or launch the Electron desktop app with bundled Node/Pi. |
65
80
 
66
81
  > Chats run independently, but files and Git changes in the same worktree are shared. Switching chats does not stop work; stopping the service ends its background tasks. Terminals and agent tools run with your system permissions, not in a sandbox.
@@ -147,7 +162,7 @@ The **pi** desktop app bundles Node and Pi—no separate runtime installation ne
147
162
  | **Guardrails at the host boundary** | Loopback transport uses token/origin checks; file previews enforce workspace and symlink boundaries. Git writes reject stale state and coordinate known chats sharing the worktree. These checks are not an OS sandbox. |
148
163
  | **One UI across entry points** | React + TypeScript power the workbench, Vite/esbuild bundle the app, and Electron provides the desktop shell without a separate conversation UI. |
149
164
 
150
- **Optional, not built in:** drawings belong to the official `@chengzhiyi/pi-excalidraw` plugin, installed and enabled explicitly in Plugins. The host ships no editor/fonts and does not auto-install it on offline startup. Hosted plugins use a separate Node process for lifecycle management—not a security sandbox. Development protocol/plugin artifacts on this branch are verification-only, not a published release. See [drawing migration and recovery](docs/diagrams.md) for update behavior and preserved backups.
165
+ **Optional, not built in:** drawings belong to the official `@chengzhiyi/pi-excalidraw` plugin and UI designs to `@chengzhiyi/pi-pencil` (OpenPencil), each installed and enabled explicitly in Plugins. The host ships no editor/fonts and does not auto-install it on offline startup. Hosted plugins use a separate Node process for lifecycle management—not a security sandbox. Development protocol/plugin artifacts on this branch are verification-only, not a published release. See [drawing migration and recovery](docs/diagrams.md) for update behavior and preserved backups.
151
166
 
152
167
  ### Source map
153
168
 
@@ -164,7 +179,7 @@ Read the [architecture and ownership guide](docs/architecture.md) or [Web plugin
164
179
 
165
180
  ## Guides & development
166
181
 
167
- - **New users:** [Quick start](docs/en/getting-started.md) · [Conversations](docs/en/conversation.md) · [Sessions and workspaces](docs/en/sessions.md) · [Files, terminal and Git](docs/en/workspace-tools.md) · [Diagrams](docs/en/diagrams.md)
182
+ - **New users:** [Quick start](docs/en/getting-started.md) · [Conversations](docs/en/conversation.md) · [Sessions and workspaces](docs/en/sessions.md) · [Files, terminal and Git](docs/en/workspace-tools.md) · [Diagrams](docs/en/diagrams.md) · [UI design](docs/en/design.md)
168
183
  - **Configuration:** [Overview](docs/en/configuration.md) · [Models and providers](docs/en/models.md) · [Packages, skills and plugins](docs/en/extensions.md) · [Updates](docs/en/updates.md) · [Security and privacy](docs/en/security.md)
169
184
  - **Help and reference:** [Troubleshooting](docs/en/troubleshooting.md) · [FAQ](docs/en/faq.md) · [Command line](docs/en/reference/cli.md) · [Environment variables](docs/en/reference/environment.md)
170
185
  - **Contributors:** [Architecture](docs/architecture.md) · [Web plugins](docs/web-plugins.md) · [Desktop builds](docs/desktop.md) · [Developers](docs/en/developers.md)
package/README.zh-CN.md CHANGED
@@ -48,7 +48,22 @@ npx pi-webapp
48
48
  - **亲手调整细节:** 移动图形、修改文字、调整布局,支持原生撤销与重做。
49
49
  - **保留可编辑成果:** 将 `.excalidraw` 源文件保存到工作区,或从编辑器导出 PNG。
50
50
 
51
- **可选插件:** 在「**插件 → Hosted 插件**」中显式安装并启用 `@chengzhiyi/pi-excalidraw`,需要可用的兼容发行版。插件不随宿主内置,也不会自动安装,无需额外绘图服务账号。[安装、保存与恢复说明](docs/diagrams.md)。
51
+ **可选插件:** 在「**插件 → 官方插件**」中显式安装并启用 `@chengzhiyi/pi-excalidraw`,需要可用的兼容发行版。插件不随宿主内置,也不会自动安装,无需额外绘图服务账号。[安装、保存与恢复说明](docs/diagrams.md)。
52
+
53
+ ## OpenPencil:和 Pi 一起在真正的设计画布上做界面
54
+
55
+ **提出需求 → 即时看到 → 撤销或继续调整。** 让 Pi 设计一个登录页、一个仪表盘或一个组件,它的修改会在 [OpenPencil](https://github.com/open-pencil/open-pencil) 画布上即时出现:被修改的画框会被选中,最近一次修改可以直接 **撤销**。
56
+
57
+ [![OpenPencil 插件与对话并排:Pi 在画布上加了登录页和仪表盘,提示条提供撤销按钮](assets/readme/openpencil.png)](assets/readme/openpencil.png)
58
+
59
+ *截图来自真实插件界面,Agent 回合为脚本预设,并非实时模型生成记录。点击图片可查看原图。*
60
+
61
+ - **完整的设计编辑器:** 画框、自动布局、组件、钢笔、文字、布尔运算、页面与图层,另有代码(JSX / React + Tailwind / HTML)和 Lint(设计检查)面板,可导出 PNG/JPG/WebP/SVG。
62
+ - **主动权在你:** Pi 发送的是带类型的操作,而不是代码。可以锁定图层,或把 Pi 限制在选中范围内;撤销、保存和锁定只能由你来做,Pi 也无法覆盖它没看到的改动。
63
+ - **实时预览:** **预览** 会在画布上运行设计稿,按钮、开关、滑块、标签页和输入框都能真正操作。
64
+ - **纳入代码仓库:** 设计稿以 `.fig` 文件保存在工作区的 `designs/` 下,和代码一起提交。
65
+
66
+ **可选插件:** 在「**插件 → 官方插件**」中安装并启用 `@chengzhiyi/pi-pencil`(**OpenPencil**)。插件不随宿主内置,也不会自动安装,在本地运行,无需账号;不包含 OpenPencil 自带的 AI 对话,这件事由 Pi 来做。尚未进入稳定版。[安装、设计与保存](docs/zh/design.md)。
52
67
 
53
68
  ## 核心功能
54
69
 
@@ -60,7 +75,7 @@ npx pi-webapp
60
75
  | **真正的交互式终端** | 在工作区启动 shell,交互输入、Ctrl+C;切换聊天或面板时保留进程与输出。 |
61
76
  | **Git 审查与操作** | 查看改动和内联差异、逐文件暂存/取消暂存、提交暂存区、创建/切换本地分支,并用分支关系图浏览提交历史。 |
62
77
  | **灵活的工作台布局** | 调宽、分栏、展开工具面板,或进入工作区专注模式,同时保留导航入口。各聊天保留自己的工具标签,直到网页刷新。 |
63
- | **模型、技能与插件** | 配置提供方和模型,管理 Pi 软件包/扩展/技能,启停内置文件、终端与 Git;兼容的 Web 插件还可贡献自己的界面。 |
78
+ | **模型、技能与插件** | 配置提供方和模型,管理 Pi 软件包/扩展/技能,启停内置文件、终端与 Git;可选的官方插件提供 Excalidraw 图表和 OpenPencil UI 设计,兼容的 Web 插件还可贡献自己的界面。 |
64
79
  | **浏览器与桌面入口** | 用后台启动器打开 Web,从 Pi 终端输入 `/web`,或运行自带 Node/Pi 的 Electron 桌面应用。 |
65
80
 
66
81
  > 聊天独立运行,但同一工作树中的文件和 Git 改动是共享的。切换聊天不会停止任务;停止服务会结束其后台任务。终端与 Agent 工具使用你的系统权限,不是沙箱环境。
@@ -147,7 +162,7 @@ pi
147
162
  | **宿主边界上的操作保护** | 本地传输校验令牌与请求来源;文件预览限制工作区及符号链接范围;Git 写入拒绝过期状态,并协调同工作树的已知聊天。这些检查不等于操作系统沙箱。 |
148
163
  | **多入口复用同一套界面** | React + TypeScript 构建工作台,Vite/esbuild 完成打包,Electron 提供桌面外壳,无需另维护一套桌面对话 UI。 |
149
164
 
150
- **绘图为可选扩展,而非内置能力:** 在插件管理中显式安装、启用官方 `@chengzhiyi/pi-excalidraw`。宿主不携带编辑器和专用字体,首次离线启动不会自动安装。Hosted 插件使用独立 Node 子进程管理生命周期,但不是安全沙箱。本分支开发协议和插件产物仅用于验证,并非已发布版本。更新行为、旧图稿及备份保留方式见[绘图迁移与恢复](docs/diagrams.md)。
165
+ **绘图与 UI 设计为可选扩展,而非内置能力:** 在插件管理中显式安装、启用官方 `@chengzhiyi/pi-excalidraw`(绘图)或 `@chengzhiyi/pi-pencil`(OpenPencil UI 设计)。宿主不携带编辑器和专用字体,首次离线启动不会自动安装。Hosted 插件使用独立 Node 子进程管理生命周期,但不是安全沙箱。本分支开发协议和插件产物仅用于验证,并非已发布版本。更新行为、旧图稿及备份保留方式见[绘图迁移与恢复](docs/diagrams.md)。
151
166
 
152
167
  ### 源码导航
153
168
 
@@ -164,7 +179,7 @@ pi
164
179
 
165
180
  ## 使用指南与开发
166
181
 
167
- - **新用户:** [快速开始](docs/zh/getting-started.md) · [对话](docs/zh/conversation.md) · [会话与工作区](docs/zh/sessions.md) · [文件、终端与 Git](docs/zh/workspace-tools.md) · [图表](docs/zh/diagrams.md)
182
+ - **新用户:** [快速开始](docs/zh/getting-started.md) · [对话](docs/zh/conversation.md) · [会话与工作区](docs/zh/sessions.md) · [文件、终端与 Git](docs/zh/workspace-tools.md) · [图表](docs/zh/diagrams.md) · [UI 设计](docs/zh/design.md)
168
183
  - **配置:** [配置概览](docs/zh/configuration.md) · [模型与提供方](docs/zh/models.md) · [包、技能与插件](docs/zh/extensions.md) · [更新](docs/zh/updates.md) · [安全与隐私](docs/zh/security.md)
169
184
  - **帮助与参考:** [排错](docs/zh/troubleshooting.md) · [常见问题](docs/zh/faq.md) · [命令行](docs/zh/reference/cli.md) · [环境变量](docs/zh/reference/environment.md)
170
185
  - **参与开发:** [架构说明](docs/architecture.md) · [Web 插件](docs/web-plugins.md) · [桌面构建](docs/desktop.md) · [开发者](docs/zh/developers.md)
@@ -8,6 +8,7 @@ The UI screenshots illustrate the real pi-webapp interface using **seeded demo c
8
8
  | `git-review.png` | Git tool panel: staged regression tests and the actual `>` → `>=` working-tree diff. |
9
9
  | `terminal.png` | Terminal tool panel: actual Node test execution in the disposable project, with two passing tests. |
10
10
  | `excalidraw.png` | Actual optional Excalidraw plugin tool card, with a seeded hand-drawn workflow and native Edit entry. Captured at 2× density, not a fabricated UI or live model transcript. |
11
+ | `openpencil.png` | Actual optional OpenPencil plugin in the workbench beside a conversation, after a scripted agent turn added two seeded mobile screens; the Undo toast is the plugin's own. Captured at 1.5× density. |
11
12
  | `architecture-zh.png` | User-supplied hand-drawn architecture image, embedded directly in the Chinese README. Preserve this original when regenerating SVGs. |
12
13
  | `architecture-en.png` | User-supplied English hand-drawn architecture image (2840 × 2280), embedded directly in the English README. Preserve this original when regenerating SVGs. |
13
14
  | `architecture-en.svg` / `architecture-zh.svg` | Editable vector counterparts using the same layered composition; the Chinese PNG retains the supplied hand-drawn styling. No remote fonts, scripts, or embedded private data. |
@@ -38,6 +39,18 @@ CAPTURE_README_EXCALIDRAW=1 HOSTED_EXCALIDRAW_TGZ=/absolute/path/plugin.tgz \
38
39
 
39
40
  Unset inherited `PI_WEBAPP_RESTART_PORT`, `PI_WEBAPP_RESTART_TOKEN`, and `PI_WEBAPP_LAUNCHER_NONCE` when capturing from inside a running Pi Web service, so the temporary bridge uses its own port and token. The opt-in capture uses the actual host, plugin worker, preview, and native editor with deterministic local registry/model fixtures; it makes no external requests. It saves only the tool-card crop, verifies the editor opens, and cleans up its temporary workspace. A local verification archive is not evidence of an npm release. Both READMEs share the English demo image with localized surrounding text.
40
41
 
42
+ ## Regenerate the OpenPencil showcase
43
+
44
+ Build the host and the plugin (`node scripts/build.mjs` in `pi-extensions/packages/pencil`), then:
45
+
46
+ ```bash
47
+ npm run build
48
+ CAPTURE_README_PENCIL=1 PI_PENCIL_ROOT=/absolute/path/pi-extensions/packages/pencil \
49
+ npx playwright test test/browser/readme-pencil.spec.ts --workers=1
50
+ ```
51
+
52
+ `PI_PENCIL_ROOT` defaults to a `pi-extensions` checkout next to this one. The same environment-variable caveat as the Excalidraw capture applies. The capture runs the actual host, plugin worker and editor as a developer root, scripts one agent turn without calling a model, makes no external requests, and writes the full-page `openpencil.png`.
53
+
41
54
  ## Maintain the diagrams
42
55
 
43
56
  The architecture diagrams use the chat-authored three-layer composition: shared UI, local Node host, and execution capabilities, with only three vertical connectors. The side rail shows contracts, optional hosted extensions, and diagnostics. Excalidraw is an optional plugin, not a builtin.
@@ -48,7 +61,7 @@ Regenerate both localized SVGs from their shared layout and copy:
48
61
  node scripts/generate-readme-architecture.mjs
49
62
  ```
50
63
 
51
- READMEs embed PNGs for image-renderer compatibility; keep the workbench, Git, and terminal screenshots visible as well. Both architecture PNGs are user-supplied hand-drawn originals, not generated SVG exports. Do not overwrite them when regenerating the vector counterparts. Verify all five embedded images load in each README.
64
+ READMEs embed PNGs for image-renderer compatibility; keep the workbench, Git, and terminal screenshots visible as well. Both architecture PNGs are user-supplied hand-drawn originals, not generated SVG exports. Do not overwrite them when regenerating the vector counterparts. Verify all six embedded images load in each README.
52
65
 
53
66
  Edit the generator rather than the generated SVGs. Keep both languages, dimensions, and palette in sync; check responsibilities against the current source and `docs/architecture.md`. The diagrams include accessible titles/descriptions and use only local text and vector shapes. Validate XML and browser rendering, including text bounds, after regeneration. Same-layer placement does not imply sequential calls; process boundaries do not imply security sandboxes.
54
67
 
Binary file