@oldsuns/pi-switch 0.2.3 → 0.2.5
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 +10 -10
- package/package.json +1 -1
- package/pi-switch-native.darwin-arm64.node +0 -0
- package/pi-switch-native.darwin-x64.node +0 -0
- package/pi-switch-native.linux-x64-gnu.node +0 -0
- package/pi-switch-native.linux-x64-musl.node +0 -0
- package/pi-switch-native.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ npm install -g @oldsuns/pi-switch
|
|
|
28
28
|
pi-switch
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
首次运行会自动把现有的 `~/.pi/agent/models.json` 全量导入本地库,**不修改** Pi 配置;随后即可在 Profiles
|
|
31
|
+
首次运行会自动把现有的 `~/.pi/agent/models.json` 全量导入本地库,**不修改** Pi 配置;随后即可在 Profiles 中勾选要同步到 Pi 的 provider / model。
|
|
32
32
|
|
|
33
33
|
CLI:
|
|
34
34
|
|
|
@@ -61,8 +61,8 @@ node ./bin/pi-switch.js
|
|
|
61
61
|
| 键 | 作用 |
|
|
62
62
|
|----|------|
|
|
63
63
|
| `n` / `e` / `d` / `c` | 新建 / 编辑 / 删除 / 复制当前焦点(provider 或 model) |
|
|
64
|
-
| `Space`(provider) |
|
|
65
|
-
| `Space`(model) |
|
|
64
|
+
| `Space`(provider) | 同步到 Pi / 取消同步;`[x]` 已同步,`[ ]` 不同步 |
|
|
65
|
+
| `Space`(model) | 设为默认模型(仅已同步到 Pi 的 provider) |
|
|
66
66
|
| `i` | 从当前 provider 在线导入模型 |
|
|
67
67
|
| `/` | 筛选 provider |
|
|
68
68
|
| `Enter` / `l` | 进入模型列表 |
|
|
@@ -71,7 +71,7 @@ node ./bin/pi-switch.js
|
|
|
71
71
|
| `b` | 浏览备份 |
|
|
72
72
|
| `v` | 校验配置(doctor) |
|
|
73
73
|
|
|
74
|
-
新建 provider
|
|
74
|
+
新建 provider 默认同步到 Pi,表单可关闭;复制继承源的同步状态。
|
|
75
75
|
|
|
76
76
|
Provider 表单:`baseUrl`、`api`(`openai-completions` / `openai-responses` / `anthropic-messages` / `google-generative-ai`)、`apiKey`、`authHeader`、Headers(独立 `User-Agent` + 其余 JSON)、`compat`(含一等开关 Session affinity = `sendSessionAffinityHeaders`)。
|
|
77
77
|
|
|
@@ -115,11 +115,11 @@ Session 根目录优先级:`PI_CODING_AGENT_SESSION_DIR` → `PI_CODING_AGENT_
|
|
|
115
115
|
|
|
116
116
|
## Provider 库与 Pi 同步
|
|
117
117
|
|
|
118
|
-
- `~/.pi-switch/providers.json` 是完整本地库;`~/.pi/agent/models.json`
|
|
118
|
+
- `~/.pi-switch/providers.json` 是完整本地库;`~/.pi/agent/models.json` 只含当前已同步到 Pi 的子集。
|
|
119
119
|
- 首次运行把现有 `models.json` 全量导入本地库,不修改 Pi 配置。
|
|
120
|
-
-
|
|
121
|
-
- 在线导入 model
|
|
122
|
-
- 启动或手动重载时,以 `models.json` 中同 ID provider 为准回灌本地库;外部从 Pi 删除的 provider
|
|
120
|
+
- 已同步 provider 的编辑与 model 变更会同步两份文件;不同步项只更新本地库。
|
|
121
|
+
- 在线导入 model **不会**隐式同步到 Pi。
|
|
122
|
+
- 启动或手动重载时,以 `models.json` 中同 ID provider 为准回灌本地库;外部从 Pi 删除的 provider 仍作为不同步项保留。
|
|
123
123
|
- 从 Pi 移除当前默认 provider 会先确认并清除默认模型;`d` 永久删除本地副本,必要时同时从 Pi 删除。
|
|
124
124
|
|
|
125
125
|
## 模型导入与价格
|
|
@@ -137,14 +137,14 @@ Session 根目录优先级:`PI_CODING_AGENT_SESSION_DIR` → `PI_CODING_AGENT_
|
|
|
137
137
|
- 网关价格在 catalog 元数据之上叠加。
|
|
138
138
|
4. 关闭实时元数据:使用 Settings 中的默认参数;空字段回落 Pi 官方默认(context window `128000`、max tokens `16384`、cost `0`)。
|
|
139
139
|
|
|
140
|
-
**OpenCode 导入**(Settings):只读 `~/.config/opencode/opencode.json`,可全选或勾选 provider
|
|
140
|
+
**OpenCode 导入**(Settings):只读 `~/.config/opencode/opencode.json`,可全选或勾选 provider;导入项默认同步到 Pi。若 models.dev 仍有歧义,**需要用户选择候选**。OpenCode 配置本身不会被修改。
|
|
141
141
|
|
|
142
142
|
## 配置路径与 Settings 字段
|
|
143
143
|
|
|
144
144
|
| 路径 | 角色 |
|
|
145
145
|
|------|------|
|
|
146
146
|
| `~/.pi-switch/providers.json` | 完整本地 provider 库(`version: 1`) |
|
|
147
|
-
| `~/.pi/agent/models.json` |
|
|
147
|
+
| `~/.pi/agent/models.json` | 已同步到 Pi 的 provider 子集 |
|
|
148
148
|
| `~/.pi/agent/settings.json` | 默认模型 + pi-switch 设置 |
|
|
149
149
|
| `~/.config/opencode/opencode.json` | OpenCode 只读导入源 |
|
|
150
150
|
| `~/.pi-switch/backups/` | version 2 备份(providers + models + settings),最多 10 份 |
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|