dsh-llm-fallbacks 0.1.0-alpha.2 → 0.1.0-alpha.4

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.
@@ -11,7 +11,6 @@ window.__ModuleLoader__.load({
11
11
  var __getOwnPropNames = Object.getOwnPropertyNames;
12
12
  var __getProtoOf = Object.getPrototypeOf;
13
13
  var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
15
14
  var __copyProps = (to, from, except, desc) => {
16
15
  if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
17
16
  key = keys[i];
@@ -30,1001 +29,11 @@ window.__ModuleLoader__.load({
30
29
  let _deepseek_ai_dsh_client_web_react = require("@deepseek-ai/dsh-client-web-react");
31
30
  let react = require("react");
32
31
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
32
+ let _deepseek_ai_schemastery = require("@deepseek-ai/schemastery");
33
+ _deepseek_ai_schemastery = __toESM(_deepseek_ai_schemastery, 1);
33
34
  let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
34
35
  let react_jsx_runtime = require("react/jsx-runtime");
35
- //#region node_modules/cosmokit/lib/index.cjs
36
- var require_lib$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
37
- var __defProp = Object.defineProperty;
38
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
39
- var __getOwnPropNames = Object.getOwnPropertyNames;
40
- var __hasOwnProp = Object.prototype.hasOwnProperty;
41
- var __export = (target, all) => {
42
- for (var name in all) __defProp(target, name, {
43
- get: all[name],
44
- enumerable: true
45
- });
46
- };
47
- var __copyProps = (to, from, except, desc) => {
48
- if (from && typeof from === "object" || typeof from === "function") {
49
- for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
50
- get: () => from[key],
51
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
52
- });
53
- }
54
- return to;
55
- };
56
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
57
- var index_exports = {};
58
- __export(index_exports, {
59
- Binary: () => Binary,
60
- Time: () => Time,
61
- arrayBufferToBase64: () => arrayBufferToBase64,
62
- arrayBufferToHex: () => arrayBufferToHex,
63
- base64ToArrayBuffer: () => base64ToArrayBuffer,
64
- camelCase: () => camelCase,
65
- camelize: () => camelize,
66
- capitalize: () => capitalize,
67
- clone: () => clone,
68
- contain: () => contain,
69
- deduplicate: () => deduplicate,
70
- deepEqual: () => deepEqual,
71
- defineProperty: () => defineProperty,
72
- difference: () => difference,
73
- filterKeys: () => filterKeys,
74
- formatProperty: () => formatProperty,
75
- hexToArrayBuffer: () => hexToArrayBuffer,
76
- hyphenate: () => hyphenate,
77
- intersection: () => intersection,
78
- is: () => is,
79
- isNonNullable: () => isNonNullable,
80
- isNullable: () => isNullable,
81
- isPlainObject: () => isPlainObject,
82
- makeArray: () => makeArray,
83
- mapValues: () => mapValues,
84
- noop: () => noop,
85
- omit: () => omit,
86
- paramCase: () => paramCase,
87
- pick: () => pick,
88
- remove: () => remove,
89
- sanitize: () => sanitize,
90
- snakeCase: () => snakeCase,
91
- trimSlash: () => trimSlash,
92
- uncapitalize: () => uncapitalize,
93
- union: () => union,
94
- valueMap: () => mapValues
95
- });
96
- module.exports = __toCommonJS(index_exports);
97
- function noop() {}
98
- function isNullable(value) {
99
- return value === null || value === void 0;
100
- }
101
- function isNonNullable(value) {
102
- return !isNullable(value);
103
- }
104
- function isPlainObject(data) {
105
- return data && typeof data === "object" && !Array.isArray(data);
106
- }
107
- function filterKeys(object, filter) {
108
- return Object.fromEntries(Object.entries(object).filter(([key, value]) => filter(key, value)));
109
- }
110
- function mapValues(object, transform) {
111
- return Object.fromEntries(Object.entries(object).map(([key, value]) => [key, transform(value, key)]));
112
- }
113
- function pick(source, keys, forced) {
114
- if (!keys) return { ...source };
115
- const result = {};
116
- for (const key of keys) if (forced || source[key] !== void 0) result[key] = source[key];
117
- return result;
118
- }
119
- function omit(source, keys) {
120
- if (!keys) return { ...source };
121
- const result = { ...source };
122
- for (const key of keys) Reflect.deleteProperty(result, key);
123
- return result;
124
- }
125
- function defineProperty(object, key, value) {
126
- return Object.defineProperty(object, key, {
127
- writable: true,
128
- value,
129
- enumerable: false
130
- });
131
- }
132
- function contain(array1, array2) {
133
- return array2.every((item) => array1.includes(item));
134
- }
135
- function intersection(array1, array2) {
136
- return array1.filter((item) => array2.includes(item));
137
- }
138
- function difference(array1, array2) {
139
- return array1.filter((item) => !array2.includes(item));
140
- }
141
- function union(array1, array2) {
142
- return Array.from(/* @__PURE__ */ new Set([...array1, ...array2]));
143
- }
144
- function deduplicate(array) {
145
- return [...new Set(array)];
146
- }
147
- function remove(list, item) {
148
- const index = list?.indexOf(item);
149
- if (index >= 0) {
150
- list.splice(index, 1);
151
- return true;
152
- } else return false;
153
- }
154
- function makeArray(source) {
155
- return Array.isArray(source) ? source : isNullable(source) ? [] : [source];
156
- }
157
- function is(type, value) {
158
- if (arguments.length === 1) return (value2) => is(type, value2);
159
- return type in globalThis && value instanceof globalThis[type] || Object.prototype.toString.call(value).slice(8, -1) === type;
160
- }
161
- function isArrayBufferLike(value) {
162
- return is("ArrayBuffer", value) || is("SharedArrayBuffer", value);
163
- }
164
- function isArrayBufferSource(value) {
165
- return isArrayBufferLike(value) || ArrayBuffer.isView(value);
166
- }
167
- var Binary;
168
- ((Binary2) => {
169
- Binary2.is = isArrayBufferLike;
170
- Binary2.isSource = isArrayBufferSource;
171
- function fromSource(source) {
172
- if (ArrayBuffer.isView(source)) return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength);
173
- else return source;
174
- }
175
- Binary2.fromSource = fromSource;
176
- function toBase64(source) {
177
- source = fromSource(source);
178
- if (typeof Buffer !== "undefined") return Buffer.from(source).toString("base64");
179
- let binary = "";
180
- const bytes = new Uint8Array(source);
181
- for (let i = 0; i < bytes.byteLength; i++) binary += String.fromCharCode(bytes[i]);
182
- return btoa(binary);
183
- }
184
- Binary2.toBase64 = toBase64;
185
- function fromBase64(source) {
186
- if (typeof Buffer !== "undefined") return fromSource(Buffer.from(source, "base64"));
187
- return Uint8Array.from(atob(source), (c) => c.charCodeAt(0));
188
- }
189
- Binary2.fromBase64 = fromBase64;
190
- function toHex(source) {
191
- source = fromSource(source);
192
- if (typeof Buffer !== "undefined") return Buffer.from(source).toString("hex");
193
- return Array.from(new Uint8Array(source), (byte) => byte.toString(16).padStart(2, "0")).join("");
194
- }
195
- Binary2.toHex = toHex;
196
- function fromHex(source) {
197
- if (typeof Buffer !== "undefined") return fromSource(Buffer.from(source, "hex"));
198
- const hex = source.length % 2 === 0 ? source : source.slice(0, source.length - 1);
199
- const buffer = [];
200
- for (let i = 0; i < hex.length; i += 2) buffer.push(parseInt(`${hex[i]}${hex[i + 1]}`, 16));
201
- return Uint8Array.from(buffer).buffer;
202
- }
203
- Binary2.fromHex = fromHex;
204
- })(Binary || (Binary = {}));
205
- var base64ToArrayBuffer = Binary.fromBase64;
206
- var arrayBufferToBase64 = Binary.toBase64;
207
- var hexToArrayBuffer = Binary.fromHex;
208
- var arrayBufferToHex = Binary.toHex;
209
- function clone(source, refs = /* @__PURE__ */ new Map()) {
210
- if (!source || typeof source !== "object") return source;
211
- if (is("Date", source)) return new Date(source.valueOf());
212
- if (is("RegExp", source)) return new RegExp(source.source, source.flags);
213
- if (isArrayBufferLike(source)) return source.slice(0);
214
- if (ArrayBuffer.isView(source)) return source.buffer.slice(source.byteOffset, source.byteOffset + source.byteLength);
215
- const cached = refs.get(source);
216
- if (cached) return cached;
217
- if (Array.isArray(source)) {
218
- const result2 = [];
219
- refs.set(source, result2);
220
- source.forEach((value, index) => {
221
- result2[index] = Reflect.apply(clone, null, [value, refs]);
222
- });
223
- return result2;
224
- }
225
- const result = Object.create(Object.getPrototypeOf(source));
226
- refs.set(source, result);
227
- for (const key of Reflect.ownKeys(source)) {
228
- const descriptor = { ...Reflect.getOwnPropertyDescriptor(source, key) };
229
- if ("value" in descriptor) descriptor.value = Reflect.apply(clone, null, [descriptor.value, refs]);
230
- Reflect.defineProperty(result, key, descriptor);
231
- }
232
- return result;
233
- }
234
- function deepEqual(a, b, strict) {
235
- if (a === b) return true;
236
- if (!strict && isNullable(a) && isNullable(b)) return true;
237
- if (typeof a !== typeof b) return false;
238
- if (typeof a !== "object") return false;
239
- if (!a || !b) return false;
240
- function check(test, then) {
241
- return test(a) ? test(b) ? then(a, b) : false : test(b) ? false : void 0;
242
- }
243
- return check(Array.isArray, (a2, b2) => a2.length === b2.length && a2.every((item, index) => deepEqual(item, b2[index]))) ?? check(is("Date"), (a2, b2) => a2.valueOf() === b2.valueOf()) ?? check(is("RegExp"), (a2, b2) => a2.source === b2.source && a2.flags === b2.flags) ?? check(isArrayBufferLike, (a2, b2) => {
244
- if (a2.byteLength !== b2.byteLength) return false;
245
- const viewA = new Uint8Array(a2);
246
- const viewB = new Uint8Array(b2);
247
- for (let i = 0; i < viewA.length; i++) if (viewA[i] !== viewB[i]) return false;
248
- return true;
249
- }) ?? Object.keys({
250
- ...a,
251
- ...b
252
- }).every((key) => deepEqual(a[key], b[key], strict));
253
- }
254
- function capitalize(source) {
255
- return source.charAt(0).toUpperCase() + source.slice(1);
256
- }
257
- function uncapitalize(source) {
258
- return source.charAt(0).toLowerCase() + source.slice(1);
259
- }
260
- function camelCase(source) {
261
- return source.replace(/[_-][a-z]/g, (str) => str.slice(1).toUpperCase());
262
- }
263
- function tokenize(source, delimiters, delimiter) {
264
- const output = [];
265
- let state = 0;
266
- for (let i = 0; i < source.length; i++) {
267
- const code = source.charCodeAt(i);
268
- if (code >= 65 && code <= 90) {
269
- if (state === 1) {
270
- const next = source.charCodeAt(i + 1);
271
- if (next >= 97 && next <= 122) output.push(delimiter);
272
- output.push(code + 32);
273
- } else {
274
- if (state !== 0) output.push(delimiter);
275
- output.push(code + 32);
276
- }
277
- state = 1;
278
- } else if (code >= 97 && code <= 122) {
279
- output.push(code);
280
- state = 2;
281
- } else if (delimiters.includes(code)) {
282
- if (state !== 0) output.push(delimiter);
283
- state = 0;
284
- } else output.push(code);
285
- }
286
- return String.fromCharCode(...output);
287
- }
288
- function paramCase(source) {
289
- return tokenize(source, [45, 95], 45);
290
- }
291
- function snakeCase(source) {
292
- return tokenize(source, [45, 95], 95);
293
- }
294
- var camelize = camelCase;
295
- var hyphenate = paramCase;
296
- function formatProperty(key) {
297
- if (typeof key !== "string") return `[${key.toString()}]`;
298
- return /^[a-z_$][\w$]*$/i.test(key) ? `.${key}` : `[${JSON.stringify(key)}]`;
299
- }
300
- function trimSlash(source) {
301
- return source.replace(/\/$/, "");
302
- }
303
- function sanitize(source) {
304
- if (!source.startsWith("/")) source = "/" + source;
305
- return trimSlash(source);
306
- }
307
- var Time;
308
- ((Time2) => {
309
- Time2.millisecond = 1;
310
- Time2.second = 1e3;
311
- Time2.minute = Time2.second * 60;
312
- Time2.hour = Time2.minute * 60;
313
- Time2.day = Time2.hour * 24;
314
- Time2.week = Time2.day * 7;
315
- let timezoneOffset = (/* @__PURE__ */ new Date()).getTimezoneOffset();
316
- function setTimezoneOffset(offset) {
317
- timezoneOffset = offset;
318
- }
319
- Time2.setTimezoneOffset = setTimezoneOffset;
320
- function getTimezoneOffset() {
321
- return timezoneOffset;
322
- }
323
- Time2.getTimezoneOffset = getTimezoneOffset;
324
- function getDateNumber(date = /* @__PURE__ */ new Date(), offset) {
325
- if (typeof date === "number") date = new Date(date);
326
- if (offset === void 0) offset = timezoneOffset;
327
- return Math.floor((date.valueOf() / Time2.minute - offset) / 1440);
328
- }
329
- Time2.getDateNumber = getDateNumber;
330
- function fromDateNumber(value, offset) {
331
- const date = new Date(value * Time2.day);
332
- if (offset === void 0) offset = timezoneOffset;
333
- return new Date(+date + offset * Time2.minute);
334
- }
335
- Time2.fromDateNumber = fromDateNumber;
336
- const numeric = /\d+(?:\.\d+)?/.source;
337
- const timeRegExp = new RegExp(`^${[
338
- "w(?:eek(?:s)?)?",
339
- "d(?:ay(?:s)?)?",
340
- "h(?:our(?:s)?)?",
341
- "m(?:in(?:ute)?(?:s)?)?",
342
- "s(?:ec(?:ond)?(?:s)?)?"
343
- ].map((unit) => `(${numeric}${unit})?`).join("")}$`);
344
- function parseTime(source) {
345
- const capture = timeRegExp.exec(source);
346
- if (!capture) return 0;
347
- return (parseFloat(capture[1]) * Time2.week || 0) + (parseFloat(capture[2]) * Time2.day || 0) + (parseFloat(capture[3]) * Time2.hour || 0) + (parseFloat(capture[4]) * Time2.minute || 0) + (parseFloat(capture[5]) * Time2.second || 0);
348
- }
349
- Time2.parseTime = parseTime;
350
- function parseDate(date) {
351
- const parsed = parseTime(date);
352
- if (parsed) date = Date.now() + parsed;
353
- else if (/^\d{1,2}(:\d{1,2}){1,2}$/.test(date)) date = `${(/* @__PURE__ */ new Date()).toLocaleDateString()}-${date}`;
354
- else if (/^\d{1,2}-\d{1,2}-\d{1,2}(:\d{1,2}){1,2}$/.test(date)) date = `${(/* @__PURE__ */ new Date()).getFullYear()}-${date}`;
355
- return date ? new Date(date) : /* @__PURE__ */ new Date();
356
- }
357
- Time2.parseDate = parseDate;
358
- function format(ms) {
359
- const abs = Math.abs(ms);
360
- if (abs >= Time2.day - Time2.hour / 2) return Math.round(ms / Time2.day) + "d";
361
- else if (abs >= Time2.hour - Time2.minute / 2) return Math.round(ms / Time2.hour) + "h";
362
- else if (abs >= Time2.minute - Time2.second / 2) return Math.round(ms / Time2.minute) + "m";
363
- else if (abs >= Time2.second) return Math.round(ms / Time2.second) + "s";
364
- return ms + "ms";
365
- }
366
- Time2.format = format;
367
- function toDigits(source, length = 2) {
368
- return source.toString().padStart(length, "0");
369
- }
370
- Time2.toDigits = toDigits;
371
- function template(template2, time = /* @__PURE__ */ new Date()) {
372
- return template2.replace("yyyy", time.getFullYear().toString()).replace("yy", time.getFullYear().toString().slice(2)).replace("MM", toDigits(time.getMonth() + 1)).replace("dd", toDigits(time.getDate())).replace("hh", toDigits(time.getHours())).replace("mm", toDigits(time.getMinutes())).replace("ss", toDigits(time.getSeconds())).replace("SSS", toDigits(time.getMilliseconds(), 3));
373
- }
374
- Time2.template = template;
375
- })(Time || (Time = {}));
376
- 0 && (module.exports = {
377
- Binary,
378
- Time,
379
- arrayBufferToBase64,
380
- arrayBufferToHex,
381
- base64ToArrayBuffer,
382
- camelCase,
383
- camelize,
384
- capitalize,
385
- clone,
386
- contain,
387
- deduplicate,
388
- deepEqual,
389
- defineProperty,
390
- difference,
391
- filterKeys,
392
- formatProperty,
393
- hexToArrayBuffer,
394
- hyphenate,
395
- intersection,
396
- is,
397
- isNonNullable,
398
- isNullable,
399
- isPlainObject,
400
- makeArray,
401
- mapValues,
402
- noop,
403
- omit,
404
- paramCase,
405
- pick,
406
- remove,
407
- sanitize,
408
- snakeCase,
409
- trimSlash,
410
- uncapitalize,
411
- union,
412
- valueMap
413
- });
414
- }));
415
- //#endregion
416
36
  //#region src/selectors.ts
417
- var import_lib = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMin(((exports, module) => {
418
- var __defProp = Object.defineProperty;
419
- var __name = (target, value) => __defProp(target, "name", {
420
- value,
421
- configurable: true
422
- });
423
- var import_cosmokit = require_lib$1();
424
- var kSchema = Symbol.for("schemastery");
425
- var kValidationError = Symbol.for("ValidationError");
426
- globalThis.__schemastery_index__ ??= 0;
427
- globalThis.__schemastery_refs__ = void 0;
428
- var ValidationError = class extends TypeError {
429
- constructor(message, options) {
430
- let prefix = "$";
431
- for (const segment of options.path || []) if (typeof segment === "string") prefix += "." + segment;
432
- else if (typeof segment === "number") prefix += "[" + segment + "]";
433
- else if (typeof segment === "symbol") prefix += `[Symbol(${segment.toString()})]`;
434
- if (prefix.startsWith(".")) prefix = prefix.slice(1);
435
- super((prefix === "$" ? "" : `${prefix} `) + message);
436
- this.options = options;
437
- }
438
- static {
439
- __name(this, "ValidationError");
440
- }
441
- name = "ValidationError";
442
- static is(error) {
443
- return !!error?.[kValidationError];
444
- }
445
- };
446
- Object.defineProperty(ValidationError.prototype, kValidationError, { value: true });
447
- var Schema = /* @__PURE__ */ __name(function(options) {
448
- const schema = /* @__PURE__ */ __name(function(data, options2 = {}) {
449
- return Schema.resolve(data, schema, options2)[0];
450
- }, "schema");
451
- if (options.refs) {
452
- const refs = (0, import_cosmokit.valueMap)(options.refs, (options2) => new Schema(options2));
453
- const getRef = /* @__PURE__ */ __name((uid) => refs[uid], "getRef");
454
- for (const key in refs) {
455
- const options2 = refs[key];
456
- options2.sKey = getRef(options2.sKey);
457
- options2.inner = getRef(options2.inner);
458
- options2.list = options2.list && options2.list.map(getRef);
459
- options2.dict = options2.dict && (0, import_cosmokit.valueMap)(options2.dict, getRef);
460
- }
461
- return refs[options.uid];
462
- }
463
- Object.assign(schema, options);
464
- if (typeof schema.callback === "string") try {
465
- schema.callback = new Function("return " + schema.callback)();
466
- } catch {}
467
- Object.defineProperty(schema, "uid", { value: globalThis.__schemastery_index__++ });
468
- Object.setPrototypeOf(schema, Schema.prototype);
469
- schema.meta ||= {};
470
- schema.toString = schema.toString.bind(schema);
471
- return schema;
472
- }, "Schema");
473
- Schema.prototype = Object.create(Function.prototype);
474
- Schema.prototype[kSchema] = true;
475
- Object.defineProperty(Schema.prototype, "~standard", { get() {
476
- return {
477
- version: 1,
478
- vendor: "schemastery",
479
- validate: /* @__PURE__ */ __name((value) => {
480
- try {
481
- return { value: Schema.resolve(value, this, {})[0] };
482
- } catch (error) {
483
- if (ValidationError.is(error)) return { issues: [{
484
- message: error.message,
485
- path: error.options.path
486
- }] };
487
- throw error;
488
- }
489
- }, "validate")
490
- };
491
- } });
492
- Schema.ValidationError = ValidationError;
493
- Schema.prototype.toJSON = /* @__PURE__ */ __name(function toJSON() {
494
- if (globalThis.__schemastery_refs__) {
495
- globalThis.__schemastery_refs__[this.uid] ??= JSON.parse(JSON.stringify({ ...this }));
496
- return this.uid;
497
- }
498
- globalThis.__schemastery_refs__ = { [this.uid]: { ...this } };
499
- globalThis.__schemastery_refs__[this.uid] = JSON.parse(JSON.stringify({ ...this }));
500
- const result = {
501
- uid: this.uid,
502
- refs: globalThis.__schemastery_refs__
503
- };
504
- globalThis.__schemastery_refs__ = void 0;
505
- return result;
506
- }, "toJSON");
507
- Schema.prototype.set = /* @__PURE__ */ __name(function set(key, value) {
508
- this.dict[key] = value;
509
- return this;
510
- }, "set");
511
- Schema.prototype.push = /* @__PURE__ */ __name(function push(value) {
512
- this.list.push(value);
513
- return this;
514
- }, "push");
515
- function mergeDesc(original, messages) {
516
- const result = typeof original === "string" ? { "": original } : { ...original };
517
- for (const locale in messages) {
518
- const value = messages[locale];
519
- if (value?.$description || value?.$desc) result[locale] = value.$description || value.$desc;
520
- else if (typeof value === "string") result[locale] = value;
521
- }
522
- return result;
523
- }
524
- __name(mergeDesc, "mergeDesc");
525
- function getInner(value) {
526
- return value?.$value ?? value?.$inner;
527
- }
528
- __name(getInner, "getInner");
529
- function extractKeys(data) {
530
- return (0, import_cosmokit.filterKeys)(data ?? {}, (key) => !key.startsWith("$"));
531
- }
532
- __name(extractKeys, "extractKeys");
533
- Schema.prototype.i18n = /* @__PURE__ */ __name(function i18n(messages) {
534
- const schema = Schema(this);
535
- const desc = mergeDesc(schema.meta.description, messages);
536
- if (Object.keys(desc).length) schema.meta.description = desc;
537
- if (schema.dict) schema.dict = (0, import_cosmokit.valueMap)(schema.dict, (inner, key) => {
538
- return inner.i18n((0, import_cosmokit.valueMap)(messages, (data) => getInner(data)?.[key] ?? data?.[key]));
539
- });
540
- if (schema.list) schema.list = schema.list.map((inner, index) => {
541
- return inner.i18n((0, import_cosmokit.valueMap)(messages, (data = {}) => {
542
- if (Array.isArray(getInner(data))) return getInner(data)[index];
543
- if (Array.isArray(data)) return data[index];
544
- return extractKeys(data);
545
- }));
546
- });
547
- if (schema.inner) schema.inner = schema.inner.i18n((0, import_cosmokit.valueMap)(messages, (data) => {
548
- if (getInner(data)) return getInner(data);
549
- return extractKeys(data);
550
- }));
551
- if (schema.sKey) schema.sKey = schema.sKey.i18n((0, import_cosmokit.valueMap)(messages, (data) => data?.$key));
552
- return schema;
553
- }, "i18n");
554
- Schema.prototype.extra = /* @__PURE__ */ __name(function extra(key, value) {
555
- const schema = Schema(this);
556
- schema.meta = {
557
- ...schema.meta,
558
- [key]: value
559
- };
560
- return schema;
561
- }, "extra");
562
- for (const key of [
563
- "required",
564
- "disabled",
565
- "collapse",
566
- "hidden",
567
- "loose"
568
- ]) Object.assign(Schema.prototype, { [key](value = true) {
569
- const schema = Schema(this);
570
- schema.meta = {
571
- ...schema.meta,
572
- [key]: value
573
- };
574
- return schema;
575
- } });
576
- Schema.prototype.deprecated = /* @__PURE__ */ __name(function deprecated() {
577
- const schema = Schema(this);
578
- schema.meta.badges ||= [];
579
- schema.meta.badges.push({
580
- text: "deprecated",
581
- type: "danger"
582
- });
583
- return schema;
584
- }, "deprecated");
585
- Schema.prototype.experimental = /* @__PURE__ */ __name(function experimental() {
586
- const schema = Schema(this);
587
- schema.meta.badges ||= [];
588
- schema.meta.badges.push({
589
- text: "experimental",
590
- type: "warning"
591
- });
592
- return schema;
593
- }, "experimental");
594
- Schema.prototype.pattern = /* @__PURE__ */ __name(function pattern(regexp) {
595
- const schema = Schema(this);
596
- const pattern2 = (0, import_cosmokit.pick)(regexp, ["source", "flags"]);
597
- schema.meta = {
598
- ...schema.meta,
599
- pattern: pattern2
600
- };
601
- return schema;
602
- }, "pattern");
603
- Schema.prototype.simplify = /* @__PURE__ */ __name(function simplify(value) {
604
- if ((0, import_cosmokit.deepEqual)(value, this.meta.default, this.type === "dict")) return null;
605
- if ((0, import_cosmokit.isNullable)(value)) return value;
606
- if (this.type === "object" || this.type === "dict") {
607
- const result = {};
608
- for (const key in value) {
609
- const item = (this.type === "object" ? this.dict[key] : this.inner)?.simplify(value[key]);
610
- if (this.type === "dict" || !(0, import_cosmokit.isNullable)(item)) result[key] = item;
611
- }
612
- if ((0, import_cosmokit.deepEqual)(result, this.meta.default, this.type === "dict")) return null;
613
- return result;
614
- } else if (this.type === "array" || this.type === "tuple") {
615
- const result = [];
616
- value.forEach((value2, index) => {
617
- const schema = this.type === "array" ? this.inner : this.list[index];
618
- const item = schema ? schema.simplify(value2) : value2;
619
- result.push(item);
620
- });
621
- return result;
622
- } else if (this.type === "intersect") {
623
- const result = {};
624
- for (const item of this.list) Object.assign(result, item.simplify(value));
625
- return result;
626
- } else if (this.type === "union") for (const schema of this.list) try {
627
- Schema.resolve(value, schema, {});
628
- return schema.simplify(value);
629
- } catch {}
630
- return value;
631
- }, "simplify");
632
- Schema.prototype.toString = /* @__PURE__ */ __name(function toString(inline) {
633
- return formatters[this.type]?.(this, inline) ?? `Schema<${this.type}>`;
634
- }, "toString");
635
- Schema.prototype.role = /* @__PURE__ */ __name(function role(role, extra2) {
636
- const schema = Schema(this);
637
- schema.meta = {
638
- ...schema.meta,
639
- role,
640
- extra: extra2
641
- };
642
- return schema;
643
- }, "role");
644
- for (const key of [
645
- "default",
646
- "link",
647
- "comment",
648
- "description",
649
- "max",
650
- "min",
651
- "step"
652
- ]) Object.assign(Schema.prototype, { [key](value) {
653
- const schema = Schema(this);
654
- schema.meta = {
655
- ...schema.meta,
656
- [key]: value
657
- };
658
- return schema;
659
- } });
660
- var resolvers = {};
661
- Schema.extend = /* @__PURE__ */ __name(function extend(type, resolve2) {
662
- resolvers[type] = resolve2;
663
- }, "extend");
664
- Schema.resolve = /* @__PURE__ */ __name(function resolve(data, schema, options = {}, strict = false) {
665
- if (!schema) return [data];
666
- if (options.ignore?.(data, schema)) return [data];
667
- if ((0, import_cosmokit.isNullable)(data) && schema.type !== "lazy") {
668
- if (schema.meta.required) throw new ValidationError(`missing required value`, options);
669
- let current = schema;
670
- let fallback = schema.meta.default;
671
- while (current?.type === "intersect" && (0, import_cosmokit.isNullable)(fallback)) {
672
- current = current.list[0];
673
- fallback = current?.meta.default;
674
- }
675
- if ((0, import_cosmokit.isNullable)(fallback)) return [data];
676
- data = (0, import_cosmokit.clone)(fallback);
677
- }
678
- const callback = resolvers[schema.type];
679
- if (!callback) throw new ValidationError(`unsupported type "${schema.type}"`, options);
680
- try {
681
- return callback(data, schema, options, strict);
682
- } catch (error) {
683
- if (!schema.meta.loose) throw error;
684
- return [schema.meta.default];
685
- }
686
- }, "resolve");
687
- Schema.from = /* @__PURE__ */ __name(function from(source) {
688
- if ((0, import_cosmokit.isNullable)(source)) return Schema.any();
689
- else if ([
690
- "string",
691
- "number",
692
- "boolean"
693
- ].includes(typeof source)) return Schema.const(source).required();
694
- else if (source[kSchema]) return source;
695
- else if (typeof source === "function") switch (source) {
696
- case String: return Schema.string().required();
697
- case Number: return Schema.number().required();
698
- case Boolean: return Schema.boolean().required();
699
- case Function: return Schema.function().required();
700
- default: return Schema.is(source).required();
701
- }
702
- else throw new TypeError(`cannot infer schema from ${source}`);
703
- }, "from");
704
- Schema.lazy = /* @__PURE__ */ __name(function lazy(builder) {
705
- const schema = new Schema({
706
- type: "lazy",
707
- builder,
708
- inner: { toJSON: /* @__PURE__ */ __name(() => {
709
- if (!schema.inner[kSchema]) {
710
- schema.inner = schema.builder();
711
- schema.inner.meta = {
712
- ...schema.meta,
713
- ...schema.inner.meta
714
- };
715
- }
716
- return schema.inner.toJSON();
717
- }, "toJSON") }
718
- });
719
- return schema;
720
- }, "lazy");
721
- Schema.natural = /* @__PURE__ */ __name(function natural() {
722
- return Schema.number().step(1).min(0);
723
- }, "natural");
724
- Schema.percent = /* @__PURE__ */ __name(function percent() {
725
- return Schema.number().step(.01).min(0).max(1).role("slider");
726
- }, "percent");
727
- Schema.date = /* @__PURE__ */ __name(function date() {
728
- return Schema.union([Schema.is(Date), Schema.transform(Schema.string().role("datetime"), (value, options) => {
729
- const date2 = new Date(value);
730
- if (isNaN(+date2)) throw new ValidationError(`invalid date "${value}"`, options);
731
- return date2;
732
- }, true)]);
733
- }, "date");
734
- Schema.regExp = /* @__PURE__ */ __name(function regExp(flag = "") {
735
- return Schema.union([Schema.is(RegExp), Schema.transform(Schema.string().role("regexp", { flag }), (value, options) => {
736
- try {
737
- return new RegExp(value, flag);
738
- } catch (e) {
739
- throw new ValidationError(e.message, options);
740
- }
741
- }, true)]);
742
- }, "regExp");
743
- Schema.arrayBuffer = /* @__PURE__ */ __name(function arrayBuffer(encoding) {
744
- return Schema.union([
745
- Schema.is(ArrayBuffer),
746
- Schema.is(SharedArrayBuffer),
747
- Schema.transform(Schema.any(), (value, options) => {
748
- if (import_cosmokit.Binary.isSource(value)) return import_cosmokit.Binary.fromSource(value);
749
- throw new ValidationError(`expected ArrayBufferSource but got ${value}`, options);
750
- }, true),
751
- ...encoding ? [Schema.transform(Schema.string(), (value, options) => {
752
- try {
753
- return encoding === "base64" ? import_cosmokit.Binary.fromBase64(value) : import_cosmokit.Binary.fromHex(value);
754
- } catch (e) {
755
- throw new ValidationError(e.message, options);
756
- }
757
- }, true)] : []
758
- ]);
759
- }, "arrayBuffer");
760
- Schema.extend("lazy", (data, schema, options, strict) => {
761
- if (!schema.inner[kSchema]) {
762
- schema.inner = schema.builder();
763
- schema.inner.meta = {
764
- ...schema.meta,
765
- ...schema.inner.meta
766
- };
767
- }
768
- return Schema.resolve(data, schema.inner, options, strict);
769
- });
770
- Schema.extend("any", (data) => {
771
- return [data];
772
- });
773
- Schema.extend("never", (data, _, options) => {
774
- throw new ValidationError(`expected nullable but got ${data}`, options);
775
- });
776
- Schema.extend("const", (data, { value }, options) => {
777
- if ((0, import_cosmokit.deepEqual)(data, value)) return [value];
778
- throw new ValidationError(`expected ${value} but got ${data}`, options);
779
- });
780
- function checkWithinRange(data, meta, description, options, skipMin = false) {
781
- const { max = Infinity, min = -Infinity } = meta;
782
- if (data > max) throw new ValidationError(`expected ${description} <= ${max} but got ${data}`, options);
783
- if (data < min && !skipMin) throw new ValidationError(`expected ${description} >= ${min} but got ${data}`, options);
784
- }
785
- __name(checkWithinRange, "checkWithinRange");
786
- Schema.extend("string", (data, { meta }, options) => {
787
- if (typeof data !== "string") throw new ValidationError(`expected string but got ${data}`, options);
788
- if (meta.pattern) {
789
- const regexp = new RegExp(meta.pattern.source, meta.pattern.flags);
790
- if (!regexp.test(data)) throw new ValidationError(`expect string to match regexp ${regexp}`, options);
791
- }
792
- checkWithinRange(data.length, meta, "string length", options);
793
- return [data];
794
- });
795
- function decimalShift(data, digits) {
796
- const str = data.toString();
797
- if (str.includes("e")) return data * Math.pow(10, digits);
798
- const index = str.indexOf(".");
799
- if (index === -1) return data * Math.pow(10, digits);
800
- const frac = str.slice(index + 1);
801
- const integer = str.slice(0, index);
802
- if (frac.length <= digits) return +(integer + frac.padEnd(digits, "0"));
803
- return +(integer + frac.slice(0, digits) + "." + frac.slice(digits));
804
- }
805
- __name(decimalShift, "decimalShift");
806
- function isMultipleOf(data, min, step) {
807
- step = Math.abs(step);
808
- if (!/^\d+\.\d+$/.test(step.toString())) return (data - min) % step === 0;
809
- const index = step.toString().indexOf(".");
810
- const digits = step.toString().slice(index + 1).length;
811
- return Math.abs(decimalShift(data, digits) - decimalShift(min, digits)) % decimalShift(step, digits) === 0;
812
- }
813
- __name(isMultipleOf, "isMultipleOf");
814
- Schema.extend("number", (data, { meta }, options) => {
815
- if (typeof data !== "number") throw new ValidationError(`expected number but got ${data}`, options);
816
- checkWithinRange(data, meta, "number", options);
817
- const { step } = meta;
818
- if (step && !isMultipleOf(data, meta.min ?? 0, step)) throw new ValidationError(`expected number multiple of ${step} but got ${data}`, options);
819
- return [data];
820
- });
821
- Schema.extend("boolean", (data, _, options) => {
822
- if (typeof data === "boolean") return [data];
823
- throw new ValidationError(`expected boolean but got ${data}`, options);
824
- });
825
- Schema.extend("bitset", (data, { bits, meta }, options) => {
826
- let value = 0, keys = [];
827
- if (typeof data === "number") {
828
- value = data;
829
- for (const key in bits) if (data & bits[key]) keys.push(key);
830
- } else if (Array.isArray(data)) {
831
- keys = data;
832
- for (const key of keys) {
833
- if (typeof key !== "string") throw new ValidationError(`expected string but got ${key}`, options);
834
- if (key in bits) value |= bits[key];
835
- }
836
- } else throw new ValidationError(`expected number or array but got ${data}`, options);
837
- if (value === meta.default) return [value];
838
- return [value, keys];
839
- });
840
- Schema.extend("function", (data, _, options) => {
841
- if (typeof data === "function") return [data];
842
- throw new ValidationError(`expected function but got ${data}`, options);
843
- });
844
- Schema.extend("is", (data, { constructor }, options) => {
845
- if (typeof constructor === "function") {
846
- if (data instanceof constructor) return [data];
847
- throw new ValidationError(`expected ${constructor.name} but got ${data}`, options);
848
- } else {
849
- if ((0, import_cosmokit.isNullable)(data)) throw new ValidationError(`expected ${constructor} but got ${data}`, options);
850
- let prototype = Object.getPrototypeOf(data);
851
- while (prototype) {
852
- if (prototype.constructor?.name === constructor) return [data];
853
- prototype = Object.getPrototypeOf(prototype);
854
- }
855
- throw new ValidationError(`expected ${constructor} but got ${data}`, options);
856
- }
857
- });
858
- function property(data, key, schema, options) {
859
- try {
860
- const [value, adapted] = Schema.resolve(data[key], schema, {
861
- ...options,
862
- path: [...options.path || [], key]
863
- });
864
- if (adapted !== void 0) data[key] = adapted;
865
- return value;
866
- } catch (e) {
867
- if (!options?.autofix) throw e;
868
- delete data[key];
869
- return schema.meta.default;
870
- }
871
- }
872
- __name(property, "property");
873
- Schema.extend("array", (data, { inner, meta }, options) => {
874
- if (!Array.isArray(data)) throw new ValidationError(`expected array but got ${data}`, options);
875
- checkWithinRange(data.length, meta, "array length", options, !(0, import_cosmokit.isNullable)(inner.meta.default));
876
- return [data.map((_, index) => property(data, index, inner, options))];
877
- });
878
- Schema.extend("dict", (data, { inner, sKey }, options, strict) => {
879
- if (!(0, import_cosmokit.isPlainObject)(data)) throw new ValidationError(`expected object but got ${data}`, options);
880
- const result = {};
881
- for (const key in data) {
882
- let rKey;
883
- try {
884
- rKey = Schema.resolve(key, sKey, options)[0];
885
- } catch (error) {
886
- if (strict) continue;
887
- throw error;
888
- }
889
- result[rKey] = property(data, key, inner, options);
890
- data[rKey] = data[key];
891
- if (key !== rKey) delete data[key];
892
- }
893
- return [result];
894
- });
895
- Schema.extend("tuple", (data, { list }, options, strict) => {
896
- if (!Array.isArray(data)) throw new ValidationError(`expected array but got ${data}`, options);
897
- const result = list.map((inner, index) => property(data, index, inner, options));
898
- if (strict) return [result];
899
- result.push(...data.slice(list.length));
900
- return [result];
901
- });
902
- function merge(result, data) {
903
- for (const key in data) {
904
- if (key in result) continue;
905
- result[key] = data[key];
906
- }
907
- }
908
- __name(merge, "merge");
909
- Schema.extend("object", (data, { dict }, options, strict) => {
910
- if (!(0, import_cosmokit.isPlainObject)(data)) throw new ValidationError(`expected object but got ${data}`, options);
911
- const result = {};
912
- for (const key in dict) {
913
- const value = property(data, key, dict[key], options);
914
- if (!(0, import_cosmokit.isNullable)(value) || key in data) result[key] = value;
915
- }
916
- if (!strict) merge(result, data);
917
- return [result];
918
- });
919
- Schema.extend("union", (data, { list, toString: toString2 }, options, strict) => {
920
- const messages = [];
921
- for (const inner of list) try {
922
- return Schema.resolve(data, inner, options, strict);
923
- } catch (error) {
924
- messages.push(error);
925
- }
926
- throw new ValidationError(`expected ${toString2()} but got ${JSON.stringify(data)}`, options);
927
- });
928
- Schema.extend("intersect", (data, { list, toString: toString2 }, options, strict) => {
929
- if (!list.length) return [data];
930
- let result;
931
- for (const inner of list) {
932
- const value = Schema.resolve(data, inner, options, true)[0];
933
- if ((0, import_cosmokit.isNullable)(value)) continue;
934
- if ((0, import_cosmokit.isNullable)(result)) result = value;
935
- else if (typeof result !== typeof value) throw new ValidationError(`expected ${toString2()} but got ${JSON.stringify(data)}`, options);
936
- else if (typeof value === "object") merge(result ??= {}, value);
937
- else if (result !== value) throw new ValidationError(`expected ${toString2()} but got ${JSON.stringify(data)}`, options);
938
- }
939
- if (!strict && (0, import_cosmokit.isPlainObject)(data)) merge(result, data);
940
- return [result];
941
- });
942
- Schema.extend("transform", (data, { inner, callback, preserve }, options) => {
943
- const [result, adapted = data] = Schema.resolve(data, inner, options, true);
944
- if (preserve) return [callback(result)];
945
- else return [callback(result), callback(adapted)];
946
- });
947
- var formatters = {};
948
- function defineMethod(name, keys, format) {
949
- formatters[name] = format;
950
- Object.assign(Schema, { [name](...args) {
951
- const schema = new Schema({ type: name });
952
- keys.forEach((key, index) => {
953
- switch (key) {
954
- case "sKey":
955
- schema.sKey = args[index] ?? Schema.string();
956
- break;
957
- case "inner":
958
- schema.inner = Schema.from(args[index]);
959
- break;
960
- case "list":
961
- schema.list = args[index].map(Schema.from);
962
- break;
963
- case "dict":
964
- schema.dict = (0, import_cosmokit.valueMap)(args[index], Schema.from);
965
- break;
966
- case "bits":
967
- schema.bits = {};
968
- for (const key2 in args[index]) {
969
- if (typeof args[index][key2] !== "number") continue;
970
- schema.bits[key2] = args[index][key2];
971
- }
972
- break;
973
- case "callback": {
974
- const callback = schema.callback = args[index];
975
- callback["toJSON"] ||= () => callback.toString();
976
- break;
977
- }
978
- case "constructor": {
979
- const constructor = schema.constructor = args[index];
980
- if (typeof constructor === "function") constructor["toJSON"] ||= () => constructor["name"];
981
- break;
982
- }
983
- default: schema[key] = args[index];
984
- }
985
- });
986
- if (name === "object" || name === "dict") schema.meta.default = {};
987
- else if (name === "array" || name === "tuple") schema.meta.default = [];
988
- else if (name === "bitset") schema.meta.default = 0;
989
- return schema;
990
- } });
991
- }
992
- __name(defineMethod, "defineMethod");
993
- defineMethod("is", ["constructor"], ({ constructor }) => {
994
- if (typeof constructor === "function") return constructor.name;
995
- else return constructor;
996
- });
997
- defineMethod("any", [], () => "any");
998
- defineMethod("never", [], () => "never");
999
- defineMethod("const", ["value"], ({ value }) => typeof value === "string" ? JSON.stringify(value) : value);
1000
- defineMethod("string", [], () => "string");
1001
- defineMethod("number", [], () => "number");
1002
- defineMethod("boolean", [], () => "boolean");
1003
- defineMethod("bitset", ["bits"], () => "bitset");
1004
- defineMethod("function", [], () => "function");
1005
- defineMethod("array", ["inner"], ({ inner }) => `${inner.toString(true)}[]`);
1006
- defineMethod("dict", ["inner", "sKey"], ({ inner, sKey }) => `{ [key: ${sKey.toString()}]: ${inner.toString()} }`);
1007
- defineMethod("tuple", ["list"], ({ list }) => `[${list.map((inner) => inner.toString()).join(", ")}]`);
1008
- defineMethod("object", ["dict"], ({ dict }) => {
1009
- if (Object.keys(dict).length === 0) return "{}";
1010
- return `{ ${Object.entries(dict).map(([key, inner]) => {
1011
- return `${key}${inner.meta.required ? "" : "?"}: ${inner.toString()}`;
1012
- }).join(", ")} }`;
1013
- });
1014
- defineMethod("union", ["list"], ({ list }, inline) => {
1015
- const result = list.map(({ toString: format }) => format()).join(" | ");
1016
- return inline ? `(${result})` : result;
1017
- });
1018
- defineMethod("intersect", ["list"], ({ list }) => {
1019
- return `${list.map((inner) => inner.toString(true)).join(" & ")}`;
1020
- });
1021
- defineMethod("transform", [
1022
- "inner",
1023
- "callback",
1024
- "preserve"
1025
- ], ({ inner }, isInner) => inner.toString(isInner));
1026
- module.exports = Schema;
1027
- })))(), 1);
1028
37
  /** Catchable error for illegal/unknown selectors (config-warning path). */
1029
38
  var SelectorError = class extends Error {
1030
39
  constructor(message) {
@@ -1112,41 +121,41 @@ window.__ModuleLoader__.load({
1112
121
  const INHERIT_ROLE_ID = "inherit";
1113
122
  /** Role id format (aligned with yet-another-subagent `isValidProfileId`). */
1114
123
  const ROLE_ID_PATTERN = /^[a-z0-9-]{1,32}$/;
1115
- import_lib.default.object({
1116
- enabled: import_lib.default.boolean().default(false),
1117
- triggerCodes: import_lib.default.array(import_lib.default.string()).default([
124
+ _deepseek_ai_schemastery.default.object({
125
+ enabled: _deepseek_ai_schemastery.default.boolean().default(false),
126
+ triggerCodes: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.string()).default([
1118
127
  "AUTH",
1119
128
  "QUOTA",
1120
129
  "RATE_LIMIT"
1121
130
  ]),
1122
- rootChain: import_lib.default.array(import_lib.default.string()).default([]),
1123
- roles: import_lib.default.object({
1124
- list: import_lib.default.array(import_lib.default.object({
1125
- id: import_lib.default.string().required(),
1126
- label: import_lib.default.string().default(""),
1127
- description: import_lib.default.string().default(""),
1128
- prompt: import_lib.default.string(),
1129
- permissions: import_lib.default.object({
1130
- allow: import_lib.default.array(import_lib.default.string()),
1131
- deny: import_lib.default.array(import_lib.default.string())
131
+ rootChain: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.string()).default([]),
132
+ roles: _deepseek_ai_schemastery.default.object({
133
+ list: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.object({
134
+ id: _deepseek_ai_schemastery.default.string().required(),
135
+ label: _deepseek_ai_schemastery.default.string().default(""),
136
+ description: _deepseek_ai_schemastery.default.string().default(""),
137
+ prompt: _deepseek_ai_schemastery.default.string(),
138
+ permissions: _deepseek_ai_schemastery.default.object({
139
+ allow: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.string()),
140
+ deny: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.string())
1132
141
  }),
1133
- chain: import_lib.default.array(import_lib.default.string()),
1134
- fallback: import_lib.default.union([import_lib.default.const("inherit-root"), import_lib.default.const("none")]).default("inherit-root")
142
+ chain: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.string()),
143
+ fallback: _deepseek_ai_schemastery.default.union([_deepseek_ai_schemastery.default.const("inherit-root"), _deepseek_ai_schemastery.default.const("none")]).default("inherit-root")
1135
144
  })).default([]),
1136
- rules: import_lib.default.array(import_lib.default.object({
1137
- origin: import_lib.default.union([import_lib.default.const("root"), import_lib.default.const("subagent")]),
1138
- provider: import_lib.default.string(),
1139
- model: import_lib.default.string(),
1140
- role: import_lib.default.string().required()
145
+ rules: _deepseek_ai_schemastery.default.array(_deepseek_ai_schemastery.default.object({
146
+ origin: _deepseek_ai_schemastery.default.union([_deepseek_ai_schemastery.default.const("root"), _deepseek_ai_schemastery.default.const("subagent")]),
147
+ provider: _deepseek_ai_schemastery.default.string(),
148
+ model: _deepseek_ai_schemastery.default.string(),
149
+ role: _deepseek_ai_schemastery.default.string().required()
1141
150
  })).default([])
1142
151
  }).default({
1143
152
  list: [],
1144
153
  rules: []
1145
154
  }),
1146
- cooldownMs: import_lib.default.number().default(3e5),
1147
- revertPolicy: import_lib.default.union([import_lib.default.const("cooldown-expiry"), import_lib.default.const("never")]).default("cooldown-expiry"),
1148
- maxSwitchesPerStep: import_lib.default.number().default(8),
1149
- alwaysModeRetryCap: import_lib.default.number().default(5)
155
+ cooldownMs: _deepseek_ai_schemastery.default.number().default(3e5),
156
+ revertPolicy: _deepseek_ai_schemastery.default.union([_deepseek_ai_schemastery.default.const("cooldown-expiry"), _deepseek_ai_schemastery.default.const("never")]).default("cooldown-expiry"),
157
+ maxSwitchesPerStep: _deepseek_ai_schemastery.default.number().default(8),
158
+ alwaysModeRetryCap: _deepseek_ai_schemastery.default.number().default(5)
1150
159
  });
1151
160
  //#endregion
1152
161
  //#region src/client/fallbacks-store.ts