pi-webapp 0.1.0 → 0.1.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 +7 -1
- package/README.zh-CN.md +56 -0
- package/package.json +7 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# pi-webapp
|
|
2
2
|
|
|
3
|
+
[简体中文](README.zh-CN.md)
|
|
4
|
+
|
|
3
5
|

|
|
4
6
|
|
|
5
7
|
**pi-webapp** opens the active Pi coding agent session in a local browser. Pi continues to run the agent, tools, and session storage; the browser provides a live interface for conversation and control.
|
|
@@ -39,12 +41,16 @@ pi -e .
|
|
|
39
41
|
|
|
40
42
|
After editing the extension, rebuild it, then enter `/reload` and `/web` in Pi. Refreshing an old browser page alone does not replace the running bridge.
|
|
41
43
|
|
|
42
|
-
The source lives in `extension/`, `shared/`, and `web/src/`. The npm package contains only the bundled, minified JavaScript extension, built web assets, cover image, and
|
|
44
|
+
The source lives in `extension/`, `shared/`, and `web/src/`. The npm package contains only the bundled, minified JavaScript extension, built web assets, cover image, and the English and Chinese READMEs. No TypeScript source or source maps are published. Minification makes the shipped code harder to read; it does not encrypt JavaScript.
|
|
43
45
|
|
|
44
46
|
## Publish
|
|
45
47
|
|
|
46
48
|
`npm publish` runs the checks, tests, and production build. The `pi-package` keyword makes the published npm package eligible for the [Pi package catalog](https://pi.dev/packages); catalog updates may lag behind npm.
|
|
47
49
|
|
|
50
|
+
GitHub Actions runs `check`, `test`, and `build` on pull requests to `main`. A push to `main` repeats those checks and then publishes the next patch version to npm. The release version is selected from the greater of the source version and the npm `latest` version; it is set in the package during CI and is not committed back to Git. To start a new minor or major series, raise the version in `package.json` and `package-lock.json` in the pull request. Each release also updates the package's `pi.image` URL to its own version.
|
|
51
|
+
|
|
52
|
+
Before the first automated release, configure npm Trusted Publishing for the `pi-webapp` package: GitHub owner `chengzhiyi`, repository `pi-webapp`, workflow filename `ci.yml`, no environment, and allow direct `npm publish`. This workflow uses GitHub's OIDC identity and does not need an npm token. Keep the package's repository URL in `package.json` aligned with the GitHub repository.
|
|
53
|
+
|
|
48
54
|
## License
|
|
49
55
|
|
|
50
56
|
MIT. See the `LICENSE` file.
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# pi-webapp
|
|
2
|
+
|
|
3
|
+
[English](README.md)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**pi-webapp** 可以在本地浏览器中打开当前活跃的 Pi 编程 Agent 会话。Agent、工具和会话存储仍由 Pi 运行和管理;浏览器提供实时的对话与控制界面。
|
|
8
|
+
|
|
9
|
+
## 安装与打开
|
|
10
|
+
|
|
11
|
+
需要 Node.js 22.19 或更新版本,以及 Pi 0.87.1 或更新版本。
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pi install npm:pi-webapp
|
|
15
|
+
pi
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
在 Pi 中输入 `/web`,即可在默认浏览器中打开界面。对于远程或无图形界面的环境,Pi 也会输出本地访问地址。该地址包含一个随机令牌,仅在当前 Pi 进程运行期间有效。再次输入 `/web` 可以重新打开界面。
|
|
19
|
+
|
|
20
|
+
## 功能
|
|
21
|
+
|
|
22
|
+
- 查看当前对话,包括 Markdown 内容、流式输出、可展开的推理过程与工具调用、Token 用量,以及逐轮执行轨迹。
|
|
23
|
+
- 发送消息、停止运行、启动新的 Pi 会话,以及切换当前模型或思考级别。
|
|
24
|
+
- 浏览工作区和已保存的会话。环境支持时可通过系统目录选择器添加工作区;通过 SSH 使用时,也可使用内置目录浏览器。
|
|
25
|
+
- 通过选择、拖放或粘贴附加文件,最多 20 个,每个不超过 20 MB。图片会显示预览,并作为 Pi 图片内容发送。
|
|
26
|
+
- 在设置面板中管理外观、Pi 软件包、扩展、技能和模型。模型提供商的凭据保留在 Pi 本地的身份验证存储中,不会返回给浏览器。
|
|
27
|
+
|
|
28
|
+
打开 `/web` 的 Pi 终端会话会与浏览器保持同步。在其他工作区打开的会话使用 Pi SDK,并加载该工作区的技能和项目上下文;同一进程中不会再次加载扩展。
|
|
29
|
+
|
|
30
|
+
工作区记录和附件继续存放在 Pi 现有的 `pi-web/` 数据目录下,以兼容早期版本。从侧边栏移除工作区不会删除其文件或会话。
|
|
31
|
+
|
|
32
|
+
## 本地开发
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
npm install
|
|
36
|
+
npm run check
|
|
37
|
+
npm run test
|
|
38
|
+
npm run build
|
|
39
|
+
pi -e .
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
修改扩展后,需要重新构建扩展,再在 Pi 中依次输入 `/reload` 和 `/web`。仅刷新旧的浏览器页面不会替换正在运行的连接桥接代码。
|
|
43
|
+
|
|
44
|
+
源代码位于 `extension/`、`shared/` 和 `web/src/`。npm 软件包仅包含打包并压缩后的 JavaScript 扩展、构建后的 Web 资源、封面图片,以及英文和中文 README;不会发布 TypeScript 源码或 source map。代码压缩会增加阅读发布版本代码的难度,但不会对 JavaScript 加密。
|
|
45
|
+
|
|
46
|
+
## 发布
|
|
47
|
+
|
|
48
|
+
`npm publish` 会运行检查、测试和生产构建。`pi-package` 关键词使发布到 npm 的软件包有资格进入 [Pi 软件包目录](https://pi.dev/packages);目录更新可能晚于 npm。
|
|
49
|
+
|
|
50
|
+
GitHub Actions 会在针对 `main` 的拉取请求中运行 `check`、`test` 和 `build`。代码推送到 `main` 后会再次运行这些检查,全部通过才自动发布下一个补丁版本。发布版本根据源码版本和 npm `latest` 版本确定,仅在 CI 中写入包文件,不会提交回 Git。如需开始新的次版本或主版本,请在拉取请求中同步提高 `package.json` 和 `package-lock.json` 的版本。每次发布也会将包内 `pi.image` 的地址更新为该版本。
|
|
51
|
+
|
|
52
|
+
首次自动发布前,请在 npm 的 `pi-webapp` 包设置中配置 Trusted Publishing:GitHub 所有者为 `chengzhiyi`,仓库为 `pi-webapp`,工作流文件名为 `ci.yml`,不设置环境,并允许直接执行 `npm publish`。工作流通过 GitHub OIDC 认证,无需 npm token。`package.json` 中的仓库地址应与 GitHub 仓库保持一致。
|
|
53
|
+
|
|
54
|
+
## 许可证
|
|
55
|
+
|
|
56
|
+
MIT。详见 `LICENSE` 文件。
|
package/package.json
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-webapp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A browser interface for Pi with live chat, workspaces, models, and attachments",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git+https://github.com/chengzhiyi/pi-webapp.git"
|
|
9
|
+
},
|
|
6
10
|
"license": "MIT",
|
|
7
11
|
"keywords": [
|
|
8
12
|
"pi-package"
|
|
9
13
|
],
|
|
10
14
|
"pi": {
|
|
11
|
-
"image": "https://unpkg.com/pi-webapp@0.1.
|
|
15
|
+
"image": "https://unpkg.com/pi-webapp@0.1.1/assets/cover-webapp.png",
|
|
12
16
|
"extensions": [
|
|
13
17
|
"./dist/extension.js"
|
|
14
18
|
]
|
|
@@ -18,6 +22,7 @@
|
|
|
18
22
|
"dist",
|
|
19
23
|
"web/dist",
|
|
20
24
|
"README.md",
|
|
25
|
+
"README.zh-CN.md",
|
|
21
26
|
"LICENSE"
|
|
22
27
|
],
|
|
23
28
|
"scripts": {
|