@ashlr/hub 3.7.0 → 3.9.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/CHANGELOG.md +257 -0
- package/dist/build-identity.json +2 -2
- package/dist/cli/resource-profile.js +95 -21
- package/dist/cli/resource-profile.js.map +1 -1
- package/dist/core/policy/local-only.d.ts +142 -2
- package/dist/core/policy/local-only.js +204 -15
- package/dist/core/policy/local-only.js.map +1 -1
- package/dist/core/resources/native-profile.d.ts +56 -0
- package/dist/core/resources/native-profile.js +368 -6
- package/dist/core/resources/native-profile.js.map +1 -1
- package/dist/core/run/budget.d.ts +22 -8
- package/dist/core/run/budget.js +80 -12
- package/dist/core/run/budget.js.map +1 -1
- package/dist/core/run/model-catalog.js +8 -1
- package/dist/core/run/model-catalog.js.map +1 -1
- package/dist/core/run/sandboxed-engine.js +3 -3
- package/dist/core/run/sandboxed-engine.js.map +1 -1
- package/dist/core/universe/builtins/preparation/manifest.json +1 -1
- package/dist/core/universe/builtins/preparation/preparation-bridge.mjs +69 -10
- package/dist/core/universe/builtins/preparation/preparation-verification-fixtures.mjs +68 -9
- package/dist/core/verse/adapters/claude.d.ts +49 -2
- package/dist/core/verse/adapters/claude.js +317 -56
- package/dist/core/verse/adapters/claude.js.map +1 -1
- package/dist/core/verse/adapters/codex.d.ts +81 -5
- package/dist/core/verse/adapters/codex.js +409 -47
- package/dist/core/verse/adapters/codex.js.map +1 -1
- package/dist/core/verse/adapters/grok.d.ts +13 -1
- package/dist/core/verse/adapters/grok.js +28 -2
- package/dist/core/verse/adapters/grok.js.map +1 -1
- package/dist/core/verse/adapters/index.d.ts +32 -0
- package/dist/core/verse/adapters/index.js +2 -0
- package/dist/core/verse/adapters/index.js.map +1 -1
- package/dist/core/verse/codex-rollout.d.ts +284 -0
- package/dist/core/verse/codex-rollout.js +786 -0
- package/dist/core/verse/codex-rollout.js.map +1 -0
- package/dist/core/verse/context-fit.d.ts +63 -0
- package/dist/core/verse/context-fit.js +355 -0
- package/dist/core/verse/context-fit.js.map +1 -0
- package/dist/core/verse/context-math.d.ts +215 -0
- package/dist/core/verse/context-math.js +365 -0
- package/dist/core/verse/context-math.js.map +1 -0
- package/dist/core/verse/local-models.d.ts +137 -1
- package/dist/core/verse/local-models.js +209 -5
- package/dist/core/verse/local-models.js.map +1 -1
- package/dist/core/verse/model-windows.d.ts +217 -0
- package/dist/core/verse/model-windows.js +616 -0
- package/dist/core/verse/model-windows.js.map +1 -0
- package/dist/core/verse/preferences.d.ts +123 -0
- package/dist/core/verse/preferences.js +403 -0
- package/dist/core/verse/preferences.js.map +1 -0
- package/dist/core/verse/project-memory.d.ts +112 -0
- package/dist/core/verse/project-memory.js +295 -0
- package/dist/core/verse/project-memory.js.map +1 -0
- package/dist/core/verse/seats.d.ts +106 -4
- package/dist/core/verse/seats.js +291 -89
- package/dist/core/verse/seats.js.map +1 -1
- package/dist/core/verse/session-engine.d.ts +117 -2
- package/dist/core/verse/session-engine.js +763 -65
- package/dist/core/verse/session-engine.js.map +1 -1
- package/dist/core/verse/session-handoff.d.ts +94 -0
- package/dist/core/verse/session-handoff.js +551 -0
- package/dist/core/verse/session-handoff.js.map +1 -0
- package/dist/core/verse/session-search.d.ts +63 -0
- package/dist/core/verse/session-search.js +213 -0
- package/dist/core/verse/session-search.js.map +1 -0
- package/dist/core/verse/session-store.d.ts +16 -2
- package/dist/core/verse/session-store.js +80 -6
- package/dist/core/verse/session-store.js.map +1 -1
- package/dist/core/verse/types.d.ts +333 -1
- package/dist/core/verse/types.js +54 -2
- package/dist/core/verse/types.js.map +1 -1
- package/dist/core/verse/verse-api.d.ts +40 -5
- package/dist/core/verse/verse-api.js +724 -25
- package/dist/core/verse/verse-api.js.map +1 -1
- package/dist/core/web/api.d.ts +14 -4
- package/dist/core/web/api.js +26 -11
- package/dist/core/web/api.js.map +1 -1
- package/dist/core/web/public/next/assets/{App-vtaHB9mp.js → App-XURmiAAp.js} +5 -5
- package/dist/core/web/public/next/assets/{App-vtaHB9mp.js.map → App-XURmiAAp.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js → ApprovalsSection-BriUzoZc.js} +2 -2
- package/dist/core/web/public/next/assets/{ApprovalsSection-B-bFJ0I9.js.map → ApprovalsSection-BriUzoZc.js.map} +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-C4GBsQVc.js +2 -0
- package/dist/core/web/public/next/assets/{AutonomySection-DoqmsCjw.js.map → AutonomySection-C4GBsQVc.js.map} +1 -1
- package/dist/core/web/public/next/assets/ChatSection-BpOBOUvg.css +1 -0
- package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js +84 -0
- package/dist/core/web/public/next/assets/ChatSection-hlgPBRco.js.map +1 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js +2 -0
- package/dist/core/web/public/next/assets/ConfirmDialog-BdQYI-Ng.js.map +1 -0
- package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js → Dialog-BxdIfmFH.js} +2 -2
- package/dist/core/web/public/next/assets/{Dialog-CPM9JxBc.js.map → Dialog-BxdIfmFH.js.map} +1 -1
- package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js → DiffViewer-DmeRWuc4.js} +2 -2
- package/dist/core/web/public/next/assets/{DiffViewer-B84qVef9.js.map → DiffViewer-DmeRWuc4.js.map} +1 -1
- package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js → McpSection-q34T7Tho.js} +2 -2
- package/dist/core/web/public/next/assets/{McpSection-CEUpV_5X.js.map → McpSection-q34T7Tho.js.map} +1 -1
- package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js → MutationTokenDialog-CFAkwOEt.js} +2 -2
- package/dist/core/web/public/next/assets/{MutationTokenDialog-DA8t97XT.js.map → MutationTokenDialog-CFAkwOEt.js.map} +1 -1
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js → ResourcePoolConsoleApp-DHc8GFOY.js} +4 -4
- package/dist/core/web/public/next/assets/{ResourcePoolConsoleApp-Bq7Vyud0.js.map → ResourcePoolConsoleApp-DHc8GFOY.js.map} +1 -1
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js → RouteErrorBoundary-ZL9F4qUn.js} +2 -2
- package/dist/core/web/public/next/assets/{RouteErrorBoundary-Badio_uO.js.map → RouteErrorBoundary-ZL9F4qUn.js.map} +1 -1
- package/dist/core/web/public/next/assets/{Meter-CLcr-4wS.css → Segmented-8cf0Fypn.css} +1 -1
- package/dist/core/web/public/next/assets/{Meter--h3MmZS-.js → Segmented-DbRjVye3.js} +2 -2
- package/dist/core/web/public/next/assets/Segmented-DbRjVye3.js.map +1 -0
- package/dist/core/web/public/next/assets/SettingsSection-nJGGGYqv.js +2 -0
- package/dist/core/web/public/next/assets/{SettingsSection-BwrpQlpP.js.map → SettingsSection-nJGGGYqv.js.map} +1 -1
- package/dist/core/web/public/next/assets/UniverseConsoleApp-6GJydgo4.js +2 -0
- package/dist/core/web/public/next/assets/{UniverseConsoleApp-_FSohAdN.js.map → UniverseConsoleApp-6GJydgo4.js.map} +1 -1
- package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js → UniverseView-DLDtNYL8.js} +2 -2
- package/dist/core/web/public/next/assets/{UniverseView-DqcXbed4.js.map → UniverseView-DLDtNYL8.js.map} +1 -1
- package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js +2 -0
- package/dist/core/web/public/next/assets/UsageSection-Cf9d9iFH.js.map +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-DsdKQoTH.css +1 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js +3 -0
- package/dist/core/web/public/next/assets/VerseConsoleApp-y0uOHixd.js.map +1 -0
- package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js → charts-CVooqJWN.js} +2 -2
- package/dist/core/web/public/next/assets/{charts-CTZJ-JrH.js.map → charts-CVooqJWN.js.map} +1 -1
- package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js +2 -0
- package/dist/core/web/public/next/assets/context-model-Bqv8DVuH.js.map +1 -0
- package/dist/core/web/public/next/assets/global-eaY9GyX3.js +2 -0
- package/dist/core/web/public/next/assets/global-eaY9GyX3.js.map +1 -0
- package/dist/core/web/public/next/assets/{icons-D9vlf85u.js → icons-vex8rclC.js} +2 -2
- package/dist/core/web/public/next/assets/{icons-D9vlf85u.js.map → icons-vex8rclC.js.map} +1 -1
- package/dist/core/web/public/next/assets/{index-CZamKRUg.js → index-D2Eik-zt.js} +3 -3
- package/dist/core/web/public/next/assets/{index-CZamKRUg.js.map → index-D2Eik-zt.js.map} +1 -1
- package/dist/core/web/public/next/assets/{queries-B8eBnFox.js → queries-bAYU0VNy.js} +2 -2
- package/dist/core/web/public/next/assets/{queries-B8eBnFox.js.map → queries-bAYU0VNy.js.map} +1 -1
- package/dist/core/web/public/next/assets/use-guarded-action-C7QrP7Yp.js +2 -0
- package/dist/core/web/public/next/assets/{use-guarded-action-bzrVVAYq.js.map → use-guarded-action-C7QrP7Yp.js.map} +1 -1
- package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js +2 -0
- package/dist/core/web/public/next/assets/verse-model-TfDk9cky.js.map +1 -0
- package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js → workspace-model-CHol5RVp.js} +2 -2
- package/dist/core/web/public/next/assets/{workspace-model-v0a1gl-C.js.map → workspace-model-CHol5RVp.js.map} +1 -1
- package/dist/core/web/public/next/index.html +1 -1
- package/dist/release-dependency-inventory.json +1 -1
- package/docs/README.md +1 -0
- package/package.json +1 -1
- package/dist/core/web/public/next/assets/AutonomySection-DoqmsCjw.js +0 -2
- package/dist/core/web/public/next/assets/ChatSection-BfnLe5dT.css +0 -1
- package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js +0 -80
- package/dist/core/web/public/next/assets/ChatSection-vNPIJffd.js.map +0 -1
- package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js +0 -2
- package/dist/core/web/public/next/assets/ConfirmDialog-Dd2APQhB.js.map +0 -1
- package/dist/core/web/public/next/assets/Meter--h3MmZS-.js.map +0 -1
- package/dist/core/web/public/next/assets/SettingsSection-BwrpQlpP.js +0 -2
- package/dist/core/web/public/next/assets/UniverseConsoleApp-_FSohAdN.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js +0 -2
- package/dist/core/web/public/next/assets/UsageSection-Bq6Daaby.js.map +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-CMkCizvL.css +0 -1
- package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js +0 -3
- package/dist/core/web/public/next/assets/VerseConsoleApp-CsIQv9id.js.map +0 -1
- package/dist/core/web/public/next/assets/global-D6bTxIRn.js +0 -2
- package/dist/core/web/public/next/assets/global-D6bTxIRn.js.map +0 -1
- package/dist/core/web/public/next/assets/use-guarded-action-bzrVVAYq.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js +0 -2
- package/dist/core/web/public/next/assets/verse-model-CvtK6vP6.js.map +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* core/verse/model-windows.ts — the per-model context budgets every seat is
|
|
3
|
+
* built from (Verse 3.9, owner U4). docs/VERSE-CONTEXT.md §1 is the prose
|
|
4
|
+
* authority; every number below was read from a CLI or a seat's own catalog on
|
|
5
|
+
* 2026-09-23, never recalled.
|
|
6
|
+
*
|
|
7
|
+
* WHY THIS MODULE EXISTS. Until 3.9 every model option carried one number, and
|
|
8
|
+
* for six of the eight Claude models it was wrong: they all inherited the
|
|
9
|
+
* CLI's 200k "unknown model" fallback while the CLI itself ran them at 1M.
|
|
10
|
+
* Codex showed its RAW 272k window while the CLI measures against 95% of it,
|
|
11
|
+
* and Grok showed 256k against a 500k window. So the meter under- or
|
|
12
|
+
* over-read on every native engine. This module is the single place a seat's
|
|
13
|
+
* model list — windows, compaction points, expansive budgets and the binary
|
|
14
|
+
* each model needs — is assembled, and it does the arithmetic ONLY through
|
|
15
|
+
* `context-math.ts`, so "compacts at 367k" can never mean two numbers.
|
|
16
|
+
*
|
|
17
|
+
* SOURCES, in the order a seat prefers them:
|
|
18
|
+
*
|
|
19
|
+
* Claude — the CLI's EMBEDDED catalog (`windowSource: 'cli-catalog'`). There
|
|
20
|
+
* is no per-seat file to read: the served catalog cache carries no windows
|
|
21
|
+
* (`max_input_tokens` absent on every row), so the binary is the authority.
|
|
22
|
+
* The table below is transcribed from the 2.1.257 and 2.1.280 binaries.
|
|
23
|
+
* Codex — the seat's OWN `native-state/models_cache.json`
|
|
24
|
+
* (`provider-catalog`). Catalogs differ per ACCOUNT (codex-b lacks the
|
|
25
|
+
* daybreak slug the global cache has) and per BINARY, so the unpinned
|
|
26
|
+
* `~/.codex` cache is never consulted. No catalog yet → a documented list.
|
|
27
|
+
* Grok — the seat's OWN `native-state/models_cache.json`, whose `.models`
|
|
28
|
+
* is a dict of `{info, api_key, env_key, api_base_url}`. ONLY `.info` is
|
|
29
|
+
* ever read: `api_key` is a credential slot and must not be touched, copied
|
|
30
|
+
* or returned, even though it is null today.
|
|
31
|
+
*
|
|
32
|
+
* Runtime readings (claude/grok `result.modelUsage`, codex rollouts) override
|
|
33
|
+
* all of this per turn — see the session engine. These are the STARTING
|
|
34
|
+
* budgets and the picker's promises, not the last word.
|
|
35
|
+
*
|
|
36
|
+
* Nothing here throws, spends, or reaches the network. File reads are
|
|
37
|
+
* size-capped, symlink-refusing and cached by path + mtime + size.
|
|
38
|
+
*/
|
|
39
|
+
import { type VerseEngine, type VerseModelOption, type VerseWindowSource } from './types.js';
|
|
40
|
+
/**
|
|
41
|
+
* Every Claude model a seat offers, in picker order (first runnable = default).
|
|
42
|
+
*
|
|
43
|
+
* Transcribed from the embedded catalog of Claude Code 2.1.257 and 2.1.280
|
|
44
|
+
* (`context.window`, `context.native_1m`, `max_output_tokens.default`):
|
|
45
|
+
*
|
|
46
|
+
* - `native1m` is the catalog's own `native_1m` flag: the CLI runs these at
|
|
47
|
+
* 1M with no `[1m]` suffix on a first-party seat. Never append `[1m]` to a
|
|
48
|
+
* 200k model — the CLI would then CLAIM 1M for a model that has 200k.
|
|
49
|
+
* - `maxOutputTokens` is the catalog DEFAULT, not the upper bound: it is the
|
|
50
|
+
* number Claude Code reserves from (capped at 20k) when it computes the
|
|
51
|
+
* compaction point, which is all Verse uses it for.
|
|
52
|
+
* - `minCliVersion` is set only where a binary genuinely lacks the id.
|
|
53
|
+
* `claude-opus-5-5` is absent from 2.1.257 (0 occurrences) and present in
|
|
54
|
+
* 2.1.280, and the served catalog cache says `min_claude_code_version:
|
|
55
|
+
* "2.1.280"`. An older binary does not reject it — its id normaliser falls
|
|
56
|
+
* back to `includes('claude-opus-5')` and silently runs Opus 5 — which is
|
|
57
|
+
* why a too-old seat lists it as UNAVAILABLE instead of offering it.
|
|
58
|
+
*
|
|
59
|
+
* The dotted `claude-opus-5.5` Verse once shipped is an ALIAS (context-math
|
|
60
|
+
* `VERSE_MODEL_ID_ALIASES`): on every binary it resolves to Opus 5. It is
|
|
61
|
+
* never offered; old records keep it and adapters send the canonical id.
|
|
62
|
+
*
|
|
63
|
+
* `claude-mythos-5` / `-5-1` are in the catalog too but are deliberately not
|
|
64
|
+
* offered: whether a subscription seat may use them is unverified, and a
|
|
65
|
+
* picker entry is a promise.
|
|
66
|
+
*/
|
|
67
|
+
export declare const VERSE_CLAUDE_MODEL_SPECS: readonly {
|
|
68
|
+
id: string;
|
|
69
|
+
label: string;
|
|
70
|
+
contextWindow: number;
|
|
71
|
+
maxOutputTokens: number | null;
|
|
72
|
+
minCliVersion: string | null;
|
|
73
|
+
native1m: boolean;
|
|
74
|
+
}[];
|
|
75
|
+
type ClaudeModelSpec = (typeof VERSE_CLAUDE_MODEL_SPECS)[number];
|
|
76
|
+
/**
|
|
77
|
+
* The spec for a model id, after alias canonicalisation — so an old session
|
|
78
|
+
* stored as `claude-opus-5.5` finds Opus 5.5's budget. A trailing `[1m]`
|
|
79
|
+
* (which the CLI strips from native-1M ids anyway) is tolerated. Null for an
|
|
80
|
+
* id this table does not know: the caller falls back to the seat, then to
|
|
81
|
+
* `VERSE_DEFAULT_CONTEXT_WINDOWS.claude` — never to a guess.
|
|
82
|
+
*/
|
|
83
|
+
export declare function claudeSpecFor(modelId: string): ClaudeModelSpec | null;
|
|
84
|
+
/**
|
|
85
|
+
* The Claude model list for a seat pinned to `cliVersion`.
|
|
86
|
+
*
|
|
87
|
+
* `cliVersion === null` means UNKNOWN, and unknown is not "too old": no model
|
|
88
|
+
* is marked unavailable on a guess (the seat carries a note instead). Order is
|
|
89
|
+
* the table's; callers put runnable models first.
|
|
90
|
+
*/
|
|
91
|
+
export declare function claudeModelOptions(cliVersion: string | null): VerseModelOption[];
|
|
92
|
+
/** Specs a binary of `cliVersion` is too old for (empty when the version is unknown). */
|
|
93
|
+
export declare function claudeModelsNeedingNewerCli(cliVersion: string | null): ClaudeModelSpec[];
|
|
94
|
+
/** Labels for a note: "Opus 5.5", "Opus 5.5 and Fable 6", "A, B and C". */
|
|
95
|
+
export declare function joinClaudeLabels(specs: readonly ClaudeModelSpec[]): string;
|
|
96
|
+
/**
|
|
97
|
+
* Compare two CLI versions: negative when `a` is older, 0 when equal, positive
|
|
98
|
+
* when newer. Numeric per segment (2.1.280 > 2.1.257 > 2.1.99), and a
|
|
99
|
+
* pre-release sorts before its release (0.155.0-alpha.9 < 0.155.0). Strings
|
|
100
|
+
* with no `x.y.z` in them compare equal to each other and older than any real
|
|
101
|
+
* version — an unparseable version is never allowed to unlock a model.
|
|
102
|
+
*/
|
|
103
|
+
export declare function compareCliVersions(a: string, b: string): number;
|
|
104
|
+
/**
|
|
105
|
+
* The version of the CLI a native profile is pinned to, from the executable
|
|
106
|
+
* path its launcher execs. Never runs the binary (that would be a process
|
|
107
|
+
* spawn on the discovery path, and some CLIs phone home on `--version`).
|
|
108
|
+
*
|
|
109
|
+
* - Claude Code installs each version as a file NAMED by it:
|
|
110
|
+
* `~/.local/share/claude/versions/2.1.257` → `2.1.257`.
|
|
111
|
+
* - Grok's downloads embed it: `grok-0.2.118-macos-aarch64` → `0.2.118`.
|
|
112
|
+
* - The npm codex wrapper is `…/@openai/codex/bin/codex.js`; its version is
|
|
113
|
+
* the package's own `package.json`, read with a size cap.
|
|
114
|
+
*
|
|
115
|
+
* Anything else (e.g. the codex binary inside ChatGPT.app) is null: unknown,
|
|
116
|
+
* which is reported as unknown rather than guessed from a neighbour.
|
|
117
|
+
*/
|
|
118
|
+
export declare function cliVersionFromExecutable(executablePath: string): string | null;
|
|
119
|
+
/** Where Claude Code's installer keeps one file per installed version. */
|
|
120
|
+
export declare function defaultClaudeVersionsRoot(home?: string): string;
|
|
121
|
+
/**
|
|
122
|
+
* The newest Claude Code version installed on this machine, or null. Only
|
|
123
|
+
* regular files named exactly `x.y.z` count — the installer's lock and
|
|
124
|
+
* partial-download files are skipped.
|
|
125
|
+
*/
|
|
126
|
+
export declare function newestInstalledClaudeVersion(root?: string): string | null;
|
|
127
|
+
/** Every catalog read is capped here — codex's is ~350 KB today. */
|
|
128
|
+
export declare const VERSE_CATALOG_MAX_BYTES: number;
|
|
129
|
+
/** Test seam: forget every cached catalog read. */
|
|
130
|
+
export declare function resetModelWindowCaches(): void;
|
|
131
|
+
/** One row of a codex `models_cache.json`, reduced to what budgets need. */
|
|
132
|
+
export interface CodexCatalogEntry {
|
|
133
|
+
slug: string;
|
|
134
|
+
displayName: string | null;
|
|
135
|
+
/** `list`, `hide`, … — `hide` rows are never offered. */
|
|
136
|
+
visibility: string | null;
|
|
137
|
+
/** RAW window the model is configured with by default (272_000). */
|
|
138
|
+
contextWindow: number;
|
|
139
|
+
/** Largest window `model_context_window` may be raised to (872_000); null when absent. */
|
|
140
|
+
maxContextWindow: number | null;
|
|
141
|
+
/** Share of the raw window the CLI measures against (95); null → the documented default. */
|
|
142
|
+
effectiveContextWindowPercent: number | null;
|
|
143
|
+
/** Explicit auto-compaction limit from the catalog; null → 90% of the raw window. */
|
|
144
|
+
autoCompactTokenLimit: number | null;
|
|
145
|
+
priority: number | null;
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* The seat's own codex catalog, or null when it has none yet (a seat that has
|
|
149
|
+
* never run a turn has not fetched one) or it is unreadable. `nativeStatePath`
|
|
150
|
+
* is the seat profile's `CODEX_HOME` — NEVER the unpinned `~/.codex`, whose
|
|
151
|
+
* catalog belongs to a different account and binary.
|
|
152
|
+
*/
|
|
153
|
+
export declare function readCodexCatalog(nativeStatePath: string): CodexCatalogEntry[] | null;
|
|
154
|
+
/**
|
|
155
|
+
* A codex seat's model list: every VISIBLE slug in its own catalog, in the
|
|
156
|
+
* provider's priority order, or the documented list (`windowSource:
|
|
157
|
+
* 'documented'`) when the seat has not fetched a catalog yet.
|
|
158
|
+
*/
|
|
159
|
+
export declare function codexModelOptions(catalog: CodexCatalogEntry[] | null): VerseModelOption[];
|
|
160
|
+
/** One grok catalog row, lifted out of `.models[id].info` and nothing else. */
|
|
161
|
+
export interface GrokCatalogEntry {
|
|
162
|
+
id: string;
|
|
163
|
+
name: string | null;
|
|
164
|
+
contextWindow: number | null;
|
|
165
|
+
autoCompactThresholdPercent: number | null;
|
|
166
|
+
maxCompletionTokens: number | null;
|
|
167
|
+
hidden: boolean;
|
|
168
|
+
supportedInApi: boolean;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* The seat's own grok catalog (`<GROK_HOME>/models_cache.json`), or null. The
|
|
172
|
+
* unpinned `~/.grok` cache is stale on this machine (fetched weeks earlier,
|
|
173
|
+
* two models) and is never consulted.
|
|
174
|
+
*/
|
|
175
|
+
export declare function readGrokCatalog(nativeStatePath: string): GrokCatalogEntry[] | null;
|
|
176
|
+
/**
|
|
177
|
+
* A grok seat's model list: every entry that is not hidden and not flagged
|
|
178
|
+
* unsupported, in the catalog's own order (JSON object order is preserved and
|
|
179
|
+
* is the CLI's), or the documented list when the seat has no catalog. Grok has
|
|
180
|
+
* no expansive mode: its CLI cannot be told a larger budget per invocation.
|
|
181
|
+
*/
|
|
182
|
+
export declare function grokModelOptions(catalog: GrokCatalogEntry[] | null): VerseModelOption[];
|
|
183
|
+
/**
|
|
184
|
+
* A local (Ollama / llama-server) model option. Local turns run the Claude
|
|
185
|
+
* Code binary with `CLAUDE_CODE_MAX_CONTEXT_TOKENS=<window>`, so they compact
|
|
186
|
+
* by the Claude formula over the window Verse resolved; max output is unknown
|
|
187
|
+
* for a non-Claude id, which the formula treats as the 20k reserve cap. No
|
|
188
|
+
* expansive mode: the window IS the runtime's allocation.
|
|
189
|
+
*/
|
|
190
|
+
export declare function localModelOption(tag: string, label: string, window: number, source: VerseWindowSource): VerseModelOption;
|
|
191
|
+
/**
|
|
192
|
+
* The option whose budgets govern a session, given the option its PINNED
|
|
193
|
+
* launch snapshot lists (`snapshot`, null when the snapshot no longer lists
|
|
194
|
+
* the model).
|
|
195
|
+
*
|
|
196
|
+
* Normally the snapshot's own option. The exception is a snapshot written
|
|
197
|
+
* before 3.9: its options carry one flat window and no budgets (claude: the
|
|
198
|
+
* CLI's 200k fallback for every model; codex: the RAW 272k window, which the
|
|
199
|
+
* CLI measures against 95% of; grok: the 500k default), so it can state
|
|
200
|
+
* neither a compaction point nor an expansive budget. For those, the model's
|
|
201
|
+
* DOCUMENTED option from this module supplies the budgets — the same builders
|
|
202
|
+
* the live seat lists are made from, so the web UI (which reads the live seat)
|
|
203
|
+
* and the engine and adapters (which read the snapshot) can never disagree
|
|
204
|
+
* about whether a mode exists or what it costs. The snapshot keeps its identity
|
|
205
|
+
* (id, label); only budgets are borrowed.
|
|
206
|
+
*
|
|
207
|
+
* ONE helper, used by the engine (`effectiveModelOption`) and by every adapter
|
|
208
|
+
* that turns a budget into CLI flags (claude `--autocompact`, codex
|
|
209
|
+
* `-c model_context_window`), because two copies of this rule would drift and
|
|
210
|
+
* the flag the CLI is given must be the budget the meter shows.
|
|
211
|
+
*
|
|
212
|
+
* A model this module does not know keeps its snapshot option (and, lacking an
|
|
213
|
+
* expansive budget, gets no expansive mode — absent, never faked). Local is
|
|
214
|
+
* never substituted.
|
|
215
|
+
*/
|
|
216
|
+
export declare function legacyModelOptionFallback(engine: VerseEngine, model: string, snapshot: VerseModelOption | null): VerseModelOption | null;
|
|
217
|
+
export {};
|