pi-provimux 105.0.1 → 105.0.3
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/CHANGELOG.md +32 -0
- package/README.md +39 -23
- package/extensions/index.ts +35 -17
- package/extensions/lib.ts +14 -2
- package/extensions/upstreams.ts +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 105.0.3
|
|
4
|
+
|
|
5
|
+
The command and the login now say Provimux. The old names keep working.
|
|
6
|
+
|
|
7
|
+
- **`/provimux-refresh`** reloads the model list. `/cliproxyapi-refresh`, its name in the original extension, stays
|
|
8
|
+
as an alias, and its description says it is the old name of `/provimux-refresh`.
|
|
9
|
+
- **The login is shown as Provimux** in `/login`'s list, its prompts and the extension's messages (was
|
|
10
|
+
CLIProxyAPI). `/login Provimux` and `/login cliproxyapi` work; so does `/login CLIProxyAPI`, which pi matches,
|
|
11
|
+
ignoring case, to the provider id. A `cliproxyapi.json` written by an earlier `/login` holds
|
|
12
|
+
`"providerName": "CLIProxyAPI"`: that value now reads as the default, Provimux. Another name in the file, or any
|
|
13
|
+
name in `CLIPROXYAPI_PROVIDER_NAME`, is kept.
|
|
14
|
+
- **Unchanged:** the provider id `cliproxyapi` (`cliproxyapi/<model>` in settings and sessions), the
|
|
15
|
+
`CLIPROXYAPI_*` environment variables, `cliproxyapi.json`, `cliproxyapi-models.json`, and the internal API name
|
|
16
|
+
`cliproxyapi-codex-responses`.
|
|
17
|
+
|
|
18
|
+
## 105.0.2
|
|
19
|
+
|
|
20
|
+
The extension is the same as in 105.0.1; what changes is how pi-provimux is released.
|
|
21
|
+
|
|
22
|
+
- **Published from GitHub, with provenance.** npm versions are published by the repository's `publish.yml` through
|
|
23
|
+
npm trusted publishing: no token, and each version on npm names the workflow run and the commit it was built
|
|
24
|
+
from. A version is published when `main` names one that npm does not have; its tag `v<version>` and GitHub release
|
|
25
|
+
are made by the same run.
|
|
26
|
+
- **Following the original.** A workflow takes each new release of
|
|
27
|
+
[pi-cliproxyapi-provider](https://github.com/router-for-me/pi-cliproxyapi-provider) once it has been public for
|
|
28
|
+
24 hours. When it merges cleanly, passes a guard and passes every check, it is merged into `main` and released as
|
|
29
|
+
the next version (`105.1.1` for the original's 1.5.1). Anything else lands nothing and is reported in an issue.
|
|
30
|
+
Until it is switched on, it runs as a dry run: everything is checked, and it only says what it would land.
|
|
31
|
+
How it works, and what it accepts: [docs/FOLLOWING.md](docs/FOLLOWING.md).
|
|
32
|
+
- **Checked on pi 1.3.0 and pi 1.6.0** before anything lands and before anything is published, with the packed
|
|
33
|
+
package loaded by pi's own loader on both. The archive published to npm is that tested archive, byte for byte.
|
|
34
|
+
|
|
3
35
|
## 105.0.1 - 2026-11-22
|
|
4
36
|
|
|
5
37
|
The extension is now **pi-provimux**, Provimux's pi extension, a fork of
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ pi install npm:pi-provimux
|
|
|
14
14
|
Then, in pi:
|
|
15
15
|
|
|
16
16
|
```text
|
|
17
|
-
/login
|
|
17
|
+
/login Provimux
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
and enter the server's address (for example `http://127.0.0.1:8317`) and your client key.
|
|
@@ -28,8 +28,8 @@ From the original extension:
|
|
|
28
28
|
|
|
29
29
|
- **Your models in pi.** It reads the model list from `{root}/v1/models?client_version=pi` and registers each model
|
|
30
30
|
with its context window, reasoning levels and, when [models.dev](https://models.dev) knows it, its price.
|
|
31
|
-
- **Setup by `/login`.** `/login
|
|
32
|
-
- **A model cache**, so pi starts at once when the server is slow; `/
|
|
31
|
+
- **Setup by `/login`.** `/login Provimux` asks for the address and the key, checks them, and saves them.
|
|
32
|
+
- **A model cache**, so pi starts at once when the server is slow; `/provimux-refresh` reloads the list.
|
|
33
33
|
- **`/fast` and `/ultrafast`**: faster service tiers on the models that offer them.
|
|
34
34
|
- **`/pause` and `/continue`**: hold every request to the provider until you continue.
|
|
35
35
|
- **GPT prompt caching kept**: the base prompt of `gpt-` models is sent so the prompt cache keeps being read (pi
|
|
@@ -66,7 +66,13 @@ pi -e /absolute/path/to/pi-provimux
|
|
|
66
66
|
```
|
|
67
67
|
|
|
68
68
|
The version names the original release it is built on, then a count of its own: 105.0.1 is pi-provimux's first
|
|
69
|
-
release on the original's 1.5.0 (major × 100 + minor, then patch).
|
|
69
|
+
release on the original's 1.5.0 (major × 100 + minor, then patch), 105.0.2 its second, and 105.1.1 would be the first
|
|
70
|
+
on the original's 1.5.1.
|
|
71
|
+
|
|
72
|
+
Versions on npm are published from this repository's `main` by GitHub Actions, with npm provenance. A workflow
|
|
73
|
+
follows the original's releases: once a day old, one that merges cleanly and passes every check is merged into `main`
|
|
74
|
+
and released, with no person in between: this is switched on. [docs/FOLLOWING.md](docs/FOLLOWING.md) says how, and
|
|
75
|
+
what that accepts.
|
|
70
76
|
|
|
71
77
|
It needs pi 0.99.0 or newer: the Codex WebSocket reports which kind of account answered through pi's
|
|
72
78
|
`provider_stream_event`, which older pi does not have.
|
|
@@ -74,9 +80,19 @@ It needs pi 0.99.0 or newer: the Codex WebSocket reports which kind of account a
|
|
|
74
80
|
### Coming from pi-cliproxyapi-provider
|
|
75
81
|
|
|
76
82
|
pi-provimux keeps everything your setup names: the provider id `cliproxyapi` (so `cliproxyapi/<model>` in your
|
|
77
|
-
settings still works),
|
|
78
|
-
`cliproxyapi
|
|
79
|
-
|
|
83
|
+
settings still works), the `CLIPROXYAPI_*` environment variables, and the files `cliproxyapi.json` and
|
|
84
|
+
`cliproxyapi-models.json`. Two names changed, and the old ones still work:
|
|
85
|
+
|
|
86
|
+
| Was | Now | The old one |
|
|
87
|
+
| --- | --- | --- |
|
|
88
|
+
| `/cliproxyapi-refresh` | `/provimux-refresh` | Kept as an alias of `/provimux-refresh`. |
|
|
89
|
+
| The login shown as **CLIProxyAPI** | **Provimux** | `/login CLIProxyAPI` still works: pi matches it, ignoring case, to the id `cliproxyapi`. |
|
|
90
|
+
|
|
91
|
+
A `cliproxyapi.json` written by an earlier `/login` holds `"providerName": "CLIProxyAPI"`; it is read as the
|
|
92
|
+
default, so the login shows as Provimux there too. A name you set yourself, or through `CLIPROXYAPI_PROVIDER_NAME`,
|
|
93
|
+
is kept.
|
|
94
|
+
|
|
95
|
+
Remove the old package first, so that only one of them registers the provider:
|
|
80
96
|
|
|
81
97
|
```bash
|
|
82
98
|
pi remove npm:@router-for-me/pi-cliproxyapi-provider # or the source you installed it from
|
|
@@ -85,21 +101,21 @@ pi install npm:pi-provimux
|
|
|
85
101
|
|
|
86
102
|
## Login-style setup (recommended)
|
|
87
103
|
|
|
88
|
-
This plugin needs both **baseUrl** and **apiKey**. pi's built-in `/login` only supports multi-field prompts on the account/OAuth path, so
|
|
104
|
+
This plugin needs both **baseUrl** and **apiKey**. pi's built-in `/login` only supports multi-field prompts on the account/OAuth path, so Provimux appears under **Sign in with an account** (not API key).
|
|
89
105
|
|
|
90
106
|
### Preferred: /login shortcuts
|
|
91
107
|
|
|
92
108
|
```text
|
|
93
|
-
/login
|
|
109
|
+
/login Provimux
|
|
94
110
|
```
|
|
95
111
|
|
|
96
|
-
or:
|
|
112
|
+
or, by the provider id:
|
|
97
113
|
|
|
98
114
|
```text
|
|
99
115
|
/login cliproxyapi
|
|
100
116
|
```
|
|
101
117
|
|
|
102
|
-
These shortcuts jump straight into
|
|
118
|
+
(`/login CLIProxyAPI` is the same id, as pi ignores case.) These shortcuts jump straight into the multi-field baseUrl + API key prompts. The provider is registered as OAuth-only, so pi does not ask you to choose between API key and account first.
|
|
103
119
|
|
|
104
120
|
### Menu path
|
|
105
121
|
|
|
@@ -111,7 +127,7 @@ Then choose:
|
|
|
111
127
|
|
|
112
128
|
1. **Sign in with an account**
|
|
113
129
|
(required for multi-field baseUrl + API key prompts)
|
|
114
|
-
2. **
|
|
130
|
+
2. **Provimux**
|
|
115
131
|
3. Enter:
|
|
116
132
|
- base URL — preferred form is host:port, e.g. `http://127.0.0.1:8317`
|
|
117
133
|
- API key
|
|
@@ -127,7 +143,7 @@ On success:
|
|
|
127
143
|
- `baseUrl` / `apiKey` are written to `~/.pi/agent/cliproxyapi.json`
|
|
128
144
|
- pi also stores the returned credential in `~/.pi/agent/auth.json`
|
|
129
145
|
|
|
130
|
-
Re-run `/login
|
|
146
|
+
Re-run `/login Provimux` or `/login cliproxyapi` anytime to reconfigure. The built-in `/logout` command only removes credentials saved in `auth.json`; it does not erase `cliproxyapi.json`. Remove or update that file if you also need to clear the provider configuration.
|
|
131
147
|
|
|
132
148
|
## Non-interactive configuration
|
|
133
149
|
|
|
@@ -150,10 +166,10 @@ Optional fields:
|
|
|
150
166
|
|
|
151
167
|
| Field | Default | Description |
|
|
152
168
|
| ------- | --------- | ------------- |
|
|
153
|
-
| `baseUrl` | `http://127.0.0.1:8317` | CLIProxyAPI address |
|
|
169
|
+
| `baseUrl` | `http://127.0.0.1:8317` | Provimux or CLIProxyAPI address |
|
|
154
170
|
| `apiKey` | _(required unless set via /login or env)_ | Bearer token / CPA API key |
|
|
155
171
|
| `providerId` | `cliproxyapi` | Provider id shown in `/model` |
|
|
156
|
-
| `providerName` | `
|
|
172
|
+
| `providerName` | `Provimux` | Display name in `/login` and UI (`CLIProxyAPI`, the default before 105.0.3, written here by `/login`, reads as the default) |
|
|
157
173
|
| `fast` | `false` | Persisted speed preference: `false` (off), `true` (Fast), or `"ultrafast"` (Ultra Fast) |
|
|
158
174
|
| `pause` | `false` | Persisted request-pause preference; provider requests wait until it is cleared |
|
|
159
175
|
| `tps` | `true` | Show the elapsed time footer and TPS summary in the TUI; see [Elapsed time and TPS](#elapsed-time-and-tps-tui) |
|
|
@@ -244,12 +260,12 @@ When the provider loads (including session resume):
|
|
|
244
260
|
1. If a cache exists for the configured `baseUrl`, its models are registered immediately. A remote query to `{root}/v1/models?client_version=pi` then runs in the background; on success, the cache is rewritten and the registered model list is refreshed. If the query fails, the existing cache remains active.
|
|
245
261
|
2. If no matching cache exists, the remote query runs synchronously. On success, the cache is written and the fetched models are registered. If it fails, startup logs a warning and no models are registered until the proxy responds.
|
|
246
262
|
|
|
247
|
-
Use `/
|
|
263
|
+
Use `/provimux-refresh` to force an immediate remote refresh of the model catalog.
|
|
248
264
|
|
|
249
265
|
### Refresh commands
|
|
250
266
|
|
|
251
|
-
- `/cliproxyapi-refresh` — force an immediate remote refresh of the model catalog, rewrite the cache, and update registered models. Use this after adding or removing models on the proxy without restarting pi.
|
|
252
|
-
- `/login
|
|
267
|
+
- `/provimux-refresh` (or its old name `/cliproxyapi-refresh`) — force an immediate remote refresh of the model catalog, rewrite the cache, and update registered models. Use this after adding or removing models on the proxy without restarting pi.
|
|
268
|
+
- `/login Provimux` / `/login cliproxyapi` — re-entering credentials always forces a fresh models query and rewrites the cache.
|
|
253
269
|
|
|
254
270
|
Delete `~/.pi/agent/cliproxyapi-models.json` to clear the cache manually.
|
|
255
271
|
|
|
@@ -330,7 +346,7 @@ anthropic/claude-opus-5.5 · OpenRouter api
|
|
|
330
346
|
- Everything is read from CLIProxyAPI's list; nothing is guessed from a model's id or owner. A CLIProxyAPI that does
|
|
331
347
|
not list its credentials, or a list that can't be read, leaves every name as it was.
|
|
332
348
|
- It says what the list said when it was fetched: after changing credentials or priorities in CLIProxyAPI, run
|
|
333
|
-
`/
|
|
349
|
+
`/provimux-refresh` (the startup refresh also updates it). What answered a given request is a separate matter:
|
|
334
350
|
see the next section.
|
|
335
351
|
|
|
336
352
|
pi shows a model's name in `/model` beside its id and searches it, and its model patterns (`--model`, scoped models)
|
|
@@ -352,7 +368,7 @@ from providers.dev.
|
|
|
352
368
|
The answer belongs to the session that asked: when it ends (quit, `/reload`, another session) before the list
|
|
353
369
|
arrives, the lookup is aborted and nothing is said.
|
|
354
370
|
- **`model-upstreams`**: `{ provider, models: { [modelId]: { upstreams, fallbacks? } } }`, the answer, and again after
|
|
355
|
-
`/
|
|
371
|
+
`/provimux-refresh`. `upstreams` are what may serve the model (several: it is not known which), `fallbacks` what
|
|
356
372
|
may answer when those fail or cool down.
|
|
357
373
|
- **`model-upstreams:answered`** (Provimux): `{ provider, model, upstreams }`, what answered a request, at most once
|
|
358
374
|
per answer. `model` is the model the request was sent to (a virtual model's routed model, not the selection).
|
|
@@ -420,7 +436,7 @@ How the routes are made:
|
|
|
420
436
|
|
|
421
437
|
If you previously maintained a static provider such as `cpa-responses` in `~/.pi/agent/models.json`:
|
|
422
438
|
|
|
423
|
-
1. Install this package and run `/login
|
|
439
|
+
1. Install this package and run `/login Provimux` or `/login cliproxyapi` (or set `cliproxyapi.json`).
|
|
424
440
|
2. Point `defaultProvider` / `enabledModels` at `cliproxyapi/<model-id>` (or set `providerId` to `cpa-responses` for a drop-in id).
|
|
425
441
|
3. Remove the hand-maintained models array once the dynamic list looks correct.
|
|
426
442
|
|
|
@@ -440,11 +456,11 @@ Set `"tps": false` in `~/.pi/agent/cliproxyapi.json` to turn off just this helpe
|
|
|
440
456
|
- Before setup / without credentials: provider still appears in `/login`; no models are listed yet.
|
|
441
457
|
- After successful `/login`: models are registered; credentials are stored in `auth.json` and mirrored to `cliproxyapi.json`.
|
|
442
458
|
- The built-in `/logout` command removes only the matching `auth.json` credential; environment variables and `cliproxyapi.json` are unchanged.
|
|
443
|
-
- If a models request returns **HTTP 401** or CPA is unreachable during startup, an existing matching cache remains in use while the background refresh fails. Only when no cache is available is a warning logged; reconfigure via `/login
|
|
459
|
+
- If a models request returns **HTTP 401** or CPA is unreachable during startup, an existing matching cache remains in use while the background refresh fails. Only when no cache is available is a warning logged; reconfigure via `/login Provimux` or fix config/env.
|
|
444
460
|
- Login final step validates credentials by requesting models:
|
|
445
461
|
- HTTP 200 (including empty catalog) → credentials are persisted
|
|
446
462
|
- non-200 / network / invalid baseUrl → nothing is persisted; re-enter baseUrl + API key
|
|
447
|
-
- If CPA returns HTTP 200 with zero usable models: login still succeeds; re-run `/login
|
|
463
|
+
- If CPA returns HTTP 200 with zero usable models: login still succeeds; re-run `/login Provimux` later after models become available.
|
|
448
464
|
- If the selected model does not provide a non-empty `service_tiers` array: the request is left unchanged; `/fast` and `/ultrafast` still update the global preference and warn when enabling a mode.
|
|
449
465
|
- After `/compact`, threshold compaction, or overflow recovery, the provider closes the reused Codex WebSocket for the current session. CLIProxyAPI binds server-side context to the connection, so a reused socket would keep reporting a near-full `cacheRead` and retrigger proactive compaction even though the client context is now small. SSE is unaffected because it bills from the request body.
|
|
450
466
|
|
package/extensions/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Provimux dynamic model provider for pi (works with a Provimux or a plain CLIProxyAPI server).
|
|
3
3
|
*
|
|
4
4
|
* Supports login-style setup via `/login`:
|
|
5
|
-
* 1. Provider is registered as OAuth-only so `/login
|
|
5
|
+
* 1. Provider is registered as OAuth-only so `/login Provimux` / `/login cliproxyapi`
|
|
6
6
|
* skip the API-key vs account selector and go straight to multi-field prompts
|
|
7
|
-
* (pi only supports multi-field prompts on the account/OAuth path).
|
|
8
|
-
*
|
|
7
|
+
* (pi only supports multi-field prompts on the account/OAuth path). pi matches the
|
|
8
|
+
* reference against the id and the display name ignoring case, so `/login CLIProxyAPI`
|
|
9
|
+
* still matches, by the id.
|
|
10
|
+
* 2. Preferred shortcuts: `/login Provimux` or `/login cliproxyapi`.
|
|
9
11
|
* 3. Setup prompts for baseUrl + apiKey.
|
|
10
12
|
* 4. Final login step validates credentials via /v1/models?client_version=pi
|
|
11
13
|
* (HTTP 200 = success even if the catalog is empty; otherwise re-prompt).
|
|
@@ -276,12 +278,14 @@ function resolveDefaultBaseUrl(agentDir: string, providerId: string): string {
|
|
|
276
278
|
|
|
277
279
|
async function promptConnection(
|
|
278
280
|
callbacks: OAuthLoginCallbacks,
|
|
279
|
-
defaults: { baseUrl: string },
|
|
281
|
+
defaults: { baseUrl: string; providerName: string },
|
|
280
282
|
): Promise<{ baseUrlInput: string; apiKey: string }> {
|
|
281
|
-
callbacks.onProgress?.(
|
|
283
|
+
callbacks.onProgress?.(
|
|
284
|
+
`Configure ${defaults.providerName} (a Provimux or CLIProxyAPI server). Preferred baseUrl form: host:port (e.g. http://127.0.0.1:8317).`,
|
|
285
|
+
);
|
|
282
286
|
|
|
283
287
|
const baseUrlRaw = await callbacks.onPrompt({
|
|
284
|
-
message:
|
|
288
|
+
message: `${defaults.providerName} base URL [${defaults.baseUrl}]:`,
|
|
285
289
|
placeholder: defaults.baseUrl,
|
|
286
290
|
allowEmpty: true,
|
|
287
291
|
});
|
|
@@ -292,7 +296,7 @@ async function promptConnection(
|
|
|
292
296
|
|
|
293
297
|
const apiKey = (
|
|
294
298
|
await callbacks.onPrompt({
|
|
295
|
-
message:
|
|
299
|
+
message: `${defaults.providerName} API key:`,
|
|
296
300
|
placeholder: "sk-...",
|
|
297
301
|
allowEmpty: false,
|
|
298
302
|
})
|
|
@@ -415,6 +419,7 @@ function createOAuthHandlers(options: {
|
|
|
415
419
|
while (true) {
|
|
416
420
|
const { baseUrlInput, apiKey } = await promptConnection(callbacks, {
|
|
417
421
|
baseUrl: promptDefaultBaseUrl,
|
|
422
|
+
providerName,
|
|
418
423
|
});
|
|
419
424
|
|
|
420
425
|
callbacks.onProgress?.("Validating credentials via models endpoint...");
|
|
@@ -611,7 +616,7 @@ export function registerFastCommands(options: {
|
|
|
611
616
|
let modeChangeInProgress = false;
|
|
612
617
|
|
|
613
618
|
const createCommand = (name: string, label: string, selected: Exclude<FastPreference, false>) => ({
|
|
614
|
-
description: `Toggle
|
|
619
|
+
description: `Toggle Provimux ${label} mode globally.`,
|
|
615
620
|
handler: async (args: string, ctx: ExtensionContext) => {
|
|
616
621
|
if (args.trim()) {
|
|
617
622
|
ctx.ui.notify(`Usage: /${name}`, "error");
|
|
@@ -684,6 +689,10 @@ export function registerFastCommands(options: {
|
|
|
684
689
|
pi.registerCommand("ultrafast", createCommand("ultrafast", "Ultra Fast", "ultrafast"));
|
|
685
690
|
}
|
|
686
691
|
|
|
692
|
+
/** The refresh command, and the original extension's name for it, kept as an alias. */
|
|
693
|
+
export const REFRESH_COMMAND = "provimux-refresh";
|
|
694
|
+
export const LEGACY_REFRESH_COMMAND = "cliproxyapi-refresh";
|
|
695
|
+
|
|
687
696
|
export function registerRefreshCommand(options: {
|
|
688
697
|
pi: ExtensionAPI;
|
|
689
698
|
agentDir: string;
|
|
@@ -707,18 +716,18 @@ export function registerRefreshCommand(options: {
|
|
|
707
716
|
onRefresh,
|
|
708
717
|
} = options;
|
|
709
718
|
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
719
|
+
const refreshHandler =
|
|
720
|
+
(name: string) =>
|
|
721
|
+
async (args: string, ctx: ExtensionContext): Promise<void> => {
|
|
713
722
|
if (args.trim()) {
|
|
714
|
-
ctx.ui.notify(
|
|
723
|
+
ctx.ui.notify(`Usage: /${name}`, "error");
|
|
715
724
|
return;
|
|
716
725
|
}
|
|
717
726
|
|
|
718
727
|
const connection = resolveConnection(agentDir, providerId);
|
|
719
728
|
if (!connection) {
|
|
720
729
|
ctx.ui.notify(
|
|
721
|
-
|
|
730
|
+
`${providerName} is not configured. Use /login ${providerName} or /login ${providerId}.`,
|
|
722
731
|
"error",
|
|
723
732
|
);
|
|
724
733
|
return;
|
|
@@ -766,14 +775,23 @@ export function registerRefreshCommand(options: {
|
|
|
766
775
|
const staleSuffix =
|
|
767
776
|
result.staleCount && result.staleCount > 0 ? ` (${result.staleCount} retained from cache)` : "";
|
|
768
777
|
ctx.ui.notify(
|
|
769
|
-
`Refreshed ${result.modelCount}
|
|
778
|
+
`Refreshed ${result.modelCount} ${providerName} models${staleSuffix} from ${result.modelsUrl}.`,
|
|
770
779
|
"info",
|
|
771
780
|
);
|
|
772
781
|
} catch (error) {
|
|
773
782
|
const message = error instanceof Error ? error.message : String(error);
|
|
774
|
-
ctx.ui.notify(`Failed to refresh
|
|
783
|
+
ctx.ui.notify(`Failed to refresh ${providerName} models: ${message}`, "error");
|
|
775
784
|
}
|
|
776
|
-
}
|
|
785
|
+
};
|
|
786
|
+
|
|
787
|
+
pi.registerCommand(REFRESH_COMMAND, {
|
|
788
|
+
description: "Force refresh Provimux models from the remote catalog.",
|
|
789
|
+
handler: refreshHandler(REFRESH_COMMAND),
|
|
790
|
+
});
|
|
791
|
+
// The original extension's name for it, kept for people coming from pi-cliproxyapi-provider.
|
|
792
|
+
pi.registerCommand(LEGACY_REFRESH_COMMAND, {
|
|
793
|
+
description: `Old name of /${REFRESH_COMMAND}: force refresh Provimux models from the remote catalog.`,
|
|
794
|
+
handler: refreshHandler(LEGACY_REFRESH_COMMAND),
|
|
777
795
|
});
|
|
778
796
|
}
|
|
779
797
|
|
package/extensions/lib.ts
CHANGED
|
@@ -25,7 +25,13 @@ export interface PiProviderModelCompat {
|
|
|
25
25
|
export const ANTHROPIC_MESSAGES_API = "anthropic-messages";
|
|
26
26
|
|
|
27
27
|
export const DEFAULT_PROVIDER_ID = "cliproxyapi";
|
|
28
|
-
export const DEFAULT_PROVIDER_NAME = "
|
|
28
|
+
export const DEFAULT_PROVIDER_NAME = "Provimux";
|
|
29
|
+
/**
|
|
30
|
+
* The display name before 105.0.3. `/login` writes the name into `cliproxyapi.json`, so a setup made then holds it
|
|
31
|
+
* without anyone having chosen it: read from the file, it means the default. Set by `CLIPROXYAPI_PROVIDER_NAME`, it
|
|
32
|
+
* is a choice and is kept.
|
|
33
|
+
*/
|
|
34
|
+
export const LEGACY_DEFAULT_PROVIDER_NAME = "CLIProxyAPI";
|
|
29
35
|
export const DEFAULT_BASE_URL = "http://127.0.0.1:8317";
|
|
30
36
|
export const CONFIG_FILE_NAME = "cliproxyapi.json";
|
|
31
37
|
export const MODELS_CACHE_FILE_NAME = "cliproxyapi-models.json";
|
|
@@ -413,7 +419,13 @@ export function resolveIdentity(agentDir: string): ResolvedIdentity {
|
|
|
413
419
|
|
|
414
420
|
return {
|
|
415
421
|
providerId: firstNonEmpty(process.env.CLIPROXYAPI_PROVIDER_ID, file.providerId, DEFAULT_PROVIDER_ID)!,
|
|
416
|
-
providerName: firstNonEmpty(
|
|
422
|
+
providerName: firstNonEmpty(
|
|
423
|
+
process.env.CLIPROXYAPI_PROVIDER_NAME,
|
|
424
|
+
typeof file.providerName === "string" && file.providerName.trim() === LEGACY_DEFAULT_PROVIDER_NAME
|
|
425
|
+
? undefined
|
|
426
|
+
: file.providerName,
|
|
427
|
+
DEFAULT_PROVIDER_NAME,
|
|
428
|
+
)!,
|
|
417
429
|
};
|
|
418
430
|
}
|
|
419
431
|
|
package/extensions/upstreams.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* - `model-upstreams:request` (sent by an extension that wants them): CLIProxyAPI is asked, and the answer follows.
|
|
14
14
|
* - `model-upstreams`: `{ provider, models: { [id]: { upstreams, fallbacks? } } }`, after a request and, once one came,
|
|
15
|
-
* after `/
|
|
15
|
+
* after `/provimux-refresh`. `upstreams` are what may serve the model (several: not known which), `fallbacks` what may
|
|
16
16
|
* answer when those fail.
|
|
17
17
|
* - `model-upstreams:answered`: `{ provider, model, upstreams }`, once per answer, while the request is out. Over HTTP
|
|
18
18
|
* and SSE only the response headers (`X-CPA-AUTH-*`) count; over the Codex WebSocket, which has no headers per turn,
|