@interf/compiler 0.7.3 → 0.9.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 +124 -90
- package/TRADEMARKS.md +1 -1
- package/agent-skills/interf-actions/SKILL.md +74 -0
- package/agent-skills/interf-actions/references/cli.md +190 -0
- package/{builtin-workflows/interf → builtin-methods/interf-default}/README.md +9 -9
- package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/shape/SKILL.md +4 -4
- package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/structure/SKILL.md +1 -1
- package/builtin-methods/interf-default/improve/SKILL.md +18 -0
- package/{builtin-workflows/interf/workflow.json → builtin-methods/interf-default/method.json} +9 -9
- package/{builtin-workflows/interf/workflow.schema.json → builtin-methods/interf-default/method.schema.json} +3 -3
- package/{builtin-workflows/interf → builtin-methods/interf-default}/use/query/SKILL.md +1 -1
- package/dist/cli/commands/check-draft.d.ts +11 -10
- package/dist/cli/commands/check-draft.js +21 -20
- package/dist/cli/commands/compile-controller.d.ts +10 -7
- package/dist/cli/commands/compile-controller.js +84 -79
- package/dist/cli/commands/compile.d.ts +3 -3
- package/dist/cli/commands/compile.js +101 -43
- package/dist/cli/commands/compiled-flow.d.ts +14 -11
- package/dist/cli/commands/compiled-flow.js +38 -33
- package/dist/cli/commands/control-path.d.ts +11 -0
- package/dist/cli/commands/control-path.js +72 -0
- package/dist/cli/commands/create-method-wizard.d.ts +76 -0
- package/dist/cli/commands/create-method-wizard.js +465 -0
- package/dist/cli/commands/create.d.ts +3 -3
- package/dist/cli/commands/create.js +81 -68
- package/dist/cli/commands/default.js +4 -3
- package/dist/cli/commands/doctor.js +5 -5
- package/dist/cli/commands/executor-flow.d.ts +6 -6
- package/dist/cli/commands/executor-flow.js +2 -2
- package/dist/cli/commands/init.d.ts +2 -2
- package/dist/cli/commands/init.js +415 -144
- package/dist/cli/commands/list.js +16 -14
- package/dist/cli/commands/preparation-selection.d.ts +6 -0
- package/dist/cli/commands/preparation-selection.js +11 -0
- package/dist/cli/commands/reset.js +3 -3
- package/dist/cli/commands/source-config-wizard.d.ts +12 -11
- package/dist/cli/commands/source-config-wizard.js +206 -228
- package/dist/cli/commands/status.js +152 -17
- package/dist/cli/commands/test-flow.d.ts +16 -16
- package/dist/cli/commands/test-flow.js +53 -243
- package/dist/cli/commands/test.d.ts +6 -2
- package/dist/cli/commands/test.js +136 -100
- package/dist/cli/commands/verify.js +13 -13
- package/dist/cli/commands/web.d.ts +11 -0
- package/dist/cli/commands/web.js +386 -0
- package/dist/cli/index.d.ts +2 -1
- package/dist/cli/index.js +3 -1
- package/dist/compiler-ui/404.html +1 -0
- package/dist/compiler-ui/__next.__PAGE__.txt +10 -0
- package/dist/compiler-ui/__next._full.txt +20 -0
- package/dist/compiler-ui/__next._head.txt +5 -0
- package/dist/compiler-ui/__next._index.txt +5 -0
- package/dist/compiler-ui/__next._tree.txt +5 -0
- package/dist/compiler-ui/_next/static/chunks/03~yq9q893hmn.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +5 -0
- package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/08g7lvje.te.u.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/08m7vf5asqlsm.js +91 -0
- package/dist/compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/0c9mu7yldxyyg.css +3 -0
- package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +31 -0
- package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/0n51hrfoufc7g.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +1 -0
- package/dist/compiler-ui/_next/static/chunks/0y5z3t-z1c8ks.js.map +5 -0
- package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/15mks7ry_cupt.js +118 -0
- package/dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js +1 -0
- package/dist/compiler-ui/_next/static/chunks/turbopack-10e~t1yzi4svj.js +1 -0
- package/dist/compiler-ui/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +1 -0
- package/dist/compiler-ui/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/dist/compiler-ui/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/dist/compiler-ui/_next/static/media/worker.102zas1s52_pf.js +109 -0
- package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_buildManifest.js +11 -0
- package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_clientMiddlewareManifest.js +1 -0
- package/dist/compiler-ui/_next/static/pIZnDsV3Je6hdC3cOsGdK/_ssgManifest.js +1 -0
- package/dist/compiler-ui/_not-found/__next._full.txt +15 -0
- package/dist/compiler-ui/_not-found/__next._head.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._index.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -0
- package/dist/compiler-ui/_not-found.html +1 -0
- package/dist/compiler-ui/_not-found.txt +15 -0
- package/dist/compiler-ui/index.html +1 -0
- package/dist/compiler-ui/index.txt +20 -0
- package/dist/index.d.ts +11 -7
- package/dist/index.js +8 -4
- package/dist/packages/agents/index.d.ts +1 -1
- package/dist/packages/agents/lib/args.d.ts +2 -2
- package/dist/packages/agents/lib/compiled-bootstrap.js +7 -6
- package/dist/packages/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/agents/lib/execution-profile.js +7 -6
- package/dist/packages/agents/lib/execution.js +4 -2
- package/dist/packages/agents/lib/executors.d.ts +14 -13
- package/dist/packages/agents/lib/executors.js +1 -0
- package/dist/packages/agents/lib/preflight.d.ts +1 -0
- package/dist/packages/agents/lib/preflight.js +32 -9
- package/dist/packages/agents/lib/render.d.ts +2 -2
- package/dist/packages/agents/lib/render.js +10 -9
- package/dist/packages/agents/lib/shells.d.ts +27 -34
- package/dist/packages/agents/lib/shells.js +191 -235
- package/dist/packages/agents/lib/types.d.ts +3 -2
- package/dist/packages/compiler/artifact-counts.d.ts +1 -0
- package/dist/packages/compiler/artifact-counts.js +30 -0
- package/dist/packages/compiler/compiled-paths.d.ts +5 -5
- package/dist/packages/compiler/compiled-paths.js +10 -10
- package/dist/packages/compiler/compiled-pipeline.d.ts +18 -12
- package/dist/packages/compiler/compiled-pipeline.js +34 -23
- package/dist/packages/compiler/compiled-schema.d.ts +20 -20
- package/dist/packages/compiler/compiled-schema.js +29 -29
- package/dist/packages/compiler/compiled-stage-plan.d.ts +4 -4
- package/dist/packages/compiler/compiled-stage-plan.js +11 -11
- package/dist/packages/compiler/compiled-stage-runner.d.ts +10 -5
- package/dist/packages/compiler/compiled-stage-runner.js +56 -8
- package/dist/packages/compiler/compiled-target.d.ts +5 -5
- package/dist/packages/compiler/compiled-target.js +5 -5
- package/dist/packages/compiler/index.d.ts +3 -3
- package/dist/packages/compiler/index.js +2 -2
- package/dist/packages/compiler/lib/schema.d.ts +68 -93
- package/dist/packages/compiler/lib/schema.js +57 -89
- package/dist/packages/compiler/{workflows.d.ts → method-runs.d.ts} +4 -4
- package/dist/packages/compiler/{workflows.js → method-runs.js} +4 -3
- package/dist/packages/compiler/raw-snapshot.d.ts +3 -3
- package/dist/packages/compiler/raw-snapshot.js +0 -1
- package/dist/packages/compiler/reset.js +3 -3
- package/dist/packages/compiler/runtime-acceptance.js +9 -16
- package/dist/packages/compiler/runtime-contracts.js +9 -9
- package/dist/packages/compiler/runtime-prompt.js +9 -9
- package/dist/packages/compiler/runtime-reconcile.d.ts +2 -2
- package/dist/packages/compiler/runtime-reconcile.js +3 -3
- package/dist/packages/compiler/runtime-runs.js +12 -9
- package/dist/packages/compiler/runtime-types.d.ts +9 -7
- package/dist/packages/compiler/state-health.js +26 -35
- package/dist/packages/compiler/state-view.js +6 -6
- package/dist/packages/compiler/validate-compiled.d.ts +5 -5
- package/dist/packages/compiler/validate-compiled.js +56 -62
- package/dist/packages/compiler/validate.d.ts +2 -2
- package/dist/packages/compiler/validate.js +22 -14
- package/dist/packages/contracts/index.d.ts +2 -0
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +205 -0
- package/dist/packages/contracts/lib/schema.js +101 -0
- package/dist/packages/execution/adapters.d.ts +15 -0
- package/dist/packages/execution/adapters.js +1 -0
- package/dist/packages/execution/events.d.ts +8 -0
- package/dist/packages/execution/events.js +16 -0
- package/dist/packages/execution/index.d.ts +9 -0
- package/dist/packages/execution/index.js +6 -0
- package/dist/packages/execution/lib/schema.d.ts +1551 -0
- package/dist/packages/execution/lib/schema.js +296 -0
- package/dist/packages/local-service/action-values.d.ts +22 -0
- package/dist/packages/local-service/action-values.js +30 -0
- package/dist/packages/local-service/client.d.ts +119 -0
- package/dist/packages/local-service/client.js +356 -0
- package/dist/packages/local-service/index.d.ts +15 -0
- package/dist/packages/local-service/index.js +11 -0
- package/dist/packages/local-service/lib/schema.d.ts +6917 -0
- package/dist/packages/local-service/lib/schema.js +519 -0
- package/dist/packages/local-service/routes.d.ts +27 -0
- package/dist/packages/local-service/routes.js +32 -0
- package/dist/packages/local-service/run-observability.d.ts +6 -0
- package/dist/packages/local-service/run-observability.js +592 -0
- package/dist/packages/local-service/runtime.d.ts +130 -0
- package/dist/packages/local-service/runtime.js +2263 -0
- package/dist/packages/local-service/server.d.ts +18 -0
- package/dist/packages/local-service/server.js +577 -0
- package/dist/packages/method-authoring/index.d.ts +4 -0
- package/dist/packages/method-authoring/index.js +4 -0
- package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.d.ts → method-authoring/lib/method-edit-utils.d.ts} +3 -3
- package/dist/packages/method-authoring/method-authoring.d.ts +24 -0
- package/dist/packages/method-authoring/method-authoring.js +116 -0
- package/dist/packages/method-authoring/method-edit-session.d.ts +18 -0
- package/dist/packages/method-authoring/method-edit-session.js +125 -0
- package/dist/packages/method-authoring/method-improvement.d.ts +23 -0
- package/dist/packages/{workflow-authoring/workflow-improvement.js → method-authoring/method-improvement.js} +65 -64
- package/dist/packages/{workflow-package/builtin-compiled-workflow.d.ts → method-package/builtin-compiled-method.d.ts} +1 -1
- package/dist/packages/{workflow-package/builtin-compiled-workflow.js → method-package/builtin-compiled-method.js} +17 -17
- package/dist/packages/{workflow-package → method-package}/context-interface.d.ts +12 -12
- package/dist/packages/{workflow-package → method-package}/context-interface.js +20 -20
- package/dist/packages/method-package/index.d.ts +11 -0
- package/dist/packages/method-package/index.js +11 -0
- package/dist/packages/method-package/interf-method-package.d.ts +31 -0
- package/dist/packages/method-package/interf-method-package.js +496 -0
- package/dist/packages/{workflow-package → method-package}/lib/package-root.js +1 -1
- package/dist/packages/method-package/local-methods.d.ts +64 -0
- package/dist/packages/method-package/local-methods.js +466 -0
- package/dist/packages/method-package/method-definitions.d.ts +83 -0
- package/dist/packages/method-package/method-definitions.js +205 -0
- package/dist/packages/{workflow-package/workflow-helpers.d.ts → method-package/method-helpers.d.ts} +10 -10
- package/dist/packages/{workflow-package/workflow-helpers.js → method-package/method-helpers.js} +27 -27
- package/dist/packages/method-package/method-review-paths.d.ts +10 -0
- package/dist/packages/{workflow-package/workflow-review-paths.js → method-package/method-review-paths.js} +4 -4
- package/dist/packages/{workflow-package/workflow-stage-runner.d.ts → method-package/method-stage-runner.d.ts} +13 -11
- package/dist/packages/{workflow-package/workflow-stage-runner.js → method-package/method-stage-runner.js} +8 -6
- package/dist/packages/methods/index.d.ts +2 -0
- package/dist/packages/methods/index.js +2 -0
- package/dist/packages/methods/method-resolution.d.ts +6 -0
- package/dist/packages/methods/method-resolution.js +7 -0
- package/dist/packages/project-model/index.d.ts +2 -4
- package/dist/packages/project-model/index.js +1 -3
- package/dist/packages/project-model/interf-detect.d.ts +3 -3
- package/dist/packages/project-model/interf-detect.js +18 -14
- package/dist/packages/project-model/interf-scaffold.d.ts +2 -2
- package/dist/packages/project-model/interf-scaffold.js +40 -38
- package/dist/packages/project-model/interf.d.ts +1 -2
- package/dist/packages/project-model/interf.js +1 -2
- package/dist/packages/project-model/lib/schema.d.ts +24 -14
- package/dist/packages/project-model/lib/schema.js +22 -30
- package/dist/packages/project-model/project-paths.d.ts +9 -10
- package/dist/packages/project-model/project-paths.js +14 -17
- package/dist/packages/project-model/source-config.d.ts +19 -17
- package/dist/packages/project-model/source-config.js +144 -145
- package/dist/packages/project-model/source-folders.d.ts +11 -0
- package/dist/packages/project-model/source-folders.js +110 -0
- package/dist/packages/testing/index.d.ts +2 -2
- package/dist/packages/testing/index.js +1 -1
- package/dist/packages/testing/lib/schema.d.ts +11 -11
- package/dist/packages/testing/lib/schema.js +8 -9
- package/dist/packages/testing/readiness-check-run.d.ts +67 -0
- package/dist/packages/testing/readiness-check-run.js +258 -0
- package/dist/packages/testing/test-execution.d.ts +3 -3
- package/dist/packages/testing/test-execution.js +8 -8
- package/dist/packages/testing/test-paths.js +7 -9
- package/dist/packages/testing/test-profile-presets.js +2 -2
- package/dist/packages/testing/test-sandbox.js +10 -11
- package/dist/packages/testing/test-targets.d.ts +1 -1
- package/dist/packages/testing/test-targets.js +8 -7
- package/dist/packages/testing/test-types.d.ts +1 -1
- package/package.json +29 -30
- package/builtin-workflows/interf/improve/SKILL.md +0 -18
- package/dist/cli/commands/create-workflow-wizard.d.ts +0 -70
- package/dist/cli/commands/create-workflow-wizard.js +0 -361
- package/dist/cli/commands/dataset-selection.d.ts +0 -6
- package/dist/cli/commands/dataset-selection.js +0 -11
- package/dist/lib/agent-args.d.ts +0 -1
- package/dist/lib/agent-args.js +0 -1
- package/dist/lib/agent-constants.d.ts +0 -1
- package/dist/lib/agent-constants.js +0 -1
- package/dist/lib/agent-detection.d.ts +0 -1
- package/dist/lib/agent-detection.js +0 -1
- package/dist/lib/agent-execution.d.ts +0 -1
- package/dist/lib/agent-execution.js +0 -1
- package/dist/lib/agent-logs.d.ts +0 -1
- package/dist/lib/agent-logs.js +0 -1
- package/dist/lib/agent-preflight.d.ts +0 -1
- package/dist/lib/agent-preflight.js +0 -1
- package/dist/lib/agent-render.d.ts +0 -1
- package/dist/lib/agent-render.js +0 -1
- package/dist/lib/agent-shells.d.ts +0 -1
- package/dist/lib/agent-shells.js +0 -1
- package/dist/lib/agent-status.d.ts +0 -1
- package/dist/lib/agent-status.js +0 -1
- package/dist/lib/agent-types.d.ts +0 -1
- package/dist/lib/agent-types.js +0 -1
- package/dist/lib/agents.d.ts +0 -1
- package/dist/lib/agents.js +0 -1
- package/dist/lib/builtin-compiled-workflow.d.ts +0 -1
- package/dist/lib/builtin-compiled-workflow.js +0 -1
- package/dist/lib/chart-guidance.d.ts +0 -1
- package/dist/lib/chart-guidance.js +0 -1
- package/dist/lib/compiled-compile.d.ts +0 -1
- package/dist/lib/compiled-compile.js +0 -1
- package/dist/lib/compiled-paths.d.ts +0 -1
- package/dist/lib/compiled-paths.js +0 -3
- package/dist/lib/compiled-raw.d.ts +0 -1
- package/dist/lib/compiled-raw.js +0 -3
- package/dist/lib/compiled-reset.d.ts +0 -1
- package/dist/lib/compiled-reset.js +0 -3
- package/dist/lib/compiled-schema.d.ts +0 -1
- package/dist/lib/compiled-schema.js +0 -1
- package/dist/lib/discovery.d.ts +0 -1
- package/dist/lib/discovery.js +0 -1
- package/dist/lib/execution-profile.d.ts +0 -1
- package/dist/lib/execution-profile.js +0 -1
- package/dist/lib/executors.d.ts +0 -1
- package/dist/lib/executors.js +0 -1
- package/dist/lib/filesystem.d.ts +0 -1
- package/dist/lib/filesystem.js +0 -1
- package/dist/lib/interf-bootstrap.d.ts +0 -1
- package/dist/lib/interf-bootstrap.js +0 -3
- package/dist/lib/interf-detect.d.ts +0 -1
- package/dist/lib/interf-detect.js +0 -3
- package/dist/lib/interf-scaffold.d.ts +0 -1
- package/dist/lib/interf-scaffold.js +0 -3
- package/dist/lib/interf-workflow-package.d.ts +0 -1
- package/dist/lib/interf-workflow-package.js +0 -1
- package/dist/lib/interf.d.ts +0 -1
- package/dist/lib/interf.js +0 -3
- package/dist/lib/local-workflows.d.ts +0 -1
- package/dist/lib/local-workflows.js +0 -1
- package/dist/lib/logger.d.ts +0 -1
- package/dist/lib/logger.js +0 -1
- package/dist/lib/package-root.d.ts +0 -1
- package/dist/lib/package-root.js +0 -1
- package/dist/lib/parse.d.ts +0 -1
- package/dist/lib/parse.js +0 -1
- package/dist/lib/project-paths.d.ts +0 -1
- package/dist/lib/project-paths.js +0 -3
- package/dist/lib/runtime-acceptance.d.ts +0 -1
- package/dist/lib/runtime-acceptance.js +0 -1
- package/dist/lib/runtime-contracts.d.ts +0 -1
- package/dist/lib/runtime-contracts.js +0 -1
- package/dist/lib/runtime-inventory.d.ts +0 -1
- package/dist/lib/runtime-inventory.js +0 -1
- package/dist/lib/runtime-paths.d.ts +0 -1
- package/dist/lib/runtime-paths.js +0 -1
- package/dist/lib/runtime-prompt.d.ts +0 -1
- package/dist/lib/runtime-prompt.js +0 -1
- package/dist/lib/runtime-reconcile.d.ts +0 -1
- package/dist/lib/runtime-reconcile.js +0 -1
- package/dist/lib/runtime-runs.d.ts +0 -1
- package/dist/lib/runtime-runs.js +0 -1
- package/dist/lib/runtime-types.d.ts +0 -1
- package/dist/lib/runtime-types.js +0 -1
- package/dist/lib/runtime.d.ts +0 -1
- package/dist/lib/runtime.js +0 -1
- package/dist/lib/schema.d.ts +0 -4
- package/dist/lib/schema.js +0 -6
- package/dist/lib/source-config.d.ts +0 -1
- package/dist/lib/source-config.js +0 -3
- package/dist/lib/state-artifacts.d.ts +0 -1
- package/dist/lib/state-artifacts.js +0 -1
- package/dist/lib/state-health.d.ts +0 -1
- package/dist/lib/state-health.js +0 -1
- package/dist/lib/state-io.d.ts +0 -1
- package/dist/lib/state-io.js +0 -1
- package/dist/lib/state-paths.d.ts +0 -1
- package/dist/lib/state-paths.js +0 -1
- package/dist/lib/state-view.d.ts +0 -1
- package/dist/lib/state-view.js +0 -1
- package/dist/lib/state.d.ts +0 -1
- package/dist/lib/state.js +0 -1
- package/dist/lib/test-execution.d.ts +0 -1
- package/dist/lib/test-execution.js +0 -3
- package/dist/lib/test-matrices.d.ts +0 -1
- package/dist/lib/test-matrices.js +0 -3
- package/dist/lib/test-paths.d.ts +0 -1
- package/dist/lib/test-paths.js +0 -3
- package/dist/lib/test-profile-presets.d.ts +0 -1
- package/dist/lib/test-profile-presets.js +0 -3
- package/dist/lib/test-sandbox.d.ts +0 -1
- package/dist/lib/test-sandbox.js +0 -3
- package/dist/lib/test-specs.d.ts +0 -1
- package/dist/lib/test-specs.js +0 -3
- package/dist/lib/test-targets.d.ts +0 -1
- package/dist/lib/test-targets.js +0 -3
- package/dist/lib/test-types.d.ts +0 -1
- package/dist/lib/test-types.js +0 -3
- package/dist/lib/test.d.ts +0 -1
- package/dist/lib/test.js +0 -3
- package/dist/lib/util.d.ts +0 -1
- package/dist/lib/util.js +0 -1
- package/dist/lib/validate-compiled.d.ts +0 -1
- package/dist/lib/validate-compiled.js +0 -1
- package/dist/lib/validate-helpers.d.ts +0 -1
- package/dist/lib/validate-helpers.js +0 -1
- package/dist/lib/validate.d.ts +0 -1
- package/dist/lib/validate.js +0 -1
- package/dist/lib/workflow-authoring.d.ts +0 -1
- package/dist/lib/workflow-authoring.js +0 -1
- package/dist/lib/workflow-definitions.d.ts +0 -1
- package/dist/lib/workflow-definitions.js +0 -1
- package/dist/lib/workflow-edit-session.d.ts +0 -1
- package/dist/lib/workflow-edit-session.js +0 -1
- package/dist/lib/workflow-edit-utils.d.ts +0 -1
- package/dist/lib/workflow-edit-utils.js +0 -1
- package/dist/lib/workflow-helpers.d.ts +0 -1
- package/dist/lib/workflow-helpers.js +0 -1
- package/dist/lib/workflow-improvement.d.ts +0 -1
- package/dist/lib/workflow-improvement.js +0 -1
- package/dist/lib/workflow-primitives.d.ts +0 -1
- package/dist/lib/workflow-primitives.js +0 -1
- package/dist/lib/workflow-review-paths.d.ts +0 -1
- package/dist/lib/workflow-review-paths.js +0 -1
- package/dist/lib/workflow-stage-policy.d.ts +0 -1
- package/dist/lib/workflow-stage-policy.js +0 -1
- package/dist/lib/workflow-stage-runner.d.ts +0 -1
- package/dist/lib/workflow-stage-runner.js +0 -1
- package/dist/lib/workflows.d.ts +0 -1
- package/dist/lib/workflows.js +0 -1
- package/dist/packages/project-model/compiled-paths.d.ts +0 -1
- package/dist/packages/project-model/compiled-paths.js +0 -1
- package/dist/packages/project-model/compiled-raw.d.ts +0 -1
- package/dist/packages/project-model/compiled-raw.js +0 -1
- package/dist/packages/project-model/compiled-reset.d.ts +0 -1
- package/dist/packages/project-model/compiled-reset.js +0 -1
- package/dist/packages/shared/index.d.ts +0 -7
- package/dist/packages/shared/index.js +0 -7
- package/dist/packages/shared/util.d.ts +0 -3
- package/dist/packages/shared/util.js +0 -3
- package/dist/packages/testing/test-matrices.d.ts +0 -90
- package/dist/packages/testing/test-matrices.js +0 -96
- package/dist/packages/workflow-authoring/index.d.ts +0 -4
- package/dist/packages/workflow-authoring/index.js +0 -4
- package/dist/packages/workflow-authoring/workflow-authoring.d.ts +0 -26
- package/dist/packages/workflow-authoring/workflow-authoring.js +0 -123
- package/dist/packages/workflow-authoring/workflow-edit-session.d.ts +0 -16
- package/dist/packages/workflow-authoring/workflow-edit-session.js +0 -60
- package/dist/packages/workflow-authoring/workflow-improvement.d.ts +0 -23
- package/dist/packages/workflow-package/index.d.ts +0 -11
- package/dist/packages/workflow-package/index.js +0 -11
- package/dist/packages/workflow-package/interf-workflow-package.d.ts +0 -25
- package/dist/packages/workflow-package/interf-workflow-package.js +0 -389
- package/dist/packages/workflow-package/local-workflows.d.ts +0 -64
- package/dist/packages/workflow-package/local-workflows.js +0 -441
- package/dist/packages/workflow-package/workflow-definitions.d.ts +0 -82
- package/dist/packages/workflow-package/workflow-definitions.js +0 -210
- package/dist/packages/workflow-package/workflow-review-paths.d.ts +0 -10
- /package/{builtin-workflows/interf → builtin-methods/interf-default}/compile/stages/summarize/SKILL.md +0 -0
- /package/dist/packages/compiler/{workflow-primitives.d.ts → method-primitives.d.ts} +0 -0
- /package/dist/packages/compiler/{workflow-primitives.js → method-primitives.js} +0 -0
- /package/dist/packages/{workflow-authoring/lib/workflow-edit-utils.js → method-authoring/lib/method-edit-utils.js} +0 -0
- /package/dist/packages/{workflow-package → method-package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.d.ts → method-package/method-stage-policy.d.ts} +0 -0
- /package/dist/packages/{workflow-package/workflow-stage-policy.js → method-package/method-stage-policy.js} +0 -0
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
|
-
import { existsSync, mkdirSync,
|
|
3
|
-
import { join, relative, resolve, sep } from "node:path";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { isAbsolute, join, relative, resolve, sep } from "node:path";
|
|
4
4
|
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
5
|
import { readInterfConfig, } from "./interf.js";
|
|
6
|
-
import {
|
|
6
|
+
import { seedCompiledMethodPackage } from "../method-package/interf-method-package.js";
|
|
7
7
|
import { readJsonFileWithSchema } from "../shared/parse.js";
|
|
8
|
-
import {
|
|
8
|
+
import { getCompiledMethod } from "../method-package/method-definitions.js";
|
|
9
|
+
import { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, } from "../methods/method-resolution.js";
|
|
9
10
|
import { SourceFolderConfigSchema, } from "./lib/schema.js";
|
|
10
11
|
import { slugify } from "../shared/naming.js";
|
|
11
|
-
import { assertPathWithinRoot } from "../shared/path-guards.js";
|
|
12
|
+
import { assertPathWithinRoot, isPathWithinRoot } from "../shared/path-guards.js";
|
|
12
13
|
import { defaultControlPathForCompiled, resolveSourceControlPathForCompiled, compiledInterfConfigPath, compiledInterfRoot, } from "../compiler/compiled-paths.js";
|
|
13
14
|
import { projectInterfRoot, PROJECT_INTERF_DIR } from "./project-paths.js";
|
|
14
15
|
export const SOURCE_FOLDER_CONFIG_FILE = "interf.json";
|
|
@@ -16,56 +17,13 @@ export const SOURCE_FOLDER_CONFIG_PATH = `${PROJECT_INTERF_DIR}/${SOURCE_FOLDER_
|
|
|
16
17
|
export function sourceFolderConfigPath(sourcePath) {
|
|
17
18
|
return join(projectInterfRoot(sourcePath), SOURCE_FOLDER_CONFIG_FILE);
|
|
18
19
|
}
|
|
19
|
-
export function legacySourceFolderConfigPath(sourcePath) {
|
|
20
|
-
return join(sourcePath, SOURCE_FOLDER_CONFIG_FILE);
|
|
21
|
-
}
|
|
22
20
|
export function resolveSourceFolderConfigPath(sourcePath) {
|
|
23
|
-
|
|
24
|
-
if (existsSync(primaryPath))
|
|
25
|
-
return primaryPath;
|
|
26
|
-
const legacyPath = legacySourceFolderConfigPath(sourcePath);
|
|
27
|
-
if (existsSync(legacyPath))
|
|
28
|
-
return legacyPath;
|
|
29
|
-
return primaryPath;
|
|
21
|
+
return sourceFolderConfigPath(sourcePath);
|
|
30
22
|
}
|
|
31
23
|
function readSourceFolderConfigFile(filePath) {
|
|
32
24
|
return readJsonFileWithSchema(filePath, "Interf project config", SourceFolderConfigSchema);
|
|
33
25
|
}
|
|
34
|
-
function
|
|
35
|
-
try {
|
|
36
|
-
return JSON.parse(readFileSync(filePath, "utf-8"));
|
|
37
|
-
}
|
|
38
|
-
catch {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
function isValidLegacySourceFolderConfig(sourcePath) {
|
|
43
|
-
const legacyPath = legacySourceFolderConfigPath(sourcePath);
|
|
44
|
-
if (!existsSync(legacyPath))
|
|
45
|
-
return false;
|
|
46
|
-
const raw = readJsonFileUncheckedQuiet(legacyPath);
|
|
47
|
-
return SourceFolderConfigSchema.safeParse(raw).success;
|
|
48
|
-
}
|
|
49
|
-
export function migrateLegacySourceFolderConfig(sourcePath) {
|
|
50
|
-
const primaryPath = sourceFolderConfigPath(sourcePath);
|
|
51
|
-
const legacyPath = legacySourceFolderConfigPath(sourcePath);
|
|
52
|
-
if (existsSync(primaryPath) || !existsSync(legacyPath))
|
|
53
|
-
return false;
|
|
54
|
-
if (!isValidLegacySourceFolderConfig(sourcePath))
|
|
55
|
-
return false;
|
|
56
|
-
mkdirSync(projectInterfRoot(sourcePath), { recursive: true });
|
|
57
|
-
renameSync(legacyPath, primaryPath);
|
|
58
|
-
return true;
|
|
59
|
-
}
|
|
60
|
-
function removeLegacySourceFolderConfig(sourcePath) {
|
|
61
|
-
const legacyPath = legacySourceFolderConfigPath(sourcePath);
|
|
62
|
-
if (!existsSync(legacyPath))
|
|
63
|
-
return;
|
|
64
|
-
if (!isValidLegacySourceFolderConfig(sourcePath))
|
|
65
|
-
return;
|
|
66
|
-
rmSync(legacyPath, { force: true });
|
|
67
|
-
}
|
|
68
|
-
function normalizeTruthChecks(cases) {
|
|
26
|
+
function normalizeReadinessChecks(cases) {
|
|
69
27
|
const seen = new Set();
|
|
70
28
|
return cases.map((caseSpec, index) => {
|
|
71
29
|
const baseId = slugify(caseSpec.id ?? caseSpec.question) || `check-${index + 1}`;
|
|
@@ -85,7 +43,7 @@ function normalizeTruthChecks(cases) {
|
|
|
85
43
|
};
|
|
86
44
|
});
|
|
87
45
|
}
|
|
88
|
-
export function
|
|
46
|
+
export function fingerprintReadinessChecks(checks) {
|
|
89
47
|
const normalized = checks.map((check) => ({
|
|
90
48
|
question: check.question.trim(),
|
|
91
49
|
...(check.answer ? { answer: check.answer.trim() } : {}),
|
|
@@ -103,11 +61,19 @@ export function loadSourceFolderConfig(sourcePath) {
|
|
|
103
61
|
return null;
|
|
104
62
|
return readSourceFolderConfigFile(filePath);
|
|
105
63
|
}
|
|
106
|
-
export
|
|
107
|
-
|
|
64
|
+
export { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig } from "../methods/method-resolution.js";
|
|
65
|
+
function normalizeSourcePreparationConfig(preparationConfig) {
|
|
66
|
+
const method = methodIdForSourcePreparationConfig(preparationConfig);
|
|
67
|
+
return {
|
|
68
|
+
...preparationConfig,
|
|
69
|
+
...(method ? { method } : {}),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export function listSourcePreparationConfigs(config) {
|
|
73
|
+
return (config?.preparations ?? []).map((preparation) => normalizeSourcePreparationConfig(preparation));
|
|
108
74
|
}
|
|
109
|
-
export function
|
|
110
|
-
const configured = override ??
|
|
75
|
+
export function resolvePreparationCompileMaxAttempts(preparationConfig, override = null) {
|
|
76
|
+
const configured = override ?? preparationConfig.max_attempts ?? null;
|
|
111
77
|
if (configured == null)
|
|
112
78
|
return null;
|
|
113
79
|
const normalized = Math.trunc(configured);
|
|
@@ -115,8 +81,8 @@ export function resolveDatasetCompileMaxAttempts(datasetConfig, override = null)
|
|
|
115
81
|
return 1;
|
|
116
82
|
return Math.min(5, normalized);
|
|
117
83
|
}
|
|
118
|
-
export function
|
|
119
|
-
const configured = override ??
|
|
84
|
+
export function resolvePreparationCompileMaxLoops(preparationConfig, override = null) {
|
|
85
|
+
const configured = override ?? preparationConfig.max_loops ?? null;
|
|
120
86
|
if (configured == null)
|
|
121
87
|
return null;
|
|
122
88
|
const normalized = Math.trunc(configured);
|
|
@@ -124,89 +90,106 @@ export function resolveDatasetCompileMaxLoops(datasetConfig, override = null) {
|
|
|
124
90
|
return 1;
|
|
125
91
|
return Math.min(3, normalized);
|
|
126
92
|
}
|
|
127
|
-
export function
|
|
128
|
-
const
|
|
129
|
-
return
|
|
93
|
+
export function getDefaultSourcePreparationConfig(config) {
|
|
94
|
+
const preparations = listSourcePreparationConfigs(config);
|
|
95
|
+
return preparations[0] ?? null;
|
|
96
|
+
}
|
|
97
|
+
export function findSourcePreparationConfig(config, preparationName) {
|
|
98
|
+
return listSourcePreparationConfigs(config).find((preparation) => preparation.name === preparationName) ?? null;
|
|
130
99
|
}
|
|
131
|
-
export function
|
|
132
|
-
return
|
|
100
|
+
export function configuredSourceFolderPath(config) {
|
|
101
|
+
return config?.source_folder?.path ?? null;
|
|
102
|
+
}
|
|
103
|
+
export function resolveConfiguredSourceFolderPath(sourcePath, config = loadSourceFolderConfig(sourcePath)) {
|
|
104
|
+
const configuredPath = configuredSourceFolderPath(config);
|
|
105
|
+
return configuredPath ? resolve(sourcePath, configuredPath) : null;
|
|
133
106
|
}
|
|
134
107
|
function toWritableSourceProjectConfig(config) {
|
|
135
|
-
const
|
|
136
|
-
|
|
108
|
+
const preparations = config?.preparations ?? [];
|
|
109
|
+
const sourceFolder = config?.source_folder;
|
|
110
|
+
if (preparations.length > 0) {
|
|
137
111
|
return {
|
|
138
|
-
|
|
112
|
+
...(sourceFolder ? { source_folder: sourceFolder } : {}),
|
|
113
|
+
preparations: preparations.map((preparation) => toWritableSourcePreparationConfig(preparation)),
|
|
139
114
|
};
|
|
140
115
|
}
|
|
141
|
-
return {
|
|
116
|
+
return {
|
|
117
|
+
...(sourceFolder ? { source_folder: sourceFolder } : {}),
|
|
118
|
+
preparations: [],
|
|
119
|
+
};
|
|
142
120
|
}
|
|
143
|
-
function
|
|
121
|
+
function toWritableSourcePreparationConfig(preparation) {
|
|
122
|
+
const method = methodIdForSourcePreparationConfig(preparation);
|
|
144
123
|
return {
|
|
145
|
-
name:
|
|
146
|
-
path:
|
|
147
|
-
...(
|
|
148
|
-
|
|
149
|
-
...(typeof
|
|
150
|
-
...(typeof
|
|
151
|
-
checks:
|
|
124
|
+
name: preparation.name,
|
|
125
|
+
path: preparation.path,
|
|
126
|
+
...(preparation.about ? { about: preparation.about } : {}),
|
|
127
|
+
method: method ?? DEFAULT_METHOD_ID,
|
|
128
|
+
...(typeof preparation.max_attempts === "number" ? { max_attempts: preparation.max_attempts } : {}),
|
|
129
|
+
...(typeof preparation.max_loops === "number" ? { max_loops: preparation.max_loops } : {}),
|
|
130
|
+
checks: preparation.checks,
|
|
152
131
|
};
|
|
153
132
|
}
|
|
154
133
|
export function saveSourceFolderConfig(sourcePath, config) {
|
|
134
|
+
const existing = loadSourceFolderConfig(sourcePath);
|
|
135
|
+
const mergedConfig = {
|
|
136
|
+
...(existing?.source_folder && !config.source_folder ? { source_folder: existing.source_folder } : {}),
|
|
137
|
+
...config,
|
|
138
|
+
};
|
|
155
139
|
mkdirSync(projectInterfRoot(sourcePath), { recursive: true });
|
|
156
|
-
writeFileSync(sourceFolderConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(
|
|
157
|
-
removeLegacySourceFolderConfig(sourcePath);
|
|
140
|
+
writeFileSync(sourceFolderConfigPath(sourcePath), JSON.stringify(toWritableSourceProjectConfig(mergedConfig), null, 2) + "\n");
|
|
158
141
|
}
|
|
159
|
-
export function
|
|
142
|
+
export function appendSourcePreparationChecks(sourcePath, preparationName, checks) {
|
|
160
143
|
const existing = loadSourceFolderConfig(sourcePath);
|
|
161
|
-
const
|
|
162
|
-
const
|
|
163
|
-
const currentChecks =
|
|
164
|
-
const
|
|
165
|
-
...
|
|
166
|
-
name:
|
|
167
|
-
path: `./${
|
|
144
|
+
const currentPreparation = findSourcePreparationConfig(existing, preparationName);
|
|
145
|
+
const otherPreparations = listSourcePreparationConfigs(existing).filter((preparation) => preparation.name !== preparationName);
|
|
146
|
+
const currentChecks = currentPreparation?.checks ?? [];
|
|
147
|
+
const nextPreparation = {
|
|
148
|
+
...toWritableSourcePreparationConfig(currentPreparation ?? {
|
|
149
|
+
name: preparationName,
|
|
150
|
+
path: `./${preparationName}`,
|
|
168
151
|
checks: [],
|
|
169
152
|
}),
|
|
170
153
|
checks: [...currentChecks, ...checks],
|
|
171
154
|
};
|
|
172
155
|
saveSourceFolderConfig(sourcePath, {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
...
|
|
156
|
+
preparations: [
|
|
157
|
+
nextPreparation,
|
|
158
|
+
...otherPreparations,
|
|
176
159
|
],
|
|
177
160
|
});
|
|
178
161
|
}
|
|
179
|
-
export function
|
|
162
|
+
export function upsertSourcePreparationConfig(sourcePath, preparationConfig, options = {}) {
|
|
180
163
|
const existing = loadSourceFolderConfig(sourcePath);
|
|
181
|
-
const
|
|
182
|
-
const candidateNames = Array.from(new Set([
|
|
183
|
-
const existingIndex =
|
|
164
|
+
const preparations = listSourcePreparationConfigs(existing);
|
|
165
|
+
const candidateNames = Array.from(new Set([preparationConfig.name, options.matchName].filter((value) => Boolean(value))));
|
|
166
|
+
const existingIndex = preparations.findIndex((entry) => candidateNames.includes(entry.name));
|
|
184
167
|
if (existingIndex >= 0) {
|
|
185
|
-
|
|
168
|
+
preparations[existingIndex] = normalizeSourcePreparationConfig(preparationConfig);
|
|
186
169
|
}
|
|
187
170
|
else {
|
|
188
|
-
|
|
171
|
+
preparations.push(normalizeSourcePreparationConfig(preparationConfig));
|
|
189
172
|
}
|
|
190
173
|
saveSourceFolderConfig(sourcePath, {
|
|
191
|
-
|
|
174
|
+
preparations,
|
|
192
175
|
});
|
|
193
176
|
}
|
|
194
177
|
export function compiledMaxAttempts(maxAttempts) {
|
|
195
178
|
if (maxAttempts == null)
|
|
196
179
|
return undefined;
|
|
197
|
-
return
|
|
180
|
+
return resolvePreparationCompileMaxAttempts({ max_attempts: maxAttempts }, null) ?? 1;
|
|
198
181
|
}
|
|
199
182
|
export function compiledMaxLoops(maxLoops) {
|
|
200
183
|
if (maxLoops == null)
|
|
201
184
|
return undefined;
|
|
202
|
-
return
|
|
185
|
+
return resolvePreparationCompileMaxLoops({ max_loops: maxLoops }, null) ?? 1;
|
|
203
186
|
}
|
|
204
|
-
export function
|
|
187
|
+
export function sourcePreparationConfigFromInterfConfig(config, preparationPath = `./${config.name}`) {
|
|
205
188
|
return {
|
|
206
189
|
name: config.name,
|
|
207
|
-
path:
|
|
190
|
+
path: preparationPath,
|
|
208
191
|
...(config.about ? { about: config.about } : {}),
|
|
209
|
-
|
|
192
|
+
method: config.method,
|
|
210
193
|
...(typeof config.max_attempts === "number"
|
|
211
194
|
? { max_attempts: config.max_attempts }
|
|
212
195
|
: {}),
|
|
@@ -216,39 +199,50 @@ export function sourceDatasetConfigFromInterfConfig(config, datasetPath = `./${c
|
|
|
216
199
|
checks: config.checks ?? [],
|
|
217
200
|
};
|
|
218
201
|
}
|
|
219
|
-
export function
|
|
202
|
+
export function loadCompiledPreparationConfig(compiledPath) {
|
|
220
203
|
const config = readInterfConfig(compiledPath);
|
|
221
204
|
if (!config)
|
|
222
205
|
return null;
|
|
223
206
|
const projectPath = resolveSourceControlPathForCompiled(compiledPath);
|
|
224
|
-
const
|
|
225
|
-
const
|
|
226
|
-
?
|
|
207
|
+
const configuredPreparations = listSourcePreparationConfigs(loadSourceFolderConfig(projectPath));
|
|
208
|
+
const defaultPreparationPath = configuredPreparations.length === 1
|
|
209
|
+
? configuredPreparations[0].path
|
|
227
210
|
: `./${config.name}`;
|
|
228
|
-
const
|
|
229
|
-
?
|
|
230
|
-
:
|
|
231
|
-
|
|
211
|
+
const sourceBinding = typeof config.source?.preparation_path === "string" && config.source.preparation_path.length > 0
|
|
212
|
+
? config.source.preparation_path
|
|
213
|
+
: null;
|
|
214
|
+
const preparationPath = sourceBinding
|
|
215
|
+
? (() => {
|
|
216
|
+
const sourceAbsolutePath = resolve(compiledPath, sourceBinding);
|
|
217
|
+
if (!isPathWithinRoot(projectPath, sourceAbsolutePath)) {
|
|
218
|
+
return sourceAbsolutePath;
|
|
219
|
+
}
|
|
220
|
+
return relative(projectPath, sourceAbsolutePath).split(sep).join("/") || defaultPreparationPath;
|
|
221
|
+
})()
|
|
222
|
+
: defaultPreparationPath;
|
|
223
|
+
return sourcePreparationConfigFromInterfConfig(config, preparationPath);
|
|
232
224
|
}
|
|
233
225
|
export function saveCompiledInterfConfig(compiledPath, config) {
|
|
234
226
|
mkdirSync(compiledInterfRoot(compiledPath), { recursive: true });
|
|
235
227
|
writeFileSync(compiledInterfConfigPath(compiledPath), JSON.stringify(config, null, 2) + "\n");
|
|
236
228
|
return config;
|
|
237
229
|
}
|
|
238
|
-
export function
|
|
230
|
+
export function syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath, preparationConfig) {
|
|
239
231
|
const current = readInterfConfig(compiledPath);
|
|
240
232
|
const projectPath = resolveSourceControlPathForCompiled(compiledPath);
|
|
241
|
-
const
|
|
242
|
-
const
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
233
|
+
const preparationAbsolutePath = resolveSourcePreparationPath(projectPath, preparationConfig);
|
|
234
|
+
const preparationRelativePath = relative(compiledPath, preparationAbsolutePath).split(sep).join("/") || ".";
|
|
235
|
+
const methodId = methodIdForSourcePreparationConfig(preparationConfig)
|
|
236
|
+
?? methodIdForSourcePreparationConfig(current)
|
|
237
|
+
?? DEFAULT_METHOD_ID;
|
|
238
|
+
const methodChanged = current?.method !== undefined && current.method !== methodId;
|
|
239
|
+
const methodOrigin = methodChanged || !current?.method_origin
|
|
246
240
|
? {
|
|
247
|
-
selected:
|
|
241
|
+
selected: methodId,
|
|
248
242
|
local_draft: false,
|
|
249
243
|
}
|
|
250
|
-
: current.
|
|
251
|
-
const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout,
|
|
244
|
+
: current.method_origin;
|
|
245
|
+
const { type: _ignoredType, name: _ignoredName, about: _ignoredAbout, method: _ignoredMethod, max_attempts: _ignoredMaxAttempts, max_loops: _ignoredMaxLoops, checks: _ignoredChecks, method_origin: _ignoredMethodOrigin, source: _ignoredSource, ...passthrough } = current ?? {};
|
|
252
246
|
const nextConfig = {
|
|
253
247
|
...passthrough,
|
|
254
248
|
...(!current ? {
|
|
@@ -258,31 +252,31 @@ export function syncCompiledInterfConfigFromSourceDatasetConfig(compiledPath, da
|
|
|
258
252
|
},
|
|
259
253
|
} : {}),
|
|
260
254
|
type: "compiled",
|
|
261
|
-
name:
|
|
262
|
-
...(
|
|
263
|
-
|
|
264
|
-
...(typeof
|
|
265
|
-
? { max_attempts:
|
|
255
|
+
name: preparationConfig.name,
|
|
256
|
+
...(preparationConfig.about ? { about: preparationConfig.about } : {}),
|
|
257
|
+
method: methodId,
|
|
258
|
+
...(typeof preparationConfig.max_attempts === "number"
|
|
259
|
+
? { max_attempts: preparationConfig.max_attempts }
|
|
266
260
|
: {}),
|
|
267
|
-
...(typeof
|
|
268
|
-
? { max_loops:
|
|
261
|
+
...(typeof preparationConfig.max_loops === "number"
|
|
262
|
+
? { max_loops: preparationConfig.max_loops }
|
|
269
263
|
: {}),
|
|
270
|
-
checks:
|
|
271
|
-
|
|
264
|
+
checks: preparationConfig.checks,
|
|
265
|
+
method_origin: methodOrigin,
|
|
272
266
|
source: {
|
|
273
267
|
path: current?.source?.path ?? "./raw",
|
|
274
268
|
control_path: defaultControlPathForCompiled(compiledPath),
|
|
275
|
-
|
|
269
|
+
preparation_path: preparationRelativePath,
|
|
276
270
|
},
|
|
277
271
|
};
|
|
278
272
|
const saved = saveCompiledInterfConfig(compiledPath, nextConfig);
|
|
279
|
-
if (
|
|
273
|
+
if (methodChanged) {
|
|
280
274
|
const sourcePath = projectPath;
|
|
281
|
-
const
|
|
282
|
-
|
|
275
|
+
const selectedMethod = getCompiledMethod(methodId, { sourcePath });
|
|
276
|
+
seedCompiledMethodPackage({
|
|
283
277
|
compiledPath,
|
|
284
278
|
sourcePath,
|
|
285
|
-
|
|
279
|
+
methodId: selectedMethod.id,
|
|
286
280
|
});
|
|
287
281
|
}
|
|
288
282
|
refreshCompiledBootstrapGuidance(compiledPath);
|
|
@@ -297,8 +291,8 @@ function buildLoadedTestSpec(options) {
|
|
|
297
291
|
filePath: options.filePath,
|
|
298
292
|
type: options.targetType,
|
|
299
293
|
name: options.name,
|
|
300
|
-
description: options.about ?? options.
|
|
301
|
-
cases:
|
|
294
|
+
description: options.about ?? options.defaultDescription,
|
|
295
|
+
cases: normalizeReadinessChecks(options.checks),
|
|
302
296
|
};
|
|
303
297
|
}
|
|
304
298
|
export function buildTestSpecFromSourceFolderConfig(options) {
|
|
@@ -306,14 +300,14 @@ export function buildTestSpecFromSourceFolderConfig(options) {
|
|
|
306
300
|
const config = loadSourceFolderConfig(sourcePath);
|
|
307
301
|
if (!config)
|
|
308
302
|
return null;
|
|
309
|
-
const
|
|
310
|
-
if (
|
|
303
|
+
const preparations = listSourcePreparationConfigs(config);
|
|
304
|
+
if (preparations.length === 0)
|
|
311
305
|
return null;
|
|
312
306
|
const match = targetName
|
|
313
|
-
?
|
|
314
|
-
:
|
|
315
|
-
?
|
|
316
|
-
:
|
|
307
|
+
? preparations.find((entry) => entry.name === targetName)
|
|
308
|
+
: preparations.length === 1
|
|
309
|
+
? preparations[0]
|
|
310
|
+
: getDefaultSourcePreparationConfig(config);
|
|
317
311
|
if (!match)
|
|
318
312
|
return null;
|
|
319
313
|
const configPath = resolveSourceFolderConfigPath(sourcePath);
|
|
@@ -324,12 +318,12 @@ export function buildTestSpecFromSourceFolderConfig(options) {
|
|
|
324
318
|
checks: match.checks,
|
|
325
319
|
targetType,
|
|
326
320
|
filePath: targetType === "raw"
|
|
327
|
-
? `${configPath}#
|
|
328
|
-
: `${configPath}#
|
|
329
|
-
|
|
321
|
+
? `${configPath}#preparations/${match.name}:source-files`
|
|
322
|
+
: `${configPath}#preparations/${match.name}:portable-context`,
|
|
323
|
+
defaultDescription: `Derived from saved Preparation checks in ${SOURCE_FOLDER_CONFIG_PATH}`,
|
|
330
324
|
});
|
|
331
325
|
}
|
|
332
|
-
export function
|
|
326
|
+
export function buildTestSpecFromCompiledPreparationConfig(options) {
|
|
333
327
|
const { compiledPath, targetType = "compiled" } = options;
|
|
334
328
|
const config = readInterfConfig(compiledPath);
|
|
335
329
|
const configPath = compiledInterfConfigPath(compiledPath);
|
|
@@ -343,9 +337,14 @@ export function buildTestSpecFromCompiledDatasetConfig(options) {
|
|
|
343
337
|
filePath: targetType === "raw"
|
|
344
338
|
? `${configPath}#checks:file-as-is`
|
|
345
339
|
: `${configPath}#checks:compiled`,
|
|
346
|
-
|
|
340
|
+
defaultDescription: "Derived from checks in the portable context config.",
|
|
347
341
|
});
|
|
348
342
|
}
|
|
349
|
-
export function
|
|
350
|
-
|
|
343
|
+
export function resolveSourcePreparationPath(projectPath, preparationConfig) {
|
|
344
|
+
const configuredPath = preparationConfig.path.trim();
|
|
345
|
+
const resolvedPath = resolve(projectPath, configuredPath);
|
|
346
|
+
if (isAbsolute(configuredPath)) {
|
|
347
|
+
return resolvedPath;
|
|
348
|
+
}
|
|
349
|
+
return assertPathWithinRoot(projectPath, resolvedPath, "Source folder path");
|
|
351
350
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function listVisibleSourceFolders(projectPath: string): string[];
|
|
2
|
+
export declare function isReservedSourcePreparationPath(relativePath: string): boolean;
|
|
3
|
+
export declare function normalizeSourcePreparationPathForConfig(projectPath: string, value: string): string;
|
|
4
|
+
export declare function defaultPreparationNameForPath(sourceFolderPath: string): string;
|
|
5
|
+
export declare function findSingleSourceFolderCandidate(projectPath: string): string | null;
|
|
6
|
+
export declare function listSourceFolderChoices(projectPath?: string): Array<{
|
|
7
|
+
value: string;
|
|
8
|
+
label: string;
|
|
9
|
+
hint: string;
|
|
10
|
+
}>;
|
|
11
|
+
export declare function defaultSourcePreparationPathForPrompt(name: string, introStyle: "first" | "additional" | "edit", projectPath?: string): string;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
2
|
+
import { isAbsolute, join, relative, sep } from "node:path";
|
|
3
|
+
import { slugify } from "../shared/naming.js";
|
|
4
|
+
import { resolveSourcePreparationPath } from "./source-config.js";
|
|
5
|
+
import { isPathWithinRoot } from "../shared/path-guards.js";
|
|
6
|
+
const DEFAULT_PREPARATION_NAME = "default";
|
|
7
|
+
const IGNORED_SOURCE_FOLDER_ENTRIES = new Set([
|
|
8
|
+
".DS_Store",
|
|
9
|
+
".git",
|
|
10
|
+
".interf",
|
|
11
|
+
"interf",
|
|
12
|
+
"interf.json",
|
|
13
|
+
"node_modules",
|
|
14
|
+
]);
|
|
15
|
+
export function listVisibleSourceFolders(projectPath) {
|
|
16
|
+
let rootEntries = [];
|
|
17
|
+
try {
|
|
18
|
+
rootEntries = readdirSync(projectPath);
|
|
19
|
+
}
|
|
20
|
+
catch {
|
|
21
|
+
return [];
|
|
22
|
+
}
|
|
23
|
+
const visibleEntries = rootEntries.filter((entry) => (!IGNORED_SOURCE_FOLDER_ENTRIES.has(entry) && !entry.startsWith(".")));
|
|
24
|
+
const visibleDirectories = [];
|
|
25
|
+
for (const entry of visibleEntries) {
|
|
26
|
+
try {
|
|
27
|
+
const entryPath = join(projectPath, entry);
|
|
28
|
+
if (statSync(entryPath).isDirectory()) {
|
|
29
|
+
visibleDirectories.push(entry);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
// Ignore unreadable entries.
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return visibleDirectories.sort((left, right) => left.localeCompare(right));
|
|
37
|
+
}
|
|
38
|
+
export function isReservedSourcePreparationPath(relativePath) {
|
|
39
|
+
const normalized = relativePath.replace(/\\/g, "/").replace(/^\.\/+/, "");
|
|
40
|
+
return normalized === "interf" ||
|
|
41
|
+
normalized.startsWith("interf/") ||
|
|
42
|
+
normalized === ".interf" ||
|
|
43
|
+
normalized.startsWith(".interf/");
|
|
44
|
+
}
|
|
45
|
+
export function normalizeSourcePreparationPathForConfig(projectPath, value) {
|
|
46
|
+
const trimmedValue = value.trim();
|
|
47
|
+
const resolvedPath = resolveSourcePreparationPath(projectPath, { path: trimmedValue });
|
|
48
|
+
const relativePath = relative(projectPath, resolvedPath).split(sep).join("/") || ".";
|
|
49
|
+
if (relativePath === ".") {
|
|
50
|
+
throw new Error("Pick a Source Folder, not the Interf Workspace itself.");
|
|
51
|
+
}
|
|
52
|
+
if (isAbsolute(trimmedValue) && !isPathWithinRoot(projectPath, resolvedPath)) {
|
|
53
|
+
if (!existsSync(resolvedPath)) {
|
|
54
|
+
throw new Error("Pick an existing source folder.");
|
|
55
|
+
}
|
|
56
|
+
if (!statSync(resolvedPath).isDirectory()) {
|
|
57
|
+
throw new Error("Source folder must be a directory.");
|
|
58
|
+
}
|
|
59
|
+
return resolvedPath;
|
|
60
|
+
}
|
|
61
|
+
if (isReservedSourcePreparationPath(relativePath)) {
|
|
62
|
+
throw new Error("Pick an existing source folder, not `interf/` or `.interf/`.");
|
|
63
|
+
}
|
|
64
|
+
if (!existsSync(resolvedPath)) {
|
|
65
|
+
throw new Error("Pick an existing source folder.");
|
|
66
|
+
}
|
|
67
|
+
if (!statSync(resolvedPath).isDirectory()) {
|
|
68
|
+
throw new Error("Source folder must be a directory.");
|
|
69
|
+
}
|
|
70
|
+
return relativePath.startsWith("./") ? relativePath : `./${relativePath}`;
|
|
71
|
+
}
|
|
72
|
+
export function defaultPreparationNameForPath(sourceFolderPath) {
|
|
73
|
+
const segments = sourceFolderPath
|
|
74
|
+
.replace(/\\/g, "/")
|
|
75
|
+
.replace(/\/+$/g, "")
|
|
76
|
+
.split("/")
|
|
77
|
+
.filter((segment) => segment.length > 0 && segment !== ".");
|
|
78
|
+
return slugify(segments[segments.length - 1] ?? "") || DEFAULT_PREPARATION_NAME;
|
|
79
|
+
}
|
|
80
|
+
export function findSingleSourceFolderCandidate(projectPath) {
|
|
81
|
+
const visibleDirectories = listVisibleSourceFolders(projectPath);
|
|
82
|
+
if (visibleDirectories.length !== 1) {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
return `./${visibleDirectories[0]}`;
|
|
86
|
+
}
|
|
87
|
+
export function listSourceFolderChoices(projectPath = process.cwd()) {
|
|
88
|
+
return listVisibleSourceFolders(projectPath).map((entry) => ({
|
|
89
|
+
value: `./${entry}`,
|
|
90
|
+
label: entry,
|
|
91
|
+
hint: `Use ./${entry} as the source folder`,
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
export function defaultSourcePreparationPathForPrompt(name, introStyle, projectPath = process.cwd()) {
|
|
95
|
+
const namedFolderPath = join(projectPath, name);
|
|
96
|
+
if (existsSync(namedFolderPath)) {
|
|
97
|
+
try {
|
|
98
|
+
if (statSync(namedFolderPath).isDirectory()) {
|
|
99
|
+
return `./${name}`;
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
// Fall through to the normal default.
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
if (introStyle === "first") {
|
|
107
|
+
return findSingleSourceFolderCandidate(projectPath) ?? `./${name}`;
|
|
108
|
+
}
|
|
109
|
+
return `./${name}`;
|
|
110
|
+
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export * as schema from "./lib/schema.js";
|
|
2
2
|
export * as test from "./test.js";
|
|
3
3
|
export * as execution from "./test-execution.js";
|
|
4
|
-
export * as matrices from "./test-matrices.js";
|
|
5
4
|
export * as paths from "./test-paths.js";
|
|
6
5
|
export * as profilePresets from "./test-profile-presets.js";
|
|
6
|
+
export * as readinessCheckRun from "./readiness-check-run.js";
|
|
7
7
|
export * as sandbox from "./test-sandbox.js";
|
|
8
8
|
export * as specs from "./test-specs.js";
|
|
9
9
|
export * as targets from "./test-targets.js";
|
|
10
10
|
export * as types from "./test-types.js";
|
|
11
|
-
export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun,
|
|
11
|
+
export type { TestCase, TestCaseExpect, TestCheckResult, TestCaseResult, TestSpec, TestTargetResult, TestTargetRun, ReadinessCheckRun, TestTargetType, } from "./lib/schema.js";
|
|
12
12
|
export type { LoadedTestSpec, TestTargetCandidate, } from "./test-types.js";
|
|
13
13
|
export type { TestSandboxRetentionMode, } from "./test-sandbox.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * as schema from "./lib/schema.js";
|
|
2
2
|
export * as test from "./test.js";
|
|
3
3
|
export * as execution from "./test-execution.js";
|
|
4
|
-
export * as matrices from "./test-matrices.js";
|
|
5
4
|
export * as paths from "./test-paths.js";
|
|
6
5
|
export * as profilePresets from "./test-profile-presets.js";
|
|
6
|
+
export * as readinessCheckRun from "./readiness-check-run.js";
|
|
7
7
|
export * as sandbox from "./test-sandbox.js";
|
|
8
8
|
export * as specs from "./test-specs.js";
|
|
9
9
|
export * as targets from "./test-targets.js";
|