@fanchaozz/provider-manager 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 +9 -13
- package/README_EN.md +9 -14
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -14,27 +14,23 @@
|
|
|
14
14
|
pi install npm:@fanchaozz/provider-manager
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
包托管在 **
|
|
17
|
+
包托管在 **npmjs.com**。`pi install` 默认查 npmjs,所以什么都不用配。
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
# ~/.npmrc
|
|
21
|
-
@fanchaozz:registry=https://npm.pkg.github.com/
|
|
22
|
-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
token 只需要 `read:packages` scope(包是 public 的)。之后 `npm install` / `pi install` 对所有 `@fanchaozz/*` 包都不用再配置。
|
|
26
|
-
|
|
27
|
-
### 如果没法访问 GitHub Packages
|
|
19
|
+
### 不可访问 npmjs / 想要开发版
|
|
28
20
|
|
|
29
21
|
```bash
|
|
30
22
|
git clone https://github.com/fanchaozz/provider-manager.git
|
|
31
23
|
ln -s "$(pwd)/provider-manager" ~/.pi/agent/extensions/provider-manager
|
|
32
24
|
# Windows: mklink /D "%USERPROFILE%\.pi\agent\extensions\provider-manager" "%CD%\provider-manager"
|
|
25
|
+
# 或:复制
|
|
26
|
+
cp -r provider-manager ~/.pi/agent/extensions/
|
|
33
27
|
```
|
|
34
28
|
|
|
35
|
-
|
|
29
|
+
或者在 pi 项目里 `pi install /path/to/provider-manager`。
|
|
30
|
+
|
|
31
|
+
依赖:`@earendil-works/pi-coding-agent`(pi 自带)。jiti 向上找 `node_modules`,**不需要**在扩展目录内 `npm install`。
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
安装后,首次加载时会自动创建 `~/.pi/agent/provider-manager.json`(见 [用户配置](#用户配置--provider-managerjson))。删除该文件即可回退到代码默认。
|
|
38
34
|
|
|
39
35
|
---
|
|
40
36
|
|
|
@@ -218,7 +214,7 @@ cp ~/.pi/agent/models.json.bak ~/.pi/agent/models.json
|
|
|
218
214
|
|
|
219
215
|
## 故障排查
|
|
220
216
|
|
|
221
|
-
**`pi install` 报 `E404` 或 "no such package"。**
|
|
217
|
+
**`pi install` 报 `E404` 或 "no such package"。** npm registry 没收到这个包名。先 `npm view @fanchaozz/provider-manager` 看是否发布成功;如果成功还报,检查 `npm config get registry` 输出不是 `npm.pkg.github.com`。
|
|
222
218
|
|
|
223
219
|
**仪表盘打开是空的。** 你的 `models.json` 里没有自定义 provider。本扩展只管 `models.json` — pi 内置 provider(anthropic / openai / google 等)不显示,用 pi 内置的 `/model`。
|
|
224
220
|
|
package/README_EN.md
CHANGED
|
@@ -14,27 +14,22 @@ A pi extension that manages custom providers and models in `~/.pi/agent/models.j
|
|
|
14
14
|
pi install npm:@fanchaozz/provider-manager
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
The package is hosted on **
|
|
17
|
+
The package is hosted on **npmjs.com**. `pi install` queries npmjs by default, so no extra config is required.
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
# ~/.npmrc
|
|
21
|
-
@fanchaozz:registry=https://npm.pkg.github.com/
|
|
22
|
-
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
The token only needs the `read:packages` scope (it's a public package). After that, `npm install` / `pi install` works for all `@fanchaozz/*` packages without further setup.
|
|
26
|
-
|
|
27
|
-
### If you can't reach GitHub Packages
|
|
19
|
+
### If you can't reach npmjs / want a development build
|
|
28
20
|
|
|
29
21
|
```bash
|
|
30
22
|
git clone https://github.com/fanchaozz/provider-manager.git
|
|
31
23
|
ln -s "$(pwd)/provider-manager" ~/.pi/agent/extensions/provider-manager
|
|
32
|
-
#
|
|
24
|
+
# Windows: mklink /D "%USERPROFILE%\.pi\agent\extensions\provider-manager" "%CD%\provider-manager"
|
|
25
|
+
# or: cp -r provider-manager ~/.pi/agent/extensions/
|
|
33
26
|
```
|
|
34
27
|
|
|
35
|
-
|
|
28
|
+
Or from your pi project root: `pi install /path/to/provider-manager`.
|
|
29
|
+
|
|
30
|
+
The extension depends on `@earendil-works/pi-coding-agent` (shipped with pi). jiti walks up `node_modules`, so **no `npm install` is needed** inside the extension directory.
|
|
36
31
|
|
|
37
|
-
After
|
|
32
|
+
After install, `~/.pi/agent/provider-manager.json` is auto-created on first load (see [User config](#user-config--provider-managerjson)). Delete it to fall back to the code default.
|
|
38
33
|
|
|
39
34
|
---
|
|
40
35
|
|
|
@@ -218,7 +213,7 @@ cp ~/.pi/agent/models.json.bak ~/.pi/agent/models.json
|
|
|
218
213
|
|
|
219
214
|
## Troubleshooting
|
|
220
215
|
|
|
221
|
-
**`pi install` fails with `E404` or "no such package".**
|
|
216
|
+
**`pi install` fails with `E404` or "no such package".** The npm registry doesn't have this package. First run `npm view @fanchaozz/provider-manager` to confirm the publish succeeded; if it has, check `npm config get registry` is not `npm.pkg.github.com`.
|
|
222
217
|
|
|
223
218
|
**Dashboard opens but is empty.** Your `models.json` has no custom providers. The extension only manages `models.json` — built-in pi providers (anthropic / openai / google / …) are not shown. Use pi's built-in `/model` for those.
|
|
224
219
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fanchaozz/provider-manager",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "A pi extension that manages custom providers and models in ~/.pi/agent/models.json via a TUI dashboard, /providers slash command, and remote model sync.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.ts",
|
|
@@ -10,12 +10,15 @@
|
|
|
10
10
|
"README_EN.md"
|
|
11
11
|
],
|
|
12
12
|
"keywords": [
|
|
13
|
-
"pi",
|
|
13
|
+
"pi-package",
|
|
14
14
|
"pi-extension",
|
|
15
15
|
"provider",
|
|
16
16
|
"model",
|
|
17
17
|
"ai"
|
|
18
18
|
],
|
|
19
|
+
"pi": {
|
|
20
|
+
"extensions": ["./"]
|
|
21
|
+
},
|
|
19
22
|
"license": "MIT",
|
|
20
23
|
"author": "fanchaozz <fanchaozz@users.noreply.github.com>",
|
|
21
24
|
"homepage": "https://github.com/fanchaozz/provider-manager#readme",
|