@mcowger/pi-plexus 1.14.0 → 1.14.2

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 CHANGED
@@ -4,10 +4,10 @@ Exposes models from a self-hosted [Plexus](https://github.com/mcowger/plexus) AI
4
4
 
5
5
  ## Supported agents
6
6
 
7
- | Package | Agent | npm |
8
- |---|---|---|
9
- | `plexus-pi` | [pi](https://github.com/earendil-works/pi) | `@mcowger/pi-plexus` |
10
- | `plexus-oh-my-pi` | [Oh My Pi](https://github.com/can1357/oh-my-pi) | `@mcowger/oh-my-pi-plexus` |
7
+ | Package | Agent | npm |
8
+ | -------------------- | ---------------------------------------------------- | -------------------------- |
9
+ | `plexus-pi` | [pi](https://github.com/earendil-works/pi) | `@mcowger/pi-plexus` |
10
+ | `plexus-oh-my-pi` | [Oh My Pi](https://github.com/can1357/oh-my-pi) | `@mcowger/oh-my-pi-plexus` |
11
11
  | `plexus-opencode-v2` | [OpenCode](https://github.com/anomalyco/opencode) V2 | `@mcowger/opencode-plexus` |
12
12
 
13
13
  ## Prerequisites
@@ -47,9 +47,7 @@ Then register the path in `~/.pi/agent/settings.json`:
47
47
 
48
48
  ```json
49
49
  {
50
- "extensions": [
51
- "~/code/plexus-agent-plugins/packages/plexus-pi"
52
- ]
50
+ "extensions": ["~/code/plexus-agent-plugins/packages/plexus-pi"]
53
51
  }
54
52
  ```
55
53
 
@@ -82,9 +80,7 @@ Then register the path in `~/.omp/agent/settings.json`:
82
80
 
83
81
  ```json
84
82
  {
85
- "extensions": [
86
- "~/code/plexus-agent-plugins/packages/plexus-oh-my-pi"
87
- ]
83
+ "extensions": ["~/code/plexus-agent-plugins/packages/plexus-oh-my-pi"]
88
84
  }
89
85
  ```
90
86
 
@@ -94,8 +90,8 @@ Add the plugin to `~/.config/opencode/opencode.jsonc`, either from npm or from a
94
90
 
95
91
  ```jsonc
96
92
  {
97
- "plugins": ["@mcowger/opencode-plexus"]
98
- // or: ["file:///home/you/code/plexus-agent-plugins/packages/plexus-opencode-v2"]
93
+ "plugins": ["@mcowger/opencode-plexus"],
94
+ // or: ["file:///home/you/code/plexus-agent-plugins/packages/plexus-opencode-v2"]
99
95
  }
100
96
  ```
101
97
 
@@ -177,16 +173,16 @@ Pi and OMP store only non-secret Plexus settings in their own `config.json`:
177
173
 
178
174
  Credentials stay in the host credential store (`auth.json` for Pi, `agent.db` for OMP). Model catalogs stay in the host model registry/store. The extension no longer writes a second model cache, ETag file, raw API response, or default-model preference.
179
175
 
180
- With `apiKeyEnv` omitted, Pi resolves configuration as follows:
176
+ With `apiKeyEnv` omitted, Pi and OMP resolve configuration as follows:
181
177
 
182
178
  ```text
183
179
  base URL: PLEXUS_API_URL → PLEXUS_BASE_URL → saved Plexus base URL
184
- API key: host credential store → PLEXUS_API_KEY process fallback
180
+ API key: PLEXUS_API_KEY → host credential store
185
181
  catalog: host model store → live Plexus refresh
186
182
  startup model: host model-picker preference
187
183
  ```
188
184
 
189
- OMP uses the same URL precedence, but its registered `PLEXUS_API_KEY` environment reference is a native config-key override, ahead of saved credentials. If that variable isn't set, OMP uses its host credential resolver. OpenCode uses `PLEXUS_API_KEY` before the saved `/connect` credential and plugin `apiKey` option.
185
+ Pi and OMP share credential selection in `plexus-models`: environment keys override saved credentials for discovery and every inference API, including Messages, Responses, and Chat Completions. OpenCode uses `PLEXUS_API_KEY` before the saved `/connect` credential and plugin `apiKey` option.
190
186
 
191
187
  `PLEXUS_API_URL` and `PLEXUS_BASE_URL` are process-only URL overrides; environment API keys aren't persisted. `/plexus status` reports the effective URL source, whether auth is available, and catalog state without exposing credentials.
192
188
 
@@ -200,8 +196,8 @@ For Pi, edit `~/.pi/agent/extensions/plexus/config.json` (or `<agent-dir>/extens
200
196
 
201
197
  ```json
202
198
  {
203
- "baseUrl": "https://plexus.example.com",
204
- "apiKeyEnv": "AIHOME_PI_API_KEY"
199
+ "baseUrl": "https://plexus.example.com",
200
+ "apiKeyEnv": "AIHOME_PI_API_KEY"
205
201
  }
206
202
  ```
207
203
 
@@ -209,8 +205,8 @@ For OMP, edit `~/.omp/agent/extensions/plexus/config.json` (under the active pro
209
205
 
210
206
  ```json
211
207
  {
212
- "baseUrl": "https://plexus.example.com",
213
- "apiKeyEnv": "AIHOME_OMP_API_KEY"
208
+ "baseUrl": "https://plexus.example.com",
209
+ "apiKeyEnv": "AIHOME_OMP_API_KEY"
214
210
  }
215
211
  ```
216
212
 
@@ -218,15 +214,15 @@ For OpenCode V2, put `apiKeyEnv` in the plugin's `options` in `~/.config/opencod
218
214
 
219
215
  ```jsonc
220
216
  {
221
- "plugins": [
222
- {
223
- "package": "@mcowger/opencode-plexus",
224
- "options": {
225
- "plexusBaseURL": "https://plexus.example.com",
226
- "apiKeyEnv": "AIHOME_OPENCODE_API_KEY"
227
- }
228
- }
229
- ]
217
+ "plugins": [
218
+ {
219
+ "package": "@mcowger/opencode-plexus",
220
+ "options": {
221
+ "plexusBaseURL": "https://plexus.example.com",
222
+ "apiKeyEnv": "AIHOME_OPENCODE_API_KEY",
223
+ },
224
+ },
225
+ ],
230
226
  }
231
227
  ```
232
228
 
@@ -234,22 +230,23 @@ Set the named variable in the process environment that launches the client. Rest
234
230
 
235
231
  Credential precedence:
236
232
 
237
- | Client | `apiKeyEnv` omitted | `apiKeyEnv` explicitly set |
238
- |---|---|---|
239
- | Pi | Saved host credential, then `PLEXUS_API_KEY` fallback | Only the named environment variable, ahead of saved credentials |
240
- | OMP | Registered `PLEXUS_API_KEY` env override, then host credentials | Only the named environment variable, ahead of saved credentials |
233
+ | Client | `apiKeyEnv` omitted | `apiKeyEnv` explicitly set |
234
+ | ----------- | ------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
235
+ | Pi | `PLEXUS_API_KEY`, then saved host credential | Only the named environment variable, ahead of saved credentials |
236
+ | OMP | Registered `PLEXUS_API_KEY` env override, then host credentials | Only the named environment variable, ahead of saved credentials |
241
237
  | OpenCode V2 | `PLEXUS_API_KEY`, then saved `/connect` credential, then plugin `apiKey` option | Only the named environment variable, ahead of both saved credentials and `apiKey` |
242
238
 
243
239
  An explicit setting is authoritative even when it names `PLEXUS_API_KEY`. If the selected variable is missing, empty, or whitespace-only, the plugin reports an error naming the variable without showing its value. It does not fall back to a saved key, OpenCode's `apiKey` option, or the shared `PLEXUS_API_KEY`. Saved credentials remain stored; remove `apiKeyEnv` to restore the default precedence.
244
240
 
245
241
  ### Native login with `apiKeyEnv`
246
242
 
247
- `apiKeyEnv` changes which key authenticates requests, not the native login UI:
243
+ Environment overrides authenticate requests independently of saved login credentials:
248
244
 
249
- - Pi and OMP: `/login plexus` still prompts for the base URL and API key, and saves both through the normal configuration and credential stores.
245
+ - Pi: `/login plexus` still prompts for the base URL and API key and saves both normally.
246
+ - OMP: `/login plexus` is registered only when no environment key override is active. Otherwise OMP would treat the env key as a fallback behind saved credentials. Configure the URL through `config.json` or a URL environment override instead.
250
247
  - OpenCode V2: `/connect` still stores the Plexus base URL and API key normally.
251
248
 
252
- With an explicit `apiKeyEnv`, discovery and model requests use the named environment variable rather than the key entered during login. OMP's immediate post-login refresh also uses the environment key. Login remains useful for configuring the base URL, but entering a different key won't override the environment setting.
249
+ With an explicit `apiKeyEnv`, discovery and model requests use the named environment variable rather than a saved login key. Entering a different key during login won't override the environment setting.
253
250
 
254
251
  If the named variable is missing or empty at startup, the plugin fails to load. Native login cannot repair that setting: set the variable in the launching process environment or remove `apiKeyEnv`, then restart. Removing the setting restores the default precedence above without deleting saved credentials.
255
252
 
@@ -268,16 +265,18 @@ All plugin packages support suppressing models by name or pattern so undesired m
268
265
  ### Configuration methods
269
266
 
270
267
  - **Environment variables**:
268
+
271
269
  ```sh
272
270
  export PLEXUS_SUPPRESS_MODELS="gpt-3.5*, *deprecated*, whisper"
273
271
  ```
272
+
274
273
  `PLEXUS_EXCLUDE_MODELS` is also accepted. Values can be comma-, semicolon-, or newline-separated.
275
274
 
276
275
  - **pi / Oh My Pi config**: Add `suppressModels` (or `suppress`) to `config.json`:
277
276
  ```json
278
277
  {
279
- "baseUrl": "https://plexus.example.com",
280
- "suppressModels": ["gpt-3.5*", "*deprecated*"]
278
+ "baseUrl": "https://plexus.example.com",
279
+ "suppressModels": ["gpt-3.5*", "*deprecated*"]
281
280
  }
282
281
  ```
283
282
 
@@ -324,16 +323,16 @@ packages/
324
323
 
325
324
  The `/v1/models` endpoint returns an OpenRouter-style list. These fields drive host behavior:
326
325
 
327
- | Field | Effect |
328
- |---|---|
329
- | `preferred_api` | String or array. First recognized value selects the host API dialect. |
330
- | `supported_parameters` | `reasoning`, `include_reasoning`, or `reasoning_effort` enables reasoning support. |
331
- | `architecture.input_modalities` | Enables text/image/audio/video/pdf support where the host supports it. |
332
- | `pricing` | Converted into host per-million-token cost metadata. Plexus returns per-token prices. |
333
- | `pricing.tiers` | Alternate rates above `input_tokens_above`; mapped to native pi context pricing tiers. |
334
- | `top_provider` | Supplies context and output token limits when present. |
335
- | `pi_provider` / `pi_model` | Lets the pi adapter reuse built-in pi compat, headers, and thinking-level metadata. |
336
- | `pi_options` | pi compat overrides. These win over heuristic and built-in metadata. |
326
+ | Field | Effect |
327
+ | ------------------------------- | -------------------------------------------------------------------------------------- |
328
+ | `preferred_api` | String or array. First recognized value selects the host API dialect. |
329
+ | `supported_parameters` | `reasoning`, `include_reasoning`, or `reasoning_effort` enables reasoning support. |
330
+ | `architecture.input_modalities` | Enables text/image/audio/video/pdf support where the host supports it. |
331
+ | `pricing` | Converted into host per-million-token cost metadata. Plexus returns per-token prices. |
332
+ | `pricing.tiers` | Alternate rates above `input_tokens_above`; mapped to native pi context pricing tiers. |
333
+ | `top_provider` | Supplies context and output token limits when present. |
334
+ | `pi_provider` / `pi_model` | Lets the pi adapter reuse built-in pi compat, headers, and thinking-level metadata. |
335
+ | `pi_options` | pi compat overrides. These win over heuristic and built-in metadata. |
337
336
 
338
337
  Models with a falsy `id` are skipped. Missing metadata falls back to safe defaults.
339
338