@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,23 +1,29 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
3
|
import { detectInterf, readInterfConfig, resolveSourceControlPath, } from "../../packages/project-model/interf.js";
|
|
4
|
-
import {
|
|
4
|
+
import { loadCompiledPreparationConfig, sourcePreparationConfigFromInterfConfig, resolvePreparationCompileMaxAttempts, resolvePreparationCompileMaxLoops, } from "../../packages/project-model/source-config.js";
|
|
5
5
|
import { addExecutionProfileOptions, executionProfileFromArgv, } from "../../packages/agents/lib/execution-profile.js";
|
|
6
6
|
import { chooseCompiledConfigToBuild, ensureCompiledFromConfig, } from "./compiled-flow.js";
|
|
7
|
-
import {
|
|
7
|
+
import { resolveConfiguredPreparationSelection } from "./preparation-selection.js";
|
|
8
8
|
import { promptCompileLoopSelection, } from "./source-config-wizard.js";
|
|
9
9
|
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
10
10
|
import { runConfiguredCompiledCompile } from "./compile-controller.js";
|
|
11
|
+
import { submitCompileRunToLocalService, waitForLocalCompileRun, } from "../../packages/local-service/index.js";
|
|
12
|
+
import { resolveCommandControlPath } from "./control-path.js";
|
|
13
|
+
import { resolveMethodId } from "../../packages/methods/method-resolution.js";
|
|
11
14
|
export { runConfiguredCompiledCompile } from "./compile-controller.js";
|
|
12
15
|
export const compileCommand = {
|
|
13
16
|
command: "compile",
|
|
14
|
-
describe: "
|
|
15
|
-
builder: (yargs) => addExecutionProfileOptions(yargs).option("
|
|
17
|
+
describe: "Prepare files and write Portable Context agents can use",
|
|
18
|
+
builder: (yargs) => addExecutionProfileOptions(yargs).option("preparation", {
|
|
19
|
+
type: "string",
|
|
20
|
+
describe: "Preparation id to compile when this Source Folder has more than one Preparation",
|
|
21
|
+
}).option("max-attempts", {
|
|
16
22
|
type: "number",
|
|
17
|
-
describe: "Retry
|
|
23
|
+
describe: "Retry the prepare run and run saved readiness checks with the same Method until the Preparation is ready or reaches this total attempt limit",
|
|
18
24
|
}).option("max-loops", {
|
|
19
25
|
type: "number",
|
|
20
|
-
describe: "After retries fail, let Interf edit the
|
|
26
|
+
describe: "After retries fail, let Interf edit the Method and run saved readiness checks on new Method variations for this Preparation up to this loop limit",
|
|
21
27
|
}).option("keep-stage-shells", {
|
|
22
28
|
type: "boolean",
|
|
23
29
|
default: false,
|
|
@@ -41,23 +47,24 @@ function readHintedSourcePath(argv) {
|
|
|
41
47
|
? argv.sourcePath.trim()
|
|
42
48
|
: null;
|
|
43
49
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
|
|
50
|
+
function readRequestedPreparationName(argv) {
|
|
51
|
+
const raw = argv.preparation;
|
|
52
|
+
return typeof raw === "string" && raw.trim().length > 0
|
|
53
|
+
? raw.trim()
|
|
47
54
|
: null;
|
|
48
55
|
}
|
|
49
56
|
function shouldSkipCompileConfirm(argv) {
|
|
50
57
|
return argv.skipConfirm === true;
|
|
51
58
|
}
|
|
52
|
-
function
|
|
53
|
-
return argv.
|
|
59
|
+
function shouldSkipPreparationBanner(argv) {
|
|
60
|
+
return argv.skipPreparationBanner === true;
|
|
54
61
|
}
|
|
55
62
|
function compileRunTests(options) {
|
|
56
63
|
const checks = options.compiledConfig?.checks ?? [];
|
|
57
64
|
if (checks.length === 0)
|
|
58
65
|
return false;
|
|
59
|
-
const configuredMaxAttempts =
|
|
60
|
-
const maxLoops =
|
|
66
|
+
const configuredMaxAttempts = resolvePreparationCompileMaxAttempts(options.compiledConfig ?? { max_attempts: undefined }, options.maxAttemptsOverride);
|
|
67
|
+
const maxLoops = resolvePreparationCompileMaxLoops(options.compiledConfig ?? { max_loops: undefined }, options.maxLoopsOverride);
|
|
61
68
|
const maxAttempts = configuredMaxAttempts ?? (maxLoops != null ? 1 : null);
|
|
62
69
|
return maxAttempts != null;
|
|
63
70
|
}
|
|
@@ -69,20 +76,20 @@ export async function runCompileCommand(argv = {}, deps = {}) {
|
|
|
69
76
|
let compiledPath = null;
|
|
70
77
|
const hintedSourcePath = readHintedSourcePath(argv);
|
|
71
78
|
const detected = hintedSourcePath ? null : helpers.detectInterf(process.cwd());
|
|
72
|
-
let sourcePath = hintedSourcePath ??
|
|
79
|
+
let sourcePath = hintedSourcePath ?? resolveCommandControlPath();
|
|
73
80
|
let compiledConfig = null;
|
|
74
|
-
const
|
|
75
|
-
const
|
|
81
|
+
const requestedPreparationName = readRequestedPreparationName(argv);
|
|
82
|
+
const hintedPreparationConfig = (argv.preparationConfig ?? null);
|
|
76
83
|
const skipConfirm = shouldSkipCompileConfirm(argv);
|
|
77
|
-
const
|
|
84
|
+
const skipPreparationBanner = shouldSkipPreparationBanner(argv);
|
|
78
85
|
if (detected) {
|
|
79
86
|
compiledPath = detected.path;
|
|
80
87
|
sourcePath = resolveSourceControlPath(detected.path);
|
|
81
|
-
compiledConfig =
|
|
82
|
-
??
|
|
88
|
+
compiledConfig = loadCompiledPreparationConfig(detected.path)
|
|
89
|
+
?? sourcePreparationConfigFromInterfConfig(detected.config);
|
|
83
90
|
if (!skipConfirm && process.stdin.isTTY && process.stdout.isTTY) {
|
|
84
91
|
const confirmed = await helpers.confirm({
|
|
85
|
-
message: `
|
|
92
|
+
message: `Prepare files for Preparation "${detected.config.name}" now?`,
|
|
86
93
|
initialValue: true,
|
|
87
94
|
});
|
|
88
95
|
if (p.isCancel(confirmed) || !confirmed)
|
|
@@ -90,33 +97,33 @@ export async function runCompileCommand(argv = {}, deps = {}) {
|
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
99
|
else {
|
|
93
|
-
const selectedCompiled =
|
|
94
|
-
?
|
|
100
|
+
const selectedCompiled = requestedPreparationName || hintedPreparationConfig
|
|
101
|
+
? resolveConfiguredPreparationSelection({
|
|
95
102
|
sourcePath,
|
|
96
|
-
|
|
97
|
-
|
|
103
|
+
requestedPreparationName,
|
|
104
|
+
hintedPreparationConfig,
|
|
98
105
|
})
|
|
99
106
|
: await helpers.chooseCompiledConfigToBuild({
|
|
100
107
|
sourcePath,
|
|
101
|
-
selectMessage: "Which
|
|
108
|
+
selectMessage: "Which saved Preparation do you want to compile?",
|
|
102
109
|
});
|
|
103
110
|
if (selectedCompiled === undefined)
|
|
104
111
|
return null;
|
|
105
112
|
if (!selectedCompiled) {
|
|
106
113
|
process.exitCode = 1;
|
|
107
|
-
if (
|
|
108
|
-
console.log(chalk.red(`
|
|
109
|
-
console.log(chalk.dim(" Run `interf list` to see the saved
|
|
114
|
+
if (requestedPreparationName) {
|
|
115
|
+
console.log(chalk.red(` Preparation "${requestedPreparationName}" is not saved in this Source Folder.`));
|
|
116
|
+
console.log(chalk.dim(" Run `interf list` to see the saved Preparations."));
|
|
110
117
|
}
|
|
111
118
|
else {
|
|
112
|
-
console.log(chalk.red(" No saved
|
|
119
|
+
console.log(chalk.red(" No saved Preparations are configured for this Source Folder yet."));
|
|
113
120
|
console.log(chalk.dim(" Start with `interf` or `interf init` to set up this folder."));
|
|
114
121
|
}
|
|
115
122
|
return null;
|
|
116
123
|
}
|
|
117
124
|
if (!skipConfirm && process.stdin.isTTY && process.stdout.isTTY) {
|
|
118
125
|
const confirmed = await helpers.confirm({
|
|
119
|
-
message: `
|
|
126
|
+
message: `Prepare files for Preparation "${selectedCompiled.name}" now?`,
|
|
120
127
|
initialValue: true,
|
|
121
128
|
});
|
|
122
129
|
if (p.isCancel(confirmed) || !confirmed)
|
|
@@ -124,8 +131,8 @@ export async function runCompileCommand(argv = {}, deps = {}) {
|
|
|
124
131
|
}
|
|
125
132
|
compiledConfig = selectedCompiled;
|
|
126
133
|
compiledPath = helpers.ensureCompiledFromConfig(sourcePath, selectedCompiled);
|
|
127
|
-
if (!
|
|
128
|
-
console.log(chalk.dim(`
|
|
134
|
+
if (!skipPreparationBanner) {
|
|
135
|
+
console.log(chalk.dim(` Preparation: ${selectedCompiled.name}`));
|
|
129
136
|
}
|
|
130
137
|
}
|
|
131
138
|
let maxAttemptsOverride = null;
|
|
@@ -155,6 +162,56 @@ export async function runCompileCommand(argv = {}, deps = {}) {
|
|
|
155
162
|
maxAttemptsOverride,
|
|
156
163
|
maxLoopsOverride,
|
|
157
164
|
});
|
|
165
|
+
if (argv.skipService !== true && compiledConfig) {
|
|
166
|
+
const submitted = await submitCompileRunToLocalService({
|
|
167
|
+
projectPath: sourcePath,
|
|
168
|
+
request: {
|
|
169
|
+
preparation: compiledConfig.name,
|
|
170
|
+
...(compiledConfig.method ? { method: compiledConfig.method } : {}),
|
|
171
|
+
...(maxAttemptsOverride != null ? { max_attempts: maxAttemptsOverride } : {}),
|
|
172
|
+
...(maxLoopsOverride != null ? { max_loops: maxLoopsOverride } : {}),
|
|
173
|
+
preserve_stage_shells: readStageShellRetentionMode(argv),
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
if (submitted) {
|
|
177
|
+
console.log(chalk.dim(` Visible in Interf: ${submitted.serviceUrl}/`));
|
|
178
|
+
let lastStatus = "";
|
|
179
|
+
let lastStage = "";
|
|
180
|
+
const completed = await waitForLocalCompileRun({
|
|
181
|
+
serviceUrl: submitted.serviceUrl,
|
|
182
|
+
runId: submitted.resource.run.run_id,
|
|
183
|
+
onUpdate(resource) {
|
|
184
|
+
const activeStage = resource.run.stages.find((stage) => stage.status === "running")
|
|
185
|
+
?? [...resource.run.stages].reverse().find((stage) => stage.status === "succeeded" || stage.status === "failed")
|
|
186
|
+
?? null;
|
|
187
|
+
const statusKey = `${resource.run.status}:${activeStage?.stage_id ?? ""}:${activeStage?.status ?? ""}`;
|
|
188
|
+
if (statusKey === `${lastStatus}:${lastStage}`)
|
|
189
|
+
return;
|
|
190
|
+
lastStatus = resource.run.status;
|
|
191
|
+
lastStage = `${activeStage?.stage_id ?? ""}:${activeStage?.status ?? ""}`;
|
|
192
|
+
if (activeStage) {
|
|
193
|
+
console.log(chalk.dim(` ${activeStage.stage_label ?? activeStage.stage_id}: ${activeStage.status}`));
|
|
194
|
+
}
|
|
195
|
+
else {
|
|
196
|
+
console.log(chalk.dim(` Prepare run: ${resource.run.status}`));
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
});
|
|
200
|
+
if (completed.run.status !== "succeeded") {
|
|
201
|
+
process.exitCode = 1;
|
|
202
|
+
const failure = completed.run.stages.find((stage) => stage.status === "failed");
|
|
203
|
+
console.log(chalk.red(` Prepare run ${completed.run.status}.`));
|
|
204
|
+
if (failure?.failure)
|
|
205
|
+
console.log(chalk.red(` ${failure.failure}`));
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
console.log(chalk.green(" Portable Context ready."));
|
|
209
|
+
return {
|
|
210
|
+
compiledPath: completed.run.portable_context_path,
|
|
211
|
+
testedDuringCompile,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
}
|
|
158
215
|
const executionProfile = executionProfileFromArgv(argv);
|
|
159
216
|
const { executor, error } = await helpers.resolveOrConfigureLocalExecutor({
|
|
160
217
|
executionProfile,
|
|
@@ -169,6 +226,7 @@ export async function runCompileCommand(argv = {}, deps = {}) {
|
|
|
169
226
|
}
|
|
170
227
|
const compiled = await helpers.runConfiguredCompiledCompile({
|
|
171
228
|
executor,
|
|
229
|
+
testExecutor: executor,
|
|
172
230
|
compiledPath,
|
|
173
231
|
sourcePath,
|
|
174
232
|
compiledConfig,
|
|
@@ -213,8 +271,8 @@ export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
|
213
271
|
}
|
|
214
272
|
const savedCompiledConfig = options.compiledConfig
|
|
215
273
|
?? (currentConfig
|
|
216
|
-
? (
|
|
217
|
-
??
|
|
274
|
+
? (loadCompiledPreparationConfig(options.compiledPath)
|
|
275
|
+
?? sourcePreparationConfigFromInterfConfig(currentConfig))
|
|
218
276
|
: null);
|
|
219
277
|
if (!savedCompiledConfig) {
|
|
220
278
|
return {
|
|
@@ -231,10 +289,10 @@ export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
|
231
289
|
initialMaxAttempts: savedCompiledConfig.max_attempts,
|
|
232
290
|
initialMaxLoops: savedCompiledConfig.max_loops,
|
|
233
291
|
intro: [
|
|
234
|
-
`
|
|
235
|
-
"This selection applies to this
|
|
292
|
+
`Method: ${resolveMethodId(savedCompiledConfig, resolveMethodId(currentConfig))}`,
|
|
293
|
+
"This selection applies to this prepare run only. It does not change the saved Preparation.",
|
|
236
294
|
],
|
|
237
|
-
message: "How should this
|
|
295
|
+
message: "How should this prepare run work?",
|
|
238
296
|
});
|
|
239
297
|
if (overrideSelection === null)
|
|
240
298
|
return null;
|
|
@@ -249,17 +307,17 @@ export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
|
249
307
|
};
|
|
250
308
|
}
|
|
251
309
|
const savedMode = await p.select({
|
|
252
|
-
message: "Which
|
|
310
|
+
message: "Which prepare mode should this run use?",
|
|
253
311
|
options: [
|
|
254
312
|
{
|
|
255
313
|
value: "saved",
|
|
256
|
-
label: "Use saved
|
|
314
|
+
label: "Use saved prepare mode (Recommended)",
|
|
257
315
|
hint: `${savedCompiledConfig.max_loops ? "Self-improving" : savedCompiledConfig.max_attempts && savedCompiledConfig.max_attempts > 1 ? "Retry" : "Single attempt"} · ${formatCompileModeHint(savedCompiledConfig)}`,
|
|
258
316
|
},
|
|
259
317
|
{
|
|
260
318
|
value: "override",
|
|
261
319
|
label: "Change it for this run only",
|
|
262
|
-
hint: "Keep the saved
|
|
320
|
+
hint: "Keep the saved Preparation unchanged",
|
|
263
321
|
},
|
|
264
322
|
],
|
|
265
323
|
});
|
|
@@ -277,10 +335,10 @@ export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
|
277
335
|
initialMaxAttempts: savedCompiledConfig.max_attempts,
|
|
278
336
|
initialMaxLoops: savedCompiledConfig.max_loops,
|
|
279
337
|
intro: [
|
|
280
|
-
`
|
|
281
|
-
"This applies to this
|
|
338
|
+
`Method: ${resolveMethodId(savedCompiledConfig, resolveMethodId(currentConfig))}`,
|
|
339
|
+
"This applies to this prepare run only. It does not change the saved Preparation.",
|
|
282
340
|
],
|
|
283
|
-
message: "Override the
|
|
341
|
+
message: "Override the prepare mode for this run",
|
|
284
342
|
});
|
|
285
343
|
if (selection === null)
|
|
286
344
|
return null;
|
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import { type StageShellRetentionMode, type CompiledCompileResult } from "../../packages/compiler/
|
|
3
|
-
import type {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
|
|
2
|
+
import { type StageShellRetentionMode, type CompiledCompileResult } from "../../packages/compiler/method-runs.js";
|
|
3
|
+
import type { MethodExecutor } from "../../packages/agents/lib/executors.js";
|
|
4
|
+
import type { RunEventSink } from "../../packages/execution/events.js";
|
|
5
|
+
export interface SavedPreparationEntry {
|
|
6
|
+
config: SourcePreparationConfig;
|
|
6
7
|
path: string | null;
|
|
7
8
|
localDraft: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare function
|
|
10
|
+
export declare function listSavedPreparationEntries(sourcePath: string): SavedPreparationEntry[];
|
|
10
11
|
export declare function findBuiltCompiledPath(sourcePath: string, compiledName: string): string | null;
|
|
11
|
-
export declare function findSavedCompiledConfig(sourcePath: string, compiledName: string):
|
|
12
|
+
export declare function findSavedCompiledConfig(sourcePath: string, compiledName: string): SourcePreparationConfig | null;
|
|
12
13
|
export declare function chooseCompiledConfigToBuild(options: {
|
|
13
14
|
sourcePath: string;
|
|
14
15
|
selectMessage: string;
|
|
15
|
-
}): Promise<
|
|
16
|
-
export declare function createCompiledFromConfig(sourcePath: string,
|
|
17
|
-
export declare function ensureCompiledFromConfig(sourcePath: string,
|
|
18
|
-
export declare function compileCompiledWithReporter(executor:
|
|
16
|
+
}): Promise<SourcePreparationConfig | null | undefined>;
|
|
17
|
+
export declare function createCompiledFromConfig(sourcePath: string, preparationConfig: SourcePreparationConfig): string;
|
|
18
|
+
export declare function ensureCompiledFromConfig(sourcePath: string, preparationConfig: SourcePreparationConfig): string;
|
|
19
|
+
export declare function compileCompiledWithReporter(executor: MethodExecutor, compiledPath: string, options?: {
|
|
19
20
|
heading?: string;
|
|
20
21
|
successMessage?: string;
|
|
21
22
|
preserveStageShells?: StageShellRetentionMode;
|
|
23
|
+
runId?: string;
|
|
24
|
+
events?: RunEventSink;
|
|
22
25
|
}): Promise<CompiledCompileResult>;
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import * as p from "@clack/prompts";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { compileCompiled, createCompiled, } from "../../packages/compiler/
|
|
6
|
-
import {
|
|
7
|
-
|
|
3
|
+
import { ensurePortableContextScaffold, listPortableContextsForSourceFolder, } from "../../packages/project-model/interf.js";
|
|
4
|
+
import { listSourcePreparationConfigs, loadCompiledPreparationConfig, loadSourceFolderConfig, resolveSourcePreparationPath, sourcePreparationConfigFromInterfConfig, syncCompiledInterfConfigFromSourcePreparationConfig, } from "../../packages/project-model/source-config.js";
|
|
5
|
+
import { compileCompiled, createCompiled, } from "../../packages/compiler/method-runs.js";
|
|
6
|
+
import { formatMethodExecutionProfile } from "../../packages/agents/lib/execution-profile.js";
|
|
7
|
+
import { resolveMethodId } from "../../packages/methods/method-resolution.js";
|
|
8
|
+
function formatSavedPreparationHint(entry) {
|
|
8
9
|
const config = entry.config;
|
|
9
10
|
const checkCount = config.checks.length;
|
|
10
|
-
const
|
|
11
|
+
const methodHint = `Method ${resolveMethodId(config)}${entry.localDraft ? " (local draft)" : ""}`;
|
|
11
12
|
if (config.about)
|
|
12
|
-
return `${config.path} · ${config.about} · ${
|
|
13
|
+
return `${config.path} · ${config.about} · ${methodHint}`;
|
|
13
14
|
if (checkCount === 0)
|
|
14
|
-
return `${config.path} · No
|
|
15
|
-
return `${config.path} · ${checkCount}
|
|
15
|
+
return `${config.path} · No readiness checks yet · ${methodHint}`;
|
|
16
|
+
return `${config.path} · ${checkCount} readiness check${checkCount === 1 ? "" : "s"} · ${methodHint}`;
|
|
16
17
|
}
|
|
17
|
-
export function
|
|
18
|
+
export function listSavedPreparationEntries(sourcePath) {
|
|
18
19
|
const builtEntries = new Map();
|
|
19
|
-
for (const builtCompiled of
|
|
20
|
-
const
|
|
21
|
-
??
|
|
20
|
+
for (const builtCompiled of listPortableContextsForSourceFolder(sourcePath)) {
|
|
21
|
+
const preparationConfig = loadCompiledPreparationConfig(builtCompiled.path)
|
|
22
|
+
?? sourcePreparationConfigFromInterfConfig(builtCompiled.config);
|
|
22
23
|
builtEntries.set(builtCompiled.config.name, {
|
|
23
|
-
config:
|
|
24
|
+
config: preparationConfig,
|
|
24
25
|
path: builtCompiled.path,
|
|
25
|
-
localDraft: builtCompiled.config.
|
|
26
|
+
localDraft: builtCompiled.config.method_origin?.local_draft === true,
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
const entries = new Map();
|
|
29
|
-
for (const config of
|
|
30
|
+
for (const config of listSourcePreparationConfigs(loadSourceFolderConfig(sourcePath))) {
|
|
30
31
|
const built = builtEntries.get(config.name);
|
|
31
32
|
entries.set(config.name, {
|
|
32
33
|
config,
|
|
@@ -37,13 +38,13 @@ export function listSavedCompiledEntries(sourcePath) {
|
|
|
37
38
|
return Array.from(entries.values()).sort((left, right) => left.config.name.localeCompare(right.config.name));
|
|
38
39
|
}
|
|
39
40
|
export function findBuiltCompiledPath(sourcePath, compiledName) {
|
|
40
|
-
return
|
|
41
|
+
return listSavedPreparationEntries(sourcePath).find((entry) => entry.config.name === compiledName)?.path ?? null;
|
|
41
42
|
}
|
|
42
43
|
export function findSavedCompiledConfig(sourcePath, compiledName) {
|
|
43
|
-
return
|
|
44
|
+
return listSavedPreparationEntries(sourcePath).find((entry) => entry.config.name === compiledName)?.config ?? null;
|
|
44
45
|
}
|
|
45
46
|
export async function chooseCompiledConfigToBuild(options) {
|
|
46
|
-
const savedEntries =
|
|
47
|
+
const savedEntries = listSavedPreparationEntries(options.sourcePath);
|
|
47
48
|
if (savedEntries.length === 0) {
|
|
48
49
|
return null;
|
|
49
50
|
}
|
|
@@ -56,8 +57,8 @@ export async function chooseCompiledConfigToBuild(options) {
|
|
|
56
57
|
value: entry.config.name,
|
|
57
58
|
label: entry.config.name,
|
|
58
59
|
hint: [
|
|
59
|
-
|
|
60
|
-
entry.path ? "
|
|
60
|
+
formatSavedPreparationHint(entry),
|
|
61
|
+
entry.path ? "Portable Context available" : "Portable Context not built yet",
|
|
61
62
|
].join(" · "),
|
|
62
63
|
})),
|
|
63
64
|
});
|
|
@@ -65,25 +66,27 @@ export async function chooseCompiledConfigToBuild(options) {
|
|
|
65
66
|
return undefined;
|
|
66
67
|
return savedEntries.find((entry) => entry.config.name === selected)?.config ?? null;
|
|
67
68
|
}
|
|
68
|
-
export function createCompiledFromConfig(sourcePath,
|
|
69
|
-
const
|
|
70
|
-
const
|
|
71
|
-
const compiledPath = createCompiled(
|
|
72
|
-
|
|
69
|
+
export function createCompiledFromConfig(sourcePath, preparationConfig) {
|
|
70
|
+
const methodId = resolveMethodId(preparationConfig);
|
|
71
|
+
const sourceFolderPath = resolveSourcePreparationPath(sourcePath, preparationConfig);
|
|
72
|
+
const compiledPath = createCompiled(preparationConfig.name, sourcePath, methodId, preparationConfig.about, sourceFolderPath);
|
|
73
|
+
syncCompiledInterfConfigFromSourcePreparationConfig(compiledPath, preparationConfig);
|
|
73
74
|
return compiledPath;
|
|
74
75
|
}
|
|
75
|
-
export function ensureCompiledFromConfig(sourcePath,
|
|
76
|
-
const
|
|
76
|
+
export function ensureCompiledFromConfig(sourcePath, preparationConfig) {
|
|
77
|
+
const methodId = resolveMethodId(preparationConfig);
|
|
78
|
+
const existingPath = findBuiltCompiledPath(sourcePath, preparationConfig.name);
|
|
77
79
|
if (existingPath) {
|
|
78
|
-
|
|
80
|
+
ensurePortableContextScaffold(sourcePath, preparationConfig.name, methodId);
|
|
81
|
+
syncCompiledInterfConfigFromSourcePreparationConfig(existingPath, preparationConfig);
|
|
79
82
|
return existingPath;
|
|
80
83
|
}
|
|
81
|
-
return createCompiledFromConfig(sourcePath,
|
|
84
|
+
return createCompiledFromConfig(sourcePath, preparationConfig);
|
|
82
85
|
}
|
|
83
86
|
export async function compileCompiledWithReporter(executor, compiledPath, options = {}) {
|
|
84
87
|
console.log();
|
|
85
|
-
console.log(chalk.bold(` ${options.heading ?? "Building
|
|
86
|
-
const profileLabel =
|
|
88
|
+
console.log(chalk.bold(` ${options.heading ?? "Building Portable Context..."}`));
|
|
89
|
+
const profileLabel = formatMethodExecutionProfile(executor.executionProfile);
|
|
87
90
|
if (profileLabel) {
|
|
88
91
|
console.log(chalk.dim(` Execution profile: ${profileLabel}`));
|
|
89
92
|
}
|
|
@@ -97,11 +100,13 @@ export async function compileCompiledWithReporter(executor, compiledPath, option
|
|
|
97
100
|
compiledPath,
|
|
98
101
|
reporter,
|
|
99
102
|
preserveStageShells: options.preserveStageShells,
|
|
103
|
+
runId: options.runId,
|
|
104
|
+
events: options.events,
|
|
100
105
|
});
|
|
101
106
|
if (!result.ok) {
|
|
102
107
|
return result;
|
|
103
108
|
}
|
|
104
109
|
console.log();
|
|
105
|
-
console.log(chalk.green(` ✓ ${options.successMessage ?? "Portable
|
|
110
|
+
console.log(chalk.green(` ✓ ${options.successMessage ?? "Portable Context ready."}`));
|
|
106
111
|
return result;
|
|
107
112
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function hasInterfInstanceConfig(controlPath: string): boolean;
|
|
2
|
+
export declare function findNearestInterfInstanceConfig(cwd?: string): string | null;
|
|
3
|
+
export declare function defaultInterfInstanceRoot(sourceFolderPath: string): string;
|
|
4
|
+
export declare function resolveCommandControlPath(cwd?: string): string;
|
|
5
|
+
export interface InterfInstanceContext {
|
|
6
|
+
controlPath: string;
|
|
7
|
+
defaultSourceFolderPath: string | null;
|
|
8
|
+
defaultPreparationPath: string | null;
|
|
9
|
+
}
|
|
10
|
+
export declare function relativeSourceFolderPath(controlPath: string, sourceFolderPath: string): string;
|
|
11
|
+
export declare function resolveInterfInstanceContext(cwd?: string): InterfInstanceContext;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
import { basename, dirname, join, relative, resolve, sep } from "node:path";
|
|
4
|
+
import { assertCompiledContainer } from "../../packages/project-model/interf.js";
|
|
5
|
+
import { sourceFolderConfigPath } from "../../packages/project-model/source-config.js";
|
|
6
|
+
function canUseInterfInstanceRoot(controlPath) {
|
|
7
|
+
try {
|
|
8
|
+
assertCompiledContainer(controlPath);
|
|
9
|
+
return true;
|
|
10
|
+
}
|
|
11
|
+
catch {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export function hasInterfInstanceConfig(controlPath) {
|
|
16
|
+
return existsSync(sourceFolderConfigPath(controlPath)) && canUseInterfInstanceRoot(controlPath);
|
|
17
|
+
}
|
|
18
|
+
export function findNearestInterfInstanceConfig(cwd = process.cwd()) {
|
|
19
|
+
let cursor = resolve(cwd);
|
|
20
|
+
while (true) {
|
|
21
|
+
if (hasInterfInstanceConfig(cursor))
|
|
22
|
+
return cursor;
|
|
23
|
+
const parentPath = dirname(cursor);
|
|
24
|
+
if (parentPath === cursor)
|
|
25
|
+
return null;
|
|
26
|
+
cursor = parentPath;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
function fallbackInterfInstanceRoot(sourceFolderPath) {
|
|
30
|
+
return join(homedir(), ".interf", basename(sourceFolderPath) || "source-folder");
|
|
31
|
+
}
|
|
32
|
+
export function defaultInterfInstanceRoot(sourceFolderPath) {
|
|
33
|
+
const parentPath = dirname(sourceFolderPath);
|
|
34
|
+
if (parentPath !== sourceFolderPath && canUseInterfInstanceRoot(parentPath)) {
|
|
35
|
+
return parentPath;
|
|
36
|
+
}
|
|
37
|
+
return fallbackInterfInstanceRoot(sourceFolderPath);
|
|
38
|
+
}
|
|
39
|
+
export function resolveCommandControlPath(cwd = process.cwd()) {
|
|
40
|
+
const currentPath = resolve(cwd);
|
|
41
|
+
return findNearestInterfInstanceConfig(currentPath) ?? currentPath;
|
|
42
|
+
}
|
|
43
|
+
export function relativeSourceFolderPath(controlPath, sourceFolderPath) {
|
|
44
|
+
const relativePath = relative(controlPath, sourceFolderPath).split(sep).join("/") || ".";
|
|
45
|
+
if (relativePath.startsWith(".."))
|
|
46
|
+
return sourceFolderPath;
|
|
47
|
+
return relativePath.startsWith(".") ? relativePath : `./${relativePath}`;
|
|
48
|
+
}
|
|
49
|
+
export function resolveInterfInstanceContext(cwd = process.cwd()) {
|
|
50
|
+
const currentPath = resolve(cwd);
|
|
51
|
+
const existingControlPath = findNearestInterfInstanceConfig(currentPath);
|
|
52
|
+
if (existingControlPath) {
|
|
53
|
+
if (existingControlPath !== currentPath) {
|
|
54
|
+
return {
|
|
55
|
+
controlPath: existingControlPath,
|
|
56
|
+
defaultSourceFolderPath: currentPath,
|
|
57
|
+
defaultPreparationPath: relativeSourceFolderPath(existingControlPath, currentPath),
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return {
|
|
61
|
+
controlPath: currentPath,
|
|
62
|
+
defaultSourceFolderPath: null,
|
|
63
|
+
defaultPreparationPath: null,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const controlPath = defaultInterfInstanceRoot(currentPath);
|
|
67
|
+
return {
|
|
68
|
+
controlPath,
|
|
69
|
+
defaultSourceFolderPath: currentPath,
|
|
70
|
+
defaultPreparationPath: relativeSourceFolderPath(controlPath, currentPath),
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
2
|
+
import { runMethodAuthoringDraft } from "../../packages/method-authoring/method-authoring.js";
|
|
3
|
+
import type { SourcePreparationConfig } from "../../packages/project-model/lib/schema.js";
|
|
4
|
+
import type { MethodExecutionProfile } from "../../packages/agents/lib/executors.js";
|
|
5
|
+
export interface MethodWizardPrompts {
|
|
6
|
+
intro(message: string): void;
|
|
7
|
+
select(options: {
|
|
8
|
+
message: string;
|
|
9
|
+
options: Array<{
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
hint?: string;
|
|
13
|
+
}>;
|
|
14
|
+
}): Promise<string | symbol>;
|
|
15
|
+
text(options: {
|
|
16
|
+
message: string;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
initialValue?: string;
|
|
19
|
+
validate?: (value: string) => string | undefined;
|
|
20
|
+
}): Promise<string | symbol>;
|
|
21
|
+
isCancel(value: unknown): value is symbol;
|
|
22
|
+
log: {
|
|
23
|
+
info(message: string): void;
|
|
24
|
+
error?(message: string): void;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface MethodWizardPreparationContext {
|
|
28
|
+
config: SourcePreparationConfig;
|
|
29
|
+
sourceFolderPath: string;
|
|
30
|
+
}
|
|
31
|
+
export declare const clackMethodPrompts: MethodWizardPrompts;
|
|
32
|
+
type MethodCreationMode = "draft-from-scratch" | "fork-existing" | "draft" | "manual";
|
|
33
|
+
export declare function formatMethodLabel(method: {
|
|
34
|
+
id: string;
|
|
35
|
+
label: string;
|
|
36
|
+
hint: string;
|
|
37
|
+
scope?: "builtin" | "local";
|
|
38
|
+
}): {
|
|
39
|
+
value: string;
|
|
40
|
+
label: string;
|
|
41
|
+
hint: string;
|
|
42
|
+
};
|
|
43
|
+
export declare function buildCompiledMethodOptions(sourcePath: string): {
|
|
44
|
+
value: string;
|
|
45
|
+
label: string;
|
|
46
|
+
hint: string;
|
|
47
|
+
}[];
|
|
48
|
+
export declare function chooseCompiledMethod(sourcePath: string, options?: {
|
|
49
|
+
currentMethodId?: string;
|
|
50
|
+
message?: string;
|
|
51
|
+
}): Promise<string | symbol>;
|
|
52
|
+
export declare function chooseOrCreateCompiledMethodForPreparation(sourcePath: string, preparationConfig: SourcePreparationConfig, options?: {
|
|
53
|
+
currentMethodId?: string;
|
|
54
|
+
executionProfile?: MethodExecutionProfile;
|
|
55
|
+
resolveExecutor?: typeof resolveOrConfigureLocalExecutor;
|
|
56
|
+
runDraft?: typeof runMethodAuthoringDraft;
|
|
57
|
+
}, prompts?: MethodWizardPrompts): Promise<string | symbol | null>;
|
|
58
|
+
export declare function createMethodWizard(options?: {
|
|
59
|
+
intro?: boolean;
|
|
60
|
+
sourcePath?: string;
|
|
61
|
+
executionProfile?: MethodExecutionProfile;
|
|
62
|
+
baseMethodId?: string;
|
|
63
|
+
creationMode?: MethodCreationMode;
|
|
64
|
+
preparationContext?: MethodWizardPreparationContext;
|
|
65
|
+
resolveExecutor?: typeof resolveOrConfigureLocalExecutor;
|
|
66
|
+
runDraft?: typeof runMethodAuthoringDraft;
|
|
67
|
+
}, prompts?: MethodWizardPrompts): Promise<string | symbol | null>;
|
|
68
|
+
export declare function createCompiledMethodWizard(sourcePath: string, prompts?: MethodWizardPrompts, options?: {
|
|
69
|
+
executionProfile?: MethodExecutionProfile;
|
|
70
|
+
baseMethodId?: string;
|
|
71
|
+
creationMode?: MethodCreationMode;
|
|
72
|
+
preparationContext?: MethodWizardPreparationContext;
|
|
73
|
+
resolveExecutor?: typeof resolveOrConfigureLocalExecutor;
|
|
74
|
+
runDraft?: typeof runMethodAuthoringDraft;
|
|
75
|
+
}): Promise<string | symbol | null>;
|
|
76
|
+
export {};
|