@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
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import chalk from "chalk";
|
|
2
|
+
import * as p from "@clack/prompts";
|
|
3
|
+
import { resolve } from "node:path";
|
|
4
|
+
import { listCompiledMethodChoices, getCompiledMethod, } from "../../packages/method-package/method-definitions.js";
|
|
5
|
+
import { createLocalMethodPackageFromTemplate } from "../../packages/method-package/interf-method-package.js";
|
|
6
|
+
import { rmSync } from "node:fs";
|
|
7
|
+
import { isMethodId, loadMethodDefinitionFromDir, seedLocalDefaultMethod, } from "../../packages/method-package/local-methods.js";
|
|
8
|
+
import { resolveOrConfigureLocalExecutor } from "./executor-flow.js";
|
|
9
|
+
import { runMethodAuthoringDraft } from "../../packages/method-authoring/method-authoring.js";
|
|
10
|
+
import { listSourcePreparationConfigs, loadSourceFolderConfig, resolveSourcePreparationPath, } from "../../packages/project-model/source-config.js";
|
|
11
|
+
import { slugify } from "../../packages/shared/naming.js";
|
|
12
|
+
import { submitMethodAuthoringRunToLocalService } from "../../packages/local-service/index.js";
|
|
13
|
+
import { DEFAULT_SOURCE_FOLDER_PATH_PLACEHOLDER, listSourceFolderChoices, normalizeSourceFolderPathForConfig, } from "./source-config-wizard.js";
|
|
14
|
+
export const clackMethodPrompts = {
|
|
15
|
+
intro: p.intro,
|
|
16
|
+
select: (options) => p.select(options),
|
|
17
|
+
text: (options) => p.text(options),
|
|
18
|
+
isCancel: p.isCancel,
|
|
19
|
+
log: {
|
|
20
|
+
info: p.log.info,
|
|
21
|
+
error: p.log.error,
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
function normalizeMethodCreationMode(mode) {
|
|
25
|
+
if (mode === "draft")
|
|
26
|
+
return "draft-from-scratch";
|
|
27
|
+
if (mode === "manual")
|
|
28
|
+
return "fork-existing";
|
|
29
|
+
return mode;
|
|
30
|
+
}
|
|
31
|
+
function findMatchingPreparationConfig(sourcePath, sourceFolderPath) {
|
|
32
|
+
const config = loadSourceFolderConfig(sourcePath);
|
|
33
|
+
for (const preparation of listSourcePreparationConfigs(config)) {
|
|
34
|
+
if (resolveSourcePreparationPath(sourcePath, preparation) === sourceFolderPath) {
|
|
35
|
+
return preparation;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function describeSavedPreparation(preparation) {
|
|
41
|
+
return preparation.about
|
|
42
|
+
? `${preparation.path} · ${preparation.about}`
|
|
43
|
+
: `${preparation.path} · ${preparation.checks.length} readiness check${preparation.checks.length === 1 ? "" : "s"}`;
|
|
44
|
+
}
|
|
45
|
+
async function promptMethodSourceFolder(sourcePath, prompts) {
|
|
46
|
+
const savedPreparations = listSourcePreparationConfigs(loadSourceFolderConfig(sourcePath));
|
|
47
|
+
const folderChoices = listSourceFolderChoices(sourcePath);
|
|
48
|
+
if (folderChoices.length > 0) {
|
|
49
|
+
const selected = await prompts.select({
|
|
50
|
+
message: "Which Source Folder should shape this Method?",
|
|
51
|
+
options: [
|
|
52
|
+
...savedPreparations.map((preparation) => ({
|
|
53
|
+
value: preparation.name,
|
|
54
|
+
label: preparation.name,
|
|
55
|
+
hint: describeSavedPreparation(preparation),
|
|
56
|
+
})),
|
|
57
|
+
...folderChoices,
|
|
58
|
+
{
|
|
59
|
+
value: "__manual__",
|
|
60
|
+
label: "Enter a different path",
|
|
61
|
+
hint: "Use a relative path if the Source Folder is not listed here",
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
});
|
|
65
|
+
if (prompts.isCancel(selected))
|
|
66
|
+
return selected;
|
|
67
|
+
if (selected !== "__manual__") {
|
|
68
|
+
const savedPreparation = savedPreparations.find((preparation) => preparation.name === selected);
|
|
69
|
+
if (savedPreparation) {
|
|
70
|
+
return resolveSourcePreparationPath(sourcePath, savedPreparation);
|
|
71
|
+
}
|
|
72
|
+
return resolve(sourcePath, normalizeSourceFolderPathForConfig(sourcePath, String(selected)));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const sourceFolderPrompt = await prompts.text({
|
|
76
|
+
message: "Which Source Folder should shape this Method?",
|
|
77
|
+
placeholder: DEFAULT_SOURCE_FOLDER_PATH_PLACEHOLDER,
|
|
78
|
+
initialValue: folderChoices.length === 1 ? folderChoices[0]?.value : undefined,
|
|
79
|
+
validate: (value) => {
|
|
80
|
+
const trimmed = value.trim();
|
|
81
|
+
if (trimmed.length === 0)
|
|
82
|
+
return "Source Folder is required";
|
|
83
|
+
try {
|
|
84
|
+
normalizeSourceFolderPathForConfig(sourcePath, trimmed);
|
|
85
|
+
return undefined;
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
return error instanceof Error ? error.message : String(error);
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
});
|
|
92
|
+
if (prompts.isCancel(sourceFolderPrompt))
|
|
93
|
+
return sourceFolderPrompt;
|
|
94
|
+
return resolve(sourcePath, normalizeSourceFolderPathForConfig(sourcePath, String(sourceFolderPrompt)));
|
|
95
|
+
}
|
|
96
|
+
export function formatMethodLabel(method) {
|
|
97
|
+
return {
|
|
98
|
+
value: method.id,
|
|
99
|
+
label: method.scope === "local" ? `${method.label} (Local)` : method.label,
|
|
100
|
+
hint: method.hint,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
export function buildCompiledMethodOptions(sourcePath) {
|
|
104
|
+
return listCompiledMethodChoices(sourcePath).map(formatMethodLabel);
|
|
105
|
+
}
|
|
106
|
+
function methodUseLabel(method) {
|
|
107
|
+
if (method.value === "interf-default") {
|
|
108
|
+
return "built-in Method";
|
|
109
|
+
}
|
|
110
|
+
return method.label.replace(/ \(Local\)$/, "");
|
|
111
|
+
}
|
|
112
|
+
function methodForkLabel(method) {
|
|
113
|
+
return `Fork ${methodUseLabel(method)}`;
|
|
114
|
+
}
|
|
115
|
+
export async function chooseCompiledMethod(sourcePath, options = {}) {
|
|
116
|
+
const currentMethodId = options.currentMethodId;
|
|
117
|
+
const methodOptions = buildCompiledMethodOptions(sourcePath);
|
|
118
|
+
const orderedOptions = methodOptions
|
|
119
|
+
.map((option) => option.value === currentMethodId
|
|
120
|
+
? {
|
|
121
|
+
...option,
|
|
122
|
+
label: `${option.label} (Current)`,
|
|
123
|
+
hint: option.hint,
|
|
124
|
+
}
|
|
125
|
+
: option)
|
|
126
|
+
.sort((left, right) => {
|
|
127
|
+
if (left.value === currentMethodId)
|
|
128
|
+
return -1;
|
|
129
|
+
if (right.value === currentMethodId)
|
|
130
|
+
return 1;
|
|
131
|
+
return 0;
|
|
132
|
+
});
|
|
133
|
+
if (orderedOptions.length === 1) {
|
|
134
|
+
return orderedOptions[0]?.value ?? "interf-default";
|
|
135
|
+
}
|
|
136
|
+
return p.select({
|
|
137
|
+
message: options.message ?? "Preparation Method?",
|
|
138
|
+
options: orderedOptions,
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
export async function chooseOrCreateCompiledMethodForPreparation(sourcePath, preparationConfig, options = {}, prompts = clackMethodPrompts) {
|
|
142
|
+
const currentMethodId = options.currentMethodId ?? preparationConfig.method ?? "interf-default";
|
|
143
|
+
const methodOptions = buildCompiledMethodOptions(sourcePath);
|
|
144
|
+
const currentMethod = methodOptions.find((method) => method.value === currentMethodId) ??
|
|
145
|
+
methodOptions.find((method) => method.value === "interf-default") ??
|
|
146
|
+
methodOptions[0];
|
|
147
|
+
const selected = await prompts.select({
|
|
148
|
+
message: "Which Method should Interf use for this Preparation?",
|
|
149
|
+
options: [
|
|
150
|
+
{
|
|
151
|
+
value: "__draft_from_scratch__",
|
|
152
|
+
label: "Draft a new Method from scratch (Recommended)",
|
|
153
|
+
hint: "Start from a neutral scaffold; an agent designs stages, outputs, and proof for this Preparation",
|
|
154
|
+
},
|
|
155
|
+
...(currentMethod
|
|
156
|
+
? [{
|
|
157
|
+
value: "__current__",
|
|
158
|
+
label: `Use ${methodUseLabel(currentMethod)}`,
|
|
159
|
+
hint: currentMethod.value === "interf-default"
|
|
160
|
+
? "Use the built-in Method without drafting a custom package"
|
|
161
|
+
: currentMethod.hint,
|
|
162
|
+
}]
|
|
163
|
+
: []),
|
|
164
|
+
...(currentMethod
|
|
165
|
+
? [{
|
|
166
|
+
value: "__fork_existing__",
|
|
167
|
+
label: methodForkLabel(currentMethod),
|
|
168
|
+
hint: "Copy its existing stage topology, then write the per-stage guidance yourself",
|
|
169
|
+
}]
|
|
170
|
+
: []),
|
|
171
|
+
...methodOptions
|
|
172
|
+
.filter((method) => method.value !== currentMethod?.value)
|
|
173
|
+
.map((method) => ({
|
|
174
|
+
...method,
|
|
175
|
+
label: `Use ${methodUseLabel(method)}`,
|
|
176
|
+
})),
|
|
177
|
+
],
|
|
178
|
+
});
|
|
179
|
+
if (prompts.isCancel(selected))
|
|
180
|
+
return selected;
|
|
181
|
+
if (selected === "__current__") {
|
|
182
|
+
if (currentMethod?.value === "interf-default") {
|
|
183
|
+
seedLocalDefaultMethod({ sourcePath });
|
|
184
|
+
}
|
|
185
|
+
return currentMethod?.value ?? currentMethodId;
|
|
186
|
+
}
|
|
187
|
+
if (selected === "__draft_from_scratch__" || selected === "__fork_existing__") {
|
|
188
|
+
if (selected === "__fork_existing__" && currentMethod?.value === "interf-default") {
|
|
189
|
+
seedLocalDefaultMethod({ sourcePath });
|
|
190
|
+
}
|
|
191
|
+
const methodId = await createMethodWizard({
|
|
192
|
+
intro: false,
|
|
193
|
+
sourcePath,
|
|
194
|
+
baseMethodId: selected === "__fork_existing__"
|
|
195
|
+
? currentMethod?.value ?? currentMethodId
|
|
196
|
+
: undefined,
|
|
197
|
+
creationMode: selected === "__draft_from_scratch__" ? "draft-from-scratch" : "fork-existing",
|
|
198
|
+
executionProfile: options.executionProfile,
|
|
199
|
+
resolveExecutor: options.resolveExecutor,
|
|
200
|
+
runDraft: options.runDraft,
|
|
201
|
+
preparationContext: {
|
|
202
|
+
config: preparationConfig,
|
|
203
|
+
sourceFolderPath: resolveSourcePreparationPath(sourcePath, preparationConfig),
|
|
204
|
+
},
|
|
205
|
+
}, prompts);
|
|
206
|
+
return methodId;
|
|
207
|
+
}
|
|
208
|
+
return String(selected);
|
|
209
|
+
}
|
|
210
|
+
export async function createMethodWizard(options = {}, prompts = clackMethodPrompts) {
|
|
211
|
+
if (options.intro !== false) {
|
|
212
|
+
prompts.intro(chalk.bold("Create a Method"));
|
|
213
|
+
}
|
|
214
|
+
const sourcePath = options.sourcePath ?? process.cwd();
|
|
215
|
+
return createCompiledMethodWizard(sourcePath, prompts, {
|
|
216
|
+
executionProfile: options.executionProfile,
|
|
217
|
+
baseMethodId: options.baseMethodId,
|
|
218
|
+
creationMode: options.creationMode,
|
|
219
|
+
preparationContext: options.preparationContext,
|
|
220
|
+
resolveExecutor: options.resolveExecutor,
|
|
221
|
+
runDraft: options.runDraft,
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
export async function createCompiledMethodWizard(sourcePath, prompts = clackMethodPrompts, options = {}) {
|
|
225
|
+
const creationMode = options.creationMode ?? await prompts.select({
|
|
226
|
+
message: "How do you want to create it?",
|
|
227
|
+
options: [
|
|
228
|
+
{
|
|
229
|
+
value: "draft-from-scratch",
|
|
230
|
+
label: "Draft a new Method from scratch (Recommended)",
|
|
231
|
+
hint: "Start from a neutral scaffold and let a local agent design a reusable Method for this kind of agent work",
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
value: "fork-existing",
|
|
235
|
+
label: "Fork an existing Method and edit stage guidance",
|
|
236
|
+
hint: "Copy an existing topology; choose this when the stages are right but their emphasis should change",
|
|
237
|
+
},
|
|
238
|
+
],
|
|
239
|
+
});
|
|
240
|
+
if (prompts.isCancel(creationMode))
|
|
241
|
+
return creationMode;
|
|
242
|
+
const creationModeValue = normalizeMethodCreationMode(creationMode);
|
|
243
|
+
const baseMethod = creationModeValue === "fork-existing"
|
|
244
|
+
? options.baseMethodId ?? await prompts.select({
|
|
245
|
+
message: "Which existing Method should Interf fork?",
|
|
246
|
+
options: listCompiledMethodChoices(sourcePath).map(formatMethodLabel),
|
|
247
|
+
})
|
|
248
|
+
: null;
|
|
249
|
+
if (prompts.isCancel(baseMethod))
|
|
250
|
+
return baseMethod;
|
|
251
|
+
const baseMethodId = typeof baseMethod === "string" ? baseMethod : null;
|
|
252
|
+
const resolvedBaseMethod = baseMethodId
|
|
253
|
+
? getCompiledMethod(baseMethodId, { sourcePath })
|
|
254
|
+
: null;
|
|
255
|
+
const rawName = await prompts.text({
|
|
256
|
+
message: "New Method name?",
|
|
257
|
+
placeholder: "customer-research",
|
|
258
|
+
validate: (value) => {
|
|
259
|
+
if (value.trim().length === 0)
|
|
260
|
+
return "Name is required";
|
|
261
|
+
const methodId = slugify(value);
|
|
262
|
+
if (!isMethodId(methodId))
|
|
263
|
+
return "Use letters, numbers, and dashes only";
|
|
264
|
+
if (listCompiledMethodChoices(sourcePath).some((method) => method.id === methodId)) {
|
|
265
|
+
return "That Method name already exists";
|
|
266
|
+
}
|
|
267
|
+
return undefined;
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
if (prompts.isCancel(rawName))
|
|
271
|
+
return rawName;
|
|
272
|
+
const methodId = slugify(rawName);
|
|
273
|
+
const label = rawName.trim();
|
|
274
|
+
const hint = await prompts.text({
|
|
275
|
+
message: "One-line Method description?",
|
|
276
|
+
placeholder: "Bias toward evidence-backed summaries and strong retrieval structure",
|
|
277
|
+
validate: (value) => (value.trim().length === 0 ? "Description is required" : undefined),
|
|
278
|
+
});
|
|
279
|
+
if (prompts.isCancel(hint))
|
|
280
|
+
return hint;
|
|
281
|
+
if (creationModeValue === "draft-from-scratch") {
|
|
282
|
+
let sourceFolderPath = options.preparationContext?.sourceFolderPath ?? null;
|
|
283
|
+
let matchedPreparation = options.preparationContext?.config ?? null;
|
|
284
|
+
if (!sourceFolderPath) {
|
|
285
|
+
const savedPreparations = listSourcePreparationConfigs(loadSourceFolderConfig(sourcePath));
|
|
286
|
+
if (savedPreparations.length > 0) {
|
|
287
|
+
const preparationChoice = await prompts.select({
|
|
288
|
+
message: "Which saved Preparation should shape this Method?",
|
|
289
|
+
options: [
|
|
290
|
+
...savedPreparations.map((preparation) => ({
|
|
291
|
+
value: preparation.name,
|
|
292
|
+
label: preparation.name,
|
|
293
|
+
hint: describeSavedPreparation(preparation),
|
|
294
|
+
})),
|
|
295
|
+
{
|
|
296
|
+
value: "__manual__",
|
|
297
|
+
label: "Enter folder path manually",
|
|
298
|
+
hint: "Use a folder that is not saved as a Preparation yet",
|
|
299
|
+
},
|
|
300
|
+
],
|
|
301
|
+
});
|
|
302
|
+
if (prompts.isCancel(preparationChoice))
|
|
303
|
+
return preparationChoice;
|
|
304
|
+
if (preparationChoice !== "__manual__") {
|
|
305
|
+
matchedPreparation = savedPreparations.find((preparation) => preparation.name === preparationChoice) ?? null;
|
|
306
|
+
sourceFolderPath = matchedPreparation
|
|
307
|
+
? resolveSourcePreparationPath(sourcePath, matchedPreparation)
|
|
308
|
+
: null;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
if (!sourceFolderPath) {
|
|
313
|
+
const sourceFolderPrompt = await promptMethodSourceFolder(sourcePath, prompts);
|
|
314
|
+
if (prompts.isCancel(sourceFolderPrompt))
|
|
315
|
+
return sourceFolderPrompt;
|
|
316
|
+
if (!sourceFolderPrompt)
|
|
317
|
+
return null;
|
|
318
|
+
sourceFolderPath = String(sourceFolderPrompt);
|
|
319
|
+
matchedPreparation = matchedPreparation ?? findMatchingPreparationConfig(sourcePath, sourceFolderPath);
|
|
320
|
+
}
|
|
321
|
+
const taskPrompt = await prompts.text({
|
|
322
|
+
message: "What should this Method prepare for agents, and what evidence should show the data is ready?",
|
|
323
|
+
placeholder: "Data: research interviews. Output: per-file summaries, themes, entities, claims, and source links. Evidence: every file processed, evidence linked to sources, required outputs created.",
|
|
324
|
+
validate: (value) => (value.trim().length === 0 ? "A description is required" : undefined),
|
|
325
|
+
});
|
|
326
|
+
if (prompts.isCancel(taskPrompt))
|
|
327
|
+
return taskPrompt;
|
|
328
|
+
if (matchedPreparation) {
|
|
329
|
+
prompts.log.info(`Shaping this Method from Preparation "${matchedPreparation.name}".`);
|
|
330
|
+
}
|
|
331
|
+
if (matchedPreparation?.checks.length) {
|
|
332
|
+
prompts.log.info(`Using ${matchedPreparation.checks.length} saved readiness check${matchedPreparation.checks.length === 1 ? "" : "s"} from Preparation "${matchedPreparation.name}" as authoring context.`);
|
|
333
|
+
}
|
|
334
|
+
prompts.log.info("Preparing a Method-authoring shell from the Source Folder, then drafting the package.");
|
|
335
|
+
let lastServiceStatus = "";
|
|
336
|
+
const serviceRun = await submitMethodAuthoringRunToLocalService({
|
|
337
|
+
projectPath: sourcePath,
|
|
338
|
+
request: {
|
|
339
|
+
preparation: matchedPreparation?.name ?? null,
|
|
340
|
+
source_folder_path: sourceFolderPath,
|
|
341
|
+
method_id: methodId,
|
|
342
|
+
label,
|
|
343
|
+
hint: hint.trim(),
|
|
344
|
+
task_prompt: taskPrompt.trim(),
|
|
345
|
+
checks: matchedPreparation?.checks ?? [],
|
|
346
|
+
},
|
|
347
|
+
onSubmitted: (submission) => {
|
|
348
|
+
prompts.log.info(`Visible in Interf: ${submission.serviceUrl}/`);
|
|
349
|
+
},
|
|
350
|
+
onUpdate: (job) => {
|
|
351
|
+
const activeStep = job.steps.find((step) => step.status === "running")
|
|
352
|
+
?? [...job.steps].reverse().find((step) => step.status === "succeeded" || step.status === "failed")
|
|
353
|
+
?? null;
|
|
354
|
+
const statusKey = `${job.status}:${activeStep?.id ?? ""}:${activeStep?.status ?? ""}`;
|
|
355
|
+
if (statusKey === lastServiceStatus)
|
|
356
|
+
return;
|
|
357
|
+
lastServiceStatus = statusKey;
|
|
358
|
+
prompts.log.info(activeStep
|
|
359
|
+
? `${activeStep.label}: ${activeStep.status}`
|
|
360
|
+
: `Method draft run: ${job.status}`);
|
|
361
|
+
},
|
|
362
|
+
});
|
|
363
|
+
const result = serviceRun
|
|
364
|
+
? serviceRun.result
|
|
365
|
+
? {
|
|
366
|
+
status: serviceRun.result.status,
|
|
367
|
+
changed: serviceRun.result.changed,
|
|
368
|
+
summary: serviceRun.result.summary,
|
|
369
|
+
validation: serviceRun.result.validation ?? null,
|
|
370
|
+
methodPath: serviceRun.result.method_path,
|
|
371
|
+
shellPath: serviceRun.result.shell_path,
|
|
372
|
+
}
|
|
373
|
+
: {
|
|
374
|
+
status: "executor-failed",
|
|
375
|
+
changed: false,
|
|
376
|
+
summary: serviceRun.error ?? "Method authoring failed in the local Interf service.",
|
|
377
|
+
validation: null,
|
|
378
|
+
methodPath: resolve(sourcePath, "interf", "methods", methodId),
|
|
379
|
+
shellPath: resolve(sourcePath, "interf", "methods", methodId),
|
|
380
|
+
}
|
|
381
|
+
: await (async () => {
|
|
382
|
+
const resolveExecutor = options.resolveExecutor ?? resolveOrConfigureLocalExecutor;
|
|
383
|
+
const runDraft = options.runDraft ?? runMethodAuthoringDraft;
|
|
384
|
+
const { executor, error } = await resolveExecutor({
|
|
385
|
+
executionProfile: options.executionProfile,
|
|
386
|
+
purpose: "method",
|
|
387
|
+
});
|
|
388
|
+
if (!executor && !error) {
|
|
389
|
+
return null;
|
|
390
|
+
}
|
|
391
|
+
if (!executor) {
|
|
392
|
+
process.exitCode = 1;
|
|
393
|
+
(prompts.log.error ?? prompts.log.info)(error ?? "No coding agent detected.");
|
|
394
|
+
return null;
|
|
395
|
+
}
|
|
396
|
+
return runDraft({
|
|
397
|
+
sourcePath,
|
|
398
|
+
sourceFolderPath,
|
|
399
|
+
methodId,
|
|
400
|
+
label,
|
|
401
|
+
hint: hint.trim(),
|
|
402
|
+
taskPrompt: taskPrompt.trim(),
|
|
403
|
+
checks: matchedPreparation?.checks ?? [],
|
|
404
|
+
executor,
|
|
405
|
+
onStatus: (line) => prompts.log.info(line),
|
|
406
|
+
});
|
|
407
|
+
})();
|
|
408
|
+
if (!result)
|
|
409
|
+
return null;
|
|
410
|
+
if (result.status === "updated") {
|
|
411
|
+
const draft = loadMethodDefinitionFromDir(result.methodPath);
|
|
412
|
+
const stageList = draft?.stages?.map((stage) => stage.id).join(" -> ") ?? "-";
|
|
413
|
+
prompts.log.info(`Draft ready at ${result.methodPath}`);
|
|
414
|
+
prompts.log.info(` Name: ${draft?.label ?? label}`);
|
|
415
|
+
prompts.log.info(` Description: ${draft?.hint ?? hint.trim()}`);
|
|
416
|
+
if (draft?.purpose)
|
|
417
|
+
prompts.log.info(` Purpose: ${draft.purpose}`);
|
|
418
|
+
prompts.log.info(` Stages: ${stageList}`);
|
|
419
|
+
const confirmChoice = await prompts.select({
|
|
420
|
+
message: "Save this Method?",
|
|
421
|
+
options: [
|
|
422
|
+
{ value: "save", label: "Save", hint: "Keep the draft as your new Method package" },
|
|
423
|
+
{ value: "cancel", label: "Discard", hint: "Remove the draft folder and exit without saving" },
|
|
424
|
+
],
|
|
425
|
+
});
|
|
426
|
+
if (prompts.isCancel(confirmChoice) || confirmChoice === "cancel") {
|
|
427
|
+
rmSync(result.methodPath, { recursive: true, force: true });
|
|
428
|
+
prompts.log.info(`Discarded draft at ${result.methodPath}`);
|
|
429
|
+
return null;
|
|
430
|
+
}
|
|
431
|
+
prompts.log.info(`Saved local Method: ${result.methodPath}`);
|
|
432
|
+
return methodId;
|
|
433
|
+
}
|
|
434
|
+
process.exitCode = 1;
|
|
435
|
+
(prompts.log.error ?? prompts.log.info)(result.status === "no-change"
|
|
436
|
+
? `${result.summary} Draft mode only succeeds when it produces an agent-work-specific package change.`
|
|
437
|
+
: result.summary);
|
|
438
|
+
prompts.log.info(`Method shell kept at: ${result.shellPath}`);
|
|
439
|
+
return null;
|
|
440
|
+
}
|
|
441
|
+
const stagePolicyNotes = {};
|
|
442
|
+
if (!baseMethodId || !resolvedBaseMethod) {
|
|
443
|
+
throw new Error("Fork-existing Method creation needs a base Method.");
|
|
444
|
+
}
|
|
445
|
+
for (const stage of resolvedBaseMethod.stages) {
|
|
446
|
+
const stagePrompt = await prompts.text({
|
|
447
|
+
message: `What should ${stage.id} (${stage.label}) emphasize?`,
|
|
448
|
+
placeholder: stage.description,
|
|
449
|
+
validate: (value) => (value.trim().length === 0 ? `${stage.label} guidance is required` : undefined),
|
|
450
|
+
});
|
|
451
|
+
if (prompts.isCancel(stagePrompt))
|
|
452
|
+
return stagePrompt;
|
|
453
|
+
stagePolicyNotes[stage.id] = [String(stagePrompt).trim()];
|
|
454
|
+
}
|
|
455
|
+
const methodPath = createLocalMethodPackageFromTemplate({
|
|
456
|
+
sourcePath,
|
|
457
|
+
baseMethodId,
|
|
458
|
+
methodId,
|
|
459
|
+
label,
|
|
460
|
+
hint: hint.trim(),
|
|
461
|
+
stagePolicyNotes,
|
|
462
|
+
});
|
|
463
|
+
prompts.log.info(`Saved local Method: ${methodPath}`);
|
|
464
|
+
return methodId;
|
|
465
|
+
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { CommandModule } from "yargs";
|
|
2
|
-
import type {
|
|
2
|
+
import type { MethodExecutionProfile } from "../../packages/agents/lib/executors.js";
|
|
3
3
|
export declare const createCommand: CommandModule;
|
|
4
4
|
export declare function createCompiledWizard(options?: {
|
|
5
5
|
intro?: boolean;
|
|
6
|
-
executionProfile?:
|
|
6
|
+
executionProfile?: MethodExecutionProfile;
|
|
7
7
|
}): Promise<void>;
|
|
8
|
-
export { type
|
|
8
|
+
export { type MethodWizardPrompts, formatMethodLabel, createMethodWizard, createCompiledMethodWizard, } from "./create-method-wizard.js";
|