narrarium-engine 0.1.7 → 0.1.8

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 (78) hide show
  1. package/README.md +185 -13
  2. package/dist/ai/body.d.ts +20 -0
  3. package/dist/ai/body.d.ts.map +1 -0
  4. package/dist/ai/body.js +112 -0
  5. package/dist/ai/body.js.map +1 -0
  6. package/dist/ai/catalog-fetch.d.ts +51 -0
  7. package/dist/ai/catalog-fetch.d.ts.map +1 -0
  8. package/dist/ai/catalog-fetch.js +260 -0
  9. package/dist/ai/catalog-fetch.js.map +1 -0
  10. package/dist/ai/catalog-support.d.ts +13 -0
  11. package/dist/ai/catalog-support.d.ts.map +1 -0
  12. package/dist/ai/catalog-support.js +28 -0
  13. package/dist/ai/catalog-support.js.map +1 -0
  14. package/dist/ai/catalog.d.ts +148 -0
  15. package/dist/ai/catalog.d.ts.map +1 -0
  16. package/dist/ai/catalog.js +367 -0
  17. package/dist/ai/catalog.js.map +1 -0
  18. package/dist/ai/config.d.ts +83 -7
  19. package/dist/ai/config.d.ts.map +1 -1
  20. package/dist/ai/config.js +83 -11
  21. package/dist/ai/config.js.map +1 -1
  22. package/dist/ai/fetch-client.d.ts +20 -0
  23. package/dist/ai/fetch-client.d.ts.map +1 -1
  24. package/dist/ai/fetch-client.js +49 -24
  25. package/dist/ai/fetch-client.js.map +1 -1
  26. package/dist/ai/probe.d.ts +40 -0
  27. package/dist/ai/probe.d.ts.map +1 -0
  28. package/dist/ai/probe.js +110 -0
  29. package/dist/ai/probe.js.map +1 -0
  30. package/dist/ai/request.d.ts +58 -5
  31. package/dist/ai/request.d.ts.map +1 -1
  32. package/dist/ai/request.js +96 -7
  33. package/dist/ai/request.js.map +1 -1
  34. package/dist/ai/router.d.ts +12 -1
  35. package/dist/ai/router.d.ts.map +1 -1
  36. package/dist/ai/router.js +10 -2
  37. package/dist/ai/router.js.map +1 -1
  38. package/dist/ai/routing.d.ts +15 -4
  39. package/dist/ai/routing.d.ts.map +1 -1
  40. package/dist/ai/routing.js +25 -6
  41. package/dist/ai/routing.js.map +1 -1
  42. package/dist/ai/token-limit.d.ts +4 -4
  43. package/dist/ai/token-limit.d.ts.map +1 -1
  44. package/dist/ai/token-limit.js +5 -4
  45. package/dist/ai/token-limit.js.map +1 -1
  46. package/dist/ai/types.d.ts +12 -1
  47. package/dist/ai/types.d.ts.map +1 -1
  48. package/dist/ai/types.js +12 -0
  49. package/dist/ai/types.js.map +1 -1
  50. package/dist/autopilot/errors.d.ts +4 -3
  51. package/dist/autopilot/errors.d.ts.map +1 -1
  52. package/dist/autopilot/errors.js +21 -5
  53. package/dist/autopilot/errors.js.map +1 -1
  54. package/dist/autopilot/runner.d.ts.map +1 -1
  55. package/dist/autopilot/runner.js +21 -4
  56. package/dist/autopilot/runner.js.map +1 -1
  57. package/dist/autopilot/session.js +1 -1
  58. package/dist/autopilot/session.js.map +1 -1
  59. package/dist/autopilot/state.d.ts +4 -3
  60. package/dist/autopilot/state.d.ts.map +1 -1
  61. package/dist/autopilot/state.js +35 -9
  62. package/dist/autopilot/state.js.map +1 -1
  63. package/dist/autopilot/tasks.js +2 -2
  64. package/dist/autopilot/tasks.js.map +1 -1
  65. package/dist/autopilot/types.d.ts +27 -5
  66. package/dist/autopilot/types.d.ts.map +1 -1
  67. package/dist/autopilot/types.js +1 -1
  68. package/dist/autopilot/types.js.map +1 -1
  69. package/dist/index.d.ts +3 -0
  70. package/dist/index.d.ts.map +1 -1
  71. package/dist/index.js +3 -0
  72. package/dist/index.js.map +1 -1
  73. package/dist/server/protocol.d.ts +6 -1
  74. package/dist/server/protocol.d.ts.map +1 -1
  75. package/dist/server/protocol.js.map +1 -1
  76. package/dist/version.d.ts +1 -1
  77. package/dist/version.js +1 -1
  78. package/package.json +1 -1
@@ -0,0 +1,367 @@
1
+ // What an endpoint says of its models, read from the three places a gateway like LlmProxy says it (and from LM Studio's own list). Pure: no I/O, no clock.
2
+ // Everything that comes in is data from a server nobody vouches for: it is bounded, validated field by field, never trusted for what it is called, and
3
+ // never quoted in an error. The limits are those of BookWriter (`fetchModels` and `tokenLimitsFromDetails`: 2000 models, 256 characters, windows from 256 to
4
+ // 10 000 000 tokens) and, for LM Studio's list, those of its `lmstudio-models.ts` (500 models, 200 characters).
5
+ /** The most models a list may hold: a longer one is refused (`GET /models`) or cut here (`/models/details`, `/modalities`). */
6
+ export const CATALOG_MAX_MODELS = 2_000;
7
+ /** The longest id of a model. */
8
+ export const CATALOG_MAX_ID_LENGTH = 256;
9
+ /** A window or an answer that is declared is a whole number of tokens within these limits; anything else is not declared. */
10
+ export const CATALOG_MIN_TOKENS = 256;
11
+ export const CATALOG_MAX_TOKENS = 10_000_000;
12
+ /** LM Studio's list: how many models and how long a key are read. */
13
+ export const LMSTUDIO_MAX_MODELS = 500;
14
+ export const LMSTUDIO_MAX_KEY_LENGTH = 200;
15
+ const MAX_MODALITY_GROUPS = 32;
16
+ const MAX_MODALITIES = 16;
17
+ const MAX_MODALITY_LENGTH = 32;
18
+ const MAX_ENDPOINTS = 16;
19
+ const MAX_ENDPOINT_LENGTH = 120;
20
+ const MAX_LOADED_INSTANCES = 16;
21
+ const MAX_MODEL_COUNT = 1_000_000;
22
+ /** A list that claims more entries than this is read only as far as it is needed: an array this long costs nothing to ask for its length, and a lot to walk. */
23
+ const MAX_WALKED = 4 * CATALOG_MAX_MODELS;
24
+ const FORBIDDEN = new Set(["__proto__", "constructor", "prototype"]);
25
+ const CONTROL = /[\u0000-\u001f\u007f-\u009f]/;
26
+ const MODALITY_WORD = /^[a-z0-9_-]{1,32}$/;
27
+ /**
28
+ * The models of an endpoint could not be read, or what it sent is not a catalog. The message is in English, says why and what to do, and never quotes
29
+ * what the endpoint sent or the key that was used. `status` is the HTTP status, for the reasons that come from one.
30
+ */
31
+ export class AiCatalogError extends Error {
32
+ reason;
33
+ status;
34
+ constructor(message, reason, status) {
35
+ super(message);
36
+ this.reason = reason;
37
+ this.status = status;
38
+ this.name = "AiCatalogError";
39
+ }
40
+ }
41
+ const NOT_A_LIST = "The answer is not a list of models in the OpenAI format ({\"data\": [{\"id\": …}]}). Check that the address is the API base (for example …/v1), or enter the model names by hand.";
42
+ const EMPTY_LIST = "The list of models is empty. If this is a gateway, start a model there (a model that is stopped is not listed), or enter the model names by hand.";
43
+ const LONG_LIST = `The list has more than ${CATALOG_MAX_MODELS} models: it is too large to be read. Enter the model names by hand.`;
44
+ const PAGED_LIST = "The list of models comes in pages and only the first one was sent, so it cannot be read whole. Enter the model names by hand.";
45
+ const invalid = () => new AiCatalogError(NOT_A_LIST, "invalid");
46
+ // ─── Reading what is untrusted ──────────────────────────────────────────────
47
+ function isRecord(value) {
48
+ return typeof value === "object" && value !== null && !Array.isArray(value);
49
+ }
50
+ /** An id as it is kept: a text with no spaces at its edges, no control character, not too long, and not the name of a prototype. */
51
+ function validId(value, longest = CATALOG_MAX_ID_LENGTH) {
52
+ return typeof value === "string" && value.length > 0 && value.length <= longest && value === value.trim() && !CONTROL.test(value) && !FORBIDDEN.has(value);
53
+ }
54
+ function tokenCount(value) {
55
+ return typeof value === "number" && Number.isSafeInteger(value) && value >= CATALOG_MIN_TOKENS && value <= CATALOG_MAX_TOKENS ? value : undefined;
56
+ }
57
+ /** The `data` of a list as OpenAI writes it. Anything that is not an object with an array in it is not a list. */
58
+ function listOf(payload) {
59
+ if (!isRecord(payload))
60
+ throw invalid();
61
+ const data = payload.data;
62
+ if (!Array.isArray(data))
63
+ throw invalid();
64
+ return data;
65
+ }
66
+ /** Runs a parser of one entry: whatever the entry is (a proxy, a getter that throws), the answer is "it is not an entry". */
67
+ function guarded(read) {
68
+ try {
69
+ return read();
70
+ }
71
+ catch {
72
+ return undefined;
73
+ }
74
+ }
75
+ // ─── What a model is ────────────────────────────────────────────────────────
76
+ /** The kinds of model a gateway tells apart (LlmProxy: `GET /v1/models/details`, `GET /v1/modalities`). */
77
+ export const AI_MODEL_TYPES = ["chat", "image", "speech", "transcription", "embedding", "realtime", "classifier"];
78
+ function typeOf(value) {
79
+ if (typeof value !== "string")
80
+ return "unknown";
81
+ const word = value.trim().toLowerCase();
82
+ return AI_MODEL_TYPES.includes(word) ? word : "unknown";
83
+ }
84
+ /** A list of modalities: short lower-case words, a few of them, each once. `undefined` when there is none. */
85
+ function modalitiesOf(value) {
86
+ if (!Array.isArray(value))
87
+ return undefined;
88
+ const words = [];
89
+ for (let index = 0; index < Math.min(value.length, MAX_WALKED) && words.length < MAX_MODALITIES; index += 1) {
90
+ const raw = value[index];
91
+ if (typeof raw !== "string")
92
+ continue;
93
+ const word = raw.trim().toLowerCase();
94
+ if (MODALITY_WORD.test(word) && word.length <= MAX_MODALITY_LENGTH && !FORBIDDEN.has(word) && !words.includes(word))
95
+ words.push(word);
96
+ }
97
+ return words.length ? words : undefined;
98
+ }
99
+ /** The paths a type of model is called at: short, starting with a slash, no space or control character, a few of them, each once. */
100
+ function endpointsOf(value) {
101
+ if (!Array.isArray(value))
102
+ return [];
103
+ const paths = [];
104
+ for (let index = 0; index < Math.min(value.length, MAX_WALKED) && paths.length < MAX_ENDPOINTS; index += 1) {
105
+ const raw = value[index];
106
+ if (typeof raw === "string" && raw.startsWith("/") && raw.length <= MAX_ENDPOINT_LENGTH && !/[\s\u0000-\u001f\u007f-\u009f]/.test(raw) && !paths.includes(raw))
107
+ paths.push(raw);
108
+ }
109
+ return paths;
110
+ }
111
+ function capabilitiesOf(value) {
112
+ if (!isRecord(value))
113
+ return {};
114
+ const streaming = value.streaming;
115
+ const tools = value.tools;
116
+ const vision = value.vision;
117
+ const reasoning = value.reasoning;
118
+ return {
119
+ ...(typeof streaming === "boolean" ? { streaming } : {}),
120
+ ...(typeof tools === "boolean" ? { tools } : {}),
121
+ ...(typeof vision === "boolean" ? { vision } : {}),
122
+ ...(typeof reasoning === "boolean" ? { reasoning } : {}),
123
+ };
124
+ }
125
+ /** One entry of `/models/details`, or of a `/modalities` group (whose type a model without one takes). */
126
+ function entryOf(raw, groupType) {
127
+ if (!isRecord(raw))
128
+ return undefined;
129
+ const id = raw.id;
130
+ if (!validId(id))
131
+ return undefined;
132
+ const own = typeOf(raw.type);
133
+ const type = own === "unknown" && groupType ? groupType : own;
134
+ const contextWindow = tokenCount(raw.context_window);
135
+ const maxOutputTokens = tokenCount(raw.max_output_tokens);
136
+ const inputModalities = modalitiesOf(raw.input_modalities);
137
+ const outputModalities = modalitiesOf(raw.output_modalities);
138
+ return {
139
+ id,
140
+ type,
141
+ ...(contextWindow !== undefined ? { contextWindow } : {}),
142
+ ...(maxOutputTokens !== undefined ? { maxOutputTokens } : {}),
143
+ ...(inputModalities ? { inputModalities } : {}),
144
+ ...(outputModalities ? { outputModalities } : {}),
145
+ capabilities: capabilitiesOf(raw.capabilities),
146
+ };
147
+ }
148
+ /** The entries of a list, the first of each id, at most `CATALOG_MAX_MODELS` of the entries that were sent. What is no entry is left out. */
149
+ function entriesOf(data, groupType) {
150
+ const entries = [];
151
+ if (!Array.isArray(data))
152
+ return entries;
153
+ const seen = new Set();
154
+ for (let index = 0; index < Math.min(data.length, CATALOG_MAX_MODELS); index += 1) {
155
+ const entry = guarded(() => entryOf(data[index], groupType));
156
+ if (!entry || seen.has(entry.id))
157
+ continue;
158
+ seen.add(entry.id);
159
+ entries.push(entry);
160
+ }
161
+ return entries;
162
+ }
163
+ // ─── GET /models ────────────────────────────────────────────────────────────
164
+ /**
165
+ * The ids of an OpenAI `GET /models` list, sorted and without repeats. It is all or nothing, as BookWriter reads it: a payload that is not a list, an
166
+ * entry that is not an object with a good id, a list with nothing in it or with more than `CATALOG_MAX_MODELS` models is an `AiCatalogError`, so that
167
+ * an answer that is wrong never replaces a catalog that was right. So is a list that says it goes on (`has_more: true`, the pagination of OpenAI-style
168
+ * lists, which Anthropic's `/v1/models` uses: 20 to a page): its first page is not the catalog, and nothing here follows the pages. The error never
169
+ * quotes the payload.
170
+ */
171
+ export function parseModelList(payload) {
172
+ try {
173
+ const data = listOf(payload);
174
+ if (payload.has_more === true)
175
+ throw new AiCatalogError(PAGED_LIST, "too-large");
176
+ if (data.length === 0)
177
+ throw new AiCatalogError(EMPTY_LIST, "empty");
178
+ if (data.length > CATALOG_MAX_MODELS)
179
+ throw new AiCatalogError(LONG_LIST, "too-large");
180
+ const ids = new Set();
181
+ for (const entry of data) {
182
+ const id = isRecord(entry) ? entry.id : undefined;
183
+ if (!validId(id))
184
+ throw invalid();
185
+ ids.add(id);
186
+ }
187
+ return [...ids].sort();
188
+ }
189
+ catch (error) {
190
+ throw error instanceof AiCatalogError ? error : invalid();
191
+ }
192
+ }
193
+ // ─── GET /models/details ────────────────────────────────────────────────────
194
+ /**
195
+ * The models of LlmProxy's `GET /models/details`, in the order received: for each, its kind, the window and the answer it declares, what it accepts
196
+ * and returns, and what it can do. What is `null`, out of scale, or not what it should be is absent; an entry that cannot be one is left out; at most
197
+ * `CATALOG_MAX_MODELS` entries are read. A payload that is not a list is an `AiCatalogError`; a list with nothing in it is a list with nothing in it.
198
+ */
199
+ export function parseModelDetails(payload) {
200
+ let data;
201
+ try {
202
+ data = listOf(payload);
203
+ }
204
+ catch {
205
+ throw invalid();
206
+ }
207
+ return entriesOf(data);
208
+ }
209
+ // ─── GET /modalities ────────────────────────────────────────────────────────
210
+ /**
211
+ * What LlmProxy's `GET /modalities` says: for each way of use, in the order the gateway lists them, the paths it is called at, what its models
212
+ * accept and return together, and the models that run for it. A model with no kind of its own is of the kind of its group. At most 32 groups, and
213
+ * `CATALOG_MAX_MODELS` models in each, are read. A payload that is not a list is an `AiCatalogError`.
214
+ */
215
+ export function parseModalities(payload) {
216
+ let data;
217
+ try {
218
+ data = listOf(payload);
219
+ }
220
+ catch {
221
+ throw invalid();
222
+ }
223
+ const groups = [];
224
+ for (let index = 0; index < Math.min(data.length, MAX_WALKED) && groups.length < MAX_MODALITY_GROUPS; index += 1) {
225
+ const group = guarded(() => {
226
+ const raw = data[index];
227
+ if (!isRecord(raw))
228
+ return undefined;
229
+ const type = typeOf(raw.type);
230
+ const models = entriesOf(raw.models, type);
231
+ const count = raw.model_count;
232
+ const modelCount = typeof count === "number" && Number.isSafeInteger(count) && count >= 0 && count <= MAX_MODEL_COUNT ? count : models.length;
233
+ const inputModalities = modalitiesOf(raw.input_modalities);
234
+ const outputModalities = modalitiesOf(raw.output_modalities);
235
+ return {
236
+ type,
237
+ endpoints: endpointsOf(raw.endpoints),
238
+ ...(inputModalities ? { inputModalities } : {}),
239
+ ...(outputModalities ? { outputModalities } : {}),
240
+ modelCount,
241
+ models,
242
+ };
243
+ });
244
+ if (group)
245
+ groups.push(group);
246
+ }
247
+ return groups;
248
+ }
249
+ /**
250
+ * BookWriter's formula (`tokenLimitsFromDetails`): the input is the window minus the answer the model declares, or, when it declares none, minus a
251
+ * quarter of the window up to 4096; an answer with no window is only the answer; an answer that is not smaller than its window is not believed; and an
252
+ * input that is not a usable number of tokens (it would be 0 or negative, or under 256) is not said.
253
+ *
254
+ * Mind what it is: BookWriter's `inputTokens` is what is left for the prompt once the answer is taken off. The engine's `maxInputTokens` is the window
255
+ * itself (the engine takes the answer and a safety margin off it when it judges a prompt), so it is the declared `contextWindow` that goes there,
256
+ * never this number: use `modelFieldsFromCatalogEntry`, which does.
257
+ */
258
+ export function tokenLimitsFromDetails(entry) {
259
+ const source = isRecord(entry) ? entry : {};
260
+ const window = tokenCount(source.contextWindow);
261
+ const answer = tokenCount(source.maxOutputTokens);
262
+ const output = answer !== undefined && (window === undefined || answer < window) ? answer : undefined;
263
+ const input = window === undefined ? undefined : window - (output ?? Math.min(4096, Math.floor(window / 4)));
264
+ return {
265
+ ...(input !== undefined && tokenCount(input) !== undefined ? { inputTokens: input } : {}),
266
+ ...(output !== undefined ? { outputTokens: output } : {}),
267
+ };
268
+ }
269
+ /**
270
+ * What a gateway declares of a model, as fields of the model in the configuration, for the models of kind `chat`. Only what is declared is said:
271
+ * the context window is `maxInputTokens` (the window, not BookWriter's input: see `tokenLimitsFromDetails`), the answer is `maxOutputTokens` (when it fits the
272
+ * window), and a capability is said only when it is `true`. A capability that is `false` is what LlmProxy sends for everything its administrator has not
273
+ * declared, so it is never turned into a restriction (a model that streams, with the box not ticked, must go on streaming); and an id that only
274
+ * `/models` listed says nothing at all. The author's own values are kept by the caller: `{ ...model, ...fields }` lets the gateway's declarations win for
275
+ * what it declares, and leaves the rest as it is.
276
+ */
277
+ export function modelFieldsFromCatalogEntry(entry) {
278
+ const source = isRecord(entry) ? entry : {};
279
+ const window = tokenCount(source.contextWindow);
280
+ const { outputTokens } = tokenLimitsFromDetails(entry);
281
+ const capabilities = capabilitiesOf(source.capabilities);
282
+ return {
283
+ ...(window !== undefined ? { maxInputTokens: window } : {}),
284
+ ...(outputTokens !== undefined ? { maxOutputTokens: outputTokens } : {}),
285
+ ...(capabilities.tools === true ? { supportsToolCalls: true } : {}),
286
+ ...(capabilities.streaming === true ? { supportsStreaming: true } : {}),
287
+ ...(capabilities.reasoning === true ? { supportsReasoning: true } : {}),
288
+ ...(capabilities.vision === true ? { supportsVision: true } : {}),
289
+ };
290
+ }
291
+ const THINKING_LEVELS = ["low", "medium", "high", "xhigh"];
292
+ /**
293
+ * The language models (`type: "llm"`) of LM Studio's `GET /api/v1/models`, as BookWriter reads them: the thinking levels each declares
294
+ * (`capabilities.reasoning.allowed_options`, of which only low, medium, high and xhigh are levels), its default, the context it supports and the one
295
+ * it loaded. At most `LMSTUDIO_MAX_MODELS` entries are read. A payload that is not a list of models is an `AiCatalogError`.
296
+ */
297
+ export function parseLmStudioModels(payload) {
298
+ let models;
299
+ try {
300
+ const list = isRecord(payload) ? payload.models : undefined;
301
+ if (!Array.isArray(list))
302
+ throw invalid();
303
+ models = list;
304
+ }
305
+ catch {
306
+ throw invalid();
307
+ }
308
+ const result = [];
309
+ for (let index = 0; index < Math.min(models.length, LMSTUDIO_MAX_MODELS); index += 1) {
310
+ const model = guarded(() => {
311
+ const raw = models[index];
312
+ if (!isRecord(raw) || raw.type !== "llm" || typeof raw.key !== "string")
313
+ return undefined;
314
+ const key = raw.key.trim();
315
+ if (!validId(key, LMSTUDIO_MAX_KEY_LENGTH))
316
+ return undefined;
317
+ const maxContext = tokenCount(raw.max_context_length);
318
+ const instances = Array.isArray(raw.loaded_instances) ? raw.loaded_instances : [];
319
+ const loaded = [];
320
+ for (let at = 0; at < Math.min(instances.length, MAX_WALKED) && loaded.length < MAX_LOADED_INSTANCES; at += 1) {
321
+ const instance = instances[at];
322
+ if (!isRecord(instance) || !validId(instance.id, LMSTUDIO_MAX_KEY_LENGTH))
323
+ continue;
324
+ const contextLength = tokenCount(isRecord(instance.config) ? instance.config.context_length : undefined);
325
+ loaded.push({ id: instance.id, ...(contextLength !== undefined ? { contextLength } : {}) });
326
+ }
327
+ let reasoning;
328
+ // No block of capabilities is a server that said nothing: the levels stay unknown.
329
+ if (isRecord(raw.capabilities)) {
330
+ const declared = isRecord(raw.capabilities.reasoning) ? raw.capabilities.reasoning : undefined;
331
+ const allowed = declared && Array.isArray(declared.allowed_options) ? declared.allowed_options : [];
332
+ const options = THINKING_LEVELS.filter((level) => allowed.includes(level));
333
+ const preferred = declared?.default;
334
+ reasoning = options.length
335
+ ? { options: [...options], ...(typeof preferred === "string" && options.includes(preferred) ? { default: preferred } : {}) }
336
+ : null;
337
+ }
338
+ return {
339
+ key,
340
+ ...(reasoning !== undefined ? { reasoning } : {}),
341
+ ...(maxContext !== undefined ? { maxContext } : {}),
342
+ loaded,
343
+ };
344
+ });
345
+ if (model)
346
+ result.push(model);
347
+ }
348
+ return result;
349
+ }
350
+ /**
351
+ * The context of one LM Studio model, found as BookWriter finds it: by its key or by the id of one of its loaded instances; `loaded` is the context
352
+ * of that instance (else of the first one) and `max` the longest the model supports. `undefined` for a model the list does not have.
353
+ */
354
+ export function lmStudioContext(models, modelId) {
355
+ for (const model of models) {
356
+ const instance = model.loaded.find((entry) => entry.id === modelId);
357
+ if (model.key !== modelId && !instance)
358
+ continue;
359
+ const chosen = instance ?? model.loaded[0];
360
+ return {
361
+ ...(chosen?.contextLength !== undefined ? { loaded: chosen.contextLength } : {}),
362
+ ...(model.maxContext !== undefined ? { max: model.maxContext } : {}),
363
+ };
364
+ }
365
+ return undefined;
366
+ }
367
+ //# sourceMappingURL=catalog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"catalog.js","sourceRoot":"","sources":["../../src/ai/catalog.ts"],"names":[],"mappings":"AAEA,2JAA2J;AAC3J,uJAAuJ;AACvJ,6JAA6J;AAC7J,gHAAgH;AAEhH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,kBAAkB,GAAG,KAAK,CAAC;AACxC,iCAAiC;AACjC,MAAM,CAAC,MAAM,qBAAqB,GAAG,GAAG,CAAC;AACzC,6HAA6H;AAC7H,MAAM,CAAC,MAAM,kBAAkB,GAAG,GAAG,CAAC;AACtC,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;AAC7C,qEAAqE;AACrE,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,CAAC;AACvC,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,cAAc,GAAG,EAAE,CAAC;AAC1B,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAC/B,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,mBAAmB,GAAG,GAAG,CAAC;AAChC,MAAM,oBAAoB,GAAG,EAAE,CAAC;AAChC,MAAM,eAAe,GAAG,SAAS,CAAC;AAClC,gKAAgK;AAChK,MAAM,UAAU,GAAG,CAAC,GAAG,kBAAkB,CAAC;AAE1C,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC,CAAC;AACrE,MAAM,OAAO,GAAG,8BAA8B,CAAC;AAC/C,MAAM,aAAa,GAAG,oBAAoB,CAAC;AAa3C;;;GAGG;AACH,MAAM,OAAO,cAAe,SAAQ,KAAK;IACD;IAAuC;IAA7E,YAAY,OAAe,EAAW,MAA4B,E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U,eAAe,CAAC,MAAkC,EAAE,OAAe;IACjF,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,OAAO,CAAC,CAAC;QACpE,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,CAAC,QAAQ;YAAE,SAAS;QACjD,MAAM,MAAM,GAAG,QAAQ,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC3C,OAAO;YACL,GAAG,CAAC,MAAM,EAAE,aAAa,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,aAAa,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAChF,GAAG,CAAC,KAAK,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACrE,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
@@ -11,8 +11,28 @@ export interface AiChatModelConfig {
11
11
  name: string;
12
12
  underlyingModel?: string;
13
13
  capabilities: string[];
14
+ /** The model can be asked to answer through a function. Only `false` has an effect: with "Tools only" on, a structured request skips the model. */
14
15
  supportsToolCalls?: boolean;
16
+ /** The model streams its replies. Only `false` has an effect: the model is then called without `stream`, whatever the integration's `streamMode` says. */
17
+ supportsStreaming?: boolean;
18
+ /**
19
+ * The model reasons. `true`: it gets the margin of output for its reasoning (as a model known to reason by its name), a reply cut before it wrote a
20
+ * word is a reply cut while reasoning, and a thinking level may be sent. `false`: a thinking level is not sent to it. The name of a model that is known
21
+ * to reason is not undone by `false`.
22
+ */
23
+ supportsReasoning?: boolean;
24
+ /** The model reads images. Data only: nothing in a request depends on it. */
25
+ supportsVision?: boolean;
26
+ /**
27
+ * How the thinking level reaches this model ("Thinking parameter"): `reasoning_effort` (the OpenAI field; also what an absent value means, and the requests
28
+ * of a model that does not say are exactly the ones they always were), `chat_template_kwargs.reasoning_strength` (the level as an argument of the chat
29
+ * template: Muse Glimmer takes it so, and does not take `reasoning_effort`) or `none` (no level is sent, even when the task or the integration asks for one).
30
+ * `suggestedReasoningParameter` says what the documented sources know of a model name; the engine never applies it by itself.
31
+ */
32
+ reasoningParameter?: AiReasoningParameter;
33
+ /** The context window of the model: what a prompt and its answer may be together. The engine subtracts the answer and a margin itself. */
15
34
  maxInputTokens?: number;
35
+ /** The largest answer that can be asked of the model. */
16
36
  maxOutputTokens?: number;
17
37
  pricing?: AiPricingConfig;
18
38
  }
@@ -21,6 +41,25 @@ export interface AiChatModelConfig {
21
41
  * included, so that a provider that answers slowly is never silent; `off` never streams, for a provider or a proxy that cannot.
22
42
  */
23
43
  export type AiStreamMode = "auto" | "off";
44
+ /**
45
+ * How hard a model is asked to think, per integration and per route target. `low`, `medium`, `high` and `xhigh` are sent to the provider as
46
+ * `reasoning_effort` (or as the argument of the chat template that the model's `reasoningParameter` says); `automatic` sends nothing (the provider's
47
+ * own default), even when the integration sets a level. Absent means nothing was chosen: a route target takes the level of its integration, and an
48
+ * integration without one sends nothing.
49
+ */
50
+ export declare const AI_THINKING_LEVELS: readonly ["automatic", "low", "medium", "high", "xhigh"];
51
+ export type AiThinking = (typeof AI_THINKING_LEVELS)[number];
52
+ /** A thinking level as the engine keeps it: one of `AI_THINKING_LEVELS`, spelled exactly; anything else is no value. */
53
+ export declare function normalizeThinking(value: unknown): AiThinking | undefined;
54
+ /**
55
+ * How a thinking level reaches a model: the setting of the model (`AiChatModelConfig.reasoningParameter`, "Thinking parameter"). `reasoning_effort` is the
56
+ * OpenAI field, and what is sent when a model says nothing; `chat_template_kwargs.reasoning_strength` sends the level as an argument of the model's chat
57
+ * template (`chat_template_kwargs: { reasoning_strength: <level> }`), which is how Muse Glimmer takes it; `none` sends no level to the model at all.
58
+ */
59
+ export declare const AI_REASONING_PARAMETERS: readonly ["reasoning_effort", "chat_template_kwargs.reasoning_strength", "none"];
60
+ export type AiReasoningParameter = (typeof AI_REASONING_PARAMETERS)[number];
61
+ /** A thinking parameter as the engine keeps it: one of `AI_REASONING_PARAMETERS`, spelled exactly; anything else is no value. */
62
+ export declare function normalizeReasoningParameter(value: unknown): AiReasoningParameter | undefined;
24
63
  /** The longest silence the engine waits for between two pieces of a streamed reply, unless the integration says otherwise. */
25
64
  export declare const DEFAULT_IDLE_TIMEOUT_MS = 600000;
26
65
  /** An integration's idle timeout is kept within these limits. */
@@ -42,6 +81,8 @@ export interface AiIntegrationConfig {
42
81
  idleTimeoutMs?: number;
43
82
  /** Absent: `auto`. */
44
83
  streamMode?: AiStreamMode;
84
+ /** The thinking level of every model of this integration, unless a route target says another. Absent: none is sent. */
85
+ thinking?: AiThinking;
45
86
  chatModels?: AiChatModelConfig[];
46
87
  /** @deprecated legacy single-model fields, still honored. */
47
88
  modelWriting?: string;
@@ -51,6 +92,8 @@ export interface AiIntegrationConfig {
51
92
  export interface AiRouteTarget {
52
93
  integrationId: string;
53
94
  model: string;
95
+ /** The thinking level for this task with this model. Absent: the integration's; `automatic`: none, even when the integration has one. */
96
+ thinking?: AiThinking;
54
97
  }
55
98
  export interface AiTaskRoute {
56
99
  primary?: AiRouteTarget;
@@ -87,6 +130,11 @@ export interface AiRuntimeConfig {
87
130
  fallbackDisclosure?: AiFallbackDisclosure;
88
131
  /** Absent fields are not limited: a call has no total time, token or cost limit. A configuration sent by the web app has them all. */
89
132
  routingExecution?: Partial<AiRoutingExecution>;
133
+ /**
134
+ * "Tools only" (the settings call it `aiToolsOnly`): a structured reply must be the call of its function, and a model marked as without tool
135
+ * calls is not used for one. Absent or true: on. False: a model without tool calls gets the schema in the message, and a JSON in the reply's text is read.
136
+ */
137
+ toolsOnly?: boolean;
90
138
  }
91
139
  /** The routing limits with the web app's normalization: whole numbers within the same bounds, the same defaults. */
92
140
  export declare function normalizeRoutingExecution(raw: unknown): AiRoutingExecution;
@@ -102,16 +150,44 @@ export interface RedactedAiIntegration {
102
150
  idleTimeoutMs?: number;
103
151
  /** Whether replies stream, when the integration says (absent: `auto`). */
104
152
  streamMode?: AiStreamMode;
105
- models: Array<{
106
- name: string;
107
- capabilities: string[];
108
- }>;
153
+ /** The thinking level of the integration, when it sets one. */
154
+ thinking?: AiThinking;
155
+ models: RedactedAiModel[];
109
156
  }
110
- /** Safe view of a configuration: never exposes API keys. */
111
- export declare function redactAiRuntimeConfig(config: AiRuntimeConfig): {
157
+ /** A model as the safe view shows it: its name and routes, and what its configuration declares of it (only what it declares). */
158
+ export interface RedactedAiModel {
159
+ name: string;
160
+ capabilities: string[];
161
+ supportsToolCalls?: boolean;
162
+ supportsStreaming?: boolean;
163
+ supportsReasoning?: boolean;
164
+ supportsVision?: boolean;
165
+ /** How the thinking level reaches the model, when the model says (absent: `reasoning_effort`). */
166
+ reasoningParameter?: AiReasoningParameter;
167
+ maxInputTokens?: number;
168
+ maxOutputTokens?: number;
169
+ }
170
+ /** A route target as the safe view shows it: which model of which integration, and its thinking level when it sets one. */
171
+ export interface RedactedAiRouteTarget {
172
+ integrationId: string;
173
+ model: string;
174
+ thinking?: AiThinking;
175
+ }
176
+ export interface RedactedAiTaskRoute {
177
+ primary?: RedactedAiRouteTarget;
178
+ fallbacks: RedactedAiRouteTarget[];
179
+ }
180
+ /** What `redactAiRuntimeConfig` says: nothing in it is a secret. */
181
+ export interface RedactedAiRuntimeConfig {
112
182
  integrations: RedactedAiIntegration[];
113
183
  routedTasks: string[];
184
+ /** The route of every routed task (`{}` when none is), primary first, then the fallbacks in order. */
185
+ taskRouting: Record<string, RedactedAiTaskRoute>;
186
+ /** Whether "Tools only" is in force: true unless the configuration turned it off. */
187
+ toolsOnly: boolean;
114
188
  fallbackDisclosure?: AiFallbackDisclosure;
115
189
  routingExecution?: Partial<AiRoutingExecution>;
116
- };
190
+ }
191
+ /** Safe view of a configuration: never exposes API keys. */
192
+ export declare function redactAiRuntimeConfig(config: AiRuntimeConfig): RedactedAiRuntimeConfig;
117
193
  //# sourceMappingURL=config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/ai/config.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG,QAAQ,GAAG,eAAe,GAAG,cAAc,CAAC;AAE1F,+EAA+E;AAC/E,eAAO,MAAM,yBAAyB,eAAe,CAAC;AAEtD,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,eAAe,CAAC;CAC3B;AAED;;;GAGG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,KAAK,CAAC;AAE1C,8HAA8H;AAC9H,eAAO,MAAM,uBAAuB,SAAU,CAAC;AAC/C,iEAAiE;AACjE,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAC1C,eAAO,MAAM,mBAAmB,UAAY,CAAC;AAE7C,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MA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