@interf/compiler 0.7.3 → 0.9.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 +123 -89
- package/TRADEMARKS.md +1 -1
- package/agent-skills/interf-actions/SKILL.md +71 -0
- package/agent-skills/interf-actions/references/cli.md +190 -0
- package/apps/compiler-ui/.next/server/app/index.html +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_buildManifest.js +11 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_clientMiddlewareManifest.js +1 -0
- package/apps/compiler-ui/.next/static/XWKL548yXD_UOG4ID9G3J/_ssgManifest.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/03~yq9q893hmn.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/06z~l3kwb891e.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08g7lvje.te.u.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/08m7vf5asqlsm.js +91 -0
- package/apps/compiler-ui/.next/static/chunks/0_i-3_5l9t2qe.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b-ywny_j0g~0.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0b52v41o1gixx.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0fgt_8knmicoz.js +124 -0
- package/apps/compiler-ui/.next/static/chunks/0gpzgsv0w.q~m.js +31 -0
- package/apps/compiler-ui/.next/static/chunks/0ilwfezfvu6~-.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0n51hrfoufc7g.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/0ti_66mx7~w2-.js +5 -0
- package/apps/compiler-ui/.next/static/chunks/0xxmf45eskdt~.css +1 -0
- package/apps/compiler-ui/.next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
- package/apps/compiler-ui/.next/static/chunks/13g~4mamjft.c.css +3 -0
- package/apps/compiler-ui/.next/static/chunks/14wtz~vq25~qq.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-109rtik40vwh5.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
- package/apps/compiler-ui/.next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
- package/apps/compiler-ui/.next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/apps/compiler-ui/.next/static/media/worker.102zas1s52_pf.js +109 -0
- package/builtin-workflows/interf/README.md +8 -8
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
- package/builtin-workflows/interf/compile/stages/structure/SKILL.md +1 -1
- package/builtin-workflows/interf/improve/SKILL.md +1 -1
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +8 -8
- package/builtin-workflows/interf/workflow.schema.json +1 -1
- package/dist/cli/commands/check-draft.d.ts +5 -4
- package/dist/cli/commands/check-draft.js +18 -17
- package/dist/cli/commands/compile-controller.d.ts +3 -0
- package/dist/cli/commands/compile-controller.js +53 -45
- package/dist/cli/commands/compile.js +83 -27
- package/dist/cli/commands/compiled-flow.d.ts +3 -0
- package/dist/cli/commands/compiled-flow.js +9 -7
- package/dist/cli/commands/control-path.d.ts +11 -0
- package/dist/cli/commands/control-path.js +72 -0
- package/dist/cli/commands/create-workflow-wizard.d.ts +6 -0
- package/dist/cli/commands/create-workflow-wizard.js +191 -77
- package/dist/cli/commands/create.js +54 -40
- package/dist/cli/commands/default.js +4 -3
- package/dist/cli/commands/doctor.js +5 -5
- package/dist/cli/commands/executor-flow.js +1 -1
- package/dist/cli/commands/init.js +326 -76
- package/dist/cli/commands/list.js +8 -7
- package/dist/cli/commands/preparation-selection.d.ts +6 -0
- package/dist/cli/commands/preparation-selection.js +11 -0
- package/dist/cli/commands/reset.js +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +4 -3
- package/dist/cli/commands/source-config-wizard.js +175 -197
- package/dist/cli/commands/status.js +116 -8
- package/dist/cli/commands/test-flow.d.ts +1 -1
- package/dist/cli/commands/test-flow.js +31 -31
- package/dist/cli/commands/test.d.ts +4 -0
- package/dist/cli/commands/test.js +95 -58
- package/dist/cli/commands/verify.js +7 -7
- package/dist/cli/commands/web.d.ts +11 -0
- package/dist/cli/commands/web.js +373 -0
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +3 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/dist/packages/agents/lib/execution.js +4 -2
- package/dist/packages/agents/lib/executors.d.ts +1 -0
- package/dist/packages/agents/lib/executors.js +1 -0
- package/dist/packages/agents/lib/render.d.ts +2 -2
- package/dist/packages/agents/lib/render.js +10 -9
- package/dist/packages/agents/lib/shells.d.ts +3 -11
- package/dist/packages/agents/lib/shells.js +45 -96
- package/dist/packages/agents/lib/types.d.ts +1 -0
- package/dist/packages/compiler/compiled-paths.d.ts +4 -1
- package/dist/packages/compiler/compiled-paths.js +7 -1
- package/dist/packages/compiler/compiled-pipeline.d.ts +7 -0
- package/dist/packages/compiler/compiled-pipeline.js +15 -4
- package/dist/packages/compiler/compiled-schema.js +1 -1
- package/dist/packages/compiler/compiled-stage-plan.d.ts +2 -2
- package/dist/packages/compiler/compiled-stage-plan.js +4 -4
- package/dist/packages/compiler/compiled-stage-runner.d.ts +5 -0
- package/dist/packages/compiler/compiled-stage-runner.js +50 -2
- package/dist/packages/compiler/compiled-target.d.ts +1 -1
- package/dist/packages/compiler/compiled-target.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +161 -1
- package/dist/packages/compiler/lib/schema.js +87 -1
- package/dist/packages/compiler/raw-snapshot.d.ts +9 -2
- package/dist/packages/compiler/runtime-acceptance.js +1 -1
- package/dist/packages/compiler/runtime-contracts.js +2 -2
- package/dist/packages/compiler/runtime-prompt.js +6 -6
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +3 -0
- package/dist/packages/compiler/runtime-types.d.ts +1 -0
- package/dist/packages/compiler/state-health.js +1 -1
- package/dist/packages/compiler/state-view.js +2 -2
- package/dist/packages/compiler/validate-compiled.js +11 -9
- package/dist/packages/execution/adapters.d.ts +15 -0
- package/dist/packages/execution/adapters.js +1 -0
- package/dist/packages/execution/events.d.ts +8 -0
- package/dist/packages/execution/events.js +16 -0
- package/dist/packages/execution/index.d.ts +9 -0
- package/dist/packages/execution/index.js +6 -0
- package/dist/packages/execution/lib/schema.d.ts +1554 -0
- package/dist/packages/execution/lib/schema.js +319 -0
- package/dist/packages/local-service/action-values.d.ts +23 -0
- package/dist/packages/local-service/action-values.js +31 -0
- package/dist/packages/local-service/client.d.ts +119 -0
- package/dist/packages/local-service/client.js +356 -0
- package/dist/packages/local-service/index.d.ts +15 -0
- package/dist/packages/local-service/index.js +11 -0
- package/dist/packages/local-service/lib/schema.d.ts +7355 -0
- package/dist/packages/local-service/lib/schema.js +636 -0
- package/dist/packages/local-service/routes.d.ts +27 -0
- package/dist/packages/local-service/routes.js +32 -0
- package/dist/packages/local-service/runtime.d.ts +134 -0
- package/dist/packages/local-service/runtime.js +2841 -0
- package/dist/packages/local-service/server.d.ts +17 -0
- package/dist/packages/local-service/server.js +572 -0
- package/dist/packages/project-model/index.d.ts +2 -1
- package/dist/packages/project-model/index.js +1 -0
- package/dist/packages/project-model/interf-detect.d.ts +6 -2
- package/dist/packages/project-model/interf-detect.js +25 -10
- package/dist/packages/project-model/interf-scaffold.js +9 -6
- package/dist/packages/project-model/interf.d.ts +1 -1
- package/dist/packages/project-model/interf.js +1 -1
- package/dist/packages/project-model/lib/schema.d.ts +80 -6
- package/dist/packages/project-model/lib/schema.js +29 -19
- package/dist/packages/project-model/source-config.d.ts +22 -13
- package/dist/packages/project-model/source-config.js +140 -123
- package/dist/packages/project-model/source-folders.d.ts +11 -0
- package/dist/packages/project-model/source-folders.js +110 -0
- package/dist/packages/testing/test-execution.js +5 -5
- package/dist/packages/testing/test-paths.js +1 -3
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +4 -6
- package/dist/packages/workflow-authoring/workflow-authoring.js +45 -86
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +2 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +80 -49
- package/dist/packages/workflow-authoring/workflow-improvement.js +2 -1
- package/dist/packages/workflow-package/context-interface.js +1 -1
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +6 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +115 -8
- package/dist/packages/workflow-package/local-workflows.js +33 -17
- package/dist/packages/workflow-package/workflow-definitions.d.ts +5 -5
- package/dist/packages/workflow-package/workflow-definitions.js +23 -22
- package/dist/packages/workflow-package/workflow-helpers.js +10 -6
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +1 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +2 -0
- package/package.json +17 -1
- package/dist/cli/commands/dataset-selection.d.ts +0 -6
- package/dist/cli/commands/dataset-selection.js +0 -11
- package/dist/lib/agent-args.d.ts +0 -1
- package/dist/lib/agent-args.js +0 -1
- package/dist/lib/agent-constants.d.ts +0 -1
- package/dist/lib/agent-constants.js +0 -1
- package/dist/lib/agent-detection.d.ts +0 -1
- package/dist/lib/agent-detection.js +0 -1
- package/dist/lib/agent-execution.d.ts +0 -1
- package/dist/lib/agent-execution.js +0 -1
- package/dist/lib/agent-logs.d.ts +0 -1
- package/dist/lib/agent-logs.js +0 -1
- package/dist/lib/agent-preflight.d.ts +0 -1
- package/dist/lib/agent-preflight.js +0 -1
- package/dist/lib/agent-render.d.ts +0 -1
- package/dist/lib/agent-render.js +0 -1
- package/dist/lib/agent-shells.d.ts +0 -1
- package/dist/lib/agent-shells.js +0 -1
- package/dist/lib/agent-status.d.ts +0 -1
- package/dist/lib/agent-status.js +0 -1
- package/dist/lib/agent-types.d.ts +0 -1
- package/dist/lib/agent-types.js +0 -1
- package/dist/lib/agents.d.ts +0 -1
- package/dist/lib/agents.js +0 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
- package/dist/lib/builtin-compiled-workflow.js +0 -1
- package/dist/lib/chart-guidance.d.ts +0 -1
- package/dist/lib/chart-guidance.js +0 -1
- package/dist/lib/compiled-compile.d.ts +0 -1
- package/dist/lib/compiled-compile.js +0 -1
- package/dist/lib/compiled-paths.d.ts +0 -1
- package/dist/lib/compiled-paths.js +0 -3
- package/dist/lib/compiled-raw.d.ts +0 -1
- package/dist/lib/compiled-raw.js +0 -3
- package/dist/lib/compiled-reset.d.ts +0 -1
- package/dist/lib/compiled-reset.js +0 -3
- package/dist/lib/compiled-schema.d.ts +0 -1
- package/dist/lib/compiled-schema.js +0 -1
- package/dist/lib/discovery.d.ts +0 -1
- package/dist/lib/discovery.js +0 -1
- package/dist/lib/execution-profile.d.ts +0 -1
- package/dist/lib/execution-profile.js +0 -1
- package/dist/lib/executors.d.ts +0 -1
- package/dist/lib/executors.js +0 -1
- package/dist/lib/filesystem.d.ts +0 -1
- package/dist/lib/filesystem.js +0 -1
- package/dist/lib/interf-bootstrap.d.ts +0 -1
- package/dist/lib/interf-bootstrap.js +0 -3
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +0 -3
- package/dist/lib/interf-scaffold.d.ts +0 -1
- package/dist/lib/interf-scaffold.js +0 -3
- package/dist/lib/interf-workflow-package.d.ts +0 -1
- package/dist/lib/interf-workflow-package.js +0 -1
- package/dist/lib/interf.d.ts +0 -1
- package/dist/lib/interf.js +0 -3
- package/dist/lib/local-workflows.d.ts +0 -1
- package/dist/lib/local-workflows.js +0 -1
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/package-root.d.ts +0 -1
- package/dist/lib/package-root.js +0 -1
- package/dist/lib/parse.d.ts +0 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/project-paths.d.ts +0 -1
- package/dist/lib/project-paths.js +0 -3
- package/dist/lib/runtime-acceptance.d.ts +0 -1
- package/dist/lib/runtime-acceptance.js +0 -1
- package/dist/lib/runtime-contracts.d.ts +0 -1
- package/dist/lib/runtime-contracts.js +0 -1
- package/dist/lib/runtime-inventory.d.ts +0 -1
- package/dist/lib/runtime-inventory.js +0 -1
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-paths.js +0 -1
- package/dist/lib/runtime-prompt.d.ts +0 -1
- package/dist/lib/runtime-prompt.js +0 -1
- package/dist/lib/runtime-reconcile.d.ts +0 -1
- package/dist/lib/runtime-reconcile.js +0 -1
- package/dist/lib/runtime-runs.d.ts +0 -1
- package/dist/lib/runtime-runs.js +0 -1
- package/dist/lib/runtime-types.d.ts +0 -1
- package/dist/lib/runtime-types.js +0 -1
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/schema.d.ts +0 -4
- package/dist/lib/schema.js +0 -6
- package/dist/lib/source-config.d.ts +0 -1
- package/dist/lib/source-config.js +0 -3
- package/dist/lib/state-artifacts.d.ts +0 -1
- package/dist/lib/state-artifacts.js +0 -1
- package/dist/lib/state-health.d.ts +0 -1
- package/dist/lib/state-health.js +0 -1
- package/dist/lib/state-io.d.ts +0 -1
- package/dist/lib/state-io.js +0 -1
- package/dist/lib/state-paths.d.ts +0 -1
- package/dist/lib/state-paths.js +0 -1
- package/dist/lib/state-view.d.ts +0 -1
- package/dist/lib/state-view.js +0 -1
- package/dist/lib/state.d.ts +0 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/test-execution.d.ts +0 -1
- package/dist/lib/test-execution.js +0 -3
- package/dist/lib/test-matrices.d.ts +0 -1
- package/dist/lib/test-matrices.js +0 -3
- package/dist/lib/test-paths.d.ts +0 -1
- package/dist/lib/test-paths.js +0 -3
- package/dist/lib/test-profile-presets.d.ts +0 -1
- package/dist/lib/test-profile-presets.js +0 -3
- package/dist/lib/test-sandbox.d.ts +0 -1
- package/dist/lib/test-sandbox.js +0 -3
- package/dist/lib/test-specs.d.ts +0 -1
- package/dist/lib/test-specs.js +0 -3
- package/dist/lib/test-targets.d.ts +0 -1
- package/dist/lib/test-targets.js +0 -3
- package/dist/lib/test-types.d.ts +0 -1
- package/dist/lib/test-types.js +0 -3
- package/dist/lib/test.d.ts +0 -1
- package/dist/lib/test.js +0 -3
- package/dist/lib/util.d.ts +0 -1
- package/dist/lib/util.js +0 -1
- package/dist/lib/validate-compiled.d.ts +0 -1
- package/dist/lib/validate-compiled.js +0 -1
- package/dist/lib/validate-helpers.d.ts +0 -1
- package/dist/lib/validate-helpers.js +0 -1
- package/dist/lib/validate.d.ts +0 -1
- package/dist/lib/validate.js +0 -1
- package/dist/lib/workflow-authoring.d.ts +0 -1
- package/dist/lib/workflow-authoring.js +0 -1
- package/dist/lib/workflow-definitions.d.ts +0 -1
- package/dist/lib/workflow-definitions.js +0 -1
- package/dist/lib/workflow-edit-session.d.ts +0 -1
- package/dist/lib/workflow-edit-session.js +0 -1
- package/dist/lib/workflow-edit-utils.d.ts +0 -1
- package/dist/lib/workflow-edit-utils.js +0 -1
- package/dist/lib/workflow-helpers.d.ts +0 -1
- package/dist/lib/workflow-helpers.js +0 -1
- package/dist/lib/workflow-improvement.d.ts +0 -1
- package/dist/lib/workflow-improvement.js +0 -1
- package/dist/lib/workflow-primitives.d.ts +0 -1
- package/dist/lib/workflow-primitives.js +0 -1
- package/dist/lib/workflow-review-paths.d.ts +0 -1
- package/dist/lib/workflow-review-paths.js +0 -1
- package/dist/lib/workflow-stage-policy.d.ts +0 -1
- package/dist/lib/workflow-stage-policy.js +0 -1
- package/dist/lib/workflow-stage-runner.d.ts +0 -1
- package/dist/lib/workflow-stage-runner.js +0 -1
- package/dist/lib/workflows.d.ts +0 -1
- package/dist/lib/workflows.js +0 -1
|
@@ -7,10 +7,14 @@ import { resolveSourceControlPathForCompiled, compiledInterfConfigPath, } from "
|
|
|
7
7
|
import { InterfConfigSchema, } from "./lib/schema.js";
|
|
8
8
|
import { assertPathWithinRoot } from "../shared/path-guards.js";
|
|
9
9
|
export const INTERF_CONTAINER_NAME = "interf";
|
|
10
|
-
export const
|
|
10
|
+
export const METHOD_CONTAINER_NAME = "methods";
|
|
11
|
+
export const WORKFLOW_CONTAINER_NAME = METHOD_CONTAINER_NAME;
|
|
12
|
+
export const LEGACY_WORKFLOW_CONTAINER_NAME = "workflows";
|
|
11
13
|
export const TEST_CONTAINER_NAME = "tests";
|
|
12
14
|
export const INTERF_CONFIG_FILE = "interf.json";
|
|
13
|
-
export const
|
|
15
|
+
export const METHOD_PACKAGE_DIR = "method";
|
|
16
|
+
export const WORKFLOW_PACKAGE_DIR = METHOD_PACKAGE_DIR;
|
|
17
|
+
export const LEGACY_WORKFLOW_PACKAGE_DIR = "workflow";
|
|
14
18
|
export function readInterfConfig(dirPath) {
|
|
15
19
|
const configPath = compiledInterfConfigPath(dirPath);
|
|
16
20
|
if (!existsSync(configPath))
|
|
@@ -61,11 +65,17 @@ export function resolveSourceControlPath(compiledPath) {
|
|
|
61
65
|
}
|
|
62
66
|
export function resolveSourceInputPath(compiledPath) {
|
|
63
67
|
const config = readInterfConfig(compiledPath);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
68
|
+
const sourceBinding = typeof config?.source?.preparation_path === "string" && config.source.preparation_path.length > 0
|
|
69
|
+
? config.source.preparation_path
|
|
70
|
+
: typeof config?.source?.source_folder_path === "string" && config.source.source_folder_path.length > 0
|
|
71
|
+
? config.source.source_folder_path
|
|
72
|
+
: typeof config?.source?.dataset_path === "string" && config.source.dataset_path.length > 0
|
|
73
|
+
? config.source.dataset_path
|
|
74
|
+
: null;
|
|
75
|
+
if (sourceBinding) {
|
|
76
|
+
return resolve(compiledPath, sourceBinding);
|
|
67
77
|
}
|
|
68
|
-
throw new Error(`
|
|
78
|
+
throw new Error(`Portable context is missing source.preparation_path in ${compiledInterfConfigPath(compiledPath)}.`);
|
|
69
79
|
}
|
|
70
80
|
export function listCompiledDatasetsForSourceFolder(sourcePath) {
|
|
71
81
|
const interfRoot = projectInterfRoot(sourcePath);
|
|
@@ -82,6 +92,7 @@ export function listCompiledDatasetsForSourceFolder(sourcePath) {
|
|
|
82
92
|
return readdirSync(interfRoot)
|
|
83
93
|
.filter((entry) => !entry.startsWith(".") &&
|
|
84
94
|
entry !== WORKFLOW_CONTAINER_NAME &&
|
|
95
|
+
entry !== LEGACY_WORKFLOW_CONTAINER_NAME &&
|
|
85
96
|
entry !== TEST_CONTAINER_NAME &&
|
|
86
97
|
entry !== INTERF_CONFIG_FILE)
|
|
87
98
|
.map((entry) => compiledCompiledPathForDataset(sourcePath, entry))
|
|
@@ -112,12 +123,14 @@ export function assertCompiledContainer(sourcePath) {
|
|
|
112
123
|
return true;
|
|
113
124
|
}
|
|
114
125
|
}
|
|
115
|
-
if (entry === WORKFLOW_CONTAINER_NAME ||
|
|
126
|
+
if (entry === WORKFLOW_CONTAINER_NAME ||
|
|
127
|
+
entry === LEGACY_WORKFLOW_CONTAINER_NAME ||
|
|
128
|
+
entry === TEST_CONTAINER_NAME) {
|
|
116
129
|
try {
|
|
117
130
|
return !statSync(entryPath).isDirectory();
|
|
118
131
|
}
|
|
119
132
|
catch (error) {
|
|
120
|
-
warnInterf(`Warning: failed to inspect Interf
|
|
133
|
+
warnInterf(`Warning: failed to inspect Interf Workspace path at ${entryPath}: ${error instanceof Error ? error.message : String(error)}`);
|
|
121
134
|
return true;
|
|
122
135
|
}
|
|
123
136
|
}
|
|
@@ -154,7 +167,9 @@ export function assertCompiledContainer(sourcePath) {
|
|
|
154
167
|
return true;
|
|
155
168
|
}
|
|
156
169
|
}
|
|
157
|
-
if (entry === WORKFLOW_CONTAINER_NAME ||
|
|
170
|
+
if (entry === WORKFLOW_CONTAINER_NAME ||
|
|
171
|
+
entry === LEGACY_WORKFLOW_CONTAINER_NAME ||
|
|
172
|
+
entry === TEST_CONTAINER_NAME)
|
|
158
173
|
return false;
|
|
159
174
|
const entryPath = join(containerPath, entry);
|
|
160
175
|
try {
|
|
@@ -168,7 +183,7 @@ export function assertCompiledContainer(sourcePath) {
|
|
|
168
183
|
return false;
|
|
169
184
|
});
|
|
170
185
|
if (unexpectedEntries.length > 0) {
|
|
171
|
-
throw new Error(`Interf container contains invalid
|
|
186
|
+
throw new Error(`Interf container contains invalid Preparation entries: ${containerPath}`);
|
|
172
187
|
}
|
|
173
188
|
return containerPath;
|
|
174
189
|
}
|
|
@@ -9,7 +9,7 @@ import { assertCompiledContainer, assertCompiledName, } from "./interf-detect.js
|
|
|
9
9
|
import { seedCompiledWorkflowPackage } from "../workflow-package/interf-workflow-package.js";
|
|
10
10
|
import { compiledCompiledPathForDataset } from "./project-paths.js";
|
|
11
11
|
import { ensureCompiledZoneTargets, readCompiledSchemaFile } from "../compiler/compiled-schema.js";
|
|
12
|
-
import { findSourceDatasetConfig, listSourceDatasetConfigs, loadSourceFolderConfig, resolveSourceDatasetPath, saveCompiledInterfConfig, } from "./source-config.js";
|
|
12
|
+
import { findSourceDatasetConfig, listSourceDatasetConfigs, loadSourceFolderConfig, methodIdForSourcePreparationConfig, resolveSourceDatasetPath, saveCompiledInterfConfig, } from "./source-config.js";
|
|
13
13
|
import { defaultControlPathForCompiled, testRootForCompiled, workflowPackagePathForCompiled } from "../compiler/compiled-paths.js";
|
|
14
14
|
const DEFAULT_INTERFIGNORE = [
|
|
15
15
|
".claude/",
|
|
@@ -91,7 +91,10 @@ export function ensurePortableContextScaffold(sourcePath, datasetName, workflowI
|
|
|
91
91
|
export function createCompiled(name, sourcePath, workflowId = "interf", about, datasetPath) {
|
|
92
92
|
assertCompiledName(name, "Portable context");
|
|
93
93
|
const savedCompiled = findSourceDatasetConfig(loadSourceFolderConfig(sourcePath), name);
|
|
94
|
-
const
|
|
94
|
+
const effectiveWorkflowId = workflowId === "interf"
|
|
95
|
+
? methodIdForSourcePreparationConfig(savedCompiled) ?? workflowId
|
|
96
|
+
: workflowId;
|
|
97
|
+
const selectedWorkflow = getCompiledWorkflow(effectiveWorkflowId, { sourcePath });
|
|
95
98
|
const compiledPath = ensurePortableContextScaffold(sourcePath, name, selectedWorkflow.id);
|
|
96
99
|
const resolvedAbout = about ?? savedCompiled?.about;
|
|
97
100
|
const resolvedDatasetPath = (() => {
|
|
@@ -105,13 +108,13 @@ export function createCompiled(name, sourcePath, workflowId = "interf", about, d
|
|
|
105
108
|
if (configuredDatasets.length === 1) {
|
|
106
109
|
return resolveSourceDatasetPath(sourcePath, configuredDatasets[0]);
|
|
107
110
|
}
|
|
108
|
-
throw new Error("Cannot infer the source folder for this portable context. Select a source folder first or pass an explicit
|
|
111
|
+
throw new Error("Cannot infer the source folder for this portable context. Select a source folder first or pass an explicit source folder path.");
|
|
109
112
|
})();
|
|
110
113
|
saveCompiledInterfConfig(compiledPath, {
|
|
111
114
|
type: "compiled",
|
|
112
115
|
name,
|
|
113
116
|
...(resolvedAbout ? { about: resolvedAbout } : {}),
|
|
114
|
-
|
|
117
|
+
method: selectedWorkflow.id,
|
|
115
118
|
...(typeof savedCompiled?.max_attempts === "number"
|
|
116
119
|
? { max_attempts: savedCompiled.max_attempts }
|
|
117
120
|
: {}),
|
|
@@ -119,14 +122,14 @@ export function createCompiled(name, sourcePath, workflowId = "interf", about, d
|
|
|
119
122
|
? { max_loops: savedCompiled.max_loops }
|
|
120
123
|
: {}),
|
|
121
124
|
checks: savedCompiled?.checks ?? [],
|
|
122
|
-
|
|
125
|
+
method_origin: {
|
|
123
126
|
selected: selectedWorkflow.id,
|
|
124
127
|
local_draft: false,
|
|
125
128
|
},
|
|
126
129
|
source: {
|
|
127
130
|
path: "./raw",
|
|
128
131
|
control_path: defaultControlPathForCompiled(compiledPath),
|
|
129
|
-
|
|
132
|
+
preparation_path: relative(compiledPath, resolvedDatasetPath).split(sep).join("/") || ".",
|
|
130
133
|
},
|
|
131
134
|
});
|
|
132
135
|
mkdirSync(join(compiledPath, "raw"), { recursive: true });
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
1
|
+
export { INTERF_CONTAINER_NAME, METHOD_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, LEGACY_WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, METHOD_PACKAGE_DIR, WORKFLOW_PACKAGE_DIR, LEGACY_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";
|
|
@@ -1,4 +1,4 @@
|
|
|
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";
|
|
1
|
+
export { INTERF_CONTAINER_NAME, METHOD_CONTAINER_NAME, WORKFLOW_CONTAINER_NAME, LEGACY_WORKFLOW_CONTAINER_NAME, TEST_CONTAINER_NAME, INTERF_CONFIG_FILE, METHOD_PACKAGE_DIR, WORKFLOW_PACKAGE_DIR, LEGACY_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, ensurePortableContextScaffold, } from "./interf-scaffold.js";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const DatasetNameSchema: z.ZodString;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const PreparationNameSchema: z.ZodString;
|
|
4
|
+
export declare const MethodIdSchema: z.ZodString;
|
|
5
|
+
export declare const SourceReadinessCheckSchema: z.ZodObject<{
|
|
4
6
|
id: z.ZodOptional<z.ZodString>;
|
|
5
7
|
question: z.ZodString;
|
|
6
8
|
answer: z.ZodOptional<z.ZodString>;
|
|
@@ -13,11 +15,35 @@ export declare const SourceTruthCheckSchema: z.ZodObject<{
|
|
|
13
15
|
}, z.core.$strip>>;
|
|
14
16
|
strictness: z.ZodOptional<z.ZodString>;
|
|
15
17
|
}, z.core.$strict>;
|
|
18
|
+
export declare const SourcePreparationConfigSchema: z.ZodObject<{
|
|
19
|
+
id: z.ZodOptional<z.ZodString>;
|
|
20
|
+
name: z.ZodString;
|
|
21
|
+
path: z.ZodString;
|
|
22
|
+
about: z.ZodOptional<z.ZodString>;
|
|
23
|
+
method: z.ZodOptional<z.ZodString>;
|
|
24
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
25
|
+
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
26
|
+
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
28
|
+
id: z.ZodOptional<z.ZodString>;
|
|
29
|
+
question: z.ZodString;
|
|
30
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
31
|
+
expect: z.ZodOptional<z.ZodObject<{
|
|
32
|
+
must_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
33
|
+
must_include_one_of: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
34
|
+
must_not_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
35
|
+
min_words: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
max_words: z.ZodOptional<z.ZodNumber>;
|
|
37
|
+
}, z.core.$strip>>;
|
|
38
|
+
strictness: z.ZodOptional<z.ZodString>;
|
|
39
|
+
}, z.core.$strict>>>;
|
|
40
|
+
}, z.core.$strict>;
|
|
16
41
|
export declare const SourceDatasetConfigSchema: z.ZodObject<{
|
|
17
42
|
id: z.ZodOptional<z.ZodString>;
|
|
18
43
|
name: z.ZodString;
|
|
19
44
|
path: z.ZodString;
|
|
20
45
|
about: z.ZodOptional<z.ZodString>;
|
|
46
|
+
method: z.ZodOptional<z.ZodString>;
|
|
21
47
|
workflow: z.ZodOptional<z.ZodString>;
|
|
22
48
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
23
49
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
@@ -35,11 +61,15 @@ export declare const SourceDatasetConfigSchema: z.ZodObject<{
|
|
|
35
61
|
strictness: z.ZodOptional<z.ZodString>;
|
|
36
62
|
}, z.core.$strict>>>;
|
|
37
63
|
}, z.core.$strict>;
|
|
64
|
+
export declare const SourceFolderBindingSchema: z.ZodObject<{
|
|
65
|
+
path: z.ZodString;
|
|
66
|
+
}, z.core.$strict>;
|
|
38
67
|
export declare const CompiledInterfConfigSchema: z.ZodObject<{
|
|
39
68
|
type: z.ZodLiteral<"compiled">;
|
|
40
69
|
name: z.ZodString;
|
|
41
70
|
about: z.ZodOptional<z.ZodString>;
|
|
42
|
-
|
|
71
|
+
method: z.ZodString;
|
|
72
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
43
73
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
44
74
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
45
75
|
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -55,6 +85,10 @@ export declare const CompiledInterfConfigSchema: z.ZodObject<{
|
|
|
55
85
|
}, z.core.$strip>>;
|
|
56
86
|
strictness: z.ZodOptional<z.ZodString>;
|
|
57
87
|
}, z.core.$strict>>>;
|
|
88
|
+
method_origin: z.ZodOptional<z.ZodObject<{
|
|
89
|
+
selected: z.ZodString;
|
|
90
|
+
local_draft: z.ZodOptional<z.ZodBoolean>;
|
|
91
|
+
}, z.core.$strip>>;
|
|
58
92
|
workflow_origin: z.ZodOptional<z.ZodObject<{
|
|
59
93
|
selected: z.ZodString;
|
|
60
94
|
local_draft: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -62,14 +96,17 @@ export declare const CompiledInterfConfigSchema: z.ZodObject<{
|
|
|
62
96
|
source: z.ZodObject<{
|
|
63
97
|
path: z.ZodString;
|
|
64
98
|
control_path: z.ZodOptional<z.ZodString>;
|
|
65
|
-
|
|
99
|
+
preparation_path: z.ZodOptional<z.ZodString>;
|
|
100
|
+
source_folder_path: z.ZodOptional<z.ZodString>;
|
|
101
|
+
dataset_path: z.ZodOptional<z.ZodString>;
|
|
66
102
|
}, z.core.$strip>;
|
|
67
103
|
}, z.core.$loose>;
|
|
68
104
|
export declare const InterfConfigSchema: z.ZodObject<{
|
|
69
105
|
type: z.ZodLiteral<"compiled">;
|
|
70
106
|
name: z.ZodString;
|
|
71
107
|
about: z.ZodOptional<z.ZodString>;
|
|
72
|
-
|
|
108
|
+
method: z.ZodString;
|
|
109
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
73
110
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
74
111
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
75
112
|
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
@@ -85,6 +122,10 @@ export declare const InterfConfigSchema: z.ZodObject<{
|
|
|
85
122
|
}, z.core.$strip>>;
|
|
86
123
|
strictness: z.ZodOptional<z.ZodString>;
|
|
87
124
|
}, z.core.$strict>>>;
|
|
125
|
+
method_origin: z.ZodOptional<z.ZodObject<{
|
|
126
|
+
selected: z.ZodString;
|
|
127
|
+
local_draft: z.ZodOptional<z.ZodBoolean>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
88
129
|
workflow_origin: z.ZodOptional<z.ZodObject<{
|
|
89
130
|
selected: z.ZodString;
|
|
90
131
|
local_draft: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -92,15 +133,44 @@ export declare const InterfConfigSchema: z.ZodObject<{
|
|
|
92
133
|
source: z.ZodObject<{
|
|
93
134
|
path: z.ZodString;
|
|
94
135
|
control_path: z.ZodOptional<z.ZodString>;
|
|
95
|
-
|
|
136
|
+
preparation_path: z.ZodOptional<z.ZodString>;
|
|
137
|
+
source_folder_path: z.ZodOptional<z.ZodString>;
|
|
138
|
+
dataset_path: z.ZodOptional<z.ZodString>;
|
|
96
139
|
}, z.core.$strip>;
|
|
97
140
|
}, z.core.$loose>;
|
|
98
141
|
export declare const SourceFolderConfigSchema: z.ZodObject<{
|
|
142
|
+
source_folder: z.ZodOptional<z.ZodObject<{
|
|
143
|
+
path: z.ZodString;
|
|
144
|
+
}, z.core.$strict>>;
|
|
145
|
+
preparations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
146
|
+
id: z.ZodOptional<z.ZodString>;
|
|
147
|
+
name: z.ZodString;
|
|
148
|
+
path: z.ZodString;
|
|
149
|
+
about: z.ZodOptional<z.ZodString>;
|
|
150
|
+
method: z.ZodOptional<z.ZodString>;
|
|
151
|
+
workflow: z.ZodOptional<z.ZodString>;
|
|
152
|
+
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
154
|
+
checks: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
155
|
+
id: z.ZodOptional<z.ZodString>;
|
|
156
|
+
question: z.ZodString;
|
|
157
|
+
answer: z.ZodOptional<z.ZodString>;
|
|
158
|
+
expect: z.ZodOptional<z.ZodObject<{
|
|
159
|
+
must_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
160
|
+
must_include_one_of: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString>>>;
|
|
161
|
+
must_not_include: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
min_words: z.ZodOptional<z.ZodNumber>;
|
|
163
|
+
max_words: z.ZodOptional<z.ZodNumber>;
|
|
164
|
+
}, z.core.$strip>>;
|
|
165
|
+
strictness: z.ZodOptional<z.ZodString>;
|
|
166
|
+
}, z.core.$strict>>>;
|
|
167
|
+
}, z.core.$strict>>>;
|
|
99
168
|
datasets: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
100
169
|
id: z.ZodOptional<z.ZodString>;
|
|
101
170
|
name: z.ZodString;
|
|
102
171
|
path: z.ZodString;
|
|
103
172
|
about: z.ZodOptional<z.ZodString>;
|
|
173
|
+
method: z.ZodOptional<z.ZodString>;
|
|
104
174
|
workflow: z.ZodOptional<z.ZodString>;
|
|
105
175
|
max_attempts: z.ZodOptional<z.ZodNumber>;
|
|
106
176
|
max_loops: z.ZodOptional<z.ZodNumber>;
|
|
@@ -119,7 +189,11 @@ export declare const SourceFolderConfigSchema: z.ZodObject<{
|
|
|
119
189
|
}, z.core.$strict>>>;
|
|
120
190
|
}, z.core.$strict>>>;
|
|
121
191
|
}, z.core.$strict>;
|
|
122
|
-
export type
|
|
192
|
+
export type SourceFolderBinding = z.infer<typeof SourceFolderBindingSchema>;
|
|
193
|
+
export type SourceReadinessCheck = z.infer<typeof SourceReadinessCheckSchema>;
|
|
123
194
|
export type SourceDatasetConfig = z.infer<typeof SourceDatasetConfigSchema>;
|
|
195
|
+
export type PreparationName = z.infer<typeof PreparationNameSchema>;
|
|
196
|
+
export type MethodId = z.infer<typeof MethodIdSchema>;
|
|
197
|
+
export type SourcePreparationConfig = z.infer<typeof SourcePreparationConfigSchema>;
|
|
124
198
|
export type InterfConfig = z.infer<typeof InterfConfigSchema>;
|
|
125
199
|
export type SourceFolderConfig = z.infer<typeof SourceFolderConfigSchema>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, WorkflowIdPattern, WorkflowIdSchema, } from "../../compiler/lib/schema.js";
|
|
3
3
|
const DatasetNamePattern = /^[a-z0-9][a-z0-9-]*$/;
|
|
4
|
-
const RESERVED_DATASET_NAMES = new Set(["tests", "workflows"]);
|
|
4
|
+
const RESERVED_DATASET_NAMES = new Set(["tests", "methods", "workflows"]);
|
|
5
5
|
export const DatasetNameSchema = z
|
|
6
6
|
.string()
|
|
7
|
-
.regex(DatasetNamePattern, "
|
|
8
|
-
.refine((value) => !RESERVED_DATASET_NAMES.has(value), "
|
|
9
|
-
export const
|
|
7
|
+
.regex(DatasetNamePattern, "Preparation names must use lowercase letters, numbers, and dashes only.")
|
|
8
|
+
.refine((value) => !RESERVED_DATASET_NAMES.has(value), "Preparation name is reserved.");
|
|
9
|
+
export const PreparationNameSchema = DatasetNameSchema;
|
|
10
|
+
export const MethodIdSchema = WorkflowIdSchema;
|
|
11
|
+
export const SourceReadinessCheckSchema = z.object({
|
|
10
12
|
id: z.string().regex(WorkflowIdPattern).optional(),
|
|
11
13
|
question: z.string().min(1),
|
|
12
14
|
answer: z.string().min(1).optional(),
|
|
@@ -17,28 +19,38 @@ export const SourceTruthCheckSchema = z.object({
|
|
|
17
19
|
ctx.addIssue({
|
|
18
20
|
code: z.ZodIssueCode.custom,
|
|
19
21
|
path: ["answer"],
|
|
20
|
-
message: "
|
|
22
|
+
message: "Readiness checks need `answer` or `expect`.",
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
25
|
});
|
|
24
|
-
export const
|
|
26
|
+
export const SourcePreparationConfigSchema = z.object({
|
|
25
27
|
id: z.string().regex(WorkflowIdPattern).optional(),
|
|
26
|
-
name:
|
|
28
|
+
name: PreparationNameSchema,
|
|
27
29
|
path: z.string().min(1),
|
|
28
30
|
about: z.string().min(1).optional(),
|
|
31
|
+
method: MethodIdSchema.optional(),
|
|
29
32
|
workflow: WorkflowIdSchema.optional(),
|
|
30
33
|
max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
|
|
31
34
|
max_loops: SourceCompiledMaxLoopsSchema.optional(),
|
|
32
|
-
checks: z.array(
|
|
35
|
+
checks: z.array(SourceReadinessCheckSchema).default([]),
|
|
36
|
+
}).strict();
|
|
37
|
+
export const SourceDatasetConfigSchema = SourcePreparationConfigSchema;
|
|
38
|
+
export const SourceFolderBindingSchema = z.object({
|
|
39
|
+
path: z.string().min(1),
|
|
33
40
|
}).strict();
|
|
34
41
|
export const CompiledInterfConfigSchema = z.object({
|
|
35
42
|
type: z.literal("compiled"),
|
|
36
43
|
name: DatasetNameSchema,
|
|
37
44
|
about: z.string().optional(),
|
|
38
|
-
|
|
45
|
+
method: MethodIdSchema,
|
|
46
|
+
workflow: WorkflowIdSchema.optional(),
|
|
39
47
|
max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
|
|
40
48
|
max_loops: SourceCompiledMaxLoopsSchema.optional(),
|
|
41
|
-
checks: z.array(
|
|
49
|
+
checks: z.array(SourceReadinessCheckSchema).default([]),
|
|
50
|
+
method_origin: z.object({
|
|
51
|
+
selected: MethodIdSchema,
|
|
52
|
+
local_draft: z.boolean().optional(),
|
|
53
|
+
}).optional(),
|
|
42
54
|
workflow_origin: z.object({
|
|
43
55
|
selected: WorkflowIdSchema,
|
|
44
56
|
local_draft: z.boolean().optional(),
|
|
@@ -46,17 +58,15 @@ export const CompiledInterfConfigSchema = z.object({
|
|
|
46
58
|
source: z.object({
|
|
47
59
|
path: z.string(),
|
|
48
60
|
control_path: z.string().optional(),
|
|
49
|
-
|
|
61
|
+
preparation_path: z.string().optional(),
|
|
62
|
+
source_folder_path: z.string().optional(),
|
|
63
|
+
dataset_path: z.string().optional(),
|
|
50
64
|
}),
|
|
51
65
|
}).passthrough();
|
|
52
66
|
export const InterfConfigSchema = CompiledInterfConfigSchema;
|
|
53
67
|
export const SourceFolderConfigSchema = z.object({
|
|
68
|
+
source_folder: SourceFolderBindingSchema.optional(),
|
|
69
|
+
preparations: z.array(SourcePreparationConfigSchema).default([]),
|
|
70
|
+
// Legacy config array. Read for compatibility; new writes use `preparations`.
|
|
54
71
|
datasets: z.array(SourceDatasetConfigSchema).optional(),
|
|
55
|
-
}).strict()
|
|
56
|
-
if ((value.datasets?.length ?? 0) === 0) {
|
|
57
|
-
ctx.addIssue({
|
|
58
|
-
code: z.ZodIssueCode.custom,
|
|
59
|
-
message: "Interf project config needs at least one dataset.",
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
});
|
|
72
|
+
}).strict();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type InterfConfig, type
|
|
1
|
+
import { type InterfConfig, type SourceFolderBinding, type SourceReadinessCheck, type SourceDatasetConfig, type SourcePreparationConfig, type SourceFolderConfig } from "./lib/schema.js";
|
|
2
2
|
import type { TestSpec, TestTargetType } from "../testing/lib/schema.js";
|
|
3
3
|
export declare const SOURCE_FOLDER_CONFIG_FILE = "interf.json";
|
|
4
4
|
export declare const SOURCE_FOLDER_CONFIG_PATH = "interf/interf.json";
|
|
@@ -7,30 +7,38 @@ export interface LoadedSourceTestSpec extends TestSpec {
|
|
|
7
7
|
filePath: string;
|
|
8
8
|
}
|
|
9
9
|
export declare function sourceFolderConfigPath(sourcePath: string): string;
|
|
10
|
-
export declare function legacySourceFolderConfigPath(sourcePath: string): string;
|
|
11
10
|
export declare function resolveSourceFolderConfigPath(sourcePath: string): string;
|
|
12
|
-
export declare function
|
|
13
|
-
export declare function fingerprintTruthChecks(checks: SourceTruthCheck[]): string;
|
|
11
|
+
export declare function fingerprintReadinessChecks(checks: SourceReadinessCheck[]): string;
|
|
14
12
|
export declare function loadSourceFolderConfig(sourcePath: string): SourceFolderConfig | null;
|
|
15
13
|
export interface WritableSourceProjectConfig {
|
|
14
|
+
source_folder?: SourceFolderBinding;
|
|
15
|
+
preparations?: SourcePreparationConfig[];
|
|
16
16
|
datasets?: SourceDatasetConfig[];
|
|
17
17
|
}
|
|
18
|
-
export declare function
|
|
18
|
+
export declare function methodIdForSourcePreparationConfig(preparationConfig: Pick<SourcePreparationConfig, "method" | "workflow"> | null | undefined): string | null;
|
|
19
|
+
export declare function listSourcePreparationConfigs(config: SourceFolderConfig | null): SourcePreparationConfig[];
|
|
20
|
+
export declare const listSourceDatasetConfigs: typeof listSourcePreparationConfigs;
|
|
19
21
|
export declare function resolveDatasetCompileMaxAttempts(datasetConfig: Pick<SourceDatasetConfig, "max_attempts">, override?: number | null): number | null;
|
|
20
22
|
export declare function resolveDatasetCompileMaxLoops(datasetConfig: Pick<SourceDatasetConfig, "max_loops">, override?: number | null): number | null;
|
|
21
|
-
export declare function
|
|
22
|
-
export declare
|
|
23
|
+
export declare function getDefaultSourcePreparationConfig(config: SourceFolderConfig | null): SourcePreparationConfig | null;
|
|
24
|
+
export declare const getDefaultSourceDatasetConfig: typeof getDefaultSourcePreparationConfig;
|
|
25
|
+
export declare function findSourcePreparationConfig(config: SourceFolderConfig | null, preparationName: string): SourcePreparationConfig | null;
|
|
26
|
+
export declare const findSourceDatasetConfig: typeof findSourcePreparationConfig;
|
|
27
|
+
export declare function configuredSourceFolderPath(config: SourceFolderConfig | WritableSourceProjectConfig | null | undefined): string | null;
|
|
28
|
+
export declare function resolveConfiguredSourceFolderPath(sourcePath: string, config?: SourceFolderConfig | WritableSourceProjectConfig | null | undefined): string | null;
|
|
23
29
|
export declare function saveSourceFolderConfig(sourcePath: string, config: WritableSourceProjectConfig): void;
|
|
24
|
-
export declare function appendSourceDatasetChecks(sourcePath: string,
|
|
25
|
-
export declare
|
|
30
|
+
export declare function appendSourceDatasetChecks(sourcePath: string, preparationName: string, checks: SourceReadinessCheck[]): void;
|
|
31
|
+
export declare const appendSourcePreparationChecks: typeof appendSourceDatasetChecks;
|
|
32
|
+
export declare function upsertSourceDatasetConfig(sourcePath: string, preparationConfig: SourcePreparationConfig, options?: {
|
|
26
33
|
matchName?: string;
|
|
27
34
|
}): void;
|
|
35
|
+
export declare const upsertSourcePreparationConfig: typeof upsertSourceDatasetConfig;
|
|
28
36
|
export declare function compiledMaxAttempts(maxAttempts: number | null | undefined): number | undefined;
|
|
29
37
|
export declare function compiledMaxLoops(maxLoops: number | null | undefined): number | undefined;
|
|
30
|
-
export declare function sourceDatasetConfigFromInterfConfig(config: InterfConfig,
|
|
31
|
-
export declare function loadCompiledDatasetConfig(compiledPath: string):
|
|
38
|
+
export declare function sourceDatasetConfigFromInterfConfig(config: InterfConfig, preparationPath?: string): SourcePreparationConfig;
|
|
39
|
+
export declare function loadCompiledDatasetConfig(compiledPath: string): SourcePreparationConfig | null;
|
|
32
40
|
export declare function saveCompiledInterfConfig(compiledPath: string, config: InterfConfig): InterfConfig;
|
|
33
|
-
export declare function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath: string, datasetConfig:
|
|
41
|
+
export declare function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath: string, datasetConfig: SourcePreparationConfig): InterfConfig;
|
|
34
42
|
export declare function buildTestSpecFromSourceFolderConfig(options: {
|
|
35
43
|
sourcePath: string;
|
|
36
44
|
targetName?: string | null;
|
|
@@ -40,4 +48,5 @@ export declare function buildTestSpecFromCompiledDatasetConfig(options: {
|
|
|
40
48
|
compiledPath: string;
|
|
41
49
|
targetType?: TestTargetType;
|
|
42
50
|
}): LoadedSourceTestSpec | null;
|
|
43
|
-
export declare function resolveSourceDatasetPath(projectPath: string, datasetConfig: Pick<
|
|
51
|
+
export declare function resolveSourceDatasetPath(projectPath: string, datasetConfig: Pick<SourcePreparationConfig, "path">): string;
|
|
52
|
+
export declare const resolveSourcePreparationPath: typeof resolveSourceDatasetPath;
|