@interf/compiler 0.5.0 → 0.6.1
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/README.md +126 -188
- package/builtin-workflows/interf/README.md +22 -10
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +6 -3
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +3 -0
- package/builtin-workflows/interf/compile/stages/summarize/SKILL.md +18 -2
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/workflow.json +18 -4
- package/builtin-workflows/interf/{compiled.schema.json → workflow.schema.json} +9 -2
- package/dist/commands/check-draft.js +3 -3
- package/dist/commands/compile-controller.js +9 -16
- package/dist/commands/compile.d.ts +19 -1
- package/dist/commands/compile.js +98 -28
- package/dist/commands/create-workflow-wizard.d.ts +20 -2
- package/dist/commands/create-workflow-wizard.js +163 -27
- package/dist/commands/create.d.ts +1 -1
- package/dist/commands/create.js +67 -60
- package/dist/commands/dataset-selection.d.ts +6 -0
- package/dist/commands/dataset-selection.js +11 -0
- package/dist/commands/default.js +3 -3
- package/dist/commands/doctor.js +8 -8
- package/dist/commands/executor-flow.d.ts +1 -1
- package/dist/commands/executor-flow.js +5 -2
- package/dist/commands/init.d.ts +5 -0
- package/dist/commands/init.js +56 -48
- package/dist/commands/list.js +6 -3
- package/dist/commands/reset.js +1 -1
- package/dist/commands/source-config-wizard.d.ts +2 -2
- package/dist/commands/source-config-wizard.js +50 -17
- package/dist/commands/test-flow.js +5 -16
- package/dist/commands/test.d.ts +0 -6
- package/dist/commands/test.js +9 -17
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/lib/agent-args.d.ts +1 -0
- package/dist/lib/agent-args.js +10 -0
- package/dist/lib/agent-execution.js +2 -1
- package/dist/lib/agent-preflight.js +2 -1
- package/dist/lib/agent-shells.d.ts +26 -1
- package/dist/lib/agent-shells.js +214 -40
- package/dist/lib/agents.d.ts +1 -1
- package/dist/lib/agents.js +1 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +38 -0
- package/dist/lib/builtin-compiled-workflow.js +94 -0
- package/dist/lib/compiled-compile.d.ts +0 -4
- package/dist/lib/compiled-compile.js +11 -30
- package/dist/lib/compiled-paths.d.ts +1 -2
- package/dist/lib/compiled-paths.js +8 -13
- package/dist/lib/compiled-raw.d.ts +2 -2
- package/dist/lib/compiled-reset.d.ts +1 -0
- package/dist/lib/compiled-reset.js +42 -14
- package/dist/lib/compiled-schema.d.ts +11 -7
- package/dist/lib/compiled-schema.js +47 -16
- package/dist/lib/discovery.d.ts +1 -1
- package/dist/lib/discovery.js +2 -2
- package/dist/lib/executors.d.ts +1 -1
- package/dist/lib/executors.js +2 -2
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +7 -18
- package/dist/lib/interf-scaffold.js +4 -11
- package/dist/lib/interf-workflow-package.d.ts +8 -3
- package/dist/lib/interf-workflow-package.js +128 -62
- package/dist/lib/interf.d.ts +1 -1
- package/dist/lib/interf.js +1 -1
- package/dist/lib/local-workflows.d.ts +4 -3
- package/dist/lib/local-workflows.js +127 -104
- package/dist/lib/project-paths.d.ts +2 -4
- package/dist/lib/project-paths.js +13 -10
- package/dist/lib/runtime-acceptance.js +15 -3
- package/dist/lib/runtime-contracts.js +3 -2
- package/dist/lib/runtime-paths.d.ts +1 -0
- package/dist/lib/runtime-paths.js +4 -1
- package/dist/lib/runtime-prompt.js +4 -4
- package/dist/lib/runtime-reconcile.js +90 -64
- package/dist/lib/runtime-runs.js +29 -102
- package/dist/lib/runtime.d.ts +1 -1
- package/dist/lib/runtime.js +1 -1
- package/dist/lib/schema.d.ts +104 -54
- package/dist/lib/schema.js +32 -116
- package/dist/lib/source-config.js +21 -22
- package/dist/lib/state-health.js +4 -2
- package/dist/lib/state-io.js +2 -110
- package/dist/lib/state-view.js +8 -8
- package/dist/lib/state.d.ts +1 -0
- package/dist/lib/state.js +7 -0
- package/dist/lib/test-execution.js +2 -2
- package/dist/lib/test-paths.js +12 -3
- package/dist/lib/test-sandbox.js +4 -17
- package/dist/lib/test-specs.js +1 -1
- package/dist/lib/validate-compiled.js +13 -8
- package/dist/lib/validate.d.ts +5 -1
- package/dist/lib/validate.js +30 -22
- package/dist/lib/workflow-authoring.d.ts +26 -0
- package/dist/lib/workflow-authoring.js +119 -0
- package/dist/lib/workflow-definitions.d.ts +14 -3
- package/dist/lib/workflow-definitions.js +21 -17
- package/dist/lib/workflow-edit-session.d.ts +16 -0
- package/dist/lib/workflow-edit-session.js +57 -0
- package/dist/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/lib/workflow-edit-utils.js +39 -0
- package/dist/lib/workflow-improvement.js +30 -217
- package/dist/lib/workflow-primitives.d.ts +2 -0
- package/dist/lib/workflow-primitives.js +5 -0
- package/dist/lib/workflow-stage-policy.d.ts +5 -0
- package/dist/lib/workflow-stage-policy.js +31 -0
- package/package.json +7 -8
- package/dist/lib/compiled-layout.d.ts +0 -2
- package/dist/lib/compiled-layout.js +0 -60
- package/dist/lib/obsidian.d.ts +0 -1
- package/dist/lib/obsidian.js +0 -15
- package/dist/lib/summarize-plan.d.ts +0 -17
- package/dist/lib/summarize-plan.js +0 -124
- package/dist/lib/workflow-abi.d.ts +0 -129
- package/dist/lib/workflow-abi.js +0 -156
package/dist/lib/schema.d.ts
CHANGED
|
@@ -18,6 +18,12 @@ export declare const WorkflowCompiledZoneKindSchema: z.ZodEnum<{
|
|
|
18
18
|
directory: "directory";
|
|
19
19
|
file: "file";
|
|
20
20
|
}>;
|
|
21
|
+
export declare const WorkflowZoneRoleSchema: z.ZodEnum<{
|
|
22
|
+
output: "output";
|
|
23
|
+
runtime: "runtime";
|
|
24
|
+
input: "input";
|
|
25
|
+
working: "working";
|
|
26
|
+
}>;
|
|
21
27
|
export declare const CompiledStageStatusSchema: z.ZodEnum<{
|
|
22
28
|
idle: "idle";
|
|
23
29
|
running: "running";
|
|
@@ -61,21 +67,9 @@ export declare const CompiledStateSchema: z.ZodObject<{
|
|
|
61
67
|
}, z.core.$strip>>>;
|
|
62
68
|
last_add: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
69
|
last_compile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
64
|
-
summarized: z.ZodOptional<z.ZodNumber>;
|
|
65
|
-
structured: z.ZodOptional<z.ZodNumber>;
|
|
66
|
-
shaped: z.ZodOptional<z.ZodNumber>;
|
|
67
|
-
compiled: z.ZodOptional<z.ZodNumber>;
|
|
68
|
-
last_summarize: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
69
|
-
last_structure: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
70
|
-
last_shape: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
-
inventory_complete: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
-
abstracts_read: z.ZodOptional<z.ZodNumber>;
|
|
73
|
-
full_reads: z.ZodOptional<z.ZodNumber>;
|
|
74
|
-
entity_count: z.ZodOptional<z.ZodNumber>;
|
|
75
|
-
claim_count: z.ZodOptional<z.ZodNumber>;
|
|
76
70
|
warning_count: z.ZodOptional<z.ZodNumber>;
|
|
77
71
|
error_count: z.ZodOptional<z.ZodNumber>;
|
|
78
|
-
}, z.core.$
|
|
72
|
+
}, z.core.$strict>;
|
|
79
73
|
export declare const ViewSectionSchema: z.ZodObject<{
|
|
80
74
|
id: z.ZodString;
|
|
81
75
|
type: z.ZodEnum<{
|
|
@@ -165,8 +159,36 @@ export declare const CompiledRawSnapshotSchema: z.ZodObject<{
|
|
|
165
159
|
source_total: z.ZodNumber;
|
|
166
160
|
sample_files: z.ZodArray<z.ZodString>;
|
|
167
161
|
}, z.core.$strip>;
|
|
162
|
+
export declare const WorkflowPurposeSchema: z.ZodObject<{
|
|
163
|
+
label: z.ZodString;
|
|
164
|
+
task_hint: z.ZodString;
|
|
165
|
+
}, z.core.$strict>;
|
|
166
|
+
export declare const WorkflowZoneSchema: z.ZodObject<{
|
|
167
|
+
id: z.ZodString;
|
|
168
|
+
role: z.ZodEnum<{
|
|
169
|
+
output: "output";
|
|
170
|
+
runtime: "runtime";
|
|
171
|
+
input: "input";
|
|
172
|
+
working: "working";
|
|
173
|
+
}>;
|
|
174
|
+
path: z.ZodString;
|
|
175
|
+
kind: z.ZodEnum<{
|
|
176
|
+
runtime: "runtime";
|
|
177
|
+
directory: "directory";
|
|
178
|
+
file: "file";
|
|
179
|
+
}>;
|
|
180
|
+
required: z.ZodBoolean;
|
|
181
|
+
owned_by: z.ZodArray<z.ZodString>;
|
|
182
|
+
description: z.ZodString;
|
|
183
|
+
}, z.core.$strip>;
|
|
168
184
|
export declare const WorkflowCompiledZoneSchema: z.ZodObject<{
|
|
169
185
|
id: z.ZodString;
|
|
186
|
+
role: z.ZodEnum<{
|
|
187
|
+
output: "output";
|
|
188
|
+
runtime: "runtime";
|
|
189
|
+
input: "input";
|
|
190
|
+
working: "working";
|
|
191
|
+
}>;
|
|
170
192
|
path: z.ZodString;
|
|
171
193
|
kind: z.ZodEnum<{
|
|
172
194
|
runtime: "runtime";
|
|
@@ -177,13 +199,43 @@ export declare const WorkflowCompiledZoneSchema: z.ZodObject<{
|
|
|
177
199
|
owned_by: z.ZodArray<z.ZodString>;
|
|
178
200
|
description: z.ZodString;
|
|
179
201
|
}, z.core.$strip>;
|
|
202
|
+
export declare const WorkflowSchemaSchema: z.ZodObject<{
|
|
203
|
+
kind: z.ZodLiteral<"workflow-schema">;
|
|
204
|
+
version: z.ZodLiteral<1>;
|
|
205
|
+
target_type: z.ZodLiteral<"compiled">;
|
|
206
|
+
label: z.ZodString;
|
|
207
|
+
zones: z.ZodArray<z.ZodObject<{
|
|
208
|
+
id: z.ZodString;
|
|
209
|
+
role: z.ZodEnum<{
|
|
210
|
+
output: "output";
|
|
211
|
+
runtime: "runtime";
|
|
212
|
+
input: "input";
|
|
213
|
+
working: "working";
|
|
214
|
+
}>;
|
|
215
|
+
path: z.ZodString;
|
|
216
|
+
kind: z.ZodEnum<{
|
|
217
|
+
runtime: "runtime";
|
|
218
|
+
directory: "directory";
|
|
219
|
+
file: "file";
|
|
220
|
+
}>;
|
|
221
|
+
required: z.ZodBoolean;
|
|
222
|
+
owned_by: z.ZodArray<z.ZodString>;
|
|
223
|
+
description: z.ZodString;
|
|
224
|
+
}, z.core.$strip>>;
|
|
225
|
+
}, z.core.$strip>;
|
|
180
226
|
export declare const WorkflowCompiledSchemaSchema: z.ZodObject<{
|
|
181
|
-
kind: z.ZodLiteral<"
|
|
227
|
+
kind: z.ZodLiteral<"workflow-schema">;
|
|
182
228
|
version: z.ZodLiteral<1>;
|
|
183
229
|
target_type: z.ZodLiteral<"compiled">;
|
|
184
230
|
label: z.ZodString;
|
|
185
231
|
zones: z.ZodArray<z.ZodObject<{
|
|
186
232
|
id: z.ZodString;
|
|
233
|
+
role: z.ZodEnum<{
|
|
234
|
+
output: "output";
|
|
235
|
+
runtime: "runtime";
|
|
236
|
+
input: "input";
|
|
237
|
+
working: "working";
|
|
238
|
+
}>;
|
|
187
239
|
path: z.ZodString;
|
|
188
240
|
kind: z.ZodEnum<{
|
|
189
241
|
runtime: "runtime";
|
|
@@ -242,7 +294,7 @@ export declare const RuntimeExecutorInfoSchema: z.ZodObject<{
|
|
|
242
294
|
profile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
295
|
timeout_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
244
296
|
}, z.core.$strip>;
|
|
245
|
-
export declare const RuntimeStageInstructionsSchema: z.
|
|
297
|
+
export declare const RuntimeStageInstructionsSchema: z.ZodObject<{
|
|
246
298
|
stage_skill_dir: z.ZodString;
|
|
247
299
|
effective_mode: z.ZodEnum<{
|
|
248
300
|
builtin: "builtin";
|
|
@@ -255,8 +307,8 @@ export declare const RuntimeStageInstructionsSchema: z.ZodPipe<z.ZodTransform<un
|
|
|
255
307
|
}>>;
|
|
256
308
|
local_docs: z.ZodArray<z.ZodString>;
|
|
257
309
|
mode_sources: z.ZodArray<z.ZodString>;
|
|
258
|
-
}, z.core.$
|
|
259
|
-
export declare const RuntimeStageAcceptanceSchema: z.
|
|
310
|
+
}, z.core.$strict>;
|
|
311
|
+
export declare const RuntimeStageAcceptanceSchema: z.ZodObject<{
|
|
260
312
|
artifacts_exist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
261
313
|
stage_truthy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
262
314
|
stage_equals_counts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -265,10 +317,11 @@ export declare const RuntimeStageAcceptanceSchema: z.ZodPipe<z.ZodTransform<unkn
|
|
|
265
317
|
zone_counts_at_least: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
266
318
|
zone_counts_at_least_counts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
267
319
|
markdown_frontmatter_valid_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
320
|
+
frontmatter_required_keys_in_zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
268
321
|
markdown_abstract_valid_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
269
322
|
wikilinks_valid_in_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
270
323
|
artifacts_must_not_contain: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
271
|
-
}, z.core.$
|
|
324
|
+
}, z.core.$strict>;
|
|
272
325
|
export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
273
326
|
kind: z.ZodLiteral<"interf-stage-contract">;
|
|
274
327
|
version: z.ZodLiteral<1>;
|
|
@@ -301,7 +354,7 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
301
354
|
profile: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
302
355
|
timeout_ms: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
303
356
|
}, z.core.$strip>;
|
|
304
|
-
instructions: z.
|
|
357
|
+
instructions: z.ZodObject<{
|
|
305
358
|
stage_skill_dir: z.ZodString;
|
|
306
359
|
effective_mode: z.ZodEnum<{
|
|
307
360
|
builtin: "builtin";
|
|
@@ -314,9 +367,9 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
314
367
|
}>>;
|
|
315
368
|
local_docs: z.ZodArray<z.ZodString>;
|
|
316
369
|
mode_sources: z.ZodArray<z.ZodString>;
|
|
317
|
-
}, z.core.$
|
|
370
|
+
}, z.core.$strict>;
|
|
318
371
|
counts: z.ZodRecord<z.ZodString, z.ZodNumber>;
|
|
319
|
-
acceptance: z.ZodOptional<z.
|
|
372
|
+
acceptance: z.ZodOptional<z.ZodObject<{
|
|
320
373
|
artifacts_exist: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
321
374
|
stage_truthy: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
322
375
|
stage_equals_counts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
@@ -325,10 +378,11 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
325
378
|
zone_counts_at_least: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
326
379
|
zone_counts_at_least_counts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
327
380
|
markdown_frontmatter_valid_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
381
|
+
frontmatter_required_keys_in_zones: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
328
382
|
markdown_abstract_valid_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
329
383
|
wikilinks_valid_in_zones: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
330
384
|
artifacts_must_not_contain: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString>>>;
|
|
331
|
-
}, z.core.$
|
|
385
|
+
}, z.core.$strict>>;
|
|
332
386
|
artifacts: z.ZodObject<{
|
|
333
387
|
reads: z.ZodArray<z.ZodString>;
|
|
334
388
|
writes: z.ZodArray<z.ZodString>;
|
|
@@ -395,26 +449,26 @@ export declare const RuntimeRunSchema: z.ZodObject<{
|
|
|
395
449
|
exit_code: z.ZodNullable<z.ZodNumber>;
|
|
396
450
|
error: z.ZodNullable<z.ZodString>;
|
|
397
451
|
}, z.core.$strip>;
|
|
398
|
-
export declare const CompiledInventoryEntrySchema: z.
|
|
399
|
-
input_zone: z.ZodString
|
|
400
|
-
input_path: z.ZodString
|
|
452
|
+
export declare const CompiledInventoryEntrySchema: z.ZodObject<{
|
|
453
|
+
input_zone: z.ZodOptional<z.ZodString>;
|
|
454
|
+
input_path: z.ZodOptional<z.ZodString>;
|
|
401
455
|
output_zone: z.ZodString;
|
|
402
456
|
output_path: z.ZodString;
|
|
403
457
|
state: z.ZodOptional<z.ZodString>;
|
|
404
458
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
405
|
-
}, z.core.$
|
|
459
|
+
}, z.core.$strict>;
|
|
406
460
|
export declare const CompiledInventorySchema: z.ZodObject<{
|
|
407
461
|
kind: z.ZodOptional<z.ZodLiteral<"compiled-runtime-ledger">>;
|
|
408
462
|
version: z.ZodOptional<z.ZodNumber>;
|
|
409
463
|
stage: z.ZodOptional<z.ZodString>;
|
|
410
|
-
entries: z.ZodArray<z.
|
|
411
|
-
input_zone: z.ZodString
|
|
412
|
-
input_path: z.ZodString
|
|
464
|
+
entries: z.ZodArray<z.ZodObject<{
|
|
465
|
+
input_zone: z.ZodOptional<z.ZodString>;
|
|
466
|
+
input_path: z.ZodOptional<z.ZodString>;
|
|
413
467
|
output_zone: z.ZodString;
|
|
414
468
|
output_path: z.ZodString;
|
|
415
469
|
state: z.ZodOptional<z.ZodString>;
|
|
416
470
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
417
|
-
}, z.core.$
|
|
471
|
+
}, z.core.$strict>>;
|
|
418
472
|
total: z.ZodNumber;
|
|
419
473
|
}, z.core.$strip>;
|
|
420
474
|
export declare const TestCaseExpectSchema: z.ZodObject<{
|
|
@@ -424,7 +478,7 @@ export declare const TestCaseExpectSchema: z.ZodObject<{
|
|
|
424
478
|
min_words: z.ZodOptional<z.ZodNumber>;
|
|
425
479
|
max_words: z.ZodOptional<z.ZodNumber>;
|
|
426
480
|
}, z.core.$strip>;
|
|
427
|
-
export declare const TestCaseSchema: z.
|
|
481
|
+
export declare const TestCaseSchema: z.ZodObject<{
|
|
428
482
|
id: z.ZodString;
|
|
429
483
|
question: z.ZodString;
|
|
430
484
|
file: z.ZodOptional<z.ZodString>;
|
|
@@ -437,15 +491,15 @@ export declare const TestCaseSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>,
|
|
|
437
491
|
max_words: z.ZodOptional<z.ZodNumber>;
|
|
438
492
|
}, z.core.$strip>>;
|
|
439
493
|
strictness: z.ZodOptional<z.ZodString>;
|
|
440
|
-
}, z.core.$strip
|
|
441
|
-
export declare const TestSpecSchema: z.
|
|
494
|
+
}, z.core.$strip>;
|
|
495
|
+
export declare const TestSpecSchema: z.ZodObject<{
|
|
442
496
|
type: z.ZodEnum<{
|
|
443
497
|
compiled: "compiled";
|
|
444
498
|
raw: "raw";
|
|
445
499
|
}>;
|
|
446
500
|
name: z.ZodString;
|
|
447
501
|
description: z.ZodOptional<z.ZodString>;
|
|
448
|
-
cases: z.ZodArray<z.
|
|
502
|
+
cases: z.ZodArray<z.ZodObject<{
|
|
449
503
|
id: z.ZodString;
|
|
450
504
|
question: z.ZodString;
|
|
451
505
|
file: z.ZodOptional<z.ZodString>;
|
|
@@ -458,8 +512,8 @@ export declare const TestSpecSchema: z.ZodPipe<z.ZodTransform<unknown, unknown>,
|
|
|
458
512
|
max_words: z.ZodOptional<z.ZodNumber>;
|
|
459
513
|
}, z.core.$strip>>;
|
|
460
514
|
strictness: z.ZodOptional<z.ZodString>;
|
|
461
|
-
}, z.core.$strip
|
|
462
|
-
}, z.core.$strip
|
|
515
|
+
}, z.core.$strip>>;
|
|
516
|
+
}, z.core.$strip>;
|
|
463
517
|
export declare const SourceTruthCheckSchema: z.ZodObject<{
|
|
464
518
|
id: z.ZodOptional<z.ZodString>;
|
|
465
519
|
question: z.ZodString;
|
|
@@ -476,10 +530,10 @@ export declare const SourceTruthCheckSchema: z.ZodObject<{
|
|
|
476
530
|
export declare const SourceCompiledMaxAttemptsSchema: z.ZodNumber;
|
|
477
531
|
export declare const SourceCompiledMaxLoopsSchema: z.ZodNumber;
|
|
478
532
|
export declare const DatasetNameSchema: z.ZodString;
|
|
479
|
-
export declare const SourceDatasetConfigSchema: z.
|
|
533
|
+
export declare const SourceDatasetConfigSchema: z.ZodObject<{
|
|
480
534
|
id: z.ZodOptional<z.ZodString>;
|
|
481
535
|
name: z.ZodString;
|
|
482
|
-
path: z.ZodString
|
|
536
|
+
path: z.ZodDefault<z.ZodString>;
|
|
483
537
|
about: z.ZodOptional<z.ZodString>;
|
|
484
538
|
workflow: z.ZodOptional<z.ZodString>;
|
|
485
539
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
@@ -497,12 +551,12 @@ export declare const SourceDatasetConfigSchema: z.ZodPipe<z.ZodTransform<unknown
|
|
|
497
551
|
}, z.core.$strip>>;
|
|
498
552
|
strictness: z.ZodOptional<z.ZodString>;
|
|
499
553
|
}, z.core.$strict>>>;
|
|
500
|
-
}, z.core.$strict
|
|
501
|
-
export declare const CompiledInterfConfigSchema: z.
|
|
554
|
+
}, z.core.$strict>;
|
|
555
|
+
export declare const CompiledInterfConfigSchema: z.ZodObject<{
|
|
502
556
|
type: z.ZodLiteral<"compiled">;
|
|
503
557
|
name: z.ZodString;
|
|
504
558
|
about: z.ZodOptional<z.ZodString>;
|
|
505
|
-
workflow: z.
|
|
559
|
+
workflow: z.ZodString;
|
|
506
560
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
507
561
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
508
562
|
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -525,14 +579,14 @@ export declare const CompiledInterfConfigSchema: z.ZodPipe<z.ZodTransform<unknow
|
|
|
525
579
|
source: z.ZodObject<{
|
|
526
580
|
path: z.ZodString;
|
|
527
581
|
control_path: z.ZodOptional<z.ZodString>;
|
|
528
|
-
dataset_path: z.
|
|
582
|
+
dataset_path: z.ZodString;
|
|
529
583
|
}, z.core.$strip>;
|
|
530
|
-
}, z.core.$loose
|
|
531
|
-
export declare const InterfConfigSchema: z.
|
|
584
|
+
}, z.core.$loose>;
|
|
585
|
+
export declare const InterfConfigSchema: z.ZodObject<{
|
|
532
586
|
type: z.ZodLiteral<"compiled">;
|
|
533
587
|
name: z.ZodString;
|
|
534
588
|
about: z.ZodOptional<z.ZodString>;
|
|
535
|
-
workflow: z.
|
|
589
|
+
workflow: z.ZodString;
|
|
536
590
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
537
591
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
538
592
|
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -555,9 +609,9 @@ export declare const InterfConfigSchema: z.ZodPipe<z.ZodTransform<unknown, unkno
|
|
|
555
609
|
source: z.ZodObject<{
|
|
556
610
|
path: z.ZodString;
|
|
557
611
|
control_path: z.ZodOptional<z.ZodString>;
|
|
558
|
-
dataset_path: z.
|
|
612
|
+
dataset_path: z.ZodString;
|
|
559
613
|
}, z.core.$strip>;
|
|
560
|
-
}, z.core.$loose
|
|
614
|
+
}, z.core.$loose>;
|
|
561
615
|
export declare const WorkflowImprovementLoopSummarySchema: z.ZodObject<{
|
|
562
616
|
variation: z.ZodNumber;
|
|
563
617
|
kind: z.ZodEnum<{
|
|
@@ -734,10 +788,10 @@ export type WorkflowPackageValidation = z.infer<typeof WorkflowPackageValidation
|
|
|
734
788
|
export type WorkflowImprovementLoopRecord = z.infer<typeof WorkflowImprovementLoopRecordSchema>;
|
|
735
789
|
export type WorkflowImprovementRunLedger = z.infer<typeof WorkflowImprovementRunLedgerSchema>;
|
|
736
790
|
export declare const SourceFolderConfigSchema: z.ZodObject<{
|
|
737
|
-
datasets: z.ZodOptional<z.ZodArray<z.
|
|
791
|
+
datasets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
738
792
|
id: z.ZodOptional<z.ZodString>;
|
|
739
793
|
name: z.ZodString;
|
|
740
|
-
path: z.ZodString
|
|
794
|
+
path: z.ZodDefault<z.ZodString>;
|
|
741
795
|
about: z.ZodOptional<z.ZodString>;
|
|
742
796
|
workflow: z.ZodOptional<z.ZodString>;
|
|
743
797
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
@@ -755,7 +809,7 @@ export declare const SourceFolderConfigSchema: z.ZodObject<{
|
|
|
755
809
|
}, z.core.$strip>>;
|
|
756
810
|
strictness: z.ZodOptional<z.ZodString>;
|
|
757
811
|
}, z.core.$strict>>>;
|
|
758
|
-
}, z.core.$strict
|
|
812
|
+
}, z.core.$strict>>>;
|
|
759
813
|
}, z.core.$strict>;
|
|
760
814
|
export declare const TestCheckResultSchema: z.ZodObject<{
|
|
761
815
|
label: z.ZodString;
|
|
@@ -974,10 +1028,6 @@ export declare const InterfUserConfigSchema: z.ZodObject<{
|
|
|
974
1028
|
agent: z.ZodString;
|
|
975
1029
|
agentCommand: z.ZodString;
|
|
976
1030
|
skillsInstalled: z.ZodBoolean;
|
|
977
|
-
viewer: z.ZodOptional<z.ZodEnum<{
|
|
978
|
-
plain: "plain";
|
|
979
|
-
obsidian: "obsidian";
|
|
980
|
-
}>>;
|
|
981
1031
|
initialized: z.ZodString;
|
|
982
1032
|
}, z.core.$strip>;
|
|
983
1033
|
export type InterfConfig = z.infer<typeof InterfConfigSchema>;
|
package/dist/lib/schema.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { COMPILED_ZONE_KINDS, } from "./workflow-
|
|
2
|
+
import { COMPILED_ZONE_KINDS, } from "./workflow-primitives.js";
|
|
3
3
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
4
4
|
const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
|
|
5
5
|
function isCompiledRelativePath(value) {
|
|
@@ -19,6 +19,7 @@ export const RuntimeContractTypeSchema = z.string().regex(WorkflowIdPattern);
|
|
|
19
19
|
export const WorkflowIdSchema = z.string().regex(WorkflowIdPattern);
|
|
20
20
|
export const WorkflowZoneIdSchema = z.string().regex(WorkflowIdPattern);
|
|
21
21
|
export const WorkflowCompiledZoneKindSchema = z.enum(COMPILED_ZONE_KINDS);
|
|
22
|
+
export const WorkflowZoneRoleSchema = z.enum(["input", "working", "output", "runtime"]);
|
|
22
23
|
export const CompiledStageStatusSchema = z.enum(["idle", "running", "succeeded", "failed"]);
|
|
23
24
|
export const CompiledStageStateSchema = z.object({
|
|
24
25
|
contract_type: RuntimeContractTypeSchema.optional(),
|
|
@@ -37,21 +38,9 @@ export const CompiledStateSchema = z.object({
|
|
|
37
38
|
stages: z.record(z.string().regex(WorkflowIdPattern), CompiledStageStateSchema).optional(),
|
|
38
39
|
last_add: z.string().nullable().optional(),
|
|
39
40
|
last_compile: z.string().nullable().optional(),
|
|
40
|
-
summarized: z.number().optional(),
|
|
41
|
-
structured: z.number().optional(),
|
|
42
|
-
shaped: z.number().optional(),
|
|
43
|
-
compiled: z.number().optional(),
|
|
44
|
-
last_summarize: z.string().nullable().optional(),
|
|
45
|
-
last_structure: z.string().nullable().optional(),
|
|
46
|
-
last_shape: z.string().nullable().optional(),
|
|
47
|
-
inventory_complete: z.boolean().optional(),
|
|
48
|
-
abstracts_read: z.number().optional(),
|
|
49
|
-
full_reads: z.number().optional(),
|
|
50
|
-
entity_count: z.number().optional(),
|
|
51
|
-
claim_count: z.number().optional(),
|
|
52
41
|
warning_count: z.number().optional(),
|
|
53
42
|
error_count: z.number().optional(),
|
|
54
|
-
});
|
|
43
|
+
}).strict();
|
|
55
44
|
export const ViewSectionSchema = z.object({
|
|
56
45
|
id: z.string(),
|
|
57
46
|
type: z.enum(["status", "cards", "graph", "documents", "table"]),
|
|
@@ -102,8 +91,13 @@ export const CompiledRawSnapshotSchema = z.object({
|
|
|
102
91
|
source_total: z.number(),
|
|
103
92
|
sample_files: z.array(z.string()),
|
|
104
93
|
});
|
|
105
|
-
export const
|
|
94
|
+
export const WorkflowPurposeSchema = z.object({
|
|
95
|
+
label: z.string().min(1),
|
|
96
|
+
task_hint: z.string().min(1),
|
|
97
|
+
}).strict();
|
|
98
|
+
export const WorkflowZoneSchema = z.object({
|
|
106
99
|
id: WorkflowZoneIdSchema,
|
|
100
|
+
role: WorkflowZoneRoleSchema,
|
|
107
101
|
path: z.string().min(1).refine(isCompiledRelativePath, {
|
|
108
102
|
message: "Zone paths must stay inside the compiled root",
|
|
109
103
|
}),
|
|
@@ -112,13 +106,15 @@ export const WorkflowCompiledZoneSchema = z.object({
|
|
|
112
106
|
owned_by: z.array(z.string().regex(WorkflowIdPattern)),
|
|
113
107
|
description: z.string().min(1),
|
|
114
108
|
});
|
|
115
|
-
export const
|
|
116
|
-
|
|
109
|
+
export const WorkflowCompiledZoneSchema = WorkflowZoneSchema;
|
|
110
|
+
export const WorkflowSchemaSchema = z.object({
|
|
111
|
+
kind: z.literal("workflow-schema"),
|
|
117
112
|
version: z.literal(1),
|
|
118
113
|
target_type: z.literal("compiled"),
|
|
119
114
|
label: z.string().min(1),
|
|
120
|
-
zones: z.array(
|
|
115
|
+
zones: z.array(WorkflowZoneSchema).min(1),
|
|
121
116
|
});
|
|
117
|
+
export const WorkflowCompiledSchemaSchema = WorkflowSchemaSchema;
|
|
122
118
|
export const WorkflowCompilerApiSchema = z.object({
|
|
123
119
|
kind: z.literal("compiled"),
|
|
124
120
|
version: z.literal(1),
|
|
@@ -149,36 +145,14 @@ export const RuntimeExecutorInfoSchema = z.object({
|
|
|
149
145
|
profile: z.string().nullable().optional(),
|
|
150
146
|
timeout_ms: z.number().nullable().optional(),
|
|
151
147
|
});
|
|
152
|
-
export const RuntimeStageInstructionsSchema = z.
|
|
153
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
154
|
-
return value;
|
|
155
|
-
const raw = value;
|
|
156
|
-
const legacyBundledSkill = typeof raw.bundled_skill === "string" && raw.bundled_skill.length > 0
|
|
157
|
-
? raw.bundled_skill.split(/[\\/]/).filter(Boolean).pop()
|
|
158
|
-
: undefined;
|
|
159
|
-
return {
|
|
160
|
-
...raw,
|
|
161
|
-
stage_skill_dir: raw.stage_skill_dir ?? legacyBundledSkill,
|
|
162
|
-
};
|
|
163
|
-
}, z.object({
|
|
148
|
+
export const RuntimeStageInstructionsSchema = z.object({
|
|
164
149
|
stage_skill_dir: z.string().regex(WorkflowIdPattern),
|
|
165
150
|
effective_mode: z.enum(["builtin", "extend", "override"]),
|
|
166
151
|
local_mode: z.enum(["extend", "override"]).nullable(),
|
|
167
152
|
local_docs: z.array(z.string()),
|
|
168
153
|
mode_sources: z.array(z.string()),
|
|
169
|
-
}));
|
|
170
|
-
export const RuntimeStageAcceptanceSchema = z.
|
|
171
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
172
|
-
return value;
|
|
173
|
-
const raw = value;
|
|
174
|
-
return {
|
|
175
|
-
...raw,
|
|
176
|
-
stage_truthy: raw.stage_truthy ?? raw.state_truthy,
|
|
177
|
-
stage_equals_counts: raw.stage_equals_counts ?? raw.state_equals_counts,
|
|
178
|
-
stage_at_least: raw.stage_at_least ?? raw.state_at_least,
|
|
179
|
-
stage_at_least_counts: raw.stage_at_least_counts ?? raw.state_at_least_counts,
|
|
180
|
-
};
|
|
181
|
-
}, z.object({
|
|
154
|
+
}).strict();
|
|
155
|
+
export const RuntimeStageAcceptanceSchema = z.object({
|
|
182
156
|
artifacts_exist: z.array(z.string()).optional(),
|
|
183
157
|
stage_truthy: z.array(z.string()).optional(),
|
|
184
158
|
stage_equals_counts: z.record(z.string(), z.string()).optional(),
|
|
@@ -187,10 +161,11 @@ export const RuntimeStageAcceptanceSchema = z.preprocess((value) => {
|
|
|
187
161
|
zone_counts_at_least: z.record(z.string().regex(WorkflowIdPattern), z.number()).optional(),
|
|
188
162
|
zone_counts_at_least_counts: z.record(z.string().regex(WorkflowIdPattern), z.string()).optional(),
|
|
189
163
|
markdown_frontmatter_valid_zones: z.array(WorkflowZoneIdSchema).optional(),
|
|
164
|
+
frontmatter_required_keys_in_zones: z.record(WorkflowZoneIdSchema, z.array(z.string().min(1)).min(1)).optional(),
|
|
190
165
|
markdown_abstract_valid_zones: z.array(WorkflowZoneIdSchema).optional(),
|
|
191
166
|
wikilinks_valid_in_zones: z.array(WorkflowZoneIdSchema).optional(),
|
|
192
167
|
artifacts_must_not_contain: z.record(z.string(), z.array(z.string().min(1))).optional(),
|
|
193
|
-
}));
|
|
168
|
+
}).strict();
|
|
194
169
|
export const RuntimeStageContractSchema = z.object({
|
|
195
170
|
kind: z.literal("interf-stage-contract"),
|
|
196
171
|
version: z.literal(1),
|
|
@@ -258,36 +233,14 @@ export const RuntimeRunSchema = z.object({
|
|
|
258
233
|
exit_code: z.number().nullable(),
|
|
259
234
|
error: z.string().nullable(),
|
|
260
235
|
});
|
|
261
|
-
export const CompiledInventoryEntrySchema = z.
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
const raw = value;
|
|
265
|
-
if (typeof raw.source !== "string" && typeof raw.summary !== "string")
|
|
266
|
-
return raw;
|
|
267
|
-
return {
|
|
268
|
-
input_zone: raw.input_zone ?? "raw",
|
|
269
|
-
input_path: raw.input_path ?? raw.source,
|
|
270
|
-
output_zone: raw.output_zone ?? "summaries",
|
|
271
|
-
output_path: raw.output_path ?? raw.summary,
|
|
272
|
-
state: raw.state,
|
|
273
|
-
metadata: {
|
|
274
|
-
source_kind: raw.source_kind,
|
|
275
|
-
evidence_tier: raw.evidence_tier,
|
|
276
|
-
truth_mode: raw.truth_mode,
|
|
277
|
-
status: raw.status,
|
|
278
|
-
abstract: raw.abstract,
|
|
279
|
-
frontmatter_scanned: raw.frontmatter_scanned,
|
|
280
|
-
abstract_read: raw.abstract_read,
|
|
281
|
-
},
|
|
282
|
-
};
|
|
283
|
-
}, z.object({
|
|
284
|
-
input_zone: WorkflowZoneIdSchema,
|
|
285
|
-
input_path: z.string().min(1),
|
|
236
|
+
export const CompiledInventoryEntrySchema = z.object({
|
|
237
|
+
input_zone: WorkflowZoneIdSchema.optional(),
|
|
238
|
+
input_path: z.string().min(1).optional(),
|
|
286
239
|
output_zone: WorkflowZoneIdSchema,
|
|
287
240
|
output_path: z.string().min(1),
|
|
288
241
|
state: z.string().min(1).optional(),
|
|
289
242
|
metadata: JsonRecordSchema.optional(),
|
|
290
|
-
}));
|
|
243
|
+
}).strict();
|
|
291
244
|
export const CompiledInventorySchema = z.object({
|
|
292
245
|
kind: z.literal("compiled-runtime-ledger").optional(),
|
|
293
246
|
version: z.number().int().min(1).optional(),
|
|
@@ -327,32 +280,14 @@ const TestCaseCoreSchema = z.object({
|
|
|
327
280
|
});
|
|
328
281
|
}
|
|
329
282
|
});
|
|
330
|
-
export const TestCaseSchema =
|
|
331
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
332
|
-
return value;
|
|
333
|
-
const raw = value;
|
|
334
|
-
return {
|
|
335
|
-
...raw,
|
|
336
|
-
question: raw.question ?? raw.check ?? raw.ask,
|
|
337
|
-
answer: raw.answer ?? raw.expected ?? raw.pass_when,
|
|
338
|
-
};
|
|
339
|
-
}, TestCaseCoreSchema);
|
|
283
|
+
export const TestCaseSchema = TestCaseCoreSchema;
|
|
340
284
|
const TestSpecCoreSchema = z.object({
|
|
341
285
|
type: TestTargetTypeSchema,
|
|
342
286
|
name: z.string().min(1),
|
|
343
287
|
description: z.string().min(1).optional(),
|
|
344
288
|
cases: z.array(TestCaseSchema).min(1),
|
|
345
289
|
});
|
|
346
|
-
export const TestSpecSchema =
|
|
347
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
348
|
-
return value;
|
|
349
|
-
const raw = value;
|
|
350
|
-
return {
|
|
351
|
-
...raw,
|
|
352
|
-
type: raw.type ?? "compiled",
|
|
353
|
-
cases: raw.cases ?? raw.checks,
|
|
354
|
-
};
|
|
355
|
-
}, TestSpecCoreSchema);
|
|
290
|
+
export const TestSpecSchema = TestSpecCoreSchema;
|
|
356
291
|
export const SourceTruthCheckSchema = z.object({
|
|
357
292
|
id: z.string().regex(WorkflowIdPattern).optional(),
|
|
358
293
|
question: z.string().min(1),
|
|
@@ -376,39 +311,21 @@ export const DatasetNameSchema = z
|
|
|
376
311
|
.string()
|
|
377
312
|
.regex(DatasetNamePattern, "Dataset names must use lowercase letters, numbers, and dashes only.")
|
|
378
313
|
.refine((value) => !RESERVED_DATASET_NAMES.has(value), "Dataset name is reserved.");
|
|
379
|
-
export const SourceDatasetConfigSchema = z.
|
|
380
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
381
|
-
return value;
|
|
382
|
-
const raw = value;
|
|
383
|
-
return {
|
|
384
|
-
...raw,
|
|
385
|
-
path: raw.path ?? ".",
|
|
386
|
-
};
|
|
387
|
-
}, z.object({
|
|
314
|
+
export const SourceDatasetConfigSchema = z.object({
|
|
388
315
|
id: z.string().regex(WorkflowIdPattern).optional(),
|
|
389
316
|
name: DatasetNameSchema,
|
|
390
|
-
path: z.string().min(1),
|
|
317
|
+
path: z.string().min(1).default("."),
|
|
391
318
|
about: z.string().min(1).optional(),
|
|
392
319
|
workflow: WorkflowIdSchema.optional(),
|
|
393
320
|
max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
|
|
394
321
|
max_loops: SourceCompiledMaxLoopsSchema.optional(),
|
|
395
322
|
checks: z.array(SourceTruthCheckSchema).default([]),
|
|
396
|
-
}).strict()
|
|
397
|
-
export const CompiledInterfConfigSchema = z.
|
|
398
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
399
|
-
return value;
|
|
400
|
-
const raw = value;
|
|
401
|
-
return {
|
|
402
|
-
...raw,
|
|
403
|
-
type: "compiled",
|
|
404
|
-
source: raw.source ?? { path: "./raw" },
|
|
405
|
-
checks: raw.checks ?? [],
|
|
406
|
-
};
|
|
407
|
-
}, z.object({
|
|
323
|
+
}).strict();
|
|
324
|
+
export const CompiledInterfConfigSchema = z.object({
|
|
408
325
|
type: z.literal("compiled"),
|
|
409
326
|
name: DatasetNameSchema,
|
|
410
327
|
about: z.string().optional(),
|
|
411
|
-
workflow: WorkflowIdSchema
|
|
328
|
+
workflow: WorkflowIdSchema,
|
|
412
329
|
max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
|
|
413
330
|
max_loops: SourceCompiledMaxLoopsSchema.optional(),
|
|
414
331
|
checks: z.array(SourceTruthCheckSchema).default([]),
|
|
@@ -419,9 +336,9 @@ export const CompiledInterfConfigSchema = z.preprocess((value) => {
|
|
|
419
336
|
source: z.object({
|
|
420
337
|
path: z.string(),
|
|
421
338
|
control_path: z.string().optional(),
|
|
422
|
-
dataset_path: z.string()
|
|
339
|
+
dataset_path: z.string(),
|
|
423
340
|
}),
|
|
424
|
-
}).passthrough()
|
|
341
|
+
}).passthrough();
|
|
425
342
|
export const InterfConfigSchema = CompiledInterfConfigSchema;
|
|
426
343
|
export const WorkflowImprovementLoopSummarySchema = z.object({
|
|
427
344
|
variation: z.number().int().min(1),
|
|
@@ -621,6 +538,5 @@ export const InterfUserConfigSchema = z.object({
|
|
|
621
538
|
agent: z.string(),
|
|
622
539
|
agentCommand: z.string(),
|
|
623
540
|
skillsInstalled: z.boolean(),
|
|
624
|
-
viewer: z.enum(["plain", "obsidian"]).optional(),
|
|
625
541
|
initialized: z.string(),
|
|
626
542
|
});
|
|
@@ -83,19 +83,22 @@ function toWritableSourceProjectConfig(config) {
|
|
|
83
83
|
const datasets = config?.datasets ?? [];
|
|
84
84
|
if (datasets.length > 0) {
|
|
85
85
|
return {
|
|
86
|
-
datasets: datasets.map((dataset) => (
|
|
87
|
-
name: dataset.name,
|
|
88
|
-
...(dataset.path && dataset.path !== "." ? { path: dataset.path } : {}),
|
|
89
|
-
...(dataset.about ? { about: dataset.about } : {}),
|
|
90
|
-
...(dataset.workflow && dataset.workflow !== "interf" ? { workflow: dataset.workflow } : {}),
|
|
91
|
-
...(typeof dataset.max_attempts === "number" ? { max_attempts: dataset.max_attempts } : {}),
|
|
92
|
-
...(typeof dataset.max_loops === "number" ? { max_loops: dataset.max_loops } : {}),
|
|
93
|
-
checks: dataset.checks,
|
|
94
|
-
})),
|
|
86
|
+
datasets: datasets.map((dataset) => toWritableSourceDatasetConfig(dataset)),
|
|
95
87
|
};
|
|
96
88
|
}
|
|
97
89
|
return {};
|
|
98
90
|
}
|
|
91
|
+
function toWritableSourceDatasetConfig(dataset) {
|
|
92
|
+
return {
|
|
93
|
+
name: dataset.name,
|
|
94
|
+
...(dataset.path && dataset.path !== "." ? { path: dataset.path } : {}),
|
|
95
|
+
...(dataset.about ? { about: dataset.about } : {}),
|
|
96
|
+
...(dataset.workflow && dataset.workflow !== "interf" ? { workflow: dataset.workflow } : {}),
|
|
97
|
+
...(typeof dataset.max_attempts === "number" ? { max_attempts: dataset.max_attempts } : {}),
|
|
98
|
+
...(typeof dataset.max_loops === "number" ? { max_loops: dataset.max_loops } : {}),
|
|
99
|
+
checks: dataset.checks,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
99
102
|
export function saveSourceFolderConfig(sourcePath, config) {
|
|
100
103
|
writeFileSync(sourceConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(config), null, 2) + "\n");
|
|
101
104
|
}
|
|
@@ -104,21 +107,17 @@ export function appendSourceDatasetChecks(sourcePath, datasetName, checks) {
|
|
|
104
107
|
const currentDataset = findSourceDatasetConfig(existing, datasetName);
|
|
105
108
|
const otherDatasets = listSourceDatasetConfigs(existing).filter((dataset) => dataset.name !== datasetName);
|
|
106
109
|
const currentChecks = currentDataset?.checks ?? [];
|
|
110
|
+
const nextDataset = {
|
|
111
|
+
...toWritableSourceDatasetConfig(currentDataset ?? {
|
|
112
|
+
name: datasetName,
|
|
113
|
+
path: ".",
|
|
114
|
+
checks: [],
|
|
115
|
+
}),
|
|
116
|
+
checks: [...currentChecks, ...checks],
|
|
117
|
+
};
|
|
107
118
|
saveSourceFolderConfig(sourcePath, {
|
|
108
119
|
datasets: [
|
|
109
|
-
|
|
110
|
-
name: datasetName,
|
|
111
|
-
path: currentDataset?.path ?? ".",
|
|
112
|
-
...(currentDataset?.about ? { about: currentDataset.about } : {}),
|
|
113
|
-
...(currentDataset?.workflow ? { workflow: currentDataset.workflow } : {}),
|
|
114
|
-
...(typeof currentDataset?.max_attempts === "number"
|
|
115
|
-
? { max_attempts: currentDataset.max_attempts }
|
|
116
|
-
: {}),
|
|
117
|
-
...(typeof currentDataset?.max_loops === "number"
|
|
118
|
-
? { max_loops: currentDataset.max_loops }
|
|
119
|
-
: {}),
|
|
120
|
-
checks: [...currentChecks, ...checks],
|
|
121
|
-
},
|
|
120
|
+
nextDataset,
|
|
122
121
|
...otherDatasets,
|
|
123
122
|
],
|
|
124
123
|
});
|