@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,389 +0,0 @@
|
|
|
1
|
-
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { dirname, join } from "node:path";
|
|
3
|
-
import { renderCompiledQuerySkill } from "../agents/lib/shells.js";
|
|
4
|
-
import { copyWorkflowPackageDirectory, isPortableWorkflowPackage, patchWorkflowPackageMetadata, resolveWorkflowPackageSourcePath, workflowDefinitionPath, } from "./local-workflows.js";
|
|
5
|
-
import { getCompiledWorkflow, } from "./workflow-definitions.js";
|
|
6
|
-
import { CONTEXT_INTERFACE_FILE, deriveWorkflowInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
|
|
7
|
-
import { workflowPackagePathForCompiled } from "../compiler/compiled-paths.js";
|
|
8
|
-
import { mergeStagePolicyNotesForStages } from "./workflow-stage-policy.js";
|
|
9
|
-
function workflowPackagePath(dirPath) {
|
|
10
|
-
return workflowPackagePathForCompiled(dirPath);
|
|
11
|
-
}
|
|
12
|
-
function writeWorkflowStarterDocs(dirPath, docs, options) {
|
|
13
|
-
for (const doc of docs ?? []) {
|
|
14
|
-
const targetPath = join(dirPath, doc.relativePath);
|
|
15
|
-
if (!options.overwrite && existsSync(targetPath))
|
|
16
|
-
continue;
|
|
17
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
18
|
-
writeFileSync(targetPath, doc.content);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
function writeWorkflowPackageJson(rootPath, workflow, options) {
|
|
22
|
-
const targetPath = join(rootPath, "workflow.json");
|
|
23
|
-
if (!options.overwrite && existsSync(targetPath))
|
|
24
|
-
return;
|
|
25
|
-
const inputs = workflow.inputs?.length
|
|
26
|
-
? workflow.inputs
|
|
27
|
-
: deriveWorkflowInputsFromContextInterface(workflow.contextInterface ?? workflow.schema);
|
|
28
|
-
writeFileSync(targetPath, `${JSON.stringify({
|
|
29
|
-
id: workflow.id,
|
|
30
|
-
type: "compiled",
|
|
31
|
-
compiler_api: workflow.compilerApi ?? {
|
|
32
|
-
kind: "compiled",
|
|
33
|
-
version: 1,
|
|
34
|
-
},
|
|
35
|
-
...(workflow.purpose
|
|
36
|
-
? {
|
|
37
|
-
purpose: {
|
|
38
|
-
label: workflow.purpose.label,
|
|
39
|
-
task_hint: workflow.purpose.taskHint,
|
|
40
|
-
},
|
|
41
|
-
}
|
|
42
|
-
: {}),
|
|
43
|
-
...(inputs.length > 0 ? { inputs } : {}),
|
|
44
|
-
label: workflow.label,
|
|
45
|
-
hint: workflow.hint,
|
|
46
|
-
stages: workflow.stages.map((stage) => ({
|
|
47
|
-
id: stage.id,
|
|
48
|
-
label: stage.label,
|
|
49
|
-
description: stage.description,
|
|
50
|
-
contract_type: stage.contractType,
|
|
51
|
-
skill_dir: stage.skillDir,
|
|
52
|
-
reads: stage.reads,
|
|
53
|
-
writes: stage.writes,
|
|
54
|
-
...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
|
|
55
|
-
})),
|
|
56
|
-
...(workflow.stagePolicyNotes ? { stage_policy_notes: workflow.stagePolicyNotes } : {}),
|
|
57
|
-
}, null, 2)}\n`);
|
|
58
|
-
}
|
|
59
|
-
function renderWorkflowReadme(workflow) {
|
|
60
|
-
const contextInterface = workflow.contextInterface ?? workflow.schema ?? null;
|
|
61
|
-
const stageLines = workflow.stages
|
|
62
|
-
.map((stage) => `- \`${stage.id}\` — ${stage.description} (${stage.contractType}; reads: ${stage.reads.join(", ")}; writes: ${stage.writes.join(", ")})`)
|
|
63
|
-
.join("\n");
|
|
64
|
-
const interfaceSummary = contextInterface
|
|
65
|
-
? summarizeContextInterface(contextInterface)
|
|
66
|
-
: null;
|
|
67
|
-
const contextInterfaceLines = contextInterface?.zones
|
|
68
|
-
? contextInterface.zones
|
|
69
|
-
.map((zone) => `- \`${zone.id}\` — ${zone.role} ${zone.kind} at \`${zone.path}\`: ${zone.description}`)
|
|
70
|
-
.join("\n")
|
|
71
|
-
: null;
|
|
72
|
-
const inputs = workflow.inputs?.length
|
|
73
|
-
? workflow.inputs
|
|
74
|
-
: deriveWorkflowInputsFromContextInterface(contextInterface);
|
|
75
|
-
const inputLines = inputs.length > 0
|
|
76
|
-
? inputs
|
|
77
|
-
.map((input) => `- \`${input.id}\` — ${input.label}: ${input.description}${input.required ? " (required)" : ""}${input.examples?.length ? ` Example inputs: ${input.examples.join("; ")}` : ""}`)
|
|
78
|
-
.join("\n")
|
|
79
|
-
: null;
|
|
80
|
-
const contextInterfaceSummaryLines = interfaceSummary
|
|
81
|
-
? [
|
|
82
|
-
`- Input zones: ${interfaceSummary.inputZones.length > 0 ? interfaceSummary.inputZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
|
|
83
|
-
`- Working zones: ${interfaceSummary.workingZones.length > 0 ? interfaceSummary.workingZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
|
|
84
|
-
`- Output zones: ${interfaceSummary.outputZones.length > 0 ? interfaceSummary.outputZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
|
|
85
|
-
`- Runtime zones: ${interfaceSummary.runtimeZones.length > 0 ? interfaceSummary.runtimeZones.map((zone) => `\`${zone.id}\``).join(", ") : "none"}`,
|
|
86
|
-
].join("\n")
|
|
87
|
-
: null;
|
|
88
|
-
return [
|
|
89
|
-
`# ${workflow.label}`,
|
|
90
|
-
"",
|
|
91
|
-
workflow.hint,
|
|
92
|
-
...(workflow.purpose
|
|
93
|
-
? [
|
|
94
|
-
"",
|
|
95
|
-
"## Purpose",
|
|
96
|
-
"",
|
|
97
|
-
`- ${workflow.purpose.label}`,
|
|
98
|
-
`- ${workflow.purpose.taskHint}`,
|
|
99
|
-
]
|
|
100
|
-
: []),
|
|
101
|
-
...(inputLines
|
|
102
|
-
? [
|
|
103
|
-
"",
|
|
104
|
-
"## Inputs",
|
|
105
|
-
"",
|
|
106
|
-
inputLines,
|
|
107
|
-
]
|
|
108
|
-
: []),
|
|
109
|
-
...(contextInterfaceLines
|
|
110
|
-
? [
|
|
111
|
-
"",
|
|
112
|
-
"## Context Interface",
|
|
113
|
-
"",
|
|
114
|
-
...(contextInterfaceSummaryLines
|
|
115
|
-
? [
|
|
116
|
-
contextInterfaceSummaryLines,
|
|
117
|
-
"",
|
|
118
|
-
]
|
|
119
|
-
: []),
|
|
120
|
-
"Zone map:",
|
|
121
|
-
"",
|
|
122
|
-
contextInterfaceLines,
|
|
123
|
-
]
|
|
124
|
-
: []),
|
|
125
|
-
"",
|
|
126
|
-
"## Package",
|
|
127
|
-
"",
|
|
128
|
-
"- `workflow.json` = stage graph, compiler API target, and compile contract mapping",
|
|
129
|
-
"- `workflow.schema.json` = deterministic context interface for the workflow package",
|
|
130
|
-
"- `improve/`, `compile/stages/`, and `use/query/` = human-readable authoring docs",
|
|
131
|
-
"- Portable workflow packages are standalone: explicit stages, schema, and docs live together in this folder",
|
|
132
|
-
"- Interf projects native agent shells from these docs for query use, stage execution, and workflow-improvement loops",
|
|
133
|
-
"",
|
|
134
|
-
"## Stages",
|
|
135
|
-
"",
|
|
136
|
-
stageLines,
|
|
137
|
-
"",
|
|
138
|
-
"Interf runs the local copy of this package directly from `.interf/workflow/` inside each compiled context.",
|
|
139
|
-
"",
|
|
140
|
-
].join("\n");
|
|
141
|
-
}
|
|
142
|
-
function renderDerivedWorkflowReadme(options) {
|
|
143
|
-
return [
|
|
144
|
-
`# ${options.label}`,
|
|
145
|
-
"",
|
|
146
|
-
options.hint,
|
|
147
|
-
"",
|
|
148
|
-
`This workflow package was copied from \`${options.baseWorkflowId}\` and materialized as a standalone package for this kind of work.`,
|
|
149
|
-
"",
|
|
150
|
-
"Interf runs the local copy of this package directly. Keep purpose, inputs, context interface, and stage docs self-contained in this folder instead of relying on runtime inheritance or fallback.",
|
|
151
|
-
"",
|
|
152
|
-
"## Emphasis",
|
|
153
|
-
"",
|
|
154
|
-
...(options.emphasis.length > 0
|
|
155
|
-
? options.emphasis.map((entry) => `- ${entry.stageId} (${entry.label}): ${entry.notes.join("; ")}`)
|
|
156
|
-
: ["- No stage-specific emphasis was added yet."]),
|
|
157
|
-
"",
|
|
158
|
-
].join("\n");
|
|
159
|
-
}
|
|
160
|
-
function renderSeedWorkflowReadme(options) {
|
|
161
|
-
return [
|
|
162
|
-
`# ${options.label}`,
|
|
163
|
-
"",
|
|
164
|
-
options.hint,
|
|
165
|
-
"",
|
|
166
|
-
`This workflow package was seeded from \`${options.baseWorkflowId}\` as a standalone local draft.`,
|
|
167
|
-
"",
|
|
168
|
-
"Interf runs the local copy of this package directly. Refine purpose, inputs, context interface, and stage instructions in this folder instead of relying on inheritance or runtime fallback.",
|
|
169
|
-
"",
|
|
170
|
-
].join("\n");
|
|
171
|
-
}
|
|
172
|
-
function renderImproveSkill(workflow) {
|
|
173
|
-
return [
|
|
174
|
-
"# Workflow Improvement",
|
|
175
|
-
"",
|
|
176
|
-
`Workflow: ${workflow.id}`,
|
|
177
|
-
"",
|
|
178
|
-
"This file is the editable authoring source for Interf's generated native workflow-improver shell.",
|
|
179
|
-
"The improver edits this local package directly.",
|
|
180
|
-
"",
|
|
181
|
-
"Default loop:",
|
|
182
|
-
"1. Read the loop context first.",
|
|
183
|
-
"2. Review preserved stage shells, runtime logs, and saved test runs from failed attempts.",
|
|
184
|
-
"3. Edit only the local workflow package for this compiled context to create a better workflow variation for this kind of work.",
|
|
185
|
-
`4. Keep purpose, inputs, \`workflow.json\`, \`${CONTEXT_INTERFACE_FILE}\`, and any changed stage docs aligned.`,
|
|
186
|
-
"",
|
|
187
|
-
"Guardrails:",
|
|
188
|
-
"- do not edit checks, test specs, or raw files",
|
|
189
|
-
"- do not hardcode expected answers into workflow docs",
|
|
190
|
-
"- keep this package standalone; do not add or rely on runtime `extends` or fallback behavior",
|
|
191
|
-
"- keep the workflow stack coherent: purpose, inputs, context interface, and stages should describe the same job",
|
|
192
|
-
"- prefer small, defensible workflow changes over random churn",
|
|
193
|
-
"",
|
|
194
|
-
].join("\n");
|
|
195
|
-
}
|
|
196
|
-
function renderStageSkill(workflow, stage) {
|
|
197
|
-
const notes = workflow.stagePolicyNotes?.[stage.id] ?? [];
|
|
198
|
-
const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
|
|
199
|
-
const abstractRules = stage.contractType === "compiled-file-evidence"
|
|
200
|
-
? [
|
|
201
|
-
"- Valid abstract forms for deterministic validation are:",
|
|
202
|
-
' - frontmatter key `"abstract"` with a real sentence, or',
|
|
203
|
-
" - a markdown heading `## Abstract` followed by at least one sentence",
|
|
204
|
-
"- A bare `Abstract` label without markdown heading syntax does not count.",
|
|
205
|
-
]
|
|
206
|
-
: [];
|
|
207
|
-
return [
|
|
208
|
-
`# ${stage.label}`,
|
|
209
|
-
"",
|
|
210
|
-
stage.description,
|
|
211
|
-
"",
|
|
212
|
-
"## Stage Contract",
|
|
213
|
-
"",
|
|
214
|
-
`- Contract type: \`${stage.contractType}\``,
|
|
215
|
-
`- Reads zones: ${stage.reads.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
|
|
216
|
-
`- Writes zones: ${stage.writes.map((zoneId) => `\`${zoneId}\``).join(", ")}`,
|
|
217
|
-
"",
|
|
218
|
-
"## Requirements",
|
|
219
|
-
"",
|
|
220
|
-
"- Treat `workflow.json` and `workflow.schema.json` as the authoritative package contract for this stage.",
|
|
221
|
-
"- Read only from the declared input zones unless this package explicitly documents a broader method.",
|
|
222
|
-
"- Write only inside the declared output zones for this stage. Do not invent undeclared zones or implicit outputs.",
|
|
223
|
-
"- Keep stage instructions, zone ownership, and workflow-level acceptance aligned when you change this stage.",
|
|
224
|
-
"- Treat runtime files as proof and execution state, not as the source of truth for workflow behavior.",
|
|
225
|
-
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
226
|
-
...abstractRules,
|
|
227
|
-
"",
|
|
228
|
-
...(acceptanceKeys.length > 0
|
|
229
|
-
? [
|
|
230
|
-
"## Declarative Acceptance",
|
|
231
|
-
"",
|
|
232
|
-
...acceptanceKeys.map((key) => `- \`${key}\``),
|
|
233
|
-
"",
|
|
234
|
-
]
|
|
235
|
-
: []),
|
|
236
|
-
...(notes.length > 0
|
|
237
|
-
? [
|
|
238
|
-
"## Notes",
|
|
239
|
-
"",
|
|
240
|
-
...notes.map((note) => `- ${note}`),
|
|
241
|
-
"",
|
|
242
|
-
]
|
|
243
|
-
: []),
|
|
244
|
-
].join("\n");
|
|
245
|
-
}
|
|
246
|
-
export function writeCompiledWorkflowPackage(compiledPath, workflow) {
|
|
247
|
-
writeWorkflowPackageToDir(workflowPackagePath(compiledPath), workflow);
|
|
248
|
-
}
|
|
249
|
-
export function writeWorkflowPackageToDir(workflowDir, workflow, options = {}) {
|
|
250
|
-
const overwrite = options.overwrite ?? true;
|
|
251
|
-
mkdirSync(join(workflowDir, "improve"), { recursive: true });
|
|
252
|
-
mkdirSync(join(workflowDir, "use", "query"), { recursive: true });
|
|
253
|
-
mkdirSync(join(workflowDir, "compile", "stages"), { recursive: true });
|
|
254
|
-
for (const stage of workflow.stages) {
|
|
255
|
-
mkdirSync(join(workflowDir, "compile", "stages", stage.skillDir), { recursive: true });
|
|
256
|
-
}
|
|
257
|
-
writeWorkflowPackageJson(workflowDir, workflow, { overwrite });
|
|
258
|
-
if (overwrite || !existsSync(join(workflowDir, CONTEXT_INTERFACE_FILE))) {
|
|
259
|
-
const contextInterface = workflow.contextInterface ?? workflow.schema;
|
|
260
|
-
if (contextInterface) {
|
|
261
|
-
writeContextInterface(workflowDir, {
|
|
262
|
-
...contextInterface,
|
|
263
|
-
label: contextInterface.label || `${workflow.label} workflow schema`,
|
|
264
|
-
});
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
writeContextInterfaceFile(workflowDir, workflow.stages, `${workflow.label} workflow schema`);
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
if (overwrite || !existsSync(join(workflowDir, "README.md"))) {
|
|
271
|
-
writeFileSync(join(workflowDir, "README.md"), renderWorkflowReadme(workflow));
|
|
272
|
-
}
|
|
273
|
-
if (overwrite || !existsSync(join(workflowDir, "improve", "SKILL.md"))) {
|
|
274
|
-
writeFileSync(join(workflowDir, "improve", "SKILL.md"), renderImproveSkill(workflow));
|
|
275
|
-
}
|
|
276
|
-
if (overwrite || !existsSync(join(workflowDir, "use", "query", "SKILL.md"))) {
|
|
277
|
-
writeFileSync(join(workflowDir, "use", "query", "SKILL.md"), renderCompiledQuerySkill());
|
|
278
|
-
}
|
|
279
|
-
for (const stage of workflow.stages) {
|
|
280
|
-
const targetPath = join(workflowDir, "compile", "stages", stage.skillDir, "SKILL.md");
|
|
281
|
-
if (overwrite || !existsSync(targetPath)) {
|
|
282
|
-
writeFileSync(targetPath, renderStageSkill(workflow, stage));
|
|
283
|
-
}
|
|
284
|
-
}
|
|
285
|
-
writeWorkflowStarterDocs(workflowDir, workflow.starterDocs, { overwrite });
|
|
286
|
-
}
|
|
287
|
-
export function seedCompiledWorkflowPackage(options) {
|
|
288
|
-
const resolvedWorkflow = getCompiledWorkflow(options.workflowId, {
|
|
289
|
-
sourcePath: options.sourcePath,
|
|
290
|
-
});
|
|
291
|
-
const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, resolvedWorkflow.id);
|
|
292
|
-
if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
|
|
293
|
-
// Portable seed packages can be copied directly because compile runs the
|
|
294
|
-
// local package folder without any source-root fallback.
|
|
295
|
-
copyWorkflowPackageDirectory(sourceWorkflowPath, workflowPackagePath(options.compiledPath));
|
|
296
|
-
patchWorkflowPackageMetadata(workflowPackagePath(options.compiledPath), {
|
|
297
|
-
id: resolvedWorkflow.id,
|
|
298
|
-
inputs: resolvedWorkflow.inputs,
|
|
299
|
-
label: resolvedWorkflow.label,
|
|
300
|
-
hint: resolvedWorkflow.hint,
|
|
301
|
-
stagePolicyNotes: resolvedWorkflow.stagePolicyNotes,
|
|
302
|
-
});
|
|
303
|
-
if (resolvedWorkflow.scope === "builtin") {
|
|
304
|
-
writeFileSync(join(workflowPackagePath(options.compiledPath), "README.md"), renderWorkflowReadme(resolvedWorkflow));
|
|
305
|
-
}
|
|
306
|
-
return;
|
|
307
|
-
}
|
|
308
|
-
// Legacy or partially-defined seed packages are resolved once and
|
|
309
|
-
// materialized into a standalone local package.
|
|
310
|
-
writeCompiledWorkflowPackage(options.compiledPath, resolvedWorkflow);
|
|
311
|
-
}
|
|
312
|
-
export function createLocalWorkflowPackageFromTemplate(options) {
|
|
313
|
-
const targetPath = seedLocalWorkflowPackageFromBase({
|
|
314
|
-
sourcePath: options.sourcePath,
|
|
315
|
-
baseWorkflowId: options.baseWorkflowId,
|
|
316
|
-
workflowId: options.workflowId,
|
|
317
|
-
label: options.label,
|
|
318
|
-
hint: options.hint,
|
|
319
|
-
});
|
|
320
|
-
const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
|
|
321
|
-
sourcePath: options.sourcePath,
|
|
322
|
-
});
|
|
323
|
-
const stagePolicyNotes = mergeStagePolicyNotesForStages(baseWorkflow.stages, baseWorkflow.stagePolicyNotes, options.stagePolicyNotes);
|
|
324
|
-
patchWorkflowPackageMetadata(targetPath, {
|
|
325
|
-
id: options.workflowId,
|
|
326
|
-
label: options.label,
|
|
327
|
-
hint: options.hint,
|
|
328
|
-
stagePolicyNotes,
|
|
329
|
-
});
|
|
330
|
-
writeFileSync(join(targetPath, "README.md"), renderDerivedWorkflowReadme({
|
|
331
|
-
label: options.label,
|
|
332
|
-
hint: options.hint,
|
|
333
|
-
baseWorkflowId: options.baseWorkflowId,
|
|
334
|
-
emphasis: baseWorkflow.stages
|
|
335
|
-
.map((stage) => ({
|
|
336
|
-
stageId: stage.id,
|
|
337
|
-
label: stage.label,
|
|
338
|
-
notes: stagePolicyNotes?.[stage.id] ?? [],
|
|
339
|
-
}))
|
|
340
|
-
.filter((entry) => entry.notes.length > 0),
|
|
341
|
-
}));
|
|
342
|
-
return targetPath;
|
|
343
|
-
}
|
|
344
|
-
export function seedLocalWorkflowPackageFromBase(options) {
|
|
345
|
-
const baseWorkflow = getCompiledWorkflow(options.baseWorkflowId, {
|
|
346
|
-
sourcePath: options.sourcePath,
|
|
347
|
-
});
|
|
348
|
-
const sourceWorkflowPath = resolveWorkflowPackageSourcePath(options.sourcePath, options.baseWorkflowId);
|
|
349
|
-
const targetPath = workflowDefinitionPath(options.sourcePath, options.workflowId);
|
|
350
|
-
if (sourceWorkflowPath && isPortableWorkflowPackage(sourceWorkflowPath)) {
|
|
351
|
-
// Copy directly when the base package is already portable and standalone.
|
|
352
|
-
copyWorkflowPackageDirectory(sourceWorkflowPath, targetPath);
|
|
353
|
-
patchWorkflowPackageMetadata(targetPath, {
|
|
354
|
-
id: options.workflowId,
|
|
355
|
-
inputs: baseWorkflow.inputs,
|
|
356
|
-
label: options.label,
|
|
357
|
-
hint: options.hint,
|
|
358
|
-
});
|
|
359
|
-
writeFileSync(join(targetPath, "README.md"), renderSeedWorkflowReadme({
|
|
360
|
-
label: options.label,
|
|
361
|
-
hint: options.hint,
|
|
362
|
-
baseWorkflowId: options.baseWorkflowId,
|
|
363
|
-
}));
|
|
364
|
-
return targetPath;
|
|
365
|
-
}
|
|
366
|
-
// Legacy or inherited base packages are materialized immediately so the new
|
|
367
|
-
// local workflow package is standalone from its first write.
|
|
368
|
-
const localWorkflow = {
|
|
369
|
-
...baseWorkflow,
|
|
370
|
-
id: options.workflowId,
|
|
371
|
-
label: options.label,
|
|
372
|
-
hint: options.hint,
|
|
373
|
-
recommended: false,
|
|
374
|
-
scope: "local",
|
|
375
|
-
starterDocs: [
|
|
376
|
-
{
|
|
377
|
-
relativePath: "README.md",
|
|
378
|
-
content: renderSeedWorkflowReadme({
|
|
379
|
-
label: options.label,
|
|
380
|
-
hint: options.hint,
|
|
381
|
-
baseWorkflowId: options.baseWorkflowId,
|
|
382
|
-
}),
|
|
383
|
-
},
|
|
384
|
-
...(baseWorkflow.starterDocs ?? []).filter((doc) => doc.relativePath !== "README.md"),
|
|
385
|
-
],
|
|
386
|
-
};
|
|
387
|
-
writeWorkflowPackageToDir(targetPath, localWorkflow);
|
|
388
|
-
return targetPath;
|
|
389
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { WorkflowCompilerApiSchema, RuntimeContractTypeSchema, RuntimeStageAcceptanceSchema, WorkflowPurposeSchema, WorkflowStageZoneAccessSchema } from "../compiler/lib/schema.js";
|
|
3
|
-
import { WorkflowInputSpecSchema, type ContextInterface, type WorkflowInputSpec } from "./context-interface.js";
|
|
4
|
-
export interface LocalWorkflowStarterDoc {
|
|
5
|
-
relativePath: string;
|
|
6
|
-
content: string;
|
|
7
|
-
}
|
|
8
|
-
export interface LocalWorkflowStageDefinition {
|
|
9
|
-
id: string;
|
|
10
|
-
label: string;
|
|
11
|
-
contract_type: z.infer<typeof RuntimeContractTypeSchema>;
|
|
12
|
-
skill_dir?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
reads: z.infer<typeof WorkflowStageZoneAccessSchema>;
|
|
15
|
-
writes: z.infer<typeof WorkflowStageZoneAccessSchema>;
|
|
16
|
-
acceptance?: z.infer<typeof RuntimeStageAcceptanceSchema>;
|
|
17
|
-
}
|
|
18
|
-
export interface LocalWorkflowDefinition {
|
|
19
|
-
id: string;
|
|
20
|
-
type: "compiled";
|
|
21
|
-
compiler_api?: z.infer<typeof WorkflowCompilerApiSchema>;
|
|
22
|
-
purpose?: z.infer<typeof WorkflowPurposeSchema>;
|
|
23
|
-
inputs?: Array<z.infer<typeof WorkflowInputSpecSchema>>;
|
|
24
|
-
label: string;
|
|
25
|
-
hint: string;
|
|
26
|
-
extends?: string;
|
|
27
|
-
stages?: LocalWorkflowStageDefinition[];
|
|
28
|
-
stage_policy_notes?: Record<string, string[]>;
|
|
29
|
-
workflow_schema: ContextInterface;
|
|
30
|
-
starter_docs: LocalWorkflowStarterDoc[];
|
|
31
|
-
directoryPath: string;
|
|
32
|
-
workflowPath: string;
|
|
33
|
-
workflowSchemaPath: string;
|
|
34
|
-
}
|
|
35
|
-
export declare function workflowDefinitionPath(sourcePath: string, id: string): string;
|
|
36
|
-
export declare function loadWorkflowDefinitionFromDir(dirPath: string): LocalWorkflowDefinition | null;
|
|
37
|
-
export declare function listLocalWorkflowDefinitions(sourcePath: string): LocalWorkflowDefinition[];
|
|
38
|
-
export declare function loadLocalWorkflowDefinition(sourcePath: string, id: string): LocalWorkflowDefinition | null;
|
|
39
|
-
export declare function resolveWorkflowPackageSourcePath(sourcePath: string, workflowId: string): string | null;
|
|
40
|
-
export declare function seedLocalDefaultWorkflow(options: {
|
|
41
|
-
sourcePath: string;
|
|
42
|
-
}): {
|
|
43
|
-
workflowId: string;
|
|
44
|
-
targetPath: string;
|
|
45
|
-
alreadyExisted: boolean;
|
|
46
|
-
};
|
|
47
|
-
export declare function isWorkflowId(value: string): boolean;
|
|
48
|
-
export declare function patchWorkflowPackageMetadata(dirPath: string, options?: {
|
|
49
|
-
id?: string;
|
|
50
|
-
inputs?: WorkflowInputSpec[];
|
|
51
|
-
label?: string;
|
|
52
|
-
hint?: string;
|
|
53
|
-
stagePolicyNotes?: Record<string, string[]>;
|
|
54
|
-
}): void;
|
|
55
|
-
export declare function describeWorkflowPackagePortability(dirPath: string): string[];
|
|
56
|
-
export declare function isPortableWorkflowPackage(dirPath: string): boolean;
|
|
57
|
-
export declare function copyWorkflowPackageDirectory(sourceWorkflowPath: string, targetWorkflowPath: string): void;
|
|
58
|
-
export interface WorkflowValidationResult {
|
|
59
|
-
ok: boolean;
|
|
60
|
-
summary: string;
|
|
61
|
-
errors: string[];
|
|
62
|
-
counts: Record<string, number>;
|
|
63
|
-
}
|
|
64
|
-
export declare function validateWorkflowPackage(dirPath: string): WorkflowValidationResult;
|