@zhihaohong52/sonata 0.4.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/LICENSE +21 -0
- package/README.md +437 -0
- package/dist/adapters/claude.js +83 -0
- package/dist/adapters/claude.js.map +1 -0
- package/dist/adapters/codex.js +382 -0
- package/dist/adapters/codex.js.map +1 -0
- package/dist/adapters/index.js +21 -0
- package/dist/adapters/index.js.map +1 -0
- package/dist/adapters/opencode.js +104 -0
- package/dist/adapters/opencode.js.map +1 -0
- package/dist/adapters/pi.js +152 -0
- package/dist/adapters/pi.js.map +1 -0
- package/dist/adapters/reasonix.js +358 -0
- package/dist/adapters/reasonix.js.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/agent-markers.js +3 -0
- package/dist/agent-markers.js.map +1 -0
- package/dist/aipricing.js +109 -0
- package/dist/aipricing.js.map +1 -0
- package/dist/catalog.js +274 -0
- package/dist/catalog.js.map +1 -0
- package/dist/cli.js +766 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/approve.js +23 -0
- package/dist/commands/approve.js.map +1 -0
- package/dist/commands/auth.js +41 -0
- package/dist/commands/auth.js.map +1 -0
- package/dist/commands/catalog.js +172 -0
- package/dist/commands/catalog.js.map +1 -0
- package/dist/commands/code.js +113 -0
- package/dist/commands/code.js.map +1 -0
- package/dist/commands/dispatch.js +148 -0
- package/dist/commands/dispatch.js.map +1 -0
- package/dist/commands/doctor.js +545 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/gc.js +25 -0
- package/dist/commands/gc.js.map +1 -0
- package/dist/commands/init-log.js +83 -0
- package/dist/commands/init-log.js.map +1 -0
- package/dist/commands/init.js +157 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/log.js +24 -0
- package/dist/commands/log.js.map +1 -0
- package/dist/commands/route.js +660 -0
- package/dist/commands/route.js.map +1 -0
- package/dist/commands/run.js +199 -0
- package/dist/commands/run.js.map +1 -0
- package/dist/commands/runs.js +37 -0
- package/dist/commands/runs.js.map +1 -0
- package/dist/commands/serve.js +818 -0
- package/dist/commands/serve.js.map +1 -0
- package/dist/commands/status.js +14 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.js +258 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/commands/tail.js +229 -0
- package/dist/commands/tail.js.map +1 -0
- package/dist/commands/usage.js +85 -0
- package/dist/commands/usage.js.map +1 -0
- package/dist/commands/verify.js +69 -0
- package/dist/commands/verify.js.map +1 -0
- package/dist/commands/wait.js +38 -0
- package/dist/commands/wait.js.map +1 -0
- package/dist/config.js +588 -0
- package/dist/config.js.map +1 -0
- package/dist/detect.js +445 -0
- package/dist/detect.js.map +1 -0
- package/dist/filelock.js +83 -0
- package/dist/filelock.js.map +1 -0
- package/dist/init/apply.js +96 -0
- package/dist/init/apply.js.map +1 -0
- package/dist/init/candidates.js +115 -0
- package/dist/init/candidates.js.map +1 -0
- package/dist/init/discover.js +216 -0
- package/dist/init/discover.js.map +1 -0
- package/dist/init/helpers.js +429 -0
- package/dist/init/helpers.js.map +1 -0
- package/dist/init/interactive-state.js +128 -0
- package/dist/init/interactive-state.js.map +1 -0
- package/dist/init/plan.js +225 -0
- package/dist/init/plan.js.map +1 -0
- package/dist/init/scripted-state.js +130 -0
- package/dist/init/scripted-state.js.map +1 -0
- package/dist/init/toml.js +83 -0
- package/dist/init/toml.js.map +1 -0
- package/dist/init/validate.js +149 -0
- package/dist/init/validate.js.map +1 -0
- package/dist/ledger.js +123 -0
- package/dist/ledger.js.map +1 -0
- package/dist/mcp/protocol.js +64 -0
- package/dist/mcp/protocol.js.map +1 -0
- package/dist/mcp/server.js +96 -0
- package/dist/mcp/server.js.map +1 -0
- package/dist/mcp/tools.js +210 -0
- package/dist/mcp/tools.js.map +1 -0
- package/dist/mode.js +64 -0
- package/dist/mode.js.map +1 -0
- package/dist/native/claude-shim.js +228 -0
- package/dist/native/claude-shim.js.map +1 -0
- package/dist/native/codex-auth.js +177 -0
- package/dist/native/codex-auth.js.map +1 -0
- package/dist/native/copilot-auth.js +105 -0
- package/dist/native/copilot-auth.js.map +1 -0
- package/dist/native/credentials.js +83 -0
- package/dist/native/credentials.js.map +1 -0
- package/dist/native/hosts.js +60 -0
- package/dist/native/hosts.js.map +1 -0
- package/dist/native/litellm.js +103 -0
- package/dist/native/litellm.js.map +1 -0
- package/dist/native/models.js +96 -0
- package/dist/native/models.js.map +1 -0
- package/dist/native/oauth-login.js +112 -0
- package/dist/native/oauth-login.js.map +1 -0
- package/dist/native/router.js +469 -0
- package/dist/native/router.js.map +1 -0
- package/dist/native/tls.js +73 -0
- package/dist/native/tls.js.map +1 -0
- package/dist/native/usage.js +119 -0
- package/dist/native/usage.js.map +1 -0
- package/dist/normalize.js +98 -0
- package/dist/normalize.js.map +1 -0
- package/dist/pricing.js +86 -0
- package/dist/pricing.js.map +1 -0
- package/dist/roles.js +49 -0
- package/dist/roles.js.map +1 -0
- package/dist/sessions.js +62 -0
- package/dist/sessions.js.map +1 -0
- package/dist/settings.js +131 -0
- package/dist/settings.js.map +1 -0
- package/dist/store.js +70 -0
- package/dist/store.js.map +1 -0
- package/dist/tmux.js +89 -0
- package/dist/tmux.js.map +1 -0
- package/dist/tui-ink/app-state.js +340 -0
- package/dist/tui-ink/app-state.js.map +1 -0
- package/dist/tui-ink/app.js +156 -0
- package/dist/tui-ink/app.js.map +1 -0
- package/dist/tui-ink/components/byok-step.js +102 -0
- package/dist/tui-ink/components/byok-step.js.map +1 -0
- package/dist/tui-ink/components/login-screen.js +80 -0
- package/dist/tui-ink/components/login-screen.js.map +1 -0
- package/dist/tui-ink/components/models-step.js +92 -0
- package/dist/tui-ink/components/models-step.js.map +1 -0
- package/dist/tui-ink/components/multi-select-state.js +56 -0
- package/dist/tui-ink/components/multi-select-state.js.map +1 -0
- package/dist/tui-ink/components/multi-select.js +69 -0
- package/dist/tui-ink/components/multi-select.js.map +1 -0
- package/dist/tui-ink/components/providers-step.js +285 -0
- package/dist/tui-ink/components/providers-step.js.map +1 -0
- package/dist/tui-ink/components/ranked-select-state.js +41 -0
- package/dist/tui-ink/components/ranked-select-state.js.map +1 -0
- package/dist/tui-ink/components/ranked-select.js +61 -0
- package/dist/tui-ink/components/ranked-select.js.map +1 -0
- package/dist/tui-ink/components/search-select.js +47 -0
- package/dist/tui-ink/components/search-select.js.map +1 -0
- package/dist/tui-ink/components/text-input-state.js +42 -0
- package/dist/tui-ink/components/text-input-state.js.map +1 -0
- package/dist/tui-ink/components/text-input.js +48 -0
- package/dist/tui-ink/components/text-input.js.map +1 -0
- package/dist/tui-ink/run.js +38 -0
- package/dist/tui-ink/run.js.map +1 -0
- package/dist/tui-ink/test-compile.js +4 -0
- package/dist/tui-ink/test-compile.js.map +1 -0
- package/dist/tui-ink/types.js +2 -0
- package/dist/tui-ink/types.js.map +1 -0
- package/dist/tui.js +330 -0
- package/dist/tui.js.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/watchdog.js +85 -0
- package/dist/watchdog.js.map +1 -0
- package/hooks/capture-mode.mjs +56 -0
- package/hooks/ensure-serve.mjs +140 -0
- package/hooks/hooks.json +12 -0
- package/hooks/route-session.mjs +47 -0
- package/hooks/route-subagent.mjs +54 -0
- package/package.json +64 -0
- package/roles/code.md +13 -0
- package/roles/explore.md +9 -0
- package/roles/plan.md +10 -0
- package/roles/review.md +11 -0
- package/skills/loop/SKILL.md +43 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aipricing.js","sourceRoot":"","sources":["../src/aipricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAGlD,MAAM,CAAC,MAAM,cAAc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alog.js
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which models are worth which work.
|
|
3
|
+
*
|
|
4
|
+
* Two data sources feed tier assignment: a small curated table (our own
|
|
5
|
+
* judgement, shipped with sonata) and an optional Artificial Analysis cache
|
|
6
|
+
* the *user* fetched with their own key (`sonata catalog update`). AA's free
|
|
7
|
+
* tier licenses internal use only — no redistribution — so nothing derived
|
|
8
|
+
* from AA data may ever be committed to this repository. The curated table is
|
|
9
|
+
* deliberately hand-written from experience, not from AA numbers.
|
|
10
|
+
*/
|
|
11
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
12
|
+
import { join } from 'node:path';
|
|
13
|
+
export const AA_ATTRIBUTION = 'Model rankings by Artificial Analysis — https://artificialanalysis.ai';
|
|
14
|
+
/** Coding Index at or above this ⇒ complex-eligible. Chosen so today's
|
|
15
|
+
* mid-tier coders (deepseek-v4-flash class) sit just above the line. */
|
|
16
|
+
export const AA_CAPABLE_CODING_INDEX = 40;
|
|
17
|
+
/** Blended $/1M tokens at or below this ⇒ cheap enough for the simple tier. */
|
|
18
|
+
export const AA_CHEAP_BLENDED_PRICE_USD = 1.0;
|
|
19
|
+
/**
|
|
20
|
+
* Capability, best available measure first.
|
|
21
|
+
*
|
|
22
|
+
* Every sonata role — code, review, plan, explore — runs as an agentic
|
|
23
|
+
* subagent driving tools in a loop, so the agentic index describes all four
|
|
24
|
+
* better than a coding or reasoning score does. The fallbacks exist for models
|
|
25
|
+
* AA has not scored agentically and for caches written before it was
|
|
26
|
+
* collected, not as a per-role choice.
|
|
27
|
+
*/
|
|
28
|
+
export function capabilityOf(entry) {
|
|
29
|
+
return entry.agenticIndex ?? entry.codingIndex ?? entry.intelligenceIndex ?? 0;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* What one unit of work costs, best available measure first.
|
|
33
|
+
*
|
|
34
|
+
* `costPerTask` prices the work; the blended per-1M rate only prices tokens
|
|
35
|
+
* and is a weaker proxy, kept for models AA has not costed.
|
|
36
|
+
*/
|
|
37
|
+
export function costOfEntry(entry) {
|
|
38
|
+
return entry.costPerTask ?? entry.blendedPriceUsd;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* A model must reach this fraction of the best score among the *selected*
|
|
42
|
+
* models to be eligible for a simple tier.
|
|
43
|
+
*
|
|
44
|
+
* Relative, not absolute: an absolute floor is wrong in both directions —
|
|
45
|
+
* it excludes everything when a user's whole selection is modest, and admits
|
|
46
|
+
* junk when their selection is strong. The simple tier optimises
|
|
47
|
+
* capability-per-dollar, and without a floor a very cheap, very weak model
|
|
48
|
+
* wins on ratio alone.
|
|
49
|
+
*
|
|
50
|
+
* Set where it is to keep the tier *deep* as well as good. A tier is a ranked
|
|
51
|
+
* fallback list, so a floor strict enough to admit one model leaves the router
|
|
52
|
+
* nothing to fall through to and sends the first failure straight to 529 and
|
|
53
|
+
* the dispatch lane. Measured on a real 17-model config, 0.85 admitted exactly
|
|
54
|
+
* one model where 0.75 admits four.
|
|
55
|
+
*
|
|
56
|
+
* The floor is not only a depth control: it also decides the *leader*, because
|
|
57
|
+
* a model it admits can outrank the others on value. On that same config,
|
|
58
|
+
* raising it to 0.85 excludes the cheapest model and promotes a stronger,
|
|
59
|
+
* dearer one. So it trades capability against both cost and resilience, and
|
|
60
|
+
* moving it changes what grunt work actually runs on — not merely what stands
|
|
61
|
+
* behind that choice.
|
|
62
|
+
*/
|
|
63
|
+
export const SIMPLE_CAPABILITY_FLOOR = 0.75;
|
|
64
|
+
/**
|
|
65
|
+
* The key an AA score is stored and looked up under.
|
|
66
|
+
*
|
|
67
|
+
* AA writes versions with dashes (`glm-5-3`) where sonata, ai-pricing.fyi and
|
|
68
|
+
* every gateway write dots (`glm-5.3`), so a name that is otherwise identical
|
|
69
|
+
* never joins — measured on a real 17-model config, only 3 matched, and the
|
|
70
|
+
* other 14 fell back to a constant rank that made the sort a no-op. Going
|
|
71
|
+
* dots-to-dashes is the safe direction: dashes are load-bearing inside real
|
|
72
|
+
* names (`deepseek-v4-flash`), so the reverse would be ambiguous. Verified
|
|
73
|
+
* collision-free across both catalogs (0 of 258 ai-pricing, 0 of 233 AA).
|
|
74
|
+
*/
|
|
75
|
+
export function aaMatchKey(name) {
|
|
76
|
+
return name.replace(/\./g, '-');
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Collapses the many spellings of one model to a single name: harness and
|
|
80
|
+
* provider prefixes go (`opencode-acme-…`, `openai/…`), and a trailing MMDD
|
|
81
|
+
* date suffix goes (`-0731`). Idempotent, so a normalized name can be
|
|
82
|
+
* normalized again safely.
|
|
83
|
+
*
|
|
84
|
+
* `providers` names the gateways actually configured, and is how a provider
|
|
85
|
+
* sonata has never heard of gets stripped. The built-in list below can only
|
|
86
|
+
* cover providers someone thought to hardcode; every other user's gateway fell
|
|
87
|
+
* through to the `default` catalog entry (capable, not cheap), quietly keeping
|
|
88
|
+
* its models out of the simple tier. Pass the config's gateway names and that
|
|
89
|
+
* stops being a guess.
|
|
90
|
+
*/
|
|
91
|
+
export function normalizeModelName(raw, providers = []) {
|
|
92
|
+
let name = raw.includes('/') ? raw.slice(raw.lastIndexOf('/') + 1) : raw;
|
|
93
|
+
// Sonata keys are exactly `<harness>-<provider>-<model>`, so only the first
|
|
94
|
+
// two segments are ours to remove. A `while` loop re-matches its own output
|
|
95
|
+
// and keeps eating past that structure, corrupting a model whose real name
|
|
96
|
+
// happens to begin with a reserved word (`openai-…`, `pi-…`). So stripping
|
|
97
|
+
// is two ordered passes — at most one harness prefix, then at most one
|
|
98
|
+
// provider prefix — never a loop that can run again.
|
|
99
|
+
const HARNESS_PREFIXES = ['opencode-', 'codex-', 'pi-', 'reasonix-', 'claude-harness-'];
|
|
100
|
+
// Configured gateways first and longest-first, so `openai-codex-x` loses the
|
|
101
|
+
// whole gateway name rather than the shorter `openai-` that also matches.
|
|
102
|
+
const PROVIDER_PREFIXES = [
|
|
103
|
+
...providers.map((provider) => `${provider}-`),
|
|
104
|
+
'openrouter-', 'openai-', 'google-', 'anthropic-',
|
|
105
|
+
].sort((a, b) => b.length - a.length);
|
|
106
|
+
for (const prefix of HARNESS_PREFIXES) {
|
|
107
|
+
if (name.startsWith(prefix) && name.length > prefix.length) {
|
|
108
|
+
name = name.slice(prefix.length);
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
for (const prefix of PROVIDER_PREFIXES) {
|
|
113
|
+
if (name.startsWith(prefix) && name.length > prefix.length) {
|
|
114
|
+
name = name.slice(prefix.length);
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return name.replace(/-\d{4}$/, '');
|
|
119
|
+
}
|
|
120
|
+
/** Our own judgement, not AA data. Kept deliberately small: the default for
|
|
121
|
+
* anything unlisted is capable-not-cheap, the direction that never silently
|
|
122
|
+
* hands hard work to a weak model. */
|
|
123
|
+
const CURATED = {
|
|
124
|
+
'deepseek-v4-flash': { capable: true, cheap: true },
|
|
125
|
+
'deepseek-v4-pro': { capable: true, cheap: false },
|
|
126
|
+
'gpt-5.6-luna': { capable: true, cheap: true },
|
|
127
|
+
'gpt-5.6-terra': { capable: true, cheap: false },
|
|
128
|
+
'gpt-5.6-sol': { capable: true, cheap: false },
|
|
129
|
+
'kimi-k3': { capable: true, cheap: true },
|
|
130
|
+
'kimi-k3-free': { capable: false, cheap: true },
|
|
131
|
+
'glm-5.3': { capable: true, cheap: true },
|
|
132
|
+
'grok-4.6': { capable: true, cheap: false },
|
|
133
|
+
'gemini-3.7-flash': { capable: true, cheap: true },
|
|
134
|
+
'qwen3.8-max': { capable: true, cheap: false },
|
|
135
|
+
'ox-alpha-free': { capable: false, cheap: true },
|
|
136
|
+
};
|
|
137
|
+
export function lookupModel(name, aa, providers = []) {
|
|
138
|
+
const normalized = normalizeModelName(name, providers);
|
|
139
|
+
const scored = aa?.models[normalized] ?? aa?.models[aaMatchKey(normalized)];
|
|
140
|
+
if (scored !== undefined) {
|
|
141
|
+
return {
|
|
142
|
+
capable: scored.codingIndex >= AA_CAPABLE_CODING_INDEX,
|
|
143
|
+
cheap: scored.blendedPriceUsd <= AA_CHEAP_BLENDED_PRICE_USD,
|
|
144
|
+
source: 'aa',
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
const curated = CURATED[normalized];
|
|
148
|
+
if (curated !== undefined)
|
|
149
|
+
return { ...curated, source: 'curated' };
|
|
150
|
+
return { capable: true, cheap: false, source: 'default' };
|
|
151
|
+
}
|
|
152
|
+
/** The AA row behind a model key, joined through the match key. */
|
|
153
|
+
function scoreFor(key, aa, providers = []) {
|
|
154
|
+
const normalized = normalizeModelName(key, providers);
|
|
155
|
+
return aa?.models[normalized] ?? aa?.models[aaMatchKey(normalized)];
|
|
156
|
+
}
|
|
157
|
+
/** Rank for ordering within a tier: the role's AA score when known, else a
|
|
158
|
+
* fixed mid score so curated/default models interleave stably. */
|
|
159
|
+
function rank(key, aa, providers = []) {
|
|
160
|
+
const scored = scoreFor(key, aa, providers);
|
|
161
|
+
return scored !== undefined
|
|
162
|
+
? { index: capabilityOf(scored), price: costOfEntry(scored) }
|
|
163
|
+
: { index: AA_CAPABLE_CODING_INDEX, price: AA_CHEAP_BLENDED_PRICE_USD };
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Capability per dollar — how a simple tier is ordered.
|
|
167
|
+
*
|
|
168
|
+
* A simple tier exists to do grunt work cheaply, so the model that returns the
|
|
169
|
+
* most capability per dollar wins, not the most capable model that happens to
|
|
170
|
+
* clear a price threshold (which is what this used to do, and is backwards for
|
|
171
|
+
* a tier whose whole purpose is cost). Price is floored before dividing so a
|
|
172
|
+
* free model sorts first rather than dividing by zero.
|
|
173
|
+
*/
|
|
174
|
+
function valueOf(r) {
|
|
175
|
+
return r.index / Math.max(r.price, 0.01);
|
|
176
|
+
}
|
|
177
|
+
export function proposeTiers(modelKeys, aa, providers = [], avoided = new Set()) {
|
|
178
|
+
const rankOf = (k) => rank(k, aa, providers);
|
|
179
|
+
// An avoided model sorts after every non-avoided one, whatever it scores.
|
|
180
|
+
// Demotion, not exclusion: the tier keeps it as a fallback candidate, so
|
|
181
|
+
// avoiding a gateway costs preference rather than the depth a ranked list
|
|
182
|
+
// exists to provide.
|
|
183
|
+
const avoidance = (a, b) => Number(avoided.has(a)) - Number(avoided.has(b));
|
|
184
|
+
// Complex work wants the most capable model, cost only breaking ties.
|
|
185
|
+
const byCapability = (a, b) => {
|
|
186
|
+
const ra = rankOf(a);
|
|
187
|
+
const rb = rankOf(b);
|
|
188
|
+
return avoidance(a, b) || rb.index - ra.index || ra.price - rb.price;
|
|
189
|
+
};
|
|
190
|
+
// Simple work wants the most capability per dollar, capability breaking ties.
|
|
191
|
+
const byValue = (a, b) => {
|
|
192
|
+
const ra = rankOf(a);
|
|
193
|
+
const rb = rankOf(b);
|
|
194
|
+
return avoidance(a, b) || valueOf(rb) - valueOf(ra) || rb.index - ra.index;
|
|
195
|
+
};
|
|
196
|
+
const complex = modelKeys.filter((k) => lookupModel(k, aa, providers).capable).sort(byCapability);
|
|
197
|
+
// The floor is relative to the best model actually selected, so it adapts to
|
|
198
|
+
// the user's own set rather than to an absolute score that is wrong whenever
|
|
199
|
+
// their selection is uniformly strong or uniformly modest.
|
|
200
|
+
// Measured over the models that can actually lead the tier: including an
|
|
201
|
+
// avoided model here could raise the bar high enough to exclude everything
|
|
202
|
+
// preferred, inverting the setting's intent.
|
|
203
|
+
const preferred = modelKeys.filter((k) => !avoided.has(k));
|
|
204
|
+
const best = Math.max(0, ...(preferred.length > 0 ? preferred : modelKeys).map((k) => rankOf(k).index));
|
|
205
|
+
const simple = modelKeys
|
|
206
|
+
.filter((k) => {
|
|
207
|
+
const e = lookupModel(k, aa, providers);
|
|
208
|
+
return e.capable && e.cheap && rankOf(k).index >= best * SIMPLE_CAPABILITY_FLOOR;
|
|
209
|
+
})
|
|
210
|
+
.sort(byValue);
|
|
211
|
+
// A tier must always resolve to something: with no capable model, everything
|
|
212
|
+
// is complex-eligible; with no cheap-capable model, simple mirrors complex.
|
|
213
|
+
// The fallback is sorted too — raw input order would break the documented
|
|
214
|
+
// "index descending, price ascending" ordering on exactly the path where no
|
|
215
|
+
// model cleared the threshold.
|
|
216
|
+
const complexFinal = complex.length > 0 ? complex : [...modelKeys].sort(byCapability);
|
|
217
|
+
// Falls back to the complex set, but re-sorted by value: the reason to
|
|
218
|
+
// fall back is that nothing cleared the cheap bar, not that cost stopped
|
|
219
|
+
// mattering for grunt work.
|
|
220
|
+
const simpleFinal = simple.length > 0 ? simple : [...complexFinal].sort(byValue);
|
|
221
|
+
return { simple: simpleFinal, complex: complexFinal };
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* How long a ranking cache stays trustworthy.
|
|
225
|
+
*
|
|
226
|
+
* Not a correctness bound — a stale catalog still ranks — but model releases
|
|
227
|
+
* and price cuts land continuously, so an old one silently proposes tiers
|
|
228
|
+
* built on superseded scores. Thirty days is long enough not to nag and short
|
|
229
|
+
* enough that a whole model generation cannot pass unnoticed.
|
|
230
|
+
*/
|
|
231
|
+
export const AA_CATALOG_MAX_AGE_DAYS = 30;
|
|
232
|
+
/** Whole days since a catalog was fetched, or undefined if the stamp is unreadable. */
|
|
233
|
+
export function aaCatalogAgeDays(fetchedAt, now) {
|
|
234
|
+
const at = Date.parse(fetchedAt);
|
|
235
|
+
if (!Number.isFinite(at))
|
|
236
|
+
return undefined;
|
|
237
|
+
// A stamp from the future is a clock disagreement, not freshness to report
|
|
238
|
+
// as negative age; treat it as current.
|
|
239
|
+
return Math.max(0, Math.floor((now.getTime() - at) / 86_400_000));
|
|
240
|
+
}
|
|
241
|
+
export function aaCatalogPath(home) {
|
|
242
|
+
return join(home, '.config', 'sonata', 'catalog.json');
|
|
243
|
+
}
|
|
244
|
+
export function loadAaCatalog(home) {
|
|
245
|
+
const path = aaCatalogPath(home);
|
|
246
|
+
if (!existsSync(path))
|
|
247
|
+
return undefined;
|
|
248
|
+
try {
|
|
249
|
+
const doc = JSON.parse(readFileSync(path, 'utf8'));
|
|
250
|
+
if (typeof doc.fetchedAt !== 'string' || typeof doc.models !== 'object' || doc.models === null)
|
|
251
|
+
return undefined;
|
|
252
|
+
// Validate each entry, not just the top level: a missing, null, string or
|
|
253
|
+
// non-finite score passes the shape check and then misclassifies the model
|
|
254
|
+
// (`undefined >= 40` is `false`, silently "not capable"). A partially-
|
|
255
|
+
// corrupt cache is still useful, so drop the bad entries and keep the good;
|
|
256
|
+
// degrade to no cache only when nothing survives.
|
|
257
|
+
const models = {};
|
|
258
|
+
for (const [name, entry] of Object.entries(doc.models)) {
|
|
259
|
+
if (entry !== null &&
|
|
260
|
+
typeof entry === 'object' &&
|
|
261
|
+
Number.isFinite(entry.codingIndex) &&
|
|
262
|
+
Number.isFinite(entry.blendedPriceUsd)) {
|
|
263
|
+
models[name] = entry;
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
if (Object.keys(models).length === 0)
|
|
267
|
+
return undefined;
|
|
268
|
+
return { fetchedAt: doc.fetchedAt, models };
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
return undefined;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
//# sourceMappingURL=catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog.js","sourceRoot":"","sources":["../src/catalog.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GACzB,uEAAuE,CAAC;AAE1E;wEACwE;AACxE,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,+EAA+E;AAC/E,MAAM,CAAC,MAAM,0BAA0B,GAAG,GAAG,CAAC;AAmC9C;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,KAAc;IACz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