@interf/compiler 0.6.1 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +106 -80
- 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 +16 -16
- package/dist/{commands → cli/commands}/compile-controller.d.ts +3 -3
- package/dist/{commands → cli/commands}/compile-controller.js +37 -35
- 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 +64 -37
- 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 +162 -77
- package/dist/{commands → cli/commands}/list.js +6 -6
- package/dist/{commands → cli/commands}/reset.js +4 -4
- package/dist/{commands → cli/commands}/source-config-wizard.d.ts +9 -4
- package/dist/{commands → cli/commands}/source-config-wizard.js +168 -94
- 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 +52 -48
- package/dist/cli/commands/test.d.ts +14 -0
- package/dist/{commands → cli/commands}/test.js +40 -24
- 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/chart-guidance.d.ts +1 -1
- package/dist/lib/chart-guidance.js +1 -8
- 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/discovery.d.ts +1 -7
- package/dist/lib/discovery.js +1 -84
- 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/filesystem.d.ts +1 -2
- package/dist/lib/filesystem.js +1 -55
- 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/logger.d.ts +1 -3
- package/dist/lib/logger.js +1 -10
- package/dist/lib/package-root.d.ts +1 -0
- package/dist/lib/package-root.js +1 -0
- package/dist/lib/parse.d.ts +1 -8
- package/dist/lib/parse.js +1 -145
- 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/util.d.ts +1 -4
- package/dist/lib/util.js +1 -25
- 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 +18 -0
- package/dist/packages/agents/index.js +16 -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/chart-guidance.d.ts +1 -0
- package/dist/packages/agents/lib/chart-guidance.js +8 -0
- package/dist/packages/agents/lib/compiled-bootstrap.d.ts +3 -0
- package/dist/packages/agents/lib/compiled-bootstrap.js +18 -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 +71 -0
- package/dist/packages/agents/lib/shells.js +1023 -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 +4 -0
- package/dist/packages/compiler/compiled-compile.js +4 -0
- package/dist/packages/compiler/compiled-paths.d.ts +40 -0
- package/dist/packages/compiler/compiled-paths.js +106 -0
- package/dist/packages/compiler/compiled-pipeline.d.ts +39 -0
- package/dist/packages/compiler/compiled-pipeline.js +134 -0
- package/dist/packages/compiler/compiled-schema.d.ts +31 -0
- package/dist/packages/compiler/compiled-schema.js +141 -0
- package/dist/packages/compiler/compiled-stage-plan.d.ts +15 -0
- package/dist/packages/compiler/compiled-stage-plan.js +79 -0
- package/dist/packages/compiler/compiled-stage-runner.d.ts +10 -0
- package/dist/packages/compiler/compiled-stage-runner.js +46 -0
- package/dist/packages/compiler/compiled-target.d.ts +11 -0
- package/dist/packages/compiler/compiled-target.js +16 -0
- package/dist/packages/compiler/discovery.d.ts +7 -0
- package/dist/packages/compiler/discovery.js +80 -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 +363 -0
- package/dist/packages/compiler/raw-snapshot.d.ts +49 -0
- package/dist/packages/compiler/raw-snapshot.js +102 -0
- package/dist/packages/compiler/reset.d.ts +2 -0
- package/dist/packages/compiler/reset.js +72 -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 +1 -0
- package/dist/packages/project-model/compiled-paths.js +1 -0
- package/dist/packages/project-model/compiled-raw.d.ts +1 -0
- package/dist/packages/project-model/compiled-raw.js +1 -0
- package/dist/packages/project-model/compiled-reset.d.ts +1 -0
- package/dist/packages/project-model/compiled-reset.js +1 -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 +1 -0
- package/dist/packages/project-model/interf-bootstrap.js +1 -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 +298 -0
- package/dist/packages/shared/file-types.d.ts +1 -0
- package/dist/packages/shared/file-types.js +4 -0
- package/dist/packages/shared/filesystem.d.ts +2 -0
- package/dist/packages/shared/filesystem.js +55 -0
- package/dist/packages/shared/index.d.ts +7 -0
- package/dist/packages/shared/index.js +7 -0
- package/dist/packages/shared/logger.d.ts +3 -0
- package/dist/packages/shared/logger.js +10 -0
- package/dist/packages/shared/naming.d.ts +1 -0
- package/dist/packages/shared/naming.js +8 -0
- package/dist/packages/shared/parse.d.ts +8 -0
- package/dist/packages/shared/parse.js +145 -0
- package/dist/packages/shared/path-guards.d.ts +2 -0
- package/dist/packages/shared/path-guards.js +14 -0
- package/dist/packages/shared/util.d.ts +3 -0
- package/dist/packages/shared/util.js +3 -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 +121 -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 +210 -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/context-interface.d.ts +96 -0
- package/dist/packages/workflow-package/context-interface.js +146 -0
- package/dist/packages/workflow-package/index.d.ts +11 -0
- package/dist/packages/workflow-package/index.js +11 -0
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +25 -0
- package/dist/packages/workflow-package/interf-workflow-package.js +389 -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 +57 -0
- package/dist/packages/workflow-package/local-workflows.js +424 -0
- package/dist/packages/workflow-package/workflow-definitions.d.ts +82 -0
- package/dist/packages/workflow-package/workflow-definitions.js +210 -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
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function extractAgentFailureStatus(event: Record<string, unknown>): string | null;
|
|
2
|
+
export declare function classifyTerminalVisibleStatus(text: string | null | undefined): "done" | "failure" | null;
|
|
3
|
+
export declare function hasAgentStalled(lastActivityAt: number, now: number, stallTimeoutMs: number | null | undefined): boolean;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export function extractAgentFailureStatus(event) {
|
|
2
|
+
const candidates = [];
|
|
3
|
+
const directMessage = pickString(event.message) ??
|
|
4
|
+
pickString(event.text) ??
|
|
5
|
+
pickString(event.content) ??
|
|
6
|
+
pickString(event.output) ??
|
|
7
|
+
pickString(event.summary);
|
|
8
|
+
if (directMessage)
|
|
9
|
+
candidates.push(directMessage);
|
|
10
|
+
const item = event.item;
|
|
11
|
+
if (item && typeof item === "object") {
|
|
12
|
+
const itemRecord = item;
|
|
13
|
+
const itemText = pickString(itemRecord.text);
|
|
14
|
+
if (itemText)
|
|
15
|
+
candidates.push(itemText);
|
|
16
|
+
if (typeof itemRecord.aggregated_output === "string") {
|
|
17
|
+
candidates.push(itemRecord.aggregated_output);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
for (const candidate of candidates) {
|
|
21
|
+
const lines = candidate
|
|
22
|
+
.split(/\r?\n/)
|
|
23
|
+
.map((line) => line.trim())
|
|
24
|
+
.filter((line) => line.length > 0);
|
|
25
|
+
for (const text of lines) {
|
|
26
|
+
if (text.startsWith("BLOCKED:") || text.startsWith("ERROR:")) {
|
|
27
|
+
return text;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return null;
|
|
32
|
+
}
|
|
33
|
+
export function classifyTerminalVisibleStatus(text) {
|
|
34
|
+
if (!text)
|
|
35
|
+
return null;
|
|
36
|
+
if (text.startsWith("DONE:"))
|
|
37
|
+
return "done";
|
|
38
|
+
if (text.startsWith("BLOCKED:") || text.startsWith("ERROR:"))
|
|
39
|
+
return "failure";
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
export function hasAgentStalled(lastActivityAt, now, stallTimeoutMs) {
|
|
43
|
+
return typeof stallTimeoutMs === "number" && stallTimeoutMs > 0 && now - lastActivityAt >= stallTimeoutMs;
|
|
44
|
+
}
|
|
45
|
+
function pickString(value) {
|
|
46
|
+
if (typeof value === "string")
|
|
47
|
+
return value;
|
|
48
|
+
if (!Array.isArray(value))
|
|
49
|
+
return null;
|
|
50
|
+
for (const entry of value) {
|
|
51
|
+
if (typeof entry === "string")
|
|
52
|
+
return entry;
|
|
53
|
+
if (entry && typeof entry === "object" && "text" in entry && typeof entry.text === "string") {
|
|
54
|
+
return entry.text;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return null;
|
|
58
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { WorkflowExecutionProfile } from "./executors.js";
|
|
2
|
+
export interface Agent {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
skillsDir: string;
|
|
6
|
+
command: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AgentPreflightResult {
|
|
9
|
+
ok: boolean;
|
|
10
|
+
code: number | null;
|
|
11
|
+
timedOut: boolean;
|
|
12
|
+
stdout: string;
|
|
13
|
+
stderr: string;
|
|
14
|
+
error: string | null;
|
|
15
|
+
}
|
|
16
|
+
export type AgentSpawnSync = typeof import("node:child_process").spawnSync;
|
|
17
|
+
export interface AgentPreflightOptions {
|
|
18
|
+
timeoutMs?: number;
|
|
19
|
+
spawnSyncImpl?: AgentSpawnSync;
|
|
20
|
+
}
|
|
21
|
+
export interface AgentAutomationReadiness {
|
|
22
|
+
ok: boolean;
|
|
23
|
+
error?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface SpawnAgentOptions {
|
|
26
|
+
eventLogPath?: string | null;
|
|
27
|
+
statusLogPath?: string | null;
|
|
28
|
+
executionProfile?: WorkflowExecutionProfile;
|
|
29
|
+
completionCheck?: (() => boolean) | null;
|
|
30
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type InterfUserConfig } from "./schema.js";
|
|
2
2
|
export type { InterfUserConfig } from "./schema.js";
|
|
3
|
+
export declare const INTERF_HOME: string;
|
|
3
4
|
export declare const USER_CONFIG_PATH: string;
|
|
4
5
|
export declare function loadUserConfig(): InterfUserConfig | null;
|
|
5
6
|
export declare function saveUserConfig(config: InterfUserConfig): void;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
2
3
|
import { join } from "node:path";
|
|
3
|
-
import {
|
|
4
|
-
import { readJsonFileWithSchema } from "./parse.js";
|
|
4
|
+
import { readJsonFileWithSchema } from "../../shared/parse.js";
|
|
5
5
|
import { InterfUserConfigSchema } from "./schema.js";
|
|
6
|
+
export const INTERF_HOME = join(homedir(), ".interf");
|
|
6
7
|
export const USER_CONFIG_PATH = join(INTERF_HOME, "config.json");
|
|
7
8
|
export function loadUserConfig() {
|
|
8
9
|
if (!existsSync(USER_CONFIG_PATH))
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export declare const COMPILED_INTERF_DIR = ".interf";
|
|
2
|
+
export declare const COMPILED_CONFIG_FILE = "interf.json";
|
|
3
|
+
export declare const COMPILED_WORKFLOW_DIR = "workflow";
|
|
4
|
+
export declare const COMPILED_TEST_DIR = "tests";
|
|
5
|
+
export declare const COMPILED_TEST_TARGETS_DIR = "targets";
|
|
6
|
+
export declare const COMPILED_RUNTIME_DIR = "runtime";
|
|
7
|
+
export declare const COMPILED_RUNTIME_STATE_FILE = "state.json";
|
|
8
|
+
export declare const COMPILED_RUNTIME_HEALTH_FILE = "health.json";
|
|
9
|
+
export declare const COMPILED_RUNTIME_VIEW_SPEC_FILE = "view-spec.json";
|
|
10
|
+
export declare const COMPILED_RUNTIME_RAW_SNAPSHOT_FILE = "raw-snapshot.json";
|
|
11
|
+
export declare const COMPILED_RUNTIME_INVENTORY_FILE = "inventory.json";
|
|
12
|
+
export declare const COMPILED_RUNTIME_RUN_FILE = "run.json";
|
|
13
|
+
export declare const COMPILED_RUNTIME_RUN_HISTORY_FILE = "run-history.jsonl";
|
|
14
|
+
export declare const COMPILED_RUNTIME_STAGE_CONTRACT_FILE = "stage-contract.json";
|
|
15
|
+
export declare function compiledRuntimeRoot(compiledPath: string): string;
|
|
16
|
+
export declare function compiledRuntimeFilePath(compiledPath: string, fileName: string): string;
|
|
17
|
+
export declare function compiledInterfRoot(compiledPath: string): string;
|
|
18
|
+
export declare function compiledInterfConfigPath(compiledPath: string): string;
|
|
19
|
+
export declare function workflowPackagePathForCompiled(compiledPath: string): string;
|
|
20
|
+
export declare function testRootForCompiled(compiledPath: string): string;
|
|
21
|
+
export declare function testTargetsRootForCompiled(compiledPath: string): string;
|
|
22
|
+
export declare function stageExecutionShellsRoot(compiledPath: string): string;
|
|
23
|
+
export declare function workflowImprovementLoopsRoot(compiledPath: string): string;
|
|
24
|
+
export declare function workflowImprovementRunRoot(compiledPath: string, runId: string): string;
|
|
25
|
+
export declare function workflowImprovementLoopRoot(compiledPath: string, runId: string, loopIndex: number): string;
|
|
26
|
+
export declare function targetTestRunsRootForCompiled(compiledPath: string): string;
|
|
27
|
+
export declare function targetTestSandboxesRootForCompiled(compiledPath: string): string;
|
|
28
|
+
export declare function compiledRuntimeLogsRoot(compiledPath: string): string;
|
|
29
|
+
export declare function compiledRuntimeArchivedStageContractPath(compiledPath: string, runId: string): string;
|
|
30
|
+
export declare function compiledQueryAcceptanceRoot(compiledPath: string): string;
|
|
31
|
+
export declare function compiledRuntimeStatePath(compiledPath: string): string;
|
|
32
|
+
export declare function compiledRuntimeHealthPath(compiledPath: string): string;
|
|
33
|
+
export declare function compiledRuntimeViewSpecPath(compiledPath: string): string;
|
|
34
|
+
export declare function compiledRawSnapshotMetadataPath(compiledPath: string): string;
|
|
35
|
+
export declare function compiledRuntimeInventoryPath(compiledPath: string): string;
|
|
36
|
+
export declare function compiledRuntimeRunPath(compiledPath: string): string;
|
|
37
|
+
export declare function compiledRuntimeRunHistoryPath(compiledPath: string): string;
|
|
38
|
+
export declare function compiledRuntimeStageContractPath(compiledPath: string): string;
|
|
39
|
+
export declare function resolveSourceControlPathForCompiled(compiledPath: string): string;
|
|
40
|
+
export declare function defaultControlPathForCompiled(compiledPath: string): string;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
2
|
+
export const COMPILED_INTERF_DIR = ".interf";
|
|
3
|
+
export const COMPILED_CONFIG_FILE = "interf.json";
|
|
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(`Context folder 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
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { type WorkflowExecutor } from "../agents/lib/executors.js";
|
|
2
|
+
import { type WorkflowReporter, type WorkflowStageResult } from "../workflow-package/workflow-helpers.js";
|
|
3
|
+
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
|
+
export interface CompiledSummarizeResult extends WorkflowStageResult {
|
|
5
|
+
skipped: boolean;
|
|
6
|
+
plan: {
|
|
7
|
+
sourceCount: number;
|
|
8
|
+
summaryCount: number;
|
|
9
|
+
targetCount: number;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
export interface CompiledCompileResult {
|
|
13
|
+
ok: boolean;
|
|
14
|
+
stageResults: Record<string, WorkflowStageResult>;
|
|
15
|
+
failedStage: string | null;
|
|
16
|
+
}
|
|
17
|
+
export type StageShellRetentionMode = "on-failure" | "always";
|
|
18
|
+
export declare function runCompiledSummarize(options: {
|
|
19
|
+
executor: WorkflowExecutor;
|
|
20
|
+
compiledPath: string;
|
|
21
|
+
reporter?: WorkflowReporter;
|
|
22
|
+
reportSummary?: boolean;
|
|
23
|
+
reportStep?: boolean;
|
|
24
|
+
stageDefinition?: CompiledStageExecutionDefinition;
|
|
25
|
+
fullPass?: boolean;
|
|
26
|
+
}): Promise<CompiledSummarizeResult>;
|
|
27
|
+
export declare function runCompiledCompile(options: {
|
|
28
|
+
executor: WorkflowExecutor;
|
|
29
|
+
compiledPath: string;
|
|
30
|
+
reporter?: WorkflowReporter;
|
|
31
|
+
reportStep?: boolean;
|
|
32
|
+
preserveStageShells?: StageShellRetentionMode;
|
|
33
|
+
}): Promise<WorkflowStageResult>;
|
|
34
|
+
export declare function compileCompiled(options: {
|
|
35
|
+
executor: WorkflowExecutor;
|
|
36
|
+
compiledPath: string;
|
|
37
|
+
reporter?: WorkflowReporter;
|
|
38
|
+
preserveStageShells?: StageShellRetentionMode;
|
|
39
|
+
}): Promise<CompiledCompileResult>;
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { refreshCompiledBootstrapGuidance, } from "../agents/lib/compiled-bootstrap.js";
|
|
3
|
+
import { validateWorkflowPackage } from "../workflow-package/local-workflows.js";
|
|
4
|
+
import { reportValidationFailure, } from "../workflow-package/workflow-helpers.js";
|
|
5
|
+
import { validateCompiledWorkflow, } from "./validate.js";
|
|
6
|
+
import { pruneStageExecutionShells, } from "../agents/lib/shells.js";
|
|
7
|
+
import { syncCompiledRawSnapshot } from "./raw-snapshot.js";
|
|
8
|
+
import { compiledExecutionStages, resolveCompiledContext, } from "./compiled-target.js";
|
|
9
|
+
import { discoverSourceFiles } from "./discovery.js";
|
|
10
|
+
import { runCompiledStage } from "./compiled-stage-runner.js";
|
|
11
|
+
import { resolveSourceInputPath } from "../project-model/interf-detect.js";
|
|
12
|
+
export async function runCompiledSummarize(options) {
|
|
13
|
+
const context = resolveCompiledContext(options.compiledPath);
|
|
14
|
+
const stageDefinition = options.stageDefinition
|
|
15
|
+
?? compiledExecutionStages(context.workflowId, options.compiledPath).find((stage) => stage.id === "summarize");
|
|
16
|
+
if (!stageDefinition) {
|
|
17
|
+
return {
|
|
18
|
+
ok: false,
|
|
19
|
+
code: 1,
|
|
20
|
+
skipped: true,
|
|
21
|
+
plan: { sourceCount: 0, summaryCount: 0, targetCount: 0 },
|
|
22
|
+
summary: "Workflow does not declare a summarize stage.",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
const sourceCount = discoverSourceFiles(context.sourcePath, options.compiledPath).totalCount;
|
|
26
|
+
const result = await runCompiledStage({
|
|
27
|
+
executor: options.executor,
|
|
28
|
+
compiledPath: options.compiledPath,
|
|
29
|
+
reporter: options.reporter,
|
|
30
|
+
reportStep: options.reportStep,
|
|
31
|
+
stageDefinition,
|
|
32
|
+
});
|
|
33
|
+
return {
|
|
34
|
+
...result,
|
|
35
|
+
skipped: false,
|
|
36
|
+
plan: {
|
|
37
|
+
sourceCount,
|
|
38
|
+
summaryCount: 0,
|
|
39
|
+
targetCount: sourceCount,
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export async function runCompiledCompile(options) {
|
|
44
|
+
const preserveMode = options.preserveStageShells ?? "on-failure";
|
|
45
|
+
if (preserveMode !== "always") {
|
|
46
|
+
pruneStageExecutionShells(options.compiledPath);
|
|
47
|
+
}
|
|
48
|
+
let lastResult = { ok: true, code: 0 };
|
|
49
|
+
try {
|
|
50
|
+
const context = resolveCompiledContext(options.compiledPath);
|
|
51
|
+
for (const stageDefinition of compiledExecutionStages(context.workflowId, options.compiledPath)) {
|
|
52
|
+
const result = await runCompiledStage({
|
|
53
|
+
executor: options.executor,
|
|
54
|
+
compiledPath: options.compiledPath,
|
|
55
|
+
reporter: options.reporter,
|
|
56
|
+
reportStep: options.reportStep,
|
|
57
|
+
stageDefinition,
|
|
58
|
+
});
|
|
59
|
+
lastResult = result;
|
|
60
|
+
if (!result.ok)
|
|
61
|
+
return result;
|
|
62
|
+
}
|
|
63
|
+
return lastResult;
|
|
64
|
+
}
|
|
65
|
+
finally {
|
|
66
|
+
if (preserveMode !== "always" && lastResult.ok) {
|
|
67
|
+
pruneStageExecutionShells(options.compiledPath);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
export async function compileCompiled(options) {
|
|
72
|
+
const preserveMode = options.preserveStageShells ?? "on-failure";
|
|
73
|
+
if (preserveMode !== "always") {
|
|
74
|
+
pruneStageExecutionShells(options.compiledPath);
|
|
75
|
+
}
|
|
76
|
+
let result = {
|
|
77
|
+
ok: true,
|
|
78
|
+
stageResults: {},
|
|
79
|
+
failedStage: null,
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
const sourceInputPath = resolveSourceInputPath(options.compiledPath);
|
|
83
|
+
syncCompiledRawSnapshot(options.compiledPath, sourceInputPath);
|
|
84
|
+
refreshCompiledBootstrapGuidance(options.compiledPath);
|
|
85
|
+
const workflowValidation = validateWorkflowPackage(join(options.compiledPath, ".interf", "workflow"));
|
|
86
|
+
if (!workflowValidation.ok) {
|
|
87
|
+
reportValidationFailure(options.reporter, workflowValidation.summary, workflowValidation.errors);
|
|
88
|
+
return {
|
|
89
|
+
...result,
|
|
90
|
+
ok: false,
|
|
91
|
+
failedStage: "workflow",
|
|
92
|
+
stageResults: {
|
|
93
|
+
...result.stageResults,
|
|
94
|
+
workflow: {
|
|
95
|
+
ok: false,
|
|
96
|
+
code: 1,
|
|
97
|
+
summary: workflowValidation.summary,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
const context = resolveCompiledContext(options.compiledPath);
|
|
103
|
+
const stages = compiledExecutionStages(context.workflowId, options.compiledPath);
|
|
104
|
+
for (const stageDefinition of stages) {
|
|
105
|
+
const stageResult = await runCompiledStage({
|
|
106
|
+
executor: options.executor,
|
|
107
|
+
compiledPath: options.compiledPath,
|
|
108
|
+
reporter: options.reporter,
|
|
109
|
+
reportStep: true,
|
|
110
|
+
stageDefinition,
|
|
111
|
+
});
|
|
112
|
+
result.stageResults[stageDefinition.id] = stageResult;
|
|
113
|
+
if (!stageResult.ok) {
|
|
114
|
+
result.ok = false;
|
|
115
|
+
result.failedStage = stageDefinition.id;
|
|
116
|
+
return result;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
const workflowValidationResult = validateCompiledWorkflow(options.compiledPath);
|
|
120
|
+
result.ok = workflowValidationResult.ok;
|
|
121
|
+
result.failedStage = workflowValidationResult.ok ? null : workflowValidationResult.stage;
|
|
122
|
+
result.stageResults.compiled = {
|
|
123
|
+
ok: workflowValidationResult.ok,
|
|
124
|
+
code: workflowValidationResult.ok ? 0 : 1,
|
|
125
|
+
summary: workflowValidationResult.summary,
|
|
126
|
+
};
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
129
|
+
finally {
|
|
130
|
+
if (preserveMode !== "always" && result.ok) {
|
|
131
|
+
pruneStageExecutionShells(options.compiledPath);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type BuiltinCompiledZoneId } from "../workflow-package/builtin-compiled-workflow.js";
|
|
2
|
+
import { type WorkflowCompiledSchema, type WorkflowCompiledZone, type WorkflowZoneId } from "./lib/schema.js";
|
|
3
|
+
export interface WorkflowSchemaStageLike {
|
|
4
|
+
id: string;
|
|
5
|
+
writes: readonly string[];
|
|
6
|
+
}
|
|
7
|
+
export { BUILTIN_COMPILED_ZONE_IDS } from "../workflow-package/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;
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { warnInterf } from "../shared/logger.js";
|
|
4
|
+
import { readJsonFileUnchecked } from "../shared/parse.js";
|
|
5
|
+
import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "../workflow-package/builtin-compiled-workflow.js";
|
|
6
|
+
import { WorkflowCompiledSchemaSchema, } from "./lib/schema.js";
|
|
7
|
+
export { BUILTIN_COMPILED_ZONE_IDS } from "../workflow-package/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
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type RuntimeStageContractDraft } from "./runtime.js";
|
|
2
|
+
import { type CompiledWorkflowId, type WorkflowStageDefinition } from "../workflow-package/workflow-definitions.js";
|
|
3
|
+
import { resolveCompiledContext, type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
|
+
import type { RuntimeStageInstructions } from "./lib/schema.js";
|
|
5
|
+
export declare function resolveStageContractArtifacts(compiledPath: string, stageDefinition: Pick<WorkflowStageDefinition, "id" | "reads" | "writes">): {
|
|
6
|
+
reads: string[];
|
|
7
|
+
writes: string[];
|
|
8
|
+
};
|
|
9
|
+
export declare function buildStageCounts(compiledPath: string, stageDefinition: WorkflowStageDefinition): Record<string, number>;
|
|
10
|
+
export declare function buildStageContract(compiledPath: string, workflowId: CompiledWorkflowId, stageDefinition: WorkflowStageDefinition, instructions: RuntimeStageInstructions): RuntimeStageContractDraft;
|
|
11
|
+
export declare function buildCompiledStageExecutionPlan(compiledPath: string, stageDefinition: CompiledStageExecutionDefinition): {
|
|
12
|
+
context: ReturnType<typeof resolveCompiledContext>;
|
|
13
|
+
contract: RuntimeStageContractDraft;
|
|
14
|
+
instructions: RuntimeStageInstructions;
|
|
15
|
+
};
|