pi-webapp 0.1.25 → 0.1.26
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 +104 -75
- package/README.zh-CN.md +104 -73
- package/assets/readme/README.md +30 -0
- package/assets/readme/architecture-en.svg +39 -0
- package/assets/readme/architecture-zh.svg +39 -0
- package/assets/readme/git-review.png +0 -0
- package/assets/readme/terminal.png +0 -0
- package/assets/readme/workbench.png +0 -0
- package/dist/extension.js +29 -29
- package/docs/desktop-testing.md +5 -4
- package/docs/desktop.md +48 -16
- package/package.json +3 -2
- package/web/dist/.vite/manifest.json +23 -23
- package/web/dist/assets/{app-DQXe2TPf.js → app-DGAHiflJ.js} +104 -104
- package/web/dist/assets/app.js +2 -2
- package/web/dist/assets/{graphql-DCmL4QvK.js → graphql-CM8br3eP.js} +1 -1
- package/web/dist/assets/{http-D1RjONju.js → http-Dl6CKe_K.js} +1 -1
- package/web/dist/assets/{php-D_vc4Tu2.js → php-Bk_hkz6U.js} +1 -1
- package/web/dist/assets/{plugin-Bjpcuu8G.js → plugin-BBQh2TKb.js} +1 -1
- package/web/dist/assets/{plugin-DNLljKtT.js → plugin-BPPaJeXM.js} +1 -1
- package/web/dist/assets/{plugin-Dt1cBQ6m.js → plugin-C7GyvZv1.js} +1 -1
- package/web/dist/assets/{rst-CXMoyibL.js → rst-L1NMAHRS.js} +1 -1
- package/web/dist/assets/{ruby-B2ZFKb7W.js → ruby-CT2Et3Md.js} +1 -1
- package/web/dist/assets/style.css +1 -1
- package/web/dist/assets/{svelte-Or6lhjBs.js → svelte-gqLIvd6P.js} +1 -1
- package/web/dist/assets/{vue-Di6p925N.js → vue-9dlEQDyH.js} +1 -1
package/README.md
CHANGED
|
@@ -1,127 +1,156 @@
|
|
|
1
1
|
# pi-webapp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### Your Pi coding agent. A visual workspace to build with it.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Bring conversations, project files, terminals, and Git into one interface—without giving up Pi's tools, skills, or terminal workflow. Run it in your browser, open a dedicated desktop window, or connect directly from an existing Pi session.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[简体中文](README.zh-CN.md) · [Get started](#get-started) · [Download desktop](#desktop-downloads) · [User guide](docs/en/getting-started.md) · [npm](https://www.npmjs.com/package/pi-webapp)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Desktop test build 8:** [macOS · Apple Silicon](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-arm64.dmg) · [macOS · Intel](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-x64.dmg) · [Windows x64](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-win-x64.exe) · [Linux x64](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-linux-x86_64.AppImage). Verify [SHA-256](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/SHA256SUMS); unsigned/unnotarized test-release limits apply. [Install safely](#desktop-downloads).
|
|
10
|
+
|
|
11
|
+
[](assets/readme/workbench.png)
|
|
12
|
+
|
|
13
|
+
*Follow the conversation and inspect the linked source file in the same workspace. Real UI, seeded demo data—not a live model transcript.*
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx pi-webapp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**One command for the Web. A bundled runtime for desktop. The same Pi underneath.**
|
|
20
|
+
|
|
21
|
+
## Why pi-webapp?
|
|
22
|
+
|
|
23
|
+
- **Keep your coding context together.** Follow the agent, inspect a file, run a command, and review a diff without leaving the workspace.
|
|
24
|
+
- **Work across projects without interrupting tasks.** Chats run independently; switching projects or starting another conversation leaves existing work running in the background.
|
|
25
|
+
- **See what the agent is doing.** Streaming replies, expandable reasoning and tool calls, token usage, and execution traces make progress easier to follow.
|
|
26
|
+
- **Build on Pi, not around it.** Keep Pi's session storage, model choices, skills, and extension ecosystem. The interface adds a workbench, not a replacement agent engine.
|
|
27
|
+
|
|
28
|
+
## See the workflow
|
|
29
|
+
|
|
30
|
+
**Discuss → inspect → review → verify.** The workbench above keeps your conversation and source side by side; the same tool panel takes you from reviewing a change to running its tests.
|
|
31
|
+
|
|
32
|
+
| Review before committing | Verify in a real terminal |
|
|
10
33
|
| --- | --- |
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
| Windows · x64 | [Download EXE installer](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.21-b6/pi-0.1.21-desktop.6-win-x64.exe) |
|
|
14
|
-
| Linux · x64 | [Download AppImage](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.21-b6/pi-0.1.21-desktop.6-linux-x86_64.AppImage) |
|
|
34
|
+
| [](assets/readme/git-review.png) | [](assets/readme/terminal.png) |
|
|
35
|
+
| Inspect the diff and stage only what you intend to commit. | Run project commands without losing the conversation. |
|
|
15
36
|
|
|
16
|
-
|
|
37
|
+
*Click any image for full size. Screenshots use an isolated demo repository. The terminal really runs its two regression tests; no provider credentials or private project data are used. [How these images are made](assets/readme/README.md).*
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
>
|
|
20
|
-
> **Unsigned test build:** macOS is not notarized; Windows may show an unknown-publisher warning. Only proceed if you trust the source; never globally disable system security. Installer-payload smoke tests passed on all four targets, not every Linux distribution or real model-provider login. Windows ARM/Linux ARM are not included. Desktop automatic updates are not provided in this build.
|
|
39
|
+
## Core features
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
| Capability | What you can do |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| **Live agent conversations** | Send messages and image/file attachments; pause and continue tasks; switch models and thinking levels. Render Markdown, code, reasoning, and tool results in context. |
|
|
44
|
+
| **Multi-project sessions** | Discover saved Pi sessions, add workspaces, and switch between independently running chats. Return to ongoing output and pending plugin interactions. |
|
|
45
|
+
| **Files beside the conversation** | Browse the workspace, follow file links from chat, and preview highlighted code, Markdown, and images in read-only tabs. |
|
|
46
|
+
| **Real integrated terminals** | Run interactive shells in the workspace, use Ctrl+C, and keep processes and output when switching chats or panels. |
|
|
47
|
+
| **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. |
|
|
48
|
+
| **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. |
|
|
49
|
+
| **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. |
|
|
50
|
+
| **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. |
|
|
51
|
+
|
|
52
|
+
> 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.
|
|
23
53
|
|
|
24
|
-
|
|
54
|
+
## Get started
|
|
25
55
|
|
|
26
|
-
|
|
56
|
+
### Web: run one command
|
|
27
57
|
|
|
28
|
-
Requires Node.js 22.19
|
|
58
|
+
Requires **Node.js 22.19+** and npm. Run in your project directory:
|
|
29
59
|
|
|
30
60
|
```bash
|
|
31
61
|
npx pi-webapp
|
|
32
62
|
```
|
|
33
63
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
In Settings → General → App updates, the web page checks npm for a newer `pi-webapp` release. When started by the background launcher from an npm package, **Update and restart** installs the verified release under Pi's `pi-web/releases/` data directory, restarts the server, and reloads the same browser address. Wait for any active reply to finish first. If the new version cannot start, the launcher restores the previous service. This works for both `npx` and global-command launches; later launches select the managed release automatically. It does not change the npm global installation. Source checkouts and `/web` pages opened from an existing Pi terminal show version information but cannot restart from the web page. If the service does not return, run `pi-webapp status` and check `~/.pi/agent/pi-web/launcher.log`.
|
|
64
|
+
The launcher starts Pi in the background and opens your browser on a local graphical desktop. If Pi is missing, it installs the official `@earendil-works/pi-coding-agent` package. An existing Pi installation must be **0.87.1+**; older installations are not replaced automatically. Running the command again reopens the existing service. Headless sessions print the local address instead; `PI_WEBAPP_AUTO_OPEN=0` disables automatic opening.
|
|
37
65
|
|
|
38
|
-
|
|
66
|
+
1. Open **Settings → Models** to configure a provider and choose a model you have access to.
|
|
67
|
+
2. Select or add a workspace, then start a conversation.
|
|
68
|
+
3. Open the conversation's upper-right tool panel to explore **Files**, **Terminal**, or **Git changes** alongside the agent.
|
|
39
69
|
|
|
40
|
-
|
|
70
|
+
Model access is required separately; a local interface does not mean offline inference. Keep token-bearing local URLs private and do not expose the service directly to the public internet.
|
|
41
71
|
|
|
42
72
|
```bash
|
|
43
|
-
|
|
44
|
-
pi-webapp
|
|
73
|
+
npx pi-webapp status # Show the running service address
|
|
74
|
+
npx pi-webapp stop # Stop the service after active work finishes
|
|
45
75
|
```
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
Prefer a global command? Run `npm install -g pi-webapp`, then `pi-webapp`.
|
|
78
|
+
|
|
79
|
+
**Updates:** npm-launcher installations support **Settings → General → App updates → Update and restart**, with rollback if the new service fails to start. Finish active work first. Source checkouts and terminal `/web` sessions show version information but cannot restart from the page. See the [update guide](docs/en/updates.md).
|
|
80
|
+
|
|
81
|
+
### Already using Pi in a terminal?
|
|
48
82
|
|
|
49
83
|
```bash
|
|
50
84
|
pi install npm:pi-webapp
|
|
51
85
|
pi
|
|
52
86
|
```
|
|
53
87
|
|
|
54
|
-
|
|
88
|
+
Enter **`/web`** inside Pi. The browser stays synchronized with that terminal session; Pi continues to own the agent, tools, and session storage. Exiting that Pi process ends its service.
|
|
55
89
|
|
|
56
|
-
##
|
|
90
|
+
## Desktop downloads
|
|
57
91
|
|
|
58
|
-
|
|
59
|
-
- Send messages, pause and continue a run, start a new Pi session, and change the current model or thinking level. The bottom-right control pauses an active run; an empty composer offers Continue after pausing, including after refreshing or reopening the session. Continue uses an internal control action without adding a user message; the model makes a new request based on existing progress, and plan mode still requires fresh approval.
|
|
60
|
-
- Browse workspaces and saved sessions. Add a workspace with the native directory picker when available, or use the built-in directory browser over SSH.
|
|
61
|
-
- Open the right sidebar from the permanent control in the conversation’s upper-right corner. Choose **Workspace files** to browse the current session’s directory tree and open read-only file tabs. Workspace-relative and in-workspace absolute file links in the conversation also open these previews; external URLs still open in a new tab. Previews support highlighted code with line numbers, Markdown with preview/source modes, and PNG/JPEG/GIF/WebP images with a lightbox. The sidebar supports resizing, split panes, fullscreen, and plugin content. Switching chats retains their tabs and expanded directories until the page reloads. Manually reload listings or previews as needed. Listings show up to 1,000 entries per directory; text previews allow up to 512 KB / 10,000 lines, and images up to 8 MB. HTML/SVG remain source text; unsupported binary files show a notice. Reads, including resolved symlink targets, stay within the current session’s workspace.
|
|
62
|
-
- Choose **Open terminal** on the right sidebar’s start page to launch the default shell in the current session’s workspace. Supports interactive input, streaming output, Ctrl+C, resizing, split panes, and fullscreen. Tab changes, sidebar collapse, and chat switches retain the process, environment, and screen. Short disconnects reconnect automatically without replaying uncertain input. Closing a tab or stopping the service reaps its process; disconnected browsers have a five-minute retention window. Page reloads reset tabs, and processes do not survive service restarts. Limits: 8 terminals per session, 32 per service, and 2,000 scrollback rows. Shells run with the Pi user’s system permissions; the workspace is their initial directory, not a shell sandbox.
|
|
63
|
-
- Choose **Git changes** on the right sidebar’s start page to review the current branch, commit, locally recorded upstream divergence, and staged, unstaged, untracked, or conflicted files. Click a file to preview its read-only unified diff inside the Git panel, keeping the file list visible and the tab count unchanged. Lists and diffs scroll independently; narrow panes stack them and panes at least 720 px wide place them side by side. The selected file is highlighted and retained with its Git tab, follows staging changes, and clears when the file is no longer changed. Close the preview to restore the full list. Diffs hide raw Git headers, show old/new line numbers and addition/deletion counts, and offer previous/next navigation between contiguous change blocks with a position counter. File-mode changes and missing final newlines retain compact notices. Reads stay within the session’s directory, including when it is a repository subdirectory; linked worktrees and repositories without commits are supported. Visible Git tabs refresh after agent state changes, on focus, and every five seconds; hidden tabs stop polling. Requires Git on the machine running Pi. Lists show up to 1,000 files and diffs up to 512 KB / 10,000 lines. Binary files, submodules and unresolved conflicts show notices. Changes belong to the shared working tree, not exclusively to one chat; working-file and historical diffs remain read-only.
|
|
64
|
-
- In **Git changes → Changes**, use each file’s **+ / −** button to stage or unstage it, use the fixed bottom composer to commit only the staged index (Ctrl/Cmd+Enter is supported), and click the branch name to search/switch local branches or open **New branch**. The file list scrolls independently; full repository metadata is available on the short repository name’s tooltip. Drafts stay with each chat’s Git tab. Commits and branch switches require a root workspace; switching also requires a clean working tree, including untracked files. Writes require all known chats using the worktree to be idle, reject stale snapshots, and honor Git hooks/signing. Conflicts, active Git operations, locks and occupied worktree branches block incompatible writes. Failed or unconfirmed operations retain drafts and never retry automatically. Changes are shared by chats using the same worktree. No fetch/push, forced switch, stash or discard is performed.
|
|
65
|
-
- In **Git changes → History**, browse commits alongside their branch/merge graph, with HEAD, local branch, remote-tracking branch and tag labels. Load history 50 commits at a time; a ref change resets pagination to prevent mixed histories. Open commit details for the full message, author/committer, timestamps, parents and changed files, then preview a read-only file diff alongside the same commit file list without opening another tab. Merge details let you select the parent to compare against; root commits compare against an empty tree. The graph shows repository-wide metadata while commit files and diffs stay within the session directory. Graph selection and loaded history remain with each chat’s Git tab until the page reloads. Remote labels use local refs without fetching.
|
|
66
|
-
- Attach up to 20 files of 20 MB each by selecting, dropping, or pasting them. Images show previews and are also sent as Pi image content.
|
|
67
|
-
- Open Plugins directly below New session in the sidebar to inspect and switch the bundled Git, Files and Terminal capabilities. Switches are global, persist locally, and require every chat to be idle. Disabling closes related tabs and blocks backend requests; Terminal asks for confirmation before ending all service-owned terminals. External Pi Web runtimes remain managed through Packages & extensions rather than a misleading UI-only switch.
|
|
68
|
-
- Manage appearance, Pi packages, extensions, skills, and models from the settings panel. The Models page can add models, edit display names, context windows, output limits, and input types, and restore built-in defaults; changes are saved to Pi's `models.json`. Browser sign-in opens the provider's authorization page automatically; manual code entry remains available when a callback cannot reach Pi. Stored provider credentials can also be removed there. Credentials stay in Pi's local `auth.json` and are never returned to the browser.
|
|
92
|
+
**Latest desktop test release: [pi 0.1.24 · build 8](https://github.com/chengzhiyi/pi-webapp/releases/tag/desktop-v0.1.24-b8).** Download the installer for your operating system and CPU:
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
| Platform | Download |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| **macOS · Apple Silicon (arm64)** | [Download DMG](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-arm64.dmg) |
|
|
97
|
+
| **macOS · Intel (x64)** | [Download DMG](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-x64.dmg) |
|
|
98
|
+
| **Windows · x64** | [Download EXE installer](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-win-x64.exe) |
|
|
99
|
+
| **Linux · x64** | [Download AppImage](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-linux-x86_64.AppImage) |
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
[All releases](https://github.com/chengzhiyi/pi-webapp/releases) · [SHA256SUMS](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/SHA256SUMS) · [Build/runtime metadata](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/desktop-release.json)
|
|
75
102
|
|
|
76
|
-
|
|
103
|
+
The **pi** desktop app bundles Node and Pi—no separate runtime installation needed. It can reuse a compatible Web service, open the same service in your browser, and let you choose whether background tasks continue after closing the app. Bring your own model credentials, Git/SSH setup, and project toolchains.
|
|
77
104
|
|
|
78
|
-
|
|
105
|
+
- **Install:** macOS: drag **pi.app** from the DMG into Applications. Windows: run the EXE installer. Linux: make the AppImage executable and run it; see the release notes for the FUSE alternative.
|
|
106
|
+
- **Verify:** compare the installer with `SHA256SUMS` from the same release. Confirm **build 8** in **pi → 关于 pi (About pi)**. Quit the old desktop before replacing it; do not delete `~/.pi`.
|
|
107
|
+
- **Test-release limits:** these are opt-in prereleases, not publisher-signed stable distributions. macOS uses ad-hoc signatures without Apple notarization and may be blocked by Gatekeeper; follow the [macOS test installation guide](docs/desktop-testing.md) and stop if verification fails. Windows/Linux packages are unsigned. Never disable system security globally. Desktop updates require manual installation; Windows ARM and Linux ARM are not included.
|
|
79
108
|
|
|
80
|
-
|
|
109
|
+
## Architecture highlights
|
|
81
110
|
|
|
82
|
-
|
|
111
|
+
**One agent engine, multiple interfaces, and a plugin-oriented workbench.** Pi handles model execution, tools, and session persistence; pi-webapp handles presentation, session orchestration, and workspace tools.
|
|
83
112
|
|
|
84
|
-
|
|
113
|
+
[](assets/readme/architecture-en.svg)
|
|
85
114
|
|
|
86
|
-
|
|
115
|
+
*The UI is shared; session orchestration, agent execution, and workspace capabilities keep distinct responsibilities.*
|
|
87
116
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
```
|
|
117
|
+
| Design choice | Why it matters |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| **Thin Pi adapter, separate host** | Agent integration stays small; server orchestration, browser UI, and workspace capabilities have explicit ownership instead of growing inside one extension entry point. |
|
|
120
|
+
| **Typed, validated cross-boundary contracts** | Browser code uses wire DTOs rather than Node/Pi runtime objects. HTTP actions and NDJSON events keep commands and live state updates explicit. |
|
|
121
|
+
| **Plugin-owned capabilities** | Built-in Git, Files, and Terminal each own their server/client/contracts and cleanup. A registry dispatches requests; the host workbench manages tabs, docking, focus, and session identity. |
|
|
122
|
+
| **Lifecycle-aware sessions** | Background sessions retain progress and pending interactions when you navigate away. Switching a chat preserves tool resources; closing a tab disposes its resource. |
|
|
123
|
+
| **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. |
|
|
124
|
+
| **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. |
|
|
97
125
|
|
|
98
|
-
|
|
126
|
+
Source layout: `src/adapters/pi/` → Pi entry · `src/host/` → server/browser host · `src/plugins/builtin/` → workspace capabilities · `src/contracts/` → cross-boundary contracts · `web/src/ui/` → shared UI · `desktop/` → Electron shell.
|
|
99
127
|
|
|
100
|
-
|
|
128
|
+
Read the [architecture and ownership guide](docs/architecture.md) or [Web plugin integration notes](docs/web-plugins.md) for lifecycle and extension details.
|
|
101
129
|
|
|
102
|
-
|
|
130
|
+
## Guides & development
|
|
103
131
|
|
|
104
|
-
|
|
132
|
+
- **New users:** [First conversation](docs/en/getting-started.md) · [Sessions](docs/en/sessions.md) · [Workspace tools](docs/en/workspace-tools.md)
|
|
133
|
+
- **Configuration:** [Models, packages, and skills](docs/en/configuration.md) · [Updates](docs/en/updates.md) · [Troubleshooting](docs/en/troubleshooting.md)
|
|
134
|
+
- **Contributors:** [Architecture](docs/architecture.md) · [Web plugins](docs/web-plugins.md) · [Desktop builds](docs/desktop.md)
|
|
105
135
|
|
|
106
|
-
|
|
136
|
+
The guides follow the source tree; installed versions may differ. For desktop availability, use the verified release links above and their release notes.
|
|
107
137
|
|
|
108
|
-
|
|
138
|
+
### Develop locally
|
|
109
139
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
this repository automatically.
|
|
140
|
+
```bash
|
|
141
|
+
npm ci
|
|
142
|
+
npm run check
|
|
143
|
+
npm test
|
|
144
|
+
npm run build
|
|
145
|
+
npm run start
|
|
146
|
+
```
|
|
118
147
|
|
|
119
|
-
`npm
|
|
148
|
+
`npm run start` builds and launches the background service. After changing extension code, run `npm run stop` and `npm run start`; reloading the browser alone does not replace the bridge. With `pi -e .`, rebuild and enter `/reload`, then `/web` in Pi.
|
|
120
149
|
|
|
121
|
-
|
|
150
|
+
For desktop development: `npm run desktop:prepare` → `npm run desktop:start`. `npm run desktop:package` creates a host-native installer in `desktop-release/`. For trusted local plugin development, see `PI_WEBAPP_PLUGIN_DEV_ROOTS` in the [plugin notes](docs/web-plugins.md).
|
|
122
151
|
|
|
123
|
-
|
|
152
|
+
---
|
|
124
153
|
|
|
125
|
-
|
|
154
|
+
**Give your next Pi task a visual workspace:** run `npx pi-webapp` or [try the desktop test build](#desktop-downloads). If it helps your workflow, a [GitHub star](https://github.com/chengzhiyi/pi-webapp) helps others discover it; [feedback and reproducible issues](https://github.com/chengzhiyi/pi-webapp/issues) help shape what comes next.
|
|
126
155
|
|
|
127
|
-
MIT. See
|
|
156
|
+
MIT licensed. See [LICENSE](LICENSE).
|
package/README.zh-CN.md
CHANGED
|
@@ -1,125 +1,156 @@
|
|
|
1
1
|
# pi-webapp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
### 让 Pi 编程 Agent,拥有一个看得见、用得顺的工作台。
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
把 AI 对话、项目文件、终端和 Git 放在同一个界面中,不必放弃 Pi 的工具、技能和终端工作流。在浏览器里直接使用,打开独立桌面窗口,或从已有 Pi 会话一键进入。
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
[English](README.md) · [快速开始](#快速开始) · [下载桌面端](#桌面端下载) · [使用指南](docs/zh/getting-started.md) · [npm](https://www.npmjs.com/package/pi-webapp)
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**桌面测试版 build 8:** [macOS · Apple 芯片](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-arm64.dmg) · [macOS · Intel](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-x64.dmg) · [Windows x64](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-win-x64.exe) · [Linux x64](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-linux-x86_64.AppImage)。请核对 [SHA-256](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/SHA256SUMS);测试包未签名或无发布者身份,macOS 未公证。[安全安装说明](#桌面端下载)。
|
|
10
|
+
|
|
11
|
+
[](assets/readme/workbench.png)
|
|
12
|
+
|
|
13
|
+
*一边跟进对话,一边查看消息中链接的源码。截图来自真实界面,使用英文演示数据,并非真实模型执行记录。*
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx pi-webapp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Web 一条命令启动,桌面端自带运行时,底层仍是你熟悉的 Pi。**
|
|
20
|
+
|
|
21
|
+
## 为什么选择 pi-webapp?
|
|
22
|
+
|
|
23
|
+
- **少切窗口,多关注代码。** 一边跟进 Agent,一边查看文件、运行命令、审查差异,让对话与项目上下文留在一起。
|
|
24
|
+
- **多个项目,任务不中断。** 各聊天独立运行;切换工作区或新开对话,不会打断原来正在执行的任务。
|
|
25
|
+
- **不只看到答案,也能看懂过程。** 流式回复、可展开的推理和工具调用、Token 用量及执行轨迹,让进度更容易掌握。
|
|
26
|
+
- **增强 Pi,而不是另起一套。** 继续使用 Pi 的会话存储、模型选择、技能与扩展生态,新增的是可视化工作台,而非替代 Agent 引擎。
|
|
27
|
+
|
|
28
|
+
## 看图了解工作流
|
|
29
|
+
|
|
30
|
+
**对话 → 查看源码 → 审查改动 → 运行验证。** 上方工作台把对话和代码放在一起;同一个工具面板,还能让你从差异审查直接进入终端验证。
|
|
31
|
+
|
|
32
|
+
| 提交前,看清每一处改动 | 不离开对话,直接运行验证 |
|
|
10
33
|
| --- | --- |
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
| Windows · x64 | [下载 EXE 安装程序](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.21-b6/pi-0.1.21-desktop.6-win-x64.exe) |
|
|
14
|
-
| Linux · x64 | [下载 AppImage](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.21-b6/pi-0.1.21-desktop.6-linux-x86_64.AppImage) |
|
|
34
|
+
| [](assets/readme/git-review.png) | [](assets/readme/terminal.png) |
|
|
35
|
+
| 对照差异审查,按需暂存要提交的文件。 | 在项目目录执行命令,保留当前对话上下文。 |
|
|
15
36
|
|
|
16
|
-
[
|
|
37
|
+
*点击图片可查看原图。截图使用隔离的演示仓库,终端实际运行了两项回归测试;不使用提供方凭据或私有项目数据。[图片生成与维护说明](assets/readme/README.md)。*
|
|
17
38
|
|
|
18
|
-
|
|
19
|
-
>
|
|
20
|
-
> **未签名测试版:** macOS 未公证,Windows 可能提示未知发布者;仅在确认来源可信后按单个应用的系统提示处理,不要全局关闭系统安全保护。四种实际安装包均通过原生运行冒烟,但不代表已测试所有 Linux 发行版或真实模型账户登录。不含 Windows ARM/Linux ARM;本构建尚无桌面自动更新。
|
|
39
|
+
## 核心功能
|
|
21
40
|
|
|
22
|
-
|
|
41
|
+
| 能力 | 你可以做什么 |
|
|
42
|
+
| --- | --- |
|
|
43
|
+
| **实时 Agent 对话** | 发送消息与图片/文件附件,暂停与继续任务,切换模型及思考级别;在上下文中阅读 Markdown、代码、推理和工具结果。 |
|
|
44
|
+
| **多项目与多会话** | 发现已有 Pi 会话、添加工作区,在独立运行的聊天之间切换;回来时继续查看输出和待处理的插件交互。 |
|
|
45
|
+
| **对话旁的文件预览** | 浏览工作区,点击聊天中的文件路径,在只读标签页查看高亮代码、Markdown 与图片。 |
|
|
46
|
+
| **真正的交互式终端** | 在工作区启动 shell,交互输入、Ctrl+C;切换聊天或面板时保留进程与输出。 |
|
|
47
|
+
| **Git 审查与操作** | 查看改动和内联差异、逐文件暂存/取消暂存、提交暂存区、创建/切换本地分支,并用分支关系图浏览提交历史。 |
|
|
48
|
+
| **灵活的工作台布局** | 调宽、分栏、展开工具面板,或进入工作区专注模式,同时保留导航入口。各聊天保留自己的工具标签,直到网页刷新。 |
|
|
49
|
+
| **模型、技能与插件** | 配置提供方和模型,管理 Pi 软件包/扩展/技能,启停内置文件、终端与 Git;兼容的 Web 插件还可贡献自己的界面。 |
|
|
50
|
+
| **浏览器与桌面入口** | 用后台启动器打开 Web,从 Pi 终端输入 `/web`,或运行自带 Node/Pi 的 Electron 桌面应用。 |
|
|
51
|
+
|
|
52
|
+
> 聊天独立运行,但同一工作树中的文件和 Git 改动是共享的。切换聊天不会停止任务;停止服务会结束其后台任务。终端与 Agent 工具使用你的系统权限,不是沙箱环境。
|
|
23
53
|
|
|
24
|
-
|
|
54
|
+
## 快速开始
|
|
25
55
|
|
|
26
|
-
|
|
56
|
+
### Web:一条命令启动
|
|
27
57
|
|
|
28
|
-
需要 Node.js 22.19
|
|
58
|
+
需要 **Node.js 22.19+** 和 npm。在项目目录运行:
|
|
29
59
|
|
|
30
60
|
```bash
|
|
31
61
|
npx pi-webapp
|
|
32
62
|
```
|
|
33
63
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
网页的「设置 → 通用设置 → 应用更新」会检查 npm 上的 `pi-webapp` 新版本。通过 npm 包的后台启动器运行时,点击「升级并重启」会先将新版安装并校验到 Pi 数据目录的 `pi-web/releases/`,然后重启服务,网页会在原地址重新加载。请先等待当前回复结束。若新版无法启动,启动器会恢复旧版服务。`npx` 和全局命令启动均可使用;后续启动会自动选用已安装的新版。此操作不会改动 npm 全局安装。源码目录运行和已有 Pi 终端中的 `/web` 页面可以查看版本,但不能从网页重启。若服务未恢复,可运行 `pi-webapp status` 并查看 `~/.pi/agent/pi-web/launcher.log`。
|
|
64
|
+
启动器会在后台启动 Pi,并在本地图形桌面打开默认浏览器。未安装 Pi 时,会自动安装官方 `@earendil-works/pi-coding-agent`;已有 Pi 需要 **0.87.1+**,旧版本不会被自动覆盖。再次执行命令会重新打开已有服务。无图形界面时显示本地地址;设置 `PI_WEBAPP_AUTO_OPEN=0` 可关闭自动打开。
|
|
37
65
|
|
|
38
|
-
|
|
66
|
+
1. 进入「**设置 → 模型**」,配置提供方并选择有权使用的模型。
|
|
67
|
+
2. 选择或添加工作区,开始一次对话。
|
|
68
|
+
3. 打开对话右上角的工具面板,在 Agent 旁边使用「**文件**」「**终端**」或「**Git 改动**」。
|
|
39
69
|
|
|
40
|
-
|
|
70
|
+
模型访问权限需自行配置;本地界面不等于离线推理。请勿分享带访问令牌的本地 URL,也不要把服务直接暴露到公网。
|
|
41
71
|
|
|
42
72
|
```bash
|
|
43
|
-
|
|
44
|
-
pi-webapp
|
|
73
|
+
npx pi-webapp status # 查看运行中的服务地址
|
|
74
|
+
npx pi-webapp stop # 完成当前任务后停止服务
|
|
45
75
|
```
|
|
46
76
|
|
|
47
|
-
|
|
77
|
+
习惯全局命令?先运行 `npm install -g pi-webapp`,再运行 `pi-webapp`。
|
|
78
|
+
|
|
79
|
+
**升级:** 通过 npm 后台启动器运行时,可在「设置 → 通用设置 → 应用更新」中「升级并重启」;新版启动失败会回退。请先结束活跃任务。源码运行和 Pi 终端 `/web` 页面仅显示版本信息,不能从网页重启。详见[更新指南](docs/zh/updates.md)。
|
|
80
|
+
|
|
81
|
+
### 已经在终端使用 Pi?
|
|
48
82
|
|
|
49
83
|
```bash
|
|
50
84
|
pi install npm:pi-webapp
|
|
51
85
|
pi
|
|
52
86
|
```
|
|
53
87
|
|
|
54
|
-
在 Pi 中输入
|
|
88
|
+
在 Pi 中输入 **`/web`** 即可。浏览器与该终端会话保持同步,Agent、工具和会话存储继续由 Pi 管理;退出该 Pi 进程会结束其服务。
|
|
55
89
|
|
|
56
|
-
##
|
|
90
|
+
## 桌面端下载
|
|
57
91
|
|
|
58
|
-
|
|
59
|
-
- 发送消息、暂停与继续运行、启动新的 Pi 会话,以及切换当前模型或思考级别。运行时右下角显示暂停;暂停后清空输入框即可继续,刷新或重新打开会话后仍可恢复。继续通过内部控制动作恢复原任务,不新增用户消息;模型会基于已有进度发起新请求,计划模式仍需重新审批。
|
|
60
|
-
- 浏览工作区和已保存的会话。环境支持时可通过系统目录选择器添加工作区;通过 SSH 使用时,也可使用内置目录浏览器。
|
|
61
|
-
- 通过对话右上角的常驻入口打开右侧工具栏,在「工作区文件」中逐层浏览当前会话的目录,点击文件打开只读预览。对话中的工作区相对路径及工作区内绝对路径链接也会直接打开右侧预览,外部网址仍在新窗口打开。支持带行号和高亮的代码、Markdown 预览与源码切换,以及 PNG/JPEG/GIF/WebP 图片与放大查看。面板可收起、调宽、分栏或全屏,并继续承载插件内容;切换聊天会保留各自的标签和目录展开状态(刷新网页后重置)。文件树和预览提供手动刷新,每层最多显示 1000 项,文本预览上限 512 KB / 10000 行、图片上限 8 MB;HTML/SVG 显示源码,其他二进制文件显示不支持提示。文件读取限制在当前会话工作区内,包括符号链接的真实目标。
|
|
62
|
-
- 在右侧「开始」页选择「打开终端」,以当前会话的工作区为初始目录启动默认 shell。支持真实交互输入、持续输出、Ctrl+C、尺寸调整、分栏和全屏。切换标签、折叠侧栏和切换聊天保留进程、环境变量与终端画面;短暂断线会自动重连,未确认的输入不会重放。关闭标签或停止服务会回收进程;浏览器关闭或连接持续丢失后,后台最多保留 5 分钟。刷新网页会重置标签,不支持跨服务重启恢复进程。每会话最多 8 个终端、服务最多 32 个,保留 2000 行滚动历史。终端使用 Pi 所在用户的系统权限,工作区是初始目录,不是 shell 沙箱。
|
|
63
|
-
- 在右侧「开始」页选择「Git 改动」,查看当前分支、提交、基于本地记录的上游领先/落后数量,以及已暂存、未暂存、未跟踪和冲突文件。点击文件直接在 Git 面板内预览只读差异,保留文件列表且不增加标签页。列表与差异独立滚动,窄面板上下排列,宽度达到 720 px 时左右并排。选中文件高亮并随 Git 标签保留,暂存状态变化时跟随对应范围,文件不再有改动时收起预览;也可手动关闭恢复完整列表。差异隐藏原始 Git 头信息,显示新旧行号与增删行数,可用上一处/下一处按钮逐个跳转连续改动块并查看当前位置;文件权限变化、末尾无换行等信息保留为简洁提示。读取范围限制在当前会话目录内,包括仓库子目录;支持独立工作树和尚无提交的仓库。可见的 Git 标签会在 Agent 状态变化、页面重新聚焦时刷新,并每 5 秒检查一次;隐藏后停止轮询。需要在 Pi 所在机器安装 Git。最多显示 1000 个文件,差异上限 512 KB / 10000 行;二进制文件、子模块和未解决冲突显示提示。改动属于共享工作树,不代表全部由当前聊天产生;工作区与历史文件的差异视图保持只读。
|
|
64
|
-
- 在「Git 改动 → 改动」中,用文件右侧的 **+ / −** 逐文件暂存或取消暂存;底部固定提交栏仅提交暂存区内容(支持 Ctrl/Cmd+Enter);点击顶部分支名称,可搜索和切换本地分支,选择「新建分支」才展开创建表单。文件列表独立滚动,仓库完整信息通过短名称的悬停提示查看。草稿随各聊天的 Git 标签保留。提交和切换分支要求仓库根目录工作区,切换还要求整个工作树干净(包括未跟踪文件)。写操作要求共用工作树的已知聊天均为空闲,并校验状态快照,遵守 Git hooks 与签名配置。冲突、未完成的 Git 操作、锁及其他工作树占用的分支会阻止相应操作。失败或结果不明时保留草稿,不自动重试。同一工作树的改动由多个聊天共享。不执行 fetch/push、强制切换、stash 或丢弃改动。
|
|
65
|
-
- 在「Git 改动 → 历史」中浏览提交及其分支、合并关系图,显示 HEAD、本地分支、远端跟踪分支和标签。历史每次加载 50 条;引用变化时重新加载首页,避免分页混入不同版本的历史。点击提交查看完整说明、作者与提交者、时间、父提交及改动文件,再点击文件在当前提交详情内预览只读差异,保留文件列表,不再新建差异标签。合并提交可选择比较的父提交,根提交与空目录比较。关系图展示整个仓库的提交元数据,提交文件和差异仍限制在当前会话目录内。历史选中项与已加载页随各聊天的 Git 标签保留,网页刷新后重置。远端标签仅使用本地记录,不发起拉取。
|
|
66
|
-
- 通过选择、拖放或粘贴附加文件,最多 20 个,每个不超过 20 MB。图片会显示预览,并作为 Pi 图片内容发送。
|
|
67
|
-
- 从侧栏「新会话」下方的「插件」入口管理内置 Git、文件和终端。支持列表/详情、搜索、真实启停和全局持久化;所有聊天空闲后才可切换。停用会关闭相关标签并阻止后端请求,停用终端需确认并结束此服务的全部终端。外部 Pi Web 插件展示运行时归属,仍通过「包与扩展」管理,不提供只隐藏 UI 的假开关。
|
|
68
|
-
- 在设置面板中管理外观、Pi 软件包、扩展、技能和模型。模型页可添加模型、编辑显示名称、上下文窗口、最大输出 token 数和输入类型,或恢复内置模型的默认参数;配置写入 Pi 的 `models.json`。网页登录会自动打开提供方授权页;当回调无法到达 Pi 时,仍可手动粘贴授权码。已保存的提供方认证可在这里移除。凭据保留在 Pi 本地的 `auth.json`,不会返回给浏览器。
|
|
92
|
+
**最新桌面测试版:[pi 0.1.24 · build 8](https://github.com/chengzhiyi/pi-webapp/releases/tag/desktop-v0.1.24-b8)。** 请按系统与芯片选择安装包:
|
|
69
93
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
94
|
+
| 平台 | 下载 |
|
|
95
|
+
| --- | --- |
|
|
96
|
+
| **macOS · Apple 芯片(arm64)** | [下载 DMG](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-arm64.dmg) |
|
|
97
|
+
| **macOS · Intel(x64)** | [下载 DMG](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-mac-x64.dmg) |
|
|
98
|
+
| **Windows · x64** | [下载 EXE 安装包](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-win-x64.exe) |
|
|
99
|
+
| **Linux · x64** | [下载 AppImage](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/pi-0.1.24-desktop.8-linux-x86_64.AppImage) |
|
|
73
100
|
|
|
74
|
-
|
|
101
|
+
[全部版本](https://github.com/chengzhiyi/pi-webapp/releases) · [SHA256SUMS 校验文件](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/SHA256SUMS) · [构建与运行时信息](https://github.com/chengzhiyi/pi-webapp/releases/download/desktop-v0.1.24-b8/desktop-release.json)
|
|
75
102
|
|
|
76
|
-
|
|
103
|
+
桌面应用名为 **pi**,自带 Node 和 Pi,无需另装运行时。支持复用兼容的 Web 服务、在浏览器中打开同一服务,以及退出时选择是否保留后台任务。模型凭据、Git/SSH 配置和项目工具链仍需自行准备。
|
|
77
104
|
|
|
78
|
-
|
|
105
|
+
- **安装:** macOS 从 DMG 将 **pi.app** 拖入“应用程序”;Windows 运行 EXE;Linux 为 AppImage 添加执行权限后运行,不支持 FUSE 时可参考该版本发布说明中的替代方式。
|
|
106
|
+
- **核对:** 对照同一 Release 的 `SHA256SUMS` 校验安装包,在「pi → 关于 pi」确认 **build 8**。替换前先退出旧桌面,不要删除 `~/.pi`。
|
|
107
|
+
- **测试版边界:** 当前为自愿参与的预发布测试包,不是具有发布者签名的稳定发行版。macOS 使用 ad-hoc 临时签名、未经过 Apple 公证,可能被 Gatekeeper 拦截;请按 [macOS 测试安装说明](docs/desktop-testing.md)核验,失败就停止。Windows/Linux 安装包未签名。不要全局关闭系统安全保护。桌面更新需手动安装;暂不包含 Windows ARM 和 Linux ARM。
|
|
79
108
|
|
|
80
|
-
|
|
109
|
+
## 技术架构亮点
|
|
81
110
|
|
|
82
|
-
|
|
111
|
+
**一套 Agent 引擎,多种使用入口,插件化工作台。** Pi 负责模型执行、工具与会话持久化;pi-webapp 负责界面、会话编排与工作区工具。
|
|
83
112
|
|
|
84
|
-
|
|
113
|
+
[](assets/readme/architecture-zh.svg)
|
|
85
114
|
|
|
86
|
-
|
|
115
|
+
*共享的是界面;会话编排、Agent 执行与工作区能力,仍然各司其职。*
|
|
87
116
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
```
|
|
117
|
+
| 设计 | 带来的价值 |
|
|
118
|
+
| --- | --- |
|
|
119
|
+
| **薄 Pi 适配层,独立宿主职责** | Agent 接入保持轻量,服务编排、浏览器 UI 与工作区能力各有归属,避免所有逻辑挤进单一扩展入口。 |
|
|
120
|
+
| **类型化、可校验的跨端契约** | 浏览器只依赖传输 DTO,不直接耦合 Node/Pi 运行时对象;HTTP 动作与 NDJSON 事件明确划分命令和实时状态更新。 |
|
|
121
|
+
| **能力插件化,而非页面堆叠** | Git、文件和终端分别拥有 server/client/contracts 与清理逻辑,由注册表分发请求;标签、停靠、专注模式和会话身份交给宿主工作台。 |
|
|
122
|
+
| **面向生命周期的会话管理** | 离开聊天仍保留后台进度与待处理交互;切换聊天保留工具资源,关闭标签则释放对应资源。 |
|
|
123
|
+
| **宿主边界上的操作保护** | 本地传输校验令牌与请求来源;文件预览限制工作区及符号链接范围;Git 写入拒绝过期状态,并协调同工作树的已知聊天。这些检查不等于操作系统沙箱。 |
|
|
124
|
+
| **多入口复用同一套界面** | React + TypeScript 构建工作台,Vite/esbuild 完成打包,Electron 提供桌面外壳,无需另维护一套桌面对话 UI。 |
|
|
97
125
|
|
|
98
|
-
|
|
126
|
+
源码导航:`src/adapters/pi/` → Pi 入口 · `src/host/` → 前后端宿主 · `src/plugins/builtin/` → 工作区能力 · `src/contracts/` → 跨端契约 · `web/src/ui/` → 共享 UI · `desktop/` → Electron 外壳。
|
|
99
127
|
|
|
100
|
-
|
|
128
|
+
深入了解:[架构与职责划分](docs/architecture.md) · [Web 插件接入与生命周期](docs/web-plugins.md)。
|
|
101
129
|
|
|
102
|
-
|
|
130
|
+
## 使用指南与开发
|
|
103
131
|
|
|
104
|
-
|
|
132
|
+
- **新用户:** [首次对话](docs/zh/getting-started.md) · [会话管理](docs/zh/sessions.md) · [工作区工具](docs/zh/workspace-tools.md)
|
|
133
|
+
- **配置与排错:** [模型、软件包与技能](docs/zh/configuration.md) · [版本更新](docs/zh/updates.md) · [常见问题](docs/zh/troubleshooting.md)
|
|
134
|
+
- **参与开发:** [架构说明](docs/architecture.md) · [Web 插件](docs/web-plugins.md) · [桌面构建](docs/desktop.md)
|
|
105
135
|
|
|
106
|
-
|
|
136
|
+
指南随源码演进,可能与你安装的版本不同;桌面端支持范围以上方已核实的下载链接及对应版本发布说明为准。
|
|
107
137
|
|
|
108
|
-
|
|
138
|
+
### 本地开发
|
|
109
139
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
140
|
+
```bash
|
|
141
|
+
npm ci
|
|
142
|
+
npm run check
|
|
143
|
+
npm test
|
|
144
|
+
npm run build
|
|
145
|
+
npm run start
|
|
146
|
+
```
|
|
116
147
|
|
|
117
|
-
`npm
|
|
148
|
+
`npm run start` 会构建并启动后台服务。修改扩展代码后,运行 `npm run stop` 再运行 `npm run start`;仅刷新网页不会替换桥接代码。使用 `pi -e .` 开发时,重新构建后在 Pi 中输入 `/reload`,再输入 `/web`。
|
|
118
149
|
|
|
119
|
-
|
|
150
|
+
桌面开发:`npm run desktop:prepare` → `npm run desktop:start`;`npm run desktop:package` 在 `desktop-release/` 生成当前系统的安装包。可信本地插件联调可参考[插件说明](docs/web-plugins.md)中的 `PI_WEBAPP_PLUGIN_DEV_ROOTS`。
|
|
120
151
|
|
|
121
|
-
|
|
152
|
+
---
|
|
122
153
|
|
|
123
|
-
|
|
154
|
+
**让下一次 Pi 任务,从一个可视化工作台开始:** 运行 `npx pi-webapp`,或[体验桌面测试版](#桌面端下载)。如果它让你的工作更顺手,欢迎 [Star 项目](https://github.com/chengzhiyi/pi-webapp)帮助更多人发现,也欢迎[提交反馈与可复现的问题](https://github.com/chengzhiyi/pi-webapp/issues),一起完善工作流。
|
|
124
155
|
|
|
125
|
-
MIT
|
|
156
|
+
基于 MIT 许可证开源。详见 [LICENSE](LICENSE)。
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# README visual assets
|
|
2
|
+
|
|
3
|
+
These images illustrate the real pi-webapp interface using a **seeded demo conversation** and a disposable checkout project. They are not a recording of a live model run. No provider authentication, user sessions, or private repositories are used.
|
|
4
|
+
|
|
5
|
+
| Asset | Contents |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `workbench.png` | Full workbench: project navigation, conversation, and read-only TypeScript preview. |
|
|
8
|
+
| `git-review.png` | Git tool panel: staged regression tests and the actual `>` → `>=` working-tree diff. |
|
|
9
|
+
| `terminal.png` | Terminal tool panel: actual Node test execution in the disposable project, with two passing tests. |
|
|
10
|
+
| `architecture-en.svg` / `architecture-zh.svg` | Editable, self-contained architecture diagrams. Text, shapes, and connectors only; no remote fonts, scripts, or embedded private data. |
|
|
11
|
+
|
|
12
|
+
## Regenerate screenshots
|
|
13
|
+
|
|
14
|
+
From a source checkout with Node.js 22.19+ and dependencies installed:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm run build
|
|
18
|
+
npx playwright install chromium # Only if the browser is not installed yet
|
|
19
|
+
node --experimental-strip-types scripts/capture-readme.ts
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The capture script starts a loopback bridge only for the bounded capture run and closes it afterward. It creates a temporary Git repository and shell, seeds example messages without calling a model, checks code and diff rendering, runs the demo tests in a real PTY, and checks for browser errors before cleanup. The Git repository, plugin settings, and shell profile are temporary; your normal Pi service and settings are not changed. The helper currently uses a POSIX shell and Git; run it on macOS/Linux.
|
|
23
|
+
|
|
24
|
+
Screenshots are captured at a 1440 × 760 viewport and 1.5× pixel density. The hero shows the full page; the Git and terminal images crop to the tool panel so their details remain legible side by side. Do not fabricate UI controls or test output in post-processing. Interface copy is English in both READMEs; surrounding captions are localized.
|
|
25
|
+
|
|
26
|
+
## Maintain the diagrams
|
|
27
|
+
|
|
28
|
+
Edit both SVGs together when boundaries change; keep their dimensions and palette consistent. Match the host/Pi/plugin responsibilities in `docs/architecture.md`, provide a descriptive title and alternative text, and verify XML and browser rendering. Keep critical text inside the canvas.
|
|
29
|
+
|
|
30
|
+
The package's `files` list includes this directory so the README images remain available in npm packages, not only on GitHub. Keep the existing `assets/cover-webapp.png` separate: it is also used as the Pi package catalog cover.
|