@interf/compiler 0.6.1 → 0.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -74
- package/builtin-workflows/interf/README.md +5 -5
- package/builtin-workflows/interf/compile/stages/shape/SKILL.md +4 -4
- package/builtin-workflows/interf/improve/SKILL.md +2 -2
- package/builtin-workflows/interf/use/query/SKILL.md +1 -1
- package/builtin-workflows/interf/workflow.json +6 -6
- package/builtin-workflows/interf/workflow.schema.json +1 -1
- package/dist/bin.js +2 -28
- package/dist/{commands → cli/commands}/check-draft.d.ts +2 -2
- package/dist/{commands → cli/commands}/check-draft.js +12 -12
- package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
- package/dist/{commands → cli/commands}/compile-controller.js +36 -34
- package/dist/{commands → cli/commands}/compile.d.ts +2 -2
- package/dist/{commands → cli/commands}/compile.js +15 -11
- package/dist/{commands → cli/commands}/compiled-flow.d.ts +3 -4
- package/dist/{commands → cli/commands}/compiled-flow.js +9 -14
- package/dist/{commands → cli/commands}/create-workflow-wizard.d.ts +3 -3
- package/dist/{commands → cli/commands}/create-workflow-wizard.js +61 -34
- package/dist/{commands → cli/commands}/create.d.ts +1 -1
- package/dist/{commands → cli/commands}/create.js +15 -18
- package/dist/{commands → cli/commands}/dataset-selection.d.ts +1 -1
- package/dist/{commands → cli/commands}/default.js +3 -3
- package/dist/{commands → cli/commands}/doctor.js +5 -6
- package/dist/{commands → cli/commands}/executor-flow.d.ts +1 -1
- package/dist/{commands → cli/commands}/executor-flow.js +13 -16
- package/dist/{commands → cli/commands}/init.d.ts +4 -1
- package/dist/{commands → cli/commands}/init.js +157 -72
- package/dist/{commands → cli/commands}/list.js +5 -5
- package/dist/{commands → cli/commands}/reset.js +4 -4
- package/dist/{commands → cli/commands}/source-config-wizard.d.ts +8 -3
- package/dist/{commands → cli/commands}/source-config-wizard.js +161 -87
- package/dist/{commands → cli/commands}/status.js +20 -11
- package/dist/{commands → cli/commands}/test-flow.d.ts +13 -4
- package/dist/{commands → cli/commands}/test-flow.js +30 -26
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/{commands → cli/commands}/test.js +39 -23
- package/dist/{commands → cli/commands}/verify.js +4 -4
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.js +33 -0
- package/dist/index.d.ts +22 -11
- package/dist/index.js +15 -6
- package/dist/lib/agent-args.d.ts +1 -4
- package/dist/lib/agent-args.js +1 -52
- package/dist/lib/agent-constants.d.ts +1 -5
- package/dist/lib/agent-constants.js +1 -28
- package/dist/lib/agent-detection.d.ts +1 -7
- package/dist/lib/agent-detection.js +1 -65
- package/dist/lib/agent-execution.d.ts +1 -2
- package/dist/lib/agent-execution.js +1 -243
- package/dist/lib/agent-logs.d.ts +1 -2
- package/dist/lib/agent-logs.js +1 -17
- package/dist/lib/agent-preflight.d.ts +1 -7
- package/dist/lib/agent-preflight.js +1 -77
- package/dist/lib/agent-render.d.ts +1 -8
- package/dist/lib/agent-render.js +1 -218
- package/dist/lib/agent-shells.d.ts +1 -69
- package/dist/lib/agent-shells.js +1 -1021
- package/dist/lib/agent-status.d.ts +1 -3
- package/dist/lib/agent-status.js +1 -58
- package/dist/lib/agent-types.d.ts +1 -30
- package/dist/lib/agent-types.js +1 -1
- package/dist/lib/agents.d.ts +1 -6
- package/dist/lib/agents.js +1 -5
- package/dist/lib/builtin-compiled-workflow.d.ts +1 -38
- package/dist/lib/builtin-compiled-workflow.js +1 -94
- package/dist/lib/compiled-compile.d.ts +1 -48
- package/dist/lib/compiled-compile.js +1 -255
- package/dist/lib/compiled-paths.d.ts +1 -40
- package/dist/lib/compiled-paths.js +3 -106
- package/dist/lib/compiled-raw.d.ts +1 -49
- package/dist/lib/compiled-raw.js +3 -102
- package/dist/lib/compiled-reset.d.ts +1 -2
- package/dist/lib/compiled-reset.js +3 -72
- package/dist/lib/compiled-schema.d.ts +1 -31
- package/dist/lib/compiled-schema.js +1 -141
- package/dist/lib/execution-profile.d.ts +1 -17
- package/dist/lib/execution-profile.js +1 -84
- package/dist/lib/executors.d.ts +1 -32
- package/dist/lib/executors.js +1 -43
- package/dist/lib/interf-bootstrap.d.ts +1 -3
- package/dist/lib/interf-bootstrap.js +3 -18
- package/dist/lib/interf-detect.d.ts +1 -33
- package/dist/lib/interf-detect.js +3 -176
- package/dist/lib/interf-scaffold.d.ts +1 -2
- package/dist/lib/interf-scaffold.js +3 -114
- package/dist/lib/interf-workflow-package.d.ts +1 -25
- package/dist/lib/interf-workflow-package.js +1 -342
- package/dist/lib/interf.d.ts +1 -5
- package/dist/lib/interf.js +3 -4
- package/dist/lib/local-workflows.d.ts +1 -54
- package/dist/lib/local-workflows.js +1 -422
- package/dist/lib/package-root.d.ts +1 -0
- package/dist/lib/package-root.js +1 -0
- package/dist/lib/project-paths.d.ts +1 -11
- package/dist/lib/project-paths.js +3 -32
- package/dist/lib/runtime-acceptance.d.ts +1 -9
- package/dist/lib/runtime-acceptance.js +1 -269
- package/dist/lib/runtime-contracts.d.ts +1 -2
- package/dist/lib/runtime-contracts.js +1 -48
- package/dist/lib/runtime-inventory.d.ts +1 -7
- package/dist/lib/runtime-inventory.js +1 -29
- package/dist/lib/runtime-paths.d.ts +1 -8
- package/dist/lib/runtime-paths.js +1 -26
- package/dist/lib/runtime-prompt.d.ts +1 -2
- package/dist/lib/runtime-prompt.js +1 -48
- package/dist/lib/runtime-reconcile.d.ts +1 -2
- package/dist/lib/runtime-reconcile.js +1 -193
- package/dist/lib/runtime-runs.d.ts +1 -11
- package/dist/lib/runtime-runs.js +1 -262
- package/dist/lib/runtime-types.d.ts +1 -43
- package/dist/lib/runtime-types.js +1 -1
- package/dist/lib/runtime.d.ts +1 -6
- package/dist/lib/runtime.js +1 -5
- package/dist/lib/schema.d.ts +4 -1073
- package/dist/lib/schema.js +6 -542
- package/dist/lib/source-config.d.ts +1 -39
- package/dist/lib/source-config.js +3 -293
- package/dist/lib/state-artifacts.d.ts +1 -8
- package/dist/lib/state-artifacts.js +1 -13
- package/dist/lib/state-health.d.ts +1 -4
- package/dist/lib/state-health.js +1 -132
- package/dist/lib/state-io.d.ts +1 -10
- package/dist/lib/state-io.js +1 -76
- package/dist/lib/state-paths.d.ts +1 -4
- package/dist/lib/state-paths.js +1 -13
- package/dist/lib/state-view.d.ts +1 -4
- package/dist/lib/state-view.js +1 -103
- package/dist/lib/state.d.ts +1 -7
- package/dist/lib/state.js +1 -12
- package/dist/lib/test-execution.d.ts +1 -14
- package/dist/lib/test-execution.js +3 -525
- package/dist/lib/test-matrices.d.ts +1 -90
- package/dist/lib/test-matrices.js +3 -96
- package/dist/lib/test-paths.d.ts +1 -12
- package/dist/lib/test-paths.js +3 -59
- package/dist/lib/test-profile-presets.d.ts +1 -57
- package/dist/lib/test-profile-presets.js +3 -50
- package/dist/lib/test-sandbox.d.ts +1 -11
- package/dist/lib/test-sandbox.js +3 -105
- package/dist/lib/test-specs.d.ts +1 -7
- package/dist/lib/test-specs.js +3 -114
- package/dist/lib/test-targets.d.ts +1 -5
- package/dist/lib/test-targets.js +3 -38
- package/dist/lib/test-types.d.ts +1 -17
- package/dist/lib/test-types.js +3 -1
- package/dist/lib/test.d.ts +1 -4
- package/dist/lib/test.js +3 -3
- package/dist/lib/validate-compiled.d.ts +1 -27
- package/dist/lib/validate-compiled.js +1 -241
- package/dist/lib/validate-helpers.d.ts +1 -12
- package/dist/lib/validate-helpers.js +1 -41
- package/dist/lib/validate.d.ts +1 -21
- package/dist/lib/validate.js +1 -249
- package/dist/lib/workflow-authoring.d.ts +1 -26
- package/dist/lib/workflow-authoring.js +1 -119
- package/dist/lib/workflow-definitions.d.ts +1 -78
- package/dist/lib/workflow-definitions.js +1 -203
- package/dist/lib/workflow-edit-session.d.ts +1 -16
- package/dist/lib/workflow-edit-session.js +1 -57
- package/dist/lib/workflow-edit-utils.d.ts +1 -10
- package/dist/lib/workflow-edit-utils.js +1 -39
- package/dist/lib/workflow-helpers.d.ts +1 -38
- package/dist/lib/workflow-helpers.js +1 -167
- package/dist/lib/workflow-improvement.d.ts +1 -22
- package/dist/lib/workflow-improvement.js +1 -209
- package/dist/lib/workflow-primitives.d.ts +1 -2
- package/dist/lib/workflow-primitives.js +1 -5
- package/dist/lib/workflow-review-paths.d.ts +1 -10
- package/dist/lib/workflow-review-paths.js +1 -27
- package/dist/lib/workflow-stage-policy.d.ts +1 -5
- package/dist/lib/workflow-stage-policy.js +1 -31
- package/dist/lib/workflow-stage-runner.d.ts +1 -41
- package/dist/lib/workflow-stage-runner.js +1 -109
- package/dist/lib/workflows.d.ts +1 -15
- package/dist/lib/workflows.js +1 -31
- package/dist/packages/agents/index.d.ts +17 -0
- package/dist/packages/agents/index.js +15 -0
- package/dist/packages/agents/lib/agents.d.ts +6 -0
- package/dist/packages/agents/lib/agents.js +5 -0
- package/dist/packages/agents/lib/args.d.ts +4 -0
- package/dist/packages/agents/lib/args.js +52 -0
- package/dist/packages/agents/lib/constants.d.ts +5 -0
- package/dist/packages/agents/lib/constants.js +28 -0
- package/dist/packages/agents/lib/detection.d.ts +7 -0
- package/dist/packages/agents/lib/detection.js +65 -0
- package/dist/packages/agents/lib/execution-profile.d.ts +17 -0
- package/dist/packages/agents/lib/execution-profile.js +84 -0
- package/dist/packages/agents/lib/execution.d.ts +2 -0
- package/dist/packages/agents/lib/execution.js +243 -0
- package/dist/packages/agents/lib/executors.d.ts +32 -0
- package/dist/packages/agents/lib/executors.js +45 -0
- package/dist/packages/agents/lib/logs.d.ts +2 -0
- package/dist/packages/agents/lib/logs.js +17 -0
- package/dist/packages/agents/lib/preflight.d.ts +7 -0
- package/dist/packages/agents/lib/preflight.js +77 -0
- package/dist/packages/agents/lib/render.d.ts +8 -0
- package/dist/packages/agents/lib/render.js +218 -0
- package/dist/packages/agents/lib/schema.d.ts +8 -0
- package/dist/packages/agents/lib/schema.js +7 -0
- package/dist/packages/agents/lib/shells.d.ts +69 -0
- package/dist/packages/agents/lib/shells.js +1021 -0
- package/dist/packages/agents/lib/status.d.ts +3 -0
- package/dist/packages/agents/lib/status.js +58 -0
- package/dist/packages/agents/lib/types.d.ts +30 -0
- package/dist/packages/agents/lib/types.js +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.d.ts +1 -0
- package/dist/{lib → packages/agents/lib}/user-config.js +3 -2
- package/dist/packages/compiler/compiled-compile.d.ts +48 -0
- package/dist/packages/compiler/compiled-compile.js +256 -0
- package/dist/packages/compiler/compiled-schema.d.ts +31 -0
- package/dist/packages/compiler/compiled-schema.js +141 -0
- package/dist/packages/compiler/index.d.ts +24 -0
- package/dist/packages/compiler/index.js +23 -0
- package/dist/packages/compiler/lib/schema.d.ts +684 -0
- package/dist/packages/compiler/lib/schema.js +361 -0
- package/dist/packages/compiler/runtime-acceptance.d.ts +9 -0
- package/dist/packages/compiler/runtime-acceptance.js +269 -0
- package/dist/packages/compiler/runtime-contracts.d.ts +2 -0
- package/dist/packages/compiler/runtime-contracts.js +48 -0
- package/dist/packages/compiler/runtime-inventory.d.ts +7 -0
- package/dist/packages/compiler/runtime-inventory.js +29 -0
- package/dist/packages/compiler/runtime-paths.d.ts +8 -0
- package/dist/packages/compiler/runtime-paths.js +26 -0
- package/dist/packages/compiler/runtime-prompt.d.ts +2 -0
- package/dist/packages/compiler/runtime-prompt.js +48 -0
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -0
- package/dist/packages/compiler/runtime-reconcile.js +193 -0
- package/dist/packages/compiler/runtime-runs.d.ts +11 -0
- package/dist/packages/compiler/runtime-runs.js +262 -0
- package/dist/packages/compiler/runtime-types.d.ts +43 -0
- package/dist/packages/compiler/runtime-types.js +1 -0
- package/dist/packages/compiler/runtime.d.ts +6 -0
- package/dist/packages/compiler/runtime.js +5 -0
- package/dist/packages/compiler/state-artifacts.d.ts +8 -0
- package/dist/packages/compiler/state-artifacts.js +13 -0
- package/dist/packages/compiler/state-health.d.ts +4 -0
- package/dist/packages/compiler/state-health.js +132 -0
- package/dist/packages/compiler/state-io.d.ts +10 -0
- package/dist/packages/compiler/state-io.js +76 -0
- package/dist/packages/compiler/state-paths.d.ts +4 -0
- package/dist/packages/compiler/state-paths.js +13 -0
- package/dist/packages/compiler/state-view.d.ts +4 -0
- package/dist/packages/compiler/state-view.js +103 -0
- package/dist/packages/compiler/state.d.ts +7 -0
- package/dist/packages/compiler/state.js +12 -0
- package/dist/packages/compiler/validate-compiled.d.ts +27 -0
- package/dist/packages/compiler/validate-compiled.js +241 -0
- package/dist/packages/compiler/validate-helpers.d.ts +12 -0
- package/dist/packages/compiler/validate-helpers.js +41 -0
- package/dist/packages/compiler/validate.d.ts +21 -0
- package/dist/packages/compiler/validate.js +249 -0
- package/dist/packages/compiler/workflow-primitives.d.ts +2 -0
- package/dist/packages/compiler/workflow-primitives.js +5 -0
- package/dist/packages/compiler/workflows.d.ts +15 -0
- package/dist/packages/compiler/workflows.js +31 -0
- package/dist/packages/project-model/compiled-paths.d.ts +40 -0
- package/dist/packages/project-model/compiled-paths.js +106 -0
- package/dist/packages/project-model/compiled-raw.d.ts +49 -0
- package/dist/packages/project-model/compiled-raw.js +102 -0
- package/dist/packages/project-model/compiled-reset.d.ts +2 -0
- package/dist/packages/project-model/compiled-reset.js +72 -0
- package/dist/packages/project-model/index.d.ts +11 -0
- package/dist/packages/project-model/index.js +10 -0
- package/dist/packages/project-model/interf-bootstrap.d.ts +3 -0
- package/dist/packages/project-model/interf-bootstrap.js +18 -0
- package/dist/packages/project-model/interf-detect.d.ts +33 -0
- package/dist/packages/project-model/interf-detect.js +176 -0
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -0
- package/dist/packages/project-model/interf-scaffold.js +124 -0
- package/dist/packages/project-model/interf.d.ts +5 -0
- package/dist/packages/project-model/interf.js +4 -0
- package/dist/packages/project-model/lib/schema.d.ts +125 -0
- package/dist/packages/project-model/lib/schema.js +62 -0
- package/dist/packages/project-model/project-paths.d.ts +11 -0
- package/dist/packages/project-model/project-paths.js +32 -0
- package/dist/packages/project-model/source-config.d.ts +38 -0
- package/dist/packages/project-model/source-config.js +297 -0
- package/dist/packages/testing/index.d.ts +13 -0
- package/dist/packages/testing/index.js +10 -0
- package/dist/packages/testing/lib/schema.d.ts +261 -0
- package/dist/packages/testing/lib/schema.js +119 -0
- package/dist/packages/testing/test-execution.d.ts +14 -0
- package/dist/packages/testing/test-execution.js +525 -0
- package/dist/packages/testing/test-matrices.d.ts +90 -0
- package/dist/packages/testing/test-matrices.js +96 -0
- package/dist/packages/testing/test-paths.d.ts +12 -0
- package/dist/packages/testing/test-paths.js +59 -0
- package/dist/packages/testing/test-profile-presets.d.ts +57 -0
- package/dist/packages/testing/test-profile-presets.js +50 -0
- package/dist/packages/testing/test-sandbox.d.ts +11 -0
- package/dist/packages/testing/test-sandbox.js +105 -0
- package/dist/packages/testing/test-specs.d.ts +7 -0
- package/dist/packages/testing/test-specs.js +114 -0
- package/dist/packages/testing/test-targets.d.ts +5 -0
- package/dist/packages/testing/test-targets.js +38 -0
- package/dist/packages/testing/test-types.d.ts +16 -0
- package/dist/packages/testing/test-types.js +1 -0
- package/dist/packages/testing/test.d.ts +4 -0
- package/dist/packages/testing/test.js +3 -0
- package/dist/packages/workflow-authoring/index.d.ts +4 -0
- package/dist/packages/workflow-authoring/index.js +4 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.d.ts +10 -0
- package/dist/packages/workflow-authoring/lib/workflow-edit-utils.js +39 -0
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +26 -0
- package/dist/packages/workflow-authoring/workflow-authoring.js +120 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +16 -0
- package/dist/packages/workflow-authoring/workflow-edit-session.js +57 -0
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +23 -0
- package/dist/packages/workflow-authoring/workflow-improvement.js +209 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.d.ts +38 -0
- package/dist/packages/workflow-package/builtin-compiled-workflow.js +94 -0
- package/dist/packages/workflow-package/index.d.ts +9 -0
- package/dist/packages/workflow-package/index.js +9 -0
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +342 -0
- package/dist/{lib/config.d.ts → packages/workflow-package/lib/package-root.d.ts} +0 -1
- package/dist/packages/workflow-package/lib/package-root.js +6 -0
- package/dist/packages/workflow-package/local-workflows.d.ts +54 -0
- package/dist/packages/workflow-package/local-workflows.js +422 -0
- package/dist/packages/workflow-package/workflow-definitions.d.ts +78 -0
- package/dist/packages/workflow-package/workflow-definitions.js +203 -0
- package/dist/packages/workflow-package/workflow-helpers.d.ts +38 -0
- package/dist/packages/workflow-package/workflow-helpers.js +167 -0
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +10 -0
- package/dist/packages/workflow-package/workflow-review-paths.js +27 -0
- package/dist/packages/workflow-package/workflow-stage-policy.d.ts +5 -0
- package/dist/packages/workflow-package/workflow-stage-policy.js +31 -0
- package/dist/packages/workflow-package/workflow-stage-runner.d.ts +41 -0
- package/dist/packages/workflow-package/workflow-stage-runner.js +109 -0
- package/package.json +43 -19
- package/dist/commands/test.d.ts +0 -3
- package/dist/lib/compiled-home.d.ts +0 -5
- package/dist/lib/compiled-home.js +0 -32
- package/dist/lib/config.js +0 -9
- /package/dist/{commands → cli/commands}/dataset-selection.js +0 -0
- /package/dist/{commands → cli/commands}/default.d.ts +0 -0
- /package/dist/{commands → cli/commands}/doctor.d.ts +0 -0
- /package/dist/{commands → cli/commands}/list.d.ts +0 -0
- /package/dist/{commands → cli/commands}/reset.d.ts +0 -0
- /package/dist/{commands → cli/commands}/status.d.ts +0 -0
- /package/dist/{commands → cli/commands}/verify.d.ts +0 -0
|
@@ -1,106 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
export const COMPILED_WORKFLOW_DIR = "workflow";
|
|
5
|
-
export const COMPILED_TEST_DIR = "tests";
|
|
6
|
-
export const COMPILED_TEST_TARGETS_DIR = "targets";
|
|
7
|
-
export const COMPILED_RUNTIME_DIR = "runtime";
|
|
8
|
-
export const COMPILED_RUNTIME_STATE_FILE = "state.json";
|
|
9
|
-
export const COMPILED_RUNTIME_HEALTH_FILE = "health.json";
|
|
10
|
-
export const COMPILED_RUNTIME_VIEW_SPEC_FILE = "view-spec.json";
|
|
11
|
-
export const COMPILED_RUNTIME_RAW_SNAPSHOT_FILE = "raw-snapshot.json";
|
|
12
|
-
export const COMPILED_RUNTIME_INVENTORY_FILE = "inventory.json";
|
|
13
|
-
export const COMPILED_RUNTIME_RUN_FILE = "run.json";
|
|
14
|
-
export const COMPILED_RUNTIME_RUN_HISTORY_FILE = "run-history.jsonl";
|
|
15
|
-
export const COMPILED_RUNTIME_STAGE_CONTRACT_FILE = "stage-contract.json";
|
|
16
|
-
export function compiledRuntimeRoot(compiledPath) {
|
|
17
|
-
return join(compiledPath, COMPILED_INTERF_DIR, COMPILED_RUNTIME_DIR);
|
|
18
|
-
}
|
|
19
|
-
export function compiledRuntimeFilePath(compiledPath, fileName) {
|
|
20
|
-
return join(compiledRuntimeRoot(compiledPath), fileName);
|
|
21
|
-
}
|
|
22
|
-
export function compiledInterfRoot(compiledPath) {
|
|
23
|
-
return join(compiledPath, COMPILED_INTERF_DIR);
|
|
24
|
-
}
|
|
25
|
-
export function compiledInterfConfigPath(compiledPath) {
|
|
26
|
-
return join(compiledInterfRoot(compiledPath), COMPILED_CONFIG_FILE);
|
|
27
|
-
}
|
|
28
|
-
export function workflowPackagePathForCompiled(compiledPath) {
|
|
29
|
-
return join(compiledInterfRoot(compiledPath), COMPILED_WORKFLOW_DIR);
|
|
30
|
-
}
|
|
31
|
-
export function testRootForCompiled(compiledPath) {
|
|
32
|
-
return join(compiledInterfRoot(compiledPath), COMPILED_TEST_DIR);
|
|
33
|
-
}
|
|
34
|
-
export function testTargetsRootForCompiled(compiledPath) {
|
|
35
|
-
return join(testRootForCompiled(compiledPath), COMPILED_TEST_TARGETS_DIR);
|
|
36
|
-
}
|
|
37
|
-
export function stageExecutionShellsRoot(compiledPath) {
|
|
38
|
-
return join(compiledRuntimeRoot(compiledPath), "execution-shells");
|
|
39
|
-
}
|
|
40
|
-
export function workflowImprovementLoopsRoot(compiledPath) {
|
|
41
|
-
return join(compiledRuntimeRoot(compiledPath), "improvement-loops");
|
|
42
|
-
}
|
|
43
|
-
export function workflowImprovementRunRoot(compiledPath, runId) {
|
|
44
|
-
return join(workflowImprovementLoopsRoot(compiledPath), runId);
|
|
45
|
-
}
|
|
46
|
-
export function workflowImprovementLoopRoot(compiledPath, runId, loopIndex) {
|
|
47
|
-
return join(workflowImprovementRunRoot(compiledPath, runId), `loop-${String(loopIndex).padStart(2, "0")}`);
|
|
48
|
-
}
|
|
49
|
-
export function targetTestRunsRootForCompiled(compiledPath) {
|
|
50
|
-
return join(testTargetsRootForCompiled(compiledPath), "runs");
|
|
51
|
-
}
|
|
52
|
-
export function targetTestSandboxesRootForCompiled(compiledPath) {
|
|
53
|
-
return join(testTargetsRootForCompiled(compiledPath), "sandboxes");
|
|
54
|
-
}
|
|
55
|
-
export function compiledRuntimeLogsRoot(compiledPath) {
|
|
56
|
-
return join(compiledRuntimeRoot(compiledPath), "logs");
|
|
57
|
-
}
|
|
58
|
-
export function compiledRuntimeArchivedStageContractPath(compiledPath, runId) {
|
|
59
|
-
return join(compiledRuntimeLogsRoot(compiledPath), `${runId}.stage-contract.json`);
|
|
60
|
-
}
|
|
61
|
-
export function compiledQueryAcceptanceRoot(compiledPath) {
|
|
62
|
-
return join(compiledRuntimeRoot(compiledPath), "query-acceptance");
|
|
63
|
-
}
|
|
64
|
-
export function compiledRuntimeStatePath(compiledPath) {
|
|
65
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_STATE_FILE);
|
|
66
|
-
}
|
|
67
|
-
export function compiledRuntimeHealthPath(compiledPath) {
|
|
68
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_HEALTH_FILE);
|
|
69
|
-
}
|
|
70
|
-
export function compiledRuntimeViewSpecPath(compiledPath) {
|
|
71
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_VIEW_SPEC_FILE);
|
|
72
|
-
}
|
|
73
|
-
export function compiledRawSnapshotMetadataPath(compiledPath) {
|
|
74
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_RAW_SNAPSHOT_FILE);
|
|
75
|
-
}
|
|
76
|
-
export function compiledRuntimeInventoryPath(compiledPath) {
|
|
77
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_INVENTORY_FILE);
|
|
78
|
-
}
|
|
79
|
-
export function compiledRuntimeRunPath(compiledPath) {
|
|
80
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_RUN_FILE);
|
|
81
|
-
}
|
|
82
|
-
export function compiledRuntimeRunHistoryPath(compiledPath) {
|
|
83
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_RUN_HISTORY_FILE);
|
|
84
|
-
}
|
|
85
|
-
export function compiledRuntimeStageContractPath(compiledPath) {
|
|
86
|
-
return compiledRuntimeFilePath(compiledPath, COMPILED_RUNTIME_STAGE_CONTRACT_FILE);
|
|
87
|
-
}
|
|
88
|
-
export function resolveSourceControlPathForCompiled(compiledPath) {
|
|
89
|
-
let cursor = resolve(compiledPath);
|
|
90
|
-
while (true) {
|
|
91
|
-
const parent = dirname(cursor);
|
|
92
|
-
if (basename(parent) === "interf" &&
|
|
93
|
-
basename(cursor) !== "tests" &&
|
|
94
|
-
basename(cursor) !== "workflows") {
|
|
95
|
-
return dirname(parent);
|
|
96
|
-
}
|
|
97
|
-
if (parent === cursor)
|
|
98
|
-
break;
|
|
99
|
-
cursor = parent;
|
|
100
|
-
}
|
|
101
|
-
throw new Error(`Compiled dataset is not under the canonical project layout: ${compiledPath}`);
|
|
102
|
-
}
|
|
103
|
-
export function defaultControlPathForCompiled(compiledPath) {
|
|
104
|
-
const relativePath = relative(compiledPath, resolveSourceControlPathForCompiled(compiledPath));
|
|
105
|
-
return relativePath.length > 0 ? relativePath.split(sep).join("/") : ".";
|
|
106
|
-
}
|
|
1
|
+
// Compatibility shim for historical `src/lib/compiled-paths.ts` imports.
|
|
2
|
+
// Source of truth: `src/packages/project-model/compiled-paths.ts`.
|
|
3
|
+
export * from "../packages/project-model/compiled-paths.js";
|
|
@@ -1,49 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export interface CompiledRawSyncResult {
|
|
3
|
-
sourceTotal: number;
|
|
4
|
-
copied: number;
|
|
5
|
-
removed: number;
|
|
6
|
-
}
|
|
7
|
-
type RawSnapshotMaterializeMode = "copy" | "link-or-copy";
|
|
8
|
-
export declare function resolveCompiledRawPath(compiledPath: string, config?: {
|
|
9
|
-
[x: string]: unknown;
|
|
10
|
-
type: "compiled";
|
|
11
|
-
name: string;
|
|
12
|
-
workflow: string;
|
|
13
|
-
checks: {
|
|
14
|
-
question: string;
|
|
15
|
-
id?: string | undefined;
|
|
16
|
-
answer?: string | undefined;
|
|
17
|
-
expect?: {
|
|
18
|
-
must_include?: string[] | undefined;
|
|
19
|
-
must_include_one_of?: string[][] | undefined;
|
|
20
|
-
must_not_include?: string[] | undefined;
|
|
21
|
-
min_words?: number | undefined;
|
|
22
|
-
max_words?: number | undefined;
|
|
23
|
-
} | undefined;
|
|
24
|
-
strictness?: string | undefined;
|
|
25
|
-
}[];
|
|
26
|
-
source: {
|
|
27
|
-
path: string;
|
|
28
|
-
dataset_path: string;
|
|
29
|
-
control_path?: string | undefined;
|
|
30
|
-
};
|
|
31
|
-
about?: string | undefined;
|
|
32
|
-
max_attempts?: number | undefined;
|
|
33
|
-
max_loops?: number | undefined;
|
|
34
|
-
workflow_origin?: {
|
|
35
|
-
selected: string;
|
|
36
|
-
local_draft?: boolean | undefined;
|
|
37
|
-
} | undefined;
|
|
38
|
-
} | null): string;
|
|
39
|
-
export declare function syncCompiledRawSnapshot(compiledPath: string, sourcePath?: string): CompiledRawSyncResult;
|
|
40
|
-
export declare function ensureCompiledRawBinding(compiledPath: string): InterfConfig | null;
|
|
41
|
-
export declare function projectRawSnapshot(options: {
|
|
42
|
-
sourcePath: string;
|
|
43
|
-
destinationPath: string;
|
|
44
|
-
compiledPath: string;
|
|
45
|
-
mode?: RawSnapshotMaterializeMode;
|
|
46
|
-
prune?: boolean;
|
|
47
|
-
preserveTimestamps?: boolean;
|
|
48
|
-
}): CompiledRawSyncResult;
|
|
49
|
-
export {};
|
|
1
|
+
export * from "../packages/project-model/compiled-raw.js";
|
package/dist/lib/compiled-raw.js
CHANGED
|
@@ -1,102 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { discoverSourceFiles } from "./discovery.js";
|
|
5
|
-
import { readInterfConfig, resolveSourceInputPath, } from "./interf-detect.js";
|
|
6
|
-
import { saveCompiledInterfConfig } from "./source-config.js";
|
|
7
|
-
import { defaultControlPathForCompiled, } from "./compiled-paths.js";
|
|
8
|
-
import { assertPathWithinRoot } from "./util.js";
|
|
9
|
-
export function resolveCompiledRawPath(compiledPath, config = readInterfConfig(compiledPath)) {
|
|
10
|
-
const configuredPath = typeof config?.source?.path === "string" && config.source.path.length > 0
|
|
11
|
-
? config.source.path
|
|
12
|
-
: "raw";
|
|
13
|
-
return assertPathWithinRoot(compiledPath, resolve(compiledPath, configuredPath), "Compiled raw path");
|
|
14
|
-
}
|
|
15
|
-
export function syncCompiledRawSnapshot(compiledPath, sourcePath = resolveSourceInputPath(compiledPath)) {
|
|
16
|
-
ensureCompiledRawBinding(compiledPath);
|
|
17
|
-
const rawPath = resolveCompiledRawPath(compiledPath);
|
|
18
|
-
return projectRawSnapshot({
|
|
19
|
-
sourcePath,
|
|
20
|
-
destinationPath: rawPath,
|
|
21
|
-
compiledPath,
|
|
22
|
-
mode: "copy",
|
|
23
|
-
prune: true,
|
|
24
|
-
preserveTimestamps: true,
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
export function ensureCompiledRawBinding(compiledPath) {
|
|
28
|
-
const config = readInterfConfig(compiledPath);
|
|
29
|
-
if (!config)
|
|
30
|
-
return null;
|
|
31
|
-
if (config.source?.path === "./raw")
|
|
32
|
-
return config;
|
|
33
|
-
const nextConfig = {
|
|
34
|
-
...config,
|
|
35
|
-
source: {
|
|
36
|
-
...(config.source ?? {}),
|
|
37
|
-
path: "./raw",
|
|
38
|
-
control_path: config.source?.control_path ?? defaultControlPathForCompiled(compiledPath),
|
|
39
|
-
...(config.source?.dataset_path ? { dataset_path: config.source.dataset_path } : {}),
|
|
40
|
-
},
|
|
41
|
-
};
|
|
42
|
-
return saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
43
|
-
}
|
|
44
|
-
function filesMatch(sourcePath, targetPath) {
|
|
45
|
-
if (!existsSync(targetPath))
|
|
46
|
-
return false;
|
|
47
|
-
try {
|
|
48
|
-
const sourceStat = statSync(sourcePath);
|
|
49
|
-
const targetStat = statSync(targetPath);
|
|
50
|
-
return sourceStat.size === targetStat.size && sourceStat.mtimeMs === targetStat.mtimeMs;
|
|
51
|
-
}
|
|
52
|
-
catch {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
function materializeRawSnapshotFile(sourcePath, targetPath, options) {
|
|
57
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
58
|
-
rmSync(targetPath, { force: true });
|
|
59
|
-
if (options.mode === "link-or-copy") {
|
|
60
|
-
try {
|
|
61
|
-
linkSync(sourcePath, targetPath);
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
// fall through to copy
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
cpSync(sourcePath, targetPath, { preserveTimestamps: options.preserveTimestamps });
|
|
69
|
-
}
|
|
70
|
-
export function projectRawSnapshot(options) {
|
|
71
|
-
const discovery = discoverSourceFiles(options.sourcePath, options.compiledPath);
|
|
72
|
-
const expectedFiles = new Set(discovery.sourceFiles);
|
|
73
|
-
mkdirSync(options.destinationPath, { recursive: true });
|
|
74
|
-
let removed = 0;
|
|
75
|
-
if (options.prune !== false) {
|
|
76
|
-
for (const existingPath of listFilesRecursive(options.destinationPath)) {
|
|
77
|
-
const relativePath = relative(options.destinationPath, existingPath);
|
|
78
|
-
if (expectedFiles.has(relativePath))
|
|
79
|
-
continue;
|
|
80
|
-
rmSync(existingPath, { force: true });
|
|
81
|
-
removed += 1;
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
let copied = 0;
|
|
85
|
-
for (const relativePath of discovery.sourceFiles) {
|
|
86
|
-
const sourceFilePath = join(options.sourcePath, relativePath);
|
|
87
|
-
const targetFilePath = join(options.destinationPath, relativePath);
|
|
88
|
-
if (filesMatch(sourceFilePath, targetFilePath)) {
|
|
89
|
-
continue;
|
|
90
|
-
}
|
|
91
|
-
materializeRawSnapshotFile(sourceFilePath, targetFilePath, {
|
|
92
|
-
mode: options.mode ?? "copy",
|
|
93
|
-
preserveTimestamps: options.preserveTimestamps ?? true,
|
|
94
|
-
});
|
|
95
|
-
copied += 1;
|
|
96
|
-
}
|
|
97
|
-
return {
|
|
98
|
-
sourceTotal: discovery.totalCount,
|
|
99
|
-
copied,
|
|
100
|
-
removed,
|
|
101
|
-
};
|
|
102
|
-
}
|
|
1
|
+
// Compatibility shim for historical `src/lib/compiled-raw.ts` imports.
|
|
2
|
+
// Source of truth: `src/packages/project-model/compiled-raw.ts`.
|
|
3
|
+
export * from "../packages/project-model/compiled-raw.js";
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function resetCompiledGeneratedState(compiledPath: string, scope?: "compile" | "all"): void;
|
|
1
|
+
export * from "../packages/project-model/compiled-reset.js";
|
|
@@ -1,72 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { initializeCompiledRuntimeState, } from "./state.js";
|
|
5
|
-
import { stageExecutionShellsRoot, testRootForCompiled, testTargetsRootForCompiled, workflowImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeRoot, compiledRuntimeLogsRoot, workflowPackagePathForCompiled, } from "./compiled-paths.js";
|
|
6
|
-
function removeIfExists(path) {
|
|
7
|
-
if (existsSync(path)) {
|
|
8
|
-
rmSync(path, { recursive: true, force: true });
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
const COMPILE_RUNTIME_RESET_ENTRIES = [
|
|
12
|
-
"state.json",
|
|
13
|
-
"health.json",
|
|
14
|
-
"view-spec.json",
|
|
15
|
-
"inventory.json",
|
|
16
|
-
"run.json",
|
|
17
|
-
"raw-snapshot.json",
|
|
18
|
-
"stage-contract.json",
|
|
19
|
-
];
|
|
20
|
-
const PRESERVED_COMPILED_ROOTS = new Set([
|
|
21
|
-
".agents",
|
|
22
|
-
".claude",
|
|
23
|
-
".codex",
|
|
24
|
-
".cursor",
|
|
25
|
-
".gitignore",
|
|
26
|
-
".interf",
|
|
27
|
-
".interfignore",
|
|
28
|
-
"AGENTS.md",
|
|
29
|
-
"CLAUDE.md",
|
|
30
|
-
]);
|
|
31
|
-
export function clearCompiledRuntimeDerivedArtifacts(compiledPath) {
|
|
32
|
-
const runtimeRoot = compiledRuntimeRoot(compiledPath);
|
|
33
|
-
for (const entry of COMPILE_RUNTIME_RESET_ENTRIES) {
|
|
34
|
-
removeIfExists(join(runtimeRoot, entry));
|
|
35
|
-
}
|
|
36
|
-
removeIfExists(compiledQueryAcceptanceRoot(compiledPath));
|
|
37
|
-
}
|
|
38
|
-
function activeCompiledInputRoots(compiledPath) {
|
|
39
|
-
const schema = readCompiledSchemaFile(workflowPackagePathForCompiled(compiledPath));
|
|
40
|
-
const roots = new Set();
|
|
41
|
-
for (const zone of schema?.zones ?? []) {
|
|
42
|
-
if (zone.role !== "input")
|
|
43
|
-
continue;
|
|
44
|
-
const root = zone.path.split("/")[0]?.trim();
|
|
45
|
-
if (root)
|
|
46
|
-
roots.add(root);
|
|
47
|
-
}
|
|
48
|
-
return roots;
|
|
49
|
-
}
|
|
50
|
-
function resetCompiledGeneratedOutputs(compiledPath) {
|
|
51
|
-
const preservedInputRoots = activeCompiledInputRoots(compiledPath);
|
|
52
|
-
for (const entry of readdirSync(compiledPath)) {
|
|
53
|
-
if (PRESERVED_COMPILED_ROOTS.has(entry))
|
|
54
|
-
continue;
|
|
55
|
-
if (preservedInputRoots.has(entry))
|
|
56
|
-
continue;
|
|
57
|
-
removeIfExists(join(compiledPath, entry));
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
export function resetCompiledGeneratedState(compiledPath, scope = "compile") {
|
|
61
|
-
resetCompiledGeneratedOutputs(compiledPath);
|
|
62
|
-
clearCompiledRuntimeDerivedArtifacts(compiledPath);
|
|
63
|
-
initializeCompiledRuntimeState(compiledPath);
|
|
64
|
-
if (scope === "all") {
|
|
65
|
-
removeIfExists(stageExecutionShellsRoot(compiledPath));
|
|
66
|
-
removeIfExists(workflowImprovementLoopsRoot(compiledPath));
|
|
67
|
-
removeIfExists(compiledRuntimeLogsRoot(compiledPath));
|
|
68
|
-
removeIfExists(join(compiledRuntimeRoot(compiledPath), "run-history.jsonl"));
|
|
69
|
-
removeIfExists(testRootForCompiled(compiledPath));
|
|
70
|
-
removeIfExists(testTargetsRootForCompiled(compiledPath));
|
|
71
|
-
}
|
|
72
|
-
}
|
|
1
|
+
// Compatibility shim for historical `src/lib/compiled-reset.ts` imports.
|
|
2
|
+
// Source of truth: `src/packages/project-model/compiled-reset.ts`.
|
|
3
|
+
export * from "../packages/project-model/compiled-reset.js";
|
|
@@ -1,31 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { type WorkflowCompiledSchema, type WorkflowCompiledZone, type WorkflowZoneId } from "./schema.js";
|
|
3
|
-
export interface WorkflowSchemaStageLike {
|
|
4
|
-
id: string;
|
|
5
|
-
writes: readonly string[];
|
|
6
|
-
}
|
|
7
|
-
export { BUILTIN_COMPILED_ZONE_IDS } from "./builtin-compiled-workflow.js";
|
|
8
|
-
export declare const WORKFLOW_SCHEMA_FILE = "workflow.schema.json";
|
|
9
|
-
export declare function workflowSchemaFilePath(rootPath: string): string;
|
|
10
|
-
export declare function resolveWorkflowSchemaPath(rootPath: string): string | null;
|
|
11
|
-
export declare function workflowSchemaExists(rootPath: string): boolean;
|
|
12
|
-
export declare function workflowSchemaRelativePath(): string;
|
|
13
|
-
export declare function listCompiledSchemaZones(schema: WorkflowCompiledSchema): WorkflowCompiledZone[];
|
|
14
|
-
export declare function findCompiledSchemaZone(schema: WorkflowCompiledSchema, zoneId: WorkflowZoneId): WorkflowCompiledZone | null;
|
|
15
|
-
export declare function compiledZoneAbsolutePath(compiledPath: string, zone: Pick<WorkflowCompiledZone, "path">): string;
|
|
16
|
-
export declare function compiledContractArtifactPath(zone: Pick<WorkflowCompiledZone, "path" | "kind">): string;
|
|
17
|
-
export declare function compiledContractArtifactPathsForZoneIds(schema: WorkflowCompiledSchema, zoneIds: readonly WorkflowZoneId[]): string[];
|
|
18
|
-
export declare function builtinCompiledZoneRelativePath(zoneId: BuiltinCompiledZoneId): string;
|
|
19
|
-
export declare function builtinCompiledZoneAbsolutePath(compiledPath: string, zoneId: BuiltinCompiledZoneId): string;
|
|
20
|
-
export declare function compiledSummariesPath(compiledPath: string): string;
|
|
21
|
-
export declare function compiledKnowledgeEntitiesPath(compiledPath: string): string;
|
|
22
|
-
export declare function compiledKnowledgeClaimsPath(compiledPath: string): string;
|
|
23
|
-
export declare function compiledKnowledgeIndexesPath(compiledPath: string): string;
|
|
24
|
-
export declare function compiledKnowledgeRootPath(compiledPath: string): string;
|
|
25
|
-
export declare function compiledHomePath(compiledPath: string): string;
|
|
26
|
-
export declare function ensureCompiledZoneTargets(compiledPath: string, schema: WorkflowCompiledSchema): void;
|
|
27
|
-
export declare function buildWorkflowSchema(stages: WorkflowSchemaStageLike[], label?: string): WorkflowCompiledSchema;
|
|
28
|
-
export declare function writeWorkflowSchemaFile(rootPath: string, stages: WorkflowSchemaStageLike[], label?: string): WorkflowCompiledSchema;
|
|
29
|
-
export declare function writeWorkflowSchemaDocument(rootPath: string, schema: WorkflowCompiledSchema): WorkflowCompiledSchema;
|
|
30
|
-
export declare function readWorkflowSchemaFile(rootPath: string): WorkflowCompiledSchema | null;
|
|
31
|
-
export declare function readCompiledSchemaFile(rootPath: string): WorkflowCompiledSchema | null;
|
|
1
|
+
export * from "../packages/compiler/compiled-schema.js";
|
|
@@ -1,141 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { warnInterf } from "./logger.js";
|
|
4
|
-
import { readJsonFileUnchecked } from "./parse.js";
|
|
5
|
-
import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "./builtin-compiled-workflow.js";
|
|
6
|
-
import { WorkflowCompiledSchemaSchema, } from "./schema.js";
|
|
7
|
-
export { BUILTIN_COMPILED_ZONE_IDS } from "./builtin-compiled-workflow.js";
|
|
8
|
-
export const WORKFLOW_SCHEMA_FILE = "workflow.schema.json";
|
|
9
|
-
const BUILTIN_COMPILED_ZONE_SPEC_BY_ID = new Map(listBuiltinCompiledZoneSpecs().map((zone) => [zone.id, zone]));
|
|
10
|
-
export function workflowSchemaFilePath(rootPath) {
|
|
11
|
-
return join(rootPath, WORKFLOW_SCHEMA_FILE);
|
|
12
|
-
}
|
|
13
|
-
export function resolveWorkflowSchemaPath(rootPath) {
|
|
14
|
-
const path = workflowSchemaFilePath(rootPath);
|
|
15
|
-
return existsSync(path) ? path : null;
|
|
16
|
-
}
|
|
17
|
-
export function workflowSchemaExists(rootPath) {
|
|
18
|
-
return existsSync(workflowSchemaFilePath(rootPath));
|
|
19
|
-
}
|
|
20
|
-
export function workflowSchemaRelativePath() {
|
|
21
|
-
return `workflow/${WORKFLOW_SCHEMA_FILE}`;
|
|
22
|
-
}
|
|
23
|
-
export function listCompiledSchemaZones(schema) {
|
|
24
|
-
return [...schema.zones];
|
|
25
|
-
}
|
|
26
|
-
export function findCompiledSchemaZone(schema, zoneId) {
|
|
27
|
-
return schema.zones.find((zone) => zone.id === zoneId) ?? null;
|
|
28
|
-
}
|
|
29
|
-
export function compiledZoneAbsolutePath(compiledPath, zone) {
|
|
30
|
-
return join(compiledPath, zone.path);
|
|
31
|
-
}
|
|
32
|
-
export function compiledContractArtifactPath(zone) {
|
|
33
|
-
if (zone.kind === "file")
|
|
34
|
-
return zone.path;
|
|
35
|
-
return zone.path.endsWith("/") ? zone.path : `${zone.path}/`;
|
|
36
|
-
}
|
|
37
|
-
export function compiledContractArtifactPathsForZoneIds(schema, zoneIds) {
|
|
38
|
-
return zoneIds.map((zoneId) => {
|
|
39
|
-
const zone = findCompiledSchemaZone(schema, zoneId);
|
|
40
|
-
if (!zone) {
|
|
41
|
-
throw new Error(`Compiled schema is missing declared zone "${zoneId}".`);
|
|
42
|
-
}
|
|
43
|
-
return compiledContractArtifactPath(zone);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
export function builtinCompiledZoneRelativePath(zoneId) {
|
|
47
|
-
const zone = BUILTIN_COMPILED_ZONE_SPEC_BY_ID.get(zoneId);
|
|
48
|
-
if (!zone) {
|
|
49
|
-
throw new Error(`Missing built-in compiled zone "${zoneId}".`);
|
|
50
|
-
}
|
|
51
|
-
return zone.path;
|
|
52
|
-
}
|
|
53
|
-
export function builtinCompiledZoneAbsolutePath(compiledPath, zoneId) {
|
|
54
|
-
return join(compiledPath, builtinCompiledZoneRelativePath(zoneId));
|
|
55
|
-
}
|
|
56
|
-
export function compiledSummariesPath(compiledPath) {
|
|
57
|
-
return builtinCompiledZoneAbsolutePath(compiledPath, BUILTIN_COMPILED_ZONE_IDS.SUMMARIES);
|
|
58
|
-
}
|
|
59
|
-
export function compiledKnowledgeEntitiesPath(compiledPath) {
|
|
60
|
-
return builtinCompiledZoneAbsolutePath(compiledPath, BUILTIN_COMPILED_ZONE_IDS.KNOWLEDGE_ENTITIES);
|
|
61
|
-
}
|
|
62
|
-
export function compiledKnowledgeClaimsPath(compiledPath) {
|
|
63
|
-
return builtinCompiledZoneAbsolutePath(compiledPath, BUILTIN_COMPILED_ZONE_IDS.KNOWLEDGE_CLAIMS);
|
|
64
|
-
}
|
|
65
|
-
export function compiledKnowledgeIndexesPath(compiledPath) {
|
|
66
|
-
return builtinCompiledZoneAbsolutePath(compiledPath, BUILTIN_COMPILED_ZONE_IDS.KNOWLEDGE_INDEXES);
|
|
67
|
-
}
|
|
68
|
-
export function compiledKnowledgeRootPath(compiledPath) {
|
|
69
|
-
return dirname(compiledKnowledgeEntitiesPath(compiledPath));
|
|
70
|
-
}
|
|
71
|
-
export function compiledHomePath(compiledPath) {
|
|
72
|
-
return builtinCompiledZoneAbsolutePath(compiledPath, BUILTIN_COMPILED_ZONE_IDS.HOME);
|
|
73
|
-
}
|
|
74
|
-
export function ensureCompiledZoneTargets(compiledPath, schema) {
|
|
75
|
-
for (const zone of schema.zones) {
|
|
76
|
-
if (zone.kind === "directory" || zone.kind === "runtime") {
|
|
77
|
-
mkdirSync(compiledZoneAbsolutePath(compiledPath, zone), { recursive: true });
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
mkdirSync(dirname(compiledZoneAbsolutePath(compiledPath, zone)), { recursive: true });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
function pushZone(zones, zone) {
|
|
84
|
-
if (zones.some((existing) => existing.path === zone.path))
|
|
85
|
-
return;
|
|
86
|
-
zones.push(zone);
|
|
87
|
-
}
|
|
88
|
-
function normalizeWorkflowSchema(schema) {
|
|
89
|
-
return {
|
|
90
|
-
...schema,
|
|
91
|
-
kind: "workflow-schema",
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
export function buildWorkflowSchema(stages, label = "Workflow schema") {
|
|
95
|
-
const zones = [];
|
|
96
|
-
for (const zone of listBuiltinCompiledZoneSpecs()) {
|
|
97
|
-
pushZone(zones, {
|
|
98
|
-
id: zone.id,
|
|
99
|
-
role: zone.role,
|
|
100
|
-
path: zone.path,
|
|
101
|
-
kind: zone.kind,
|
|
102
|
-
required: zone.required,
|
|
103
|
-
owned_by: requiredCompiledZoneOwners(stages, zone.id),
|
|
104
|
-
description: zone.description,
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
kind: "workflow-schema",
|
|
109
|
-
version: 1,
|
|
110
|
-
target_type: "compiled",
|
|
111
|
-
label,
|
|
112
|
-
zones,
|
|
113
|
-
};
|
|
114
|
-
}
|
|
115
|
-
export function writeWorkflowSchemaFile(rootPath, stages, label) {
|
|
116
|
-
const schema = buildWorkflowSchema(stages, label);
|
|
117
|
-
writeWorkflowSchemaDocument(rootPath, schema);
|
|
118
|
-
return schema;
|
|
119
|
-
}
|
|
120
|
-
export function writeWorkflowSchemaDocument(rootPath, schema) {
|
|
121
|
-
const normalized = normalizeWorkflowSchema(schema);
|
|
122
|
-
writeFileSync(workflowSchemaFilePath(rootPath), `${JSON.stringify(normalized, null, 2)}\n`);
|
|
123
|
-
return normalized;
|
|
124
|
-
}
|
|
125
|
-
export function readWorkflowSchemaFile(rootPath) {
|
|
126
|
-
const path = workflowSchemaFilePath(rootPath);
|
|
127
|
-
if (!existsSync(path))
|
|
128
|
-
return null;
|
|
129
|
-
const raw = readJsonFileUnchecked(path, "workflow schema");
|
|
130
|
-
if (raw === null)
|
|
131
|
-
return null;
|
|
132
|
-
const parsed = WorkflowCompiledSchemaSchema.safeParse(raw);
|
|
133
|
-
if (!parsed.success) {
|
|
134
|
-
warnInterf(`Warning: failed to validate workflow schema at ${path}: ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
|
|
135
|
-
return null;
|
|
136
|
-
}
|
|
137
|
-
return normalizeWorkflowSchema(parsed.data);
|
|
138
|
-
}
|
|
139
|
-
export function readCompiledSchemaFile(rootPath) {
|
|
140
|
-
return readWorkflowSchemaFile(rootPath);
|
|
141
|
-
}
|
|
1
|
+
export * from "../packages/compiler/compiled-schema.js";
|
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { Agent } from "./agents.js";
|
|
3
|
-
import type { WorkflowExecutionProfile } from "./executors.js";
|
|
4
|
-
type AgentLike = Pick<Agent, "name"> | string | null | undefined;
|
|
5
|
-
export declare function addExecutionProfileOptions<T extends Argv>(yargs: T): T;
|
|
6
|
-
type ExecutionProfileArgSource = Record<string, unknown> & {
|
|
7
|
-
model?: unknown;
|
|
8
|
-
profile?: unknown;
|
|
9
|
-
effort?: unknown;
|
|
10
|
-
timeoutMs?: unknown;
|
|
11
|
-
"timeout-ms"?: unknown;
|
|
12
|
-
};
|
|
13
|
-
export declare function executionProfileFromArgv(argv: ExecutionProfileArgSource): WorkflowExecutionProfile;
|
|
14
|
-
export declare function applyInternalAcceptanceExecutionProfileDefaults(agent: AgentLike, overrides?: WorkflowExecutionProfile): WorkflowExecutionProfile;
|
|
15
|
-
export declare function hasWorkflowExecutionProfile(profile: WorkflowExecutionProfile | null | undefined): boolean;
|
|
16
|
-
export declare function formatWorkflowExecutionProfile(profile: WorkflowExecutionProfile | null | undefined): string | null;
|
|
17
|
-
export {};
|
|
1
|
+
export * from "../packages/agents/lib/execution-profile.js";
|
|
@@ -1,84 +1 @@
|
|
|
1
|
-
|
|
2
|
-
"claude-code": {
|
|
3
|
-
model: "claude-sonnet-4-6",
|
|
4
|
-
effort: "low",
|
|
5
|
-
},
|
|
6
|
-
codex: {
|
|
7
|
-
model: "gpt-5.4-mini",
|
|
8
|
-
effort: "low",
|
|
9
|
-
},
|
|
10
|
-
};
|
|
11
|
-
function readAgentName(agent) {
|
|
12
|
-
if (!agent)
|
|
13
|
-
return null;
|
|
14
|
-
return typeof agent === "string" ? agent : agent.name;
|
|
15
|
-
}
|
|
16
|
-
function normalizeOptionalString(value) {
|
|
17
|
-
if (typeof value !== "string")
|
|
18
|
-
return null;
|
|
19
|
-
const trimmed = value.trim();
|
|
20
|
-
return trimmed.length > 0 ? trimmed : null;
|
|
21
|
-
}
|
|
22
|
-
function normalizeOptionalTimeout(value) {
|
|
23
|
-
if (value === undefined || value === null || value === "")
|
|
24
|
-
return null;
|
|
25
|
-
const parsed = typeof value === "number" ? value : Number.parseInt(String(value), 10);
|
|
26
|
-
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
27
|
-
throw new Error(`Invalid timeout: ${String(value)}`);
|
|
28
|
-
}
|
|
29
|
-
return parsed;
|
|
30
|
-
}
|
|
31
|
-
export function addExecutionProfileOptions(yargs) {
|
|
32
|
-
return yargs
|
|
33
|
-
.option("model", {
|
|
34
|
-
type: "string",
|
|
35
|
-
describe: "Override the local executor model for this run",
|
|
36
|
-
})
|
|
37
|
-
.option("profile", {
|
|
38
|
-
type: "string",
|
|
39
|
-
describe: "Executor-specific profile override for this run",
|
|
40
|
-
})
|
|
41
|
-
.option("effort", {
|
|
42
|
-
type: "string",
|
|
43
|
-
describe: "Override the model reasoning effort for this run",
|
|
44
|
-
})
|
|
45
|
-
.option("timeout-ms", {
|
|
46
|
-
type: "number",
|
|
47
|
-
describe: "Interrupt the local executor after this much inactivity",
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
export function executionProfileFromArgv(argv) {
|
|
51
|
-
return {
|
|
52
|
-
model: normalizeOptionalString(argv.model),
|
|
53
|
-
profile: normalizeOptionalString(argv.profile),
|
|
54
|
-
effort: normalizeOptionalString(argv.effort),
|
|
55
|
-
timeoutMs: normalizeOptionalTimeout(argv.timeoutMs ?? argv["timeout-ms"]),
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
export function applyInternalAcceptanceExecutionProfileDefaults(agent, overrides = {}) {
|
|
59
|
-
const defaults = INTERNAL_ACCEPTANCE_DEFAULTS[readAgentName(agent) ?? ""];
|
|
60
|
-
const profile = overrides.profile ?? null;
|
|
61
|
-
const explicitEffort = overrides.effort ?? null;
|
|
62
|
-
return {
|
|
63
|
-
model: overrides.model ?? defaults?.model ?? null,
|
|
64
|
-
profile,
|
|
65
|
-
effort: explicitEffort ?? (profile ? null : defaults?.effort ?? null),
|
|
66
|
-
timeoutMs: overrides.timeoutMs ?? null,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
export function hasWorkflowExecutionProfile(profile) {
|
|
70
|
-
return Boolean(profile?.model ||
|
|
71
|
-
profile?.profile ||
|
|
72
|
-
profile?.effort ||
|
|
73
|
-
profile?.timeoutMs);
|
|
74
|
-
}
|
|
75
|
-
export function formatWorkflowExecutionProfile(profile) {
|
|
76
|
-
if (!hasWorkflowExecutionProfile(profile))
|
|
77
|
-
return null;
|
|
78
|
-
return JSON.stringify({
|
|
79
|
-
...(profile?.model ? { model: profile.model } : {}),
|
|
80
|
-
...(profile?.profile ? { profile: profile.profile } : {}),
|
|
81
|
-
...(profile?.effort ? { effort: profile.effort } : {}),
|
|
82
|
-
...(profile?.timeoutMs ? { timeout_ms: profile.timeoutMs } : {}),
|
|
83
|
-
});
|
|
84
|
-
}
|
|
1
|
+
export * from "../packages/agents/lib/execution-profile.js";
|
package/dist/lib/executors.d.ts
CHANGED
|
@@ -1,32 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import type { RuntimeExecutorInfo } from "./schema.js";
|
|
3
|
-
export type WorkflowExecutorKind = "local-agent" | "connected-provider" | "managed";
|
|
4
|
-
export interface WorkflowExecutionProfile {
|
|
5
|
-
model?: string | null;
|
|
6
|
-
effort?: string | null;
|
|
7
|
-
profile?: string | null;
|
|
8
|
-
timeoutMs?: number | null;
|
|
9
|
-
}
|
|
10
|
-
export interface WorkflowExecuteOptions {
|
|
11
|
-
eventLogPath?: string | null;
|
|
12
|
-
statusLogPath?: string | null;
|
|
13
|
-
completionCheck?: (() => boolean) | null;
|
|
14
|
-
}
|
|
15
|
-
export interface WorkflowExecutor {
|
|
16
|
-
kind: WorkflowExecutorKind;
|
|
17
|
-
name: string;
|
|
18
|
-
displayName: string;
|
|
19
|
-
command?: string | null;
|
|
20
|
-
executionProfile?: WorkflowExecutionProfile;
|
|
21
|
-
execute(rootPath: string, prompt: string, options?: WorkflowExecuteOptions): Promise<number>;
|
|
22
|
-
}
|
|
23
|
-
export type { RuntimeExecutorInfo } from "./schema.js";
|
|
24
|
-
export declare function buildRuntimeExecutorInfo(executor: WorkflowExecutor): RuntimeExecutorInfo;
|
|
25
|
-
export declare function createLocalAgentExecutor(agent: Agent, executionProfile?: WorkflowExecutionProfile): WorkflowExecutor;
|
|
26
|
-
export declare function resolveLocalExecutor(options?: {
|
|
27
|
-
preflight?: boolean;
|
|
28
|
-
executionProfile?: WorkflowExecutionProfile;
|
|
29
|
-
}): {
|
|
30
|
-
executor: WorkflowExecutor | null;
|
|
31
|
-
error?: string;
|
|
32
|
-
};
|
|
1
|
+
export * from "../packages/agents/lib/executors.js";
|