pi-web-ui 0.34.3 → 0.35.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 +93 -0
- package/README.zh-CN.md +80 -0
- package/bin/pi-web-ui.mjs +1736 -1722
- package/dist/server/agent-service.js +8 -2
- package/dist/server/index.js +7 -2
- package/dist/server/plugins.js +44 -2
- package/dist/server/protocol-version.js +1 -1
- package/package.json +1 -1
- package/themes/md-preview.css +7167 -7026
- package/themes/white.css +7228 -7087
- package/web/dist/assets/{TerminalPanel-__4r1Djg.js → TerminalPanel-BxezvWth.js} +1 -1
- package/web/dist/assets/index-BP593LGC.js +19 -0
- package/web/dist/assets/index-DduTNQNx.css +10 -0
- package/web/dist/index.html +2 -2
- package/web/dist/assets/index-8y0w43os.css +0 -10
- package/web/dist/assets/index-CITqw531.js +0 -19
package/README.md
CHANGED
|
@@ -164,6 +164,99 @@ Options: `--port` (default 8787), `--cwd` (workspace), `--data-dir` (sessions),
|
|
|
164
164
|
regenerates the config and restarts the service — that's how you change its
|
|
165
165
|
port/cwd.
|
|
166
166
|
|
|
167
|
+
## Plugins (UI extensions)
|
|
168
|
+
|
|
169
|
+
Plugins are optional UI components (extra top-bar tabs backed by their own
|
|
170
|
+
client view, optionally with a server-side entry and agent tools). They live in
|
|
171
|
+
your **data-dir plugins folder** (`<dataDir>/plugins/<id>/`, default
|
|
172
|
+
`~/.pi-web/plugins/`) — a plugin is simply a directory containing
|
|
173
|
+
`manifest.json`, an optional server entry (`index.mjs`) and an optional view
|
|
174
|
+
entry (`client/entry.mjs`). No plugin directories = no plugins, nothing shows
|
|
175
|
+
up in the UI.
|
|
176
|
+
|
|
177
|
+
### Plugin catalog
|
|
178
|
+
|
|
179
|
+
These plugins ship in this repository (`dev/plugins/<id>/`) and can be installed
|
|
180
|
+
straight from GitHub:
|
|
181
|
+
|
|
182
|
+
| Plugin | What it does |
|
|
183
|
+
| --- | --- |
|
|
184
|
+
| 📬 [webmail](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail) | IMAP inbox browsing / search / read / mark / delete + SMTP sending, new-mail notifications, and an optional "allow AI to manage my mailbox" switch (six `mail_*` agent tools). Auto-installs its npm deps on first activation. |
|
|
185
|
+
| 🗄️ [db-client](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/db-client) | Database workbench: connection manager + schema tree for MySQL / PostgreSQL / SQLite / SQL Server / MongoDB / Redis — table structure, paginated data with sorting, SQL editor, and row editing. Drivers auto-install on first use. |
|
|
186
|
+
| 📝 [vscode-editor](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/vscode-editor) | VS Code-like workbench: multi-root file tree (local + SSH hosts), CodeMirror multi-tab editor, Remote-SSH remote file browsing/editing, draggable multi-terminal panel (xterm.js), SFTP sync & upload/download to your computer. Auto-installs `ssh2`. |
|
|
187
|
+
| 📬 [demo-mailbox](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/demo-mailbox) | Minimal example plugin demonstrating the server entry + client view + two-way message protocol. Doubles as the plugin test fixture — start here if you want to write your own. |
|
|
188
|
+
|
|
189
|
+
Example — install the webmail plugin:
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
pi-web-ui install https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
Each plugin's directory in the repo has its own `README.md` with full feature
|
|
196
|
+
lists, configuration and per-plugin caveats.
|
|
197
|
+
|
|
198
|
+
### Installing
|
|
199
|
+
|
|
200
|
+
From GitHub (any of these source forms):
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
pi-web-ui install owner/repo # shorthand
|
|
204
|
+
pi-web-ui install https://github.com/owner/repo # full URL (.git optional)
|
|
205
|
+
pi-web-ui install https://github.com/o/r/tree/dev/sub/dir # branch + subdirectory inside the repo
|
|
206
|
+
pi-web-ui install owner/repo#v1.2 # pin a branch/tag (#suffix works on any form above)
|
|
207
|
+
pi-web-ui install /path/to/plugin-dir # local directory (for development)
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Useful options:
|
|
211
|
+
|
|
212
|
+
- `--name <id>` — custom plugin id / directory name (defaults to the repo or
|
|
213
|
+
subdirectory name; letters/digits/`-`/`_` only).
|
|
214
|
+
- `--force` — overwrite an existing installation. Your plugin's local
|
|
215
|
+
`config.json` (credentials etc.) is preserved across upgrades.
|
|
216
|
+
- `--data-dir <dir>` — override the data dir (default `~/.pi-web`).
|
|
217
|
+
|
|
218
|
+
The CLI clones the repo (shallow; falls back to a tarball download without
|
|
219
|
+
git), locates the `manifest.json` (including inside subdirectories) and copies
|
|
220
|
+
the plugin into `<dataDir>/plugins/<id>/`.
|
|
221
|
+
|
|
222
|
+
**No git? No network?** You can also just copy a plugin directory into
|
|
223
|
+
`~/.pi-web/plugins/` by hand — same result.
|
|
224
|
+
|
|
225
|
+
### Updating
|
|
226
|
+
|
|
227
|
+
Re-run `install` against the same source with `--force`:
|
|
228
|
+
|
|
229
|
+
```bash
|
|
230
|
+
# example: update the webmail plugin to the latest version in the repo
|
|
231
|
+
pi-web-ui install https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail --force
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
- The upgrade preserves the plugin's local `config.json` automatically.
|
|
235
|
+
- Plugins that store other local state inside their directory (e.g. db-client's
|
|
236
|
+
`db-connections.json`, vscode-editor's `ssh-hosts.json`) are **not** covered
|
|
237
|
+
by that preservation — back those up before a forced reinstall.
|
|
238
|
+
- Refresh the browser afterwards; no server restart needed.
|
|
239
|
+
|
|
240
|
+
### Activating
|
|
241
|
+
|
|
242
|
+
If the server is running, just **refresh the browser** — new plugins are picked
|
|
243
|
+
up on attach without a restart. If it isn't, they load on next start. Each
|
|
244
|
+
plugin appears as a tab (🧩 or its own icon) in the top bar.
|
|
245
|
+
|
|
246
|
+
### Listing / disabling / uninstalling
|
|
247
|
+
|
|
248
|
+
```bash
|
|
249
|
+
pi-web-ui plugins # list installed plugins (id / name / version / description)
|
|
250
|
+
pi-web-ui uninstall <id> # remove a plugin
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
- To temporarily hide a plugin without uninstalling, use the **Settings panel
|
|
254
|
+
(⚙) → UI plugins** switches — stored per client, purely visual, no restart
|
|
255
|
+
needed. Re-enable any time.
|
|
256
|
+
- `uninstall` deletes the plugin directory; refresh the browser and its tab
|
|
257
|
+
disappears. Plugin configuration written inside the plugin dir is removed
|
|
258
|
+
too — back up `<dataDir>/plugins/<id>/config.json` first if you need it.
|
|
259
|
+
|
|
167
260
|
## Themes
|
|
168
261
|
|
|
169
262
|
Each theme is a **complete standalone stylesheet** — a full copy of the bundled dark `web/src/styles.css` with a different palette (no CSS-variable extraction, no base file to include). Picking a theme swaps the whole file, so any theme works with every build.
|
package/README.zh-CN.md
CHANGED
|
@@ -159,6 +159,86 @@ pi-web-ui server unquiesce # 解除排空,恢复接收新工
|
|
|
159
159
|
`--name`(自定义服务名)。重复执行 `server install` 并传入新选项即可重新生成配置
|
|
160
160
|
并重启服务 —— 这就是修改已装服务端口/工作目录的方式。
|
|
161
161
|
|
|
162
|
+
## 界面插件
|
|
163
|
+
|
|
164
|
+
插件是可选的界面组件(顶栏多出一个 tab,背后是插件自己的视图,可带服务端入口和 AI 工具)。
|
|
165
|
+
它们安装在**数据目录的 plugins 文件夹**(`<dataDir>/plugins/<id>/`,默认
|
|
166
|
+
`~/.pi-web/plugins/`)—— 一个插件就是一个目录:`manifest.json` + 可选服务端入口
|
|
167
|
+
(`index.mjs`)+ 可选视图入口(`client/entry.mjs`)。目录不存在 = 没有插件,界面上不会有任何痕迹。
|
|
168
|
+
|
|
169
|
+
### 插件目录
|
|
170
|
+
|
|
171
|
+
以下插件随本仓库发布(`dev/plugins/<id>/`),可直接从 GitHub 安装:
|
|
172
|
+
|
|
173
|
+
| 插件 | 功能 |
|
|
174
|
+
| --- | --- |
|
|
175
|
+
| 📬 [网页邮箱 webmail](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail) | IMAP 收件箱浏览/搜索/阅读/标记/删除 + SMTP 发信、新邮件通知,可选「允许 AI 管理邮箱」(六个 `mail_*` AI 工具)。首次激活自动补装 npm 依赖。 |
|
|
176
|
+
| 🗄️ [数据库 db-client](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/db-client) | 数据库工作台:MySQL / PostgreSQL / SQLite / SQL Server / MongoDB / Redis 连接管理 + 库表树 —— 表结构、分页排序、SQL 编辑器、行编辑。驱动首次使用自动安装。 |
|
|
177
|
+
| 📝 [编辑器 + SSH vscode-editor](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/vscode-editor) | 类 VSCode 工作台:多根文件树(本地 + SSH 主机)、CodeMirror 多标签编辑器、Remote-SSH 远程文件浏览/编辑、可拖拽多终端面板(xterm.js)、SFTP 同步与下载到电脑。自动安装 `ssh2`。 |
|
|
178
|
+
| 📬 [示例邮箱 demo-mailbox](https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/demo-mailbox) | 最小示例插件:演示服务端入口 + 客户端视图 + 双向消息协议,兼作测试夹具——想自己写插件从这里入手。 |
|
|
179
|
+
|
|
180
|
+
安装示例(网页邮箱):
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
pi-web-ui install https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
每个插件在仓库里的目录都带独立 `README.md`,含完整功能清单、配置说明与注意事项。
|
|
187
|
+
|
|
188
|
+
### 安装
|
|
189
|
+
|
|
190
|
+
从 GitHub 安装(支持以下任意源写法):
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
pi-web-ui install owner/repo # 简写
|
|
194
|
+
pi-web-ui install https://github.com/owner/repo # 完整 URL(.git 可省)
|
|
195
|
+
pi-web-ui install https://github.com/o/r/tree/dev/sub/dir # 指定分支 + 仓库内子目录
|
|
196
|
+
pi-web-ui install owner/repo#v1.2 # 指定分支/tag(#后缀对以上任意写法都适用)
|
|
197
|
+
pi-web-ui install /path/to/plugin-dir # 本地目录直接安装(开发调试用)
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
常用选项:
|
|
201
|
+
|
|
202
|
+
- `--name <id>` —— 自定义插件 id / 目录名(默认取仓库名或子目录名;仅限字母数字-`-`/`_`)。
|
|
203
|
+
- `--force` —— 目标目录已存在时覆盖安装。插件本地的 `config.json`(凭据等)在升级时会原样保留。
|
|
204
|
+
- `--data-dir <dir>` —— 覆盖数据目录(默认 `~/.pi-web`)。
|
|
205
|
+
|
|
206
|
+
CLI 会浅克隆仓库(无 git 时回退 tarball 下载),定位其中的 `manifest.json`
|
|
207
|
+
(包括仓库内子目录里的),然后把插件拷贝到 `<dataDir>/plugins/<id>/`。
|
|
208
|
+
|
|
209
|
+
**没装 git?没有网络?** 直接把插件目录手工拷进 `~/.pi-web/plugins/` 也行——效果完全一样。
|
|
210
|
+
|
|
211
|
+
### 更新
|
|
212
|
+
|
|
213
|
+
对同一来源重新执行 `install` 并加 `--force` 即覆盖更新:
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# 例:把网页邮箱插件更新到仓库里的最新版
|
|
217
|
+
pi-web-ui install https://github.com/xing-shuyin/pi-web-ui/tree/main/dev/plugins/webmail --force
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
- 升级时会自动保留插件目录里的 `config.json`(账号凭据等)。
|
|
221
|
+
- 存放在插件目录**其他位置**的本地数据不在保留范围内(如 db-client 的
|
|
222
|
+
`db-connections.json`、vscode-editor 的 `ssh-hosts.json`)——强制重装前请先备份。
|
|
223
|
+
- 更新后刷新浏览器即可生效,无需重启服务。
|
|
224
|
+
|
|
225
|
+
### 生效方式
|
|
226
|
+
|
|
227
|
+
服务运行中只需**刷新浏览器**——新插件在 attach 时即被加载,无需重启;服务未运行则下次启动生效。
|
|
228
|
+
每个插件会在顶栏出现一个 tab(🧩 或插件自带图标)。
|
|
229
|
+
|
|
230
|
+
### 列出 / 停用 / 卸载
|
|
231
|
+
|
|
232
|
+
```bash
|
|
233
|
+
pi-web-ui plugins # 列出已装插件(id / 名称 / 版本 / 描述)
|
|
234
|
+
pi-web-ui uninstall <id> # 卸载插件
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
- 想临时隐藏某个插件而不卸载:设置面板(⚙)→「界面插件」开关即可——按客户端持久化、纯 UI
|
|
238
|
+
隐藏,无需重启,随时可重新打开。
|
|
239
|
+
- `uninstall` 会删除插件目录;刷新浏览器后 tab 即消失。写在插件目录内的配置文件也会一并删除——
|
|
240
|
+
如需保留请先备份 `<dataDir>/plugins/<id>/config.json`。
|
|
241
|
+
|
|
162
242
|
## 主题
|
|
163
243
|
|
|
164
244
|
每个主题是**一份完整独立的样式表** —— 即内置深色 `web/src/styles.css` 的整份副本,只是配色不同(不做 CSS 变量抽取、不需要引入基础文件)。切换主题就是整文件替换,因此任何主题都能在所有版本上工作。
|