dsh-auto-flow 0.1.1 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/README.md +253 -51
- package/cordis.patch.yml +3 -24
- package/lib/client.js +2899 -917
- package/lib/index.d.ts +360 -113
- package/lib/index.js +12222 -437
- package/lib/typert.host.js +1134 -158
- package/lib/typert.remote-client.d.ts +32 -13
- package/lib/typert.remote-client.js +846 -99
- package/lib/types-B5z-T_7S.d.ts +1389 -0
- package/lib/types.d.ts +2 -106
- package/lib/types.js +2 -1
- package/package.json +53 -37
package/lib/client.js
CHANGED
|
@@ -5,9 +5,11 @@ window.__ModuleLoader__.load({
|
|
|
5
5
|
var exports = module.exports;
|
|
6
6
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
7
7
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
8
|
+
let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
|
|
8
9
|
let react = require("react");
|
|
10
|
+
let react_dom = require("react-dom");
|
|
9
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
|
-
//#region
|
|
12
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/util.js
|
|
11
13
|
function getEnumValues(entries) {
|
|
12
14
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
13
15
|
return Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -19,14 +21,22 @@ window.__ModuleLoader__.load({
|
|
|
19
21
|
if (typeof value === "bigint") return value.toString();
|
|
20
22
|
return value;
|
|
21
23
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
var Cached = class {
|
|
25
|
+
constructor(getter) {
|
|
26
|
+
this._getter = getter;
|
|
27
|
+
this._value = void 0;
|
|
28
|
+
}
|
|
29
|
+
get value() {
|
|
30
|
+
const getter = this._getter;
|
|
31
|
+
if (getter !== void 0) {
|
|
32
|
+
this._value = getter();
|
|
33
|
+
this._getter = void 0;
|
|
28
34
|
}
|
|
29
|
-
|
|
35
|
+
return this._value;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
function cached(getter) {
|
|
39
|
+
return new Cached(getter);
|
|
30
40
|
}
|
|
31
41
|
function nullish(input) {
|
|
32
42
|
return input === null || input === void 0;
|
|
@@ -43,6 +53,24 @@ window.__ModuleLoader__.load({
|
|
|
43
53
|
if (Math.abs(ratio - roundedRatio) < tolerance) return 0;
|
|
44
54
|
return ratio - roundedRatio;
|
|
45
55
|
}
|
|
56
|
+
const EVALUATING = /* @__PURE__*/ Symbol("evaluating");
|
|
57
|
+
function defineLazy(object, key, getter) {
|
|
58
|
+
let value = void 0;
|
|
59
|
+
Object.defineProperty(object, key, {
|
|
60
|
+
get() {
|
|
61
|
+
if (value === EVALUATING) return;
|
|
62
|
+
if (value === void 0) {
|
|
63
|
+
value = EVALUATING;
|
|
64
|
+
value = getter();
|
|
65
|
+
}
|
|
66
|
+
return value;
|
|
67
|
+
},
|
|
68
|
+
set(v) {
|
|
69
|
+
Object.defineProperty(object, key, { value: v });
|
|
70
|
+
},
|
|
71
|
+
configurable: true
|
|
72
|
+
});
|
|
73
|
+
}
|
|
46
74
|
function assignProp(target, prop, value) {
|
|
47
75
|
Object.defineProperty(target, prop, {
|
|
48
76
|
value,
|
|
@@ -51,6 +79,58 @@ window.__ModuleLoader__.load({
|
|
|
51
79
|
configurable: true
|
|
52
80
|
});
|
|
53
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Whichever object a def's `shape` currently answers from: the one the caller passed until the first read, the frozen copy after it.
|
|
84
|
+
*
|
|
85
|
+
* Its keys and descriptors read without invoking anything, which is what lets a discriminated union check its discriminator, and the cycle walk read a shape, without resolving a getter that references the schema being constructed. A def that answers `shape` from an accessor of its own has none.
|
|
86
|
+
*/
|
|
87
|
+
function rawShape(def) {
|
|
88
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
89
|
+
return desc?.get ? desc.get.raw : desc?.value;
|
|
90
|
+
}
|
|
91
|
+
function sourceShape(schema) {
|
|
92
|
+
return rawShape(schema._zod.def) ?? schema._zod.def.shape;
|
|
93
|
+
}
|
|
94
|
+
function deferProp(target, key, getter) {
|
|
95
|
+
Object.defineProperty(target, key, {
|
|
96
|
+
get() {
|
|
97
|
+
const value = getter();
|
|
98
|
+
assignProp(this, key, value);
|
|
99
|
+
return value;
|
|
100
|
+
},
|
|
101
|
+
enumerable: true,
|
|
102
|
+
configurable: true
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
function putProp(target, key, value) {
|
|
106
|
+
if (key in target) assignProp(target, key, value);
|
|
107
|
+
else target[key] = value;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Copies `keys` of `source`'s shape onto `target`, each value passed through `wrap`.
|
|
111
|
+
*
|
|
112
|
+
* A key the source has resolved is copied through now, so the derived shape states it outright and nothing has to resolve it to learn what it holds. A key the source still defers stays deferred, and reads back through the source's own `shape`, so it resolves once and both shapes get that one schema.
|
|
113
|
+
*/
|
|
114
|
+
function mirrorShape(target, source, keys, wrap) {
|
|
115
|
+
const raw = sourceShape(source);
|
|
116
|
+
for (const key of keys) {
|
|
117
|
+
const desc = Object.getOwnPropertyDescriptor(raw, key);
|
|
118
|
+
if (!desc.enumerable) continue;
|
|
119
|
+
if (desc.get) deferProp(target, key, () => {
|
|
120
|
+
const value = source._zod.def.shape[key];
|
|
121
|
+
return wrap ? wrap(value, key) : value;
|
|
122
|
+
});
|
|
123
|
+
else putProp(target, key, wrap ? wrap(desc.value, key) : desc.value);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
function mirrorProps(target, source) {
|
|
127
|
+
for (const key of Reflect.ownKeys(source)) {
|
|
128
|
+
const desc = Object.getOwnPropertyDescriptor(source, key);
|
|
129
|
+
if (!desc.enumerable) continue;
|
|
130
|
+
if (desc.get) deferProp(target, key, () => source[key]);
|
|
131
|
+
else putProp(target, key, desc.value);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
54
134
|
function mergeDefs(...defs) {
|
|
55
135
|
const mergedDescriptors = {};
|
|
56
136
|
for (const def of defs) {
|
|
@@ -141,39 +221,39 @@ window.__ModuleLoader__.load({
|
|
|
141
221
|
float32: [-34028234663852886e22, 34028234663852886e22],
|
|
142
222
|
float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
|
|
143
223
|
}))();
|
|
224
|
+
const BIGINT_FORMAT_RANGES = {
|
|
225
|
+
int64: [/* @__PURE__*/ BigInt("-9223372036854775808"), /* @__PURE__*/ BigInt("9223372036854775807")],
|
|
226
|
+
uint64: [/* @__PURE__*/ BigInt(0), /* @__PURE__*/ BigInt("18446744073709551615")]
|
|
227
|
+
};
|
|
144
228
|
function pick(schema, mask) {
|
|
145
229
|
const currDef = schema._zod.def;
|
|
146
230
|
const checks = currDef.checks;
|
|
147
231
|
if (checks && checks.length > 0) throw new Error(".pick() cannot be used on object schemas containing refinements");
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
if (!Object.prototype.hasOwnProperty.call(currDef.shape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
153
|
-
if (!mask[key]) continue;
|
|
154
|
-
assignProp(newShape, key, currDef.shape[key]);
|
|
155
|
-
}
|
|
156
|
-
assignProp(this, "shape", newShape);
|
|
157
|
-
return newShape;
|
|
158
|
-
},
|
|
232
|
+
const newShape = {};
|
|
233
|
+
mirrorShape(newShape, schema, maskedKeys(schema, mask));
|
|
234
|
+
return clone(schema, mergeDefs(currDef, {
|
|
235
|
+
shape: newShape,
|
|
159
236
|
checks: []
|
|
160
237
|
}));
|
|
161
238
|
}
|
|
239
|
+
function maskedKeys(schema, mask) {
|
|
240
|
+
const raw = sourceShape(schema);
|
|
241
|
+
const keys = [];
|
|
242
|
+
for (const key of Reflect.ownKeys(mask)) {
|
|
243
|
+
if (!Object.getOwnPropertyDescriptor(raw, key)?.enumerable) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
244
|
+
if (mask[key]) keys.push(key);
|
|
245
|
+
}
|
|
246
|
+
return keys;
|
|
247
|
+
}
|
|
162
248
|
function omit(schema, mask) {
|
|
163
249
|
const currDef = schema._zod.def;
|
|
164
250
|
const checks = currDef.checks;
|
|
165
251
|
if (checks && checks.length > 0) throw new Error(".omit() cannot be used on object schemas containing refinements");
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
if (!mask[key]) continue;
|
|
172
|
-
delete newShape[key];
|
|
173
|
-
}
|
|
174
|
-
assignProp(this, "shape", newShape);
|
|
175
|
-
return newShape;
|
|
176
|
-
},
|
|
252
|
+
const omitted = new Set(maskedKeys(schema, mask));
|
|
253
|
+
const newShape = {};
|
|
254
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)).filter((key) => !omitted.has(key)));
|
|
255
|
+
return clone(schema, mergeDefs(currDef, {
|
|
256
|
+
shape: newShape,
|
|
177
257
|
checks: []
|
|
178
258
|
}));
|
|
179
259
|
}
|
|
@@ -181,41 +261,29 @@ window.__ModuleLoader__.load({
|
|
|
181
261
|
if (!isPlainObject(shape)) throw new Error("Invalid input to extend: expected a plain object");
|
|
182
262
|
const checks = schema._zod.def.checks;
|
|
183
263
|
if (checks && checks.length > 0) {
|
|
184
|
-
const existingShape = schema
|
|
264
|
+
const existingShape = sourceShape(schema);
|
|
185
265
|
for (const key of Reflect.ownKeys(shape)) if (Object.getOwnPropertyDescriptor(existingShape, key) !== void 0) throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.");
|
|
186
266
|
}
|
|
187
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
} }));
|
|
267
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
268
|
+
}
|
|
269
|
+
function extended(schema, shape) {
|
|
270
|
+
const newShape = {};
|
|
271
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)));
|
|
272
|
+
mirrorProps(newShape, shape);
|
|
273
|
+
return newShape;
|
|
195
274
|
}
|
|
196
275
|
function safeExtend(schema, shape) {
|
|
197
276
|
if (!isPlainObject(shape)) throw new Error("Invalid input to safeExtend: expected a plain object");
|
|
198
|
-
return clone(schema, mergeDefs(schema._zod.def, {
|
|
199
|
-
const _shape = {
|
|
200
|
-
...schema._zod.def.shape,
|
|
201
|
-
...shape
|
|
202
|
-
};
|
|
203
|
-
assignProp(this, "shape", _shape);
|
|
204
|
-
return _shape;
|
|
205
|
-
} }));
|
|
277
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: extended(schema, shape) }));
|
|
206
278
|
}
|
|
207
279
|
function merge(a, b) {
|
|
208
280
|
if (!b?._zod?.def) throw new Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");
|
|
209
281
|
if (a._zod.def.checks?.length) throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");
|
|
282
|
+
const newShape = {};
|
|
283
|
+
mirrorShape(newShape, a, Reflect.ownKeys(sourceShape(a)));
|
|
284
|
+
mirrorShape(newShape, b, Reflect.ownKeys(sourceShape(b)));
|
|
210
285
|
return clone(a, mergeDefs(a._zod.def, {
|
|
211
|
-
|
|
212
|
-
const _shape = {
|
|
213
|
-
...a._zod.def.shape,
|
|
214
|
-
...b._zod.def.shape
|
|
215
|
-
};
|
|
216
|
-
assignProp(this, "shape", _shape);
|
|
217
|
-
return _shape;
|
|
218
|
-
},
|
|
286
|
+
shape: newShape,
|
|
219
287
|
get catchall() {
|
|
220
288
|
return b._zod.def.catchall;
|
|
221
289
|
},
|
|
@@ -225,47 +293,25 @@ window.__ModuleLoader__.load({
|
|
|
225
293
|
function partial(Class, schema, mask, name = "partial") {
|
|
226
294
|
const checks = schema._zod.def.checks;
|
|
227
295
|
if (checks && checks.length > 0) throw new Error(`.${name}() cannot be used on object schemas containing refinements`);
|
|
296
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
297
|
+
const newShape = {};
|
|
298
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), Class && ((value, key) => selected && !selected.has(key) ? value : new Class({
|
|
299
|
+
type: "optional",
|
|
300
|
+
innerType: value
|
|
301
|
+
})));
|
|
228
302
|
return clone(schema, mergeDefs(schema._zod.def, {
|
|
229
|
-
|
|
230
|
-
const oldShape = schema._zod.def.shape;
|
|
231
|
-
const shape = { ...oldShape };
|
|
232
|
-
if (mask) for (const key of Reflect.ownKeys(mask)) {
|
|
233
|
-
if (!Object.prototype.hasOwnProperty.call(oldShape, key)) throw new Error(`Unrecognized key: "${String(key)}"`);
|
|
234
|
-
if (!mask[key]) continue;
|
|
235
|
-
shape[key] = Class ? new Class({
|
|
236
|
-
type: "optional",
|
|
237
|
-
innerType: oldShape[key]
|
|
238
|
-
}) : oldShape[key];
|
|
239
|
-
}
|
|
240
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = Class ? new Class({
|
|
241
|
-
type: "optional",
|
|
242
|
-
innerType: oldShape[key]
|
|
243
|
-
}) : oldShape[key];
|
|
244
|
-
assignProp(this, "shape", shape);
|
|
245
|
-
return shape;
|
|
246
|
-
},
|
|
303
|
+
shape: newShape,
|
|
247
304
|
checks: []
|
|
248
305
|
}));
|
|
249
306
|
}
|
|
250
307
|
function required(Class, schema, mask) {
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
type: "nonoptional",
|
|
259
|
-
innerType: oldShape[key]
|
|
260
|
-
});
|
|
261
|
-
}
|
|
262
|
-
else for (const key of Reflect.ownKeys(oldShape)) shape[key] = new Class({
|
|
263
|
-
type: "nonoptional",
|
|
264
|
-
innerType: oldShape[key]
|
|
265
|
-
});
|
|
266
|
-
assignProp(this, "shape", shape);
|
|
267
|
-
return shape;
|
|
268
|
-
} }));
|
|
308
|
+
const selected = mask ? new Set(maskedKeys(schema, mask)) : void 0;
|
|
309
|
+
const newShape = {};
|
|
310
|
+
mirrorShape(newShape, schema, Reflect.ownKeys(sourceShape(schema)), (value, key) => selected && !selected.has(key) ? value : new Class({
|
|
311
|
+
type: "nonoptional",
|
|
312
|
+
innerType: value
|
|
313
|
+
}));
|
|
314
|
+
return clone(schema, mergeDefs(schema._zod.def, { shape: newShape }));
|
|
269
315
|
}
|
|
270
316
|
function aborted(x, startIndex = 0) {
|
|
271
317
|
if (x.aborted === true) return true;
|
|
@@ -301,11 +347,15 @@ window.__ModuleLoader__.load({
|
|
|
301
347
|
}
|
|
302
348
|
const schemaError = iss.schema !== iss.inst ? iss.schema?._zod.def?.error : void 0;
|
|
303
349
|
const message = iss.message ? iss.message : unwrapMessage(iss.inst?._zod.def?.error?.(iss)) ?? unwrapMessage(schemaError?.(iss)) ?? unwrapMessage(ctx?.error?.(iss)) ?? unwrapMessage(config.customError?.(iss)) ?? unwrapMessage(config.localeError?.(iss)) ?? "Invalid input";
|
|
304
|
-
const
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
350
|
+
const full = {};
|
|
351
|
+
for (const k of Object.keys(iss)) {
|
|
352
|
+
if (k === "inst" || k === "schema" || k === "continue" || k === "input" || k === "__proto__") continue;
|
|
353
|
+
full[k] = iss[k];
|
|
354
|
+
}
|
|
355
|
+
full.path ?? (full.path = []);
|
|
356
|
+
full.message = message;
|
|
357
|
+
if (ctx?.reportInput) full.input = iss.input;
|
|
358
|
+
return full;
|
|
309
359
|
}
|
|
310
360
|
const highSurrogate = /[\uD800-\uDBFF]/;
|
|
311
361
|
function codePointLength(str) {
|
|
@@ -375,6 +425,23 @@ window.__ModuleLoader__.load({
|
|
|
375
425
|
function hide(inst, key, value) {
|
|
376
426
|
return own(inst, key, value, false);
|
|
377
427
|
}
|
|
428
|
+
/** Adds members a table derives from the instance: each builds on first read and shadows as own data, and assignment shadows the same way, as when these were own properties. */
|
|
429
|
+
function derived(computes, table) {
|
|
430
|
+
for (const key in computes) {
|
|
431
|
+
const compute = computes[key];
|
|
432
|
+
Object.defineProperty(table, key, {
|
|
433
|
+
configurable: true,
|
|
434
|
+
enumerable: true,
|
|
435
|
+
get() {
|
|
436
|
+
return own(this, key, compute(this));
|
|
437
|
+
},
|
|
438
|
+
set(value) {
|
|
439
|
+
own(this, key, value);
|
|
440
|
+
}
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
return table;
|
|
444
|
+
}
|
|
378
445
|
function defineBound(proto, key, fn) {
|
|
379
446
|
Object.defineProperty(proto, key, {
|
|
380
447
|
configurable: true,
|
|
@@ -483,9 +550,9 @@ window.__ModuleLoader__.load({
|
|
|
483
550
|
return fn;
|
|
484
551
|
}
|
|
485
552
|
//#endregion
|
|
486
|
-
//#region
|
|
553
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/core.js
|
|
487
554
|
var _a$1;
|
|
488
|
-
const _zodDesc
|
|
555
|
+
const _zodDesc = {
|
|
489
556
|
value: void 0,
|
|
490
557
|
enumerable: false
|
|
491
558
|
};
|
|
@@ -522,14 +589,13 @@ window.__ModuleLoader__.load({
|
|
|
522
589
|
const initialized = protoMembers && /* @__PURE__ */ new WeakSet();
|
|
523
590
|
function init(inst, def) {
|
|
524
591
|
if (!inst._zod) {
|
|
525
|
-
_zodDesc
|
|
592
|
+
_zodDesc.value = new Internals(def);
|
|
526
593
|
try {
|
|
527
|
-
Object.defineProperty(inst, "_zod", _zodDesc
|
|
594
|
+
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
528
595
|
} finally {
|
|
529
|
-
_zodDesc
|
|
596
|
+
_zodDesc.value = void 0;
|
|
530
597
|
}
|
|
531
|
-
}
|
|
532
|
-
if (inst._zod.traits.has(name)) return;
|
|
598
|
+
} else if (inst._zod.traits.has(name)) return;
|
|
533
599
|
inst._zod.traits.add(name);
|
|
534
600
|
initializer(inst, def);
|
|
535
601
|
if (initialized) {
|
|
@@ -590,7 +656,7 @@ window.__ModuleLoader__.load({
|
|
|
590
656
|
return globalConfig;
|
|
591
657
|
}
|
|
592
658
|
//#endregion
|
|
593
|
-
//#region
|
|
659
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/errors.js
|
|
594
660
|
function _getMessage() {
|
|
595
661
|
const internals = this._zod;
|
|
596
662
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -605,10 +671,6 @@ window.__ModuleLoader__.load({
|
|
|
605
671
|
enumerable: true,
|
|
606
672
|
configurable: true
|
|
607
673
|
};
|
|
608
|
-
const _zodDesc = {
|
|
609
|
-
value: void 0,
|
|
610
|
-
enumerable: false
|
|
611
|
-
};
|
|
612
674
|
const _issuesDesc = {
|
|
613
675
|
value: void 0,
|
|
614
676
|
enumerable: false
|
|
@@ -616,11 +678,8 @@ window.__ModuleLoader__.load({
|
|
|
616
678
|
const _installedToString = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
617
679
|
const initializer$1 = (inst, def) => {
|
|
618
680
|
inst.name = "$ZodError";
|
|
619
|
-
_zodDesc.value = inst._zod;
|
|
620
|
-
Object.defineProperty(inst, "_zod", _zodDesc);
|
|
621
681
|
_issuesDesc.value = def;
|
|
622
682
|
Object.defineProperty(inst, "issues", _issuesDesc);
|
|
623
|
-
_zodDesc.value = void 0;
|
|
624
683
|
_issuesDesc.value = void 0;
|
|
625
684
|
Object.defineProperty(inst, "message", _messageDesc);
|
|
626
685
|
const proto = Object.getPrototypeOf(inst);
|
|
@@ -649,7 +708,7 @@ window.__ModuleLoader__.load({
|
|
|
649
708
|
}
|
|
650
709
|
};
|
|
651
710
|
const $ZodError = $constructor("$ZodError", initializer$1);
|
|
652
|
-
|
|
711
|
+
$constructor("$ZodError", initializer$1, void 0, { Parent: Error });
|
|
653
712
|
/** Get-or-create `obj[key]` as an own data property. A path segment naming an inherited member
|
|
654
713
|
* ("toString", "constructor") would otherwise read through to the prototype, and assigning
|
|
655
714
|
* "__proto__" would hit the setter instead of creating a key. */
|
|
@@ -713,7 +772,7 @@ window.__ModuleLoader__.load({
|
|
|
713
772
|
return fieldErrors;
|
|
714
773
|
}
|
|
715
774
|
//#endregion
|
|
716
|
-
//#region
|
|
775
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/parse.js
|
|
717
776
|
function finalizeParams(callee, params) {
|
|
718
777
|
return {
|
|
719
778
|
callee: params?.callee ?? callee,
|
|
@@ -770,15 +829,30 @@ window.__ModuleLoader__.load({
|
|
|
770
829
|
issues: []
|
|
771
830
|
}, ctx);
|
|
772
831
|
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
773
|
-
return result.issues.length ? {
|
|
774
|
-
success: false,
|
|
775
|
-
error: new (_Err ?? $ZodError)(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
776
|
-
} : {
|
|
832
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
777
833
|
success: true,
|
|
778
834
|
data: result.value
|
|
779
835
|
};
|
|
780
836
|
};
|
|
781
|
-
|
|
837
|
+
function failure(Err, issues, ctx) {
|
|
838
|
+
let error;
|
|
839
|
+
return {
|
|
840
|
+
success: false,
|
|
841
|
+
get error() {
|
|
842
|
+
if (!error) {
|
|
843
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config())));
|
|
844
|
+
issues = void 0;
|
|
845
|
+
ctx = void 0;
|
|
846
|
+
}
|
|
847
|
+
return error;
|
|
848
|
+
},
|
|
849
|
+
set error(e) {
|
|
850
|
+
error = e;
|
|
851
|
+
issues = void 0;
|
|
852
|
+
ctx = void 0;
|
|
853
|
+
}
|
|
854
|
+
};
|
|
855
|
+
}
|
|
782
856
|
const _safeParseAsync = (_Err) => async (schema, value, _ctx) => {
|
|
783
857
|
const ctx = _ctx ? {
|
|
784
858
|
..._ctx,
|
|
@@ -789,15 +863,61 @@ window.__ModuleLoader__.load({
|
|
|
789
863
|
issues: []
|
|
790
864
|
}, ctx);
|
|
791
865
|
if (result instanceof Promise) result = await result;
|
|
792
|
-
return result.issues.length ? {
|
|
793
|
-
success: false,
|
|
794
|
-
error: new _Err(result.issues.map((iss) => finalizeIssue(iss, ctx, config())))
|
|
795
|
-
} : {
|
|
866
|
+
return result.issues.length ? failure(_Err, result.issues, ctx) : {
|
|
796
867
|
success: true,
|
|
797
868
|
data: result.value
|
|
798
869
|
};
|
|
799
870
|
};
|
|
800
|
-
const
|
|
871
|
+
const COMPILE_INVALID = /* @__PURE__ */ Symbol.for("zod.compile.invalid");
|
|
872
|
+
const COMPILE_FALLBACK = /* @__PURE__ */ Symbol.for("zod.compile.fallback");
|
|
873
|
+
const validate = ((schema, value, _ctx) => {
|
|
874
|
+
const validator = schema._zod.bag.validator;
|
|
875
|
+
if (validator !== void 0) {
|
|
876
|
+
if (validator(value) !== COMPILE_INVALID) return true;
|
|
877
|
+
if (validator.definite === true && _ctx === void 0) return false;
|
|
878
|
+
}
|
|
879
|
+
return validateFallback(schema, value, _ctx);
|
|
880
|
+
});
|
|
881
|
+
function validateFallback(schema, value, _ctx) {
|
|
882
|
+
const ctx = _ctx ? {
|
|
883
|
+
..._ctx,
|
|
884
|
+
async: false,
|
|
885
|
+
abortEarly: true
|
|
886
|
+
} : {
|
|
887
|
+
async: false,
|
|
888
|
+
abortEarly: true
|
|
889
|
+
};
|
|
890
|
+
const fallbackRun = schema._zod.bag.fallbackRun;
|
|
891
|
+
let result;
|
|
892
|
+
if (fallbackRun) {
|
|
893
|
+
ctx[COMPILE_FALLBACK] = true;
|
|
894
|
+
result = fallbackRun({
|
|
895
|
+
value,
|
|
896
|
+
issues: []
|
|
897
|
+
}, ctx);
|
|
898
|
+
} else result = schema._zod.run({
|
|
899
|
+
value,
|
|
900
|
+
issues: []
|
|
901
|
+
}, ctx);
|
|
902
|
+
if (result instanceof Promise) throw new $ZodAsyncError();
|
|
903
|
+
return result.issues.length === 0;
|
|
904
|
+
}
|
|
905
|
+
const validateAsync$1 = async (schema, value, _ctx) => {
|
|
906
|
+
const ctx = _ctx ? {
|
|
907
|
+
..._ctx,
|
|
908
|
+
async: true,
|
|
909
|
+
abortEarly: true
|
|
910
|
+
} : {
|
|
911
|
+
async: true,
|
|
912
|
+
abortEarly: true
|
|
913
|
+
};
|
|
914
|
+
let result = schema._zod.run({
|
|
915
|
+
value,
|
|
916
|
+
issues: []
|
|
917
|
+
}, ctx);
|
|
918
|
+
if (result instanceof Promise) result = await result;
|
|
919
|
+
return result.issues.length === 0;
|
|
920
|
+
};
|
|
801
921
|
const _encode = (_Err) => {
|
|
802
922
|
const parse = _parse(_Err);
|
|
803
923
|
const fn = (schema, value, _ctx, _params) => {
|
|
@@ -855,7 +975,7 @@ window.__ModuleLoader__.load({
|
|
|
855
975
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
856
976
|
};
|
|
857
977
|
//#endregion
|
|
858
|
-
//#region
|
|
978
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/regexes.js
|
|
859
979
|
/**
|
|
860
980
|
* @deprecated CUID v1 is deprecated by its authors due to information leakage
|
|
861
981
|
* (timestamps embedded in the id). Use {@link cuid2} instead.
|
|
@@ -882,8 +1002,8 @@ window.__ModuleLoader__.load({
|
|
|
882
1002
|
return new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${version}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`);
|
|
883
1003
|
};
|
|
884
1004
|
/** Practical email validation */
|
|
885
|
-
const email = /^(
|
|
886
|
-
const _emoji$1 = `^[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
1005
|
+
const email = /^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/;
|
|
1006
|
+
const _emoji$1 = `^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;
|
|
887
1007
|
function emoji() {
|
|
888
1008
|
return new RegExp(_emoji$1, "u");
|
|
889
1009
|
}
|
|
@@ -892,7 +1012,7 @@ window.__ModuleLoader__.load({
|
|
|
892
1012
|
const cidrv4 = /^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/;
|
|
893
1013
|
const cidrv6 = /^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
894
1014
|
const base64 = /^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/;
|
|
895
|
-
const base64url = /^[A-Za-z0-9_-]
|
|
1015
|
+
const base64url = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/;
|
|
896
1016
|
const httpProtocol = /^https?$/;
|
|
897
1017
|
const e164 = /^\+[1-9]\d{6,14}$/;
|
|
898
1018
|
const dateSource = `(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;
|
|
@@ -920,10 +1040,7 @@ window.__ModuleLoader__.load({
|
|
|
920
1040
|
const timeRegex = args.local ? `${qualified}|${timeSource({ precision: args.precision })}` : qualified;
|
|
921
1041
|
return new RegExp(`^${dateSource}T(?:${timeRegex})$`);
|
|
922
1042
|
}
|
|
923
|
-
const
|
|
924
|
-
const regex = params ? `[\\s\\S]{${params?.minimum ?? 0},${params?.maximum ?? ""}}` : `[\\s\\S]*`;
|
|
925
|
-
return new RegExp(`^${regex}$`);
|
|
926
|
-
};
|
|
1043
|
+
const anyString = /^[\s\S]{0,}$/;
|
|
927
1044
|
const integer = /^-?\d+$/;
|
|
928
1045
|
const number$1 = /^-?\d+(?:\.\d+)?$/;
|
|
929
1046
|
const boolean$1 = /^(?:true|false)$/i;
|
|
@@ -931,7 +1048,7 @@ window.__ModuleLoader__.load({
|
|
|
931
1048
|
const lowercase = /^[^A-Z]*$/;
|
|
932
1049
|
const uppercase = /^[^a-z]*$/;
|
|
933
1050
|
//#endregion
|
|
934
|
-
//#region
|
|
1051
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/checks.js
|
|
935
1052
|
const $ZodCheck = /*@__PURE__*/ $constructor("$ZodCheck", (inst, def) => {
|
|
936
1053
|
var _a;
|
|
937
1054
|
inst._zod ?? (inst._zod = {});
|
|
@@ -951,14 +1068,6 @@ window.__ModuleLoader__.load({
|
|
|
951
1068
|
const $ZodCheckLessThan = /*@__PURE__*/ $constructor("$ZodCheckLessThan", (inst, def) => {
|
|
952
1069
|
$ZodCheck.init(inst, def);
|
|
953
1070
|
const origin = numericOriginMap[typeof def.value];
|
|
954
|
-
inst._zod.onattach.push((inst) => {
|
|
955
|
-
const bag = inst._zod.bag;
|
|
956
|
-
const curr = (def.inclusive ? bag.maximum : bag.exclusiveMaximum) ?? Number.POSITIVE_INFINITY;
|
|
957
|
-
if (def.value < curr) {
|
|
958
|
-
if (def.inclusive) bag.maximum = def.value;
|
|
959
|
-
else bag.exclusiveMaximum = def.value;
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
1071
|
inst._zod.check = (payload) => {
|
|
963
1072
|
if (def.inclusive ? payload.value <= def.value : payload.value < def.value) return;
|
|
964
1073
|
payload.issues.push({
|
|
@@ -975,14 +1084,6 @@ window.__ModuleLoader__.load({
|
|
|
975
1084
|
const $ZodCheckGreaterThan = /*@__PURE__*/ $constructor("$ZodCheckGreaterThan", (inst, def) => {
|
|
976
1085
|
$ZodCheck.init(inst, def);
|
|
977
1086
|
const origin = numericOriginMap[typeof def.value];
|
|
978
|
-
inst._zod.onattach.push((inst) => {
|
|
979
|
-
const bag = inst._zod.bag;
|
|
980
|
-
const curr = (def.inclusive ? bag.minimum : bag.exclusiveMinimum) ?? Number.NEGATIVE_INFINITY;
|
|
981
|
-
if (def.value > curr) {
|
|
982
|
-
if (def.inclusive) bag.minimum = def.value;
|
|
983
|
-
else bag.exclusiveMinimum = def.value;
|
|
984
|
-
}
|
|
985
|
-
});
|
|
986
1087
|
inst._zod.check = (payload) => {
|
|
987
1088
|
if (def.inclusive ? payload.value >= def.value : payload.value > def.value) return;
|
|
988
1089
|
payload.issues.push({
|
|
@@ -998,10 +1099,6 @@ window.__ModuleLoader__.load({
|
|
|
998
1099
|
});
|
|
999
1100
|
const $ZodCheckMultipleOf = /*@__PURE__*/ $constructor("$ZodCheckMultipleOf", (inst, def) => {
|
|
1000
1101
|
$ZodCheck.init(inst, def);
|
|
1001
|
-
inst._zod.onattach.push((inst) => {
|
|
1002
|
-
var _a;
|
|
1003
|
-
(_a = inst._zod.bag).multipleOf ?? (_a.multipleOf = def.value);
|
|
1004
|
-
});
|
|
1005
1102
|
inst._zod.check = (payload) => {
|
|
1006
1103
|
if (typeof payload.value !== typeof def.value) throw new Error("Cannot mix number and bigint in multiple_of check.");
|
|
1007
1104
|
if (typeof payload.value === "bigint" ? def.value !== BigInt(0) && payload.value % def.value === BigInt(0) : floatSafeRemainder(payload.value, def.value) === 0) return;
|
|
@@ -1021,13 +1118,6 @@ window.__ModuleLoader__.load({
|
|
|
1021
1118
|
const isInt = def.format?.includes("int");
|
|
1022
1119
|
const origin = isInt ? "int" : "number";
|
|
1023
1120
|
const [minimum, maximum] = NUMBER_FORMAT_RANGES[def.format];
|
|
1024
|
-
inst._zod.onattach.push((inst) => {
|
|
1025
|
-
const bag = inst._zod.bag;
|
|
1026
|
-
bag.format = def.format;
|
|
1027
|
-
bag.minimum = minimum;
|
|
1028
|
-
bag.maximum = maximum;
|
|
1029
|
-
if (isInt) bag.pattern = integer;
|
|
1030
|
-
});
|
|
1031
1121
|
inst._zod.check = (payload) => {
|
|
1032
1122
|
const input = payload.value;
|
|
1033
1123
|
if (isInt) {
|
|
@@ -1090,10 +1180,6 @@ window.__ModuleLoader__.load({
|
|
|
1090
1180
|
var _a;
|
|
1091
1181
|
$ZodCheck.init(inst, def);
|
|
1092
1182
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1093
|
-
inst._zod.onattach.push((inst) => {
|
|
1094
|
-
const curr = inst._zod.bag.maximum ?? Number.POSITIVE_INFINITY;
|
|
1095
|
-
if (def.maximum < curr) inst._zod.bag.maximum = def.maximum;
|
|
1096
|
-
});
|
|
1097
1183
|
inst._zod.check = (payload) => {
|
|
1098
1184
|
const input = payload.value;
|
|
1099
1185
|
const units = input.length;
|
|
@@ -1114,10 +1200,6 @@ window.__ModuleLoader__.load({
|
|
|
1114
1200
|
var _a;
|
|
1115
1201
|
$ZodCheck.init(inst, def);
|
|
1116
1202
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1117
|
-
inst._zod.onattach.push((inst) => {
|
|
1118
|
-
const curr = inst._zod.bag.minimum ?? Number.NEGATIVE_INFINITY;
|
|
1119
|
-
if (def.minimum > curr) inst._zod.bag.minimum = def.minimum;
|
|
1120
|
-
});
|
|
1121
1203
|
inst._zod.check = (payload) => {
|
|
1122
1204
|
const input = payload.value;
|
|
1123
1205
|
const units = input.length;
|
|
@@ -1138,12 +1220,6 @@ window.__ModuleLoader__.load({
|
|
|
1138
1220
|
var _a;
|
|
1139
1221
|
$ZodCheck.init(inst, def);
|
|
1140
1222
|
(_a = inst._zod.def).when ?? (_a.when = _whenHasLength);
|
|
1141
|
-
inst._zod.onattach.push((inst) => {
|
|
1142
|
-
const bag = inst._zod.bag;
|
|
1143
|
-
bag.minimum = def.length;
|
|
1144
|
-
bag.maximum = def.length;
|
|
1145
|
-
bag.length = def.length;
|
|
1146
|
-
});
|
|
1147
1223
|
inst._zod.check = (payload) => {
|
|
1148
1224
|
const input = payload.value;
|
|
1149
1225
|
const units = input.length;
|
|
@@ -1171,14 +1247,6 @@ window.__ModuleLoader__.load({
|
|
|
1171
1247
|
const $ZodCheckStringFormat = /*@__PURE__*/ $constructor("$ZodCheckStringFormat", (inst, def) => {
|
|
1172
1248
|
var _a, _b;
|
|
1173
1249
|
$ZodCheck.init(inst, def);
|
|
1174
|
-
inst._zod.onattach.push((inst) => {
|
|
1175
|
-
const bag = inst._zod.bag;
|
|
1176
|
-
bag.format = def.format;
|
|
1177
|
-
if (def.pattern) {
|
|
1178
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1179
|
-
bag.patterns.add(def.pattern);
|
|
1180
|
-
}
|
|
1181
|
-
});
|
|
1182
1250
|
if (def.pattern) (_a = inst._zod).check ?? (_a.check = (payload) => {
|
|
1183
1251
|
def.pattern.lastIndex = 0;
|
|
1184
1252
|
if (def.pattern.test(payload.value)) return;
|
|
@@ -1221,13 +1289,7 @@ window.__ModuleLoader__.load({
|
|
|
1221
1289
|
const $ZodCheckIncludes = /*@__PURE__*/ $constructor("$ZodCheckIncludes", (inst, def) => {
|
|
1222
1290
|
$ZodCheck.init(inst, def);
|
|
1223
1291
|
const escapedRegex = escapeRegex(def.includes);
|
|
1224
|
-
|
|
1225
|
-
def.pattern = pattern;
|
|
1226
|
-
inst._zod.onattach.push((inst) => {
|
|
1227
|
-
const bag = inst._zod.bag;
|
|
1228
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1229
|
-
bag.patterns.add(pattern);
|
|
1230
|
-
});
|
|
1292
|
+
def.pattern = new RegExp(typeof def.position === "number" ? `^.{${def.position},}${escapedRegex}` : escapedRegex);
|
|
1231
1293
|
inst._zod.check = (payload) => {
|
|
1232
1294
|
if (payload.value.includes(def.includes, def.position)) return;
|
|
1233
1295
|
payload.issues.push({
|
|
@@ -1245,11 +1307,6 @@ window.__ModuleLoader__.load({
|
|
|
1245
1307
|
$ZodCheck.init(inst, def);
|
|
1246
1308
|
const pattern = new RegExp(`^${escapeRegex(def.prefix)}.*`);
|
|
1247
1309
|
def.pattern ?? (def.pattern = pattern);
|
|
1248
|
-
inst._zod.onattach.push((inst) => {
|
|
1249
|
-
const bag = inst._zod.bag;
|
|
1250
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1251
|
-
bag.patterns.add(pattern);
|
|
1252
|
-
});
|
|
1253
1310
|
inst._zod.check = (payload) => {
|
|
1254
1311
|
if (payload.value.startsWith(def.prefix)) return;
|
|
1255
1312
|
payload.issues.push({
|
|
@@ -1267,11 +1324,6 @@ window.__ModuleLoader__.load({
|
|
|
1267
1324
|
$ZodCheck.init(inst, def);
|
|
1268
1325
|
const pattern = new RegExp(`.*${escapeRegex(def.suffix)}$`);
|
|
1269
1326
|
def.pattern ?? (def.pattern = pattern);
|
|
1270
|
-
inst._zod.onattach.push((inst) => {
|
|
1271
|
-
const bag = inst._zod.bag;
|
|
1272
|
-
bag.patterns ?? (bag.patterns = /* @__PURE__ */ new Set());
|
|
1273
|
-
bag.patterns.add(pattern);
|
|
1274
|
-
});
|
|
1275
1327
|
inst._zod.check = (payload) => {
|
|
1276
1328
|
if (payload.value.endsWith(def.suffix)) return;
|
|
1277
1329
|
payload.issues.push({
|
|
@@ -1292,7 +1344,7 @@ window.__ModuleLoader__.load({
|
|
|
1292
1344
|
};
|
|
1293
1345
|
});
|
|
1294
1346
|
//#endregion
|
|
1295
|
-
//#region
|
|
1347
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/doc.js
|
|
1296
1348
|
var Doc = class {
|
|
1297
1349
|
constructor(args = [], closed = {}) {
|
|
1298
1350
|
this.content = [];
|
|
@@ -1302,8 +1354,11 @@ window.__ModuleLoader__.load({
|
|
|
1302
1354
|
}
|
|
1303
1355
|
indented(fn) {
|
|
1304
1356
|
this.indent += 1;
|
|
1305
|
-
|
|
1306
|
-
|
|
1357
|
+
try {
|
|
1358
|
+
fn(this);
|
|
1359
|
+
} finally {
|
|
1360
|
+
this.indent -= 1;
|
|
1361
|
+
}
|
|
1307
1362
|
}
|
|
1308
1363
|
write(arg) {
|
|
1309
1364
|
if (typeof arg === "function") {
|
|
@@ -1323,14 +1378,14 @@ window.__ModuleLoader__.load({
|
|
|
1323
1378
|
}
|
|
1324
1379
|
};
|
|
1325
1380
|
//#endregion
|
|
1326
|
-
//#region
|
|
1381
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/versions.js
|
|
1327
1382
|
const version = {
|
|
1328
1383
|
major: 4,
|
|
1329
|
-
minor:
|
|
1330
|
-
patch:
|
|
1384
|
+
minor: 6,
|
|
1385
|
+
patch: 5
|
|
1331
1386
|
};
|
|
1332
1387
|
//#endregion
|
|
1333
|
-
//#region
|
|
1388
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/schemas.js
|
|
1334
1389
|
const $ZodType = /*@__PURE__*/ $constructor("$ZodType", (inst, def) => {
|
|
1335
1390
|
var _a;
|
|
1336
1391
|
inst ?? (inst = {});
|
|
@@ -1419,15 +1474,26 @@ window.__ModuleLoader__.load({
|
|
|
1419
1474
|
}
|
|
1420
1475
|
});
|
|
1421
1476
|
/** The Standard Schema surface for `inst`. Shared so wrappers can extend it without forcing it. */
|
|
1422
|
-
const toStandardResult = (r) => r.
|
|
1477
|
+
const toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config())) } : { value: r.value };
|
|
1478
|
+
async function validateAsync(inst, value) {
|
|
1479
|
+
const ctx = { async: true };
|
|
1480
|
+
return toStandardResult(await inst._zod.run({
|
|
1481
|
+
value,
|
|
1482
|
+
issues: []
|
|
1483
|
+
}, ctx), ctx);
|
|
1484
|
+
}
|
|
1423
1485
|
function standardProps(inst) {
|
|
1424
1486
|
return {
|
|
1425
1487
|
validate: (value) => {
|
|
1488
|
+
const ctx = { async: false };
|
|
1426
1489
|
try {
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1490
|
+
const r = inst._zod.run({
|
|
1491
|
+
value,
|
|
1492
|
+
issues: []
|
|
1493
|
+
}, ctx);
|
|
1494
|
+
if (!(r instanceof Promise)) return toStandardResult(r, ctx);
|
|
1495
|
+
} catch (_) {}
|
|
1496
|
+
return validateAsync(inst, value);
|
|
1431
1497
|
},
|
|
1432
1498
|
vendor: "zod",
|
|
1433
1499
|
version: 1
|
|
@@ -1435,7 +1501,7 @@ window.__ModuleLoader__.load({
|
|
|
1435
1501
|
}
|
|
1436
1502
|
const $ZodString = /*@__PURE__*/ $constructor("$ZodString", (inst, def) => {
|
|
1437
1503
|
$ZodType.init(inst, def);
|
|
1438
|
-
inst._zod.pattern =
|
|
1504
|
+
inst._zod.pattern = def.pattern ?? anyString;
|
|
1439
1505
|
inst._zod.parse = (payload, _) => {
|
|
1440
1506
|
if (def.coerce) try {
|
|
1441
1507
|
payload.value = String(payload.value);
|
|
@@ -1479,10 +1545,27 @@ window.__ModuleLoader__.load({
|
|
|
1479
1545
|
def.pattern ?? (def.pattern = email);
|
|
1480
1546
|
$ZodStringFormat.init(inst, def);
|
|
1481
1547
|
});
|
|
1482
|
-
|
|
1548
|
+
function canParseURL(input) {
|
|
1549
|
+
try {
|
|
1550
|
+
if (typeof URL !== "undefined" && typeof URL.canParse === "function") return URL.canParse(input);
|
|
1551
|
+
new URL(input);
|
|
1552
|
+
return true;
|
|
1553
|
+
} catch {
|
|
1554
|
+
return false;
|
|
1555
|
+
}
|
|
1556
|
+
}
|
|
1557
|
+
function validateURL(trimmed, def) {
|
|
1558
|
+
if (!("normalize" in def) && !("hostname" in def) && !("protocol" in def)) return canParseURL(trimmed) || 2;
|
|
1559
|
+
return parseURLObject(trimmed, def);
|
|
1560
|
+
}
|
|
1561
|
+
/** Parses a URL while preserving the non-normalizing HTTP guard. */
|
|
1483
1562
|
function parseURLObject(trimmed, def) {
|
|
1484
1563
|
if (!def.normalize && def.protocol?.source === httpProtocol.source && !/^https?:\/\//i.test(trimmed)) return 1;
|
|
1485
1564
|
try {
|
|
1565
|
+
if (typeof URL !== "undefined") {
|
|
1566
|
+
const URLStatic = URL;
|
|
1567
|
+
if (typeof URLStatic.parse === "function") return URLStatic.parse(trimmed) ?? 2;
|
|
1568
|
+
}
|
|
1486
1569
|
return new URL(trimmed);
|
|
1487
1570
|
} catch {
|
|
1488
1571
|
return 2;
|
|
@@ -1506,7 +1589,7 @@ window.__ModuleLoader__.load({
|
|
|
1506
1589
|
inst._zod.check = (payload) => {
|
|
1507
1590
|
try {
|
|
1508
1591
|
const trimmed = payload.value.trim();
|
|
1509
|
-
const url =
|
|
1592
|
+
const url = validateURL(trimmed, def);
|
|
1510
1593
|
if (url === 1) {
|
|
1511
1594
|
payload.issues.push({
|
|
1512
1595
|
code: "invalid_format",
|
|
@@ -1528,6 +1611,10 @@ window.__ModuleLoader__.load({
|
|
|
1528
1611
|
});
|
|
1529
1612
|
return;
|
|
1530
1613
|
}
|
|
1614
|
+
if (url === true) {
|
|
1615
|
+
payload.value = stripTabAndNewline(trimmed);
|
|
1616
|
+
return;
|
|
1617
|
+
}
|
|
1531
1618
|
if (def.hostname && !urlHostnameOk(url, def.hostname)) payload.issues.push({
|
|
1532
1619
|
code: "invalid_format",
|
|
1533
1620
|
format: "url",
|
|
@@ -1596,12 +1683,6 @@ window.__ModuleLoader__.load({
|
|
|
1596
1683
|
const $ZodISODateTime = /*@__PURE__*/ $constructor("$ZodISODateTime", (inst, def) => {
|
|
1597
1684
|
def.pattern ?? (def.pattern = datetime(def));
|
|
1598
1685
|
$ZodStringFormat.init(inst, def);
|
|
1599
|
-
if (def.local || def.precision === -1) {
|
|
1600
|
-
inst._zod.bag.laxFormat = true;
|
|
1601
|
-
inst._zod.onattach.push((s) => {
|
|
1602
|
-
s._zod.bag.laxFormat = true;
|
|
1603
|
-
});
|
|
1604
|
-
}
|
|
1605
1686
|
});
|
|
1606
1687
|
const $ZodISODate = /*@__PURE__*/ $constructor("$ZodISODate", (inst, def) => {
|
|
1607
1688
|
def.pattern ?? (def.pattern = date);
|
|
@@ -1618,23 +1699,16 @@ window.__ModuleLoader__.load({
|
|
|
1618
1699
|
const $ZodIPv4 = /*@__PURE__*/ $constructor("$ZodIPv4", (inst, def) => {
|
|
1619
1700
|
def.pattern ?? (def.pattern = ipv4);
|
|
1620
1701
|
$ZodStringFormat.init(inst, def);
|
|
1621
|
-
inst._zod.bag.format = `ipv4`;
|
|
1622
1702
|
});
|
|
1623
1703
|
/** An IPv6 address is written with hex digits, colons and dots, and nothing else. The guard is what makes the check below an IPv6 check: `new URL("http://[...]")` parses an authority, not an address, so `@` and `\` re-delimit it and `"::@1\\"` validates against the host `0.0.0.1`. The URL parser also deletes ASCII tab, LF and CR rather than failing, which is how `"::1\n"` validated as `::1`. */
|
|
1624
1704
|
const ipv6Alphabet = /^[0-9a-fA-F:.]+$/;
|
|
1625
1705
|
function isValidIPv6(value) {
|
|
1626
1706
|
if (!ipv6Alphabet.test(value)) return false;
|
|
1627
|
-
|
|
1628
|
-
new URL(`http://[${value}]`);
|
|
1629
|
-
return true;
|
|
1630
|
-
} catch {
|
|
1631
|
-
return false;
|
|
1632
|
-
}
|
|
1707
|
+
return canParseURL(`http://[${value}]`);
|
|
1633
1708
|
}
|
|
1634
1709
|
const $ZodIPv6 = /*@__PURE__*/ $constructor("$ZodIPv6", (inst, def) => {
|
|
1635
1710
|
def.pattern ?? (def.pattern = ipv6);
|
|
1636
1711
|
$ZodStringFormat.init(inst, def);
|
|
1637
|
-
inst._zod.bag.format = `ipv6`;
|
|
1638
1712
|
inst._zod.check = (payload) => {
|
|
1639
1713
|
if (!isValidIPv6(payload.value)) payload.issues.push({
|
|
1640
1714
|
code: "invalid_format",
|
|
@@ -1683,10 +1757,10 @@ window.__ModuleLoader__.load({
|
|
|
1683
1757
|
return false;
|
|
1684
1758
|
}
|
|
1685
1759
|
}
|
|
1760
|
+
const base64Charset = /^[0-9a-zA-Z+/]*={0,2}$/;
|
|
1686
1761
|
const $ZodBase64 = /*@__PURE__*/ $constructor("$ZodBase64", (inst, def) => {
|
|
1687
|
-
def.pattern ?? (def.pattern =
|
|
1762
|
+
def.pattern ?? (def.pattern = base64Charset);
|
|
1688
1763
|
$ZodStringFormat.init(inst, def);
|
|
1689
|
-
inst._zod.bag.contentEncoding = "base64";
|
|
1690
1764
|
inst._zod.check = (payload) => {
|
|
1691
1765
|
if (isValidBase64(payload.value)) return;
|
|
1692
1766
|
payload.issues.push({
|
|
@@ -1698,15 +1772,15 @@ window.__ModuleLoader__.load({
|
|
|
1698
1772
|
});
|
|
1699
1773
|
};
|
|
1700
1774
|
});
|
|
1775
|
+
const base64urlCharset = /^[A-Za-z0-9_-]*$/;
|
|
1701
1776
|
function isValidBase64URL(data) {
|
|
1702
|
-
if (!
|
|
1777
|
+
if (!base64urlCharset.test(data)) return false;
|
|
1703
1778
|
const base64 = data.replace(/[-_]/g, (c) => c === "-" ? "+" : "/");
|
|
1704
1779
|
return isValidBase64(base64.padEnd(Math.ceil(base64.length / 4) * 4, "="));
|
|
1705
1780
|
}
|
|
1706
1781
|
const $ZodBase64URL = /*@__PURE__*/ $constructor("$ZodBase64URL", (inst, def) => {
|
|
1707
|
-
def.pattern ?? (def.pattern =
|
|
1782
|
+
def.pattern ?? (def.pattern = base64urlCharset);
|
|
1708
1783
|
$ZodStringFormat.init(inst, def);
|
|
1709
|
-
inst._zod.bag.contentEncoding = "base64url";
|
|
1710
1784
|
inst._zod.check = (payload) => {
|
|
1711
1785
|
if (isValidBase64URL(payload.value)) return;
|
|
1712
1786
|
payload.issues.push({
|
|
@@ -1752,7 +1826,7 @@ window.__ModuleLoader__.load({
|
|
|
1752
1826
|
});
|
|
1753
1827
|
const $ZodNumber = /*@__PURE__*/ $constructor("$ZodNumber", (inst, def) => {
|
|
1754
1828
|
$ZodType.init(inst, def);
|
|
1755
|
-
inst._zod.pattern =
|
|
1829
|
+
inst._zod.pattern = number$1;
|
|
1756
1830
|
inst._zod.parse = (payload, _ctx) => {
|
|
1757
1831
|
if (def.coerce) try {
|
|
1758
1832
|
payload.value = Number(payload.value);
|
|
@@ -1845,6 +1919,7 @@ window.__ModuleLoader__.load({
|
|
|
1845
1919
|
}
|
|
1846
1920
|
payload.value = memo ? memo.alloc(inst, payload, Array(input.length), ctx) : Array(input.length);
|
|
1847
1921
|
const proms = [];
|
|
1922
|
+
const abortEarly = ctx?.abortEarly;
|
|
1848
1923
|
for (let i = 0; i < input.length; i++) {
|
|
1849
1924
|
const item = input[i];
|
|
1850
1925
|
const result = def.element._zod.run({
|
|
@@ -1852,7 +1927,10 @@ window.__ModuleLoader__.load({
|
|
|
1852
1927
|
issues: []
|
|
1853
1928
|
}, ctx);
|
|
1854
1929
|
if (result instanceof Promise) proms.push(result.then((result) => handleArrayResult(result, payload, i)));
|
|
1855
|
-
else
|
|
1930
|
+
else {
|
|
1931
|
+
handleArrayResult(result, payload, i);
|
|
1932
|
+
if (abortEarly && result.issues.length !== 0 && aborted(result)) break;
|
|
1933
|
+
}
|
|
1856
1934
|
}
|
|
1857
1935
|
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
1858
1936
|
return payload;
|
|
@@ -1876,7 +1954,7 @@ window.__ModuleLoader__.load({
|
|
|
1876
1954
|
return;
|
|
1877
1955
|
}
|
|
1878
1956
|
if (result.value === void 0) {
|
|
1879
|
-
if (isPresent) final.value[key] = void 0;
|
|
1957
|
+
if (isPresent || optin === "defaulted" && !isOptionalOut) final.value[key] = void 0;
|
|
1880
1958
|
} else final.value[key] = result.value;
|
|
1881
1959
|
}
|
|
1882
1960
|
const NO_SYMBOL_KEYS = [];
|
|
@@ -1896,14 +1974,19 @@ window.__ModuleLoader__.load({
|
|
|
1896
1974
|
optionalKeys: new Set(okeys)
|
|
1897
1975
|
};
|
|
1898
1976
|
}
|
|
1899
|
-
function handleCatchall(proms, input, payload, ctx, def, inst) {
|
|
1977
|
+
function handleCatchall(proms, input, payload, ctx, def, inst, abortEarly) {
|
|
1900
1978
|
const unrecognized = [];
|
|
1901
1979
|
const keySet = def.keySet;
|
|
1902
1980
|
const _catchall = def.catchall._zod;
|
|
1903
1981
|
const t = _catchall.def.type;
|
|
1904
1982
|
const optin = _catchall.optin;
|
|
1905
1983
|
const optout = _catchall.optout;
|
|
1984
|
+
let seen = 0;
|
|
1906
1985
|
for (const key in input) {
|
|
1986
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
1987
|
+
if (aborted(payload, seen)) break;
|
|
1988
|
+
seen = payload.issues.length;
|
|
1989
|
+
}
|
|
1907
1990
|
if (keySet.has(key)) continue;
|
|
1908
1991
|
if (key === "__proto__") {
|
|
1909
1992
|
if (t === "never") unrecognized.push(key);
|
|
@@ -1932,18 +2015,19 @@ window.__ModuleLoader__.load({
|
|
|
1932
2015
|
return payload;
|
|
1933
2016
|
});
|
|
1934
2017
|
}
|
|
1935
|
-
const propShapes = /* @__PURE__ */ new WeakMap();
|
|
1936
2018
|
const $ZodObject = /*@__PURE__*/ $constructor("$ZodObject", (inst, def) => {
|
|
1937
2019
|
$ZodType.init(inst, def);
|
|
1938
|
-
|
|
1939
|
-
|
|
1940
|
-
|
|
1941
|
-
|
|
2020
|
+
const desc = Object.getOwnPropertyDescriptor(def, "shape");
|
|
2021
|
+
const sh = desc?.get ? desc.get.raw : def.shape ?? {};
|
|
2022
|
+
if (sh) {
|
|
2023
|
+
const get = () => {
|
|
1942
2024
|
const newSh = { ...sh };
|
|
1943
2025
|
Object.defineProperty(def, "shape", { value: newSh });
|
|
1944
|
-
|
|
2026
|
+
get.raw = newSh;
|
|
1945
2027
|
return newSh;
|
|
1946
|
-
}
|
|
2028
|
+
};
|
|
2029
|
+
get.raw = sh;
|
|
2030
|
+
Object.defineProperty(def, "shape", { get });
|
|
1947
2031
|
}
|
|
1948
2032
|
const _normalized = cached(() => normalizeDef(def));
|
|
1949
2033
|
defineLazyInternal(inst, "propValues", (zod) => {
|
|
@@ -1959,7 +2043,7 @@ window.__ModuleLoader__.load({
|
|
|
1959
2043
|
}
|
|
1960
2044
|
return propValues;
|
|
1961
2045
|
});
|
|
1962
|
-
const isObject$
|
|
2046
|
+
const isObject$2 = isObject;
|
|
1963
2047
|
const catchall = def.catchall;
|
|
1964
2048
|
let value;
|
|
1965
2049
|
const memo = globalConfig.memoizer;
|
|
@@ -1967,7 +2051,7 @@ window.__ModuleLoader__.load({
|
|
|
1967
2051
|
inst._zod.parse = (payload, ctx) => {
|
|
1968
2052
|
value ?? (value = _normalized.value);
|
|
1969
2053
|
const input = payload.value;
|
|
1970
|
-
if (!isObject$
|
|
2054
|
+
if (!isObject$2(input)) {
|
|
1971
2055
|
payload.issues.push({
|
|
1972
2056
|
expected: "object",
|
|
1973
2057
|
code: "invalid_type",
|
|
@@ -1979,7 +2063,13 @@ window.__ModuleLoader__.load({
|
|
|
1979
2063
|
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
1980
2064
|
const proms = [];
|
|
1981
2065
|
const shape = value.shape;
|
|
2066
|
+
const abortEarly = ctx?.abortEarly;
|
|
2067
|
+
let seen = payload.issues.length;
|
|
1982
2068
|
for (const key of value.allKeys) {
|
|
2069
|
+
if (abortEarly && payload.issues.length !== seen) {
|
|
2070
|
+
if (aborted(payload, seen)) break;
|
|
2071
|
+
seen = payload.issues.length;
|
|
2072
|
+
}
|
|
1983
2073
|
if (key === "__proto__") continue;
|
|
1984
2074
|
const el = shape[key];
|
|
1985
2075
|
const optin = el._zod.optin;
|
|
@@ -1992,7 +2082,7 @@ window.__ModuleLoader__.load({
|
|
|
1992
2082
|
else handlePropertyResult(r, payload, key, input, optin, optout);
|
|
1993
2083
|
}
|
|
1994
2084
|
if (!catchall) return proms.length ? Promise.all(proms).then(() => payload) : payload;
|
|
1995
|
-
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
|
|
2085
|
+
return handleCatchall(proms, input, payload, ctx, _normalized.value, inst, abortEarly === true);
|
|
1996
2086
|
};
|
|
1997
2087
|
});
|
|
1998
2088
|
const $ZodObjectJIT = /*@__PURE__*/ $constructor("$ZodObjectJIT", (inst, def) => {
|
|
@@ -2011,10 +2101,16 @@ window.__ModuleLoader__.load({
|
|
|
2011
2101
|
});
|
|
2012
2102
|
const parseStr = (k) => `shape[${k}]._zod.run({ value: input[${k}], issues: [] }, ctx)`;
|
|
2013
2103
|
const prefixStr = (id, k) => `
|
|
2104
|
+
let ${id}_ab = false;
|
|
2014
2105
|
for (let i = 0; i < ${id}.issues.length; i++) {
|
|
2015
2106
|
const iss = ${id}.issues[i];
|
|
2016
2107
|
iss.path = iss.path ? [${k}, ...iss.path] : [${k}];
|
|
2017
2108
|
payload.issues.push(iss);
|
|
2109
|
+
if (iss.continue !== true) ${id}_ab = true;
|
|
2110
|
+
}
|
|
2111
|
+
if (${id}_ab && ctx && ctx.abortEarly) {
|
|
2112
|
+
payload.value = newResult;
|
|
2113
|
+
return payload;
|
|
2018
2114
|
}`;
|
|
2019
2115
|
doc.write(`const input = payload.value;`);
|
|
2020
2116
|
const ids = Object.create(null);
|
|
@@ -2056,6 +2152,10 @@ window.__ModuleLoader__.load({
|
|
|
2056
2152
|
input: undefined,
|
|
2057
2153
|
path: [${k}]
|
|
2058
2154
|
});
|
|
2155
|
+
if (ctx && ctx.abortEarly) {
|
|
2156
|
+
payload.value = newResult;
|
|
2157
|
+
return payload;
|
|
2158
|
+
}
|
|
2059
2159
|
}
|
|
2060
2160
|
|
|
2061
2161
|
if (${id}_present) {
|
|
@@ -2063,26 +2163,25 @@ window.__ModuleLoader__.load({
|
|
|
2063
2163
|
}
|
|
2064
2164
|
|
|
2065
2165
|
`);
|
|
2066
|
-
else
|
|
2166
|
+
else {
|
|
2167
|
+
doc.write(`
|
|
2067
2168
|
if (${id}.issues.length) {${prefixStr(id, k)}
|
|
2068
2169
|
}
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
}
|
|
2074
|
-
} else {
|
|
2170
|
+
`);
|
|
2171
|
+
if (optin === "defaulted") doc.write(`newResult[${k}] = ${id}.value;`);
|
|
2172
|
+
else doc.write(`
|
|
2173
|
+
if (${id}.value !== undefined || ${isPresent}) {
|
|
2075
2174
|
newResult[${k}] = ${id}.value;
|
|
2076
2175
|
}
|
|
2077
|
-
|
|
2078
2176
|
`);
|
|
2177
|
+
}
|
|
2079
2178
|
}
|
|
2080
2179
|
doc.write(`payload.value = newResult;`);
|
|
2081
2180
|
doc.write(`return payload;`);
|
|
2082
2181
|
return doc.compile();
|
|
2083
2182
|
};
|
|
2084
2183
|
let fastpass;
|
|
2085
|
-
const isObject$
|
|
2184
|
+
const isObject$1 = isObject;
|
|
2086
2185
|
const jit = !globalConfig.jitless;
|
|
2087
2186
|
const fastEnabled = jit && allowsEval.value;
|
|
2088
2187
|
const catchall = def.catchall;
|
|
@@ -2090,7 +2189,7 @@ window.__ModuleLoader__.load({
|
|
|
2090
2189
|
inst._zod.parse = (payload, ctx) => {
|
|
2091
2190
|
value ?? (value = _normalized.value);
|
|
2092
2191
|
const input = payload.value;
|
|
2093
|
-
if (!isObject$
|
|
2192
|
+
if (!isObject$1(input)) {
|
|
2094
2193
|
payload.issues.push({
|
|
2095
2194
|
expected: "object",
|
|
2096
2195
|
code: "invalid_type",
|
|
@@ -2103,7 +2202,7 @@ window.__ModuleLoader__.load({
|
|
|
2103
2202
|
if (!fastpass) fastpass = generateFastpass(def.shape);
|
|
2104
2203
|
payload = fastpass(payload, ctx);
|
|
2105
2204
|
if (!catchall) return payload;
|
|
2106
|
-
return handleCatchall([], input, payload, ctx, value, inst);
|
|
2205
|
+
return handleCatchall([], input, payload, ctx, value, inst, ctx?.abortEarly === true);
|
|
2107
2206
|
}
|
|
2108
2207
|
return superParse(payload, ctx);
|
|
2109
2208
|
};
|
|
@@ -2277,13 +2376,147 @@ window.__ModuleLoader__.load({
|
|
|
2277
2376
|
result.value = merged.data;
|
|
2278
2377
|
return result;
|
|
2279
2378
|
}
|
|
2379
|
+
const $ZodRecord = /*@__PURE__*/ $constructor("$ZodRecord", (inst, def) => {
|
|
2380
|
+
$ZodType.init(inst, def);
|
|
2381
|
+
const memo = globalConfig.memoizer;
|
|
2382
|
+
memo?.attach(inst);
|
|
2383
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2384
|
+
const input = payload.value;
|
|
2385
|
+
if (!isPlainObject(input)) {
|
|
2386
|
+
payload.issues.push({
|
|
2387
|
+
expected: "record",
|
|
2388
|
+
code: "invalid_type",
|
|
2389
|
+
input,
|
|
2390
|
+
inst
|
|
2391
|
+
});
|
|
2392
|
+
return payload;
|
|
2393
|
+
}
|
|
2394
|
+
const proms = [];
|
|
2395
|
+
const values = def.keyType._zod.values;
|
|
2396
|
+
if (values && !def.partial) {
|
|
2397
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2398
|
+
const recordKeys = /* @__PURE__ */ new Set();
|
|
2399
|
+
for (const key of values) if (typeof key === "string" || typeof key === "number" || typeof key === "symbol") {
|
|
2400
|
+
recordKeys.add(typeof key === "number" ? key.toString() : key);
|
|
2401
|
+
if (key === "__proto__") continue;
|
|
2402
|
+
const keyResult = def.keyType._zod.run({
|
|
2403
|
+
value: key,
|
|
2404
|
+
issues: []
|
|
2405
|
+
}, ctx);
|
|
2406
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2407
|
+
if (keyResult.issues.length) {
|
|
2408
|
+
payload.issues.push({
|
|
2409
|
+
code: "invalid_key",
|
|
2410
|
+
origin: "record",
|
|
2411
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2412
|
+
input: key,
|
|
2413
|
+
path: [key],
|
|
2414
|
+
inst
|
|
2415
|
+
});
|
|
2416
|
+
continue;
|
|
2417
|
+
}
|
|
2418
|
+
const outKey = keyResult.value;
|
|
2419
|
+
if (outKey === "__proto__") continue;
|
|
2420
|
+
const result = def.valueType._zod.run({
|
|
2421
|
+
value: input[key],
|
|
2422
|
+
issues: []
|
|
2423
|
+
}, ctx);
|
|
2424
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2425
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2426
|
+
payload.value[outKey] = result.value;
|
|
2427
|
+
}));
|
|
2428
|
+
else {
|
|
2429
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2430
|
+
payload.value[outKey] = result.value;
|
|
2431
|
+
}
|
|
2432
|
+
}
|
|
2433
|
+
let unrecognized;
|
|
2434
|
+
for (const key in input) if (!recordKeys.has(key)) {
|
|
2435
|
+
if (def.mode === "loose") {
|
|
2436
|
+
if (key === "__proto__") continue;
|
|
2437
|
+
payload.value[key] = input[key];
|
|
2438
|
+
} else {
|
|
2439
|
+
unrecognized = unrecognized ?? [];
|
|
2440
|
+
unrecognized.push(key);
|
|
2441
|
+
}
|
|
2442
|
+
}
|
|
2443
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2444
|
+
code: "unrecognized_keys",
|
|
2445
|
+
input,
|
|
2446
|
+
inst,
|
|
2447
|
+
keys: unrecognized,
|
|
2448
|
+
continue: true
|
|
2449
|
+
});
|
|
2450
|
+
} else {
|
|
2451
|
+
payload.value = memo ? memo.alloc(inst, payload, {}, ctx) : {};
|
|
2452
|
+
let unrecognized;
|
|
2453
|
+
for (const key of Reflect.ownKeys(input)) {
|
|
2454
|
+
if (key === "__proto__") continue;
|
|
2455
|
+
if (!Object.prototype.propertyIsEnumerable.call(input, key)) continue;
|
|
2456
|
+
let keyResult = def.keyType._zod.run({
|
|
2457
|
+
value: key,
|
|
2458
|
+
issues: []
|
|
2459
|
+
}, ctx);
|
|
2460
|
+
if (keyResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2461
|
+
if (typeof key === "string" && number$1.test(key) && keyResult.issues.length) {
|
|
2462
|
+
const retryResult = def.keyType._zod.run({
|
|
2463
|
+
value: Number(key),
|
|
2464
|
+
issues: []
|
|
2465
|
+
}, ctx);
|
|
2466
|
+
if (retryResult instanceof Promise) throw new Error("Async schemas not supported in object keys currently");
|
|
2467
|
+
if (retryResult.issues.length === 0) keyResult = retryResult;
|
|
2468
|
+
}
|
|
2469
|
+
if (keyResult.issues.length) {
|
|
2470
|
+
if (def.mode === "loose") payload.value[key] = input[key];
|
|
2471
|
+
else if (values) {
|
|
2472
|
+
unrecognized = unrecognized ?? [];
|
|
2473
|
+
unrecognized.push(key);
|
|
2474
|
+
} else payload.issues.push({
|
|
2475
|
+
code: "invalid_key",
|
|
2476
|
+
origin: "record",
|
|
2477
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config())),
|
|
2478
|
+
input: key,
|
|
2479
|
+
path: [key],
|
|
2480
|
+
inst
|
|
2481
|
+
});
|
|
2482
|
+
continue;
|
|
2483
|
+
}
|
|
2484
|
+
const outKey = keyResult.value;
|
|
2485
|
+
if (outKey === "__proto__") continue;
|
|
2486
|
+
const result = def.valueType._zod.run({
|
|
2487
|
+
value: input[key],
|
|
2488
|
+
issues: []
|
|
2489
|
+
}, ctx);
|
|
2490
|
+
if (result instanceof Promise) proms.push(result.then((result) => {
|
|
2491
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2492
|
+
payload.value[outKey] = result.value;
|
|
2493
|
+
}));
|
|
2494
|
+
else {
|
|
2495
|
+
if (result.issues.length) payload.issues.push(...prefixIssues(key, result.issues));
|
|
2496
|
+
payload.value[outKey] = result.value;
|
|
2497
|
+
}
|
|
2498
|
+
}
|
|
2499
|
+
if (unrecognized && unrecognized.length > 0) payload.issues.push({
|
|
2500
|
+
code: "unrecognized_keys",
|
|
2501
|
+
input,
|
|
2502
|
+
inst,
|
|
2503
|
+
keys: unrecognized,
|
|
2504
|
+
continue: true
|
|
2505
|
+
});
|
|
2506
|
+
}
|
|
2507
|
+
if (proms.length) return Promise.all(proms).then(() => payload);
|
|
2508
|
+
return payload;
|
|
2509
|
+
};
|
|
2510
|
+
});
|
|
2280
2511
|
const $ZodEnum = /*@__PURE__*/ $constructor("$ZodEnum", (inst, def) => {
|
|
2281
2512
|
$ZodType.init(inst, def);
|
|
2282
2513
|
const values = getEnumValues(def.entries);
|
|
2283
2514
|
const valuesSet = new Set(values);
|
|
2284
2515
|
inst._zod.values = valuesSet;
|
|
2285
|
-
|
|
2286
|
-
|
|
2516
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2517
|
+
const patternValues = getEnumValues(zod.def.entries).filter((k) => propertyKeyTypes.has(typeof k));
|
|
2518
|
+
return new RegExp(patternValues.length ? `^(${patternValues.map((o) => escapeRegex(o.toString())).join("|")})$` : "^[^\\s\\S]$");
|
|
2519
|
+
});
|
|
2287
2520
|
inst._zod.parse = (payload, _ctx) => {
|
|
2288
2521
|
const input = payload.value;
|
|
2289
2522
|
if (valuesSet.has(input)) return payload;
|
|
@@ -2300,7 +2533,10 @@ window.__ModuleLoader__.load({
|
|
|
2300
2533
|
$ZodType.init(inst, def);
|
|
2301
2534
|
const values = new Set(def.values);
|
|
2302
2535
|
inst._zod.values = values;
|
|
2303
|
-
inst
|
|
2536
|
+
defineLazyInternal(inst, "pattern", (zod) => {
|
|
2537
|
+
const vals = zod.def.values;
|
|
2538
|
+
return new RegExp(vals.length ? `^(${vals.map((o) => typeof o === "string" ? escapeRegex(o) : o ? escapeRegex(o.toString()) : String(o)).join("|")})$` : "^[^\\s\\S]$");
|
|
2539
|
+
});
|
|
2304
2540
|
inst._zod.parse = (payload, _ctx) => {
|
|
2305
2541
|
const input = payload.value;
|
|
2306
2542
|
if (values.has(input)) return payload;
|
|
@@ -2508,6 +2744,21 @@ window.__ModuleLoader__.load({
|
|
|
2508
2744
|
if (!payload.memo) payload.value = Object.freeze(payload.value);
|
|
2509
2745
|
return payload;
|
|
2510
2746
|
}
|
|
2747
|
+
const $ZodLazy = /*@__PURE__*/ $constructor("$ZodLazy", (inst, def) => {
|
|
2748
|
+
$ZodType.init(inst, def);
|
|
2749
|
+
defineLazy(inst._zod, "innerType", () => {
|
|
2750
|
+
const d = def;
|
|
2751
|
+
if (!d._cachedInner) d._cachedInner = def.getter();
|
|
2752
|
+
return d._cachedInner;
|
|
2753
|
+
});
|
|
2754
|
+
defineLazyInternal(inst, "pattern", (zod) => zod.innerType?._zod?.pattern);
|
|
2755
|
+
defineLazyInternal(inst, "propValues", (zod) => zod.innerType?._zod?.propValues);
|
|
2756
|
+
defineLazyInternal(inst, "optin", (zod) => zod.innerType?._zod?.optin ?? void 0);
|
|
2757
|
+
defineLazyInternal(inst, "optout", (zod) => zod.innerType?._zod?.optout ?? void 0);
|
|
2758
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2759
|
+
return inst._zod.innerType._zod.run(payload, ctx);
|
|
2760
|
+
};
|
|
2761
|
+
});
|
|
2511
2762
|
const $ZodCustom = /*@__PURE__*/ $constructor("$ZodCustom", (inst, def) => {
|
|
2512
2763
|
$ZodCheck.init(inst, def);
|
|
2513
2764
|
$ZodType.init(inst, def);
|
|
@@ -2535,7 +2786,7 @@ window.__ModuleLoader__.load({
|
|
|
2535
2786
|
}
|
|
2536
2787
|
}
|
|
2537
2788
|
//#endregion
|
|
2538
|
-
//#region
|
|
2789
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/memoizer.js
|
|
2539
2790
|
var $ZodCyclicError = class extends Error {
|
|
2540
2791
|
constructor() {
|
|
2541
2792
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -2545,6 +2796,9 @@ window.__ModuleLoader__.load({
|
|
|
2545
2796
|
/** Keyed off the context object every schema in one parse call already shares. */
|
|
2546
2797
|
const STATE = "~memo";
|
|
2547
2798
|
const NO_ISSUES = [];
|
|
2799
|
+
function isRef(value) {
|
|
2800
|
+
return value !== null && typeof value === "object";
|
|
2801
|
+
}
|
|
2548
2802
|
function cloneIssues(issues) {
|
|
2549
2803
|
return issues.map((iss) => iss.path ? {
|
|
2550
2804
|
...iss,
|
|
@@ -2552,22 +2806,44 @@ window.__ModuleLoader__.load({
|
|
|
2552
2806
|
} : { ...iss });
|
|
2553
2807
|
}
|
|
2554
2808
|
const recursive = /*@__PURE__*/ new WeakMap();
|
|
2809
|
+
/** What the walk established, in order of certainty: ordered so the strongest answer among children wins. */
|
|
2810
|
+
const NONE = 0;
|
|
2811
|
+
const ASSUMED = 1;
|
|
2812
|
+
const PROVEN = 2;
|
|
2555
2813
|
/** Whether this schema's subtree contains a cycle, so one parse can re-enter it. */
|
|
2556
|
-
function isRecursive(inst, stack) {
|
|
2814
|
+
function isRecursive(inst, stack, resolve) {
|
|
2557
2815
|
const cached = recursive.get(inst);
|
|
2558
|
-
if (cached !== void 0) return cached;
|
|
2559
|
-
if (stack.has(inst)) return
|
|
2816
|
+
if (cached !== void 0) return cached ? PROVEN : NONE;
|
|
2817
|
+
if (stack.has(inst)) return PROVEN;
|
|
2560
2818
|
stack.add(inst);
|
|
2561
|
-
let result =
|
|
2819
|
+
let result = NONE;
|
|
2562
2820
|
const check = (child) => {
|
|
2563
|
-
if (
|
|
2821
|
+
if (result !== PROVEN && child?._zod) {
|
|
2822
|
+
const answer = isRecursive(child, stack, resolve);
|
|
2823
|
+
if (answer > result) result = answer;
|
|
2824
|
+
}
|
|
2825
|
+
};
|
|
2826
|
+
const shape = (sh, spread) => {
|
|
2827
|
+
let answer = NONE;
|
|
2828
|
+
for (const key of Reflect.ownKeys(sh)) {
|
|
2829
|
+
const desc = Object.getOwnPropertyDescriptor(sh, key);
|
|
2830
|
+
if (spread && !desc.enumerable) continue;
|
|
2831
|
+
const child = desc.get ? ASSUMED : desc.value?._zod ? isRecursive(desc.value, stack, resolve) : NONE;
|
|
2832
|
+
if (child > answer) answer = child;
|
|
2833
|
+
}
|
|
2834
|
+
return answer;
|
|
2835
|
+
};
|
|
2836
|
+
const merge = (answer) => {
|
|
2837
|
+
if (answer > result) result = answer;
|
|
2564
2838
|
};
|
|
2565
2839
|
const def = inst._zod.def;
|
|
2566
2840
|
switch (def.type) {
|
|
2567
|
-
case "object":
|
|
2568
|
-
|
|
2841
|
+
case "object": {
|
|
2842
|
+
const raw = rawShape(def);
|
|
2843
|
+
merge(raw ? shape(raw, true) : ASSUMED);
|
|
2569
2844
|
check(def.catchall);
|
|
2570
2845
|
break;
|
|
2846
|
+
}
|
|
2571
2847
|
case "array":
|
|
2572
2848
|
check(def.element);
|
|
2573
2849
|
break;
|
|
@@ -2609,9 +2885,11 @@ window.__ModuleLoader__.load({
|
|
|
2609
2885
|
check(def.input);
|
|
2610
2886
|
check(def.output);
|
|
2611
2887
|
break;
|
|
2612
|
-
case "lazy":
|
|
2613
|
-
|
|
2888
|
+
case "lazy": {
|
|
2889
|
+
const inner = def._cachedInner ?? (resolve ? inst._zod.innerType : void 0);
|
|
2890
|
+
merge(inner ? isRecursive(inner, stack, false) : ASSUMED);
|
|
2614
2891
|
break;
|
|
2892
|
+
}
|
|
2615
2893
|
case "template_literal":
|
|
2616
2894
|
case "string":
|
|
2617
2895
|
case "number":
|
|
@@ -2642,13 +2920,17 @@ window.__ModuleLoader__.load({
|
|
|
2642
2920
|
}
|
|
2643
2921
|
}
|
|
2644
2922
|
stack.delete(inst);
|
|
2645
|
-
|
|
2646
|
-
|
|
2923
|
+
return settle(inst, result);
|
|
2924
|
+
}
|
|
2925
|
+
/** An assumed answer must not outlive the resolution that settles it, so only a certain one is cached. */
|
|
2926
|
+
function settle(inst, answer) {
|
|
2927
|
+
if (answer !== ASSUMED) recursive.set(inst, answer === PROVEN);
|
|
2928
|
+
return answer;
|
|
2647
2929
|
}
|
|
2648
2930
|
function bucketFor(state, inst) {
|
|
2649
2931
|
let bucket = state.buckets.get(inst);
|
|
2650
2932
|
if (!bucket) {
|
|
2651
|
-
bucket = /* @__PURE__ */ new
|
|
2933
|
+
bucket = /* @__PURE__ */ new WeakMap();
|
|
2652
2934
|
state.buckets.set(inst, bucket);
|
|
2653
2935
|
}
|
|
2654
2936
|
return bucket;
|
|
@@ -2684,6 +2966,7 @@ window.__ModuleLoader__.load({
|
|
|
2684
2966
|
attach(inst) {
|
|
2685
2967
|
var _a;
|
|
2686
2968
|
let isRecursiveInst;
|
|
2969
|
+
let rechecked = false;
|
|
2687
2970
|
let lastCtx;
|
|
2688
2971
|
let lastBucket;
|
|
2689
2972
|
(_a = inst._zod).deferred ?? (_a.deferred = []);
|
|
@@ -2691,19 +2974,21 @@ window.__ModuleLoader__.load({
|
|
|
2691
2974
|
const base = inst._zod.parse;
|
|
2692
2975
|
const wrapped = (payload, ctx) => {
|
|
2693
2976
|
if (isRecursiveInst === void 0) {
|
|
2694
|
-
|
|
2695
|
-
if (
|
|
2977
|
+
const walked = isRecursive(inst, /* @__PURE__ */ new Set(), false);
|
|
2978
|
+
if (walked === NONE) {
|
|
2696
2979
|
inst._zod.parse = base;
|
|
2697
2980
|
if (inst._zod.run === wrapped) inst._zod.run = base;
|
|
2698
2981
|
return base(payload, ctx);
|
|
2699
2982
|
}
|
|
2983
|
+
if (walked === PROVEN || rechecked) isRecursiveInst = true;
|
|
2984
|
+
else rechecked = true;
|
|
2700
2985
|
}
|
|
2701
2986
|
const input = payload.value;
|
|
2702
|
-
if (input
|
|
2987
|
+
if (!isRef(input)) return base(payload, ctx);
|
|
2703
2988
|
let state = ctx[STATE];
|
|
2704
2989
|
if (!state) {
|
|
2705
2990
|
state = {
|
|
2706
|
-
buckets: /* @__PURE__ */ new
|
|
2991
|
+
buckets: /* @__PURE__ */ new WeakMap(),
|
|
2707
2992
|
backEdges: void 0
|
|
2708
2993
|
};
|
|
2709
2994
|
ctx[STATE] = state;
|
|
@@ -2722,7 +3007,7 @@ window.__ModuleLoader__.load({
|
|
|
2722
3007
|
if (hit.issues.length) payload.issues.push(...cloneIssues(hit.issues));
|
|
2723
3008
|
} else {
|
|
2724
3009
|
payload.memo = true;
|
|
2725
|
-
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new
|
|
3010
|
+
state.backEdges ?? (state.backEdges = /* @__PURE__ */ new WeakSet());
|
|
2726
3011
|
state.backEdges.add(hit.value);
|
|
2727
3012
|
}
|
|
2728
3013
|
return payload;
|
|
@@ -2751,10 +3036,10 @@ window.__ModuleLoader__.load({
|
|
|
2751
3036
|
/** Whether this value is a node a back-edge resolved to before it finished. */
|
|
2752
3037
|
function isBackEdge(ctx, value) {
|
|
2753
3038
|
const backEdges = ctx[STATE]?.backEdges;
|
|
2754
|
-
return backEdges !== void 0 && value
|
|
3039
|
+
return backEdges !== void 0 && isRef(value) && backEdges.has(value);
|
|
2755
3040
|
}
|
|
2756
3041
|
//#endregion
|
|
2757
|
-
//#region
|
|
3042
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/locales/en.js
|
|
2758
3043
|
const error = () => {
|
|
2759
3044
|
const Sizable = {
|
|
2760
3045
|
string: {
|
|
@@ -2809,7 +3094,9 @@ window.__ModuleLoader__.load({
|
|
|
2809
3094
|
base64url: "base64url-encoded string",
|
|
2810
3095
|
json_string: "JSON string",
|
|
2811
3096
|
e164: "E.164 number",
|
|
3097
|
+
currency_code: "currency code",
|
|
2812
3098
|
credit_card: "credit card number",
|
|
3099
|
+
iban: "IBAN",
|
|
2813
3100
|
jwt: "JWT",
|
|
2814
3101
|
template_literal: "input"
|
|
2815
3102
|
};
|
|
@@ -2860,7 +3147,7 @@ window.__ModuleLoader__.load({
|
|
|
2860
3147
|
return { localeError: error() };
|
|
2861
3148
|
}
|
|
2862
3149
|
//#endregion
|
|
2863
|
-
//#region
|
|
3150
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/registries.js
|
|
2864
3151
|
var _a;
|
|
2865
3152
|
var $ZodRegistry = class {
|
|
2866
3153
|
constructor() {
|
|
@@ -2907,13 +3194,17 @@ window.__ModuleLoader__.load({
|
|
|
2907
3194
|
(_a = globalThis).__zod_globalRegistry ?? (_a.__zod_globalRegistry = registry());
|
|
2908
3195
|
const globalRegistry = globalThis.__zod_globalRegistry;
|
|
2909
3196
|
//#endregion
|
|
2910
|
-
//#region
|
|
3197
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/api.js
|
|
3198
|
+
function snapshotChecks(def) {
|
|
3199
|
+
if (def.checks) def.checks = [...def.checks];
|
|
3200
|
+
return def;
|
|
3201
|
+
}
|
|
2911
3202
|
// @__NO_SIDE_EFFECTS__
|
|
2912
3203
|
function _string(Class, params) {
|
|
2913
|
-
return new Class({
|
|
3204
|
+
return new Class(snapshotChecks({
|
|
2914
3205
|
type: "string",
|
|
2915
3206
|
...normalizeParams(params)
|
|
2916
|
-
});
|
|
3207
|
+
}));
|
|
2917
3208
|
}
|
|
2918
3209
|
// @__NO_SIDE_EFFECTS__
|
|
2919
3210
|
function _email(Class, params) {
|
|
@@ -3185,11 +3476,11 @@ window.__ModuleLoader__.load({
|
|
|
3185
3476
|
}
|
|
3186
3477
|
// @__NO_SIDE_EFFECTS__
|
|
3187
3478
|
function _number(Class, params) {
|
|
3188
|
-
return new Class({
|
|
3479
|
+
return new Class(snapshotChecks({
|
|
3189
3480
|
type: "number",
|
|
3190
3481
|
checks: [],
|
|
3191
3482
|
...normalizeParams(params)
|
|
3192
|
-
});
|
|
3483
|
+
}));
|
|
3193
3484
|
}
|
|
3194
3485
|
// @__NO_SIDE_EFFECTS__
|
|
3195
3486
|
function _int(Class, params) {
|
|
@@ -3419,7 +3710,7 @@ window.__ModuleLoader__.load({
|
|
|
3419
3710
|
return ch;
|
|
3420
3711
|
}
|
|
3421
3712
|
//#endregion
|
|
3422
|
-
//#region
|
|
3713
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/to-json-schema.js
|
|
3423
3714
|
function assignProps(target, ...sources) {
|
|
3424
3715
|
for (const source of sources) for (const key of Reflect.ownKeys(source)) if (Object.prototype.propertyIsEnumerable.call(source, key)) assignProp(target, key, source[key]);
|
|
3425
3716
|
return target;
|
|
@@ -3462,7 +3753,7 @@ window.__ModuleLoader__.load({
|
|
|
3462
3753
|
Object.assign(json, result);
|
|
3463
3754
|
return true;
|
|
3464
3755
|
}
|
|
3465
|
-
function
|
|
3756
|
+
function processSchema(schema, ctx, _params = {
|
|
3466
3757
|
path: [],
|
|
3467
3758
|
schemaPath: []
|
|
3468
3759
|
}) {
|
|
@@ -3501,7 +3792,7 @@ window.__ModuleLoader__.load({
|
|
|
3501
3792
|
const parent = schema._zod.parent;
|
|
3502
3793
|
if (parent) {
|
|
3503
3794
|
if (!result.ref) result.ref = parent;
|
|
3504
|
-
|
|
3795
|
+
processSchema(parent, ctx, params);
|
|
3505
3796
|
ctx.seen.get(parent).isParent = true;
|
|
3506
3797
|
}
|
|
3507
3798
|
}
|
|
@@ -3591,10 +3882,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3591
3882
|
continue;
|
|
3592
3883
|
}
|
|
3593
3884
|
if (seen.count > 1) {
|
|
3594
|
-
if (ctx.reused === "ref")
|
|
3595
|
-
extractToDef(entry);
|
|
3596
|
-
continue;
|
|
3597
|
-
}
|
|
3885
|
+
if (ctx.reused === "ref") extractToDef(entry);
|
|
3598
3886
|
}
|
|
3599
3887
|
}
|
|
3600
3888
|
if (ctx.external) ctx.sharedDefsExtractedFor = ctx.external;
|
|
@@ -3849,7 +4137,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3849
4137
|
...params,
|
|
3850
4138
|
processors
|
|
3851
4139
|
});
|
|
3852
|
-
|
|
4140
|
+
processSchema(schema, ctx);
|
|
3853
4141
|
extractDefs(ctx, schema);
|
|
3854
4142
|
return finalize(ctx, schema);
|
|
3855
4143
|
};
|
|
@@ -3861,33 +4149,107 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3861
4149
|
io,
|
|
3862
4150
|
processors
|
|
3863
4151
|
});
|
|
3864
|
-
|
|
4152
|
+
processSchema(schema, ctx);
|
|
3865
4153
|
extractDefs(ctx, schema);
|
|
3866
4154
|
return finalize(ctx, schema);
|
|
3867
4155
|
};
|
|
3868
4156
|
//#endregion
|
|
3869
|
-
//#region
|
|
3870
|
-
const
|
|
3871
|
-
|
|
3872
|
-
url: "uri",
|
|
3873
|
-
datetime: "date-time",
|
|
3874
|
-
json_string: "json-string",
|
|
3875
|
-
regex: ""
|
|
4157
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/core/json-schema-processors.js
|
|
4158
|
+
const narrowMin = (agg, key, value) => {
|
|
4159
|
+
if (agg[key] === void 0 || value > agg[key]) agg[key] = value;
|
|
3876
4160
|
};
|
|
3877
|
-
const
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
|
|
3883
|
-
|
|
4161
|
+
const narrowMax = (agg, key, value) => {
|
|
4162
|
+
if (agg[key] === void 0 || value < agg[key]) agg[key] = value;
|
|
4163
|
+
};
|
|
4164
|
+
const narrowBoth = (agg, value) => {
|
|
4165
|
+
narrowMin(agg, "minimum", value);
|
|
4166
|
+
narrowMax(agg, "maximum", value);
|
|
4167
|
+
};
|
|
4168
|
+
const addDivisor = (agg, value) => {
|
|
4169
|
+
agg.multipleOf ?? (agg.multipleOf = []);
|
|
4170
|
+
if (!agg.multipleOf.includes(value)) agg.multipleOf.push(value);
|
|
4171
|
+
};
|
|
4172
|
+
const addPattern = (agg, pattern) => {
|
|
4173
|
+
agg.patterns ?? (agg.patterns = /* @__PURE__ */ new Set());
|
|
4174
|
+
agg.patterns.add(pattern);
|
|
4175
|
+
};
|
|
4176
|
+
const intersectMime = (agg, mime) => {
|
|
4177
|
+
agg.mime = agg.mime ? agg.mime.filter((m) => mime.includes(m)) : [...mime];
|
|
4178
|
+
};
|
|
4179
|
+
const setFormat = (agg, format) => {
|
|
4180
|
+
agg.format = format;
|
|
4181
|
+
if (format.includes("int")) agg.isInt = true;
|
|
4182
|
+
};
|
|
4183
|
+
const minContributor = (agg, def) => narrowMin(agg, "minimum", def.minimum);
|
|
4184
|
+
const maxContributor = (agg, def) => narrowMax(agg, "maximum", def.maximum);
|
|
4185
|
+
const formatContributor = (ranges) => (agg, def) => {
|
|
4186
|
+
setFormat(agg, def.format);
|
|
4187
|
+
const [minimum, maximum] = ranges[def.format];
|
|
4188
|
+
narrowMin(agg, "minimum", minimum);
|
|
4189
|
+
narrowMax(agg, "maximum", maximum);
|
|
4190
|
+
};
|
|
4191
|
+
const contributors = {
|
|
4192
|
+
greater_than: (agg, def) => narrowMin(agg, def.inclusive ? "minimum" : "exclusiveMinimum", def.value),
|
|
4193
|
+
less_than: (agg, def) => narrowMax(agg, def.inclusive ? "maximum" : "exclusiveMaximum", def.value),
|
|
4194
|
+
multiple_of: (agg, def) => addDivisor(agg, def.value),
|
|
4195
|
+
number_format: formatContributor(NUMBER_FORMAT_RANGES),
|
|
4196
|
+
bigint_format: formatContributor(BIGINT_FORMAT_RANGES),
|
|
4197
|
+
min_length: minContributor,
|
|
4198
|
+
max_length: maxContributor,
|
|
4199
|
+
length_equals: (agg, def) => narrowBoth(agg, def.length),
|
|
4200
|
+
min_size: minContributor,
|
|
4201
|
+
max_size: maxContributor,
|
|
4202
|
+
size_equals: (agg, def) => narrowBoth(agg, def.size),
|
|
4203
|
+
string_format: (agg, def) => {
|
|
4204
|
+
setFormat(agg, def.format);
|
|
4205
|
+
if (def.pattern) addPattern(agg, def.pattern);
|
|
4206
|
+
if (def.format === "base64" || def.format === "base64url") agg.contentEncoding = def.format;
|
|
4207
|
+
if (def.local || def.precision === -1) agg.laxFormat = true;
|
|
4208
|
+
},
|
|
4209
|
+
mime_type: (agg, def) => intersectMime(agg, def.mime)
|
|
4210
|
+
};
|
|
4211
|
+
function aggregateChecks(schema) {
|
|
4212
|
+
const agg = {};
|
|
4213
|
+
const def = schema._zod.def;
|
|
4214
|
+
const list = schema._zod.traits.has("$ZodCheck") ? [schema, ...def.checks ?? []] : def.checks ?? [];
|
|
4215
|
+
for (const ch of list) contributors[ch._zod.def.check]?.(agg, ch._zod.def);
|
|
4216
|
+
const bag = schema._zod.bag;
|
|
4217
|
+
if (bag.minimum !== void 0) narrowMin(agg, "minimum", bag.minimum);
|
|
4218
|
+
if (bag.exclusiveMinimum !== void 0) narrowMin(agg, "exclusiveMinimum", bag.exclusiveMinimum);
|
|
4219
|
+
if (bag.maximum !== void 0) narrowMax(agg, "maximum", bag.maximum);
|
|
4220
|
+
if (bag.exclusiveMaximum !== void 0) narrowMax(agg, "exclusiveMaximum", bag.exclusiveMaximum);
|
|
4221
|
+
if (bag.multipleOf !== void 0) addDivisor(agg, bag.multipleOf);
|
|
4222
|
+
if (bag.format !== void 0) {
|
|
4223
|
+
agg.format ?? (agg.format = bag.format);
|
|
4224
|
+
if (bag.format.includes("int")) agg.isInt = true;
|
|
4225
|
+
}
|
|
4226
|
+
if (bag.mime) intersectMime(agg, bag.mime);
|
|
4227
|
+
for (const pattern of bag.patterns ?? []) addPattern(agg, pattern);
|
|
4228
|
+
return agg;
|
|
4229
|
+
}
|
|
4230
|
+
const formatMap = {
|
|
4231
|
+
guid: "uuid",
|
|
4232
|
+
url: "uri",
|
|
4233
|
+
datetime: "date-time",
|
|
4234
|
+
json_string: "json-string",
|
|
4235
|
+
regex: ""
|
|
4236
|
+
};
|
|
4237
|
+
const exactPatterns = /* @__PURE__ */ new Map([[base64Charset, base64], [base64urlCharset, base64url]]);
|
|
4238
|
+
const exactPattern = (p) => exactPatterns.get(p) ?? p;
|
|
4239
|
+
const stringProcessor = (schema, ctx, _json, _params) => {
|
|
4240
|
+
const json = _json;
|
|
4241
|
+
json.type = "string";
|
|
4242
|
+
const { minimum, maximum, format, patterns, contentEncoding, laxFormat } = aggregateChecks(schema);
|
|
4243
|
+
if (typeof minimum === "number") json.minLength = minimum;
|
|
4244
|
+
if (typeof maximum === "number") json.maxLength = maximum;
|
|
4245
|
+
if (format) {
|
|
3884
4246
|
json.format = formatMap[format] ?? format;
|
|
3885
4247
|
if (json.format === "") delete json.format;
|
|
3886
4248
|
if (format === "time" || laxFormat) delete json.format;
|
|
3887
4249
|
}
|
|
3888
4250
|
if (contentEncoding) json.contentEncoding = contentEncoding;
|
|
3889
4251
|
if (patterns && patterns.size > 0) {
|
|
3890
|
-
const patternList = [...patterns];
|
|
4252
|
+
const patternList = [...patterns].map(exactPattern);
|
|
3891
4253
|
if (patternList.length === 1) json.pattern = patternList[0].source;
|
|
3892
4254
|
else if (patternList.length > 1) json.allOf = [...patternList.map((regex) => ({
|
|
3893
4255
|
...ctx.target === "draft-07" || ctx.target === "draft-04" || ctx.target === "openapi-3.0" ? { type: "string" } : {},
|
|
@@ -3897,9 +4259,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3897
4259
|
};
|
|
3898
4260
|
const numberProcessor = (schema, ctx, _json, params) => {
|
|
3899
4261
|
const json = _json;
|
|
3900
|
-
const { minimum, maximum,
|
|
3901
|
-
|
|
3902
|
-
else json.type = "number";
|
|
4262
|
+
const { minimum, maximum, multipleOf, exclusiveMaximum, exclusiveMinimum, isInt } = aggregateChecks(schema);
|
|
4263
|
+
json.type = isInt ? "integer" : "number";
|
|
3903
4264
|
const exMin = typeof exclusiveMinimum === "number" && exclusiveMinimum >= (minimum ?? Number.NEGATIVE_INFINITY);
|
|
3904
4265
|
const exMax = typeof exclusiveMaximum === "number" && exclusiveMaximum <= (maximum ?? Number.POSITIVE_INFINITY);
|
|
3905
4266
|
const legacy = ctx.target === "draft-04" || ctx.target === "openapi-3.0";
|
|
@@ -3915,9 +4276,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3915
4276
|
json.exclusiveMaximum = true;
|
|
3916
4277
|
} else json.exclusiveMaximum = exclusiveMaximum;
|
|
3917
4278
|
} else if (typeof maximum === "number") json.maximum = maximum;
|
|
3918
|
-
if (
|
|
3919
|
-
|
|
3920
|
-
|
|
4279
|
+
if (multipleOf) {
|
|
4280
|
+
const divisors = /* @__PURE__ */ new Set();
|
|
4281
|
+
for (const divisor of multipleOf) if (Number.isFinite(divisor) && divisor !== 0) divisors.add(Math.abs(divisor));
|
|
4282
|
+
else handleUnrepresentable(schema, ctx, json, params, `A multipleOf divisor of ${divisor} cannot be represented in JSON Schema`);
|
|
4283
|
+
const [first, ...rest] = divisors;
|
|
4284
|
+
if (first !== void 0) json.multipleOf = first;
|
|
4285
|
+
if (rest.length) json.allOf = [...json.allOf ?? [], ...rest.map((m) => ({ multipleOf: m }))];
|
|
3921
4286
|
}
|
|
3922
4287
|
};
|
|
3923
4288
|
const booleanProcessor = (_schema, _ctx, json, _params) => {
|
|
@@ -3975,11 +4340,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3975
4340
|
const arrayProcessor = (schema, ctx, _json, params) => {
|
|
3976
4341
|
const json = _json;
|
|
3977
4342
|
const def = schema._zod.def;
|
|
3978
|
-
const { minimum, maximum } = schema
|
|
4343
|
+
const { minimum, maximum } = aggregateChecks(schema);
|
|
3979
4344
|
if (typeof minimum === "number") json.minItems = minimum;
|
|
3980
4345
|
if (typeof maximum === "number") json.maxItems = maximum;
|
|
3981
4346
|
json.type = "array";
|
|
3982
|
-
json.items =
|
|
4347
|
+
json.items = processSchema(def.element, ctx, {
|
|
3983
4348
|
...params,
|
|
3984
4349
|
path: [...params.path, "items"]
|
|
3985
4350
|
});
|
|
@@ -3997,7 +4362,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
3997
4362
|
if (Object.getOwnPropertySymbols(shape).length && handleUnrepresentable(schema, ctx, json, params, "Symbol keys cannot be represented in JSON Schema")) return;
|
|
3998
4363
|
json.type = "object";
|
|
3999
4364
|
json.properties = {};
|
|
4000
|
-
for (const key in shape) assignProp(json.properties, key,
|
|
4365
|
+
for (const key in shape) assignProp(json.properties, key, processSchema(shape[key], ctx, {
|
|
4001
4366
|
...params,
|
|
4002
4367
|
path: [
|
|
4003
4368
|
...params.path,
|
|
@@ -4005,17 +4370,16 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4005
4370
|
key
|
|
4006
4371
|
]
|
|
4007
4372
|
}));
|
|
4008
|
-
const
|
|
4009
|
-
const
|
|
4373
|
+
const requiredKeys = [];
|
|
4374
|
+
for (const key of Object.keys(shape)) {
|
|
4010
4375
|
const field = def.shape[key];
|
|
4011
|
-
if (ctx.io === "input"
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
if (requiredKeys.size > 0) json.required = Array.from(requiredKeys);
|
|
4376
|
+
if (ctx.io === "input" ? inputOptin(field) === void 0 : field._zod.optout === void 0) requiredKeys.push(key);
|
|
4377
|
+
}
|
|
4378
|
+
if (requiredKeys.length > 0) json.required = requiredKeys;
|
|
4015
4379
|
if (def.catchall?._zod.def.type === "never") json.additionalProperties = false;
|
|
4016
4380
|
else if (!def.catchall) {
|
|
4017
4381
|
if (ctx.io === "output") json.additionalProperties = false;
|
|
4018
|
-
} else if (def.catchall) json.additionalProperties =
|
|
4382
|
+
} else if (def.catchall) json.additionalProperties = processSchema(def.catchall, ctx, {
|
|
4019
4383
|
...params,
|
|
4020
4384
|
path: [...params.path, "additionalProperties"]
|
|
4021
4385
|
});
|
|
@@ -4023,7 +4387,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4023
4387
|
const unionProcessor = (schema, ctx, json, params) => {
|
|
4024
4388
|
const def = schema._zod.def;
|
|
4025
4389
|
const isExclusive = def.inclusive === false;
|
|
4026
|
-
const options = def.options.map((x, i) =>
|
|
4390
|
+
const options = def.options.map((x, i) => processSchema(x, ctx, {
|
|
4027
4391
|
...params,
|
|
4028
4392
|
path: [
|
|
4029
4393
|
...params.path,
|
|
@@ -4036,7 +4400,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4036
4400
|
};
|
|
4037
4401
|
const intersectionProcessor = (schema, ctx, json, params) => {
|
|
4038
4402
|
const def = schema._zod.def;
|
|
4039
|
-
const a =
|
|
4403
|
+
const a = processSchema(def.left, ctx, {
|
|
4040
4404
|
...params,
|
|
4041
4405
|
path: [
|
|
4042
4406
|
...params.path,
|
|
@@ -4044,7 +4408,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4044
4408
|
0
|
|
4045
4409
|
]
|
|
4046
4410
|
});
|
|
4047
|
-
const b =
|
|
4411
|
+
const b = processSchema(def.right, ctx, {
|
|
4048
4412
|
...params,
|
|
4049
4413
|
path: [
|
|
4050
4414
|
...params.path,
|
|
@@ -4057,9 +4421,110 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4057
4421
|
json.allOf = allOf;
|
|
4058
4422
|
ctx.intersections.push(allOf);
|
|
4059
4423
|
};
|
|
4424
|
+
/** JSON object keys are always strings, so a numeric record key schema is re-expressed over the
|
|
4425
|
+
* numeric-string form the record parser matches. Deferred to `finalize`, after the flatten: a key
|
|
4426
|
+
* behind a wrapper only carries its own `type` before then, and a union key only has its branches.
|
|
4427
|
+
*
|
|
4428
|
+
* A numeric bound cannot apply to a property name, so `minimum` and its siblings are dropped rather
|
|
4429
|
+
* than carried over: keeping them beside `type: "string"` reproduces the match-nothing schema this
|
|
4430
|
+
* exists to fix. A key that carries one therefore emits wider than the record parses — `z.record(z.number().min(5), V)`
|
|
4431
|
+
* accepts `"3"` — which is the deliberate trade, since throwing on it would reject an ordinary schema
|
|
4432
|
+
* outright. */
|
|
4433
|
+
function stringifyKeyNames(bySchema, json, visited) {
|
|
4434
|
+
if (json.$ref) {
|
|
4435
|
+
if (visited.has(json)) return json;
|
|
4436
|
+
visited.add(json);
|
|
4437
|
+
const def = bySchema.get(json)?.def;
|
|
4438
|
+
if (!def) return json;
|
|
4439
|
+
const inlined = stringifyKeyNames(bySchema, def, visited);
|
|
4440
|
+
return inlined === def ? json : inlined;
|
|
4441
|
+
}
|
|
4442
|
+
for (const keyword of ["anyOf", "oneOf"]) {
|
|
4443
|
+
const branches = json[keyword];
|
|
4444
|
+
if (!Array.isArray(branches)) continue;
|
|
4445
|
+
const mapped = branches.map((branch) => stringifyKeyNames(bySchema, branch, visited));
|
|
4446
|
+
if (mapped.some((branch, i) => branch !== branches[i])) json = {
|
|
4447
|
+
...json,
|
|
4448
|
+
[keyword]: mapped
|
|
4449
|
+
};
|
|
4450
|
+
}
|
|
4451
|
+
const types = Array.isArray(json.type) ? json.type : [json.type];
|
|
4452
|
+
const numericType = !types.includes("string") && types.some((t) => t === "number" || t === "integer");
|
|
4453
|
+
const values = json.enum ?? (json.const !== void 0 ? [json.const] : void 0);
|
|
4454
|
+
if (!numericType && !values?.some((v) => typeof v === "number")) return json;
|
|
4455
|
+
const { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf, format, id, ...rest } = json;
|
|
4456
|
+
if (rest.enum) rest.enum = rest.enum.map((v) => typeof v === "number" ? String(v) : v);
|
|
4457
|
+
else if (typeof rest.const === "number") rest.const = String(rest.const);
|
|
4458
|
+
if (!numericType) return rest;
|
|
4459
|
+
rest.type = "string";
|
|
4460
|
+
if (!values) rest.pattern = (types.includes("number") ? number$1 : integer).source;
|
|
4461
|
+
return rest;
|
|
4462
|
+
}
|
|
4463
|
+
/** Every record of one conversion, so the carriers are found in a single pass rather than once per record. */
|
|
4464
|
+
const pendingRecords = /* @__PURE__ */ new WeakMap();
|
|
4465
|
+
function rewriteKeyNames(ctx) {
|
|
4466
|
+
const bySchema = /* @__PURE__ */ new Map();
|
|
4467
|
+
for (const entry of ctx.seen.values()) if (entry.def && !bySchema.has(entry.schema)) bySchema.set(entry.schema, entry);
|
|
4468
|
+
const rewrites = /* @__PURE__ */ new Map();
|
|
4469
|
+
for (const record of pendingRecords.get(ctx) ?? []) {
|
|
4470
|
+
const seen = ctx.seen.get(record);
|
|
4471
|
+
const names = (seen?.def ?? seen?.schema)?.propertyNames;
|
|
4472
|
+
if (!names || names === true || rewrites.has(names)) continue;
|
|
4473
|
+
const rewritten = stringifyKeyNames(bySchema, names, /* @__PURE__ */ new Set());
|
|
4474
|
+
if (rewritten !== names) rewrites.set(names, rewritten);
|
|
4475
|
+
}
|
|
4476
|
+
if (!rewrites.size) return;
|
|
4477
|
+
for (const entry of ctx.seen.values()) for (const carrier of [entry.schema, entry.def]) {
|
|
4478
|
+
const rewritten = carrier && rewrites.get(carrier.propertyNames);
|
|
4479
|
+
if (rewritten) carrier.propertyNames = rewritten;
|
|
4480
|
+
}
|
|
4481
|
+
}
|
|
4482
|
+
const recordProcessor = (schema, ctx, _json, params) => {
|
|
4483
|
+
const json = _json;
|
|
4484
|
+
const def = schema._zod.def;
|
|
4485
|
+
json.type = "object";
|
|
4486
|
+
const keyType = def.keyType;
|
|
4487
|
+
const patterns = aggregateChecks(keyType).patterns;
|
|
4488
|
+
if (def.mode === "loose" && patterns && patterns.size > 0) {
|
|
4489
|
+
const valueSchema = processSchema(def.valueType, ctx, {
|
|
4490
|
+
...params,
|
|
4491
|
+
path: [
|
|
4492
|
+
...params.path,
|
|
4493
|
+
"patternProperties",
|
|
4494
|
+
"*"
|
|
4495
|
+
]
|
|
4496
|
+
});
|
|
4497
|
+
json.patternProperties = {};
|
|
4498
|
+
for (const pattern of patterns) assignProp(json.patternProperties, exactPattern(pattern).source, valueSchema);
|
|
4499
|
+
} else {
|
|
4500
|
+
if (ctx.target === "draft-07" || ctx.target === "draft-2020-12") {
|
|
4501
|
+
json.propertyNames = processSchema(def.keyType, ctx, {
|
|
4502
|
+
...params,
|
|
4503
|
+
path: [...params.path, "propertyNames"]
|
|
4504
|
+
});
|
|
4505
|
+
let pending = pendingRecords.get(ctx);
|
|
4506
|
+
if (!pending) {
|
|
4507
|
+
pending = [];
|
|
4508
|
+
pendingRecords.set(ctx, pending);
|
|
4509
|
+
ctx.deferred.push(() => rewriteKeyNames(ctx));
|
|
4510
|
+
}
|
|
4511
|
+
pending.push(schema);
|
|
4512
|
+
}
|
|
4513
|
+
json.additionalProperties = processSchema(def.valueType, ctx, {
|
|
4514
|
+
...params,
|
|
4515
|
+
path: [...params.path, "additionalProperties"]
|
|
4516
|
+
});
|
|
4517
|
+
}
|
|
4518
|
+
const keyValues = keyType._zod.values;
|
|
4519
|
+
const omittableOnInput = ctx.io === "input" && inputOptin(def.valueType) !== void 0;
|
|
4520
|
+
if (keyValues && !def.partial && !omittableOnInput) {
|
|
4521
|
+
const validKeyValues = [...keyValues].filter((v) => typeof v === "string" || typeof v === "number");
|
|
4522
|
+
if (validKeyValues.length > 0) json.required = validKeyValues.map(String);
|
|
4523
|
+
}
|
|
4524
|
+
};
|
|
4060
4525
|
const nullableProcessor = (schema, ctx, json, params) => {
|
|
4061
4526
|
const def = schema._zod.def;
|
|
4062
|
-
const inner =
|
|
4527
|
+
const inner = processSchema(def.innerType, ctx, params);
|
|
4063
4528
|
const seen = ctx.seen.get(schema);
|
|
4064
4529
|
if (ctx.target === "openapi-3.0") {
|
|
4065
4530
|
seen.ref = def.innerType;
|
|
@@ -4068,7 +4533,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4068
4533
|
};
|
|
4069
4534
|
const nonoptionalProcessor = (schema, ctx, _json, params) => {
|
|
4070
4535
|
const def = schema._zod.def;
|
|
4071
|
-
|
|
4536
|
+
processSchema(def.innerType, ctx, params);
|
|
4072
4537
|
const seen = ctx.seen.get(schema);
|
|
4073
4538
|
seen.ref = def.innerType;
|
|
4074
4539
|
};
|
|
@@ -4089,7 +4554,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4089
4554
|
}
|
|
4090
4555
|
const defaultProcessor = (schema, ctx, json, params) => {
|
|
4091
4556
|
const def = schema._zod.def;
|
|
4092
|
-
|
|
4557
|
+
processSchema(def.innerType, ctx, params);
|
|
4093
4558
|
const seen = ctx.seen.get(schema);
|
|
4094
4559
|
seen.ref = def.innerType;
|
|
4095
4560
|
const value = serializeDefaultValue(def.defaultValue, schema, ctx, json, params);
|
|
@@ -4097,7 +4562,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4097
4562
|
};
|
|
4098
4563
|
const prefaultProcessor = (schema, ctx, json, params) => {
|
|
4099
4564
|
const def = schema._zod.def;
|
|
4100
|
-
|
|
4565
|
+
processSchema(def.innerType, ctx, params);
|
|
4101
4566
|
const seen = ctx.seen.get(schema);
|
|
4102
4567
|
seen.ref = def.innerType;
|
|
4103
4568
|
if (ctx.io !== "input") return;
|
|
@@ -4106,7 +4571,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4106
4571
|
};
|
|
4107
4572
|
const catchProcessor = (schema, ctx, json, params) => {
|
|
4108
4573
|
const def = schema._zod.def;
|
|
4109
|
-
|
|
4574
|
+
processSchema(def.innerType, ctx, params);
|
|
4110
4575
|
const seen = ctx.seen.get(schema);
|
|
4111
4576
|
seen.ref = def.innerType;
|
|
4112
4577
|
let catchValue;
|
|
@@ -4122,25 +4587,31 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4122
4587
|
const def = schema._zod.def;
|
|
4123
4588
|
const inIsTransform = def.in._zod.traits.has("$ZodTransform");
|
|
4124
4589
|
const innerType = ctx.io === "input" ? inIsTransform ? def.out : def.in : def.out;
|
|
4125
|
-
|
|
4590
|
+
processSchema(innerType, ctx, params);
|
|
4126
4591
|
const seen = ctx.seen.get(schema);
|
|
4127
4592
|
seen.ref = innerType;
|
|
4128
4593
|
};
|
|
4129
4594
|
const readonlyProcessor = (schema, ctx, json, params) => {
|
|
4130
4595
|
const def = schema._zod.def;
|
|
4131
|
-
|
|
4596
|
+
processSchema(def.innerType, ctx, params);
|
|
4132
4597
|
const seen = ctx.seen.get(schema);
|
|
4133
4598
|
seen.ref = def.innerType;
|
|
4134
4599
|
json.readOnly = true;
|
|
4135
4600
|
};
|
|
4136
4601
|
const optionalProcessor = (schema, ctx, _json, params) => {
|
|
4137
4602
|
const def = schema._zod.def;
|
|
4138
|
-
|
|
4603
|
+
processSchema(def.innerType, ctx, params);
|
|
4139
4604
|
const seen = ctx.seen.get(schema);
|
|
4140
4605
|
seen.ref = def.innerType;
|
|
4141
4606
|
};
|
|
4607
|
+
const lazyProcessor = (schema, ctx, _json, params) => {
|
|
4608
|
+
const innerType = schema._zod.innerType;
|
|
4609
|
+
processSchema(innerType, ctx, params);
|
|
4610
|
+
const seen = ctx.seen.get(schema);
|
|
4611
|
+
seen.ref = innerType;
|
|
4612
|
+
};
|
|
4142
4613
|
//#endregion
|
|
4143
|
-
//#region
|
|
4614
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/errors.js
|
|
4144
4615
|
const _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
4145
4616
|
function _lazyMethod(proto, key, make) {
|
|
4146
4617
|
Object.defineProperty(proto, key, {
|
|
@@ -4190,7 +4661,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4190
4661
|
};
|
|
4191
4662
|
const ZodRealError = /*@__PURE__*/ $constructor("ZodError", initializer, void 0, { Parent: Error });
|
|
4192
4663
|
//#endregion
|
|
4193
|
-
//#region
|
|
4664
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/parse.js
|
|
4194
4665
|
const parse = /* @__PURE__ */ _parse(ZodRealError);
|
|
4195
4666
|
const parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
4196
4667
|
const safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -4204,7 +4675,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4204
4675
|
const safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
4205
4676
|
const safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
4206
4677
|
//#endregion
|
|
4207
|
-
//#region
|
|
4678
|
+
//#region ../../../node_modules/.pnpm/zod@4.6.5/node_modules/zod/v4/classic/schemas.js
|
|
4208
4679
|
function _ensureDefaultLocale() {
|
|
4209
4680
|
if (!globalConfig.localeError) config(en_default());
|
|
4210
4681
|
}
|
|
@@ -4340,6 +4811,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4340
4811
|
set spa(value) {
|
|
4341
4812
|
own(this, "spa", value);
|
|
4342
4813
|
},
|
|
4814
|
+
validate(data, params) {
|
|
4815
|
+
return validate(this, data, params);
|
|
4816
|
+
},
|
|
4817
|
+
validateAsync(data, params) {
|
|
4818
|
+
return validateAsync$1(this, data, params);
|
|
4819
|
+
},
|
|
4343
4820
|
encode: function _encode(data, params) {
|
|
4344
4821
|
return encode(this, data, params, { callee: _encode });
|
|
4345
4822
|
},
|
|
@@ -4379,10 +4856,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4379
4856
|
$ZodString.init(inst, def);
|
|
4380
4857
|
ZodType.init(inst, def);
|
|
4381
4858
|
inst._zod.processJSONSchema = (ctx, json, params) => stringProcessor(inst, ctx, json, params);
|
|
4382
|
-
|
|
4383
|
-
|
|
4384
|
-
|
|
4385
|
-
|
|
4859
|
+
}, /*@__PURE__*/ derived({
|
|
4860
|
+
format: (inst) => aggregateChecks(inst).format ?? null,
|
|
4861
|
+
minLength: (inst) => aggregateChecks(inst).minimum ?? null,
|
|
4862
|
+
maxLength: (inst) => aggregateChecks(inst).maximum ?? null
|
|
4386
4863
|
}, {
|
|
4387
4864
|
regex(...args) {
|
|
4388
4865
|
return this.check(/* @__PURE__ */ _regex(...args));
|
|
@@ -4429,7 +4906,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4429
4906
|
slugify() {
|
|
4430
4907
|
return this.check(/* @__PURE__ */ _slugify());
|
|
4431
4908
|
}
|
|
4432
|
-
});
|
|
4909
|
+
}));
|
|
4433
4910
|
const ZodString = /*@__PURE__*/ $constructor("ZodString", (inst, def) => {
|
|
4434
4911
|
$ZodString.init(inst, def);
|
|
4435
4912
|
_ZodString.init(inst, def);
|
|
@@ -4621,12 +5098,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4621
5098
|
$ZodNumber.init(inst, def);
|
|
4622
5099
|
ZodType.init(inst, def);
|
|
4623
5100
|
inst._zod.processJSONSchema = (ctx, json, params) => numberProcessor(inst, ctx, json, params);
|
|
4624
|
-
const bag = inst._zod.bag;
|
|
4625
|
-
inst.minValue = Math.max(bag.minimum ?? Number.NEGATIVE_INFINITY, bag.exclusiveMinimum ?? Number.NEGATIVE_INFINITY) ?? null;
|
|
4626
|
-
inst.maxValue = Math.min(bag.maximum ?? Number.POSITIVE_INFINITY, bag.exclusiveMaximum ?? Number.POSITIVE_INFINITY) ?? null;
|
|
4627
|
-
inst.isInt = (bag.format ?? "").includes("int") || Number.isSafeInteger(bag.multipleOf ?? .5);
|
|
4628
5101
|
inst.isFinite = true;
|
|
4629
|
-
|
|
5102
|
+
}, /*@__PURE__*/ derived({
|
|
5103
|
+
minValue: (inst) => {
|
|
5104
|
+
const { minimum, exclusiveMinimum } = aggregateChecks(inst);
|
|
5105
|
+
return Math.max(minimum ?? Number.NEGATIVE_INFINITY, exclusiveMinimum ?? Number.NEGATIVE_INFINITY);
|
|
5106
|
+
},
|
|
5107
|
+
maxValue: (inst) => {
|
|
5108
|
+
const { maximum, exclusiveMaximum } = aggregateChecks(inst);
|
|
5109
|
+
return Math.min(maximum ?? Number.POSITIVE_INFINITY, exclusiveMaximum ?? Number.POSITIVE_INFINITY);
|
|
5110
|
+
},
|
|
5111
|
+
isInt: (inst) => {
|
|
5112
|
+
const { isInt, multipleOf } = aggregateChecks(inst);
|
|
5113
|
+
return !!isInt || !!multipleOf?.some(Number.isSafeInteger);
|
|
5114
|
+
},
|
|
5115
|
+
format: (inst) => aggregateChecks(inst).format ?? null
|
|
4630
5116
|
}, {
|
|
4631
5117
|
gt(value, params) {
|
|
4632
5118
|
return this.check(/* @__PURE__ */ _gt(value, params));
|
|
@@ -4673,7 +5159,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4673
5159
|
finite() {
|
|
4674
5160
|
return this;
|
|
4675
5161
|
}
|
|
4676
|
-
});
|
|
5162
|
+
}));
|
|
4677
5163
|
function number(params) {
|
|
4678
5164
|
return /* @__PURE__ */ _number(ZodNumber, params);
|
|
4679
5165
|
}
|
|
@@ -4753,34 +5239,19 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4753
5239
|
return _enum(Object.keys(this._zod.def.shape));
|
|
4754
5240
|
},
|
|
4755
5241
|
catchall(catchall) {
|
|
4756
|
-
return this.clone({
|
|
4757
|
-
...this._zod.def,
|
|
4758
|
-
catchall
|
|
4759
|
-
});
|
|
5242
|
+
return this.clone(mergeDefs(this._zod.def, { catchall }));
|
|
4760
5243
|
},
|
|
4761
5244
|
passthrough() {
|
|
4762
|
-
return this.clone({
|
|
4763
|
-
...this._zod.def,
|
|
4764
|
-
catchall: unknown()
|
|
4765
|
-
});
|
|
5245
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
4766
5246
|
},
|
|
4767
5247
|
loose() {
|
|
4768
|
-
return this.clone({
|
|
4769
|
-
...this._zod.def,
|
|
4770
|
-
catchall: unknown()
|
|
4771
|
-
});
|
|
5248
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: unknown() }));
|
|
4772
5249
|
},
|
|
4773
5250
|
strict() {
|
|
4774
|
-
return this.clone({
|
|
4775
|
-
...this._zod.def,
|
|
4776
|
-
catchall: never()
|
|
4777
|
-
});
|
|
5251
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: never() }));
|
|
4778
5252
|
},
|
|
4779
5253
|
strip() {
|
|
4780
|
-
return this.clone({
|
|
4781
|
-
...this._zod.def,
|
|
4782
|
-
catchall: void 0
|
|
4783
|
-
});
|
|
5254
|
+
return this.clone(mergeDefs(this._zod.def, { catchall: void 0 }));
|
|
4784
5255
|
},
|
|
4785
5256
|
extend(incoming) {
|
|
4786
5257
|
return extend(this, incoming);
|
|
@@ -4840,12 +5311,34 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
4840
5311
|
right
|
|
4841
5312
|
});
|
|
4842
5313
|
}
|
|
5314
|
+
const ZodRecord = /*@__PURE__*/ $constructor("ZodRecord", (inst, def) => {
|
|
5315
|
+
_ensureDefaultMemoizer();
|
|
5316
|
+
$ZodRecord.init(inst, def);
|
|
5317
|
+
ZodType.init(inst, def);
|
|
5318
|
+
inst._zod.processJSONSchema = (ctx, json, params) => recordProcessor(inst, ctx, json, params);
|
|
5319
|
+
inst.keyType = def.keyType;
|
|
5320
|
+
inst.valueType = def.valueType;
|
|
5321
|
+
});
|
|
5322
|
+
function record(keyType, valueType, params) {
|
|
5323
|
+
if (!valueType || !valueType._zod) return new ZodRecord({
|
|
5324
|
+
type: "record",
|
|
5325
|
+
keyType: string(),
|
|
5326
|
+
valueType: keyType,
|
|
5327
|
+
...normalizeParams(valueType)
|
|
5328
|
+
});
|
|
5329
|
+
return new ZodRecord({
|
|
5330
|
+
type: "record",
|
|
5331
|
+
keyType,
|
|
5332
|
+
valueType,
|
|
5333
|
+
...normalizeParams(params)
|
|
5334
|
+
});
|
|
5335
|
+
}
|
|
4843
5336
|
const ZodEnum = /*@__PURE__*/ $constructor("ZodEnum", (inst, def) => {
|
|
4844
5337
|
$ZodEnum.init(inst, def);
|
|
4845
5338
|
ZodType.init(inst, def);
|
|
4846
5339
|
inst._zod.processJSONSchema = (ctx, json, params) => enumProcessor(inst, ctx, json, params);
|
|
4847
5340
|
inst.enum = def.entries;
|
|
4848
|
-
inst.options =
|
|
5341
|
+
inst.options = [...inst._zod.values];
|
|
4849
5342
|
const keys = new Set(Object.keys(def.entries));
|
|
4850
5343
|
inst.extract = (values, params) => {
|
|
4851
5344
|
const newEntries = {};
|
|
@@ -5048,6 +5541,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5048
5541
|
innerType
|
|
5049
5542
|
});
|
|
5050
5543
|
}
|
|
5544
|
+
const ZodLazy = /*@__PURE__*/ $constructor("ZodLazy", (inst, def) => {
|
|
5545
|
+
$ZodLazy.init(inst, def);
|
|
5546
|
+
ZodType.init(inst, def);
|
|
5547
|
+
inst._zod.processJSONSchema = (ctx, json, params) => lazyProcessor(inst, ctx, json, params);
|
|
5548
|
+
inst.unwrap = () => inst._zod.def.getter();
|
|
5549
|
+
});
|
|
5550
|
+
function lazy(getter) {
|
|
5551
|
+
return new ZodLazy({
|
|
5552
|
+
type: "lazy",
|
|
5553
|
+
getter
|
|
5554
|
+
});
|
|
5555
|
+
}
|
|
5051
5556
|
const ZodCustom = /*@__PURE__*/ $constructor("ZodCustom", (inst, def) => {
|
|
5052
5557
|
$ZodCustom.init(inst, def);
|
|
5053
5558
|
ZodType.init(inst, def);
|
|
@@ -5061,701 +5566,2163 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5061
5566
|
}
|
|
5062
5567
|
//#endregion
|
|
5063
5568
|
//#region lib/typert.remote-client.js
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5569
|
+
let FlowDataValueRemoteCodec$schema$value;
|
|
5570
|
+
const FlowDataValueRemoteCodec$schema = () => FlowDataValueRemoteCodec$schema$value ??= union([
|
|
5571
|
+
literal(null),
|
|
5572
|
+
string(),
|
|
5573
|
+
number(),
|
|
5574
|
+
literal(false),
|
|
5575
|
+
literal(true),
|
|
5576
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema())),
|
|
5577
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema()))
|
|
5578
|
+
]);
|
|
5579
|
+
let FlowDataValueRemoteCodec$schema2$value;
|
|
5580
|
+
const FlowDataValueRemoteCodec$schema2 = () => FlowDataValueRemoteCodec$schema2$value ??= union([
|
|
5581
|
+
literal(null),
|
|
5582
|
+
string(),
|
|
5583
|
+
number(),
|
|
5584
|
+
literal(false),
|
|
5585
|
+
literal(true),
|
|
5586
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema2())),
|
|
5587
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema2()))
|
|
5588
|
+
]);
|
|
5589
|
+
let FlowDataValueRemoteCodec$schema3$value;
|
|
5590
|
+
const FlowDataValueRemoteCodec$schema3 = () => FlowDataValueRemoteCodec$schema3$value ??= union([
|
|
5591
|
+
literal(null),
|
|
5592
|
+
string(),
|
|
5593
|
+
number(),
|
|
5594
|
+
literal(false),
|
|
5595
|
+
literal(true),
|
|
5596
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema3())),
|
|
5597
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema3()))
|
|
5598
|
+
]);
|
|
5599
|
+
let FlowDataValueRemoteCodec$schema4$value;
|
|
5600
|
+
const FlowDataValueRemoteCodec$schema4 = () => FlowDataValueRemoteCodec$schema4$value ??= union([
|
|
5601
|
+
literal(null),
|
|
5602
|
+
string(),
|
|
5603
|
+
number(),
|
|
5604
|
+
literal(false),
|
|
5605
|
+
literal(true),
|
|
5606
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5607
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5608
|
+
]);
|
|
5609
|
+
let FlowDataValueRemoteCodec$schema5$value;
|
|
5610
|
+
const FlowDataValueRemoteCodec$schema5 = () => FlowDataValueRemoteCodec$schema5$value ??= union([
|
|
5611
|
+
literal(null),
|
|
5612
|
+
string(),
|
|
5613
|
+
number(),
|
|
5614
|
+
literal(false),
|
|
5615
|
+
literal(true),
|
|
5616
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema5())),
|
|
5617
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema5()))
|
|
5618
|
+
]);
|
|
5619
|
+
let FlowDataValueRemoteCodec$schema6$value;
|
|
5620
|
+
const FlowDataValueRemoteCodec$schema6 = () => FlowDataValueRemoteCodec$schema6$value ??= union([
|
|
5621
|
+
literal(null),
|
|
5622
|
+
string(),
|
|
5623
|
+
number(),
|
|
5624
|
+
literal(false),
|
|
5625
|
+
literal(true),
|
|
5626
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema6())),
|
|
5627
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema6()))
|
|
5628
|
+
]);
|
|
5629
|
+
let FlowDataValueRemoteCodec$schema7$value;
|
|
5630
|
+
const FlowDataValueRemoteCodec$schema7 = () => FlowDataValueRemoteCodec$schema7$value ??= union([
|
|
5631
|
+
literal(null),
|
|
5632
|
+
string(),
|
|
5633
|
+
number(),
|
|
5634
|
+
literal(false),
|
|
5635
|
+
literal(true),
|
|
5636
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema7())),
|
|
5637
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema7()))
|
|
5638
|
+
]);
|
|
5639
|
+
let FlowDataValueRemoteCodec$schema8$value;
|
|
5640
|
+
const FlowDataValueRemoteCodec$schema8 = () => FlowDataValueRemoteCodec$schema8$value ??= union([
|
|
5641
|
+
literal(null),
|
|
5642
|
+
string(),
|
|
5643
|
+
number(),
|
|
5644
|
+
literal(false),
|
|
5645
|
+
literal(true),
|
|
5646
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema8())),
|
|
5647
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema8()))
|
|
5648
|
+
]);
|
|
5649
|
+
let FlowDataValueRemoteCodec$schema9$value;
|
|
5650
|
+
const FlowDataValueRemoteCodec$schema9 = () => FlowDataValueRemoteCodec$schema9$value ??= union([
|
|
5651
|
+
literal(null),
|
|
5652
|
+
string(),
|
|
5653
|
+
number(),
|
|
5654
|
+
literal(false),
|
|
5655
|
+
literal(true),
|
|
5656
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema9())),
|
|
5657
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema9()))
|
|
5658
|
+
]);
|
|
5659
|
+
let ScriptParamFieldRemoteCodec$schema$value;
|
|
5660
|
+
const ScriptParamFieldRemoteCodec$schema = () => ScriptParamFieldRemoteCodec$schema$value ??= object({
|
|
5661
|
+
"key": string(),
|
|
5662
|
+
"label": string(),
|
|
5663
|
+
"type": union([
|
|
5664
|
+
literal("string"),
|
|
5665
|
+
literal("number"),
|
|
5666
|
+
literal("boolean"),
|
|
5667
|
+
literal("object"),
|
|
5668
|
+
literal("file"),
|
|
5669
|
+
literal("array"),
|
|
5670
|
+
literal("select"),
|
|
5671
|
+
literal("datetime")
|
|
5672
|
+
]),
|
|
5673
|
+
"required": union([
|
|
5674
|
+
_undefined(),
|
|
5675
|
+
literal(false),
|
|
5676
|
+
literal(true)
|
|
5677
|
+
]).optional(),
|
|
5678
|
+
"defaultValue": union([
|
|
5679
|
+
_undefined(),
|
|
5680
|
+
literal(null),
|
|
5681
|
+
string(),
|
|
5682
|
+
number(),
|
|
5683
|
+
literal(false),
|
|
5684
|
+
literal(true),
|
|
5685
|
+
array(union([
|
|
5686
|
+
literal(null),
|
|
5687
|
+
string(),
|
|
5688
|
+
number(),
|
|
5689
|
+
literal(false),
|
|
5690
|
+
literal(true),
|
|
5691
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5692
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5693
|
+
])),
|
|
5694
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5695
|
+
]).optional(),
|
|
5696
|
+
"options": union([_undefined(), array(object({
|
|
5697
|
+
"label": string(),
|
|
5698
|
+
"value": union([
|
|
5699
|
+
literal(null),
|
|
5700
|
+
string(),
|
|
5701
|
+
number(),
|
|
5702
|
+
literal(false),
|
|
5703
|
+
literal(true),
|
|
5704
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5705
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5706
|
+
])
|
|
5707
|
+
}))]).optional(),
|
|
5708
|
+
"multiple": union([
|
|
5070
5709
|
_undefined(),
|
|
5071
5710
|
literal(false),
|
|
5072
5711
|
literal(true)
|
|
5712
|
+
]).optional(),
|
|
5713
|
+
"format": union([_undefined(), string()]).optional(),
|
|
5714
|
+
"placeholder": union([_undefined(), string()]).optional(),
|
|
5715
|
+
"description": union([_undefined(), string()]).optional(),
|
|
5716
|
+
"children": union([_undefined(), array(lazy(() => ScriptParamFieldRemoteCodec$schema()))]).optional(),
|
|
5717
|
+
"variants": union([_undefined(), array(object({
|
|
5718
|
+
"when": string(),
|
|
5719
|
+
"value": union([
|
|
5720
|
+
literal(null),
|
|
5721
|
+
string(),
|
|
5722
|
+
number(),
|
|
5723
|
+
literal(false),
|
|
5724
|
+
literal(true),
|
|
5725
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5726
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5727
|
+
]),
|
|
5728
|
+
"children": array(lazy(() => ScriptParamFieldRemoteCodec$schema()))
|
|
5729
|
+
}))]).optional(),
|
|
5730
|
+
"visibleWhen": union([
|
|
5731
|
+
_undefined(),
|
|
5732
|
+
object({
|
|
5733
|
+
"key": string(),
|
|
5734
|
+
"op": union([
|
|
5735
|
+
_undefined(),
|
|
5736
|
+
literal("eq"),
|
|
5737
|
+
literal("not"),
|
|
5738
|
+
literal("gte"),
|
|
5739
|
+
literal("lte"),
|
|
5740
|
+
literal("gt"),
|
|
5741
|
+
literal("lt"),
|
|
5742
|
+
literal("startsWith"),
|
|
5743
|
+
literal("endsWith"),
|
|
5744
|
+
literal("includes"),
|
|
5745
|
+
literal("regex"),
|
|
5746
|
+
literal("exists")
|
|
5747
|
+
]).optional(),
|
|
5748
|
+
"value": union([
|
|
5749
|
+
_undefined(),
|
|
5750
|
+
literal(null),
|
|
5751
|
+
string(),
|
|
5752
|
+
number(),
|
|
5753
|
+
literal(false),
|
|
5754
|
+
literal(true),
|
|
5755
|
+
array(union([
|
|
5756
|
+
literal(null),
|
|
5757
|
+
string(),
|
|
5758
|
+
number(),
|
|
5759
|
+
literal(false),
|
|
5760
|
+
literal(true),
|
|
5761
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5762
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5763
|
+
])),
|
|
5764
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5765
|
+
]).optional(),
|
|
5766
|
+
"values": union([_undefined(), array(union([
|
|
5767
|
+
literal(null),
|
|
5768
|
+
string(),
|
|
5769
|
+
number(),
|
|
5770
|
+
literal(false),
|
|
5771
|
+
literal(true),
|
|
5772
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5773
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5774
|
+
]))]).optional()
|
|
5775
|
+
}),
|
|
5776
|
+
array(object({
|
|
5777
|
+
"key": string(),
|
|
5778
|
+
"op": union([
|
|
5779
|
+
_undefined(),
|
|
5780
|
+
literal("eq"),
|
|
5781
|
+
literal("not"),
|
|
5782
|
+
literal("gte"),
|
|
5783
|
+
literal("lte"),
|
|
5784
|
+
literal("gt"),
|
|
5785
|
+
literal("lt"),
|
|
5786
|
+
literal("startsWith"),
|
|
5787
|
+
literal("endsWith"),
|
|
5788
|
+
literal("includes"),
|
|
5789
|
+
literal("regex"),
|
|
5790
|
+
literal("exists")
|
|
5791
|
+
]).optional(),
|
|
5792
|
+
"value": union([
|
|
5793
|
+
_undefined(),
|
|
5794
|
+
literal(null),
|
|
5795
|
+
string(),
|
|
5796
|
+
number(),
|
|
5797
|
+
literal(false),
|
|
5798
|
+
literal(true),
|
|
5799
|
+
array(union([
|
|
5800
|
+
literal(null),
|
|
5801
|
+
string(),
|
|
5802
|
+
number(),
|
|
5803
|
+
literal(false),
|
|
5804
|
+
literal(true),
|
|
5805
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5806
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5807
|
+
])),
|
|
5808
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5809
|
+
]).optional(),
|
|
5810
|
+
"values": union([_undefined(), array(union([
|
|
5811
|
+
literal(null),
|
|
5812
|
+
string(),
|
|
5813
|
+
number(),
|
|
5814
|
+
literal(false),
|
|
5815
|
+
literal(true),
|
|
5816
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
5817
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
5818
|
+
]))]).optional()
|
|
5819
|
+
}))
|
|
5073
5820
|
]).optional()
|
|
5074
5821
|
});
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
|
|
5081
|
-
"
|
|
5082
|
-
"
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
"
|
|
5089
|
-
"
|
|
5090
|
-
"
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
"
|
|
5096
|
-
"
|
|
5822
|
+
let dsh_auto_flow_autoFlow_approveRun_parameter_0$schema$value;
|
|
5823
|
+
const dsh_auto_flow_autoFlow_approveRun_parameter_0$schema = () => dsh_auto_flow_autoFlow_approveRun_parameter_0$schema$value ??= string();
|
|
5824
|
+
let dsh_auto_flow_autoFlow_approveRun_parameter_1$schema$value;
|
|
5825
|
+
const dsh_auto_flow_autoFlow_approveRun_parameter_1$schema = () => dsh_auto_flow_autoFlow_approveRun_parameter_1$schema$value ??= string();
|
|
5826
|
+
let dsh_auto_flow_autoFlow_approveRun_result$schema$value;
|
|
5827
|
+
const dsh_auto_flow_autoFlow_approveRun_result$schema = () => dsh_auto_flow_autoFlow_approveRun_result$schema$value ??= object({
|
|
5828
|
+
"runId": string(),
|
|
5829
|
+
"workflowId": string(),
|
|
5830
|
+
"name": string(),
|
|
5831
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
5832
|
+
"status": union([
|
|
5833
|
+
literal("running"),
|
|
5834
|
+
literal("waiting"),
|
|
5835
|
+
literal("completed"),
|
|
5836
|
+
literal("failed"),
|
|
5837
|
+
literal("cancelled"),
|
|
5838
|
+
literal("crashed")
|
|
5839
|
+
]),
|
|
5840
|
+
"workspaceDir": string(),
|
|
5841
|
+
"steps": array(object({
|
|
5842
|
+
"index": number(),
|
|
5843
|
+
"nodeId": string(),
|
|
5844
|
+
"itemCounts": union([_undefined(), object({
|
|
5845
|
+
"in": record(string(), number()),
|
|
5846
|
+
"out": record(string(), number())
|
|
5847
|
+
})]).optional(),
|
|
5848
|
+
"inputSources": union([_undefined(), array(string())]).optional(),
|
|
5849
|
+
"nodeType": string(),
|
|
5850
|
+
"label": string(),
|
|
5851
|
+
"status": union([
|
|
5852
|
+
literal("success"),
|
|
5853
|
+
literal("running"),
|
|
5854
|
+
literal("waiting"),
|
|
5855
|
+
literal("failed"),
|
|
5856
|
+
literal("pending"),
|
|
5857
|
+
literal("skipped")
|
|
5858
|
+
]),
|
|
5859
|
+
"statusChangedAt": union([_undefined(), number()]).optional(),
|
|
5860
|
+
"startedAt": union([_undefined(), number()]).optional(),
|
|
5861
|
+
"finishedAt": union([_undefined(), number()]).optional(),
|
|
5862
|
+
"script": union([_undefined(), string()]).optional(),
|
|
5863
|
+
"stepDir": union([_undefined(), string()]).optional(),
|
|
5864
|
+
"files": union([_undefined(), array(string())]).optional(),
|
|
5865
|
+
"items": union([_undefined(), array(object({
|
|
5866
|
+
"json": record(string(), union([
|
|
5867
|
+
literal(null),
|
|
5868
|
+
string(),
|
|
5869
|
+
number(),
|
|
5870
|
+
literal(false),
|
|
5871
|
+
literal(true),
|
|
5872
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema8())),
|
|
5873
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema8()))
|
|
5874
|
+
])),
|
|
5875
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
5876
|
+
}))]).optional(),
|
|
5877
|
+
"portItems": union([_undefined(), record(string(), array(object({
|
|
5878
|
+
"json": record(string(), union([
|
|
5879
|
+
literal(null),
|
|
5880
|
+
string(),
|
|
5881
|
+
number(),
|
|
5882
|
+
literal(false),
|
|
5883
|
+
literal(true),
|
|
5884
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema8())),
|
|
5885
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema8()))
|
|
5886
|
+
])),
|
|
5887
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
5888
|
+
})))]).optional(),
|
|
5889
|
+
"failedItems": union([_undefined(), array(object({
|
|
5890
|
+
"index": number(),
|
|
5891
|
+
"error": string()
|
|
5892
|
+
}))]).optional(),
|
|
5893
|
+
"skippedCount": union([_undefined(), number()]).optional(),
|
|
5894
|
+
"itemsRef": union([_undefined(), string()]).optional(),
|
|
5895
|
+
"error": union([_undefined(), string()]).optional(),
|
|
5896
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
5897
|
+
"durationMs": union([_undefined(), number()]).optional(),
|
|
5898
|
+
"attempts": union([_undefined(), array(object({
|
|
5899
|
+
"attempt": number(),
|
|
5900
|
+
"startedAt": number(),
|
|
5901
|
+
"finishedAt": number(),
|
|
5902
|
+
"durationMs": number(),
|
|
5903
|
+
"ok": boolean(),
|
|
5904
|
+
"itemCounts": union([_undefined(), record(string(), number())]).optional(),
|
|
5905
|
+
"error": union([_undefined(), string()]).optional(),
|
|
5906
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
5907
|
+
"retryable": union([
|
|
5908
|
+
_undefined(),
|
|
5909
|
+
literal(false),
|
|
5910
|
+
literal(true)
|
|
5911
|
+
]).optional()
|
|
5912
|
+
}))]).optional(),
|
|
5913
|
+
"logs": union([_undefined(), array(object({
|
|
5914
|
+
"at": number(),
|
|
5915
|
+
"kind": string(),
|
|
5916
|
+
"message": string(),
|
|
5917
|
+
"data": union([_undefined(), record(string(), union([
|
|
5918
|
+
literal(null),
|
|
5919
|
+
string(),
|
|
5920
|
+
number(),
|
|
5921
|
+
literal(false),
|
|
5922
|
+
literal(true),
|
|
5923
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema8())),
|
|
5924
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema8()))
|
|
5925
|
+
]))]).optional()
|
|
5926
|
+
}))]).optional()
|
|
5927
|
+
})),
|
|
5928
|
+
"batch": union([_undefined(), object({
|
|
5929
|
+
"batchId": string(),
|
|
5930
|
+
"nodeId": string(),
|
|
5931
|
+
"port": string(),
|
|
5932
|
+
"keyField": union([_undefined(), string()]).optional()
|
|
5933
|
+
})]).optional(),
|
|
5934
|
+
"resumeMode": union([
|
|
5935
|
+
_undefined(),
|
|
5936
|
+
literal("rerun-all"),
|
|
5937
|
+
literal("skip-succeeded")
|
|
5938
|
+
]).optional(),
|
|
5939
|
+
"createdAt": number(),
|
|
5940
|
+
"updatedAt": number()
|
|
5941
|
+
});
|
|
5942
|
+
let dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema$value;
|
|
5943
|
+
const dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema = () => dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema$value ??= string();
|
|
5944
|
+
let dsh_auto_flow_autoFlow_cancelRun_result$schema$value;
|
|
5945
|
+
const dsh_auto_flow_autoFlow_cancelRun_result$schema = () => dsh_auto_flow_autoFlow_cancelRun_result$schema$value ??= object({
|
|
5946
|
+
"runId": string(),
|
|
5947
|
+
"workflowId": string(),
|
|
5948
|
+
"name": string(),
|
|
5949
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
5950
|
+
"status": union([
|
|
5951
|
+
literal("running"),
|
|
5952
|
+
literal("waiting"),
|
|
5953
|
+
literal("completed"),
|
|
5954
|
+
literal("failed"),
|
|
5955
|
+
literal("cancelled"),
|
|
5956
|
+
literal("crashed")
|
|
5957
|
+
]),
|
|
5958
|
+
"workspaceDir": string(),
|
|
5959
|
+
"steps": array(object({
|
|
5960
|
+
"index": number(),
|
|
5961
|
+
"nodeId": string(),
|
|
5962
|
+
"itemCounts": union([_undefined(), object({
|
|
5963
|
+
"in": record(string(), number()),
|
|
5964
|
+
"out": record(string(), number())
|
|
5965
|
+
})]).optional(),
|
|
5966
|
+
"inputSources": union([_undefined(), array(string())]).optional(),
|
|
5967
|
+
"nodeType": string(),
|
|
5968
|
+
"label": string(),
|
|
5969
|
+
"status": union([
|
|
5970
|
+
literal("success"),
|
|
5971
|
+
literal("running"),
|
|
5972
|
+
literal("waiting"),
|
|
5973
|
+
literal("failed"),
|
|
5974
|
+
literal("pending"),
|
|
5975
|
+
literal("skipped")
|
|
5976
|
+
]),
|
|
5977
|
+
"statusChangedAt": union([_undefined(), number()]).optional(),
|
|
5978
|
+
"startedAt": union([_undefined(), number()]).optional(),
|
|
5979
|
+
"finishedAt": union([_undefined(), number()]).optional(),
|
|
5980
|
+
"script": union([_undefined(), string()]).optional(),
|
|
5981
|
+
"stepDir": union([_undefined(), string()]).optional(),
|
|
5982
|
+
"files": union([_undefined(), array(string())]).optional(),
|
|
5983
|
+
"items": union([_undefined(), array(object({
|
|
5984
|
+
"json": record(string(), union([
|
|
5985
|
+
literal(null),
|
|
5986
|
+
string(),
|
|
5987
|
+
number(),
|
|
5988
|
+
literal(false),
|
|
5989
|
+
literal(true),
|
|
5990
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema7())),
|
|
5991
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema7()))
|
|
5992
|
+
])),
|
|
5993
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
5994
|
+
}))]).optional(),
|
|
5995
|
+
"portItems": union([_undefined(), record(string(), array(object({
|
|
5996
|
+
"json": record(string(), union([
|
|
5997
|
+
literal(null),
|
|
5998
|
+
string(),
|
|
5999
|
+
number(),
|
|
6000
|
+
literal(false),
|
|
6001
|
+
literal(true),
|
|
6002
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema7())),
|
|
6003
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema7()))
|
|
6004
|
+
])),
|
|
6005
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
6006
|
+
})))]).optional(),
|
|
6007
|
+
"failedItems": union([_undefined(), array(object({
|
|
6008
|
+
"index": number(),
|
|
6009
|
+
"error": string()
|
|
6010
|
+
}))]).optional(),
|
|
6011
|
+
"skippedCount": union([_undefined(), number()]).optional(),
|
|
6012
|
+
"itemsRef": union([_undefined(), string()]).optional(),
|
|
6013
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6014
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6015
|
+
"durationMs": union([_undefined(), number()]).optional(),
|
|
6016
|
+
"attempts": union([_undefined(), array(object({
|
|
6017
|
+
"attempt": number(),
|
|
6018
|
+
"startedAt": number(),
|
|
6019
|
+
"finishedAt": number(),
|
|
6020
|
+
"durationMs": number(),
|
|
6021
|
+
"ok": boolean(),
|
|
6022
|
+
"itemCounts": union([_undefined(), record(string(), number())]).optional(),
|
|
6023
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6024
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6025
|
+
"retryable": union([
|
|
6026
|
+
_undefined(),
|
|
6027
|
+
literal(false),
|
|
6028
|
+
literal(true)
|
|
6029
|
+
]).optional()
|
|
6030
|
+
}))]).optional(),
|
|
6031
|
+
"logs": union([_undefined(), array(object({
|
|
6032
|
+
"at": number(),
|
|
6033
|
+
"kind": string(),
|
|
6034
|
+
"message": string(),
|
|
6035
|
+
"data": union([_undefined(), record(string(), union([
|
|
6036
|
+
literal(null),
|
|
6037
|
+
string(),
|
|
6038
|
+
number(),
|
|
6039
|
+
literal(false),
|
|
6040
|
+
literal(true),
|
|
6041
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema7())),
|
|
6042
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema7()))
|
|
6043
|
+
]))]).optional()
|
|
6044
|
+
}))]).optional()
|
|
6045
|
+
})),
|
|
6046
|
+
"batch": union([_undefined(), object({
|
|
6047
|
+
"batchId": string(),
|
|
6048
|
+
"nodeId": string(),
|
|
6049
|
+
"port": string(),
|
|
6050
|
+
"keyField": union([_undefined(), string()]).optional()
|
|
6051
|
+
})]).optional(),
|
|
6052
|
+
"resumeMode": union([
|
|
6053
|
+
_undefined(),
|
|
6054
|
+
literal("rerun-all"),
|
|
6055
|
+
literal("skip-succeeded")
|
|
6056
|
+
]).optional(),
|
|
6057
|
+
"createdAt": number(),
|
|
6058
|
+
"updatedAt": number()
|
|
6059
|
+
});
|
|
6060
|
+
let dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema$value;
|
|
6061
|
+
const dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema = () => dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema$value ??= string();
|
|
6062
|
+
let dsh_auto_flow_autoFlow_deleteFlow_result$schema$value;
|
|
6063
|
+
const dsh_auto_flow_autoFlow_deleteFlow_result$schema = () => dsh_auto_flow_autoFlow_deleteFlow_result$schema$value ??= object({ "deleted": boolean() });
|
|
6064
|
+
let dsh_auto_flow_autoFlow_listFlows_result$schema$value;
|
|
6065
|
+
const dsh_auto_flow_autoFlow_listFlows_result$schema = () => dsh_auto_flow_autoFlow_listFlows_result$schema$value ??= array(object({
|
|
6066
|
+
"id": string(),
|
|
6067
|
+
"name": string(),
|
|
6068
|
+
"description": string(),
|
|
6069
|
+
"nodeCount": number(),
|
|
6070
|
+
"inputs": array(string())
|
|
6071
|
+
}));
|
|
6072
|
+
let dsh_auto_flow_autoFlow_listLlmRoutes_result$schema$value;
|
|
6073
|
+
const dsh_auto_flow_autoFlow_listLlmRoutes_result$schema = () => dsh_auto_flow_autoFlow_listLlmRoutes_result$schema$value ??= object({ "routes": array(object({
|
|
6074
|
+
"provider": string(),
|
|
6075
|
+
"displayName": string()
|
|
6076
|
+
})) });
|
|
6077
|
+
let dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema$value;
|
|
6078
|
+
const dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema = () => dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema$value ??= object({ "provider": string() });
|
|
6079
|
+
let dsh_auto_flow_autoFlow_listRouteModels_result$schema$value;
|
|
6080
|
+
const dsh_auto_flow_autoFlow_listRouteModels_result$schema = () => dsh_auto_flow_autoFlow_listRouteModels_result$schema$value ??= object({
|
|
6081
|
+
"models": array(object({
|
|
6082
|
+
"id": string(),
|
|
6083
|
+
"name": string()
|
|
6084
|
+
})),
|
|
6085
|
+
"error": union([_undefined(), string()]).optional()
|
|
6086
|
+
});
|
|
6087
|
+
let dsh_auto_flow_autoFlow_listRuns_parameter_0$schema$value;
|
|
6088
|
+
const dsh_auto_flow_autoFlow_listRuns_parameter_0$schema = () => dsh_auto_flow_autoFlow_listRuns_parameter_0$schema$value ??= object({
|
|
6089
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
6090
|
+
"workflowId": union([_undefined(), string()]).optional()
|
|
6091
|
+
});
|
|
6092
|
+
let dsh_auto_flow_autoFlow_listRuns_result$schema$value;
|
|
6093
|
+
const dsh_auto_flow_autoFlow_listRuns_result$schema = () => dsh_auto_flow_autoFlow_listRuns_result$schema$value ??= array(object({
|
|
6094
|
+
"runId": string(),
|
|
6095
|
+
"workflowId": string(),
|
|
6096
|
+
"name": string(),
|
|
6097
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
6098
|
+
"status": union([
|
|
6099
|
+
literal("running"),
|
|
6100
|
+
literal("waiting"),
|
|
6101
|
+
literal("completed"),
|
|
6102
|
+
literal("failed"),
|
|
6103
|
+
literal("cancelled"),
|
|
6104
|
+
literal("crashed")
|
|
6105
|
+
]),
|
|
6106
|
+
"nodeCount": number(),
|
|
6107
|
+
"createdAt": number(),
|
|
6108
|
+
"updatedAt": number()
|
|
6109
|
+
}));
|
|
6110
|
+
let dsh_auto_flow_autoFlow_listScripts_result$schema$value;
|
|
6111
|
+
const dsh_auto_flow_autoFlow_listScripts_result$schema = () => dsh_auto_flow_autoFlow_listScripts_result$schema$value ??= array(object({
|
|
6112
|
+
"name": string(),
|
|
6113
|
+
"label": string(),
|
|
6114
|
+
"description": string(),
|
|
6115
|
+
"params": array(object({
|
|
6116
|
+
"key": string(),
|
|
6117
|
+
"label": string(),
|
|
6118
|
+
"type": union([
|
|
6119
|
+
literal("string"),
|
|
6120
|
+
literal("number"),
|
|
6121
|
+
literal("boolean"),
|
|
6122
|
+
literal("object"),
|
|
6123
|
+
literal("file"),
|
|
6124
|
+
literal("array"),
|
|
6125
|
+
literal("select"),
|
|
6126
|
+
literal("datetime")
|
|
6127
|
+
]),
|
|
6128
|
+
"required": union([
|
|
6129
|
+
_undefined(),
|
|
6130
|
+
literal(false),
|
|
6131
|
+
literal(true)
|
|
6132
|
+
]).optional(),
|
|
6133
|
+
"defaultValue": union([
|
|
6134
|
+
_undefined(),
|
|
6135
|
+
literal(null),
|
|
6136
|
+
string(),
|
|
6137
|
+
number(),
|
|
6138
|
+
literal(false),
|
|
6139
|
+
literal(true),
|
|
6140
|
+
array(union([
|
|
6141
|
+
literal(null),
|
|
6142
|
+
string(),
|
|
6143
|
+
number(),
|
|
6144
|
+
literal(false),
|
|
6145
|
+
literal(true),
|
|
6146
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6147
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6148
|
+
])),
|
|
6149
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6150
|
+
]).optional(),
|
|
6151
|
+
"options": union([_undefined(), array(object({
|
|
6152
|
+
"label": string(),
|
|
6153
|
+
"value": union([
|
|
6154
|
+
literal(null),
|
|
6155
|
+
string(),
|
|
6156
|
+
number(),
|
|
6157
|
+
literal(false),
|
|
6158
|
+
literal(true),
|
|
6159
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6160
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6161
|
+
])
|
|
6162
|
+
}))]).optional(),
|
|
6163
|
+
"multiple": union([
|
|
5097
6164
|
_undefined(),
|
|
5098
6165
|
literal(false),
|
|
5099
6166
|
literal(true)
|
|
6167
|
+
]).optional(),
|
|
6168
|
+
"format": union([_undefined(), string()]).optional(),
|
|
6169
|
+
"placeholder": union([_undefined(), string()]).optional(),
|
|
6170
|
+
"description": union([_undefined(), string()]).optional(),
|
|
6171
|
+
"children": union([_undefined(), array(lazy(() => ScriptParamFieldRemoteCodec$schema()))]).optional(),
|
|
6172
|
+
"variants": union([_undefined(), array(object({
|
|
6173
|
+
"when": string(),
|
|
6174
|
+
"value": union([
|
|
6175
|
+
literal(null),
|
|
6176
|
+
string(),
|
|
6177
|
+
number(),
|
|
6178
|
+
literal(false),
|
|
6179
|
+
literal(true),
|
|
6180
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6181
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6182
|
+
]),
|
|
6183
|
+
"children": array(lazy(() => ScriptParamFieldRemoteCodec$schema()))
|
|
6184
|
+
}))]).optional(),
|
|
6185
|
+
"visibleWhen": union([
|
|
6186
|
+
_undefined(),
|
|
6187
|
+
object({
|
|
6188
|
+
"key": string(),
|
|
6189
|
+
"op": union([
|
|
6190
|
+
_undefined(),
|
|
6191
|
+
literal("eq"),
|
|
6192
|
+
literal("not"),
|
|
6193
|
+
literal("gte"),
|
|
6194
|
+
literal("lte"),
|
|
6195
|
+
literal("gt"),
|
|
6196
|
+
literal("lt"),
|
|
6197
|
+
literal("startsWith"),
|
|
6198
|
+
literal("endsWith"),
|
|
6199
|
+
literal("includes"),
|
|
6200
|
+
literal("regex"),
|
|
6201
|
+
literal("exists")
|
|
6202
|
+
]).optional(),
|
|
6203
|
+
"value": union([
|
|
6204
|
+
_undefined(),
|
|
6205
|
+
literal(null),
|
|
6206
|
+
string(),
|
|
6207
|
+
number(),
|
|
6208
|
+
literal(false),
|
|
6209
|
+
literal(true),
|
|
6210
|
+
array(union([
|
|
6211
|
+
literal(null),
|
|
6212
|
+
string(),
|
|
6213
|
+
number(),
|
|
6214
|
+
literal(false),
|
|
6215
|
+
literal(true),
|
|
6216
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6217
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6218
|
+
])),
|
|
6219
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6220
|
+
]).optional(),
|
|
6221
|
+
"values": union([_undefined(), array(union([
|
|
6222
|
+
literal(null),
|
|
6223
|
+
string(),
|
|
6224
|
+
number(),
|
|
6225
|
+
literal(false),
|
|
6226
|
+
literal(true),
|
|
6227
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6228
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6229
|
+
]))]).optional()
|
|
6230
|
+
}),
|
|
6231
|
+
array(object({
|
|
6232
|
+
"key": string(),
|
|
6233
|
+
"op": union([
|
|
6234
|
+
_undefined(),
|
|
6235
|
+
literal("eq"),
|
|
6236
|
+
literal("not"),
|
|
6237
|
+
literal("gte"),
|
|
6238
|
+
literal("lte"),
|
|
6239
|
+
literal("gt"),
|
|
6240
|
+
literal("lt"),
|
|
6241
|
+
literal("startsWith"),
|
|
6242
|
+
literal("endsWith"),
|
|
6243
|
+
literal("includes"),
|
|
6244
|
+
literal("regex"),
|
|
6245
|
+
literal("exists")
|
|
6246
|
+
]).optional(),
|
|
6247
|
+
"value": union([
|
|
6248
|
+
_undefined(),
|
|
6249
|
+
literal(null),
|
|
6250
|
+
string(),
|
|
6251
|
+
number(),
|
|
6252
|
+
literal(false),
|
|
6253
|
+
literal(true),
|
|
6254
|
+
array(union([
|
|
6255
|
+
literal(null),
|
|
6256
|
+
string(),
|
|
6257
|
+
number(),
|
|
6258
|
+
literal(false),
|
|
6259
|
+
literal(true),
|
|
6260
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6261
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6262
|
+
])),
|
|
6263
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6264
|
+
]).optional(),
|
|
6265
|
+
"values": union([_undefined(), array(union([
|
|
6266
|
+
literal(null),
|
|
6267
|
+
string(),
|
|
6268
|
+
number(),
|
|
6269
|
+
literal(false),
|
|
6270
|
+
literal(true),
|
|
6271
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema4())),
|
|
6272
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema4()))
|
|
6273
|
+
]))]).optional()
|
|
6274
|
+
}))
|
|
5100
6275
|
]).optional()
|
|
5101
|
-
})
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
6276
|
+
})),
|
|
6277
|
+
"artifacts": union([_undefined(), object({
|
|
6278
|
+
"filesKey": union([_undefined(), string()]).optional(),
|
|
6279
|
+
"filesShape": union([
|
|
6280
|
+
_undefined(),
|
|
6281
|
+
literal("paths"),
|
|
6282
|
+
literal("prompt-pairs")
|
|
6283
|
+
]).optional(),
|
|
6284
|
+
"filesPromptKey": union([_undefined(), string()]).optional()
|
|
6285
|
+
})]).optional(),
|
|
6286
|
+
"source": union([_undefined(), object({
|
|
6287
|
+
"id": string(),
|
|
6288
|
+
"label": string()
|
|
6289
|
+
})]).optional(),
|
|
6290
|
+
"diagnostics": union([_undefined(), array(object({
|
|
6291
|
+
"name": string(),
|
|
6292
|
+
"code": string(),
|
|
6293
|
+
"message": string()
|
|
6294
|
+
}))]).optional()
|
|
6295
|
+
}));
|
|
6296
|
+
let dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema$value;
|
|
6297
|
+
const dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema = () => dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema$value ??= string();
|
|
6298
|
+
let dsh_auto_flow_autoFlow_loadFlow_result$schema$value;
|
|
6299
|
+
const dsh_auto_flow_autoFlow_loadFlow_result$schema = () => dsh_auto_flow_autoFlow_loadFlow_result$schema$value ??= union([literal(null), object({
|
|
6300
|
+
"formatVersion": number(),
|
|
6301
|
+
"name": string(),
|
|
6302
|
+
"description": string(),
|
|
6303
|
+
"nodes": array(object({
|
|
6304
|
+
"id": string(),
|
|
6305
|
+
"name": string(),
|
|
6306
|
+
"type": string(),
|
|
6307
|
+
"position": object({
|
|
6308
|
+
"x": number(),
|
|
6309
|
+
"y": number()
|
|
6310
|
+
}),
|
|
6311
|
+
"data": record(string(), union([
|
|
6312
|
+
literal(null),
|
|
6313
|
+
string(),
|
|
6314
|
+
number(),
|
|
6315
|
+
literal(false),
|
|
6316
|
+
literal(true),
|
|
6317
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema())),
|
|
6318
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema()))
|
|
6319
|
+
])),
|
|
6320
|
+
"style": union([_undefined(), record(string(), union([
|
|
6321
|
+
literal(null),
|
|
6322
|
+
string(),
|
|
6323
|
+
number(),
|
|
6324
|
+
literal(false),
|
|
6325
|
+
literal(true),
|
|
6326
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema())),
|
|
6327
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema()))
|
|
6328
|
+
]))]).optional()
|
|
6329
|
+
})),
|
|
6330
|
+
"edges": array(object({
|
|
6331
|
+
"id": string(),
|
|
6332
|
+
"source": string(),
|
|
6333
|
+
"target": string(),
|
|
6334
|
+
"sourceHandle": union([_undefined(), string()]).optional(),
|
|
6335
|
+
"targetHandle": union([_undefined(), string()]).optional(),
|
|
6336
|
+
"type": union([
|
|
6337
|
+
_undefined(),
|
|
6338
|
+
literal("default"),
|
|
6339
|
+
literal("custom-edge"),
|
|
6340
|
+
literal("straight"),
|
|
6341
|
+
literal("step"),
|
|
6342
|
+
literal("smoothstep"),
|
|
6343
|
+
literal("simplebezier")
|
|
6344
|
+
]).optional()
|
|
6345
|
+
}))
|
|
5105
6346
|
})]);
|
|
5106
|
-
|
|
5107
|
-
const
|
|
5108
|
-
|
|
5109
|
-
const
|
|
5110
|
-
"
|
|
5111
|
-
"
|
|
5112
|
-
"
|
|
5113
|
-
|
|
5114
|
-
|
|
5115
|
-
|
|
5116
|
-
|
|
5117
|
-
|
|
6347
|
+
let dsh_auto_flow_autoFlow_resumeRun_parameter_0$schema$value;
|
|
6348
|
+
const dsh_auto_flow_autoFlow_resumeRun_parameter_0$schema = () => dsh_auto_flow_autoFlow_resumeRun_parameter_0$schema$value ??= string();
|
|
6349
|
+
let dsh_auto_flow_autoFlow_resumeRun_result$schema$value;
|
|
6350
|
+
const dsh_auto_flow_autoFlow_resumeRun_result$schema = () => dsh_auto_flow_autoFlow_resumeRun_result$schema$value ??= object({
|
|
6351
|
+
"runId": string(),
|
|
6352
|
+
"workflowId": string(),
|
|
6353
|
+
"name": string(),
|
|
6354
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
6355
|
+
"status": union([
|
|
6356
|
+
literal("running"),
|
|
6357
|
+
literal("waiting"),
|
|
6358
|
+
literal("completed"),
|
|
6359
|
+
literal("failed"),
|
|
6360
|
+
literal("cancelled"),
|
|
6361
|
+
literal("crashed")
|
|
6362
|
+
]),
|
|
6363
|
+
"workspaceDir": string(),
|
|
6364
|
+
"steps": array(object({
|
|
6365
|
+
"index": number(),
|
|
6366
|
+
"nodeId": string(),
|
|
6367
|
+
"itemCounts": union([_undefined(), object({
|
|
6368
|
+
"in": record(string(), number()),
|
|
6369
|
+
"out": record(string(), number())
|
|
6370
|
+
})]).optional(),
|
|
6371
|
+
"inputSources": union([_undefined(), array(string())]).optional(),
|
|
6372
|
+
"nodeType": string(),
|
|
6373
|
+
"label": string(),
|
|
6374
|
+
"status": union([
|
|
6375
|
+
literal("success"),
|
|
6376
|
+
literal("running"),
|
|
6377
|
+
literal("waiting"),
|
|
6378
|
+
literal("failed"),
|
|
6379
|
+
literal("pending"),
|
|
6380
|
+
literal("skipped")
|
|
6381
|
+
]),
|
|
6382
|
+
"statusChangedAt": union([_undefined(), number()]).optional(),
|
|
6383
|
+
"startedAt": union([_undefined(), number()]).optional(),
|
|
6384
|
+
"finishedAt": union([_undefined(), number()]).optional(),
|
|
6385
|
+
"script": union([_undefined(), string()]).optional(),
|
|
6386
|
+
"stepDir": union([_undefined(), string()]).optional(),
|
|
6387
|
+
"files": union([_undefined(), array(string())]).optional(),
|
|
6388
|
+
"items": union([_undefined(), array(object({
|
|
6389
|
+
"json": record(string(), union([
|
|
6390
|
+
literal(null),
|
|
6391
|
+
string(),
|
|
6392
|
+
number(),
|
|
6393
|
+
literal(false),
|
|
6394
|
+
literal(true),
|
|
6395
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema9())),
|
|
6396
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema9()))
|
|
6397
|
+
])),
|
|
6398
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
6399
|
+
}))]).optional(),
|
|
6400
|
+
"portItems": union([_undefined(), record(string(), array(object({
|
|
6401
|
+
"json": record(string(), union([
|
|
6402
|
+
literal(null),
|
|
6403
|
+
string(),
|
|
6404
|
+
number(),
|
|
6405
|
+
literal(false),
|
|
6406
|
+
literal(true),
|
|
6407
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema9())),
|
|
6408
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema9()))
|
|
6409
|
+
])),
|
|
6410
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
6411
|
+
})))]).optional(),
|
|
6412
|
+
"failedItems": union([_undefined(), array(object({
|
|
6413
|
+
"index": number(),
|
|
6414
|
+
"error": string()
|
|
6415
|
+
}))]).optional(),
|
|
6416
|
+
"skippedCount": union([_undefined(), number()]).optional(),
|
|
6417
|
+
"itemsRef": union([_undefined(), string()]).optional(),
|
|
6418
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6419
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6420
|
+
"durationMs": union([_undefined(), number()]).optional(),
|
|
6421
|
+
"attempts": union([_undefined(), array(object({
|
|
6422
|
+
"attempt": number(),
|
|
6423
|
+
"startedAt": number(),
|
|
6424
|
+
"finishedAt": number(),
|
|
6425
|
+
"durationMs": number(),
|
|
6426
|
+
"ok": boolean(),
|
|
6427
|
+
"itemCounts": union([_undefined(), record(string(), number())]).optional(),
|
|
6428
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6429
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6430
|
+
"retryable": union([
|
|
6431
|
+
_undefined(),
|
|
6432
|
+
literal(false),
|
|
6433
|
+
literal(true)
|
|
6434
|
+
]).optional()
|
|
6435
|
+
}))]).optional(),
|
|
6436
|
+
"logs": union([_undefined(), array(object({
|
|
6437
|
+
"at": number(),
|
|
6438
|
+
"kind": string(),
|
|
6439
|
+
"message": string(),
|
|
6440
|
+
"data": union([_undefined(), record(string(), union([
|
|
6441
|
+
literal(null),
|
|
6442
|
+
string(),
|
|
6443
|
+
number(),
|
|
6444
|
+
literal(false),
|
|
6445
|
+
literal(true),
|
|
6446
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema9())),
|
|
6447
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema9()))
|
|
6448
|
+
]))]).optional()
|
|
6449
|
+
}))]).optional()
|
|
6450
|
+
})),
|
|
6451
|
+
"batch": union([_undefined(), object({
|
|
6452
|
+
"batchId": string(),
|
|
6453
|
+
"nodeId": string(),
|
|
6454
|
+
"port": string(),
|
|
6455
|
+
"keyField": union([_undefined(), string()]).optional()
|
|
6456
|
+
})]).optional(),
|
|
6457
|
+
"resumeMode": union([
|
|
6458
|
+
_undefined(),
|
|
6459
|
+
literal("rerun-all"),
|
|
6460
|
+
literal("skip-succeeded")
|
|
6461
|
+
]).optional(),
|
|
6462
|
+
"createdAt": number(),
|
|
6463
|
+
"updatedAt": number()
|
|
6464
|
+
});
|
|
6465
|
+
let dsh_auto_flow_autoFlow_retryRun_parameter_0$schema$value;
|
|
6466
|
+
const dsh_auto_flow_autoFlow_retryRun_parameter_0$schema = () => dsh_auto_flow_autoFlow_retryRun_parameter_0$schema$value ??= string();
|
|
6467
|
+
let dsh_auto_flow_autoFlow_retryRun_result$schema$value;
|
|
6468
|
+
const dsh_auto_flow_autoFlow_retryRun_result$schema = () => dsh_auto_flow_autoFlow_retryRun_result$schema$value ??= object({
|
|
6469
|
+
"runId": string(),
|
|
6470
|
+
"plan": object({
|
|
6471
|
+
"batchId": string(),
|
|
6472
|
+
"keyField": string(),
|
|
6473
|
+
"resumeMode": union([literal("rerun-all"), literal("skip-succeeded")]),
|
|
6474
|
+
"pendingCount": number(),
|
|
6475
|
+
"knownCount": number()
|
|
6476
|
+
})
|
|
6477
|
+
});
|
|
6478
|
+
let dsh_auto_flow_autoFlow_runFlow_parameter_0$schema$value;
|
|
6479
|
+
const dsh_auto_flow_autoFlow_runFlow_parameter_0$schema = () => dsh_auto_flow_autoFlow_runFlow_parameter_0$schema$value ??= object({
|
|
6480
|
+
"flow": object({
|
|
6481
|
+
"nodes": array(object({
|
|
6482
|
+
"id": string(),
|
|
6483
|
+
"name": string(),
|
|
6484
|
+
"type": string(),
|
|
6485
|
+
"position": object({
|
|
6486
|
+
"x": number(),
|
|
6487
|
+
"y": number()
|
|
6488
|
+
}),
|
|
6489
|
+
"data": record(string(), union([
|
|
6490
|
+
literal(null),
|
|
6491
|
+
string(),
|
|
6492
|
+
number(),
|
|
6493
|
+
literal(false),
|
|
6494
|
+
literal(true),
|
|
6495
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema5())),
|
|
6496
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema5()))
|
|
6497
|
+
])),
|
|
6498
|
+
"style": union([_undefined(), record(string(), union([
|
|
6499
|
+
literal(null),
|
|
6500
|
+
string(),
|
|
6501
|
+
number(),
|
|
6502
|
+
literal(false),
|
|
6503
|
+
literal(true),
|
|
6504
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema5())),
|
|
6505
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema5()))
|
|
6506
|
+
]))]).optional()
|
|
6507
|
+
})),
|
|
6508
|
+
"edges": array(object({
|
|
6509
|
+
"id": string(),
|
|
6510
|
+
"source": string(),
|
|
6511
|
+
"target": string(),
|
|
6512
|
+
"sourceHandle": union([_undefined(), string()]).optional(),
|
|
6513
|
+
"targetHandle": union([_undefined(), string()]).optional(),
|
|
6514
|
+
"type": union([
|
|
6515
|
+
_undefined(),
|
|
6516
|
+
literal("default"),
|
|
6517
|
+
literal("custom-edge"),
|
|
6518
|
+
literal("straight"),
|
|
6519
|
+
literal("step"),
|
|
6520
|
+
literal("smoothstep"),
|
|
6521
|
+
literal("simplebezier")
|
|
6522
|
+
]).optional()
|
|
6523
|
+
}))
|
|
6524
|
+
}),
|
|
6525
|
+
"workflowId": string().optional(),
|
|
6526
|
+
"name": string().optional(),
|
|
6527
|
+
"sessionId": string().optional()
|
|
6528
|
+
});
|
|
6529
|
+
let dsh_auto_flow_autoFlow_runFlow_result$schema$value;
|
|
6530
|
+
const dsh_auto_flow_autoFlow_runFlow_result$schema = () => dsh_auto_flow_autoFlow_runFlow_result$schema$value ??= object({ "runId": string() });
|
|
6531
|
+
let dsh_auto_flow_autoFlow_runState_parameter_0$schema$value;
|
|
6532
|
+
const dsh_auto_flow_autoFlow_runState_parameter_0$schema = () => dsh_auto_flow_autoFlow_runState_parameter_0$schema$value ??= string();
|
|
6533
|
+
let dsh_auto_flow_autoFlow_runState_result$schema$value;
|
|
6534
|
+
const dsh_auto_flow_autoFlow_runState_result$schema = () => dsh_auto_flow_autoFlow_runState_result$schema$value ??= union([literal(null), object({
|
|
6535
|
+
"runId": string(),
|
|
6536
|
+
"workflowId": string(),
|
|
6537
|
+
"name": string(),
|
|
6538
|
+
"sessionId": union([_undefined(), string()]).optional(),
|
|
6539
|
+
"status": union([
|
|
6540
|
+
literal("running"),
|
|
6541
|
+
literal("waiting"),
|
|
6542
|
+
literal("completed"),
|
|
6543
|
+
literal("failed"),
|
|
6544
|
+
literal("cancelled"),
|
|
6545
|
+
literal("crashed")
|
|
6546
|
+
]),
|
|
6547
|
+
"workspaceDir": string(),
|
|
6548
|
+
"steps": array(object({
|
|
6549
|
+
"index": number(),
|
|
6550
|
+
"nodeId": string(),
|
|
6551
|
+
"itemCounts": union([_undefined(), object({
|
|
6552
|
+
"in": record(string(), number()),
|
|
6553
|
+
"out": record(string(), number())
|
|
6554
|
+
})]).optional(),
|
|
6555
|
+
"inputSources": union([_undefined(), array(string())]).optional(),
|
|
6556
|
+
"nodeType": string(),
|
|
6557
|
+
"label": string(),
|
|
6558
|
+
"status": union([
|
|
6559
|
+
literal("success"),
|
|
6560
|
+
literal("running"),
|
|
6561
|
+
literal("waiting"),
|
|
6562
|
+
literal("failed"),
|
|
6563
|
+
literal("pending"),
|
|
6564
|
+
literal("skipped")
|
|
6565
|
+
]),
|
|
6566
|
+
"statusChangedAt": union([_undefined(), number()]).optional(),
|
|
6567
|
+
"startedAt": union([_undefined(), number()]).optional(),
|
|
6568
|
+
"finishedAt": union([_undefined(), number()]).optional(),
|
|
6569
|
+
"script": union([_undefined(), string()]).optional(),
|
|
6570
|
+
"stepDir": union([_undefined(), string()]).optional(),
|
|
6571
|
+
"files": union([_undefined(), array(string())]).optional(),
|
|
6572
|
+
"items": union([_undefined(), array(object({
|
|
6573
|
+
"json": record(string(), union([
|
|
6574
|
+
literal(null),
|
|
6575
|
+
string(),
|
|
6576
|
+
number(),
|
|
6577
|
+
literal(false),
|
|
6578
|
+
literal(true),
|
|
6579
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema6())),
|
|
6580
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema6()))
|
|
6581
|
+
])),
|
|
6582
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
6583
|
+
}))]).optional(),
|
|
6584
|
+
"portItems": union([_undefined(), record(string(), array(object({
|
|
6585
|
+
"json": record(string(), union([
|
|
6586
|
+
literal(null),
|
|
6587
|
+
string(),
|
|
6588
|
+
number(),
|
|
6589
|
+
literal(false),
|
|
6590
|
+
literal(true),
|
|
6591
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema6())),
|
|
6592
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema6()))
|
|
6593
|
+
])),
|
|
6594
|
+
"pairedItem": union([_undefined(), number()]).optional()
|
|
6595
|
+
})))]).optional(),
|
|
6596
|
+
"failedItems": union([_undefined(), array(object({
|
|
6597
|
+
"index": number(),
|
|
6598
|
+
"error": string()
|
|
6599
|
+
}))]).optional(),
|
|
6600
|
+
"skippedCount": union([_undefined(), number()]).optional(),
|
|
6601
|
+
"itemsRef": union([_undefined(), string()]).optional(),
|
|
6602
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6603
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6604
|
+
"durationMs": union([_undefined(), number()]).optional(),
|
|
6605
|
+
"attempts": union([_undefined(), array(object({
|
|
6606
|
+
"attempt": number(),
|
|
6607
|
+
"startedAt": number(),
|
|
6608
|
+
"finishedAt": number(),
|
|
6609
|
+
"durationMs": number(),
|
|
6610
|
+
"ok": boolean(),
|
|
6611
|
+
"itemCounts": union([_undefined(), record(string(), number())]).optional(),
|
|
6612
|
+
"error": union([_undefined(), string()]).optional(),
|
|
6613
|
+
"errorCode": union([_undefined(), string()]).optional(),
|
|
6614
|
+
"retryable": union([
|
|
6615
|
+
_undefined(),
|
|
6616
|
+
literal(false),
|
|
6617
|
+
literal(true)
|
|
6618
|
+
]).optional()
|
|
6619
|
+
}))]).optional(),
|
|
6620
|
+
"logs": union([_undefined(), array(object({
|
|
6621
|
+
"at": number(),
|
|
6622
|
+
"kind": string(),
|
|
6623
|
+
"message": string(),
|
|
6624
|
+
"data": union([_undefined(), record(string(), union([
|
|
6625
|
+
literal(null),
|
|
6626
|
+
string(),
|
|
6627
|
+
number(),
|
|
6628
|
+
literal(false),
|
|
6629
|
+
literal(true),
|
|
6630
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema6())),
|
|
6631
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema6()))
|
|
6632
|
+
]))]).optional()
|
|
6633
|
+
}))]).optional()
|
|
6634
|
+
})),
|
|
6635
|
+
"batch": union([_undefined(), object({
|
|
6636
|
+
"batchId": string(),
|
|
6637
|
+
"nodeId": string(),
|
|
6638
|
+
"port": string(),
|
|
6639
|
+
"keyField": union([_undefined(), string()]).optional()
|
|
6640
|
+
})]).optional(),
|
|
6641
|
+
"resumeMode": union([
|
|
6642
|
+
_undefined(),
|
|
6643
|
+
literal("rerun-all"),
|
|
6644
|
+
literal("skip-succeeded")
|
|
6645
|
+
]).optional(),
|
|
6646
|
+
"createdAt": number(),
|
|
6647
|
+
"updatedAt": number()
|
|
5118
6648
|
})]);
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
"
|
|
5127
|
-
|
|
5128
|
-
|
|
6649
|
+
let dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema$value;
|
|
6650
|
+
const dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema = () => dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema$value ??= string();
|
|
6651
|
+
let dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema$value;
|
|
6652
|
+
const dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema = () => dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema$value ??= object({
|
|
6653
|
+
"formatVersion": number(),
|
|
6654
|
+
"name": string(),
|
|
6655
|
+
"description": string(),
|
|
6656
|
+
"nodes": array(object({
|
|
6657
|
+
"id": string(),
|
|
6658
|
+
"name": string(),
|
|
6659
|
+
"type": string(),
|
|
6660
|
+
"position": object({
|
|
6661
|
+
"x": number(),
|
|
6662
|
+
"y": number()
|
|
6663
|
+
}),
|
|
6664
|
+
"data": record(string(), union([
|
|
6665
|
+
literal(null),
|
|
6666
|
+
string(),
|
|
6667
|
+
number(),
|
|
6668
|
+
literal(false),
|
|
6669
|
+
literal(true),
|
|
6670
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema2())),
|
|
6671
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema2()))
|
|
6672
|
+
])),
|
|
6673
|
+
"style": union([_undefined(), record(string(), union([
|
|
6674
|
+
literal(null),
|
|
6675
|
+
string(),
|
|
6676
|
+
number(),
|
|
6677
|
+
literal(false),
|
|
6678
|
+
literal(true),
|
|
6679
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema2())),
|
|
6680
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema2()))
|
|
6681
|
+
]))]).optional()
|
|
6682
|
+
})),
|
|
6683
|
+
"edges": array(object({
|
|
6684
|
+
"id": string(),
|
|
6685
|
+
"source": string(),
|
|
6686
|
+
"target": string(),
|
|
6687
|
+
"sourceHandle": union([_undefined(), string()]).optional(),
|
|
6688
|
+
"targetHandle": union([_undefined(), string()]).optional(),
|
|
6689
|
+
"type": union([
|
|
6690
|
+
_undefined(),
|
|
6691
|
+
literal("default"),
|
|
6692
|
+
literal("custom-edge"),
|
|
6693
|
+
literal("straight"),
|
|
6694
|
+
literal("step"),
|
|
6695
|
+
literal("smoothstep"),
|
|
6696
|
+
literal("simplebezier")
|
|
6697
|
+
]).optional()
|
|
6698
|
+
}))
|
|
6699
|
+
});
|
|
6700
|
+
let dsh_auto_flow_autoFlow_saveFlow_result$schema$value;
|
|
6701
|
+
const dsh_auto_flow_autoFlow_saveFlow_result$schema = () => dsh_auto_flow_autoFlow_saveFlow_result$schema$value ??= object({
|
|
6702
|
+
"formatVersion": number(),
|
|
6703
|
+
"name": string(),
|
|
6704
|
+
"description": string(),
|
|
6705
|
+
"nodes": array(object({
|
|
6706
|
+
"id": string(),
|
|
6707
|
+
"name": string(),
|
|
6708
|
+
"type": string(),
|
|
6709
|
+
"position": object({
|
|
6710
|
+
"x": number(),
|
|
6711
|
+
"y": number()
|
|
6712
|
+
}),
|
|
6713
|
+
"data": record(string(), union([
|
|
6714
|
+
literal(null),
|
|
6715
|
+
string(),
|
|
6716
|
+
number(),
|
|
6717
|
+
literal(false),
|
|
6718
|
+
literal(true),
|
|
6719
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema3())),
|
|
6720
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema3()))
|
|
6721
|
+
])),
|
|
6722
|
+
"style": union([_undefined(), record(string(), union([
|
|
6723
|
+
literal(null),
|
|
6724
|
+
string(),
|
|
6725
|
+
number(),
|
|
6726
|
+
literal(false),
|
|
6727
|
+
literal(true),
|
|
6728
|
+
array(lazy(() => FlowDataValueRemoteCodec$schema3())),
|
|
6729
|
+
record(string(), lazy(() => FlowDataValueRemoteCodec$schema3()))
|
|
6730
|
+
]))]).optional()
|
|
6731
|
+
})),
|
|
6732
|
+
"edges": array(object({
|
|
6733
|
+
"id": string(),
|
|
6734
|
+
"source": string(),
|
|
6735
|
+
"target": string(),
|
|
6736
|
+
"sourceHandle": union([_undefined(), string()]).optional(),
|
|
6737
|
+
"targetHandle": union([_undefined(), string()]).optional(),
|
|
6738
|
+
"type": union([
|
|
6739
|
+
_undefined(),
|
|
6740
|
+
literal("default"),
|
|
6741
|
+
literal("custom-edge"),
|
|
6742
|
+
literal("straight"),
|
|
6743
|
+
literal("step"),
|
|
6744
|
+
literal("smoothstep"),
|
|
6745
|
+
literal("simplebezier")
|
|
6746
|
+
]).optional()
|
|
6747
|
+
}))
|
|
6748
|
+
});
|
|
6749
|
+
let dsh_auto_flow_autoFlow_unitUrl_parameter_0$schema$value;
|
|
6750
|
+
const dsh_auto_flow_autoFlow_unitUrl_parameter_0$schema = () => dsh_auto_flow_autoFlow_unitUrl_parameter_0$schema$value ??= string();
|
|
6751
|
+
let dsh_auto_flow_autoFlow_unitUrl_result$schema$value;
|
|
6752
|
+
const dsh_auto_flow_autoFlow_unitUrl_result$schema = () => dsh_auto_flow_autoFlow_unitUrl_result$schema$value ??= object({
|
|
6753
|
+
"url": union([literal(null), string()]),
|
|
6754
|
+
"reason": string().optional()
|
|
5129
6755
|
});
|
|
5130
6756
|
const TYPERT_REMOTE = {
|
|
5131
6757
|
package: "dsh-auto-flow",
|
|
5132
6758
|
descriptors: [
|
|
5133
6759
|
{
|
|
5134
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6760
|
+
id: "dsh-auto-flow#autoFlow/approveRun",
|
|
5135
6761
|
service: "autoFlow",
|
|
5136
6762
|
namespace: "autoFlow",
|
|
5137
|
-
method: "
|
|
6763
|
+
method: "approveRun",
|
|
5138
6764
|
invocation: { kind: "direct" },
|
|
5139
6765
|
parameters: [{
|
|
5140
|
-
name: "
|
|
5141
|
-
wire: "
|
|
6766
|
+
name: "runId",
|
|
6767
|
+
wire: "runId",
|
|
6768
|
+
source: "json",
|
|
6769
|
+
codec: {
|
|
6770
|
+
mode: "strict",
|
|
6771
|
+
typeSymbol: "dsh-auto-flow#autoFlow/approveRun:runId",
|
|
6772
|
+
create: dsh_auto_flow_autoFlow_approveRun_parameter_0$schema
|
|
6773
|
+
}
|
|
6774
|
+
}, {
|
|
6775
|
+
name: "choice",
|
|
6776
|
+
wire: "choice",
|
|
5142
6777
|
source: "json",
|
|
5143
6778
|
codec: {
|
|
5144
6779
|
mode: "strict",
|
|
5145
|
-
typeSymbol: "dsh-auto-flow/
|
|
5146
|
-
|
|
6780
|
+
typeSymbol: "dsh-auto-flow#autoFlow/approveRun:choice",
|
|
6781
|
+
create: dsh_auto_flow_autoFlow_approveRun_parameter_1$schema
|
|
5147
6782
|
}
|
|
5148
6783
|
}],
|
|
5149
6784
|
result: {
|
|
5150
6785
|
mode: "strict",
|
|
5151
|
-
typeSymbol: "
|
|
5152
|
-
|
|
6786
|
+
typeSymbol: "workflow/types#RunState",
|
|
6787
|
+
create: dsh_auto_flow_autoFlow_approveRun_result$schema
|
|
5153
6788
|
},
|
|
5154
6789
|
sourceLocation: {
|
|
5155
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5156
|
-
"line":
|
|
6790
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6791
|
+
"line": 533,
|
|
5157
6792
|
"column": 9
|
|
5158
6793
|
}
|
|
5159
6794
|
},
|
|
5160
6795
|
{
|
|
5161
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6796
|
+
id: "dsh-auto-flow#autoFlow/cancelRun",
|
|
5162
6797
|
service: "autoFlow",
|
|
5163
6798
|
namespace: "autoFlow",
|
|
5164
|
-
method: "
|
|
6799
|
+
method: "cancelRun",
|
|
5165
6800
|
invocation: { kind: "direct" },
|
|
5166
6801
|
parameters: [{
|
|
5167
|
-
name: "
|
|
5168
|
-
wire: "
|
|
6802
|
+
name: "runId",
|
|
6803
|
+
wire: "runId",
|
|
5169
6804
|
source: "json",
|
|
5170
6805
|
codec: {
|
|
5171
6806
|
mode: "strict",
|
|
5172
|
-
typeSymbol: "dsh-auto-flow#autoFlow/
|
|
5173
|
-
|
|
6807
|
+
typeSymbol: "dsh-auto-flow#autoFlow/cancelRun:runId",
|
|
6808
|
+
create: dsh_auto_flow_autoFlow_cancelRun_parameter_0$schema
|
|
5174
6809
|
}
|
|
5175
6810
|
}],
|
|
5176
6811
|
result: {
|
|
5177
6812
|
mode: "strict",
|
|
5178
|
-
typeSymbol: "
|
|
5179
|
-
|
|
6813
|
+
typeSymbol: "workflow/types#RunState",
|
|
6814
|
+
create: dsh_auto_flow_autoFlow_cancelRun_result$schema
|
|
5180
6815
|
},
|
|
5181
6816
|
sourceLocation: {
|
|
5182
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5183
|
-
"line":
|
|
6817
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6818
|
+
"line": 527,
|
|
5184
6819
|
"column": 9
|
|
5185
6820
|
}
|
|
5186
6821
|
},
|
|
5187
6822
|
{
|
|
5188
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6823
|
+
id: "dsh-auto-flow#autoFlow/deleteFlow",
|
|
5189
6824
|
service: "autoFlow",
|
|
5190
6825
|
namespace: "autoFlow",
|
|
5191
|
-
method: "
|
|
6826
|
+
method: "deleteFlow",
|
|
5192
6827
|
invocation: { kind: "direct" },
|
|
5193
6828
|
parameters: [{
|
|
5194
|
-
name: "
|
|
5195
|
-
wire: "
|
|
6829
|
+
name: "flowId",
|
|
6830
|
+
wire: "flowId",
|
|
5196
6831
|
source: "json",
|
|
5197
6832
|
codec: {
|
|
5198
6833
|
mode: "strict",
|
|
5199
|
-
typeSymbol: "dsh-auto-flow#autoFlow/
|
|
5200
|
-
|
|
6834
|
+
typeSymbol: "dsh-auto-flow#autoFlow/deleteFlow:flowId",
|
|
6835
|
+
create: dsh_auto_flow_autoFlow_deleteFlow_parameter_0$schema
|
|
5201
6836
|
}
|
|
5202
6837
|
}],
|
|
5203
6838
|
result: {
|
|
5204
6839
|
mode: "strict",
|
|
5205
|
-
typeSymbol: "dsh-auto-flow/
|
|
5206
|
-
|
|
6840
|
+
typeSymbol: "dsh-auto-flow#autoFlow/deleteFlow:result",
|
|
6841
|
+
create: dsh_auto_flow_autoFlow_deleteFlow_result$schema
|
|
5207
6842
|
},
|
|
5208
6843
|
sourceLocation: {
|
|
5209
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5210
|
-
"line":
|
|
6844
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6845
|
+
"line": 410,
|
|
5211
6846
|
"column": 9
|
|
5212
6847
|
}
|
|
5213
6848
|
},
|
|
5214
6849
|
{
|
|
5215
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6850
|
+
id: "dsh-auto-flow#autoFlow/listFlows",
|
|
5216
6851
|
service: "autoFlow",
|
|
5217
6852
|
namespace: "autoFlow",
|
|
5218
|
-
method: "
|
|
6853
|
+
method: "listFlows",
|
|
5219
6854
|
invocation: { kind: "direct" },
|
|
5220
6855
|
parameters: [],
|
|
5221
6856
|
result: {
|
|
5222
6857
|
mode: "strict",
|
|
5223
|
-
typeSymbol: "dsh-auto-flow#autoFlow/
|
|
5224
|
-
|
|
6858
|
+
typeSymbol: "dsh-auto-flow#autoFlow/listFlows:result",
|
|
6859
|
+
create: dsh_auto_flow_autoFlow_listFlows_result$schema
|
|
5225
6860
|
},
|
|
5226
6861
|
sourceLocation: {
|
|
5227
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5228
|
-
"line":
|
|
6862
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6863
|
+
"line": 282,
|
|
5229
6864
|
"column": 3
|
|
5230
6865
|
}
|
|
5231
6866
|
},
|
|
5232
6867
|
{
|
|
5233
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6868
|
+
id: "dsh-auto-flow#autoFlow/listLlmRoutes",
|
|
5234
6869
|
service: "autoFlow",
|
|
5235
6870
|
namespace: "autoFlow",
|
|
5236
|
-
method: "
|
|
6871
|
+
method: "listLlmRoutes",
|
|
5237
6872
|
invocation: { kind: "direct" },
|
|
5238
6873
|
parameters: [],
|
|
5239
6874
|
result: {
|
|
5240
6875
|
mode: "strict",
|
|
5241
|
-
typeSymbol: "
|
|
5242
|
-
|
|
6876
|
+
typeSymbol: "workflow/types#WorkflowListLlmRoutesResult",
|
|
6877
|
+
create: dsh_auto_flow_autoFlow_listLlmRoutes_result$schema
|
|
5243
6878
|
},
|
|
5244
6879
|
sourceLocation: {
|
|
5245
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5246
|
-
"line":
|
|
6880
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6881
|
+
"line": 474,
|
|
5247
6882
|
"column": 3
|
|
5248
6883
|
}
|
|
5249
6884
|
},
|
|
5250
6885
|
{
|
|
5251
|
-
id: "dsh-auto-flow#autoFlow/
|
|
6886
|
+
id: "dsh-auto-flow#autoFlow/listRouteModels",
|
|
6887
|
+
service: "autoFlow",
|
|
6888
|
+
namespace: "autoFlow",
|
|
6889
|
+
method: "listRouteModels",
|
|
6890
|
+
invocation: { kind: "direct" },
|
|
6891
|
+
parameters: [{
|
|
6892
|
+
name: "request",
|
|
6893
|
+
wire: "request",
|
|
6894
|
+
source: "json",
|
|
6895
|
+
codec: {
|
|
6896
|
+
mode: "strict",
|
|
6897
|
+
typeSymbol: "workflow/types#WorkflowListRouteModelsRequest",
|
|
6898
|
+
create: dsh_auto_flow_autoFlow_listRouteModels_parameter_0$schema
|
|
6899
|
+
}
|
|
6900
|
+
}],
|
|
6901
|
+
result: {
|
|
6902
|
+
mode: "strict",
|
|
6903
|
+
typeSymbol: "workflow/types#WorkflowListRouteModelsResult",
|
|
6904
|
+
create: dsh_auto_flow_autoFlow_listRouteModels_result$schema
|
|
6905
|
+
},
|
|
6906
|
+
sourceLocation: {
|
|
6907
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6908
|
+
"line": 484,
|
|
6909
|
+
"column": 9
|
|
6910
|
+
}
|
|
6911
|
+
},
|
|
6912
|
+
{
|
|
6913
|
+
id: "dsh-auto-flow#autoFlow/listRuns",
|
|
6914
|
+
service: "autoFlow",
|
|
6915
|
+
namespace: "autoFlow",
|
|
6916
|
+
method: "listRuns",
|
|
6917
|
+
invocation: { kind: "direct" },
|
|
6918
|
+
parameters: [{
|
|
6919
|
+
name: "request",
|
|
6920
|
+
wire: "request",
|
|
6921
|
+
source: "json",
|
|
6922
|
+
codec: {
|
|
6923
|
+
mode: "strict",
|
|
6924
|
+
typeSymbol: "workflow/types#WorkflowListRunsRequest",
|
|
6925
|
+
create: dsh_auto_flow_autoFlow_listRuns_parameter_0$schema
|
|
6926
|
+
}
|
|
6927
|
+
}],
|
|
6928
|
+
result: {
|
|
6929
|
+
mode: "strict",
|
|
6930
|
+
typeSymbol: "dsh-auto-flow#autoFlow/listRuns:result",
|
|
6931
|
+
create: dsh_auto_flow_autoFlow_listRuns_result$schema
|
|
6932
|
+
},
|
|
6933
|
+
sourceLocation: {
|
|
6934
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6935
|
+
"line": 305,
|
|
6936
|
+
"column": 9
|
|
6937
|
+
}
|
|
6938
|
+
},
|
|
6939
|
+
{
|
|
6940
|
+
id: "dsh-auto-flow#autoFlow/listScripts",
|
|
6941
|
+
service: "autoFlow",
|
|
6942
|
+
namespace: "autoFlow",
|
|
6943
|
+
method: "listScripts",
|
|
6944
|
+
invocation: { kind: "direct" },
|
|
6945
|
+
parameters: [],
|
|
6946
|
+
result: {
|
|
6947
|
+
mode: "strict",
|
|
6948
|
+
typeSymbol: "dsh-auto-flow#autoFlow/listScripts:result",
|
|
6949
|
+
create: dsh_auto_flow_autoFlow_listScripts_result$schema
|
|
6950
|
+
},
|
|
6951
|
+
sourceLocation: {
|
|
6952
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6953
|
+
"line": 423,
|
|
6954
|
+
"column": 9
|
|
6955
|
+
}
|
|
6956
|
+
},
|
|
6957
|
+
{
|
|
6958
|
+
id: "dsh-auto-flow#autoFlow/loadFlow",
|
|
6959
|
+
service: "autoFlow",
|
|
6960
|
+
namespace: "autoFlow",
|
|
6961
|
+
method: "loadFlow",
|
|
6962
|
+
invocation: { kind: "direct" },
|
|
6963
|
+
parameters: [{
|
|
6964
|
+
name: "flowId",
|
|
6965
|
+
wire: "flowId",
|
|
6966
|
+
source: "json",
|
|
6967
|
+
codec: {
|
|
6968
|
+
mode: "strict",
|
|
6969
|
+
typeSymbol: "dsh-auto-flow#autoFlow/loadFlow:flowId",
|
|
6970
|
+
create: dsh_auto_flow_autoFlow_loadFlow_parameter_0$schema
|
|
6971
|
+
}
|
|
6972
|
+
}],
|
|
6973
|
+
result: {
|
|
6974
|
+
mode: "strict",
|
|
6975
|
+
typeSymbol: "dsh-auto-flow#autoFlow/loadFlow:result",
|
|
6976
|
+
create: dsh_auto_flow_autoFlow_loadFlow_result$schema
|
|
6977
|
+
},
|
|
6978
|
+
sourceLocation: {
|
|
6979
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
6980
|
+
"line": 332,
|
|
6981
|
+
"column": 9
|
|
6982
|
+
}
|
|
6983
|
+
},
|
|
6984
|
+
{
|
|
6985
|
+
id: "dsh-auto-flow#autoFlow/resumeRun",
|
|
6986
|
+
service: "autoFlow",
|
|
6987
|
+
namespace: "autoFlow",
|
|
6988
|
+
method: "resumeRun",
|
|
6989
|
+
invocation: { kind: "direct" },
|
|
6990
|
+
parameters: [{
|
|
6991
|
+
name: "runId",
|
|
6992
|
+
wire: "runId",
|
|
6993
|
+
source: "json",
|
|
6994
|
+
codec: {
|
|
6995
|
+
mode: "strict",
|
|
6996
|
+
typeSymbol: "dsh-auto-flow#autoFlow/resumeRun:runId",
|
|
6997
|
+
create: dsh_auto_flow_autoFlow_resumeRun_parameter_0$schema
|
|
6998
|
+
}
|
|
6999
|
+
}],
|
|
7000
|
+
result: {
|
|
7001
|
+
mode: "strict",
|
|
7002
|
+
typeSymbol: "workflow/types#RunState",
|
|
7003
|
+
create: dsh_auto_flow_autoFlow_resumeRun_result$schema
|
|
7004
|
+
},
|
|
7005
|
+
sourceLocation: {
|
|
7006
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7007
|
+
"line": 544,
|
|
7008
|
+
"column": 9
|
|
7009
|
+
}
|
|
7010
|
+
},
|
|
7011
|
+
{
|
|
7012
|
+
id: "dsh-auto-flow#autoFlow/retryRun",
|
|
7013
|
+
service: "autoFlow",
|
|
7014
|
+
namespace: "autoFlow",
|
|
7015
|
+
method: "retryRun",
|
|
7016
|
+
invocation: { kind: "direct" },
|
|
7017
|
+
parameters: [{
|
|
7018
|
+
name: "runId",
|
|
7019
|
+
wire: "runId",
|
|
7020
|
+
source: "json",
|
|
7021
|
+
codec: {
|
|
7022
|
+
mode: "strict",
|
|
7023
|
+
typeSymbol: "dsh-auto-flow#autoFlow/retryRun:runId",
|
|
7024
|
+
create: dsh_auto_flow_autoFlow_retryRun_parameter_0$schema
|
|
7025
|
+
}
|
|
7026
|
+
}],
|
|
7027
|
+
result: {
|
|
7028
|
+
mode: "strict",
|
|
7029
|
+
typeSymbol: "dsh-auto-flow#autoFlow/retryRun:result",
|
|
7030
|
+
create: dsh_auto_flow_autoFlow_retryRun_result$schema
|
|
7031
|
+
},
|
|
7032
|
+
sourceLocation: {
|
|
7033
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7034
|
+
"line": 559,
|
|
7035
|
+
"column": 9
|
|
7036
|
+
}
|
|
7037
|
+
},
|
|
7038
|
+
{
|
|
7039
|
+
id: "dsh-auto-flow#autoFlow/runFlow",
|
|
7040
|
+
service: "autoFlow",
|
|
7041
|
+
namespace: "autoFlow",
|
|
7042
|
+
method: "runFlow",
|
|
7043
|
+
invocation: { kind: "direct" },
|
|
7044
|
+
parameters: [{
|
|
7045
|
+
name: "request",
|
|
7046
|
+
wire: "request",
|
|
7047
|
+
source: "json",
|
|
7048
|
+
codec: {
|
|
7049
|
+
mode: "strict",
|
|
7050
|
+
typeSymbol: "dsh-auto-flow#autoFlow/runFlow:request",
|
|
7051
|
+
create: dsh_auto_flow_autoFlow_runFlow_parameter_0$schema
|
|
7052
|
+
}
|
|
7053
|
+
}],
|
|
7054
|
+
result: {
|
|
7055
|
+
mode: "strict",
|
|
7056
|
+
typeSymbol: "dsh-auto-flow#autoFlow/runFlow:result",
|
|
7057
|
+
create: dsh_auto_flow_autoFlow_runFlow_result$schema
|
|
7058
|
+
},
|
|
7059
|
+
sourceLocation: {
|
|
7060
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7061
|
+
"line": 510,
|
|
7062
|
+
"column": 9
|
|
7063
|
+
}
|
|
7064
|
+
},
|
|
7065
|
+
{
|
|
7066
|
+
id: "dsh-auto-flow#autoFlow/runState",
|
|
7067
|
+
service: "autoFlow",
|
|
7068
|
+
namespace: "autoFlow",
|
|
7069
|
+
method: "runState",
|
|
7070
|
+
invocation: { kind: "direct" },
|
|
7071
|
+
parameters: [{
|
|
7072
|
+
name: "runId",
|
|
7073
|
+
wire: "runId",
|
|
7074
|
+
source: "json",
|
|
7075
|
+
codec: {
|
|
7076
|
+
mode: "strict",
|
|
7077
|
+
typeSymbol: "dsh-auto-flow#autoFlow/runState:runId",
|
|
7078
|
+
create: dsh_auto_flow_autoFlow_runState_parameter_0$schema
|
|
7079
|
+
}
|
|
7080
|
+
}],
|
|
7081
|
+
result: {
|
|
7082
|
+
mode: "strict",
|
|
7083
|
+
typeSymbol: "dsh-auto-flow#autoFlow/runState:result",
|
|
7084
|
+
create: dsh_auto_flow_autoFlow_runState_result$schema
|
|
7085
|
+
},
|
|
7086
|
+
sourceLocation: {
|
|
7087
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7088
|
+
"line": 521,
|
|
7089
|
+
"column": 9
|
|
7090
|
+
}
|
|
7091
|
+
},
|
|
7092
|
+
{
|
|
7093
|
+
id: "dsh-auto-flow#autoFlow/saveFlow",
|
|
7094
|
+
service: "autoFlow",
|
|
7095
|
+
namespace: "autoFlow",
|
|
7096
|
+
method: "saveFlow",
|
|
7097
|
+
invocation: { kind: "direct" },
|
|
7098
|
+
parameters: [{
|
|
7099
|
+
name: "flowId",
|
|
7100
|
+
wire: "flowId",
|
|
7101
|
+
source: "json",
|
|
7102
|
+
codec: {
|
|
7103
|
+
mode: "strict",
|
|
7104
|
+
typeSymbol: "dsh-auto-flow#autoFlow/saveFlow:flowId",
|
|
7105
|
+
create: dsh_auto_flow_autoFlow_saveFlow_parameter_0$schema
|
|
7106
|
+
}
|
|
7107
|
+
}, {
|
|
7108
|
+
name: "flow",
|
|
7109
|
+
wire: "flow",
|
|
7110
|
+
source: "json",
|
|
7111
|
+
codec: {
|
|
7112
|
+
mode: "strict",
|
|
7113
|
+
typeSymbol: "workflow/types#WorkflowDefinition",
|
|
7114
|
+
create: dsh_auto_flow_autoFlow_saveFlow_parameter_1$schema
|
|
7115
|
+
}
|
|
7116
|
+
}],
|
|
7117
|
+
result: {
|
|
7118
|
+
mode: "strict",
|
|
7119
|
+
typeSymbol: "workflow/types#WorkflowDefinition",
|
|
7120
|
+
create: dsh_auto_flow_autoFlow_saveFlow_result$schema
|
|
7121
|
+
},
|
|
7122
|
+
sourceLocation: {
|
|
7123
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7124
|
+
"line": 359,
|
|
7125
|
+
"column": 9
|
|
7126
|
+
}
|
|
7127
|
+
},
|
|
7128
|
+
{
|
|
7129
|
+
id: "dsh-auto-flow#autoFlow/unitUrl",
|
|
5252
7130
|
service: "autoFlow",
|
|
5253
7131
|
namespace: "autoFlow",
|
|
5254
|
-
method: "
|
|
7132
|
+
method: "unitUrl",
|
|
5255
7133
|
invocation: { kind: "direct" },
|
|
5256
7134
|
parameters: [{
|
|
5257
|
-
name: "
|
|
5258
|
-
wire: "
|
|
7135
|
+
name: "unit",
|
|
7136
|
+
wire: "unit",
|
|
5259
7137
|
source: "json",
|
|
5260
7138
|
codec: {
|
|
5261
7139
|
mode: "strict",
|
|
5262
|
-
typeSymbol: "dsh-auto-flow#autoFlow/
|
|
5263
|
-
|
|
7140
|
+
typeSymbol: "dsh-auto-flow#autoFlow/unitUrl:unit",
|
|
7141
|
+
create: dsh_auto_flow_autoFlow_unitUrl_parameter_0$schema
|
|
5264
7142
|
}
|
|
5265
7143
|
}],
|
|
5266
7144
|
result: {
|
|
5267
7145
|
mode: "strict",
|
|
5268
|
-
typeSymbol: "dsh-auto-flow/types#
|
|
5269
|
-
|
|
7146
|
+
typeSymbol: "dsh-auto-flow/types#UnitEntryResult",
|
|
7147
|
+
create: dsh_auto_flow_autoFlow_unitUrl_result$schema
|
|
5270
7148
|
},
|
|
5271
7149
|
sourceLocation: {
|
|
5272
|
-
"file": "packages/dsh-auto-flow/src/
|
|
5273
|
-
"line":
|
|
7150
|
+
"file": "packages/business/dsh-auto-flow/src/host/service.ts",
|
|
7151
|
+
"line": 240,
|
|
5274
7152
|
"column": 9
|
|
5275
7153
|
}
|
|
5276
7154
|
}
|
|
5277
7155
|
]
|
|
5278
7156
|
};
|
|
5279
7157
|
//#endregion
|
|
5280
|
-
//#region
|
|
5281
|
-
|
|
5282
|
-
const
|
|
5283
|
-
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
tag.dataset.pluginCss = tagId$2;
|
|
5287
|
-
tag.textContent = css$2;
|
|
5288
|
-
document.head.appendChild(tag);
|
|
5289
|
-
}
|
|
5290
|
-
var DemoBar_module_css_default = {
|
|
5291
|
-
"result": "_0Yhqva_result",
|
|
5292
|
-
"markers": "_0Yhqva_markers",
|
|
5293
|
-
"bar": "_0Yhqva_bar",
|
|
5294
|
-
"row": "_0Yhqva_row",
|
|
5295
|
-
"button": "_0Yhqva_button",
|
|
5296
|
-
"output": "_0Yhqva_output",
|
|
5297
|
-
"checkbox": "_0Yhqva_checkbox",
|
|
5298
|
-
"input": "_0Yhqva_input",
|
|
5299
|
-
"failed": "_0Yhqva_failed"
|
|
5300
|
-
};
|
|
7158
|
+
//#region src/client/dock-units.ts
|
|
7159
|
+
/** 会话输入区里的入口(数组顺序即显示顺序)。 */
|
|
7160
|
+
const DOCK_UNITS = [{ unit: "admin" }, {
|
|
7161
|
+
unit: "editor",
|
|
7162
|
+
label: "workflowOverlay.title"
|
|
7163
|
+
}];
|
|
5301
7164
|
//#endregion
|
|
5302
|
-
//#region src/
|
|
7165
|
+
//#region ../../shared/host-signal/src/index.ts
|
|
5303
7166
|
/**
|
|
5304
|
-
*
|
|
5305
|
-
*
|
|
5306
|
-
*
|
|
5307
|
-
*
|
|
5308
|
-
* 输出只回本区域展示,不进会话、不动界面。
|
|
7167
|
+
* 宿主页面表达深色外观的属性名。
|
|
7168
|
+
*
|
|
7169
|
+
* 两侧语义不同、字面量同一个:宿主页面上它是**输入**(宿主呈现器写它,宿主半边读它),应用单元页面里
|
|
7170
|
+
* 它是**输出**(应用自己写、自己的画布读)。
|
|
5309
7171
|
*/
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
onSend,
|
|
5340
|
-
pending
|
|
5341
|
-
]);
|
|
5342
|
-
const exec = (0, react.useCallback)(async () => {
|
|
5343
|
-
const line = command.trim();
|
|
5344
|
-
if (line === "" || pending !== null) return;
|
|
5345
|
-
setPending("exec");
|
|
5346
|
-
setExecError(null);
|
|
5347
|
-
setExecResult(null);
|
|
5348
|
-
setBackground(null);
|
|
5349
|
-
const result = await onExec(runInBackground ? {
|
|
5350
|
-
command: line,
|
|
5351
|
-
runInBackground: true
|
|
5352
|
-
} : { command: line });
|
|
5353
|
-
setPending(null);
|
|
5354
|
-
if (!result.ok) {
|
|
5355
|
-
setExecError(result.error.message);
|
|
5356
|
-
return;
|
|
5357
|
-
}
|
|
5358
|
-
if (result.value.kind === "foreground") setExecResult(result.value);
|
|
5359
|
-
else setBackground({
|
|
5360
|
-
jobId: result.value.jobId,
|
|
5361
|
-
output: "",
|
|
5362
|
-
status: "running"
|
|
5363
|
-
});
|
|
5364
|
-
}, [
|
|
5365
|
-
command,
|
|
5366
|
-
onExec,
|
|
5367
|
-
pending,
|
|
5368
|
-
runInBackground
|
|
5369
|
-
]);
|
|
5370
|
-
/** 拉取一次后台输出并更新本地视图(自动轮询与手动「读取输出」共用)。 */
|
|
5371
|
-
const refreshBackground = (0, react.useCallback)(async (jobId) => {
|
|
5372
|
-
const result = await onRead(jobId);
|
|
5373
|
-
setBackground((prev) => {
|
|
5374
|
-
if (prev === null || prev.jobId !== jobId) return prev;
|
|
5375
|
-
if (!result.ok) return {
|
|
5376
|
-
...prev,
|
|
5377
|
-
status: "failed",
|
|
5378
|
-
error: result.error.message,
|
|
5379
|
-
lastReadAt: Date.now()
|
|
5380
|
-
};
|
|
5381
|
-
return {
|
|
5382
|
-
...prev,
|
|
5383
|
-
output: prev.output + result.value.text,
|
|
5384
|
-
status: result.value.status,
|
|
5385
|
-
...result.value.detail !== void 0 ? { detail: result.value.detail } : {},
|
|
5386
|
-
lastReadAt: Date.now()
|
|
5387
|
-
};
|
|
5388
|
-
});
|
|
5389
|
-
}, [onRead]);
|
|
5390
|
-
(0, react.useEffect)(() => {
|
|
5391
|
-
if (background === null || TERMINAL.has(background.status)) return;
|
|
5392
|
-
const jobId = background.jobId;
|
|
5393
|
-
const interval = setInterval(() => {
|
|
5394
|
-
refreshBackground(jobId);
|
|
5395
|
-
}, 1e3);
|
|
5396
|
-
return () => clearInterval(interval);
|
|
5397
|
-
}, [background, refreshBackground]);
|
|
5398
|
-
const killBackground = (0, react.useCallback)(async () => {
|
|
5399
|
-
if (background === null) return;
|
|
5400
|
-
await onKill(background.jobId);
|
|
5401
|
-
await refreshBackground(background.jobId);
|
|
5402
|
-
}, [
|
|
5403
|
-
background,
|
|
5404
|
-
onKill,
|
|
5405
|
-
refreshBackground
|
|
5406
|
-
]);
|
|
5407
|
-
const foregroundText = execResult === null ? "" : [execResult.stdout.text.trim(), execResult.stderr.text.trim()].filter((part) => part !== "").join("\n");
|
|
5408
|
-
const execMarkers = [];
|
|
5409
|
-
if (execResult !== null) {
|
|
5410
|
-
if (execResult.timedOut) execMarkers.push(t("exec.timedOut"));
|
|
5411
|
-
if (execResult.aborted) execMarkers.push(t("exec.aborted"));
|
|
5412
|
-
if (execResult.sandbox?.denied === true) execMarkers.push(t("exec.denied"));
|
|
5413
|
-
if (execResult.signal !== null) execMarkers.push(execResult.signal);
|
|
5414
|
-
else if (execResult.exitCode !== 0) execMarkers.push(`${t("exec.exitCode")}: ${execResult.exitCode}`);
|
|
5415
|
-
}
|
|
5416
|
-
const execFailed = execResult !== null && (execResult.exitCode !== 0 || execResult.timedOut || execResult.aborted || execResult.sandbox?.denied === true);
|
|
5417
|
-
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5418
|
-
className: DemoBar_module_css_default.bar,
|
|
5419
|
-
"data-dsh-plugin": "auto-flow",
|
|
5420
|
-
children: [
|
|
5421
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5422
|
-
className: DemoBar_module_css_default.row,
|
|
5423
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5424
|
-
className: DemoBar_module_css_default.input,
|
|
5425
|
-
value: draft,
|
|
5426
|
-
placeholder: t("bar.placeholder"),
|
|
5427
|
-
"aria-label": t("bar.sendAria"),
|
|
5428
|
-
disabled: pending !== null,
|
|
5429
|
-
onChange: (event) => setDraft(event.target.value),
|
|
5430
|
-
onKeyDown: (event) => {
|
|
5431
|
-
if (event.key === "Enter") send();
|
|
5432
|
-
}
|
|
5433
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5434
|
-
type: "button",
|
|
5435
|
-
className: DemoBar_module_css_default.button,
|
|
5436
|
-
disabled: pending !== null || draft.trim() === "",
|
|
5437
|
-
onClick: () => void send(),
|
|
5438
|
-
children: t("bar.send")
|
|
5439
|
-
})]
|
|
5440
|
-
}),
|
|
5441
|
-
sendFailed && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5442
|
-
className: DemoBar_module_css_default.failed,
|
|
5443
|
-
role: "alert",
|
|
5444
|
-
children: t("bar.failed")
|
|
5445
|
-
}),
|
|
5446
|
-
sent !== null && !sendFailed && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5447
|
-
className: DemoBar_module_css_default.result,
|
|
5448
|
-
children: [
|
|
5449
|
-
t("bar.recorded"),
|
|
5450
|
-
":",
|
|
5451
|
-
sent
|
|
5452
|
-
]
|
|
5453
|
-
}),
|
|
5454
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5455
|
-
className: DemoBar_module_css_default.row,
|
|
5456
|
-
children: [
|
|
5457
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5458
|
-
className: DemoBar_module_css_default.input,
|
|
5459
|
-
value: command,
|
|
5460
|
-
placeholder: t("exec.placeholder"),
|
|
5461
|
-
"aria-label": t("exec.aria"),
|
|
5462
|
-
spellCheck: false,
|
|
5463
|
-
disabled: pending !== null,
|
|
5464
|
-
onChange: (event) => setCommand(event.target.value),
|
|
5465
|
-
onKeyDown: (event) => {
|
|
5466
|
-
if (event.key === "Enter") exec();
|
|
5467
|
-
}
|
|
5468
|
-
}),
|
|
5469
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("label", {
|
|
5470
|
-
className: DemoBar_module_css_default.checkbox,
|
|
5471
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
5472
|
-
type: "checkbox",
|
|
5473
|
-
checked: runInBackground,
|
|
5474
|
-
disabled: pending !== null,
|
|
5475
|
-
onChange: (event) => setRunInBackground(event.target.checked)
|
|
5476
|
-
}), t("exec.background")]
|
|
5477
|
-
}),
|
|
5478
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5479
|
-
type: "button",
|
|
5480
|
-
className: DemoBar_module_css_default.button,
|
|
5481
|
-
disabled: pending !== null || command.trim() === "",
|
|
5482
|
-
onClick: () => void exec(),
|
|
5483
|
-
children: t("exec.button")
|
|
5484
|
-
})
|
|
5485
|
-
]
|
|
5486
|
-
}),
|
|
5487
|
-
execError !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5488
|
-
className: DemoBar_module_css_default.failed,
|
|
5489
|
-
role: "alert",
|
|
5490
|
-
children: execError
|
|
5491
|
-
}),
|
|
5492
|
-
execResult !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5493
|
-
className: execFailed ? DemoBar_module_css_default.failed : DemoBar_module_css_default.result,
|
|
5494
|
-
role: "status",
|
|
5495
|
-
children: [foregroundText === "" ? t("exec.empty") : foregroundText, execMarkers.length > 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5496
|
-
className: DemoBar_module_css_default.markers,
|
|
5497
|
-
children: execMarkers.join(" · ")
|
|
5498
|
-
})]
|
|
5499
|
-
}),
|
|
5500
|
-
background !== null && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5501
|
-
className: DemoBar_module_css_default.result,
|
|
5502
|
-
role: "status",
|
|
5503
|
-
children: [
|
|
5504
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
5505
|
-
t("exec.backgroundStarted"),
|
|
5506
|
-
":",
|
|
5507
|
-
background.jobId
|
|
5508
|
-
] }),
|
|
5509
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", { children: [
|
|
5510
|
-
t("exec.status"),
|
|
5511
|
-
":",
|
|
5512
|
-
background.status,
|
|
5513
|
-
background.detail !== void 0 && ` · ${background.detail}`,
|
|
5514
|
-
background.lastReadAt !== void 0 && ` · ${t("exec.lastRead")} ${new Date(background.lastReadAt).toLocaleTimeString()}`
|
|
5515
|
-
] }),
|
|
5516
|
-
background.output !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
|
|
5517
|
-
className: DemoBar_module_css_default.output,
|
|
5518
|
-
children: background.output
|
|
5519
|
-
}) : TERMINAL.has(background.status) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5520
|
-
className: DemoBar_module_css_default.markers,
|
|
5521
|
-
children: t("exec.empty")
|
|
5522
|
-
}),
|
|
5523
|
-
background.error !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
5524
|
-
className: DemoBar_module_css_default.failed,
|
|
5525
|
-
role: "alert",
|
|
5526
|
-
children: background.error
|
|
5527
|
-
}),
|
|
5528
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5529
|
-
className: DemoBar_module_css_default.row,
|
|
5530
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5531
|
-
type: "button",
|
|
5532
|
-
className: DemoBar_module_css_default.button,
|
|
5533
|
-
onClick: () => void refreshBackground(background.jobId),
|
|
5534
|
-
children: t("exec.read")
|
|
5535
|
-
}), !TERMINAL.has(background.status) && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
5536
|
-
type: "button",
|
|
5537
|
-
className: DemoBar_module_css_default.button,
|
|
5538
|
-
onClick: () => void killBackground(),
|
|
5539
|
-
children: t("exec.stop")
|
|
5540
|
-
})]
|
|
5541
|
-
})
|
|
5542
|
-
]
|
|
5543
|
-
})
|
|
5544
|
-
]
|
|
7172
|
+
const DARK_THEME_BODY_ATTRIBUTE = "data-ds-dark-theme";
|
|
7173
|
+
/** 宿主 → 应用单元的上下文消息类型标记("这条消息是给我们的"的唯一判据)。 */
|
|
7174
|
+
const HOST_CONTEXT_MESSAGE_TYPE = "dsh-auto-flow/context";
|
|
7175
|
+
/**
|
|
7176
|
+
* 是否运行在真 DOM 环境。
|
|
7177
|
+
*
|
|
7178
|
+
* 【为什么要这条退化】包级测试会在 Node 环境里直接 import 本模块:那时 `document` / `window` 不存在,
|
|
7179
|
+
* 这些函数按「宿主没说话」退化(浅色、无观察对象、出站消息不发)。没有它的话,import 本身没问题、
|
|
7180
|
+
* 一调用就 TypeError。
|
|
7181
|
+
*/
|
|
7182
|
+
function hasDom() {
|
|
7183
|
+
return typeof document !== "undefined" && typeof window !== "undefined";
|
|
7184
|
+
}
|
|
7185
|
+
/** 读宿主页面(或应用自己页面)的 `body` 当前是否深色。 */
|
|
7186
|
+
function readBodyDark() {
|
|
7187
|
+
return hasDom() && document.body.hasAttribute("data-ds-dark-theme");
|
|
7188
|
+
}
|
|
7189
|
+
/**
|
|
7190
|
+
* 订阅 `body` 深色属性的变化。
|
|
7191
|
+
*
|
|
7192
|
+
* 宿主页面上的明暗切换由 dsh 呈现器改属性表达,`MutationObserver` 是唯一能立刻拿到的信号(无事件)。
|
|
7193
|
+
*
|
|
7194
|
+
* @param onChange - 属性每次变化后调用,参数是读到的当前值。
|
|
7195
|
+
* @returns 退订函数(无 DOM 时是空操作)。
|
|
7196
|
+
*/
|
|
7197
|
+
function observeBodyDark(onChange) {
|
|
7198
|
+
if (!hasDom()) return () => {};
|
|
7199
|
+
const observer = new MutationObserver(() => {
|
|
7200
|
+
onChange(readBodyDark());
|
|
5545
7201
|
});
|
|
7202
|
+
observer.observe(document.body, {
|
|
7203
|
+
attributes: true,
|
|
7204
|
+
attributeFilter: [DARK_THEME_BODY_ATTRIBUTE]
|
|
7205
|
+
});
|
|
7206
|
+
return () => {
|
|
7207
|
+
observer.disconnect();
|
|
7208
|
+
};
|
|
7209
|
+
}
|
|
7210
|
+
/**
|
|
7211
|
+
* 判定一条 `message` 事件的数据是不是关闭请求。
|
|
7212
|
+
*
|
|
7213
|
+
* @param data - `MessageEvent.data`(类型为 unknown)。
|
|
7214
|
+
* @returns 是关闭请求时为 true。
|
|
7215
|
+
*/
|
|
7216
|
+
function isCloseRequest(data) {
|
|
7217
|
+
return typeof data === "object" && data !== null && data.type === "dsh-auto-flow/close";
|
|
7218
|
+
}
|
|
7219
|
+
/**
|
|
7220
|
+
* 把当前上下文送进应用单元的 iframe(宿主侧)。
|
|
7221
|
+
*
|
|
7222
|
+
* @param frame - iframe 元素;尚未挂上时为 null(此时什么都不做)。
|
|
7223
|
+
* @param context - 要送的外观、会话与宿主 origin。
|
|
7224
|
+
* @param targetOrigin - 目标源,由调用方写明确值:**单元的 origin**(`new URL(entryUrl).origin`)。
|
|
7225
|
+
* 写 `'*'` 等于广播给任何来源。
|
|
7226
|
+
*/
|
|
7227
|
+
function postHostContext(frame, context, targetOrigin) {
|
|
7228
|
+
frame?.contentWindow?.postMessage({
|
|
7229
|
+
type: HOST_CONTEXT_MESSAGE_TYPE,
|
|
7230
|
+
theme: context.theme,
|
|
7231
|
+
sessionId: context.sessionId,
|
|
7232
|
+
hostOrigin: context.hostOrigin
|
|
7233
|
+
}, targetOrigin);
|
|
5546
7234
|
}
|
|
5547
7235
|
//#endregion
|
|
5548
|
-
//#region \0dsh-css:C:\Users\Administrator\Desktop\projects\dsh\
|
|
5549
|
-
const css
|
|
5550
|
-
const tagId
|
|
5551
|
-
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId
|
|
7236
|
+
//#region \0dsh-css:C:\Users\Administrator\Desktop\projects\dsh\dsh-plugins\packages\business\dsh-auto-flow\src\client\features\workflow-overlay\WorkflowOverlay.module.css.mjs
|
|
7237
|
+
const css = "._3sfATW_bar{box-sizing:border-box;width:100%;max-width:var(--dsh-composer-card-max-width,720px);border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:8px;align-items:center;gap:8px;margin:0 auto;padding:8px 12px;font-size:13px;display:flex}._3sfATW_layer{z-index:1000;pointer-events:none;position:fixed;inset:0}._3sfATW_dialog{top:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,0px));background:var(--dsw-alias-bg-base,transparent);pointer-events:auto;flex-direction:column;display:flex;position:absolute;bottom:0;left:0;right:0;overflow:hidden}._3sfATW_stage{flex-direction:column;width:100%;height:100%;min-height:0;display:flex;position:relative}._3sfATW_frame{background:0 0;border:0;flex:1;width:100%;min-height:0;display:block}._3sfATW_notice{min-height:0;color:var(--dsw-alias-label-secondary,inherit);text-align:center;text-wrap:pretty;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:12px;padding:24px 15%;display:flex}._3sfATW_noticeText{margin:0}._3sfATW_noticeActions{gap:8px;display:flex}._3sfATW_noticeReason{opacity:.8;margin:0;font-size:12px}";
|
|
7238
|
+
const tagId = "dsh-auto-flow/WorkflowOverlay.module.css";
|
|
7239
|
+
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
5552
7240
|
const tag = document.createElement("style");
|
|
5553
7241
|
tag.dataset.plugin = "dsh-auto-flow";
|
|
5554
|
-
tag.dataset.pluginCss = tagId
|
|
5555
|
-
tag.textContent = css
|
|
7242
|
+
tag.dataset.pluginCss = tagId;
|
|
7243
|
+
tag.textContent = css;
|
|
5556
7244
|
document.head.appendChild(tag);
|
|
5557
7245
|
}
|
|
5558
|
-
var
|
|
5559
|
-
"
|
|
5560
|
-
"
|
|
5561
|
-
"
|
|
5562
|
-
"
|
|
7246
|
+
var WorkflowOverlay_module_css_default = {
|
|
7247
|
+
"layer": "_3sfATW_layer",
|
|
7248
|
+
"dialog": "_3sfATW_dialog",
|
|
7249
|
+
"noticeActions": "_3sfATW_noticeActions",
|
|
7250
|
+
"noticeReason": "_3sfATW_noticeReason",
|
|
7251
|
+
"noticeText": "_3sfATW_noticeText",
|
|
7252
|
+
"bar": "_3sfATW_bar",
|
|
7253
|
+
"notice": "_3sfATW_notice",
|
|
7254
|
+
"stage": "_3sfATW_stage",
|
|
7255
|
+
"frame": "_3sfATW_frame"
|
|
5563
7256
|
};
|
|
5564
7257
|
//#endregion
|
|
5565
|
-
//#region src/client/
|
|
7258
|
+
//#region src/client/features/workflow-overlay/WorkflowOverlay.tsx
|
|
7259
|
+
/**
|
|
7260
|
+
* 会话内入口(`conversation.input.dock`):一排入口按钮 + 一层铺满整个 dsh 窗口的浮层。
|
|
7261
|
+
*
|
|
7262
|
+
* 【为什么按钮是一排而不是一颗】登记表(`src/app-units.ts`)里有几个单元、入口清单
|
|
7263
|
+
* (`src/client/dock-units.ts`)列了几项,会话里就有几个入口。按钮由注入面的 `entries` 清单驱动
|
|
7264
|
+
* (见 `contract/slots.ts`),故"再加一个入口"= 往清单里加一项,这个组件不为此再改一次。
|
|
7265
|
+
*
|
|
7266
|
+
* 【宿主侧只有三件事】那排按钮、一层铺满窗口的浮层、以及**入口打不开时**那两颗处置
|
|
7267
|
+
* (重新加载页面 / 退出浮层)。
|
|
7268
|
+
* 界面(卡片列表 / 画布 / 任何外部站点)与正常路径的出口全部归应用单元:浮层里只有 iframe,退出走应用
|
|
7269
|
+
* 主页顶栏右端那颗出口,它经一条消息请宿主关掉这一层。
|
|
7270
|
+
*
|
|
7271
|
+
* 【为什么还是补了一颗宿主侧出口】"出口只在应用里"这件事假设了应用一定能画出来;入口不可用时那条
|
|
7272
|
+
* 假设不成立:整页浮层盖住宿主界面,而应用里那颗出口根本不存在 —— 用户唯一的出路是刷新
|
|
7273
|
+
* 浏览器(提交版实测踩到过)。故 `unavailable` 那一档由宿主自己给出口;`loading`(通常只有一帧)
|
|
7274
|
+
* 只靠 Esc;`ready` 那一档**不加控件** —— 那正是"应用还没画出来就先亮一颗 ✕"(实测约 160ms 的顶部
|
|
7275
|
+
* 闪烁)的来源。
|
|
7276
|
+
*
|
|
7277
|
+
* 【浮层为什么是"自己的一层 + 原语 `useModalLayer`"】更简单的做法是自绘一个 `position: fixed;
|
|
7278
|
+
* inset: 0` 的覆盖层:它挡得住鼠标,却**没有焦点陷阱**,键盘 Tab 能钻到底层的会话界面(提交版实测
|
|
7279
|
+
* 过)。原语 `Modal` 有焦点陷阱,但它的 `className` 只落在卡片层,自带的 root 与遮罩**不可样式化**
|
|
7280
|
+
* —— 于是没法让开 dsh 自绘标题栏那条带(见 `WorkflowOverlay.module.css` 的文件头)。折中:自己
|
|
7281
|
+
* portal 出这一层(root、底色、让位都可控),焦点陷阱 / Esc / 焦点归还交给原语的 `useModalLayer`
|
|
7282
|
+
* —— 它就是原语 `Modal` 内部用的那一份。两条刻意的设置:
|
|
7283
|
+
* - 层的关闭回调就是 {@link OverlayProps.onClose}(Esc 关掉这一层)。跨源之后宿主**收不到 iframe 内
|
|
7284
|
+
* 的按键**(事件不跨文档),故这条回调只在"焦点在宿主这一层"时才触发 —— 也就是应用还没接管键盘的
|
|
7285
|
+
* 时候,顺手关掉不会抢应用里任何 Esc 语义;
|
|
7286
|
+
* - 层本身 `pointer-events: none`:那条标题栏带要留给窗口拖动与窗口按钮。
|
|
7287
|
+
*
|
|
7288
|
+
* 【正常路径的出口为什么在应用里】浮层盖住了对话与侧栏,用户需要一个出口;但宿主侧多一颗控件就
|
|
7289
|
+
* 意味着"应用还没画出来时,右上角先亮一颗 ✕"(实测开浮层后有约 160ms 的空白期,那颗 ✕ 正是用户
|
|
7290
|
+
* 看到的顶部闪烁)。放在应用主页顶栏右端则天然满足两件事:它跟着应用一起出现,而且**只有主界面
|
|
7291
|
+
* 有** —— 进入某个工作流实例(画布)后它就不在 DOM 里,想退出得先用画布菜单的「关闭」回到主界面。
|
|
7292
|
+
*
|
|
7293
|
+
* 【会话从哪来】`conversation.input.dock` 是**会话作用域**席位:框架把该会话的 `sessionId` 直接
|
|
7294
|
+
* 作为 props 投递给本组件(ui-slots 的契约原文:"strict session slots receive a definite
|
|
7295
|
+
* framework-resolved `sessionId`")。浮层就渲染在这个组件里,因此不需要任何模块级快照。
|
|
7296
|
+
*
|
|
7297
|
+
* 【跨源通道】单元跑在**自己的 origin** 上(见 `app-unit` 的 README),故这条 iframe 是跨源的:
|
|
7298
|
+
* - 宿主 → 应用一条 `postMessage`(外观、会话、宿主 origin),目标源写**单元 origin**;
|
|
7299
|
+
* - 反方向只有**一条**:应用主页那颗出口发出的关闭请求(只有实现了这套协议的那个单元会发;别的单元
|
|
7300
|
+
* 不认识它),它自己写**宿主 origin**(从我们
|
|
7301
|
+
* 送的上下文里取)。宿主只认**本 iframe 发来**的那一条,别的一律丢弃(跨源拿不到它的 origin 先验值,
|
|
7302
|
+
* 窗口身份就是判据)。
|
|
7303
|
+
* 字面量、属性名与形状判定都在共享件 `host-signal` 里定义一次(守卫:
|
|
7304
|
+
* `tests/app/host-message-contract.spec.ts`)。
|
|
7305
|
+
*
|
|
7306
|
+
* 【首帧主题为什么改成"等消息"】跨源时应用读不到 iframe 元素上的任何属性(`window.frameElement`
|
|
7307
|
+
* 为 null),原先那条同步通道没有了。故:应用在收到宿主的首条上下文之前**不画内容**(文档保持透明,
|
|
7308
|
+
* 看到的是浮层自己的底色),收到后按宿主外观画第一帧。宿主的 `postMessage` 在 iframe `load` 上补发,
|
|
7309
|
+
* 所以那段等待只有一帧的量级。
|
|
7310
|
+
*/
|
|
7311
|
+
/** dock 席位里那排入口按钮(一颗按钮对一个应用单元)。 */
|
|
7312
|
+
function WorkflowOverlayView({ sessionId, entries, labels }) {
|
|
7313
|
+
const [openUnit, setOpenUnit] = (0, react.useState)(null);
|
|
7314
|
+
const close = (0, react.useCallback)(() => {
|
|
7315
|
+
setOpenUnit(null);
|
|
7316
|
+
}, []);
|
|
7317
|
+
const active = entries.find((entry) => entry.unit === openUnit);
|
|
7318
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7319
|
+
className: WorkflowOverlay_module_css_default.bar,
|
|
7320
|
+
"data-dsh-plugin": "auto-flow",
|
|
7321
|
+
children: [entries.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7322
|
+
variant: "ghost",
|
|
7323
|
+
size: "sm",
|
|
7324
|
+
onClick: () => {
|
|
7325
|
+
if (sessionId !== void 0) setOpenUnit(entry.unit);
|
|
7326
|
+
},
|
|
7327
|
+
children: entry.label
|
|
7328
|
+
}, entry.unit)), active === void 0 ? null : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Overlay, {
|
|
7329
|
+
loadEntryUrl: active.loadEntryUrl,
|
|
7330
|
+
title: active.label,
|
|
7331
|
+
labels,
|
|
7332
|
+
sessionId: sessionId ?? null,
|
|
7333
|
+
onClose: close
|
|
7334
|
+
})]
|
|
7335
|
+
});
|
|
7336
|
+
}
|
|
5566
7337
|
/**
|
|
5567
|
-
*
|
|
7338
|
+
* 浮层本体:**挂载即打开**的一层(`createPortal` 到 `body`)。
|
|
5568
7339
|
*
|
|
5569
|
-
*
|
|
5570
|
-
*
|
|
7340
|
+
* 【为什么"关闭"是卸载整层,而不是把某个 `open` 切成假】层里跑的是跨源 iframe(整个应用):留着它
|
|
7341
|
+
* 只是不可见的话,探测、轮询与画布动画都还在后台跑 —— 关闭看起来生效了,实际没有。交给条件渲染就
|
|
7342
|
+
* 没有这层歧义(`WorkflowOverlayView` 里 `open ? <Overlay/> : null`)。
|
|
7343
|
+
*
|
|
7344
|
+
* 【为什么不动 `Stage` 的排版】`.dialog` 就是原来那层"面",`Stage` 铺满它;应用的 iframe 也仍然铺满
|
|
7345
|
+
* `.stage`。
|
|
5571
7346
|
*/
|
|
5572
|
-
function
|
|
5573
|
-
const
|
|
7347
|
+
function Overlay({ loadEntryUrl, title, labels, sessionId, onClose }) {
|
|
7348
|
+
const dialogRef = (0, react.useRef)(null);
|
|
7349
|
+
const entry = useEntryUrl(loadEntryUrl);
|
|
7350
|
+
(0, _deepseek_ai_dsh_client_ui_primitives.useModalLayer)(dialogRef, true, onClose);
|
|
7351
|
+
return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7352
|
+
className: WorkflowOverlay_module_css_default.layer,
|
|
7353
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7354
|
+
ref: dialogRef,
|
|
7355
|
+
className: WorkflowOverlay_module_css_default.dialog,
|
|
7356
|
+
role: "dialog",
|
|
7357
|
+
"aria-modal": "true",
|
|
7358
|
+
"aria-label": title,
|
|
7359
|
+
tabIndex: -1,
|
|
7360
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
7361
|
+
className: WorkflowOverlay_module_css_default.stage,
|
|
7362
|
+
children: entry.kind === "loading" ? null : entry.kind === "unavailable" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7363
|
+
className: WorkflowOverlay_module_css_default.notice,
|
|
7364
|
+
children: [
|
|
7365
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
7366
|
+
className: WorkflowOverlay_module_css_default.noticeText,
|
|
7367
|
+
children: labels.unavailable
|
|
7368
|
+
}),
|
|
7369
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
|
|
7370
|
+
className: WorkflowOverlay_module_css_default.noticeReason,
|
|
7371
|
+
children: entry.reason
|
|
7372
|
+
}),
|
|
7373
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
7374
|
+
className: WorkflowOverlay_module_css_default.noticeActions,
|
|
7375
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7376
|
+
variant: "ghost",
|
|
7377
|
+
size: "sm",
|
|
7378
|
+
onClick: () => {
|
|
7379
|
+
window.location.reload();
|
|
7380
|
+
},
|
|
7381
|
+
children: labels.reload
|
|
7382
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7383
|
+
variant: "ghost",
|
|
7384
|
+
size: "sm",
|
|
7385
|
+
onClick: onClose,
|
|
7386
|
+
children: labels.close
|
|
7387
|
+
})]
|
|
7388
|
+
})
|
|
7389
|
+
]
|
|
7390
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Stage, {
|
|
7391
|
+
entryUrl: entry.url,
|
|
7392
|
+
title,
|
|
7393
|
+
sessionId,
|
|
7394
|
+
onClose
|
|
7395
|
+
})
|
|
7396
|
+
})
|
|
7397
|
+
})
|
|
7398
|
+
}), document.body);
|
|
7399
|
+
}
|
|
7400
|
+
/** 浮层内容:跨源 iframe + 应用发来的关闭请求。 */
|
|
7401
|
+
function Stage({ entryUrl, title, sessionId, onClose }) {
|
|
7402
|
+
const frameRef = (0, react.useRef)(null);
|
|
7403
|
+
const theme = useHostAppearance();
|
|
7404
|
+
const targetOrigin = (0, react.useMemo)(() => new URL(entryUrl).origin, [entryUrl]);
|
|
7405
|
+
/** 把一个上下文快照送进 iframe。 */
|
|
7406
|
+
const post = (0, react.useCallback)(() => {
|
|
7407
|
+
postHostContext(frameRef.current, {
|
|
7408
|
+
theme,
|
|
7409
|
+
sessionId,
|
|
7410
|
+
hostOrigin: window.location.origin
|
|
7411
|
+
}, targetOrigin);
|
|
7412
|
+
}, [
|
|
7413
|
+
theme,
|
|
7414
|
+
sessionId,
|
|
7415
|
+
targetOrigin
|
|
7416
|
+
]);
|
|
5574
7417
|
(0, react.useEffect)(() => {
|
|
5575
|
-
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
|
|
5580
|
-
|
|
5581
|
-
|
|
7418
|
+
post();
|
|
7419
|
+
}, [post]);
|
|
7420
|
+
(0, react.useEffect)(() => {
|
|
7421
|
+
function onMessage(event) {
|
|
7422
|
+
if (event.source !== frameRef.current?.contentWindow) return;
|
|
7423
|
+
if (isCloseRequest(event.data)) onClose();
|
|
7424
|
+
}
|
|
7425
|
+
window.addEventListener("message", onMessage);
|
|
5582
7426
|
return () => {
|
|
5583
|
-
|
|
5584
|
-
clearInterval(interval);
|
|
7427
|
+
window.removeEventListener("message", onMessage);
|
|
5585
7428
|
};
|
|
5586
|
-
}, [
|
|
5587
|
-
|
|
5588
|
-
|
|
5589
|
-
|
|
5590
|
-
|
|
5591
|
-
|
|
5592
|
-
|
|
5593
|
-
|
|
5594
|
-
className: GreetingDock_module_css_default.label,
|
|
5595
|
-
children: t("dock.label")
|
|
5596
|
-
}),
|
|
5597
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5598
|
-
className: GreetingDock_module_css_default.count,
|
|
5599
|
-
children: count
|
|
5600
|
-
}),
|
|
5601
|
-
last !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5602
|
-
className: GreetingDock_module_css_default.last,
|
|
5603
|
-
children: [
|
|
5604
|
-
t("dock.last"),
|
|
5605
|
-
":",
|
|
5606
|
-
last
|
|
5607
|
-
]
|
|
5608
|
-
})
|
|
5609
|
-
]
|
|
7429
|
+
}, [onClose]);
|
|
7430
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("iframe", {
|
|
7431
|
+
ref: frameRef,
|
|
7432
|
+
className: WorkflowOverlay_module_css_default.frame,
|
|
7433
|
+
src: entryUrl,
|
|
7434
|
+
title,
|
|
7435
|
+
allow: "clipboard-write",
|
|
7436
|
+
onLoad: post
|
|
5610
7437
|
});
|
|
5611
7438
|
}
|
|
5612
|
-
|
|
5613
|
-
|
|
5614
|
-
|
|
5615
|
-
|
|
5616
|
-
|
|
5617
|
-
|
|
5618
|
-
|
|
5619
|
-
|
|
5620
|
-
|
|
5621
|
-
|
|
7439
|
+
/**
|
|
7440
|
+
* 取单元的入口地址。
|
|
7441
|
+
*
|
|
7442
|
+
* 【为什么不再"探测地址是否有人服务"】旧形态是同源 iframe,宿主半边可以 `fetch` 一下入口看有没有人
|
|
7443
|
+
* 应;跨源之后那次 fetch 会被 CORS 挡掉(单元不为自己发 CORS 头),探测结论恒为"不可用"。而真正
|
|
7444
|
+
* 权威的答案就在宿主半边手里:它知道单元服务有没有起来(`loadEntryUrl` 拿不到地址时给 null)。
|
|
7445
|
+
* 于是这一段从"问浏览器"变成"问宿主",顺带修掉旧探测的已知边界(返回 SPA 首页的宿主会被误判成可用)。
|
|
7446
|
+
*
|
|
7447
|
+
* 【失败口径】拿不到地址与取地址本身失败同等对待(都是"没有入口"),浮层给同一句说明。
|
|
7448
|
+
*
|
|
7449
|
+
* @param load - 取地址的函数(引用必须稳定:它是本 effect 的依赖)。
|
|
7450
|
+
* @returns 取用状态;未出结果前是 `loading`。
|
|
7451
|
+
*/
|
|
7452
|
+
function useEntryUrl(load) {
|
|
7453
|
+
const [state, setState] = (0, react.useState)({ kind: "loading" });
|
|
7454
|
+
(0, react.useEffect)(() => {
|
|
7455
|
+
let cancelled = false;
|
|
7456
|
+
setState({ kind: "loading" });
|
|
7457
|
+
load().then((lookup) => {
|
|
7458
|
+
if (cancelled) return;
|
|
7459
|
+
setState(lookup.ok ? {
|
|
7460
|
+
kind: "ready",
|
|
7461
|
+
url: lookup.url
|
|
7462
|
+
} : {
|
|
7463
|
+
kind: "unavailable",
|
|
7464
|
+
reason: lookup.reason
|
|
7465
|
+
});
|
|
7466
|
+
}, (error) => {
|
|
7467
|
+
if (cancelled) return;
|
|
7468
|
+
setState({
|
|
7469
|
+
kind: "unavailable",
|
|
7470
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
7471
|
+
});
|
|
7472
|
+
});
|
|
7473
|
+
return () => {
|
|
7474
|
+
cancelled = true;
|
|
7475
|
+
};
|
|
7476
|
+
}, [load]);
|
|
7477
|
+
return state;
|
|
5622
7478
|
}
|
|
5623
|
-
|
|
5624
|
-
|
|
5625
|
-
|
|
5626
|
-
|
|
5627
|
-
|
|
5628
|
-
|
|
5629
|
-
|
|
7479
|
+
/**
|
|
7480
|
+
* 读宿主页面当前的外观(`body[data-ds-dark-theme]`)。
|
|
7481
|
+
*
|
|
7482
|
+
* 【为什么读 `body` 的属性】dsh 的 ui-layout 呈现器把**解析后**的外观快照应用到
|
|
7483
|
+
* `body[data-ds-dark-theme]`(system 偏好已由主题服务解析好),故那个属性就是权威信号;读法与订阅
|
|
7484
|
+
* 都在共享件 `host-signal` 里(应用单元写的是同一个属性)。
|
|
7485
|
+
*/
|
|
7486
|
+
function useHostAppearance() {
|
|
7487
|
+
const [appearance, setAppearance] = (0, react.useState)(() => readBodyDark() ? "dark" : "light");
|
|
7488
|
+
(0, react.useEffect)(() => {
|
|
7489
|
+
const read = () => {
|
|
7490
|
+
setAppearance(readBodyDark() ? "dark" : "light");
|
|
7491
|
+
};
|
|
7492
|
+
read();
|
|
7493
|
+
return observeBodyDark(read);
|
|
7494
|
+
}, []);
|
|
7495
|
+
return appearance;
|
|
7496
|
+
}
|
|
7497
|
+
/**
|
|
7498
|
+
* 注册进 `conversation.input.dock` 的组件。
|
|
7499
|
+
*
|
|
7500
|
+
* 【为什么不再套主题桥】宿主页面里的界面全部用 dsh 原生件,它们直接认宿主的 `--dsw-*` 令牌,不需要
|
|
7501
|
+
* 任何 Provider 或 token 桥。
|
|
7502
|
+
*/
|
|
7503
|
+
const WorkflowOverlay = WorkflowOverlayView;
|
|
5630
7504
|
//#endregion
|
|
5631
|
-
//#region src/client/SettingsRow.tsx
|
|
7505
|
+
//#region src/client/features/settings/SettingsRow.tsx
|
|
5632
7506
|
/**
|
|
5633
|
-
*
|
|
7507
|
+
* 设置行(`settings.general.item`):把插件 Config(工作区目录)接到设置 UI。
|
|
7508
|
+
*
|
|
7509
|
+
* 【骨架为什么在本包自己手里】共享层不再放任何 UI(见需求 `ui-layering`):三个插件的设置行是
|
|
7510
|
+
* **各自的**宿主界面,形状相同、内容各异;再抽一个共享组件包等于把那层"薄薄的公共 UI"重造一遍。
|
|
7511
|
+
* 三份同形的代价由仓库重复闸门记录(`packages/internal/workspace-policy`)。
|
|
5634
7512
|
*
|
|
5635
|
-
*
|
|
5636
|
-
* `
|
|
5637
|
-
*
|
|
5638
|
-
* 写入走 scope.set/unset(Host 会校验、持久化并按 revision 防冲突)。
|
|
7513
|
+
* 【骨架做四件事】订阅配置快照(`useSyncExternalStore`)、维护草稿、区分两种失败(Host 拒绝 /
|
|
7514
|
+
* 传输失败)、三态状态文案。皮肤全部是 dsh 原生件(`Input` / `Button` / `Toast`)—— 装到宿主页面
|
|
7515
|
+
* 里的界面就该用它自己的组件,也不再需要任何主题桥:原语直接认宿主的 `--dsw-*` 令牌。
|
|
5639
7516
|
*/
|
|
5640
|
-
|
|
5641
|
-
|
|
5642
|
-
const
|
|
7517
|
+
/** 注册进 `settings.general.item` 的组件:工作区目录设置行。 */
|
|
7518
|
+
function SettingsRow({ form, t }) {
|
|
7519
|
+
const snapshot = (0, react.useSyncExternalStore)((0, react.useCallback)((onChange) => form.subscribe(onChange), [form]), (0, react.useCallback)(() => form.getSnapshot(), [form]));
|
|
7520
|
+
const saved = snapshot.value?.workspaceDir ?? "";
|
|
5643
7521
|
const [draft, setDraft] = (0, react.useState)(null);
|
|
5644
|
-
const
|
|
7522
|
+
const [toast, setToast] = (0, react.useState)(null);
|
|
7523
|
+
const dir = draft ?? saved;
|
|
5645
7524
|
const statusText = snapshot.status === "ready" ? t("settings.statusReady") : snapshot.status === "unavailable" ? t("settings.statusUnavailable") : t("settings.statusLoading");
|
|
7525
|
+
/** 收起提示:原语 `Toast` 到期只回调 `onDone`,卸载由我们负责。 */
|
|
7526
|
+
const dismissToast = (0, react.useCallback)(() => {
|
|
7527
|
+
setToast(null);
|
|
7528
|
+
}, []);
|
|
7529
|
+
/**
|
|
7530
|
+
* 提交草稿。
|
|
7531
|
+
*
|
|
7532
|
+
* 【为什么分两种失败】`form.set` 被 Host 拒绝时**返回 false**(不抛),传输失败才抛。只看抛错会把
|
|
7533
|
+
* 「被拒绝」当成保存成功。失败时保留草稿,用户可直接重试。
|
|
7534
|
+
*/
|
|
7535
|
+
const save = async () => {
|
|
7536
|
+
const next = dir;
|
|
7537
|
+
try {
|
|
7538
|
+
if (!await form.set("workspaceDir", next)) {
|
|
7539
|
+
setDraft(next);
|
|
7540
|
+
setToast({
|
|
7541
|
+
text: t("settings.saveFailed"),
|
|
7542
|
+
success: false
|
|
7543
|
+
});
|
|
7544
|
+
return;
|
|
7545
|
+
}
|
|
7546
|
+
setDraft(null);
|
|
7547
|
+
setToast({
|
|
7548
|
+
text: t("settings.saved"),
|
|
7549
|
+
success: true
|
|
7550
|
+
});
|
|
7551
|
+
} catch (error) {
|
|
7552
|
+
setDraft(next);
|
|
7553
|
+
const detail = error instanceof Error ? error.message : String(error);
|
|
7554
|
+
setToast({
|
|
7555
|
+
text: `${t("settings.saveFailed")}:${detail}`,
|
|
7556
|
+
success: false
|
|
7557
|
+
});
|
|
7558
|
+
}
|
|
7559
|
+
};
|
|
5646
7560
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5647
|
-
className: SettingsRow_module_css_default.row,
|
|
5648
7561
|
"data-dsh-plugin": "auto-flow",
|
|
7562
|
+
style: {
|
|
7563
|
+
display: "flex",
|
|
7564
|
+
alignItems: "center",
|
|
7565
|
+
gap: 8,
|
|
7566
|
+
width: "100%",
|
|
7567
|
+
fontSize: 13
|
|
7568
|
+
},
|
|
5649
7569
|
children: [
|
|
5650
7570
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("label", {
|
|
5651
|
-
|
|
5652
|
-
|
|
5653
|
-
children: t("settings.
|
|
7571
|
+
htmlFor: "auto-flow-workspace-dir",
|
|
7572
|
+
style: { flex: "none" },
|
|
7573
|
+
children: t("settings.workspaceDirLabel")
|
|
5654
7574
|
}),
|
|
5655
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("
|
|
5656
|
-
|
|
5657
|
-
|
|
5658
|
-
|
|
5659
|
-
|
|
5660
|
-
|
|
7575
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
7576
|
+
style: {
|
|
7577
|
+
display: "grid",
|
|
7578
|
+
flex: 1,
|
|
7579
|
+
minWidth: 0
|
|
7580
|
+
},
|
|
7581
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Input, {
|
|
7582
|
+
id: "auto-flow-workspace-dir",
|
|
7583
|
+
value: dir,
|
|
7584
|
+
placeholder: t("settings.workspaceDirPlaceholder"),
|
|
7585
|
+
onChange: (event) => {
|
|
7586
|
+
setDraft(event.target.value);
|
|
7587
|
+
}
|
|
7588
|
+
})
|
|
5661
7589
|
}),
|
|
5662
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5663
|
-
|
|
5664
|
-
|
|
5665
|
-
disabled:
|
|
7590
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
7591
|
+
variant: "primary",
|
|
7592
|
+
size: "sm",
|
|
7593
|
+
disabled: dir === saved,
|
|
5666
7594
|
onClick: () => {
|
|
5667
|
-
|
|
5668
|
-
setDraft(null);
|
|
7595
|
+
save();
|
|
5669
7596
|
},
|
|
5670
7597
|
children: t("settings.save")
|
|
5671
7598
|
}),
|
|
5672
7599
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5673
|
-
|
|
7600
|
+
style: {
|
|
7601
|
+
flex: "none",
|
|
7602
|
+
fontSize: 12,
|
|
7603
|
+
color: "var(--dsw-alias-label-secondary)"
|
|
7604
|
+
},
|
|
5674
7605
|
children: statusText
|
|
7606
|
+
}),
|
|
7607
|
+
toast === null ? null : toast.success ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
7608
|
+
text: toast.text,
|
|
7609
|
+
tone: "success",
|
|
7610
|
+
onDone: dismissToast
|
|
7611
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
7612
|
+
text: toast.text,
|
|
7613
|
+
onDone: dismissToast
|
|
5675
7614
|
})
|
|
5676
7615
|
]
|
|
5677
7616
|
});
|
|
5678
7617
|
}
|
|
5679
7618
|
//#endregion
|
|
5680
|
-
//#region src/client/locales.ts
|
|
5681
|
-
/**
|
|
5682
|
-
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
"
|
|
5694
|
-
"
|
|
5695
|
-
|
|
5696
|
-
"
|
|
5697
|
-
|
|
5698
|
-
"
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
"
|
|
5703
|
-
"
|
|
5704
|
-
"
|
|
5705
|
-
"
|
|
5706
|
-
|
|
7619
|
+
//#region src/client/features/workflow-overlay/locales.ts
|
|
7620
|
+
/**
|
|
7621
|
+
* 会话内入口 + 整页浮层的 zh/en 词典分片(workflowOverlay.*)。
|
|
7622
|
+
*
|
|
7623
|
+
* 【为什么入口与 iframe 标题共用一个键】它们说的是同一个东西(这个界面叫「工作流」),
|
|
7624
|
+
* 分成两个键只会多一处会漂移的复制品。
|
|
7625
|
+
*
|
|
7626
|
+
* 【为什么有「退出工作流」这个键】浮层里那颗宿主侧出口只在"应用不存在"时出现(判据见
|
|
7627
|
+
* `contract/slots.ts` 的 `close`),文字与应用主页那颗同名 —— 用户看到的是同一个动作。
|
|
7628
|
+
*/
|
|
7629
|
+
/** 简体中文(本分片的键集真源)。 */
|
|
7630
|
+
const zh$2 = {
|
|
7631
|
+
/** 界面名字:既是入口按钮的文字,也是它那个 iframe 的无障碍标题。 */
|
|
7632
|
+
"workflowOverlay.title": "工作流",
|
|
7633
|
+
"workflowOverlay.unavailable": "入口没有就绪:宿主没有提供信任门,或单元服务没能起来。若刚更新过插件,重新加载本页面即可。",
|
|
7634
|
+
/** 浮层里那颗宿主侧出口(只在应用不存在时出现)。 */
|
|
7635
|
+
"workflowOverlay.close": "退出",
|
|
7636
|
+
/** 说明里那颗「重新加载页面」:页面上那一半过期时的解(只在应用不存在时出现)。 */
|
|
7637
|
+
"workflowOverlay.reload": "重新加载页面"
|
|
7638
|
+
};
|
|
7639
|
+
/** 英文词典,键集与 zh 完全对齐。 */
|
|
7640
|
+
const en$2 = {
|
|
7641
|
+
"workflowOverlay.title": "Workflow",
|
|
7642
|
+
"workflowOverlay.unavailable": "The entry is not ready: this host provides no trust gate, or the unit service failed to start. Reload this page if the plugin was just updated.",
|
|
7643
|
+
"workflowOverlay.close": "Exit",
|
|
7644
|
+
"workflowOverlay.reload": "Reload this page"
|
|
7645
|
+
};
|
|
7646
|
+
//#endregion
|
|
7647
|
+
//#region src/client/features/settings/locales.ts
|
|
7648
|
+
/**
|
|
7649
|
+
* SettingsRow 设置行的 zh/en 词典分片(settings.*)。
|
|
7650
|
+
*/
|
|
7651
|
+
/** 简体中文(本分片的键集真源)。 */
|
|
7652
|
+
const zh$1 = {
|
|
7653
|
+
"settings.workspaceDirLabel": "运行产物目录",
|
|
7654
|
+
"settings.workspaceDirPlaceholder": "如 workflow-runs",
|
|
5707
7655
|
"settings.save": "保存",
|
|
7656
|
+
"settings.saved": "设置已保存",
|
|
7657
|
+
"settings.saveFailed": "保存失败",
|
|
5708
7658
|
"settings.statusReady": "已同步",
|
|
5709
7659
|
"settings.statusUnavailable": "不可用",
|
|
5710
7660
|
"settings.statusLoading": "同步中"
|
|
5711
7661
|
};
|
|
5712
7662
|
/** 英文词典,键集与 zh 完全对齐。 */
|
|
5713
|
-
const en = {
|
|
5714
|
-
"
|
|
5715
|
-
"
|
|
5716
|
-
"bar.send": "Send",
|
|
5717
|
-
"bar.failed": "send failed",
|
|
5718
|
-
"bar.recorded": "recorded",
|
|
5719
|
-
"exec.placeholder": "command line (Enter to run)",
|
|
5720
|
-
"exec.aria": "command line",
|
|
5721
|
-
"exec.button": "Run",
|
|
5722
|
-
"exec.background": "background",
|
|
5723
|
-
"exec.empty": "command returned no output",
|
|
5724
|
-
"exec.backgroundStarted": "background job started",
|
|
5725
|
-
"exec.read": "Read output",
|
|
5726
|
-
"exec.stop": "Stop",
|
|
5727
|
-
"exec.status": "status",
|
|
5728
|
-
"exec.lastRead": "last read",
|
|
5729
|
-
"exec.timedOut": "timed out",
|
|
5730
|
-
"exec.aborted": "aborted",
|
|
5731
|
-
"exec.denied": "sandbox denied",
|
|
5732
|
-
"exec.exitCode": "exit code",
|
|
5733
|
-
"dock.label": "recorded greetings",
|
|
5734
|
-
"dock.last": "last",
|
|
5735
|
-
"settings.prefixLabel": "Greeting prefix",
|
|
5736
|
-
"settings.prefixPlaceholder": "e.g. Hello",
|
|
7663
|
+
const en$1 = {
|
|
7664
|
+
"settings.workspaceDirLabel": "Run artifact directory",
|
|
7665
|
+
"settings.workspaceDirPlaceholder": "e.g. workflow-runs",
|
|
5737
7666
|
"settings.save": "Save",
|
|
7667
|
+
"settings.saved": "Settings saved",
|
|
7668
|
+
"settings.saveFailed": "Save failed",
|
|
5738
7669
|
"settings.statusReady": "synced",
|
|
5739
7670
|
"settings.statusUnavailable": "unavailable",
|
|
5740
7671
|
"settings.statusLoading": "syncing"
|
|
5741
7672
|
};
|
|
5742
7673
|
//#endregion
|
|
7674
|
+
//#region src/client/locales.ts
|
|
7675
|
+
/**
|
|
7676
|
+
* dsh-auto-flow 的 zh/en 词典聚合点:客户端半各 UI feature 的词典分片在此合并,
|
|
7677
|
+
* 供 apply.ts 的 `ctx.locale.register(NS, { zh, en })` 与 index.ts 的
|
|
7678
|
+
* `LocaleNamespaceMap` 类型声明使用。
|
|
7679
|
+
*
|
|
7680
|
+
* 【为什么这里少了一大块】画布(`workflow.*`)连同它的词典一起搬进了**前端工程**
|
|
7681
|
+
* (它的 `src/workflow/locales.ts`,仓库同级目录):那些文案只有画布自己用,
|
|
7682
|
+
* 而画布已经不在这半边渲染了。留在这里的键只有仍然由 dsh 界面承载的两段 ——
|
|
7683
|
+
* 设置页里的插件配置行与会话内入口 / 整页浮层的文案。
|
|
7684
|
+
*
|
|
7685
|
+
* 分片随组件一起收在 src/client/features/<feature>/locales.ts(按 feature 自包含);
|
|
7686
|
+
* 新增界面文案时,在对应 feature 的分片里加键并在此合并。dsh 的 flat 词典用点号分组,
|
|
7687
|
+
* 每个分片的 en 用 `satisfies Record<keyof typeof zh, string>` 就地保证双语
|
|
7688
|
+
* 键集一致,`ctx.locale.register` 的类型面(LocaleDictOf)再兜底缺失/多余键。
|
|
7689
|
+
*/
|
|
7690
|
+
/** 简体中文词典(各分片并集;键集真源)。 */
|
|
7691
|
+
const zh = {
|
|
7692
|
+
...zh$1,
|
|
7693
|
+
...zh$2
|
|
7694
|
+
};
|
|
7695
|
+
/** 英文词典,键集与 zh 完全对齐。 */
|
|
7696
|
+
const en = {
|
|
7697
|
+
...en$1,
|
|
7698
|
+
...en$2
|
|
7699
|
+
};
|
|
7700
|
+
//#endregion
|
|
5743
7701
|
//#region src/client/apply.ts
|
|
5744
7702
|
/** 词典命名空间(与 LocaleNamespaceMap 键一致)。 */
|
|
5745
7703
|
const NS = "autoFlow";
|
|
5746
|
-
/** 设置 namespace(与宿主注册的 settings namespace 字符串一致)。 */
|
|
5747
|
-
const SETTINGS_NS = "auto-flow";
|
|
5748
7704
|
/**
|
|
5749
|
-
*
|
|
5750
|
-
*
|
|
5751
|
-
*
|
|
7705
|
+
* 设置命名空间 = **Host 插件条目 id**(即 `cordis.patch.yml` 里那一行的 `id`)。
|
|
7706
|
+
*
|
|
7707
|
+
* 官方按条目 id 作为键:`ui-settings` 的 `ConfigForms.get(entryId)` 注释写明「Unique Host
|
|
7708
|
+
* plugin entry id」,Host 侧 `settings` 的 `describe()` 也用 `entry.options.id` 作 `ns`
|
|
7709
|
+
* (`packages/settings/settings/src/index.ts:326`)。此处原写作 `'auto-flow'`(去掉了 `dsh-` 前缀),
|
|
7710
|
+
* 取到的是一个**不存在的命名空间** —— 设置行读不到也存不了配置。
|
|
7711
|
+
*/
|
|
7712
|
+
const SETTINGS_NS = "dsh-auto-flow";
|
|
7713
|
+
/**
|
|
7714
|
+
* 挂载远程契约,再开子 fiber 注册 UI。返回卸载器(先卸子 fiber,再移除远程命名空间)。
|
|
7715
|
+
*
|
|
7716
|
+
* 【为什么仍然 `$mount`】远程命名空间是本插件**对外发布的契约面**(`@Remote` 那一批方法)。
|
|
7717
|
+
* 客户端半自己不再消费它(取数已全在应用单元的 BFF 里),但"不再消费"不等于"该撤掉":
|
|
7718
|
+
* 撤掉要连带改 typert 生成面与 `package.json#exports['./remote']`,与本需求无关。
|
|
5752
7719
|
*/
|
|
5753
7720
|
async function apply(ctx) {
|
|
5754
7721
|
const disposeRemote = await ctx.remote.$mount(TYPERT_REMOTE);
|
|
5755
7722
|
const ui = ctx.inject([
|
|
5756
|
-
"remote.autoFlow",
|
|
5757
7723
|
"slots",
|
|
5758
|
-
"locale"
|
|
7724
|
+
"locale",
|
|
7725
|
+
"remote.autoFlow"
|
|
5759
7726
|
], registerUi);
|
|
5760
7727
|
try {
|
|
5761
7728
|
await ui;
|
|
@@ -5769,46 +7736,61 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
5769
7736
|
await disposeRemote();
|
|
5770
7737
|
};
|
|
5771
7738
|
}
|
|
5772
|
-
/**
|
|
7739
|
+
/** slots / locale 就绪后,注册词典、设置行与会话内入口。 */
|
|
5773
7740
|
function registerUi(ctx) {
|
|
5774
|
-
const hello = ctx.remote.autoFlow;
|
|
5775
7741
|
ctx.effect(() => ctx.locale.register(NS, {
|
|
5776
7742
|
zh,
|
|
5777
7743
|
en
|
|
5778
7744
|
}), "auto-flow: 词典");
|
|
7745
|
+
const translate = (key) => ctx.locale.bind(NS)(key);
|
|
7746
|
+
ctx.inject(["configForms"], (formsCtx) => {
|
|
7747
|
+
const form = formsCtx.configForms.get(SETTINGS_NS);
|
|
7748
|
+
formsCtx.effect(() => ctx.slots.inject("settings.general.item", () => ctx.slots.register({
|
|
7749
|
+
name: "settings.general.item",
|
|
7750
|
+
id: "auto-flow",
|
|
7751
|
+
order: 10,
|
|
7752
|
+
locale: NS,
|
|
7753
|
+
inject: () => ({ form })
|
|
7754
|
+
}, SettingsRow)), "auto-flow: 设置行");
|
|
7755
|
+
});
|
|
7756
|
+
const loadFor = (unit) => async () => {
|
|
7757
|
+
const result = await ctx.remote.autoFlow.unitUrl(unit);
|
|
7758
|
+
if (!result.ok) return {
|
|
7759
|
+
ok: false,
|
|
7760
|
+
reason: `${result.error.code}: ${result.error.message}`
|
|
7761
|
+
};
|
|
7762
|
+
if (result.value.url === null) return {
|
|
7763
|
+
ok: false,
|
|
7764
|
+
reason: result.value.reason ?? "宿主没有给出单元地址(宿主日志里的 auto-flow 警告有原因)"
|
|
7765
|
+
};
|
|
7766
|
+
return {
|
|
7767
|
+
ok: true,
|
|
7768
|
+
url: result.value.url
|
|
7769
|
+
};
|
|
7770
|
+
};
|
|
7771
|
+
const entries = DOCK_UNITS.map((item) => ({
|
|
7772
|
+
unit: item.unit,
|
|
7773
|
+
label: item.label === void 0 ? item.unit : translate(item.label),
|
|
7774
|
+
loadEntryUrl: loadFor(item.unit)
|
|
7775
|
+
}));
|
|
5779
7776
|
ctx.effect(() => ctx.slots.inject("conversation.input.dock", () => ctx.slots.register({
|
|
5780
7777
|
name: "conversation.input.dock",
|
|
5781
7778
|
id: "auto-flow",
|
|
5782
7779
|
order: 20,
|
|
5783
7780
|
locale: NS,
|
|
5784
7781
|
inject: () => ({
|
|
5785
|
-
|
|
5786
|
-
|
|
5787
|
-
|
|
5788
|
-
|
|
7782
|
+
entries,
|
|
7783
|
+
labels: {
|
|
7784
|
+
unavailable: translate("workflowOverlay.unavailable"),
|
|
7785
|
+
close: translate("workflowOverlay.close"),
|
|
7786
|
+
reload: translate("workflowOverlay.reload")
|
|
7787
|
+
}
|
|
5789
7788
|
})
|
|
5790
|
-
},
|
|
5791
|
-
ctx.effect(() => ctx.slots.inject("conversation.composer.dock", () => ctx.slots.register({
|
|
5792
|
-
name: "conversation.composer.dock",
|
|
5793
|
-
id: "auto-flow",
|
|
5794
|
-
order: 10,
|
|
5795
|
-
locale: NS,
|
|
5796
|
-
inject: () => ({ list: () => hello.list() })
|
|
5797
|
-
}, GreetingDock)), "auto-flow: 会话读数");
|
|
5798
|
-
ctx.inject(["settingsScope"], (settingsCtx) => {
|
|
5799
|
-
const scope = settingsCtx.settingsScope.bind({ namespace: SETTINGS_NS });
|
|
5800
|
-
settingsCtx.effect(() => ctx.slots.inject("settings.general.item", () => ctx.slots.register({
|
|
5801
|
-
name: "settings.general.item",
|
|
5802
|
-
id: "auto-flow",
|
|
5803
|
-
order: 10,
|
|
5804
|
-
locale: NS,
|
|
5805
|
-
inject: () => ({ scope })
|
|
5806
|
-
}, SettingsRow)), "auto-flow: 设置行");
|
|
5807
|
-
});
|
|
7789
|
+
}, WorkflowOverlay)), "auto-flow: 会话内入口");
|
|
5808
7790
|
}
|
|
5809
7791
|
//#endregion
|
|
5810
7792
|
//#region src/client/index.ts
|
|
5811
|
-
/** 外层所需服务:只有 Remote 挂载点;命名空间在
|
|
7793
|
+
/** 外层所需服务:只有 Remote 挂载点;命名空间在 $mount 后就绪,交给子 fiber 注入。 */
|
|
5812
7794
|
const inject = ["remote"];
|
|
5813
7795
|
//#endregion
|
|
5814
7796
|
exports.apply = apply;
|