converse-mcp-server 3.7.1 → 4.1.0

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/.env.example CHANGED
@@ -51,6 +51,11 @@ OPENROUTER_API_KEY=your_openrouter_api_key_here
51
51
  # OPENROUTER_REFERER=https://github.com/FallDownTheSystem/converse
52
52
  # OPENROUTER_TITLE=Converse
53
53
 
54
+ # Get your TypeSafe API key from: https://typesafe.ai
55
+ # Enables the decide tool's native host for Jev decision models. Without it,
56
+ # decide reaches Jev through OPENROUTER_API_KEY instead.
57
+ TYPESAFE_API_KEY=your_typesafe_api_key_here
58
+
54
59
  # ============================================
55
60
  # Codex Configuration (Optional)
56
61
  # ============================================
@@ -80,9 +85,23 @@ OPENROUTER_API_KEY=your_openrouter_api_key_here
80
85
  # WARNING: Interactive policies may cause hangs in server/headless mode
81
86
  # CODEX_APPROVAL_POLICY=never
82
87
 
83
- # Default Codex backend model (default: gpt-6-sol). Per-request override: models: ["codex:<model>"]
84
- # Options: gpt-6-sol, gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.3-codex-spark
85
- # CODEX_MODEL=gpt-6-sol
88
+ # ============================================
89
+ # Per-provider Default Models
90
+ # ============================================
91
+ # The model a bare provider name ("codex", "openai", ...) and "auto" use.
92
+ # Each must be a model ID or alias from that provider's catalog; startup fails
93
+ # with "did you mean" suggestions otherwise. Per request, use "provider:model".
94
+ # CODEX_DEFAULT_MODEL=gpt-6-sol # gpt-6-sol, gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5, gpt-5.3-codex-spark (CODEX_MODEL is the legacy name)
95
+ # CLAUDE_DEFAULT_MODEL=claude-opus-5-5
96
+ # AGY_DEFAULT_MODEL=gemini-3.8-flash # Antigravity CLI: gemini-3.8-flash, gemini-3.1-pro-preview
97
+ # COPILOT_DEFAULT_MODEL=gpt-6-sol # COPILOT_MODEL is the legacy name
98
+ # OPENAI_DEFAULT_MODEL=gpt-6-sol
99
+ # GOOGLE_DEFAULT_MODEL=gemini-3.1-pro-preview
100
+ # XAI_DEFAULT_MODEL=grok-4.5
101
+ # ANTHROPIC_DEFAULT_MODEL=claude-opus-5-5
102
+ # MISTRAL_DEFAULT_MODEL=mistral-medium-3-5
103
+ # DEEPSEEK_DEFAULT_MODEL=deepseek-v4-pro
104
+ # OPENROUTER_DEFAULT_MODEL=z-ai/glm-5.2 # any vendor/model slug
86
105
 
87
106
  # ============================================
88
107
  # Server Configuration
package/README.md CHANGED
@@ -182,6 +182,25 @@ Cancel running asynchronous operations when needed.
182
182
  }
183
183
  ```
184
184
 
185
+ ### 4. Decide Tool
186
+
187
+ Ask a System One decision model (TypeSafe's Jev) typed questions about a state and get calibrated answers instead of text: a yes probability (`noul`), a chosen option with per-option probabilities (`choice`), or a rubric position with per-level probabilities (`score`). Batch many questions into one call; they are judged in parallel against the same state. Needs `TYPESAFE_API_KEY` or `OPENROUTER_API_KEY` (TypeSafe first, falling back to OpenRouter).
188
+
189
+ ```javascript
190
+ {
191
+ "state": { "message": "I was charged twice for order A-104. Please fix this ASAP." },
192
+ "questions": {
193
+ "urgent": { "type": "noul", "instructions": "Does the message convey urgency?" },
194
+ "team": { "type": "choice", "instructions": "Which team should handle this?",
195
+ "criteria": { "billing": "Payments, refunds", "technical": "Bugs, outages" } },
196
+ "frustration": { "type": "score", "instructions": "How frustrated is the customer?",
197
+ "criteria": ["Calm", "Frustrated", "Very angry"] }
198
+ }
199
+ }
200
+ ```
201
+
202
+ See [docs/API.md](docs/API.md#decide-tool) for the full schema, model routing, and usage guidance.
203
+
185
204
  ## 🤖 AI Summarization Feature
186
205
 
187
206
  When enabled, the server automatically generates intelligent titles and summaries for better context understanding:
@@ -242,11 +261,11 @@ SUMMARIZATION_MODEL=gpt-5-nano # Default: gpt-5-nano
242
261
  - **gemini-2.5-flash** (alias: `flash`): Ultra-fast (1M context, 65K output)
243
262
  - **gemini-2.5-flash-lite** (alias: `flash-lite`): Lightweight fast model (1M context, 65K output)
244
263
 
245
- **Note**: The bare aliases `pro` and `gemini-pro` route to Gemini 3.1 Pro through the Google API. The short name `gemini` (and `gemini:pro`/`gemini:flash`) routes to the Antigravity CLI provider instead — see below.
264
+ **Note**: The Antigravity CLI provider serves `gemini-3.8-flash` and `gemini-3.1-pro-preview` under the same names and aliases, so bare `pro`, `gemini-pro`, `flash` and those IDs go to Antigravity first when it is installed (see [Model Selection](#model-selection)). Use `google:<model>` to always use the Google API.
246
265
 
247
266
  ### X.AI/Grok Models
248
267
 
249
- - **grok-4.5** (default; aliases: `grok`, `grok-4.5-latest`, `grok-build-latest`): Flagship model with image input, reasoning content, and native web/X search (500K context). Reasoning maps to `low`/`medium`/`high` and cannot be disabled; web search is automatic. Older Grok IDs still pass through as explicit model strings.
268
+ - **grok-4.5** (default; aliases: `grok`, `grok-4.5-latest`, `grok-build-latest`): Flagship model with image input, reasoning content, and native web/X search (500K context). Reasoning maps to `low`/`medium`/`high` and cannot be disabled; web search is automatic.
250
269
 
251
270
  ### Anthropic Models
252
271
 
@@ -285,8 +304,10 @@ Any other model works via its full `provider/model` slug or the `openrouter:` na
285
304
 
286
305
  ### Codex Models
287
306
 
288
- - **codex**: OpenAI Codex agentic coding assistant (GPT-6 Sol by default)
289
- - Pick another backend per request with `codex:<model>` (e.g. `codex:luna`, `codex:astra`, `codex:gpt-5.6-terra`) or globally with `CODEX_MODEL`; backends: `gpt-6-sol` (aliases `sol`, `gpt-6`), `gpt-6-luna` (`luna`), `gpt-6-astra` (`astra`), `gpt-5.6-sol`, `gpt-5.6-terra` (`terra`), `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.3-codex-spark` (`spark`)
307
+ OpenAI Codex agentic coding assistant. `codex` uses its default model (GPT-6 Sol, or `CODEX_DEFAULT_MODEL`); `codex:<model>` picks one (e.g. `codex:luna`, `codex:astra`, `codex:gpt-5.6-terra`):
308
+
309
+ - **gpt-6-sol** (default; aliases: `sol`, `gpt-6`), **gpt-6-luna** (`luna`), **gpt-6-astra** (`astra`)
310
+ - **gpt-5.6-sol** (`gpt-5.6`), **gpt-5.6-terra** (`terra`), **gpt-5.6-luna**, **gpt-5.5**, **gpt-5.3-codex-spark** (`spark`)
290
311
  - `reasoning_effort` maps onto the tiers the chosen backend accepts (Sol/Luna: `none` through `max`; GPT-6 Astra: `low` through `max`, no `none`)
291
312
  - Thread-based sessions with persistent context
292
313
  - Direct filesystem access from working directory
@@ -296,20 +317,20 @@ Any other model works via its full `provider/model` slug or the `openrouter:` na
296
317
 
297
318
  ### Claude Agent SDK Models
298
319
 
299
- - **claude** (aliases: `claude-sdk`, `claude-code`): Claude via the Claude Agent SDK
300
- - Defaults to Claude Opus 5.5 (`claude-opus-5-5`); `claude:opus` selects Opus 5.5, `claude:opus-5` selects Opus 5, `claude:fable` / `claude:fable-5.1` select Fable 5.1, and `claude:fable-5` selects Fable 5.0
301
- - Uses Claude Code CLI authentication (`claude login`) - no API key needed
302
- - Direct filesystem access from working directory
303
- - Unknown `claude:`-prefixed names pass through to the SDK (e.g. `claude:claude-sonnet-4-6`)
320
+ Claude via the Claude Agent SDK. `claude` uses its default model (Opus 5.5, or `CLAUDE_DEFAULT_MODEL`); `claude:<model>` picks one:
321
+
322
+ - **claude-opus-5-5** (default; aliases: `opus`, `claude-opus`, `opus-5.5`), **claude-opus-5** (`opus-5`)
323
+ - **claude-fable-5-1** (aliases: `fable`, `claude-fable`, `fable-5.1`), **claude-fable-5** (`fable-5`)
324
+ - Uses Claude Code CLI authentication (`claude login`) - no API key needed
325
+ - Direct filesystem access from working directory
304
326
 
305
327
  ### GitHub Copilot SDK Models
306
328
 
307
- Reach these with the `copilot:` namespace (e.g. `copilot:gpt-6-sol`); uses your GitHub Copilot subscription (`gh auth login`) - no API key needed:
329
+ Reach these only with the `copilot:` namespace (e.g. `copilot:gpt-6-sol`) — Copilot never serves bare model names. `copilot` alone uses GPT-6 Sol, or `COPILOT_DEFAULT_MODEL`. Uses your GitHub Copilot subscription (`gh auth login`) - no API key needed:
308
330
 
309
331
  - **OpenAI**: `gpt-6-sol` (aliases: `gpt-6`, `gpt-5`, `sol`), `gpt-6-luna` (alias: `luna`), `gpt-5.6-sol` (alias: `gpt-5.6`), `gpt-5.6-terra`, `gpt-5.6-luna` (all support `reasoning_effort`)
310
332
  - **Anthropic**: `claude-opus-5.5` (aliases: `opus`, `claude`), `claude-fable-5` (alias: `fable`), `claude-sonnet-5` (alias: `sonnet`), `claude-opus-5`, `claude-opus-4.8`
311
333
  - **Google**: `gemini-3.1-pro-preview` (aliases: `gemini`, `gemini-3.1-pro`), `gemini-3.8-flash` (aliases: `gemini-3.8`, `flash-3.8`), `gemini-3.5-flash` (alias: `gemini-flash`)
312
- - Any other `copilot:<id>` is forwarded to the Copilot backend verbatim
313
334
 
314
335
  ## 📚 Help & Documentation
315
336
 
@@ -363,7 +384,21 @@ CODEX_API_KEY=your_codex_api_key_here # Optional if ChatGPT login availabl
363
384
  CODEX_SANDBOX_MODE=read-only # read-only (default), workspace-write, danger-full-access
364
385
  CODEX_SKIP_GIT_CHECK=true # true (default), false
365
386
  CODEX_APPROVAL_POLICY=never # never (default), untrusted, on-failure, on-request
366
- CODEX_MODEL=gpt-6-sol # gpt-6-sol (default), gpt-6-luna, gpt-6-astra, gpt-5.6-sol, gpt-5.6-terra, gpt-5.6-luna, gpt-5.5
387
+
388
+ # Optional: per-provider default model, used for a bare provider name (`codex`,
389
+ # `openai`, ...) and for "auto". Must be a model or alias from that provider's
390
+ # list; startup fails with suggestions otherwise.
391
+ CODEX_DEFAULT_MODEL=gpt-6-sol # CODEX_MODEL still works as a fallback
392
+ CLAUDE_DEFAULT_MODEL=claude-opus-5-5
393
+ AGY_DEFAULT_MODEL=gemini-3.8-flash # Antigravity CLI (gemini)
394
+ COPILOT_DEFAULT_MODEL=gpt-6-sol # COPILOT_MODEL still works as a fallback
395
+ OPENAI_DEFAULT_MODEL=gpt-6-sol
396
+ GOOGLE_DEFAULT_MODEL=gemini-3.1-pro-preview
397
+ XAI_DEFAULT_MODEL=grok-4.5
398
+ ANTHROPIC_DEFAULT_MODEL=claude-opus-5-5
399
+ MISTRAL_DEFAULT_MODEL=mistral-medium-3-5
400
+ DEEPSEEK_DEFAULT_MODEL=deepseek-v4-pro
401
+ OPENROUTER_DEFAULT_MODEL=z-ai/glm-5.2 # any vendor/model slug is accepted
367
402
  ```
368
403
 
369
404
  ### Configuration Options
@@ -417,57 +452,59 @@ tool_timeout_sec = 3600 # default 300 kills long calls at 5 minutes
417
452
 
418
453
  ### Model Selection
419
454
 
420
- Use `"auto"` for automatic model selection, or specify exact models:
455
+ Every entry in `models` takes one of four forms:
421
456
 
422
457
  ```javascript
423
- // Auto-selection (recommended)
458
+ // Auto-selection (recommended): the first available provider's default model
424
459
  "auto";
425
460
 
426
- // Specific models
427
- "gemini-2.5-flash";
428
- "gpt-5.6";
429
- "grok-4.5";
430
- "z-ai/glm-5.2"; // -> OpenRouter (full slug)
431
- "z-ai/glm-5.2:online"; // -> OpenRouter with web search opt-in
432
-
433
- // Using aliases
434
- "flash"; // -> gemini-2.5-flash
435
- "pro"; // -> gemini-3.1-pro-preview
436
- "grok"; // -> grok-4.5
437
- "deepseek"; // -> deepseek-v4-pro
438
- "mistral"; // -> mistral-medium-3-5
439
- "fable"; // -> claude-fable-5 (Anthropic API)
440
- "opus"; // -> claude-opus-5-5 (Anthropic API)
441
-
442
- // SDK providers (subscription-based, no API key)
461
+ // A provider: its default model (hardcoded, or <PROVIDER>_DEFAULT_MODEL)
462
+ "codex"; // -> Codex (GPT-6 Sol)
443
463
  "claude"; // -> Claude Agent SDK (Claude Opus 5.5)
444
- "claude:fable"; // -> Claude Agent SDK (Claude Fable 5.1)
445
- "codex:luna"; // -> Codex (GPT-6 Luna)
446
- "copilot:gpt-6-sol"; // -> GitHub Copilot SDK
464
+ "gemini"; // -> Antigravity CLI (Gemini 3.8 Flash); `agy` works too
465
+ "openai"; // -> OpenAI API (GPT-6 Sol)
466
+
467
+ // provider:model — that model on that provider only
468
+ "codex:astra"; // -> Codex (GPT-6 Astra)
469
+ "openai:gpt-6-astra"; // -> OpenAI API, even when Codex is available
470
+ "gemini:pro"; // -> Antigravity CLI (Gemini 3.1 Pro)
471
+ "google:gemini-3.1-pro-preview"; // -> Google API
472
+ "copilot:sonnet"; // -> GitHub Copilot (Claude Sonnet 5)
473
+ "openrouter:z-ai/glm-5.2:online"; // -> OpenRouter with web search opt-in
474
+
475
+ // A bare model ID or alias — the first configured provider that offers it
476
+ "gpt-6-astra"; // -> Codex, else OpenAI API
477
+ "opus"; // -> Claude Agent SDK, else Anthropic API
478
+ "pro"; // -> Antigravity CLI, else Google API
479
+ "grok"; // -> grok-4.5 (XAI)
480
+ "z-ai/glm-5.2"; // -> OpenRouter (any vendor/model slug)
447
481
  ```
448
482
 
483
+ **Bare model names** go to the first provider, in the order below, whose model list contains the name and that is set up (API key present; for Codex and Claude, a login file or token; for Antigravity, the `agy` binary). If that provider then fails with an authentication or availability error, the next provider that serves **the same model** takes over — a provider whose alias of that name points at a different model is never substituted (bare `fable` is Fable 5.1 on the Claude Agent SDK and Fable 5 on the Anthropic API, so it does not fail over between them). Copilot is never picked for bare names; use `copilot:<model>`.
484
+
485
+ **Unknown names are rejected**, never guessed: a typo or an unlisted model returns an error with up to three close matches, e.g. `Unknown model "gtp-6-astra". Did you mean: gpt-6-astra?` or `Unknown openai model "spark" in "openai:spark". Did you mean: codex:spark?`. OpenRouter is the exception for full `vendor/model` slugs, which are checked against OpenRouter's live catalog.
486
+
449
487
  **Auto Model Behavior:**
450
488
 
451
- - **chat mode**: `["auto"]` selects the first available provider and uses its default model
489
+ - **chat mode**: `["auto"]` selects the first available provider and uses its default model, failing over down the list
452
490
  - **consensus mode**: `["auto"]` automatically expands to the first 3 available providers
491
+ - **roundtable mode**: `["auto"]` uses the first available provider
453
492
 
454
- Provider priority order (subscription-based SDK providers first, then API-key providers):
493
+ Provider priority order (subscription-based local providers first, then API-key providers), used by both `auto` and bare model names:
455
494
 
456
495
  1. Codex (`codex` → GPT-6 Sol)
457
- 2. Gemini via Antigravity CLI (`gemini` → Gemini 3.8 Flash, `gemini:pro`)
496
+ 2. Gemini via Antigravity CLI (`gemini` / `agy` → Gemini 3.8 Flash)
458
497
  3. Claude Agent SDK (`claude` → Claude Opus 5.5)
459
- 4. Copilot (`copilot`)
460
- 5. OpenAI (`gpt-6` → GPT-6 Sol)
461
- 6. Google (`gemini-pro`)
462
- 7. XAI (`grok-4.5`)
463
- 8. Anthropic (`claude-opus-5-5`)
464
- 9. Mistral (`mistral-medium-3-5`)
465
- 10. DeepSeek (`deepseek-v4-pro`)
466
- 11. OpenRouter (`z-ai/glm-5.2`)
467
-
468
- The system will use the first 3 providers that are available (authenticated SDK or valid API key). This enables automatic multi-model consensus without manually specifying models.
469
-
470
- **Antigravity CLI permissions:** The `gemini`, `gemini:flash`, and `gemini:pro` aliases launch `agy` with `--dangerously-skip-permissions` because headless calls cannot prompt for tool approval. All tool permission requests are auto-approved, including shell commands and file writes; a read-only prompt is not an enforced security boundary. Use this provider only with trusted prompts and context. This also applies when `auto` selects it. The Google API provider is unaffected.
498
+ 4. Copilot (`copilot` → GPT-6 Sol; `auto` only, never bare names)
499
+ 5. OpenAI (`openai` → GPT-6 Sol)
500
+ 6. Google (`google` → Gemini 3.1 Pro)
501
+ 7. XAI (`xai` → Grok 4.5)
502
+ 8. Anthropic (`anthropic` → Claude Opus 5.5)
503
+ 9. Mistral (`mistral` → Mistral Medium 3.5)
504
+ 10. DeepSeek (`deepseek` → DeepSeek V4 Pro)
505
+ 11. OpenRouter (`openrouter` → GLM 5.2)
506
+
507
+ **Local agent permissions:** Bare model names and `auto` reach the local agent providers whenever they are set up, not only when named explicitly. The Antigravity CLI runs `agy` with `--dangerously-skip-permissions` because headless calls cannot prompt for tool approval — every tool request is auto-approved, including shell commands and file writes. The Claude Agent SDK runs with `bypassPermissions`. Codex uses `CODEX_SANDBOX_MODE` (read-only by default). A read-only prompt is not an enforced security boundary for these providers, so use them only with trusted prompts and context. To keep a request on a plain API, name the provider: `google:pro`, `anthropic:opus`, `openai:gpt-6-astra`.
471
508
 
472
509
  ### Advanced Configuration
473
510
 
package/docs/API.md CHANGED
@@ -366,9 +366,113 @@ The response renders a human-readable status (start time, elapsed time, turn/mod
366
366
 
367
367
  Only jobs in a `queued` or `running` state can be cancelled; already-completed, failed, or cancelled jobs return a non-cancellable status.
368
368
 
369
+ ## Decide Tool
370
+
371
+ **Description**: Ask a System One decision model (TypeSafe's Jev family) typed questions about a state. Decision models return calibrated probabilities, never text, so they have their own tool and their own providers: `chat` routing never reaches them, and `decide` never reaches a chat model.
372
+
373
+ ### Request Schema
374
+
375
+ ```json
376
+ {
377
+ "type": "object",
378
+ "properties": {
379
+ "state": { "anyOf": [{ "type": "string" }, { "type": "object" }, { "type": "array" }] },
380
+ "questions": {
381
+ "type": "object",
382
+ "additionalProperties": {
383
+ "type": "object",
384
+ "properties": {
385
+ "type": { "type": "string", "enum": ["noul", "choice", "score"] },
386
+ "instructions": { "anyOf": [{ "type": "string" }, { "type": "object" }, { "type": "array" }] },
387
+ "criteria": { "anyOf": [{ "type": "object" }, { "type": "array" }] }
388
+ },
389
+ "required": ["type", "instructions"]
390
+ }
391
+ },
392
+ "model": { "type": "string", "description": "Default: \"auto\"" },
393
+ "files": { "type": "array", "items": { "type": "string" } }
394
+ },
395
+ "required": ["questions"],
396
+ "additionalProperties": false
397
+ }
398
+ ```
399
+
400
+ - **`state`**: the material to judge. An object with descriptively named fields works best; use an array for sequences such as chat messages. Optional when `files` is given.
401
+ - **`questions`**: named questions, each judged in parallel and in isolation against the same state. The name is your own label and becomes the answer key. Batching many questions into one call adds almost no latency or cost.
402
+ - **`files`**: text files added to the state as `{ "files": { "<path>": "<content>" } }`. When `state` is also given, it moves to `input`. Line ranges (`file.txt{10:50}`) are supported; images are rejected.
403
+
404
+ | Type | `criteria` | Answer |
405
+ |---|---|---|
406
+ | `noul` | Optional `{ "true": "...", "false": "..." }` | `noul`: probability 0..1 of yes |
407
+ | `choice` | Required `{ "<option>": "description" \| null }`, 2–255 options | `choice`, per-option `probabilities`, `confidence` |
408
+ | `score` | Required ordered array of levels, lowest first, 2–10 levels | `score` (probability-weighted level position), `legend`, per-level `probabilities`, `confidence` |
409
+
410
+ `instructions` and criteria descriptions may be objects or arrays that bundle reference data with the question; refer to their fields by `` `name` `` in the text. Questions are validated before any request is sent.
411
+
412
+ ### Models and Providers
413
+
414
+ | Provider | Key | Models |
415
+ |---|---|---|
416
+ | `typesafe` (native, `https://api.typesafe.ai/v1/systemone`) | `TYPESAFE_API_KEY` | `jev-latest`, `jev-1.13.0` (alias `jev-1.13`), `jev-preview`, any versioned `jev-X.Y.Z` |
417
+ | `openrouter` (`https://openrouter.ai/api/v1/systemone`) | `OPENROUTER_API_KEY` | `~typesafe/jev-latest` (alias `jev-latest`), `typesafe/jev-1.13` (aliases `jev-1.13`, `jev-1.13.0`), any `vendor/model` slug |
418
+
419
+ - `auto` (default): TypeSafe's default model, falling back to OpenRouter's.
420
+ - A bare name such as `jev-1.13` goes to every configured provider that serves it, native first, and each provider receives its own model ID. OpenRouter does not serve `jev-preview` or patch-level IDs other than those listed above.
421
+ - `typesafe:jev-1.13.0` or `openrouter:~typesafe/jev-latest` pins one provider.
422
+
423
+ Each provider call retries timeouts, 408, 429 and 5xx with backoff, honoring `Retry-After`. Auth failures, exhausted retries and malformed responses fall back to the next provider. A 400/422 request fault stops immediately, because every host would reject it the same way.
424
+
425
+ ### Example Usage
426
+
427
+ ```json
428
+ {
429
+ "state": { "message": "I was charged twice for order A-104. Please fix this ASAP." },
430
+ "questions": {
431
+ "urgent": { "type": "noul", "instructions": "Does the message convey urgency?" },
432
+ "team": {
433
+ "type": "choice",
434
+ "instructions": "Which team should handle this?",
435
+ "criteria": { "billing": "Payments, invoicing, refunds", "technical": "Bugs, outages", "sales": null }
436
+ },
437
+ "frustration": {
438
+ "type": "score",
439
+ "instructions": "How frustrated is the customer?",
440
+ "criteria": ["Calm", "Frustrated", "Very angry"]
441
+ }
442
+ }
443
+ }
444
+ ```
445
+
446
+ ### Response Format
447
+
448
+ A one-line summary per answer, followed by the answers in the same JSON shape whichever provider served them:
449
+
450
+ ````
451
+ Decision · typesafe/jev-1.13-20260917 via OpenRouter · 394 input tokens · $0.000017
452
+ - urgent (noul): 0.97
453
+ - team (choice): billing · confidence 1.00 · billing 1.00, technical 0.00, sales 0.00
454
+ - frustration (score): 1.24 on 0–2 · confidence 0.64 · 1 Frustrated 0.76, 2 Very angry 0.24, 0 Calm 0.00
455
+
456
+ ```json
457
+ {
458
+ "model": "typesafe/jev-1.13-20260917",
459
+ "provider": "openrouter",
460
+ "answers": { "urgent": { "type": "noul", "noul": 0.97 }, "...": {} },
461
+ "usage": { "input_tokens": 394, "output_tokens": 70, "cost": 0.000016548 },
462
+ "id": "gen-dec-..."
463
+ }
464
+ ```
465
+ ````
466
+
467
+ `usage.cost` is reported by OpenRouter only (`null` from TypeSafe). A fallback is noted under the summary line.
468
+
469
+ ### Usage Guidance
470
+
471
+ Jev reads questions literally and is weak at counting, arithmetic, date comparison, and multi-hop reasoning; do those in code and ask narrow, atomic questions. Split compound judgments into separate questions and combine them in code. Treat low `confidence` as a signal to escalate to a generative model or a human. Limits: text only, about 64k tokens per request and 32k for the state plus the longest single question.
472
+
369
473
  ## Supported Models
370
474
 
371
- Provide models as plain name strings in the `models` array. Bare names and aliases resolve to a provider automatically; use a namespace prefix (`claude:`, `gemini:`, `copilot:`, `openrouter:`) or a full `provider/model` slug for explicit routing.
475
+ Provide models as plain name strings in the `models` array. Each entry is `auto`, a provider name (its default model), `provider:model` (that model on that provider only), or a bare model ID/alias (the first set-up provider that offers it). Names that match no provider's list are rejected with suggestions. See [Model Selection](#model-selection) for the full rules.
372
476
 
373
477
  ### OpenAI Models
374
478
 
@@ -399,7 +503,7 @@ Provide models as plain name strings in the `models` array. Bare names and alias
399
503
  | `gemini-2.5-flash` | `flash` | 1M | 65K | Ultra-fast |
400
504
  | `gemini-2.5-flash-lite` | `flash-lite` | 1M | 65K | Lightweight fast model |
401
505
 
402
- **Note:** The short name `gemini` (and `gemini:pro` / `gemini:flash`) routes to the **Antigravity CLI** (`agy`, OAuth-based). For Google API access, use specific model names like `gemini-3.1-pro-preview` or `gemini-2.5-flash` (bare `gemini-pro` / `gemini-flash` also route to the Google API).
506
+ **Note:** The **Antigravity CLI** provider (`agy`, OAuth-based) serves `gemini-3.8-flash` and `gemini-3.1-pro-preview` under the same IDs and aliases, so bare `pro`, `gemini-pro`, `flash` and those IDs go to Antigravity first when `agy` is installed; the bare name `gemini` is the Antigravity namespace. Use `google:<model>` (e.g. `google:pro`) to always use the Google API.
403
507
 
404
508
  ### X.AI / Grok Models
405
509
 
@@ -460,8 +564,9 @@ Any other model works via its full `provider/model` slug (e.g. `anthropic/claude
460
564
 
461
565
  **Codex** is an agentic coding assistant with direct filesystem access:
462
566
 
463
- - **Model**: `codex` (underlying model: GPT-6 Sol by default)
464
- - **Backend selection**: `codex:<model>` per request (e.g. `codex:luna`, `codex:astra`, `codex:gpt-5.6-terra`), or `CODEX_MODEL` globally; `sol`/`luna`/`gpt-6` name the GPT-6 tiers, the GPT-5.6 tiers are reached by full slug; unknown names pass through to the CLI verbatim
567
+ - **Model**: `codex` (underlying model: GPT-6 Sol by default, or `CODEX_DEFAULT_MODEL`)
568
+ - **Backend selection**: `codex:<model>` per request (e.g. `codex:luna`, `codex:astra`, `codex:gpt-5.6-terra`) from the Codex catalog: `gpt-6-sol` (`sol`, `gpt-6`), `gpt-6-luna` (`luna`), `gpt-6-astra` (`astra`), `gpt-5.6-sol` (`gpt-5.6`), `gpt-5.6-terra` (`terra`), `gpt-5.6-luna`, `gpt-5.5`, `gpt-5.3-codex-spark` (`spark`). Other names are rejected with suggestions. Bare IDs from this list (e.g. `gpt-6-astra`) go to Codex first, then the OpenAI API.
569
+ - **Availability**: the Codex SDK is installed and `~/.codex/auth.json` exists (`$CODEX_HOME/auth.json` when set) or `CODEX_API_KEY` is set
465
570
  - **Thread-based sessions**: persistent conversation history via `continuation_id` in `chat` mode
466
571
  - **Direct file access**: reads files from the working directory (paths relative to `CLIENT_CWD`)
467
572
  - **Response times**: 6-20 seconds typical (complex tasks may take minutes)
@@ -472,9 +577,11 @@ Any other model works via its full `provider/model` slug (e.g. `anthropic/claude
472
577
 
473
578
  **Claude** is available through the Claude Agent SDK, using Claude Code CLI authentication instead of an API key:
474
579
 
475
- - **Model**: `claude` (aliases: `claude-sdk`, `claude-code`) — defaults to Claude Opus 5.5 (`claude-opus-5-5`)
476
- - **Model selection**: `claude:opus` or `claude:opus-5.5` (Claude Opus 5.5), `claude:opus-5` (Claude Opus 5), `claude:fable` or `claude:fable-5.1` (Claude Fable 5.1), `claude:fable-5` (Claude Fable 5.0); unknown `claude:`-prefixed names pass through to the SDK (e.g. `claude:claude-sonnet-4-6`)
580
+ - **Model**: `claude` (namespaces: `claude`, `claude-code`, `claude-sdk`) — defaults to Claude Opus 5.5 (`claude-opus-5-5`), or `CLAUDE_DEFAULT_MODEL`
581
+ - **Model selection**: `claude-opus-5-5` (`opus`, `claude-opus`, `opus-5.5`), `claude-opus-5` (`opus-5`), `claude-fable-5-1` (`fable`, `claude-fable`, `fable-5.1`), `claude-fable-5` (`fable-5`), e.g. `claude:opus`, `claude:fable`. Other names are rejected with suggestions.
477
582
  - **Authentication**: `claude login` — no `ANTHROPIC_API_KEY` needed
583
+ - **Availability**: the Claude Agent SDK is installed and `~/.claude/.credentials.json` exists (`$CLAUDE_CONFIG_DIR` when set), or `CLAUDE_CODE_OAUTH_TOKEN`/`ANTHROPIC_API_KEY` is in the environment; on macOS the Keychain login is assumed. An expired login is caught at call time and bare-name/`auto` routing fails over.
584
+ - **Permissions**: runs with `bypassPermissions`
478
585
  - **Direct file access**: reads files from the working directory
479
586
  - **Reasoning effort**: `reasoning_effort` maps to the SDK's `effort` option: `low`, `medium`, `high`, `xhigh`, or `max`; `none` and `minimal` become `low`. Omitting it retains the SDK default.
480
587
  - **Turn limit**: SDK requests allow up to 100 turns (`maxTurns: 100`).
@@ -484,7 +591,10 @@ Any other model works via its full `provider/model` slug (e.g. `anthropic/claude
484
591
 
485
592
  The **Antigravity CLI** (`agy`) provides subscription-based access to Gemini models through Google OAuth:
486
593
 
487
- - **Models** (text-only): `gemini` (= `gemini:flash`, Gemini 3.8 Flash), `gemini:pro` (Gemini 3.1 Pro)
594
+ - **Models** (text-only): `gemini-3.8-flash` (`flash`, `gemini-3.8`, `flash-3.8`, ...; default, `gemini` = `gemini:flash`), `gemini-3.1-pro-preview` (`pro`, `gemini-pro`, `gemini-3.1-pro`, ...; `gemini:pro`). Default override: `AGY_DEFAULT_MODEL`.
595
+ - **Namespaces**: `gemini`, `agy`, `antigravity`, `gemini-cli`
596
+ - **Availability**: the `agy` binary is found on PATH or at the platform install location
597
+ - **Permissions**: `agy` runs with `--dangerously-skip-permissions`, so every tool request is auto-approved
488
598
  - **Authentication**: Google OAuth via `agy` (one-time interactive login)
489
599
  - **Setup**: install the Antigravity CLI and run `agy` once to log in
490
600
  - **Billing**: uses your Antigravity subscription/compute allowance instead of API credits
@@ -506,28 +616,39 @@ agy
506
616
 
507
617
  ### GitHub Copilot SDK (subscription)
508
618
 
509
- Reach these with the `copilot:` namespace (e.g. `copilot:gpt-6-sol`); uses your GitHub Copilot subscription (`gh auth login`) — no API key needed:
619
+ Reach these only with the `copilot:` namespace (also `github-copilot:`, `copilot-sdk:`; e.g. `copilot:gpt-6-sol`) — Copilot never serves bare model names. `copilot` alone uses GPT-6 Sol, or `COPILOT_DEFAULT_MODEL`. Available when the Copilot SDK is installed; uses your GitHub Copilot subscription (`gh auth login`) — no API key needed:
510
620
 
511
621
  - **OpenAI**: `gpt-6-sol` (aliases: `gpt-6`, `gpt-5`, `sol`), `gpt-6-luna` (alias: `luna`), `gpt-5.6-sol` (alias: `gpt-5.6`), `gpt-5.6-terra`, `gpt-5.6-luna` (all accept `reasoning_effort`)
512
622
  - **Anthropic**: `claude-opus-5.5` (aliases: `opus`, `claude`), `claude-fable-5` (alias: `fable`), `claude-sonnet-5` (alias: `sonnet`), `claude-opus-5`, `claude-opus-4.8`
513
623
  - **Google**: `gemini-3.1-pro-preview` (aliases: `gemini`, `gemini-3.1-pro`), `gemini-3.8-flash` (aliases: `gemini-3.8`, `flash-3.8`), `gemini-3.5-flash` (alias: `gemini-flash`)
514
- - Any other `copilot:<id>` is forwarded to the Copilot backend verbatim
624
+ - Any other `copilot:<id>` is rejected with suggestions
515
625
 
516
626
  ### Model Selection
517
627
 
518
- Use `"auto"` for automatic selection, or specify exact models:
628
+ Every entry in `models` takes one of four forms:
629
+
630
+ - **`auto`** — the first available provider's default model.
631
+ - **`provider`** — that provider's default model (hardcoded, or `<PROVIDER>_DEFAULT_MODEL`). Namespaces: `codex`; `gemini`/`agy`/`antigravity`/`gemini-cli` (Antigravity CLI); `claude`/`claude-code`/`claude-sdk` (Claude Agent SDK); `copilot`/`github-copilot`/`copilot-sdk`; `openai`; `google`; `xai`; `anthropic`; `mistral`; `deepseek`; `openrouter`.
632
+ - **`provider:model`** — that model on that provider only; the model must be in that provider's list.
633
+ - **Bare `model`** — the first provider, in the order `codex`, `gemini-cli`, `claude`, `openai`, `google`, `xai`, `anthropic`, `mistral`, `deepseek`, `openrouter`, whose list contains the ID or alias and that is set up (API key for API providers; SDK plus login for Codex and the Claude Agent SDK; the `agy` binary for Antigravity). On an authentication or availability error, the next set-up provider serving **the same model** takes over; a provider whose alias points at a different model is never substituted (bare `fable` is Fable 5.1 on the Claude Agent SDK and Fable 5 on the Anthropic API). Copilot never serves bare names.
634
+
635
+ **Unknown names are rejected**, never forwarded: the error lists up to three close matches, e.g. `Unknown model "gtp-6-astra". Did you mean: gpt-6-astra?` or `Unknown openai model "spark" in "openai:spark". Did you mean: codex:spark?`. The exception is OpenRouter: a full `vendor/model` slug (bare or `openrouter:`) is validated against OpenRouter's live catalog.
519
636
 
520
637
  ```text
521
638
  "auto" // First available provider (chat); first 3 (consensus)
522
- "gpt-6" // OpenAI flagship (-> gpt-6-sol)
639
+ "gpt-6" // Codex (-> gpt-6-sol), else OpenAI API
640
+ "openai:gpt-6" // OpenAI API only
523
641
  "gemini-2.5-flash" // Google API
642
+ "pro" // Antigravity CLI (-> gemini-3.1-pro-preview), else Google API
643
+ "google:pro" // Google API only
524
644
  "grok-4.5" // X.AI
525
645
  "deepseek" // DeepSeek (-> deepseek-v4-pro)
526
646
  "mistral" // Mistral (-> mistral-medium-3-5)
527
647
  "z-ai/glm-5.2" // OpenRouter (full slug)
528
648
  "z-ai/glm-5.2:online" // OpenRouter with web search opt-in
529
- "fable" // Anthropic API (-> claude-fable-5)
530
- "opus" // Anthropic API (-> claude-opus-5-5)
649
+ "fable" // Claude Agent SDK (-> claude-fable-5-1) when set up, otherwise Anthropic API (-> claude-fable-5)
650
+ "opus" // Claude Agent SDK (-> claude-opus-5-5), else Anthropic API
651
+ "anthropic:opus" // Anthropic API only
531
652
  "claude" // Claude Agent SDK (-> Claude Opus 5.5)
532
653
  "claude:fable" // Claude Agent SDK (Claude Fable 5.1)
533
654
  "codex:luna" // Codex (GPT-6 Luna)
@@ -535,6 +656,8 @@ Use `"auto"` for automatic selection, or specify exact models:
535
656
  "copilot:gpt-6-sol" // GitHub Copilot SDK
536
657
  ```
537
658
 
659
+ **Local agent permissions:** bare names and `auto` reach the local agent providers whenever they are set up. The Antigravity CLI auto-approves every tool request and the Claude Agent SDK runs with `bypassPermissions`, so a read-only prompt is not an enforced boundary there. Name the API provider (`google:pro`, `anthropic:opus`, `openai:gpt-6-astra`) to keep a request on a plain API.
660
+
538
661
  **Auto behavior:**
539
662
  - **chat mode**: `["auto"]` selects the first available provider and uses its default model, with failover to the next provider on error.
540
663
  - **consensus mode**: `["auto"]` expands to the first 3 available providers.
@@ -559,7 +682,7 @@ Control Codex behavior through environment variables:
559
682
  - **`CODEX_SANDBOX_MODE`** — filesystem access: `read-only` (default), `workspace-write`, `danger-full-access` (containers only)
560
683
  - **`CODEX_SKIP_GIT_CHECK`** — `true` (default) works in any directory; `false` requires a Git repository
561
684
  - **`CODEX_APPROVAL_POLICY`** — `never` (default, recommended for servers), `untrusted`, `on-failure`, `on-request`
562
- - **`CODEX_MODEL`** — underlying model for Codex sessions (default: `gpt-6-sol`)
685
+ - **`CODEX_DEFAULT_MODEL`** — model used for `codex` and `auto` (default: `gpt-6-sol`); the legacy name `CODEX_MODEL` is honored when it is unset
563
686
  - **`CODEX_API_KEY`** — optional API key for headless deployments (alternative to ChatGPT login)
564
687
 
565
688
  **Example (.env):**
@@ -568,7 +691,25 @@ CODEX_API_KEY=your_codex_api_key_here
568
691
  CODEX_SANDBOX_MODE=read-only
569
692
  CODEX_SKIP_GIT_CHECK=true
570
693
  CODEX_APPROVAL_POLICY=never
571
- CODEX_MODEL=gpt-6-sol
694
+ CODEX_DEFAULT_MODEL=gpt-6-sol
695
+ ```
696
+
697
+ ### Default Models
698
+
699
+ Each provider's default model (used for its bare provider name and for `auto`) can be set with `<PROVIDER>_DEFAULT_MODEL`. The value must be a model ID or alias from that provider's list; startup fails with "Did you mean" suggestions otherwise (OpenRouter also accepts any `vendor/model` slug).
700
+
701
+ ```bash
702
+ CODEX_DEFAULT_MODEL=gpt-6-sol # CODEX_MODEL is honored as a legacy fallback
703
+ CLAUDE_DEFAULT_MODEL=claude-opus-5-5
704
+ AGY_DEFAULT_MODEL=gemini-3.8-flash # Antigravity CLI (gemini)
705
+ COPILOT_DEFAULT_MODEL=gpt-6-sol # COPILOT_MODEL is honored as a legacy fallback
706
+ OPENAI_DEFAULT_MODEL=gpt-6-sol
707
+ GOOGLE_DEFAULT_MODEL=gemini-3.1-pro-preview
708
+ XAI_DEFAULT_MODEL=grok-4.5
709
+ ANTHROPIC_DEFAULT_MODEL=claude-opus-5-5
710
+ MISTRAL_DEFAULT_MODEL=mistral-medium-3-5
711
+ DEEPSEEK_DEFAULT_MODEL=deepseek-v4-pro
712
+ OPENROUTER_DEFAULT_MODEL=z-ai/glm-5.2 # any vendor/model slug is accepted
572
713
  ```
573
714
 
574
715
  ## Context Processing
@@ -656,12 +797,12 @@ Set `async: true` on a chat request for long-running work:
656
797
 
657
798
  **Missing API key / unavailable provider:**
658
799
  ```json
659
- { "error": "Provider openai is not available. Check API key configuration." }
800
+ { "error": "Provider openai is not available: set OPENAI_API_KEY." }
660
801
  ```
661
802
 
662
- **Invalid model:**
803
+ **Invalid model** (unknown names are rejected with up to three suggestions):
663
804
  ```json
664
- { "error": "Provider not found for model: invalid-model" }
805
+ { "error": "Unknown model \"gtp-6-astra\". Did you mean: gpt-6-astra?" }
665
806
  ```
666
807
 
667
808
  **All models failed (multi-model chat):** the error lists each model and its failure. In consensus/roundtable, individual model/turn failures are recorded in the result (`failed` entries and trailing failure details) rather than aborting the whole request.
@@ -677,6 +818,7 @@ ANTHROPIC_API_KEY=sk-ant-...
677
818
  MISTRAL_API_KEY=...
678
819
  DEEPSEEK_API_KEY=...
679
820
  OPENROUTER_API_KEY=sk-or-...
821
+ TYPESAFE_API_KEY=... # decide tool only
680
822
  ```
681
823
 
682
824
  **MCP client configuration:**
package/docs/EXAMPLES.md CHANGED
@@ -74,6 +74,24 @@ I'd be happy to help you understand JavaScript promises! Promises are objects th
74
74
  }
75
75
  ```
76
76
 
77
+ A bare model name goes to the first set-up provider that offers it (here Codex, then the OpenAI API), failing over only to providers serving the same model. Unknown names are rejected with "Did you mean" suggestions.
78
+
79
+ ### Pinning a provider
80
+
81
+ Use `provider:model` to run a model on one provider only, or a provider name alone for its default model:
82
+
83
+ ```json
84
+ {
85
+ "tool": "chat",
86
+ "arguments": {
87
+ "prompt": "Compare these two approaches to request batching",
88
+ "models": ["openai:gpt-6-astra", "google:pro", "anthropic:opus", "codex:luna", "copilot:sonnet"]
89
+ }
90
+ }
91
+ ```
92
+
93
+ Naming the API provider (`google:pro`, `anthropic:opus`) keeps the request off the local agent providers (Antigravity CLI, Claude Agent SDK), which bare names and `auto` otherwise reach first when they are set up.
94
+
77
95
  ### Fast responses with a lightweight model
78
96
 
79
97
  ```json
@@ -426,6 +444,26 @@ Codex maintains conversation history through threads in `chat` mode:
426
444
  }
427
445
  ```
428
446
 
447
+ ### Choosing the Codex Model
448
+
449
+ `codex` uses GPT-6 Sol (or `CODEX_DEFAULT_MODEL`); `codex:<model>` picks another model from the Codex list:
450
+
451
+ ```json
452
+ {
453
+ "tool": "chat",
454
+ "arguments": {
455
+ "prompt": "Find the race condition in the job scheduler",
456
+ "models": ["codex:astra"],
457
+ "files": ["/path/to/src/scheduler.js"]
458
+ }
459
+ }
460
+ ```
461
+
462
+ ```bash
463
+ # Default model for "codex" and "auto" (CODEX_MODEL is honored as a legacy fallback)
464
+ CODEX_DEFAULT_MODEL=gpt-6-luna
465
+ ```
466
+
429
467
  ### Sandbox Modes
430
468
 
431
469
  Control filesystem access through `CODEX_SANDBOX_MODE`: