@crossworks/client-types 0.232.39 → 0.232.48

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@crossworks/client-types",
3
- "version": "0.232.39",
3
+ "version": "0.232.48",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -14,6 +14,8 @@
14
14
  * deployment name). Prices are indicative $/M tokens (in · out) — shown to
15
15
  * the user as a class signal, not a quote.
16
16
  */
17
+ import { CURATED_MODEL_POOLS } from './model-pools-data';
18
+
17
19
  export type ModelChoice = {
18
20
  /** OpenRouter model slug (`vendor/model`). */
19
21
  id: string;
@@ -29,8 +31,10 @@ export type ModelChoice = {
29
31
  recommended?: boolean;
30
32
  };
31
33
 
32
- /** Top-tier choices for the assistant (the persona/responder agent). */
33
- export const ASSISTANT_MODEL_CHOICES: readonly ModelChoice[] = [
34
+ /** Hand-curated head of the assistant list — the recommended entry and the
35
+ * azure-capable picks carry policy the curated template can't express. The
36
+ * exported list below extends this with the shipped `agents` pool. */
37
+ const BASE_ASSISTANT_CHOICES: readonly ModelChoice[] = [
34
38
  {
35
39
  id: 'anthropic/claude-sonnet-5',
36
40
  name: 'Claude Sonnet 5',
@@ -66,7 +70,7 @@ export const ASSISTANT_MODEL_CHOICES: readonly ModelChoice[] = [
66
70
  /** Fast/cheap choices for the background workers (indexing pipeline: the
67
71
  * extractor, summarizer, reflector, document reader, and narrator). These
68
72
  * process EVERYTHING the brain ingests, so price and speed dominate. */
69
- export const WORKER_MODEL_CHOICES: readonly ModelChoice[] = [
73
+ const BASE_WORKER_CHOICES: readonly ModelChoice[] = [
70
74
  {
71
75
  id: 'google/gemini-3.1-flash-lite',
72
76
  name: 'Gemini 3.1 Flash Lite',
@@ -100,6 +104,58 @@ export const WORKER_MODEL_CHOICES: readonly ModelChoice[] = [
100
104
  },
101
105
  ];
102
106
 
107
+ // ── Extend the hand-written heads with the shipped curated template ─────────
108
+ // The onboarding step shows (and the API route accepts) the union: policy
109
+ // cards first — recommended + azure flags are hand-set and MUST stay — then
110
+ // every template model not already present, priced from its snapshot. The
111
+ // template ships with the repo (model-pools-data.ts), so new installs offer
112
+ // the full curated range with no network call.
113
+
114
+ function templatePrice(
115
+ p: {
116
+ inputPerM: number | null;
117
+ outputPerM: number | null;
118
+ } | null,
119
+ ): string {
120
+ if (!p || (p.inputPerM == null && p.outputPerM == null)) return 'price varies';
121
+ if (p.inputPerM === 0 && p.outputPerM === 0) return 'Free';
122
+ const f = (v: number | null) => (v == null ? '?' : `$${v}`);
123
+ return `${f(p.inputPerM)} · ${f(p.outputPerM)} /M`;
124
+ }
125
+
126
+ function extendFromPool(pool: string, base: readonly ModelChoice[]): readonly ModelChoice[] {
127
+ const seen = new Set(base.map((c) => c.id));
128
+ const out: ModelChoice[] = [...base];
129
+ for (const e of CURATED_MODEL_POOLS) {
130
+ if (e.pool !== pool) continue;
131
+ const route = e.routes.find((r) => r.provider === 'openrouter');
132
+ if (!route || seen.has(route.model)) continue;
133
+ seen.add(route.model);
134
+ out.push({
135
+ id: route.model,
136
+ name: e.name,
137
+ blurb: e.note
138
+ ? e.note.charAt(0).toUpperCase() + e.note.slice(1)
139
+ : 'From the shipped curated model pool.',
140
+ price: templatePrice(e.pricing),
141
+ });
142
+ }
143
+ return out;
144
+ }
145
+
146
+ /** Top-tier choices for the assistant: policy head + the curated `agents` pool. */
147
+ export const ASSISTANT_MODEL_CHOICES: readonly ModelChoice[] = extendFromPool(
148
+ 'agents',
149
+ BASE_ASSISTANT_CHOICES,
150
+ );
151
+
152
+ /** Fast/cheap worker choices: policy head + the curated `summarizer` pool
153
+ * (the shared workhorse shortlist). */
154
+ export const WORKER_MODEL_CHOICES: readonly ModelChoice[] = extendFromPool(
155
+ 'summarizer',
156
+ BASE_WORKER_CHOICES,
157
+ );
158
+
103
159
  /** Worker kinds the onboarding "worker model" pick applies to — the text
104
160
  * indexing pipeline. Modality workers (tts/stt/vision/image_gen/search)
105
161
  * keep their manifest defaults; they're tuned per-modality in Settings. */