@adhd/dispatch-base-spec 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -0
- package/index.js +3 -5
- package/index.mjs +460 -669
- package/lib/types.d.ts +1 -1
- package/package.json +20 -2
package/index.mjs
CHANGED
|
@@ -1,682 +1,473 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"set-key",
|
|
100
|
-
"remove-key",
|
|
101
|
-
"rename-key",
|
|
102
|
-
"add-array-item",
|
|
103
|
-
"remove-array-item",
|
|
104
|
-
"add-var",
|
|
105
|
-
"remove-var",
|
|
106
|
-
"rename-var",
|
|
107
|
-
"change-default",
|
|
108
|
-
"add-section",
|
|
109
|
-
"remove-section",
|
|
110
|
-
"rename-section",
|
|
111
|
-
"update-section",
|
|
112
|
-
"add-table",
|
|
113
|
-
"remove-table",
|
|
114
|
-
"add-column",
|
|
115
|
-
"remove-column",
|
|
116
|
-
"rename-column",
|
|
117
|
-
"retype-column",
|
|
118
|
-
"change-nullable",
|
|
119
|
-
"add-index",
|
|
120
|
-
"remove-index",
|
|
121
|
-
"add-entry",
|
|
122
|
-
"remove-entry",
|
|
123
|
-
"update-entry",
|
|
124
|
-
"bump-version",
|
|
125
|
-
"update-checksum",
|
|
126
|
-
"add-export"
|
|
127
|
-
])
|
|
1
|
+
//#region src/lib/types.ts
|
|
2
|
+
var e = /* @__PURE__ */ new Set([
|
|
3
|
+
"create",
|
|
4
|
+
"modify-signature",
|
|
5
|
+
"modify-body",
|
|
6
|
+
"add-export",
|
|
7
|
+
"remove-export",
|
|
8
|
+
"rename"
|
|
9
|
+
]), t = {
|
|
10
|
+
function: /* @__PURE__ */ new Set([
|
|
11
|
+
"add-param",
|
|
12
|
+
"remove-param",
|
|
13
|
+
"rename-param",
|
|
14
|
+
"retype-param",
|
|
15
|
+
"change-param-optional",
|
|
16
|
+
"reorder-params",
|
|
17
|
+
"change-return"
|
|
18
|
+
]),
|
|
19
|
+
interface: /* @__PURE__ */ new Set([
|
|
20
|
+
"add-field",
|
|
21
|
+
"remove-field",
|
|
22
|
+
"rename-field",
|
|
23
|
+
"retype-field",
|
|
24
|
+
"change-field-optional",
|
|
25
|
+
"add-generic",
|
|
26
|
+
"remove-generic",
|
|
27
|
+
"constrain-generic",
|
|
28
|
+
"add-extends",
|
|
29
|
+
"remove-extends"
|
|
30
|
+
]),
|
|
31
|
+
type: /* @__PURE__ */ new Set([
|
|
32
|
+
"add-field",
|
|
33
|
+
"remove-field",
|
|
34
|
+
"retype-field"
|
|
35
|
+
]),
|
|
36
|
+
class: /* @__PURE__ */ new Set([
|
|
37
|
+
"add-field",
|
|
38
|
+
"remove-field",
|
|
39
|
+
"rename-field",
|
|
40
|
+
"retype-field",
|
|
41
|
+
"change-field-optional",
|
|
42
|
+
"add-param",
|
|
43
|
+
"add-generic",
|
|
44
|
+
"remove-generic",
|
|
45
|
+
"constrain-generic",
|
|
46
|
+
"add-extends",
|
|
47
|
+
"remove-extends"
|
|
48
|
+
]),
|
|
49
|
+
enum: /* @__PURE__ */ new Set([
|
|
50
|
+
"add-field",
|
|
51
|
+
"remove-field",
|
|
52
|
+
"rename-field"
|
|
53
|
+
]),
|
|
54
|
+
const: /* @__PURE__ */ new Set([
|
|
55
|
+
"add-var",
|
|
56
|
+
"remove-var",
|
|
57
|
+
"rename-var",
|
|
58
|
+
"change-default"
|
|
59
|
+
]),
|
|
60
|
+
config: /* @__PURE__ */ new Set([
|
|
61
|
+
"set-key",
|
|
62
|
+
"remove-key",
|
|
63
|
+
"rename-key",
|
|
64
|
+
"add-entry",
|
|
65
|
+
"remove-entry",
|
|
66
|
+
"update-entry",
|
|
67
|
+
"bump-version",
|
|
68
|
+
"update-checksum"
|
|
69
|
+
]),
|
|
70
|
+
env: /* @__PURE__ */ new Set([
|
|
71
|
+
"set-key",
|
|
72
|
+
"remove-key",
|
|
73
|
+
"rename-key"
|
|
74
|
+
]),
|
|
75
|
+
schema: /* @__PURE__ */ new Set([
|
|
76
|
+
"add-table",
|
|
77
|
+
"remove-table",
|
|
78
|
+
"add-column",
|
|
79
|
+
"remove-column",
|
|
80
|
+
"rename-column",
|
|
81
|
+
"retype-column",
|
|
82
|
+
"change-nullable",
|
|
83
|
+
"add-index",
|
|
84
|
+
"remove-index"
|
|
85
|
+
]),
|
|
86
|
+
manifest: /* @__PURE__ */ new Set([
|
|
87
|
+
"add-entry",
|
|
88
|
+
"remove-entry",
|
|
89
|
+
"bump-version"
|
|
90
|
+
]),
|
|
91
|
+
doc: /* @__PURE__ */ new Set([
|
|
92
|
+
"add-section",
|
|
93
|
+
"remove-section",
|
|
94
|
+
"rename-section",
|
|
95
|
+
"update-section"
|
|
96
|
+
]),
|
|
97
|
+
"structured-output": /* @__PURE__ */ new Set([]),
|
|
98
|
+
script: /* @__PURE__ */ new Set(/* @__PURE__ */ "add-param.remove-param.rename-param.retype-param.change-param-optional.reorder-params.change-return.add-field.remove-field.rename-field.retype-field.change-field-optional.add-generic.remove-generic.constrain-generic.add-extends.remove-extends.set-key.remove-key.rename-key.add-array-item.remove-array-item.add-var.remove-var.rename-var.change-default.add-section.remove-section.rename-section.update-section.add-table.remove-table.add-column.remove-column.rename-column.retype-column.change-nullable.add-index.remove-index.add-entry.remove-entry.update-entry.bump-version.update-checksum.add-export".split("."))
|
|
128
99
|
};
|
|
129
|
-
function
|
|
130
|
-
|
|
131
|
-
|
|
100
|
+
function n(e, n) {
|
|
101
|
+
let r = t[e];
|
|
102
|
+
return r ? r.has(n) : !1;
|
|
132
103
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/lib/validate.ts
|
|
106
|
+
var r = /* @__PURE__ */ new Set([
|
|
107
|
+
"pending",
|
|
108
|
+
"pending-surfaced",
|
|
109
|
+
"in_progress",
|
|
110
|
+
"complete",
|
|
111
|
+
"failed",
|
|
112
|
+
"skipped"
|
|
113
|
+
]), i = /* @__PURE__ */ new Set([
|
|
114
|
+
"pending",
|
|
115
|
+
"in_progress",
|
|
116
|
+
"complete",
|
|
117
|
+
"failed",
|
|
118
|
+
"skipped"
|
|
119
|
+
]), a = /* @__PURE__ */ new Set([
|
|
120
|
+
"automated",
|
|
121
|
+
"tool-call",
|
|
122
|
+
"generative"
|
|
123
|
+
]), o = /* @__PURE__ */ new Set([
|
|
124
|
+
"anthropic",
|
|
125
|
+
"openai",
|
|
126
|
+
"deepseek",
|
|
127
|
+
"google",
|
|
128
|
+
"local",
|
|
129
|
+
"claudecli",
|
|
130
|
+
"teammate"
|
|
131
|
+
]), s = /* @__PURE__ */ new Set([
|
|
132
|
+
"function",
|
|
133
|
+
"interface",
|
|
134
|
+
"type",
|
|
135
|
+
"class",
|
|
136
|
+
"enum",
|
|
137
|
+
"const",
|
|
138
|
+
"script",
|
|
139
|
+
"config",
|
|
140
|
+
"env",
|
|
141
|
+
"schema",
|
|
142
|
+
"manifest",
|
|
143
|
+
"doc",
|
|
144
|
+
"structured-output"
|
|
168
145
|
]);
|
|
169
|
-
function
|
|
170
|
-
|
|
146
|
+
function c(e) {
|
|
147
|
+
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
171
148
|
}
|
|
172
|
-
function l(
|
|
173
|
-
|
|
149
|
+
function l(e) {
|
|
150
|
+
return typeof e == "string";
|
|
174
151
|
}
|
|
175
|
-
function
|
|
176
|
-
|
|
152
|
+
function u(e, t, n) {
|
|
153
|
+
return {
|
|
154
|
+
path: e,
|
|
155
|
+
message: t,
|
|
156
|
+
value: n
|
|
157
|
+
};
|
|
177
158
|
}
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return m.size !== e.length ? e.filter((o) => !m.has(o)).map((o) => ({ slug: o })) : null;
|
|
159
|
+
function d(e) {
|
|
160
|
+
let t = Object.keys(e), n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
|
|
161
|
+
for (let e of t) n.set(e, 0), r.set(e, []);
|
|
162
|
+
for (let i of t) for (let t of e[i]?.depends_on ?? []) e[t] && (r.get(t)?.push(i), n.set(i, (n.get(i) ?? 0) + 1));
|
|
163
|
+
let i = t.filter((e) => (n.get(e) ?? 0) === 0), a = /* @__PURE__ */ new Set();
|
|
164
|
+
for (; i.length > 0;) {
|
|
165
|
+
let e = i.shift();
|
|
166
|
+
if (e !== void 0) {
|
|
167
|
+
a.add(e);
|
|
168
|
+
for (let t of r.get(e) ?? []) {
|
|
169
|
+
let e = (n.get(t) ?? 1) - 1;
|
|
170
|
+
n.set(t, e), e === 0 && i.push(t);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return a.size === t.length ? null : t.filter((e) => !a.has(e)).map((e) => ({ slug: e }));
|
|
198
175
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
), typeof c.output_tokens != "number" && e.push(
|
|
221
|
-
n(`${o}.output_tokens`, "must be a number", c.output_tokens)
|
|
222
|
-
), l(c.t) || e.push(n(`${o}.t`, "must be a string", c.t));
|
|
223
|
-
const i = c.model_calls;
|
|
224
|
-
i != null && typeof i != "number" && e.push(
|
|
225
|
-
n(
|
|
226
|
-
`${o}.model_calls`,
|
|
227
|
-
"must be a number or null if present",
|
|
228
|
-
i
|
|
229
|
-
)
|
|
230
|
-
);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
176
|
+
function f(e, t) {
|
|
177
|
+
for (let n of e) {
|
|
178
|
+
if (!c(n)) continue;
|
|
179
|
+
let e = l(n.id) ? n.id : "?", r = n.provider;
|
|
180
|
+
(!l(r) || !o.has(r)) && t.push(u(`dispatch_log[${e}].provider`, "invalid provider", r));
|
|
181
|
+
let i = n.turns;
|
|
182
|
+
if (!Array.isArray(i)) {
|
|
183
|
+
t.push(u(`dispatch_log[${e}].turns`, "must be an array", i));
|
|
184
|
+
continue;
|
|
185
|
+
}
|
|
186
|
+
for (let n = 0; n < i.length; n++) {
|
|
187
|
+
let r = i[n], a = `dispatch_log[${e}].turns[${n}]`;
|
|
188
|
+
if (!c(r)) {
|
|
189
|
+
t.push(u(a, "must be an object", r));
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
(typeof r.turn != "number" || !Number.isInteger(r.turn) || r.turn < 1) && t.push(u(`${a}.turn`, "must be a positive integer", r.turn)), typeof r.input_tokens != "number" && t.push(u(`${a}.input_tokens`, "must be a number", r.input_tokens)), typeof r.output_tokens != "number" && t.push(u(`${a}.output_tokens`, "must be a number", r.output_tokens)), l(r.t) || t.push(u(`${a}.t`, "must be a string", r.t));
|
|
193
|
+
let o = r.model_calls;
|
|
194
|
+
o != null && typeof o != "number" && t.push(u(`${a}.model_calls`, "must be a number or null if present", o));
|
|
195
|
+
}
|
|
196
|
+
}
|
|
233
197
|
}
|
|
234
|
-
function
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (!l(b)) {
|
|
337
|
-
e.push(n("operations[?]", "missing/invalid id", b));
|
|
338
|
-
continue;
|
|
339
|
-
}
|
|
340
|
-
const f = b;
|
|
341
|
-
i.add(f);
|
|
342
|
-
const y = s.milestone;
|
|
343
|
-
l(y) ? d.has(y) || e.push(
|
|
344
|
-
n(`operations[${f}].milestone`, `unknown milestone "${y}"`)
|
|
345
|
-
) : e.push(
|
|
346
|
-
n(`operations[${f}].milestone`, "required string", y)
|
|
347
|
-
);
|
|
348
|
-
const _ = s.type;
|
|
349
|
-
l(_) && !D.has(_) && e.push(n(`operations[${f}].type`, "invalid type", _));
|
|
350
|
-
const v = s.shape;
|
|
351
|
-
if (h(v)) {
|
|
352
|
-
const g = v.kind;
|
|
353
|
-
g != null && l(g) && !E.has(g) && e.push(
|
|
354
|
-
n(`operations[${f}].shape.kind`, "invalid shape kind", g)
|
|
355
|
-
);
|
|
356
|
-
const $ = v.ops;
|
|
357
|
-
if (Array.isArray($) && l(g))
|
|
358
|
-
for (let w = 0; w < $.length; w++) {
|
|
359
|
-
const A = $[w];
|
|
360
|
-
if (!h(A))
|
|
361
|
-
continue;
|
|
362
|
-
const k = A.op;
|
|
363
|
-
l(k) && !j(g, k) && e.push(
|
|
364
|
-
n(
|
|
365
|
-
`operations[${f}].shape.ops[${w}]`,
|
|
366
|
-
`op "${k}" not valid for kind "${g}"`
|
|
367
|
-
)
|
|
368
|
-
);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
Array.isArray(s.depends_on) || e.push(
|
|
372
|
-
n(
|
|
373
|
-
`operations[${f}].depends_on`,
|
|
374
|
-
"must be an array",
|
|
375
|
-
s.depends_on
|
|
376
|
-
)
|
|
377
|
-
);
|
|
378
|
-
}
|
|
379
|
-
for (const s of u) {
|
|
380
|
-
if (!h(s))
|
|
381
|
-
continue;
|
|
382
|
-
const b = s.id;
|
|
383
|
-
if (!l(b))
|
|
384
|
-
continue;
|
|
385
|
-
const f = s.depends_on;
|
|
386
|
-
if (Array.isArray(f))
|
|
387
|
-
for (const y of f)
|
|
388
|
-
l(y) && !i.has(y) && e.push(
|
|
389
|
-
n(
|
|
390
|
-
`operations[${b}].depends_on`,
|
|
391
|
-
`unknown operation "${y}"`
|
|
392
|
-
)
|
|
393
|
-
);
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
}
|
|
397
|
-
return { valid: e.length === 0, errors: e };
|
|
198
|
+
function p(e) {
|
|
199
|
+
let t = [];
|
|
200
|
+
if (!c(e)) return {
|
|
201
|
+
valid: !1,
|
|
202
|
+
errors: [u("", "root must be an object")]
|
|
203
|
+
};
|
|
204
|
+
for (let n of [
|
|
205
|
+
"description",
|
|
206
|
+
"problem",
|
|
207
|
+
"approach",
|
|
208
|
+
"executor"
|
|
209
|
+
]) {
|
|
210
|
+
let r = e[n];
|
|
211
|
+
(!l(r) || r.trim() === "") && t.push(u(n, "required string field missing/empty", r));
|
|
212
|
+
}
|
|
213
|
+
typeof e.schema_version != "number" && t.push(u("schema_version", "must be a number", e.schema_version));
|
|
214
|
+
let r = e.plan_kind;
|
|
215
|
+
r !== "brownfield" && r !== "greenfield" && t.push(u("plan_kind", "must be \"brownfield\" or \"greenfield\"", r)), Array.isArray(e.phases) ? e.phases.length === 0 && t.push(u("phases", "must have at least one entry")) : t.push(u("phases", "must be an array", e.phases));
|
|
216
|
+
let i = e.terminal;
|
|
217
|
+
!l(i) && !Array.isArray(i) && t.push(u("terminal", "must be a string or array", i)), Array.isArray(e.dispatch_log) ? f(e.dispatch_log, t) : t.push(u("dispatch_log", "must be an array", e.dispatch_log)), c(e.optimization) || t.push(u("optimization", "must be an object", e.optimization)), c(e.providers) || t.push(u("providers", "must be an object", e.providers)), c(e.effort_max_tokens) || t.push(u("effort_max_tokens", "must be an object", e.effort_max_tokens));
|
|
218
|
+
let o = e.milestones;
|
|
219
|
+
if (!c(o)) t.push(u("milestones", "must be an object", o));
|
|
220
|
+
else {
|
|
221
|
+
let r = Object.keys(o);
|
|
222
|
+
r.length === 0 && t.push(u("milestones", "must have at least one entry"));
|
|
223
|
+
let f = new Set(r);
|
|
224
|
+
for (let e of r) {
|
|
225
|
+
let n = o[e];
|
|
226
|
+
if (!c(n)) {
|
|
227
|
+
t.push(u(`milestones.${e}`, "must be an object", n));
|
|
228
|
+
continue;
|
|
229
|
+
}
|
|
230
|
+
if ((!l(n.description) || n.description.trim() === "") && t.push(u(`milestones.${e}.description`, "required string", n.description)), !Array.isArray(n.depends_on)) t.push(u(`milestones.${e}.depends_on`, "must be an array", n.depends_on));
|
|
231
|
+
else for (let r of n.depends_on) l(r) ? f.has(r) || t.push(u(`milestones.${e}.depends_on`, `unknown milestone "${r}"`)) : t.push(u(`milestones.${e}.depends_on[]`, "must be a string", r));
|
|
232
|
+
let r = n.phase;
|
|
233
|
+
(!l(r) || r.trim() === "") && t.push(u(`milestones.${e}.phase`, "required string", r)), (!l(n.authored_by) || n.authored_by.trim() === "") && t.push(u(`milestones.${e}.authored_by`, "required string", n.authored_by));
|
|
234
|
+
let i = n.model;
|
|
235
|
+
i != null && ![
|
|
236
|
+
"Haiku",
|
|
237
|
+
"Sonnet",
|
|
238
|
+
"Opus"
|
|
239
|
+
].includes(i) && t.push(u(`milestones.${e}.model`, "invalid model tier", i));
|
|
240
|
+
let a = n.effort;
|
|
241
|
+
a != null && ![
|
|
242
|
+
"low",
|
|
243
|
+
"medium",
|
|
244
|
+
"high",
|
|
245
|
+
"xhigh",
|
|
246
|
+
"max"
|
|
247
|
+
].includes(a) && t.push(u(`milestones.${e}.effort`, "invalid effort tier", a)), n.two_stage !== void 0 && typeof n.two_stage != "boolean" && t.push(u(`milestones.${e}.two_stage`, "must be a boolean", n.two_stage)), Array.isArray(n.read_only) || t.push(u(`milestones.${e}.read_only`, "must be an array", n.read_only));
|
|
248
|
+
}
|
|
249
|
+
let p = d(o);
|
|
250
|
+
if (p) for (let { slug: e } of p) t.push(u(`milestones.${e}`, "dependency cycle detected"));
|
|
251
|
+
if (l(i) && !f.has(i)) t.push(u("terminal", `unknown milestone "${i}"`));
|
|
252
|
+
else if (Array.isArray(i)) for (let e of i) f.has(e) || t.push(u("terminal[]", `unknown milestone "${e}"`));
|
|
253
|
+
let m = e.operations, h = /* @__PURE__ */ new Set();
|
|
254
|
+
if (!Array.isArray(m) && !c(m)) t.push(u("operations", "must be an array or object", m));
|
|
255
|
+
else {
|
|
256
|
+
let e = Array.isArray(m) ? m : Object.values(m);
|
|
257
|
+
for (let r of e) {
|
|
258
|
+
if (!c(r)) {
|
|
259
|
+
t.push(u("operations[]", "must be an object", r));
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
let e = r.id;
|
|
263
|
+
if (!l(e)) {
|
|
264
|
+
t.push(u("operations[?]", "missing/invalid id", e));
|
|
265
|
+
continue;
|
|
266
|
+
}
|
|
267
|
+
let i = e;
|
|
268
|
+
h.add(i);
|
|
269
|
+
let o = r.milestone;
|
|
270
|
+
l(o) ? f.has(o) || t.push(u(`operations[${i}].milestone`, `unknown milestone "${o}"`)) : t.push(u(`operations[${i}].milestone`, "required string", o));
|
|
271
|
+
let d = r.type;
|
|
272
|
+
l(d) && !a.has(d) && t.push(u(`operations[${i}].type`, "invalid type", d));
|
|
273
|
+
let p = r.shape;
|
|
274
|
+
if (c(p)) {
|
|
275
|
+
let e = p.kind;
|
|
276
|
+
e != null && l(e) && !s.has(e) && t.push(u(`operations[${i}].shape.kind`, "invalid shape kind", e));
|
|
277
|
+
let r = p.ops;
|
|
278
|
+
if (Array.isArray(r) && l(e)) for (let a = 0; a < r.length; a++) {
|
|
279
|
+
let o = r[a];
|
|
280
|
+
if (!c(o)) continue;
|
|
281
|
+
let s = o.op;
|
|
282
|
+
l(s) && !n(e, s) && t.push(u(`operations[${i}].shape.ops[${a}]`, `op "${s}" not valid for kind "${e}"`));
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
Array.isArray(r.depends_on) || t.push(u(`operations[${i}].depends_on`, "must be an array", r.depends_on));
|
|
286
|
+
}
|
|
287
|
+
for (let n of e) {
|
|
288
|
+
if (!c(n)) continue;
|
|
289
|
+
let e = n.id;
|
|
290
|
+
if (!l(e)) continue;
|
|
291
|
+
let r = n.depends_on;
|
|
292
|
+
if (Array.isArray(r)) for (let n of r) l(n) && !h.has(n) && t.push(u(`operations[${e}].depends_on`, `unknown operation "${n}"`));
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return {
|
|
297
|
+
valid: t.length === 0,
|
|
298
|
+
errors: t
|
|
299
|
+
};
|
|
398
300
|
}
|
|
399
|
-
function
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
n(
|
|
465
|
-
`operations[${i}].milestone`,
|
|
466
|
-
`unknown milestone "${u}"`
|
|
467
|
-
)
|
|
468
|
-
);
|
|
469
|
-
const s = o.status;
|
|
470
|
-
(!l(s) || !I.has(s)) && e.push(
|
|
471
|
-
n(
|
|
472
|
-
`operations[${i}].status`,
|
|
473
|
-
"invalid operation status",
|
|
474
|
-
s
|
|
475
|
-
)
|
|
476
|
-
), Array.isArray(o.dispatch_ids) || e.push(
|
|
477
|
-
n(
|
|
478
|
-
`operations[${i}].dispatch_ids`,
|
|
479
|
-
"must be an array",
|
|
480
|
-
o.dispatch_ids
|
|
481
|
-
)
|
|
482
|
-
), typeof o.attempt_count != "number" && e.push(
|
|
483
|
-
n(
|
|
484
|
-
`operations[${i}].attempt_count`,
|
|
485
|
-
"must be a number",
|
|
486
|
-
o.attempt_count
|
|
487
|
-
)
|
|
488
|
-
), Array.isArray(o.blast_radius) || e.push(
|
|
489
|
-
n(
|
|
490
|
-
`operations[${i}].blast_radius`,
|
|
491
|
-
"must be an array",
|
|
492
|
-
o.blast_radius
|
|
493
|
-
)
|
|
494
|
-
);
|
|
495
|
-
}
|
|
496
|
-
const d = t.open_questions;
|
|
497
|
-
if (!Array.isArray(d))
|
|
498
|
-
e.push(n("open_questions", "must be an array", d));
|
|
499
|
-
else
|
|
500
|
-
for (const o of d) {
|
|
501
|
-
if (!h(o))
|
|
502
|
-
continue;
|
|
503
|
-
const i = o.blocking;
|
|
504
|
-
(!l(i) || !p.has(i)) && e.push(
|
|
505
|
-
n("open_questions", `unknown blocking milestone "${i}"`)
|
|
506
|
-
), typeof o.surfaced != "boolean" && e.push(
|
|
507
|
-
n(
|
|
508
|
-
`open_questions[${o.id}]`,
|
|
509
|
-
"surfaced must be boolean",
|
|
510
|
-
o.surfaced
|
|
511
|
-
)
|
|
512
|
-
), typeof o.answered != "boolean" && e.push(
|
|
513
|
-
n(
|
|
514
|
-
`open_questions[${o.id}]`,
|
|
515
|
-
"answered must be boolean",
|
|
516
|
-
o.answered
|
|
517
|
-
)
|
|
518
|
-
);
|
|
519
|
-
}
|
|
520
|
-
const c = t.dispatch_units;
|
|
521
|
-
if (c !== void 0)
|
|
522
|
-
if (!Array.isArray(c))
|
|
523
|
-
e.push(
|
|
524
|
-
n("dispatch_units", "must be an array if present", c)
|
|
525
|
-
);
|
|
526
|
-
else
|
|
527
|
-
for (const o of c) {
|
|
528
|
-
if (!h(o))
|
|
529
|
-
continue;
|
|
530
|
-
const i = o.fits_context_window;
|
|
531
|
-
typeof i != "boolean" && e.push(
|
|
532
|
-
n(
|
|
533
|
-
`dispatch_units[${o.id}]`,
|
|
534
|
-
"fits_context_window must be boolean",
|
|
535
|
-
i
|
|
536
|
-
)
|
|
537
|
-
);
|
|
538
|
-
const u = o.milestones;
|
|
539
|
-
if (Array.isArray(u))
|
|
540
|
-
for (const s of u)
|
|
541
|
-
l(s) && !p.has(s) && e.push(
|
|
542
|
-
n(
|
|
543
|
-
`dispatch_units[${o.id}].milestones`,
|
|
544
|
-
`unknown milestone "${s}"`
|
|
545
|
-
)
|
|
546
|
-
);
|
|
547
|
-
}
|
|
548
|
-
h(t.pairwise_overlap) || e.push(
|
|
549
|
-
n(
|
|
550
|
-
"pairwise_overlap",
|
|
551
|
-
"must be an object",
|
|
552
|
-
t.pairwise_overlap
|
|
553
|
-
)
|
|
554
|
-
);
|
|
555
|
-
}
|
|
556
|
-
return { valid: e.length === 0, errors: e };
|
|
301
|
+
function m(e) {
|
|
302
|
+
let t = [];
|
|
303
|
+
if (!c(e)) return {
|
|
304
|
+
valid: !1,
|
|
305
|
+
errors: [u("", "root must be an object")]
|
|
306
|
+
};
|
|
307
|
+
for (let n of ["snapshot_at", "description"]) l(e[n]) || t.push(u(n, "required string field missing", e[n]));
|
|
308
|
+
l(e.plan) || t.push(u("plan", "required string", e.plan));
|
|
309
|
+
let n = e.milestones;
|
|
310
|
+
if (!c(n)) t.push(u("milestones", "must be an object", n));
|
|
311
|
+
else {
|
|
312
|
+
let a = Object.keys(n), o = new Set(a);
|
|
313
|
+
for (let e of a) {
|
|
314
|
+
let i = n[e];
|
|
315
|
+
if (!c(i)) {
|
|
316
|
+
t.push(u(`milestones.${e}`, "must be an object", i));
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
let a = i.eligible, o = i.pending;
|
|
320
|
+
a === !0 && o != null && t.push(u(`milestones.${e}`, "D-07 violation: eligible=true but pending not null")), typeof a != "boolean" && t.push(u(`milestones.${e}.eligible`, "must be boolean", a));
|
|
321
|
+
let s = i.status;
|
|
322
|
+
(!l(s) || !r.has(s)) && t.push(u(`milestones.${e}.status`, "invalid status", s)), a === !0 && s === "complete" && t.push(u(`milestones.${e}`, "D-07 violation: eligible=true but status is complete"));
|
|
323
|
+
let d = i.wave;
|
|
324
|
+
(typeof d != "number" || !Number.isInteger(d) || d < 0) && t.push(u(`milestones.${e}.wave`, "must be non-negative integer", d));
|
|
325
|
+
let f = i.ki_estimate;
|
|
326
|
+
f != null && typeof f != "number" && t.push(u(`milestones.${e}.ki_estimate`, "must be number|null", f));
|
|
327
|
+
for (let n of ["tokens_estimated", "tokens_actual"]) {
|
|
328
|
+
let r = i[n];
|
|
329
|
+
r != null && typeof r != "number" && t.push(u(`milestones.${e}.${n}`, "must be number|null", r));
|
|
330
|
+
}
|
|
331
|
+
Array.isArray(i.artifacts) || t.push(u(`milestones.${e}.artifacts`, "must be an array", i.artifacts)), typeof i.si_bytes != "number" && t.push(u(`milestones.${e}.si_bytes`, "must be a number", i.si_bytes));
|
|
332
|
+
}
|
|
333
|
+
let s = e.operations;
|
|
334
|
+
if (!Array.isArray(s)) t.push(u("operations", "must be an array", s));
|
|
335
|
+
else for (let e of s) {
|
|
336
|
+
if (!c(e)) continue;
|
|
337
|
+
let n = l(e.id) ? e.id : "?", r = e.milestone;
|
|
338
|
+
l(r) && !o.has(r) && t.push(u(`operations[${n}].milestone`, `unknown milestone "${r}"`));
|
|
339
|
+
let a = e.status;
|
|
340
|
+
(!l(a) || !i.has(a)) && t.push(u(`operations[${n}].status`, "invalid operation status", a)), Array.isArray(e.dispatch_ids) || t.push(u(`operations[${n}].dispatch_ids`, "must be an array", e.dispatch_ids)), typeof e.attempt_count != "number" && t.push(u(`operations[${n}].attempt_count`, "must be a number", e.attempt_count)), Array.isArray(e.blast_radius) || t.push(u(`operations[${n}].blast_radius`, "must be an array", e.blast_radius));
|
|
341
|
+
}
|
|
342
|
+
let d = e.open_questions;
|
|
343
|
+
if (!Array.isArray(d)) t.push(u("open_questions", "must be an array", d));
|
|
344
|
+
else for (let e of d) {
|
|
345
|
+
if (!c(e)) continue;
|
|
346
|
+
let n = e.blocking;
|
|
347
|
+
(!l(n) || !o.has(n)) && t.push(u("open_questions", `unknown blocking milestone "${n}"`)), typeof e.surfaced != "boolean" && t.push(u(`open_questions[${e.id}]`, "surfaced must be boolean", e.surfaced)), typeof e.answered != "boolean" && t.push(u(`open_questions[${e.id}]`, "answered must be boolean", e.answered));
|
|
348
|
+
}
|
|
349
|
+
let f = e.dispatch_units;
|
|
350
|
+
if (f !== void 0) {
|
|
351
|
+
if (!Array.isArray(f)) t.push(u("dispatch_units", "must be an array if present", f));
|
|
352
|
+
else for (let e of f) {
|
|
353
|
+
if (!c(e)) continue;
|
|
354
|
+
let n = e.fits_context_window;
|
|
355
|
+
typeof n != "boolean" && t.push(u(`dispatch_units[${e.id}]`, "fits_context_window must be boolean", n));
|
|
356
|
+
let r = e.milestones;
|
|
357
|
+
if (Array.isArray(r)) for (let n of r) l(n) && !o.has(n) && t.push(u(`dispatch_units[${e.id}].milestones`, `unknown milestone "${n}"`));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
c(e.pairwise_overlap) || t.push(u("pairwise_overlap", "must be an object", e.pairwise_overlap));
|
|
361
|
+
}
|
|
362
|
+
return {
|
|
363
|
+
valid: t.length === 0,
|
|
364
|
+
errors: t
|
|
365
|
+
};
|
|
557
366
|
}
|
|
558
|
-
function
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
throw new Error(
|
|
562
|
-
`DagJson validation failed:
|
|
563
|
-
${e.errors.map((r) => ` ${r.path}: ${r.message}`).join(`
|
|
564
|
-
`)}`
|
|
565
|
-
);
|
|
367
|
+
function h(e) {
|
|
368
|
+
let t = p(e);
|
|
369
|
+
if (!t.valid) throw Error(`DagJson validation failed:\n${t.errors.map((e) => ` ${e.path}: ${e.message}`).join("\n")}`);
|
|
566
370
|
}
|
|
567
|
-
function
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
throw new Error(
|
|
571
|
-
`Snapshot validation failed:
|
|
572
|
-
${e.errors.map((r) => ` ${r.path}: ${r.message}`).join(`
|
|
573
|
-
`)}`
|
|
574
|
-
);
|
|
371
|
+
function g(e) {
|
|
372
|
+
let t = m(e);
|
|
373
|
+
if (!t.valid) throw Error(`Snapshot validation failed:\n${t.errors.map((e) => ` ${e.path}: ${e.message}`).join("\n")}`);
|
|
575
374
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
375
|
+
//#endregion
|
|
376
|
+
//#region src/lib/migrate.ts
|
|
377
|
+
var _ = [{
|
|
378
|
+
from: 2,
|
|
379
|
+
to: 3,
|
|
380
|
+
apply: (e) => {
|
|
381
|
+
!e.milestones && e.nodes && (e.milestones = e.nodes, delete e.nodes);
|
|
382
|
+
let t = e.operations;
|
|
383
|
+
t && typeof t == "object" && !Array.isArray(t) && (e.operations = Object.values(t));
|
|
384
|
+
}
|
|
385
|
+
}, {
|
|
386
|
+
from: 3,
|
|
387
|
+
to: 4,
|
|
388
|
+
apply: (e) => {
|
|
389
|
+
(!e.providers || Object.keys(e.providers).length === 0) && (e.providers = {
|
|
390
|
+
Haiku: {
|
|
391
|
+
type: "claudecli",
|
|
392
|
+
model_id: "claude-haiku-4-5",
|
|
393
|
+
env_secret: null,
|
|
394
|
+
base_url: null,
|
|
395
|
+
timeout_ms: 6e4,
|
|
396
|
+
retry_config: {
|
|
397
|
+
retries: 3,
|
|
398
|
+
min_timeout: 1e3,
|
|
399
|
+
max_timeout: 3e4,
|
|
400
|
+
factor: 2
|
|
401
|
+
}
|
|
402
|
+
},
|
|
403
|
+
Sonnet: {
|
|
404
|
+
type: "claudecli",
|
|
405
|
+
model_id: "claude-sonnet-4-5",
|
|
406
|
+
env_secret: null,
|
|
407
|
+
base_url: null,
|
|
408
|
+
timeout_ms: 12e4,
|
|
409
|
+
retry_config: {
|
|
410
|
+
retries: 3,
|
|
411
|
+
min_timeout: 1e3,
|
|
412
|
+
max_timeout: 3e4,
|
|
413
|
+
factor: 2
|
|
414
|
+
}
|
|
415
|
+
},
|
|
416
|
+
Opus: {
|
|
417
|
+
type: "claudecli",
|
|
418
|
+
model_id: "claude-opus-4-5",
|
|
419
|
+
env_secret: null,
|
|
420
|
+
base_url: null,
|
|
421
|
+
timeout_ms: 3e5,
|
|
422
|
+
retry_config: {
|
|
423
|
+
retries: 3,
|
|
424
|
+
min_timeout: 1e3,
|
|
425
|
+
max_timeout: 3e4,
|
|
426
|
+
factor: 2
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
}), (!e.effort_max_tokens || Object.keys(e.effort_max_tokens).length === 0) && (e.effort_max_tokens = {
|
|
430
|
+
low: 1024,
|
|
431
|
+
medium: 4096,
|
|
432
|
+
high: 8192,
|
|
433
|
+
xhigh: 16384,
|
|
434
|
+
max: 32768
|
|
435
|
+
}), e.optimization ||= {
|
|
436
|
+
sentinel_fanout: {
|
|
437
|
+
enabled: !0,
|
|
438
|
+
write_multiplier: 1.25,
|
|
439
|
+
read_multiplier: .1,
|
|
440
|
+
hit_probability: .9
|
|
441
|
+
},
|
|
442
|
+
b_per_tier: {
|
|
443
|
+
Haiku: 8e3,
|
|
444
|
+
Sonnet: 15e3,
|
|
445
|
+
Opus: 27e3
|
|
446
|
+
},
|
|
447
|
+
context_window_per_tier: {
|
|
448
|
+
Haiku: 16e3,
|
|
449
|
+
Sonnet: 16e3,
|
|
450
|
+
Opus: 32e3
|
|
451
|
+
},
|
|
452
|
+
context_window_override: null,
|
|
453
|
+
b_override: null
|
|
454
|
+
};
|
|
455
|
+
let t = [];
|
|
456
|
+
Array.isArray(e.operations) ? t = e.operations : e.operations && typeof e.operations == "object" && (t = Object.values(e.operations));
|
|
457
|
+
for (let e of t) if (typeof e == "object" && e) {
|
|
458
|
+
let t = e;
|
|
459
|
+
t.type === void 0 && (t.type = "generative"), t.criteria === void 0 && (t.criteria = []), t.tool === void 0 && (t.tool = null), t.args === void 0 && (t.args = null);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}];
|
|
463
|
+
function v(e, t, n) {
|
|
464
|
+
if (e === t) return;
|
|
465
|
+
let r = e;
|
|
466
|
+
for (let e of [..._].sort((e, t) => e.from - t.from)) if (e.from === r && (e.apply(n), r = e.to, r === t)) {
|
|
467
|
+
n.schema_version = t;
|
|
468
|
+
return;
|
|
469
|
+
}
|
|
470
|
+
throw Error(`migrateDag: no path from v${e} to v${t}. Available: [${_.map((e) => `v${e.from}→v${e.to}`).join(", ")}]`);
|
|
672
471
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
z as WRITE_CLASS_ACTIONS,
|
|
676
|
-
P as assertValidDagJson,
|
|
677
|
-
H as assertValidSnapshot,
|
|
678
|
-
j as isValidOpForKind,
|
|
679
|
-
K as migrateDag,
|
|
680
|
-
L as validateDagJson,
|
|
681
|
-
N as validateSnapshot
|
|
682
|
-
};
|
|
472
|
+
//#endregion
|
|
473
|
+
export { t as VALID_OPS_BY_KIND, e as WRITE_CLASS_ACTIONS, h as assertValidDagJson, g as assertValidSnapshot, n as isValidOpForKind, v as migrateDag, p as validateDagJson, m as validateSnapshot };
|