bareloop 0.40.0 → 0.42.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.
Files changed (77) hide show
  1. package/CHANGELOG.md +96 -1
  2. package/README.md +13 -21
  3. package/bareloop.context.md +141 -128
  4. package/package.json +5 -4
  5. package/src/authorflow.js +346 -38
  6. package/src/authoring.js +92 -7
  7. package/src/authorjob.js +82 -20
  8. package/src/authorreadout.js +89 -5
  9. package/src/authorrun.js +39 -30
  10. package/src/authorscout.js +112 -4
  11. package/src/bundle.js +7 -4
  12. package/src/bundlerun.js +4 -1
  13. package/src/cli.js +1 -1
  14. package/src/config.js +129 -29
  15. package/src/declaredclose.js +23 -12
  16. package/src/draftspend.js +4 -4
  17. package/src/facts.js +317 -0
  18. package/src/factwords.js +129 -0
  19. package/src/index.js +2 -4
  20. package/src/inputlook.js +301 -0
  21. package/src/interviewrun.js +17 -25
  22. package/src/job.js +15 -8
  23. package/src/jobblock.js +7 -2
  24. package/src/judged.js +11 -43
  25. package/src/keysfile.js +15 -7
  26. package/src/kinds.js +86 -5
  27. package/src/labelscan.js +170 -0
  28. package/src/modellist.js +84 -0
  29. package/src/monthly.js +23 -43
  30. package/src/pagefetch.js +125 -0
  31. package/src/panel/authorroutes.js +34 -16
  32. package/src/panel/authorsession.js +161 -80
  33. package/src/panel/index.html +553 -152
  34. package/src/panel/jobplan.js +34 -11
  35. package/src/panel/runroutes.js +3 -0
  36. package/src/panel/server.js +54 -18
  37. package/src/panel/settingsroutes.js +232 -173
  38. package/src/planrun.js +5 -4
  39. package/src/providerrows.js +226 -141
  40. package/src/providers.js +58 -332
  41. package/src/providershapes.js +18 -0
  42. package/src/replay.js +1 -1
  43. package/src/rubricstep.js +804 -0
  44. package/src/source.js +166 -1
  45. package/src/thinking.js +130 -0
  46. package/src/u-readout.js +1 -1
  47. package/src/userrun.js +64 -75
  48. package/types/authorflow.d.ts +272 -18
  49. package/types/authoring.d.ts +29 -1
  50. package/types/authorjob.d.ts +9 -7
  51. package/types/authorreadout.d.ts +27 -2
  52. package/types/authorscout.d.ts +72 -2
  53. package/types/config.d.ts +23 -6
  54. package/types/declaredclose.d.ts +4 -2
  55. package/types/draftspend.d.ts +8 -8
  56. package/types/facts.d.ts +71 -0
  57. package/types/factwords.d.ts +42 -0
  58. package/types/index.d.ts +1 -1
  59. package/types/inputlook.d.ts +238 -0
  60. package/types/job.d.ts +5 -5
  61. package/types/jobblock.d.ts +8 -1
  62. package/types/judged.d.ts +5 -36
  63. package/types/keysfile.d.ts +15 -4
  64. package/types/labelscan.d.ts +38 -0
  65. package/types/modellist.d.ts +50 -0
  66. package/types/monthly.d.ts +4 -3
  67. package/types/pagefetch.d.ts +71 -0
  68. package/types/panel/authorsession.d.ts +20 -11
  69. package/types/panel/jobplan.d.ts +12 -4
  70. package/types/panel/server.d.ts +18 -6
  71. package/types/providerrows.d.ts +192 -99
  72. package/types/providers.d.ts +34 -159
  73. package/types/providershapes.d.ts +10 -0
  74. package/types/rubricstep.d.ts +286 -0
  75. package/types/source.d.ts +94 -0
  76. package/types/thinking.d.ts +90 -0
  77. package/types/userrun.d.ts +17 -1
@@ -7,26 +7,26 @@
7
7
  */
8
8
  export function usableKey<T extends string | undefined>(raw: T): T | string;
9
9
  /**
10
- * What a key with no saved entry shows. Any name not listed is OpenAI-compatible with a
11
- * blank URL and a blank Name.
10
+ * The model lines of a row, pure (no I/O, no rewrite of the file). A row WITH `models.<ENV>` uses
11
+ * that list and ignores `keys.<ENV>.{name,priceInPerM,priceOutPerM}`. A row WITHOUT it whose
12
+ * `keys.<ENV>.name` is a non-empty saved string reads as ONE line: ticked when BOTH older prices
13
+ * are finite numbers >= 0 (the line carries them), else UNTICKED with no price (a ticked line
14
+ * needs both prices). A row with no saved name reads as no lines — nothing is carried from a
15
+ * built-in table.
12
16
  * @param {string} envName
13
- * @returns {{ name: string, shape: string, baseUrl: string }}
17
+ * @param {Record<string, any>} config
18
+ * @returns {ModelLine[]}
14
19
  */
15
- export function defaultsFor(envName: string): {
16
- name: string;
17
- shape: string;
18
- baseUrl: string;
19
- };
20
+ export function effectiveModels(envName: string, config: Record<string, any>): ModelLine[];
20
21
  /**
21
- * @typedef {object} KeyRow
22
- * @property {string} envName the key variable NAME (read-only label; never a value)
23
- * @property {string} name the model id Chat uses ('' = not offered in Chat)
24
- * @property {string} provider the `src/providers.js` table entry (the API shape's id)
25
- * @property {string} baseUrl the saved Base URL ('' = the shape's default host)
26
- * @property {unknown} [priceInPerM] the customer's own price, USD per 1M input tokens — carried RAW
27
- * (present only when the config row names it); {@link ratesFor} is the one place that validates it
28
- * @property {unknown} [priceOutPerM] the same, for output tokens
22
+ * Every ticked-and-priced line of the rows, in keys-file order.
23
+ * @param {readonly KeyRow[]} rows
24
+ * @returns {{ row: KeyRow, line: ModelLine }[]}
29
25
  */
26
+ export function tickedLines(rows: readonly KeyRow[]): {
27
+ row: KeyRow;
28
+ line: ModelLine;
29
+ }[];
30
30
  /**
31
31
  * The rows: one per name in `filled`, saved entry over defaults.
32
32
  * @param {{ filled: readonly string[], config: Record<string, any> }} src
@@ -37,20 +37,33 @@ export function keyRows({ filled, config }: {
37
37
  config: Record<string, any>;
38
38
  }): KeyRow[];
39
39
  /**
40
- * The rows for a keys home. `undefined` home (a door that skipped the keys file) = no
41
- * rows, so nothing resolves through the file and the provider's built-in variable stands.
40
+ * The key names that make rows: every key in the keys file with a value (file order), plus — when `env` is given — a key only the
41
+ * SHELL holds that config already names (`keys.<ENV>` or `models.<ENV>`), sorted after them. The page shows such a row as
42
+ * "found in shell"; the run path must resolve it the same way.
43
+ * @param {readonly string[]} filled the keys file's filled names
44
+ * @param {Record<string, any>} config
45
+ * @param {Record<string, string|undefined>} [env] the shell side
46
+ * @returns {string[]}
47
+ */
48
+ export function rowNamesOf(filled: readonly string[], config: Record<string, any>, env?: Record<string, string | undefined>): string[];
49
+ /**
50
+ * The rows for a keys home. `undefined` home (a door that skipped the keys file) = no rows. With `env`, a shell-only key that
51
+ * config names is a row too ({@link rowNamesOf}).
42
52
  * @param {string|undefined} home
53
+ * @param {Record<string, string|undefined>} [env]
43
54
  * @returns {KeyRow[]}
44
55
  */
45
- export function rowsForHome(home: string | undefined): KeyRow[];
56
+ export function rowsForHome(home: string | undefined, env?: Record<string, string | undefined>): KeyRow[];
46
57
  /**
47
- * @param {string} provider
48
- * @returns {string} the shape's default host ('' = the vendor's own)
58
+ * EVERY row a config home names, keyed or not: the keys file's filled names plus every name `keys.<ENV>` / `models.<ENV>` carries. For
59
+ * a readout that must say which variable a model line WOULD read ("KEY is not set in this shell") before any key exists. Never for a run.
60
+ * @param {string|undefined} home
61
+ * @returns {KeyRow[]}
49
62
  */
50
- export function defaultUrlOf(provider: string): string;
63
+ export function namedRowsForHome(home: string | undefined): KeyRow[];
51
64
  /**
52
- * An endpoint in comparable form: blank = the shape's default host; scheme + host lower-cased,
53
- * trailing slashes dropped.
65
+ * An endpoint in comparable form: scheme + host lower-cased, trailing slashes dropped. A blank
66
+ * Base URL is blank — there is no default host.
54
67
  * @param {string} provider
55
68
  * @param {string|null|undefined} baseUrl
56
69
  * @returns {string}
@@ -58,8 +71,7 @@ export function defaultUrlOf(provider: string): string;
58
71
  export function endpointOf(provider: string, baseUrl: string | null | undefined): string;
59
72
  /**
60
73
  * A job's provider in plain words for a refusal line: the host its Base URL points at (else the
61
- * shape's own default host, else the shape's label), plus the model when the spec names one.
62
- * Never a key, a path or a status code.
74
+ * shape's label), plus the model when the spec names one. Never a key, a path or a status code.
63
75
  * @param {{provider?: string, baseUrl?: string|null, model?: string|null}} spec
64
76
  * @returns {string}
65
77
  */
@@ -68,15 +80,10 @@ export function providerInWords(spec: {
68
80
  baseUrl?: string | null;
69
81
  model?: string | null;
70
82
  }): string;
71
- /**
72
- * The URL a row talks to, for display ('' = the vendor's own host, which has no URL to show).
73
- * @param {KeyRow} row
74
- * @returns {string}
75
- */
76
- export function shownUrl(row: KeyRow): string;
77
83
  /**
78
84
  * Which row a `(provider, baseUrl[, model])` identity belongs to: the rows on that shape and
79
- * endpoint; when several share it, the one whose Name is the model, else the first.
85
+ * endpoint; when several share it, the one that HAS a ticked-and-priced line for `model`, else
86
+ * the first.
80
87
  * @param {readonly KeyRow[]} rows
81
88
  * @param {{ provider?: string|null, baseUrl?: string|null, model?: string|null }} id
82
89
  * @returns {KeyRow|null}
@@ -87,56 +94,97 @@ export function findRow(rows: readonly KeyRow[], { provider, baseUrl, model }: {
87
94
  model?: string | null;
88
95
  }): KeyRow | null;
89
96
  /**
90
- * What Chat's Model menu offers and how a pick resolves: the row whose Name is the model
91
- * (a blank Name is never offered). `baseUrl` is absent when blank, exactly as a spec omits it.
97
+ * How a Model-menu pick resolves: the row named by `provider` (its key's env name) with a ticked-and-priced line for `model`.
98
+ * With no `provider` (an older caller) the first row ticking the model. `baseUrl` is absent when blank, exactly as a spec omits it.
99
+ * A model no row ticks, or a row that does not tick it, is `null` — never offered, never run.
92
100
  * @param {readonly KeyRow[]} rows
93
- * @param {string} model
94
- * @returns {{ provider: string, baseUrl?: string, envName: string, name: string }|null}
101
+ * @param {{ provider?: string|null, model?: string|null }} pick `provider` is the KEY's env name
102
+ * @returns {{ provider: string, baseUrl?: string, envName: string, name: string, legacyMaxTokens: boolean }|null}
95
103
  */
96
- export function modelChoiceFor(rows: readonly KeyRow[], model: string): {
104
+ export function modelChoiceFor(rows: readonly KeyRow[], { provider, model }: {
105
+ provider?: string | null;
106
+ model?: string | null;
107
+ }): {
97
108
  provider: string;
98
109
  baseUrl?: string;
99
110
  envName: string;
100
111
  name: string;
112
+ legacyMaxTokens: boolean;
101
113
  } | null;
102
114
  /**
103
- * The models Chat offers, in keys-file order.
115
+ * The lines Chat's Model menu offers: every ticked-and-priced line of the rows, in keys-file order, labelled `<KEY> · <model>`.
104
116
  * @param {readonly KeyRow[]} rows
105
- * @returns {{ id: string, envName: string, shape: string }[]}
117
+ * @returns {{ slot: string, model: string, label: string }[]}
106
118
  */
107
- export function chatModels(rows: readonly KeyRow[]): {
108
- id: string;
109
- envName: string;
110
- shape: string;
119
+ export function chatLines(rows: readonly KeyRow[]): {
120
+ slot: string;
121
+ model: string;
122
+ label: string;
111
123
  }[];
112
124
  /**
113
- * The key variable NAME a job on `(provider, baseUrl[, model])` reads: the matching row's
114
- * variable, else the provider's built-in one (byte-identical to before for anything no row
115
- * claims).
125
+ * Judge a Model-menu pick `{provider, model}` against the rows, for the doors that start a session. `ok:true` carries the choice;
126
+ * otherwise the plain refusal (one of the three sentences).
127
+ * @param {readonly KeyRow[]} rows
128
+ * @param {{ provider?: string|null, model?: string|null }} pick
129
+ * @returns {{ ok: true, choice: NonNullable<ReturnType<typeof modelChoiceFor>> } | { ok: false, say: string }}
130
+ */
131
+ export function judgePick(rows: readonly KeyRow[], pick: {
132
+ provider?: string | null;
133
+ model?: string | null;
134
+ }): {
135
+ ok: true;
136
+ choice: NonNullable<ReturnType<typeof modelChoiceFor>>;
137
+ } | {
138
+ ok: false;
139
+ say: string;
140
+ };
141
+ /**
142
+ * Which Settings line a RUN works on. A spec's own `model` wins; a spec that names none (signed before models were required)
143
+ * takes `--model <id>`; a spec with no `baseUrl` (the same era) matches a row on any endpoint of its shape. `--provider <KEY>`
144
+ * narrows to one key when two keys tick the same id. Pure; the signed spec is never changed, so its hash is untouched.
145
+ * @param {readonly KeyRow[]} rows
146
+ * @param {{ provider?: string|null, baseUrl?: string|null, model?: string|null }} spec the signed spec's worker fields
147
+ * @param {{ model?: string|null, provider?: string|null }} [flags] the operator's `--model` / `--provider`
148
+ * @returns {{ ok: true, row: KeyRow, line: ModelLine, model: string, baseUrl: string|undefined } | { ok: false, say: string }}
149
+ */
150
+ export function resolveWorker(rows: readonly KeyRow[], spec: {
151
+ provider?: string | null;
152
+ baseUrl?: string | null;
153
+ model?: string | null;
154
+ }, flags?: {
155
+ model?: string | null;
156
+ provider?: string | null;
157
+ }): {
158
+ ok: true;
159
+ row: KeyRow;
160
+ line: ModelLine;
161
+ model: string;
162
+ baseUrl: string | undefined;
163
+ } | {
164
+ ok: false;
165
+ say: string;
166
+ };
167
+ /**
168
+ * The key variable NAME a job on `(provider, baseUrl[, model])` reads: the matching row's own env name. There is NO built-in
169
+ * name: no matching row = no key (`name: null`).
116
170
  * @param {string|null|undefined} provider
117
171
  * @param {string|null|undefined} baseUrl
118
172
  * @param {readonly KeyRow[]} rows
119
173
  * @param {string|null|undefined} [model]
120
- * @returns {{ name: string, builtIn: string, chosen: boolean }}
174
+ * @returns {{ name: string|null, chosen: boolean }}
121
175
  */
122
176
  export function keyNameFor(provider: string | null | undefined, baseUrl: string | null | undefined, rows: readonly KeyRow[], model?: string | null | undefined): {
123
- name: string;
124
- builtIn: string;
177
+ name: string | null;
125
178
  chosen: boolean;
126
179
  };
127
180
  /**
128
- * The env a door hands to provider construction, with the matching row's key variable
129
- * standing in for the provider's built-in one: `env[builtIn] = env[row.envName]` (the `null`
130
- * no-key marker becomes {@link NO_KEY_PLACEHOLDER}). A copy — never mutates the input.
131
- * No matching row and no marker = the env unchanged.
181
+ * The key VALUE for a row's env name out of an env (the `null` no-key marker becomes {@link NO_KEY_PLACEHOLDER}); `undefined`
182
+ * when the row's variable is unset or empty.
132
183
  * @param {Record<string,string|undefined>} env
133
- * @param {string|null|undefined} provider
134
- * @param {string|null|undefined} baseUrl
135
- * @param {readonly KeyRow[]} rows
136
- * @param {string|null|undefined} [model]
137
- * @returns {Record<string,string|undefined>}
184
+ * @param {string|null|undefined} envName
185
+ * @returns {string|undefined}
138
186
  */
139
- export function applyConfiguredKey(env: Record<string, string | undefined>, provider: string | null | undefined, baseUrl: string | null | undefined, rows: readonly KeyRow[], model?: string | null | undefined): Record<string, string | undefined>;
187
+ export function keyValueOf(env: Record<string, string | undefined>, envName: string | null | undefined): string | undefined;
140
188
  /**
141
189
  * The one readout line for a resolved customer price, preview and run tail alike:
142
190
  * `yours: in $0.006 / out $1.20 per 1M tokens (DEEPSEEK_API_KEY row)`. A 0 / 0 price is accepted (the price
@@ -150,12 +198,12 @@ export function priceReadout(price: {
150
198
  envName: string;
151
199
  }): string;
152
200
  /**
153
- * The customer's own price for the row a `(provider, baseUrl[, model])` identity belongs to —
154
- * the SAME row match {@link keyNameFor} uses (`findRow`), so the price and the key always come
155
- * from one row. `null` = no price set (the run keeps bare-agent's built-in guess, byte-identical
156
- * to before). Both fields or neither, each a finite number >= 0, USD per 1M tokens; anything
157
- * else throws `ConfigError` naming the row and field — a bad price never silently falls back to
158
- * the guess. `rates` is bare-agent's `Loop({ rates })` shape (USD per 1K); `inPerM`/`outPerM`
201
+ * The customer's own price for the model LINE of the row a `(provider, baseUrl[, model])` identity
202
+ * belongs to — the SAME row match {@link keyNameFor} uses (`findRow`), so the price and the key
203
+ * always come from one row. With a `model`, the row's line of that name; without one, the row's
204
+ * first ticked line. `null` = no price set (the run keeps bare-agent's built-in guess). A line's
205
+ * price is a pair or nothing ({@link modelsProblem} guards the file), so a half price never
206
+ * reaches here. `rates` is bare-agent's `Loop({ rates })` shape (USD per 1K); `inPerM`/`outPerM`
159
207
  * are what a readout prints.
160
208
  * @param {string|null|undefined} provider
161
209
  * @param {string|null|undefined} baseUrl
@@ -173,13 +221,38 @@ export function ratesFor(provider: string | null | undefined, baseUrl: string |
173
221
  envName: string;
174
222
  } | null;
175
223
  /**
176
- * The price a judge's rounds are booked at. A price belongs to the MODEL's row: when the judge is
177
- * the worker's own provider it calls the worker's endpoint, so a row on that endpoint NAMED for the
178
- * judge's model prices it ({@link ratesFor}); a judge model that is absent or names no row there
179
- * keeps the worker's price (the worker's row, or none = the guess). A different provider resolves
180
- * on its own default endpoint, as before. A bad price on the resolved row throws like `ratesFor`.
181
- * The judge's KEY is chosen elsewhere (`applyConfiguredKey`, by the worker's model), so the two
182
- * can come from different rows — same provider + endpoint, judge model naming another row.
224
+ * A model line's own price in bare-agent's shape, or `null` when the line carries none (a price is a pair or nothing).
225
+ * @param {ModelLine} line
226
+ * @returns {{ rates: { in: number, out: number }, inPerM: number, outPerM: number }|null}
227
+ */
228
+ export function ratesOfLine(line: ModelLine): {
229
+ rates: {
230
+ in: number;
231
+ out: number;
232
+ };
233
+ inPerM: number;
234
+ outPerM: number;
235
+ } | null;
236
+ /**
237
+ * The row a judge's key and endpoint come from: the worker's own row when the judge shares the worker's API shape, else the judge
238
+ * shape's row that ticks the judge's model (else the first row of that shape). `null` when no row is on that shape.
239
+ * @param {readonly KeyRow[]} rows
240
+ * @param {{ provider: string, model?: string|null }} judge
241
+ * @param {string|null|undefined} workerProvider
242
+ * @param {KeyRow|null} workerRow
243
+ * @returns {KeyRow|null}
244
+ */
245
+ export function judgeRowFor(rows: readonly KeyRow[], judge: {
246
+ provider: string;
247
+ model?: string | null;
248
+ }, workerProvider: string | null | undefined, workerRow: KeyRow | null): KeyRow | null;
249
+ /**
250
+ * The price a judge's rounds are booked at. A price belongs to the MODEL's line: when the judge is
251
+ * the worker's own provider it calls the worker's endpoint, so a row on that endpoint with a line
252
+ * NAMED for the judge's model prices it ({@link ratesFor}); a judge model that is absent or names
253
+ * no line there keeps the worker's price (the worker's row, or none = the guess). A different
254
+ * provider resolves with no endpoint. The judge's KEY is chosen elsewhere (`applyConfiguredKey`,
255
+ * by the worker's model), so the two can come from different rows.
183
256
  * @param {{ provider: string, model?: string|null }} judge
184
257
  * @param {string|null|undefined} workerProvider
185
258
  * @param {string|null|undefined} workerBaseUrl
@@ -191,52 +264,72 @@ export function judgeRatesFor(judge: {
191
264
  provider: string;
192
265
  model?: string | null;
193
266
  }, workerProvider: string | null | undefined, workerBaseUrl: string | null | undefined, workerPrice: ReturnType<typeof ratesFor>, rows: readonly KeyRow[]): ReturnType<typeof ratesFor>;
194
- /** DeepSeek's OpenAI-shaped endpoint (the same string the panel's Model menu used). */
195
- export const DEEPSEEK_BASE_URL: "https://api.deepseek.com/v1";
196
- /**
197
- * The API shapes the dropdown offers. `id` is the `src/providers.js` table name;
198
- * `defaultUrl` is the host a blank Base URL means ('' = the vendor's own, unshown).
199
- * @type {readonly {id: string, label: string, defaultUrl: string}[]}
200
- */
201
- export const SHAPES: readonly {
202
- id: string;
203
- label: string;
204
- defaultUrl: string;
205
- }[];
206
- /** The five empty lines a fresh keys file is created with, in this order. */
207
- export const PRESET_KEY_NAMES: readonly string[];
208
- /** A local server's default endpoint: Ollama's OpenAI-compatible host (LM Studio / llama.cpp: change the URL). */
209
- export const LOCAL_BASE_URL: "http://127.0.0.1:11434/v1";
267
+ export { SHAPES };
210
268
  /**
211
269
  * A key line whose value is the word `null` is SET and means "no real key": the row exists and
212
270
  * the provider is handed this harmless stand-in (local servers ignore auth). It is not a
213
271
  * secret and is never shown or logged as a key.
214
272
  */
215
273
  export const NO_KEY_PLACEHOLDER: "no-key-needed";
216
- export type KeyRow = {
274
+ export function isTickedLine(l: ModelLine): boolean;
275
+ /** The plain sentence when a stale Chat pick names a key and a model no row ticks (fwd's wording, bareloop's seam). */
276
+ export const REFUSE_NO_TICK: "Tick a model in Settings > Providers. Nothing was spent.";
277
+ export const REFUSE_NO_PICK: "Pick a model. Nothing was spent.";
278
+ export function refuseNotSetUp(key: string): string;
279
+ /**
280
+ * The CLI sentence when a run names no model and the spec carries none (fwd's `pickTicked` sentence).
281
+ */
282
+ export const REFUSE_NAME_MODEL: "Name the model with --model <id>: one ticked in Settings > Providers with both prices.";
283
+ /**
284
+ * one model line of a row (`models.<ENV>` in config.json)
285
+ */
286
+ export type ModelLine = {
217
287
  /**
218
- * the key variable NAME (read-only label; never a value)
288
+ * the model id
289
+ */
290
+ model: string;
291
+ /**
292
+ * ticked = offered in Chat (needs both prices)
219
293
  */
294
+ use: boolean;
295
+ /**
296
+ * the customer's own price, USD per 1M input tokens
297
+ */
298
+ inPerM?: number | undefined;
299
+ /**
300
+ * the same, for output tokens
301
+ */
302
+ outPerM?: number | undefined;
303
+ };
304
+ export type PriceResult = {
305
+ rates: {
306
+ in: number;
307
+ out: number;
308
+ };
309
+ inPerM: number;
310
+ outPerM: number;
220
311
  envName: string;
312
+ } | null;
313
+ export type KeyRow = {
221
314
  /**
222
- * the model id Chat uses ('' = not offered in Chat)
315
+ * the key variable NAME (read-only label; never a value)
223
316
  */
224
- name: string;
317
+ envName: string;
225
318
  /**
226
319
  * the `src/providers.js` table entry (the API shape's id)
227
320
  */
228
321
  provider: string;
229
322
  /**
230
- * the saved Base URL ('' = the shape's default host)
323
+ * the saved Base URL ('' = none typed yet)
231
324
  */
232
325
  baseUrl: string;
233
326
  /**
234
- * the customer's own price, USD per 1M input tokens — carried RAW
235
- * (present only when the config row names it); {@link ratesFor} is the one place that validates it
327
+ * the "old max_tokens" tick (only meaningful on `openai-api`)
236
328
  */
237
- priceInPerM?: unknown;
329
+ legacyMaxTokens: boolean;
238
330
  /**
239
- * the same, for output tokens
331
+ * the row's model lines
240
332
  */
241
- priceOutPerM?: unknown;
333
+ models: ModelLine[];
242
334
  };
335
+ import { SHAPES } from './providershapes.js';