@1presence/bridge 0.67.0 → 0.68.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/dist/config.js +24 -16
- package/package.json +1 -1
package/dist/config.js
CHANGED
|
@@ -75,29 +75,37 @@ function detectClaudeDefaultModel() {
|
|
|
75
75
|
}
|
|
76
76
|
// The fixed menu — keep the option count small so the timeout default is easy
|
|
77
77
|
// to glance at. Option 1's `model: null` means "let Claude Code pick" (no
|
|
78
|
-
// `--model` flag passed to the subprocess).
|
|
79
|
-
//
|
|
80
|
-
//
|
|
81
|
-
//
|
|
82
|
-
//
|
|
83
|
-
//
|
|
84
|
-
//
|
|
85
|
-
//
|
|
86
|
-
//
|
|
78
|
+
// `--model` flag passed to the subprocess). This is the DYNAMIC default: it
|
|
79
|
+
// tracks whatever model Claude Code actually serves for the user's plan (the
|
|
80
|
+
// probe above surfaces it as a live suffix — on most accounts today that's the
|
|
81
|
+
// 1M-context Opus) and self-heals if a pinned id is ever unservable. The
|
|
82
|
+
// remaining rows pin explicit ids for users who want a specific model.
|
|
83
|
+
// `num` must stay contiguous 1..N in array order — the jump-key handler maps a
|
|
84
|
+
// typed digit `n` to `idx = n - 1`.
|
|
85
|
+
//
|
|
86
|
+
// NB there is no way to *enumerate* the models available on subscription auth:
|
|
87
|
+
// the `/v1/models` API needs an API key (the bridge strips ANTHROPIC_API_KEY —
|
|
88
|
+
// see claude.ts) and the CLI exposes only the single default via the init event.
|
|
89
|
+
// So this list is hand-maintained — add/remove ids here as the roster changes.
|
|
90
|
+
// (We dropped the standalone `claude-opus-4-8[1m]` row: it duplicated option 1,
|
|
91
|
+
// whose Claude Code default already resolves to the 1M Opus on subscription, and
|
|
92
|
+
// pinning `[1m]` risked a hard failure where the null default degrades gracefully.
|
|
93
|
+
// An earlier every-turn `400 / "unknown"` was once blamed on `[1m]` but was
|
|
94
|
+
// actually a tool-schema bug that hit every model — see vault/Bugs.md.)
|
|
87
95
|
const MODEL_OPTIONS = [
|
|
88
96
|
{ num: 1, model: null, label: 'Use Claude Code default' },
|
|
89
97
|
{ num: 2, model: 'claude-opus-4-8', label: 'claude-opus-4-8' },
|
|
90
|
-
{ num: 3, model: 'claude-opus-4-
|
|
91
|
-
{ num: 4, model: 'claude-
|
|
98
|
+
{ num: 3, model: 'claude-opus-4-7', label: 'claude-opus-4-7' },
|
|
99
|
+
{ num: 4, model: 'claude-fable-5', label: 'claude-fable-5' },
|
|
92
100
|
{ num: 5, model: 'claude-sonnet-4-6', label: 'claude-sonnet-4-6' },
|
|
93
101
|
{ num: 6, model: 'claude-haiku-4-5', label: 'claude-haiku-4-5' },
|
|
94
102
|
];
|
|
95
103
|
const PROMPT_TIMEOUT_MS = 10_000;
|
|
96
|
-
// Default to
|
|
97
|
-
//
|
|
98
|
-
//
|
|
99
|
-
//
|
|
100
|
-
const DEFAULT_OPTION_NUM =
|
|
104
|
+
// Default to option 1 ("Use Claude Code default") — the dynamic choice that
|
|
105
|
+
// follows whatever Claude Code serves for the user's plan (currently the 1M
|
|
106
|
+
// Opus on most accounts) and degrades gracefully rather than pinning a possibly
|
|
107
|
+
// unservable id. Users can arrow to a pinned model if they want one.
|
|
108
|
+
const DEFAULT_OPTION_NUM = 1;
|
|
101
109
|
function promptForModel(defaultModel) {
|
|
102
110
|
return new Promise((resolve) => {
|
|
103
111
|
const initialIdx = Math.max(0, MODEL_OPTIONS.findIndex((o) => o.num === DEFAULT_OPTION_NUM));
|