magpie-pi 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 +21 -133
- package/README.zh-CN.md +21 -133
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,153 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
English | [简体中文](README.zh-CN.md)
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
No HTTP listener, full gateway, Go-to-TypeScript translation, or Pi core fork. Plugins handle accounts, refreshes, and requests; Pi's native SDK handles message, tool, and streaming-event conversion.
|
|
5
|
+
Bring magpie's community plugin integrations to Pi through a lightweight extension and a local host. Uses Pi's native SDK over stdio, without an HTTP gateway or Pi core changes.
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
Derived from [yetone/magpie](https://github.com/yetone/magpie), with its OpenCode host extracted without modifications. Thanks to the original author and maintainers.
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
Run from this directory:
|
|
9
|
+
## Installation
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
node scripts/build.mjs
|
|
15
|
-
# Install the local extension explicitly; the build does not change global Pi settings.
|
|
16
|
-
pi install /absolute/path/magpie-pi
|
|
17
|
-
# Or load it for this session only.
|
|
18
|
-
pi -e /absolute/path/magpie-pi/extension/index.ts
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
For development dependencies, use the Pi installation's node_modules or install the exact peerDependencies versions in package.json. The local node_modules is a development symlink to an existing Pi installation, not part of the release.
|
|
22
|
-
|
|
23
|
-
Local-path installation references the project directory directly rather than copying source into Pi's plugin directory. Extension edits do not require reinstallation; after Go changes, rerun `node scripts/build.mjs`. Restart Pi after changes to the background host or configuration.
|
|
24
|
-
|
|
25
|
-
## Quick start: install from the menu → log in → select a model
|
|
26
|
-
|
|
27
|
-
After building, install persistently and start Pi:
|
|
11
|
+
Requires **Pi 1.6.0**, **Bun** to run community plugins, and **Node.js/npm** for plugin installation and management.
|
|
28
12
|
|
|
29
13
|
```sh
|
|
30
|
-
pi install
|
|
14
|
+
pi install npm:magpie-pi
|
|
31
15
|
pi
|
|
32
16
|
```
|
|
33
17
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
1. Enter `/magpie-plugins` in Pi to open the native TUI menu. Use **↑/↓** to select, **Enter** to confirm, and **Esc** to exit. UI text is in English.
|
|
37
|
-
2. Choose **Search and install**, enter `cursor` or `workbuddy`, then select a package and version. After you read the permissions notice and confirm, the extension downloads the plugin and saves its configuration automatically—no manual JSON editing needed.
|
|
38
|
-
3. Exit and restart Pi after installation. If multiple Pi instances share the state directory, exit all of them before restarting.
|
|
39
|
-
4. Enter `/login`, select the service, and follow the login prompts. Registered provider IDs have a `magpie-` prefix; menus may display the service name supplied by the plugin.
|
|
40
|
-
5. Enter `/model`, select a model from that service, and chat or use tools normally. Pi's built-in services remain available.
|
|
41
|
-
|
|
42
|
-
Other menu entries:
|
|
43
|
-
|
|
44
|
-
| Menu entry | Purpose |
|
|
45
|
-
| --- | --- |
|
|
46
|
-
| Installed plugins / details | View configured plugins and installation paths |
|
|
47
|
-
| Uninstall | Select and confirm removal of a managed plugin; old files are cleaned up after restart, preserving credentials |
|
|
48
|
-
| Install by package name | Enter an alias or full package name, optionally with `@exact-version` |
|
|
49
|
-
| Help | View text subcommands |
|
|
50
|
-
|
|
51
|
-
You can also enter `/magpie-plugins install cursor` or `/magpie-plugins install workbuddy`; interactive confirmation is still required. Reinstalling a managed plugin can replace its version; this is not an automatic background update.
|
|
52
|
-
|
|
53
|
-
**Current limitations:** Real Cursor/WorkBuddy accounts have not been verified. Successful search or installation does not establish model-call compatibility. If a service is missing from `/login`, confirm you restarted and check startup errors. If `/model` lists no models, the plugin may not expose a supported protocol; see “Supported scope” below. This extension does not yet integrate magpie's built-in Codex, Claude, Copilot, or Gemini account implementations.
|
|
54
|
-
|
|
55
|
-
## Configuration and credentials (manual configuration is optional)
|
|
56
|
-
|
|
57
|
-
On first load, the extension creates a separate state directory, `~/.local/share/magpie-pi` (0700), and an empty `config.json` (0600). With no plugins configured, it only displays a configuration hint: Go/Bun are not started, and Pi's existing services are unaffected. Existing configuration is not overwritten; invalid JSON produces an explicit error.
|
|
58
|
-
|
|
59
|
-
Use the menu to manage plugins. Manual editing of `config.json` is only needed for plugins you install yourself, for example:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"plugins": [
|
|
64
|
-
{
|
|
65
|
-
"spec": "@magpie-community/opencode-cursor-auth",
|
|
66
|
-
"target": "/absolute/plugin-install/node_modules/@magpie-community/opencode-cursor-auth"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"accounts": {},
|
|
70
|
-
"opencode": {}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
For manual installation, use a separate directory of your choice, run `npm install --save-exact package-name@exact-version`, and retain `package-lock.json`. `target` must point to an installed package or entry file. This project does not automatically download third-party code at startup; configure it manually or explicitly confirm installation through the menu. WorkBuddy uses `@magpie-community/opencode-workbuddy-auth`, not the old built-in implementation.
|
|
75
|
-
Do not install the withdrawn Antigravity plugin for new users.
|
|
18
|
+
The npm package includes prebuilt supervisor binaries: **no Go installation or build command is needed**. Bun is still required at runtime (locally tested with 1.3.14).
|
|
76
19
|
|
|
77
|
-
|
|
78
|
-
Use Pi's `/login` to select an extension-registered service (internal IDs start with `magpie-`). API keys, automatic/code-paste OAuth, and conditional host prompt/validate forms are supported; complex vendor forms have not been tested live.
|
|
79
|
-
The original host stores real tokens in a separate `plugin-auth.json` (0600); Pi stores only a `plugin-owned` marker.
|
|
80
|
-
For multiple accounts, the host's default account is used unless `config.accounts` pins an account key by plugin provider ID.
|
|
81
|
-
Pi's `/logout` clears the marker and disables the provider without deleting plugin credentials; use `/login` to enable it again. Resolution requires both Pi's saved marker and the host's login state, so cached credentials cannot bypass Pi logout. There is no plugin-credential deletion command yet.
|
|
82
|
-
|
|
83
|
-
## Supported scope
|
|
84
|
-
|
|
85
|
-
The full Go → Bun fixture plugin → Pi native OpenAI Chat SDK path has been tested for login, model discovery, text, tool calls, cancellation, and credential persistence across restarts.
|
|
86
|
-
Only Chat Completions models from `@ai-sdk/openai-compatible` and Messages models from `@ai-sdk/anthropic` are exposed.
|
|
87
|
-
The Anthropic path uses Pi's native implementation but has not had real-service or fixture verification. Responses/Gemini are unsupported. Because `@ai-sdk/openai` does not reliably distinguish Chat from Responses, all its models are hidden rather than silently treated as Chat.
|
|
88
|
-
Costs are currently marked as 0 to indicate missing pricing information, not free service.
|
|
89
|
-
Real Cursor/WorkBuddy accounts remain unverified; compatibility with all community plugins is not claimed.
|
|
90
|
-
Built-in Codex, Claude, Copilot, and Gemini account logic has not been extracted. There is no account rotation, quota routing, gateway conversion, GUI, migration tooling, or automatic plugin updating. For ordinary APIs, use Pi's `models.json` directly.
|
|
91
|
-
|
|
92
|
-
Plugins are trusted local code running with the current user's privileges, not a security sandbox. Windows file permissions depend on the user directory's ACL. Cross-platform compilation does not establish runtime support; only Linux has been tested at runtime.
|
|
93
|
-
|
|
94
|
-
## Protocol and lifecycle
|
|
95
|
-
|
|
96
|
-
Bridge protocol v1 uses the host JSON-lines contract pinned by `extraction.json`:
|
|
97
|
-
requests `{id,method,params}`; responses `{id,result}` / `{id,error}`.
|
|
98
|
-
Fetch sends a head, then base64 chunks, then a result. Credit returns the consumed byte count plus 2048 bytes of overhead per frame.
|
|
99
|
-
Each request starts with a 65536-byte window; credit is returned only on `ReadableStream` pull. Abort cancels the same ID.
|
|
100
|
-
Stdio provides backpressure; Go does not buffer complete responses. EOF closes Bun's stdin; direct children still running after two seconds are forcibly terminated.
|
|
101
|
-
Plugin-spawned grandchildren are not contained as a process tree. A host crash fails pending requests; generation is not retried automatically.
|
|
102
|
-
There is no local listening port. The Go supervisor manages only processes and state permissions; protocol adaptation stays in the thin extension.
|
|
103
|
-
|
|
104
|
-
## Testing and updates
|
|
105
|
-
|
|
106
|
-
```sh
|
|
107
|
-
node scripts/extraction.mjs
|
|
108
|
-
node scripts/build.mjs
|
|
109
|
-
node --test tests/*.test.mjs
|
|
110
|
-
bun test tests/provider.test.ts
|
|
111
|
-
go vet ./...
|
|
112
|
-
go test -race ./...
|
|
113
|
-
node scripts/build.mjs --all
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
Tests use temporary state directories and local fixtures, requiring neither real tokens nor network access.
|
|
117
|
-
Go currently has no standalone unit tests; its main behavior is covered by integration tests using the compiled binary.
|
|
118
|
-
Cross-platform artifacts are in `bin/`. Keep their platform-specific names, such as `magpie-pi-linux-amd64` and `magpie-pi-windows-arm64.exe`; the extension selects the matching binary automatically. Retain `vendor/` and `extension/`. A local build also creates the legacy `magpie-pi` / `magpie-pi.exe` alias for integration tests.
|
|
119
|
-
|
|
120
|
-
### npm packaging preparation
|
|
121
|
-
|
|
122
|
-
The package whitelist includes `extension/`, `vendor/`, `bin/`, the extraction manifest, and both READMEs. Run `node scripts/build.mjs --all` before packaging to include all six platform binaries. Package users need Bun and compatible Pi, but not Go. Only Linux runtime behavior has been verified. These packaging changes do not mean the package has been published.
|
|
123
|
-
|
|
124
|
-
The project's own license is currently `UNLICENSED`; choose an explicit distribution license before public release. The extracted host retains its upstream MIT license in `vendor/LICENSE`.
|
|
125
|
-
|
|
126
|
-
`extraction.json` pins the source commit, per-file SHA-256 hashes, and an empty patch list. `vendor/LICENSE` contains the upstream MIT license.
|
|
127
|
-
Before updating, read the upstream design and review changes, then explicitly run:
|
|
128
|
-
|
|
129
|
-
```sh
|
|
130
|
-
node scripts/extraction.mjs extract /absolute/path/magpie
|
|
131
|
-
node scripts/extraction.mjs
|
|
132
|
-
# Rerun the tests above and review the new extraction.json before publishing.
|
|
133
|
-
```
|
|
20
|
+
## Usage
|
|
134
21
|
|
|
135
|
-
|
|
22
|
+
1. Enter `/magpie-plugins` in Pi.
|
|
23
|
+
2. Choose **Search and install**, search for `cursor` or `workbuddy`, select a package and version, then confirm.
|
|
24
|
+
3. Exit and restart Pi. If multiple instances share the state directory, exit all of them before restarting.
|
|
25
|
+
4. Enter `/login` and select the service.
|
|
26
|
+
5. Enter `/model` to select a model and start chatting.
|
|
136
27
|
|
|
137
|
-
|
|
28
|
+
Use ↑/↓ to navigate, Enter to confirm, and Esc to cancel. The menu also supports viewing installed plugins, installing by package name, and uninstalling. Pi's built-in providers remain available.
|
|
138
29
|
|
|
139
|
-
|
|
30
|
+
Third-party plugins run with your user privileges; install only plugins you trust. Real Cursor/WorkBuddy accounts remain unverified.
|
|
140
31
|
|
|
141
|
-
|
|
142
|
-
- `/magpie-plugins help`
|
|
143
|
-
- `/magpie-plugins search cursor`
|
|
144
|
-
- `/magpie-plugins install cursor` (or a full package name with `@exact-version`)
|
|
145
|
-
- `/magpie-plugins list`
|
|
146
|
-
- `/magpie-plugins remove workbuddy`
|
|
32
|
+
## State and credentials
|
|
147
33
|
|
|
148
|
-
|
|
34
|
+
Configuration is created automatically in `~/.local/share/magpie-pi`; manual JSON editing is not needed for menu-managed plugins.
|
|
149
35
|
|
|
150
|
-
|
|
36
|
+
- `MAGPIE_PI_STATE`: override the state directory with an absolute path.
|
|
37
|
+
- `MAGPIE_PI_BUN`: override the Bun executable.
|
|
38
|
+
- `/logout`: disables the provider without deleting plugin credentials; use `/login` to enable it again.
|
|
151
39
|
|
|
152
|
-
|
|
40
|
+
## License
|
|
153
41
|
|
|
154
|
-
|
|
42
|
+
The project's own license is currently `UNLICENSED`. The extracted host retains its upstream MIT license in [vendor/LICENSE](vendor/LICENSE).
|
package/README.zh-CN.md
CHANGED
|
@@ -2,153 +2,41 @@
|
|
|
2
2
|
|
|
3
3
|
[English](README.md) | 简体中文
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
没有 HTTP 监听、完整 gateway、Go→TS 翻译或 Pi core fork。插件负责账号、刷新和请求;Pi 原生 SDK 负责消息、工具和流式事件转换。
|
|
5
|
+
通过轻量 Pi 扩展和本地宿主,将 magpie 的社区插件集成带入 Pi。使用 stdio 对接 Pi 原生 SDK,无需 HTTP 网关或修改 Pi 核心。
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
本项目源自 [yetone/magpie](https://github.com/yetone/magpie),原样抽取其 OpenCode 宿主。感谢原作者和维护者的付出。
|
|
9
8
|
|
|
10
|
-
|
|
11
|
-
从本目录执行:
|
|
9
|
+
## 安装
|
|
12
10
|
|
|
13
|
-
|
|
14
|
-
node scripts/build.mjs
|
|
15
|
-
# 安装本地扩展(由用户主动执行,不会由构建脚本修改全局 Pi 配置)
|
|
16
|
-
pi install /absolute/path/magpie-pi
|
|
17
|
-
# 或仅本次加载
|
|
18
|
-
pi -e /absolute/path/magpie-pi/extension/index.ts
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
开发依赖使用 Pi 安装目录的 node_modules 或安装 package.json 中精确版本的 peerDependencies。本机 node_modules 是指向已有 Pi 安装的开发用链接,不属于发布内容。
|
|
22
|
-
|
|
23
|
-
本地路径安装直接引用项目目录,不会复制源码到 Pi 的插件目录。修改扩展后无需重新安装;修改 Go 代码后先重新执行 `node scripts/build.mjs`。涉及后台宿主或配置的更改请重启 Pi。
|
|
24
|
-
|
|
25
|
-
## 快速使用:菜单安装 → 登录 → 选择模型
|
|
26
|
-
|
|
27
|
-
完成上述构建后,可以持久安装并启动:
|
|
11
|
+
需要 **Pi 1.6.0**、用于运行社区插件的 **Bun**,以及用于插件安装管理的 **Node.js/npm**。
|
|
28
12
|
|
|
29
13
|
```sh
|
|
30
|
-
pi install
|
|
14
|
+
pi install npm:magpie-pi
|
|
31
15
|
pi
|
|
32
16
|
```
|
|
33
17
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
1. 在 Pi 输入 `/magpie-plugins`,打开原生 TUI 菜单。用 **↑/↓** 选择、**Enter** 确认、**Esc** 退出;界面文字使用 English。
|
|
37
|
-
2. 选择 **Search and install**,输入 `cursor` 或 `workbuddy`,从搜索结果中选择包和版本。阅读权限提示并确认后,扩展会下载插件并自动保存配置,无需手动编辑 JSON。
|
|
38
|
-
3. 安装成功后退出并重新启动 Pi。若多个 Pi 实例共享状态目录,先全部退出再启动。
|
|
39
|
-
4. 输入 `/login`,选择对应服务并按照提示完成登录。扩展注册的 provider ID 带 `magpie-` 前缀,菜单中可能显示插件提供的服务名称。
|
|
40
|
-
5. 输入 `/model`,选择该服务提供的模型,然后正常聊天或使用工具。Pi 原有服务仍然可用。
|
|
41
|
-
|
|
42
|
-
其他菜单项:
|
|
43
|
-
|
|
44
|
-
| 菜单项 | 用途 |
|
|
45
|
-
| --- | --- |
|
|
46
|
-
| Installed plugins / details | 查看已配置插件和安装路径 |
|
|
47
|
-
| Uninstall | 选择托管插件并确认卸载;重启后清理旧文件,保留凭据 |
|
|
48
|
-
| Install by package name | 输入别名或完整包名,可附 `@精确版本` |
|
|
49
|
-
| Help | 查看文本子命令 |
|
|
50
|
-
|
|
51
|
-
也可以直接输入 `/magpie-plugins install cursor` 或 `/magpie-plugins install workbuddy`,仍需交互确认。再次安装同一托管插件可替换版本;不是后台自动更新。
|
|
52
|
-
|
|
53
|
-
**当前限制:**真实 Cursor/WorkBuddy 账号尚未验证,搜索或安装成功不代表模型调用兼容。若 `/login` 没有出现服务,先确认已重启并查看启动错误;若 `/model` 没有模型,该插件可能未提供当前支持的协议,见下方“支持范围”。本扩展尚未接入 magpie 的内置 Codex、Claude、Copilot、Gemini 账号实现。
|
|
54
|
-
|
|
55
|
-
## 配置与凭据(手动配置可选)
|
|
56
|
-
|
|
57
|
-
首次加载会自动创建独立状态目录 ~/.local/share/magpie-pi(0700)和空的 config.json(0600)。未配置插件时仅显示配置提示,不启动 Go/Bun,也不影响 Pi 原有服务。已有配置不会被覆盖;无效 JSON 会明确报错。
|
|
58
|
-
|
|
59
|
-
推荐使用菜单管理插件。只有需要使用自行安装的插件时,才手动编辑其中的 config.json,例如:
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"plugins": [
|
|
64
|
-
{
|
|
65
|
-
"spec": "@magpie-community/opencode-cursor-auth",
|
|
66
|
-
"target": "/absolute/plugin-install/node_modules/@magpie-community/opencode-cursor-auth"
|
|
67
|
-
}
|
|
68
|
-
],
|
|
69
|
-
"accounts": {},
|
|
70
|
-
"opencode": {}
|
|
71
|
-
}
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
插件安装在用户选定的独立目录,用 npm install --save-exact 包名@明确版本,并保留 package-lock.json。target 必须指向已安装包或入口文件;本项目不会在启动时自动下载安装第三方代码;可手动配置或通过下方菜单明确确认安装。WorkBuddy 使用 @magpie-community/opencode-workbuddy-auth,同样不是旧 builtin。
|
|
75
|
-
不要为新用户安装已撤回的 Antigravity 插件。
|
|
18
|
+
npm 包包含预编译宿主程序,**无需安装 Go,也无需执行构建命令**。Bun 是运行依赖,仍需安装(本机测试版本为 1.3.14)。
|
|
76
19
|
|
|
77
|
-
|
|
78
|
-
在 Pi /login 选择扩展注册的服务(内部 ID 以 magpie- 开头)。支持 API key、OAuth 自动/粘贴代码登录,以及 host prompt/validate 条件表单;复杂厂商表单尚未实测。
|
|
79
|
-
真实 token 由原 host 写入独立 plugin-auth.json(0600),Pi 中仅保存 plugin-owned 标记。
|
|
80
|
-
多账号默认使用 host 的默认账号;config.accounts 可按插件 provider ID 固定账号 key。
|
|
81
|
-
Pi /logout 清除标记并停用此 provider,不删除插件凭据;再次使用需 /login。resolve 同时要求 Pi 保存的标记与 host 登录状态,不会绕过 Pi logout。尚无插件凭据删除命令。
|
|
82
|
-
|
|
83
|
-
## 支持范围
|
|
84
|
-
|
|
85
|
-
已测试完整 Go → Bun fixture 插件 → Pi 原生 OpenAI Chat SDK:登录、模型发现、文本、工具调用、取消及重启后的凭据持久化。
|
|
86
|
-
仅暴露 @ai-sdk/openai-compatible 的 Chat Completions 模型和 @ai-sdk/anthropic 的 Messages 模型。
|
|
87
|
-
Anthropic 路径使用 Pi 原生实现,但未进行真实服务/fixture 验证。Responses/Gemini 不支持;@ai-sdk/openai 无法可靠区分 Chat 与 Responses,全部隐藏,不会静默按 Chat 处理。
|
|
88
|
-
成本目前以 0 标记,表示未接入价格信息,不代表服务免费。
|
|
89
|
-
Cursor/WorkBuddy 真账号尚未验证,不宣称兼容全部社区插件。
|
|
90
|
-
没有提取 builtin Codex、Claude、Copilot、Gemini 账号逻辑,没有账号轮转、配额路由、gateway 转换、GUI、迁移工具或插件自动更新。普通 API 请直接用 Pi models.json。
|
|
91
|
-
|
|
92
|
-
插件是受信任的本地代码,具有当前用户权限,不是安全沙箱。Windows 文件权限取决于用户目录 ACL;跨平台编译不等于平台运行验证。仅 Linux 实测。
|
|
93
|
-
|
|
94
|
-
## 协议与生命周期
|
|
95
|
-
|
|
96
|
-
桥接协议 v1 使用固定 extraction.json 所锁定的 host JSON-lines 合约:
|
|
97
|
-
请求 {id,method,params};响应 {id,result} / {id,error}。
|
|
98
|
-
fetch 先 head,再 base64 chunk,最后 result;credit 返回消费字节数加每帧 2048 的开销。
|
|
99
|
-
每请求初始窗口 65536,ReadableStream pull 才归还额度;abort 取消同一 id。
|
|
100
|
-
stdio 天然背压,Go 不缓冲完整响应。EOF 关闭 Bun stdin,2 秒后强制结束仍未退出的直接子进程。
|
|
101
|
-
插件自行派生的孙进程不提供进程树隔离。host 崩溃使 pending 请求失败,不自动重试生成。
|
|
102
|
-
没有本机监听端口。Go supervisor 只管理进程与状态权限,协议适配留在薄扩展中。
|
|
103
|
-
|
|
104
|
-
## 测试与更新
|
|
105
|
-
|
|
106
|
-
```sh
|
|
107
|
-
node scripts/extraction.mjs
|
|
108
|
-
node scripts/build.mjs
|
|
109
|
-
node --test tests/*.test.mjs
|
|
110
|
-
bun test tests/provider.test.ts
|
|
111
|
-
go vet ./...
|
|
112
|
-
go test -race ./...
|
|
113
|
-
node scripts/build.mjs --all
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
测试用临时状态目录和本地 fixture,不需要真实 token 或网络。
|
|
117
|
-
Go 当前没有单独单元测试;主要行为由实际编译二进制集成测试覆盖。
|
|
118
|
-
全平台产物在 bin/;部署时保留平台专用文件名,例如 magpie-pi-linux-amd64 和 magpie-pi-windows-arm64.exe,扩展会自动选择对应二进制。保留 vendor/ 和 extension/。本地构建还会生成旧的 magpie-pi / magpie-pi.exe 别名,供集成测试使用。
|
|
119
|
-
|
|
120
|
-
### npm 打包准备
|
|
121
|
-
|
|
122
|
-
发布文件白名单包含 extension/、vendor/、bin/、抽取清单和中英文 README。打包前执行 `node scripts/build.mjs --all`,以包含六个平台的二进制。包用户需要 Bun 和兼容版本的 Pi,无需 Go。目前仅验证了 Linux 运行行为;这些打包调整不代表已经发布 npm 包。
|
|
123
|
-
|
|
124
|
-
项目自身许可证暂标为 `UNLICENSED`,公开发布前应明确分发许可。抽取的 host 继续保留 vendor/LICENSE 中的上游 MIT 许可证。
|
|
125
|
-
|
|
126
|
-
extraction.json 锁定来源 commit、每个文件 SHA-256、空补丁列表。vendor/LICENSE 为上游 MIT 许可证。
|
|
127
|
-
升级时先阅读上游设计,审查差异,然后显式执行:
|
|
128
|
-
|
|
129
|
-
```sh
|
|
130
|
-
node scripts/extraction.mjs extract /absolute/path/magpie
|
|
131
|
-
node scripts/extraction.mjs
|
|
132
|
-
# 重跑上述测试;检查新 extraction.json 后再发布
|
|
133
|
-
```
|
|
20
|
+
## 使用
|
|
134
21
|
|
|
135
|
-
|
|
22
|
+
1. 在 Pi 输入 `/magpie-plugins`。
|
|
23
|
+
2. 选择 **Search and install**,搜索 `cursor` 或 `workbuddy`,选择包和版本后确认安装。
|
|
24
|
+
3. 退出并重新启动 Pi。若多个实例共享状态目录,先全部退出再启动。
|
|
25
|
+
4. 输入 `/login`,选择对应服务并登录。
|
|
26
|
+
5. 输入 `/model`,选择模型后开始使用。
|
|
136
27
|
|
|
137
|
-
|
|
28
|
+
菜单用 ↑/↓ 选择、Enter 确认、Esc 取消,也支持查看已安装插件、按包名安装和卸载。Pi 原有服务不受影响。
|
|
138
29
|
|
|
139
|
-
|
|
30
|
+
第三方插件拥有当前用户权限,请仅安装可信插件。真实 Cursor/WorkBuddy 账号尚未验证。
|
|
140
31
|
|
|
141
|
-
|
|
142
|
-
- `/magpie-plugins help`
|
|
143
|
-
- `/magpie-plugins search cursor`
|
|
144
|
-
- `/magpie-plugins install cursor`(或完整包名及 @精确版本)
|
|
145
|
-
- `/magpie-plugins list`
|
|
146
|
-
- `/magpie-plugins remove workbuddy`
|
|
32
|
+
## 配置与凭据
|
|
147
33
|
|
|
148
|
-
|
|
34
|
+
配置自动保存在 `~/.local/share/magpie-pi`,使用菜单管理插件无需手动编辑 JSON。
|
|
149
35
|
|
|
150
|
-
|
|
36
|
+
- `MAGPIE_PI_STATE`:指定其他状态目录,需使用绝对路径。
|
|
37
|
+
- `MAGPIE_PI_BUN`:指定 Bun 可执行文件。
|
|
38
|
+
- `/logout`:停用服务但不删除插件凭据;再次使用时执行 `/login`。
|
|
151
39
|
|
|
152
|
-
|
|
40
|
+
## 许可证
|
|
153
41
|
|
|
154
|
-
|
|
42
|
+
项目自身暂标为 `UNLICENSED`。抽取的宿主保留 [vendor/LICENSE](vendor/LICENSE) 中的上游 MIT 许可证。
|