@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
|
@@ -3,25 +3,12 @@ import { dirname, join } from "node:path";
|
|
|
3
3
|
import { copyWorkflowPackageDirectory, isPortableWorkflowPackage, patchWorkflowPackageMetadata, resolveWorkflowPackageSourcePath, workflowDefinitionPath, } from "./local-workflows.js";
|
|
4
4
|
import { getCompiledWorkflow, } from "./workflow-definitions.js";
|
|
5
5
|
import { renderCompiledQuerySkill } from "./agent-shells.js";
|
|
6
|
-
import {
|
|
7
|
-
import { writeCompiledSchemaFile } from "./compiled-schema.js";
|
|
6
|
+
import { WORKFLOW_SCHEMA_FILE, writeWorkflowSchemaDocument, writeWorkflowSchemaFile, } from "./compiled-schema.js";
|
|
8
7
|
import { workflowPackagePathForCompiled } from "./compiled-paths.js";
|
|
8
|
+
import { mergeStagePolicyNotesForStages } from "./workflow-stage-policy.js";
|
|
9
9
|
function workflowPackagePath(dirPath) {
|
|
10
10
|
return workflowPackagePathForCompiled(dirPath);
|
|
11
11
|
}
|
|
12
|
-
function mergeWorkflowStagePolicyNotes(stages, baseNotes, nextNotes) {
|
|
13
|
-
const merged = {};
|
|
14
|
-
for (const stage of stages) {
|
|
15
|
-
const combined = Array.from(new Set([
|
|
16
|
-
...(baseNotes?.[stage.id] ?? []),
|
|
17
|
-
...(nextNotes?.[stage.id] ?? []),
|
|
18
|
-
].map((note) => note.trim()).filter((note) => note.length > 0)));
|
|
19
|
-
if (combined.length > 0) {
|
|
20
|
-
merged[stage.id] = combined;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
24
|
-
}
|
|
25
12
|
function writeWorkflowStarterDocs(dirPath, docs, options) {
|
|
26
13
|
for (const doc of docs ?? []) {
|
|
27
14
|
const targetPath = join(dirPath, doc.relativePath);
|
|
@@ -42,6 +29,14 @@ function writeWorkflowPackageJson(rootPath, workflow, options) {
|
|
|
42
29
|
kind: "compiled",
|
|
43
30
|
version: 1,
|
|
44
31
|
},
|
|
32
|
+
...(workflow.purpose
|
|
33
|
+
? {
|
|
34
|
+
purpose: {
|
|
35
|
+
label: workflow.purpose.label,
|
|
36
|
+
task_hint: workflow.purpose.taskHint,
|
|
37
|
+
},
|
|
38
|
+
}
|
|
39
|
+
: {}),
|
|
45
40
|
label: workflow.label,
|
|
46
41
|
hint: workflow.hint,
|
|
47
42
|
stages: workflow.stages.map((stage) => ({
|
|
@@ -61,24 +56,46 @@ function renderWorkflowReadme(workflow) {
|
|
|
61
56
|
const stageLines = workflow.stages
|
|
62
57
|
.map((stage) => `- \`${stage.id}\` — ${stage.description} (${stage.contractType}; reads: ${stage.reads.join(", ")}; writes: ${stage.writes.join(", ")})`)
|
|
63
58
|
.join("\n");
|
|
59
|
+
const zoneLines = workflow.schema?.zones
|
|
60
|
+
? workflow.schema.zones
|
|
61
|
+
.map((zone) => `- \`${zone.id}\` — ${zone.role} ${zone.kind} at \`${zone.path}\``)
|
|
62
|
+
.join("\n")
|
|
63
|
+
: null;
|
|
64
64
|
return [
|
|
65
65
|
`# ${workflow.label}`,
|
|
66
66
|
"",
|
|
67
67
|
workflow.hint,
|
|
68
|
+
...(workflow.purpose
|
|
69
|
+
? [
|
|
70
|
+
"",
|
|
71
|
+
"## Purpose",
|
|
72
|
+
"",
|
|
73
|
+
`- ${workflow.purpose.label}`,
|
|
74
|
+
`- ${workflow.purpose.taskHint}`,
|
|
75
|
+
]
|
|
76
|
+
: []),
|
|
68
77
|
"",
|
|
69
78
|
"## Package",
|
|
70
79
|
"",
|
|
71
80
|
"- `workflow.json` = stage graph, compiler API target, and compile contract mapping",
|
|
72
|
-
"- `
|
|
81
|
+
"- `workflow.schema.json` = deterministic zone contract for the workflow package",
|
|
73
82
|
"- `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs",
|
|
74
83
|
"- Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder",
|
|
75
|
-
"- Interf
|
|
84
|
+
"- Interf projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
|
|
85
|
+
...(zoneLines
|
|
86
|
+
? [
|
|
87
|
+
"",
|
|
88
|
+
"## Zones",
|
|
89
|
+
"",
|
|
90
|
+
zoneLines,
|
|
91
|
+
]
|
|
92
|
+
: []),
|
|
76
93
|
"",
|
|
77
94
|
"## Stages",
|
|
78
95
|
"",
|
|
79
96
|
stageLines,
|
|
80
97
|
"",
|
|
81
|
-
"Interf
|
|
98
|
+
"Interf runs the local copy of this package directly from `.interf/workflow/` inside each compiled dataset.",
|
|
82
99
|
"",
|
|
83
100
|
].join("\n");
|
|
84
101
|
}
|
|
@@ -90,13 +107,25 @@ function renderDerivedWorkflowReadme(options) {
|
|
|
90
107
|
"",
|
|
91
108
|
`This workflow package was copied from \`${options.baseWorkflowId}\` and materialized as a standalone package for this dataset job.`,
|
|
92
109
|
"",
|
|
93
|
-
"Interf
|
|
110
|
+
"Interf runs the local copy of this package directly. Keep changes in this folder self-contained instead of relying on runtime inheritance or fallback.",
|
|
94
111
|
"",
|
|
95
112
|
"## Emphasis",
|
|
96
113
|
"",
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
114
|
+
...(options.emphasis.length > 0
|
|
115
|
+
? options.emphasis.map((entry) => `- ${entry.stageId} (${entry.label}): ${entry.notes.join("; ")}`)
|
|
116
|
+
: ["- No stage-specific emphasis was added yet."]),
|
|
117
|
+
"",
|
|
118
|
+
].join("\n");
|
|
119
|
+
}
|
|
120
|
+
function renderSeedWorkflowReadme(options) {
|
|
121
|
+
return [
|
|
122
|
+
`# ${options.label}`,
|
|
123
|
+
"",
|
|
124
|
+
options.hint,
|
|
125
|
+
"",
|
|
126
|
+
`This workflow package was seeded from \`${options.baseWorkflowId}\` as a standalone local draft.`,
|
|
127
|
+
"",
|
|
128
|
+
"Interf runs the local copy of this package directly. Refine the workflow docs, stage instructions, and zone contract in this folder instead of relying on inheritance or runtime fallback.",
|
|
100
129
|
"",
|
|
101
130
|
].join("\n");
|
|
102
131
|
}
|
|
@@ -106,14 +135,14 @@ function renderImproveSkill(workflow) {
|
|
|
106
135
|
"",
|
|
107
136
|
`Workflow: ${workflow.id}`,
|
|
108
137
|
"",
|
|
109
|
-
"This file is the editable authoring source for Interf
|
|
138
|
+
"This file is the editable authoring source for Interf's generated native workflow-improver shell.",
|
|
110
139
|
"The improver edits this local package directly.",
|
|
111
140
|
"",
|
|
112
141
|
"Default loop:",
|
|
113
142
|
"1. Read the loop context first.",
|
|
114
143
|
"2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.",
|
|
115
144
|
"3. Edit only the local workflow package for this compiled dataset to create a better workflow variation for this dataset.",
|
|
116
|
-
|
|
145
|
+
`4. Keep \`workflow.json\`, \`${WORKFLOW_SCHEMA_FILE}\`, and any changed stage docs aligned.`,
|
|
117
146
|
"",
|
|
118
147
|
"Guardrails:",
|
|
119
148
|
"- do not edit truth checks, test specs, or raw dataset files",
|
|
@@ -125,37 +154,41 @@ function renderImproveSkill(workflow) {
|
|
|
125
154
|
}
|
|
126
155
|
function renderStageSkill(workflow, stage) {
|
|
127
156
|
const notes = workflow.stagePolicyNotes?.[stage.id] ?? [];
|
|
128
|
-
const
|
|
157
|
+
const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
|
|
158
|
+
const abstractRules = stage.contractType === "compiled-file-evidence"
|
|
129
159
|
? [
|
|
130
|
-
"
|
|
131
|
-
|
|
132
|
-
"
|
|
160
|
+
"- Valid abstract forms for deterministic validation are:",
|
|
161
|
+
' - frontmatter key `"abstract"` with a real sentence, or',
|
|
162
|
+
" - a markdown heading `## Abstract` followed by at least one sentence",
|
|
163
|
+
"- A bare `Abstract` label without markdown heading syntax does not count.",
|
|
133
164
|
]
|
|
134
|
-
:
|
|
135
|
-
? [
|
|
136
|
-
"Treat the knowledge layer as retrieval structure, not final truth.",
|
|
137
|
-
"Prefer durable entity, claim, and index notes over one giant catch-all file.",
|
|
138
|
-
]
|
|
139
|
-
: stage.contractType === "compiled-query-shape"
|
|
140
|
-
? [
|
|
141
|
-
"Use the compiled focus plus saved truth-check question text to shape `home.md` and retrieval routes.",
|
|
142
|
-
"Rewrite `home.md` into a real entrypoint note. Do not leave the scaffold `Not yet compiled.` placeholder in place.",
|
|
143
|
-
...CHART_APPROXIMATION_NOTES,
|
|
144
|
-
"Do not copy expected answers into the compiled dataset.",
|
|
145
|
-
]
|
|
146
|
-
: [];
|
|
165
|
+
: [];
|
|
147
166
|
return [
|
|
148
167
|
`# ${stage.label}`,
|
|
149
168
|
"",
|
|
150
169
|
stage.description,
|
|
151
170
|
"",
|
|
152
|
-
|
|
171
|
+
"## Stage Contract",
|
|
153
172
|
"",
|
|
154
|
-
|
|
173
|
+
`- Contract type: \`${stage.contractType}\``,
|
|
174
|
+
`- Reads zones: ${stage.reads.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
|
|
175
|
+
`- Writes zones: ${stage.writes.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
|
|
176
|
+
"",
|
|
177
|
+
"## Requirements",
|
|
178
|
+
"",
|
|
179
|
+
"- Treat `workflow.json` and `workflow.schema.json` as the authoritative package contract for this stage.",
|
|
180
|
+
"- Read only from the declared input zones unless this package explicitly documents a broader method.",
|
|
181
|
+
"- Write only inside the declared output zones for this stage. Do not invent undeclared zones or implicit outputs.",
|
|
182
|
+
"- Keep stage instructions, zone ownership, and workflow-level acceptance aligned when you change this stage.",
|
|
183
|
+
"- Treat runtime files as proof and execution state, not as the source of truth for workflow behavior.",
|
|
184
|
+
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
185
|
+
...abstractRules,
|
|
186
|
+
"",
|
|
187
|
+
...(acceptanceKeys.length > 0
|
|
155
188
|
? [
|
|
156
|
-
"##
|
|
189
|
+
"## Declarative Acceptance",
|
|
157
190
|
"",
|
|
158
|
-
...
|
|
191
|
+
...acceptanceKeys.map((key) => `- \`${key}\``),
|
|
159
192
|
"",
|
|
160
193
|
]
|
|
161
194
|
: []),
|
|
@@ -181,8 +214,16 @@ export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
|
|
|
181
214
|
mkdirSync(join(workflowDir, "compile", "stages", stage.skillDir), { recursive: true });
|
|
182
215
|
}
|
|
183
216
|
writeWorkflowPackageJson(workflowDir, workflow, { overwrite });
|
|
184
|
-
if (overwrite || !existsSync(join(workflowDir,
|
|
185
|
-
|
|
217
|
+
if (overwrite || !existsSync(join(workflowDir, WORKFLOW_SCHEMA_FILE))) {
|
|
218
|
+
if (workflow.schema) {
|
|
219
|
+
writeWorkflowSchemaDocument(workflowDir, {
|
|
220
|
+
...workflow.schema,
|
|
221
|
+
label: workflow.schema.label || `${workflow.label} workflow schema`,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
else {
|
|
225
|
+
writeWorkflowSchemaFile(workflowDir, workflow.stages, `${workflow.label} workflow schema`);
|
|
226
|
+
}
|
|
186
227
|
}
|
|
187
228
|
if (overwrite || !existsSync(join(workflowDir, "README.md"))) {
|
|
188
229
|
writeFileSync(join(workflowDir, "README.md"), renderWorkflowReadme(workflow));
|
|
@@ -210,6 +251,12 @@ export function seedCompiledWorkflowPackage(options) {
|
|
|
210
251
|
// Portable seed packages can be copied directly because compile runs the
|
|
211
252
|
// local package folder without any source-root fallback.
|
|
212
253
|
copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.compiledPath));
|
|
254
|
+
patchWorkflowPackageMetadata(workflowPackagePath(options.compiledPath), {
|
|
255
|
+
id: resolvedWorkflow.id,
|
|
256
|
+
label: resolvedWorkflow.label,
|
|
257
|
+
hint: resolvedWorkflow.hint,
|
|
258
|
+
stagePolicyNotes: resolvedWorkflow.stagePolicyNotes,
|
|
259
|
+
});
|
|
213
260
|
return;
|
|
214
261
|
}
|
|
215
262
|
// Legacy or partially-defined seed packages are resolved once and
|
|
@@ -217,13 +264,40 @@ export function seedCompiledWorkflowPackage(options) {
|
|
|
217
264
|
writeCompiledWorkflowPackage(options.compiledPath, resolvedWorkflow);
|
|
218
265
|
}
|
|
219
266
|
export function createLocalWorkflowPackageFromTemplate(options) {
|
|
267
|
+
const targetPath = seedLocalWorkflowPackageFromBase({
|
|
268
|
+
sourcePath: options.sourcePath,
|
|
269
|
+
baseWorkflowId: options.baseWorkflowId,
|
|
270
|
+
workflowId: options.workflowId,
|
|
271
|
+
label: options.label,
|
|
272
|
+
hint: options.hint,
|
|
273
|
+
});
|
|
274
|
+
const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
|
|
275
|
+
sourcePath: options.sourcePath,
|
|
276
|
+
});
|
|
277
|
+
const stagePolicyNotes = mergeStagePolicyNotesForStages(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, options.stagePolicyNotes);
|
|
278
|
+
patchWorkflowPackageMetadata(targetPath, {
|
|
279
|
+
id: options.workflowId,
|
|
280
|
+
label: options.label,
|
|
281
|
+
hint: options.hint,
|
|
282
|
+
stagePolicyNotes,
|
|
283
|
+
});
|
|
284
|
+
writeFileSync(join(targetPath, "README.md"), renderDerivedWorkflowReadme({
|
|
285
|
+
label: options.label,
|
|
286
|
+
hint: options.hint,
|
|
287
|
+
baseWorkflowId: options.baseWorkflowId,
|
|
288
|
+
emphasis: baseWorkflow.stages
|
|
289
|
+
.map((stage) => ({
|
|
290
|
+
stageId: stage.id,
|
|
291
|
+
label: stage.label,
|
|
292
|
+
notes: stagePolicyNotes?.[stage.id] ?? [],
|
|
293
|
+
}))
|
|
294
|
+
.filter((entry) => entry.notes.length > 0),
|
|
295
|
+
}));
|
|
296
|
+
return targetPath;
|
|
297
|
+
}
|
|
298
|
+
export function seedLocalWorkflowPackageFromBase(options) {
|
|
220
299
|
const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, options.baseWorkflowId);
|
|
221
300
|
const targetPath = workflowDefinitionPath(options.sourcePath, options.workflowId);
|
|
222
|
-
const stagePolicyNotes = {
|
|
223
|
-
summarize: [options.summarizeBias],
|
|
224
|
-
structure: [options.structureBias],
|
|
225
|
-
shape: [options.shapeBias],
|
|
226
|
-
};
|
|
227
301
|
if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
|
|
228
302
|
// Copy directly when the base package is already portable and standalone.
|
|
229
303
|
copyWorkflowPackageDirectory(sourceWorkflowPath, targetPath);
|
|
@@ -231,15 +305,11 @@ export function createLocalWorkflowPackageFromTemplate(options) {
|
|
|
231
305
|
id: options.workflowId,
|
|
232
306
|
label: options.label,
|
|
233
307
|
hint: options.hint,
|
|
234
|
-
stagePolicyNotes,
|
|
235
308
|
});
|
|
236
|
-
writeFileSync(join(targetPath, "README.md"),
|
|
309
|
+
writeFileSync(join(targetPath, "README.md"), renderSeedWorkflowReadme({
|
|
237
310
|
label: options.label,
|
|
238
311
|
hint: options.hint,
|
|
239
312
|
baseWorkflowId: options.baseWorkflowId,
|
|
240
|
-
summarizeBias: options.summarizeBias,
|
|
241
|
-
structureBias: options.structureBias,
|
|
242
|
-
shapeBias: options.shapeBias,
|
|
243
313
|
}));
|
|
244
314
|
return targetPath;
|
|
245
315
|
}
|
|
@@ -255,17 +325,13 @@ export function createLocalWorkflowPackageFromTemplate(options) {
|
|
|
255
325
|
hint: options.hint,
|
|
256
326
|
recommended: false,
|
|
257
327
|
scope: "local",
|
|
258
|
-
stagePolicyNotes: mergeWorkflowStagePolicyNotes(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, stagePolicyNotes),
|
|
259
328
|
starterDocs: [
|
|
260
329
|
{
|
|
261
330
|
relativePath: "README.md",
|
|
262
|
-
content:
|
|
331
|
+
content: renderSeedWorkflowReadme({
|
|
263
332
|
label: options.label,
|
|
264
333
|
hint: options.hint,
|
|
265
334
|
baseWorkflowId: options.baseWorkflowId,
|
|
266
|
-
summarizeBias: options.summarizeBias,
|
|
267
|
-
structureBias: options.structureBias,
|
|
268
|
-
shapeBias: options.shapeBias,
|
|
269
335
|
}),
|
|
270
336
|
},
|
|
271
337
|
...(baseWorkflow.starterDocs ?? []).filter((doc) => doc.relativePath !== "README.md"),
|
package/dist/lib/interf.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR,
|
|
1
|
+
export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
|
|
2
2
|
export type { InterfConfig, ResolvedCompiled } from "./interf-detect.js";
|
|
3
3
|
export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
|
|
4
4
|
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
|
package/dist/lib/interf.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR,
|
|
1
|
+
export { INTERF_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, WORKFLOW_PACKAGE_DIR, readInterfConfig, detectInterf, resolveCompiled, resolveSourceFolderPath, resolveSourceControlPath, resolveSourceInputPath, listCompiledDatasetsForSourceFolder, hasSourceFolderInput, assertCompiledContainer, assertWritableTargetDir, assertCompiledName, } from "./interf-detect.js";
|
|
2
2
|
export { ensureCompiledRawBinding, resolveCompiledRawPath, syncCompiledRawSnapshot, } from "./compiled-raw.js";
|
|
3
3
|
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "./interf-bootstrap.js";
|
|
4
4
|
export { createCompiled, defaultCompiledNameForSource, } from "./interf-scaffold.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowStageZoneAccessSchema, type WorkflowCompiledSchema } from "./schema.js";
|
|
2
|
+
import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowPurposeSchema, WorkflowStageZoneAccessSchema, type WorkflowCompiledSchema } from "./schema.js";
|
|
3
3
|
export interface LocalWorkflowStarterDoc {
|
|
4
4
|
relativePath: string;
|
|
5
5
|
content: string;
|
|
@@ -18,16 +18,17 @@ export interface LocalWorkflowDefinition {
|
|
|
18
18
|
id: string;
|
|
19
19
|
type: "compiled";
|
|
20
20
|
compiler_api?: z.infer<typeof WorkflowCompilerApiSchema>;
|
|
21
|
+
purpose?: z.infer<typeof WorkflowPurposeSchema>;
|
|
21
22
|
label: string;
|
|
22
23
|
hint: string;
|
|
23
24
|
extends?: string;
|
|
24
25
|
stages?: LocalWorkflowStageDefinition[];
|
|
25
26
|
stage_policy_notes?: Record<string, string[]>;
|
|
26
|
-
|
|
27
|
+
workflow_schema: WorkflowCompiledSchema;
|
|
27
28
|
starter_docs: LocalWorkflowStarterDoc[];
|
|
28
29
|
directoryPath: string;
|
|
29
30
|
workflowPath: string;
|
|
30
|
-
|
|
31
|
+
workflowSchemaPath: string;
|
|
31
32
|
}
|
|
32
33
|
export declare function workflowDefinitionPath(sourcePath: string, id: string): string;
|
|
33
34
|
export declare function loadWorkflowDefinitionFromDir(dirPath: string): LocalWorkflowDefinition | null;
|