@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,18 @@
|
|
|
1
|
+
import { type Server } from "node:http";
|
|
2
|
+
import { type LocalServiceRunHandlers, type LocalServiceRuntime } from "./runtime.js";
|
|
3
|
+
export interface StartLocalServiceOptions {
|
|
4
|
+
rootPath?: string;
|
|
5
|
+
host?: string;
|
|
6
|
+
port?: number;
|
|
7
|
+
packageVersion?: string;
|
|
8
|
+
handlers?: Partial<LocalServiceRunHandlers>;
|
|
9
|
+
}
|
|
10
|
+
export interface StartedLocalService {
|
|
11
|
+
runtime: LocalServiceRuntime;
|
|
12
|
+
server: Server;
|
|
13
|
+
url: string;
|
|
14
|
+
close(): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
export declare function resolveCompilerUiStaticRoot(rootPath?: string): string;
|
|
17
|
+
export declare function createLocalServiceServer(runtime: LocalServiceRuntime): Server;
|
|
18
|
+
export declare function startLocalService(options?: StartLocalServiceOptions): Promise<StartedLocalService>;
|
|
@@ -0,0 +1,577 @@
|
|
|
1
|
+
import { createServer } from "node:http";
|
|
2
|
+
import { spawn } from "node:child_process";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, statSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { dirname, extname, join, normalize, resolve, sep } from "node:path";
|
|
5
|
+
import { fileURLToPath } from "node:url";
|
|
6
|
+
import { LocalServiceConfigSchema, LocalServiceDiscoverySchema, LocalServiceInstancePointerSchema, OpenPathRequestSchema, RunCreateRequestSchema, } from "./lib/schema.js";
|
|
7
|
+
import { assertPathWithinRoot, } from "../shared/path-guards.js";
|
|
8
|
+
import { createLocalServiceRuntime, } from "./runtime.js";
|
|
9
|
+
import { LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, LOCAL_SERVICE_INSTANCE_POINTER_PATH, LOCAL_SERVICE_ROUTES, } from "./routes.js";
|
|
10
|
+
function packageRoot() {
|
|
11
|
+
return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
|
|
12
|
+
}
|
|
13
|
+
export function resolveCompilerUiStaticRoot(rootPath = packageRoot()) {
|
|
14
|
+
const distRoot = join(rootPath, "dist", "compiler-ui");
|
|
15
|
+
const sourceExportRoot = join(rootPath, "apps", "compiler-ui", "out");
|
|
16
|
+
if (existsSync(join(distRoot, "index.html")))
|
|
17
|
+
return distRoot;
|
|
18
|
+
if (existsSync(join(sourceExportRoot, "index.html")))
|
|
19
|
+
return sourceExportRoot;
|
|
20
|
+
return distRoot;
|
|
21
|
+
}
|
|
22
|
+
function compilerUiStaticRoot() {
|
|
23
|
+
const explicit = process.env.INTERF_COMPILER_UI_STATIC_ROOT?.trim();
|
|
24
|
+
if (explicit)
|
|
25
|
+
return resolve(explicit);
|
|
26
|
+
return resolveCompilerUiStaticRoot();
|
|
27
|
+
}
|
|
28
|
+
function localInstancePointerPath(rootPath) {
|
|
29
|
+
return join(rootPath, ...LOCAL_SERVICE_INSTANCE_POINTER_PATH);
|
|
30
|
+
}
|
|
31
|
+
function writeLocalInstancePointer(rootPath, pointer) {
|
|
32
|
+
const pointerPath = localInstancePointerPath(rootPath);
|
|
33
|
+
mkdirSync(dirname(pointerPath), { recursive: true });
|
|
34
|
+
const parsed = LocalServiceInstancePointerSchema.parse(pointer);
|
|
35
|
+
writeFileSync(pointerPath, `${JSON.stringify(parsed, null, 2)}\n`);
|
|
36
|
+
}
|
|
37
|
+
function removeLocalInstancePointer(rootPath, serviceUrl) {
|
|
38
|
+
const pointerPath = localInstancePointerPath(rootPath);
|
|
39
|
+
if (!existsSync(pointerPath))
|
|
40
|
+
return;
|
|
41
|
+
try {
|
|
42
|
+
const pointer = LocalServiceInstancePointerSchema.parse(JSON.parse(readFileSync(pointerPath, "utf8")));
|
|
43
|
+
if (pointer.service_url !== serviceUrl || pointer.pid !== process.pid)
|
|
44
|
+
return;
|
|
45
|
+
rmSync(pointerPath, { force: true });
|
|
46
|
+
}
|
|
47
|
+
catch {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
function contentType(filePath) {
|
|
52
|
+
switch (extname(filePath)) {
|
|
53
|
+
case ".html":
|
|
54
|
+
return "text/html; charset=utf-8";
|
|
55
|
+
case ".js":
|
|
56
|
+
return "text/javascript; charset=utf-8";
|
|
57
|
+
case ".css":
|
|
58
|
+
return "text/css; charset=utf-8";
|
|
59
|
+
case ".json":
|
|
60
|
+
return "application/json; charset=utf-8";
|
|
61
|
+
case ".svg":
|
|
62
|
+
return "image/svg+xml";
|
|
63
|
+
case ".png":
|
|
64
|
+
return "image/png";
|
|
65
|
+
case ".ico":
|
|
66
|
+
return "image/x-icon";
|
|
67
|
+
case ".txt":
|
|
68
|
+
return "text/plain; charset=utf-8";
|
|
69
|
+
case ".map":
|
|
70
|
+
return "application/json; charset=utf-8";
|
|
71
|
+
case ".webmanifest":
|
|
72
|
+
return "application/manifest+json; charset=utf-8";
|
|
73
|
+
case ".woff2":
|
|
74
|
+
return "font/woff2";
|
|
75
|
+
default:
|
|
76
|
+
return "application/octet-stream";
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function writeHeaders(res, statusCode, headers = {}) {
|
|
80
|
+
res.writeHead(statusCode, {
|
|
81
|
+
"access-control-allow-origin": "*",
|
|
82
|
+
"access-control-allow-methods": "GET,POST,PATCH,OPTIONS",
|
|
83
|
+
"access-control-allow-headers": "content-type",
|
|
84
|
+
...headers,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
function sendJson(res, statusCode, value) {
|
|
88
|
+
writeHeaders(res, statusCode, {
|
|
89
|
+
"content-type": "application/json; charset=utf-8",
|
|
90
|
+
});
|
|
91
|
+
res.end(`${JSON.stringify(value, null, 2)}\n`);
|
|
92
|
+
}
|
|
93
|
+
function sendText(res, statusCode, value) {
|
|
94
|
+
writeHeaders(res, statusCode, {
|
|
95
|
+
"content-type": "text/plain; charset=utf-8",
|
|
96
|
+
});
|
|
97
|
+
res.end(value);
|
|
98
|
+
}
|
|
99
|
+
function sendError(res, statusCode, message) {
|
|
100
|
+
sendJson(res, statusCode, {
|
|
101
|
+
error: {
|
|
102
|
+
message,
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
function resolveOpenPath(allowedRoots, pathValue) {
|
|
107
|
+
const roots = allowedRoots.map((root) => resolve(root));
|
|
108
|
+
const targetPath = resolve(pathValue);
|
|
109
|
+
for (const root of roots) {
|
|
110
|
+
try {
|
|
111
|
+
return assertPathWithinRoot(root, targetPath, "Open path");
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
throw new Error(`Open path must stay inside ${roots.join(" or ")}: ${targetPath}`);
|
|
118
|
+
}
|
|
119
|
+
async function openLocalPath(allowedRoots, pathValue) {
|
|
120
|
+
const targetPath = resolveOpenPath(allowedRoots, pathValue);
|
|
121
|
+
if (!existsSync(targetPath)) {
|
|
122
|
+
throw new Error(`Path does not exist: ${targetPath}`);
|
|
123
|
+
}
|
|
124
|
+
if (process.env.INTERF_OPEN_PATH_DRY_RUN === "1") {
|
|
125
|
+
return targetPath;
|
|
126
|
+
}
|
|
127
|
+
const isDirectory = statSync(targetPath).isDirectory();
|
|
128
|
+
const command = process.platform === "darwin"
|
|
129
|
+
? "open"
|
|
130
|
+
: process.platform === "win32"
|
|
131
|
+
? "explorer.exe"
|
|
132
|
+
: "xdg-open";
|
|
133
|
+
const args = process.platform === "darwin"
|
|
134
|
+
? (isDirectory ? [targetPath] : ["-R", targetPath])
|
|
135
|
+
: process.platform === "win32"
|
|
136
|
+
? (isDirectory ? [targetPath] : ["/select,", targetPath])
|
|
137
|
+
: [isDirectory ? targetPath : dirname(targetPath)];
|
|
138
|
+
await new Promise((resolveOpen, rejectOpen) => {
|
|
139
|
+
const child = spawn(command, args, {
|
|
140
|
+
detached: true,
|
|
141
|
+
stdio: "ignore",
|
|
142
|
+
});
|
|
143
|
+
child.once("error", rejectOpen);
|
|
144
|
+
child.once("spawn", () => {
|
|
145
|
+
child.unref();
|
|
146
|
+
resolveOpen();
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
return targetPath;
|
|
150
|
+
}
|
|
151
|
+
function parseRequestUrl(req) {
|
|
152
|
+
return new URL(req.url ?? "/", "http://127.0.0.1");
|
|
153
|
+
}
|
|
154
|
+
function safeStaticPath(root, relativePath) {
|
|
155
|
+
const normalized = normalize(relativePath).replace(/^(\.\.(?:\/|\\|$))+/, "");
|
|
156
|
+
const absolute = resolve(root, normalized);
|
|
157
|
+
const resolvedRoot = resolve(root);
|
|
158
|
+
if (absolute !== resolvedRoot && !absolute.startsWith(`${resolvedRoot}${sep}`)) {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
return absolute;
|
|
162
|
+
}
|
|
163
|
+
function sendFile(res, filePath) {
|
|
164
|
+
if (!existsSync(filePath))
|
|
165
|
+
return false;
|
|
166
|
+
try {
|
|
167
|
+
if (!statSync(filePath).isFile())
|
|
168
|
+
return false;
|
|
169
|
+
writeHeaders(res, 200, {
|
|
170
|
+
"content-type": contentType(filePath),
|
|
171
|
+
});
|
|
172
|
+
res.end(readFileSync(filePath));
|
|
173
|
+
return true;
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
function sendCompilerUiAsset(req, res, _runtime) {
|
|
180
|
+
const staticRoot = compilerUiStaticRoot();
|
|
181
|
+
const url = parseRequestUrl(req);
|
|
182
|
+
if (url.pathname === "/") {
|
|
183
|
+
const indexPath = join(staticRoot, "index.html");
|
|
184
|
+
if (sendFile(res, indexPath))
|
|
185
|
+
return true;
|
|
186
|
+
sendText(res, 503, "Interf UI assets are missing. Run `npm run web:build`, then restart `interf web`.\n");
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
if (url.pathname.startsWith("/_next/static/")) {
|
|
190
|
+
const relativePath = url.pathname.slice("/_next/static/".length);
|
|
191
|
+
const assetPath = safeStaticPath(join(staticRoot, "_next", "static"), relativePath);
|
|
192
|
+
if (assetPath && sendFile(res, assetPath))
|
|
193
|
+
return true;
|
|
194
|
+
}
|
|
195
|
+
const assetPath = safeStaticPath(staticRoot, url.pathname.slice(1));
|
|
196
|
+
if (assetPath && sendFile(res, assetPath))
|
|
197
|
+
return true;
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
async function readJsonBody(req) {
|
|
201
|
+
const chunks = [];
|
|
202
|
+
for await (const chunk of req) {
|
|
203
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
204
|
+
}
|
|
205
|
+
const raw = Buffer.concat(chunks).toString("utf8").trim();
|
|
206
|
+
if (!raw)
|
|
207
|
+
return {};
|
|
208
|
+
return JSON.parse(raw);
|
|
209
|
+
}
|
|
210
|
+
async function routeApi(req, res, runtime) {
|
|
211
|
+
const url = parseRequestUrl(req);
|
|
212
|
+
const path = url.pathname;
|
|
213
|
+
const method = req.method ?? "GET";
|
|
214
|
+
if (method === "OPTIONS") {
|
|
215
|
+
writeHeaders(res, 204);
|
|
216
|
+
res.end();
|
|
217
|
+
return true;
|
|
218
|
+
}
|
|
219
|
+
if (method === "GET" && path === "/health") {
|
|
220
|
+
sendJson(res, 200, runtime.health());
|
|
221
|
+
return true;
|
|
222
|
+
}
|
|
223
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.api) {
|
|
224
|
+
sendJson(res, 200, LocalServiceDiscoverySchema.parse({
|
|
225
|
+
kind: "interf-local-service-discovery",
|
|
226
|
+
version: 1,
|
|
227
|
+
resources: {
|
|
228
|
+
preparations: LOCAL_SERVICE_ROUTES.preparations,
|
|
229
|
+
methods: LOCAL_SERVICE_ROUTES.methods,
|
|
230
|
+
runs: LOCAL_SERVICE_ROUTES.runs,
|
|
231
|
+
readiness: LOCAL_SERVICE_ROUTES.readiness,
|
|
232
|
+
portable_contexts: LOCAL_SERVICE_ROUTES.portableContexts,
|
|
233
|
+
source_files: LOCAL_SERVICE_ROUTES.sourceFiles,
|
|
234
|
+
workspace_files: LOCAL_SERVICE_ROUTES.workspaceFiles,
|
|
235
|
+
action_proposals: LOCAL_SERVICE_ROUTES.actionProposals,
|
|
236
|
+
executor: LOCAL_SERVICE_ROUTES.executor,
|
|
237
|
+
},
|
|
238
|
+
}));
|
|
239
|
+
return true;
|
|
240
|
+
}
|
|
241
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.preparations) {
|
|
242
|
+
sendJson(res, 200, { preparations: runtime.listPreparations() });
|
|
243
|
+
return true;
|
|
244
|
+
}
|
|
245
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.workspaceFiles) {
|
|
246
|
+
sendJson(res, 200, { workspace_files: runtime.listWorkspaceFiles() });
|
|
247
|
+
return true;
|
|
248
|
+
}
|
|
249
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.readiness) {
|
|
250
|
+
sendJson(res, 200, { readiness: runtime.listPreparationReadiness() });
|
|
251
|
+
return true;
|
|
252
|
+
}
|
|
253
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.sourceFiles) {
|
|
254
|
+
const preparation = url.searchParams.get("preparation");
|
|
255
|
+
sendJson(res, 200, { source_files: runtime.listSourceFiles(preparation) });
|
|
256
|
+
return true;
|
|
257
|
+
}
|
|
258
|
+
if (method === "POST" && path === LOCAL_SERVICE_ROUTES.openPath) {
|
|
259
|
+
const body = OpenPathRequestSchema.parse(await readJsonBody(req));
|
|
260
|
+
const health = runtime.health();
|
|
261
|
+
const allowedRoots = [
|
|
262
|
+
runtime.rootPath,
|
|
263
|
+
...(health.source_folder_path ? [health.source_folder_path] : []),
|
|
264
|
+
];
|
|
265
|
+
const openedPath = await openLocalPath(allowedRoots, body.path);
|
|
266
|
+
sendJson(res, 202, { opened: true, path: openedPath });
|
|
267
|
+
return true;
|
|
268
|
+
}
|
|
269
|
+
const preparationMatch = path.match(/^\/v1\/preparations\/([^/]+)$/);
|
|
270
|
+
if (method === "GET" && preparationMatch?.[1]) {
|
|
271
|
+
const preparation = runtime.getPreparation(decodeURIComponent(preparationMatch[1]));
|
|
272
|
+
if (!preparation)
|
|
273
|
+
sendError(res, 404, "Preparation not found.");
|
|
274
|
+
else
|
|
275
|
+
sendJson(res, 200, preparation);
|
|
276
|
+
return true;
|
|
277
|
+
}
|
|
278
|
+
const preparationReadinessMatch = path.match(/^\/v1\/preparations\/([^/]+)\/readiness$/);
|
|
279
|
+
if (method === "GET" && preparationReadinessMatch?.[1]) {
|
|
280
|
+
const readiness = runtime.getPreparationReadiness(decodeURIComponent(preparationReadinessMatch[1]));
|
|
281
|
+
if (!readiness)
|
|
282
|
+
sendError(res, 404, "Preparation not found.");
|
|
283
|
+
else
|
|
284
|
+
sendJson(res, 200, readiness);
|
|
285
|
+
return true;
|
|
286
|
+
}
|
|
287
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.methods) {
|
|
288
|
+
sendJson(res, 200, { methods: runtime.listMethods() });
|
|
289
|
+
return true;
|
|
290
|
+
}
|
|
291
|
+
const methodMatch = path.match(/^\/v1\/methods\/([^/]+)$/);
|
|
292
|
+
if (method === "GET" && methodMatch?.[1]) {
|
|
293
|
+
const methodResource = runtime.getMethod(decodeURIComponent(methodMatch[1]));
|
|
294
|
+
if (!methodResource)
|
|
295
|
+
sendError(res, 404, "Method not found.");
|
|
296
|
+
else
|
|
297
|
+
sendJson(res, 200, methodResource);
|
|
298
|
+
return true;
|
|
299
|
+
}
|
|
300
|
+
if (method === "GET" && path === "/v1/jobs") {
|
|
301
|
+
sendJson(res, 200, { jobs: runtime.listJobs() });
|
|
302
|
+
return true;
|
|
303
|
+
}
|
|
304
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.executor) {
|
|
305
|
+
sendJson(res, 200, runtime.getExecutorStatus());
|
|
306
|
+
return true;
|
|
307
|
+
}
|
|
308
|
+
if (method === "POST" && path === LOCAL_SERVICE_ROUTES.executor) {
|
|
309
|
+
const body = await readJsonBody(req);
|
|
310
|
+
sendJson(res, 202, runtime.selectExecutor(body));
|
|
311
|
+
return true;
|
|
312
|
+
}
|
|
313
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.actionProposals) {
|
|
314
|
+
sendJson(res, 200, { action_proposals: runtime.listActionProposals() });
|
|
315
|
+
return true;
|
|
316
|
+
}
|
|
317
|
+
if (method === "POST" && path === LOCAL_SERVICE_ROUTES.actionProposals) {
|
|
318
|
+
const body = await readJsonBody(req);
|
|
319
|
+
sendJson(res, 202, await runtime.createActionProposal(body));
|
|
320
|
+
return true;
|
|
321
|
+
}
|
|
322
|
+
const actionProposalMatch = path.match(/^\/v1\/action-proposals\/([^/]+)(?:\/([^/]+))?$/);
|
|
323
|
+
if (actionProposalMatch?.[1]) {
|
|
324
|
+
const proposalId = decodeURIComponent(actionProposalMatch[1]);
|
|
325
|
+
const child = actionProposalMatch[2];
|
|
326
|
+
if (method === "GET" && !child) {
|
|
327
|
+
const proposal = runtime.getActionProposal(proposalId);
|
|
328
|
+
if (!proposal)
|
|
329
|
+
sendError(res, 404, "Action proposal not found.");
|
|
330
|
+
else
|
|
331
|
+
sendJson(res, 200, proposal);
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
334
|
+
if (method === "POST" && child === "decision") {
|
|
335
|
+
const body = await readJsonBody(req);
|
|
336
|
+
const proposal = await runtime.decideActionProposal(proposalId, body);
|
|
337
|
+
if (!proposal)
|
|
338
|
+
sendError(res, 404, "Action proposal not found.");
|
|
339
|
+
else
|
|
340
|
+
sendJson(res, 202, proposal);
|
|
341
|
+
return true;
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.runs) {
|
|
345
|
+
sendJson(res, 200, { runs: runtime.listRunObservability() });
|
|
346
|
+
return true;
|
|
347
|
+
}
|
|
348
|
+
if (method === "POST" && path === LOCAL_SERVICE_ROUTES.runs) {
|
|
349
|
+
const request = RunCreateRequestSchema.parse(await readJsonBody(req));
|
|
350
|
+
if (request.run_type === "compile" || request.run_type === "prepare") {
|
|
351
|
+
const { run_type: _ignoredRunType, ...compileRequest } = request;
|
|
352
|
+
const resource = await runtime.createCompileRun(compileRequest);
|
|
353
|
+
sendJson(res, 202, runtime.getRunObservability(resource.run.run_id) ?? resource);
|
|
354
|
+
return true;
|
|
355
|
+
}
|
|
356
|
+
const { run_type: _ignoredRunType, ...testRequest } = request;
|
|
357
|
+
const resource = await runtime.createTestRun(testRequest);
|
|
358
|
+
sendJson(res, 202, runtime.getRunObservability(resource.run_id) ?? resource);
|
|
359
|
+
return true;
|
|
360
|
+
}
|
|
361
|
+
const observableRunMatch = path.match(/^\/v1\/runs\/([^/]+)$/);
|
|
362
|
+
if (method === "GET" && observableRunMatch?.[1]) {
|
|
363
|
+
const run = runtime.getRunObservability(decodeURIComponent(observableRunMatch[1]));
|
|
364
|
+
if (!run)
|
|
365
|
+
sendError(res, 404, "Run not found.");
|
|
366
|
+
else
|
|
367
|
+
sendJson(res, 200, run);
|
|
368
|
+
return true;
|
|
369
|
+
}
|
|
370
|
+
if (method === "POST" && path === "/v1/jobs") {
|
|
371
|
+
const body = await readJsonBody(req);
|
|
372
|
+
sendJson(res, 202, runtime.createJobRun(body));
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
375
|
+
const jobMatch = path.match(/^\/v1\/jobs\/([^/]+)(?:\/([^/]+))?$/);
|
|
376
|
+
if (jobMatch?.[1]) {
|
|
377
|
+
const runId = decodeURIComponent(jobMatch[1]);
|
|
378
|
+
const child = jobMatch[2];
|
|
379
|
+
if (method === "GET" && !child) {
|
|
380
|
+
const job = runtime.getJob(runId);
|
|
381
|
+
if (!job)
|
|
382
|
+
sendError(res, 404, "Job run not found.");
|
|
383
|
+
else
|
|
384
|
+
sendJson(res, 200, job);
|
|
385
|
+
return true;
|
|
386
|
+
}
|
|
387
|
+
if (method === "GET" && child === "events") {
|
|
388
|
+
const events = runtime.getJobEvents(runId);
|
|
389
|
+
if (!events)
|
|
390
|
+
sendError(res, 404, "Job run not found.");
|
|
391
|
+
else
|
|
392
|
+
sendJson(res, 200, { events });
|
|
393
|
+
return true;
|
|
394
|
+
}
|
|
395
|
+
if (method === "POST" && child === "events") {
|
|
396
|
+
const body = await readJsonBody(req);
|
|
397
|
+
const job = runtime.appendJobRunEvent(runId, body);
|
|
398
|
+
if (!job)
|
|
399
|
+
sendError(res, 404, "Job run not found.");
|
|
400
|
+
else
|
|
401
|
+
sendJson(res, 202, job);
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
if (method === "POST" && path === "/v1/readiness-check-drafts") {
|
|
406
|
+
const body = await readJsonBody(req);
|
|
407
|
+
const job = await runtime.createReadinessCheckDraftRun(body);
|
|
408
|
+
sendJson(res, 202, job);
|
|
409
|
+
return true;
|
|
410
|
+
}
|
|
411
|
+
if (method === "POST" &&
|
|
412
|
+
path === LOCAL_SERVICE_ROUTES.methodAuthoringRuns) {
|
|
413
|
+
const body = await readJsonBody(req);
|
|
414
|
+
const job = await runtime.createMethodAuthoringRun(body);
|
|
415
|
+
sendJson(res, 202, job);
|
|
416
|
+
return true;
|
|
417
|
+
}
|
|
418
|
+
if (method === "GET" && path === "/v1/compile-runs") {
|
|
419
|
+
sendJson(res, 200, { compile_runs: runtime.listCompileRuns() });
|
|
420
|
+
return true;
|
|
421
|
+
}
|
|
422
|
+
if (method === "POST" && path === "/v1/compile-runs") {
|
|
423
|
+
const body = await readJsonBody(req);
|
|
424
|
+
const resource = await runtime.createCompileRun(body);
|
|
425
|
+
sendJson(res, 202, resource);
|
|
426
|
+
return true;
|
|
427
|
+
}
|
|
428
|
+
const compileRunMatch = path.match(/^\/v1\/compile-runs\/([^/]+)(?:\/([^/]+))?$/);
|
|
429
|
+
if (compileRunMatch?.[1]) {
|
|
430
|
+
const runId = decodeURIComponent(compileRunMatch[1]);
|
|
431
|
+
const child = compileRunMatch[2];
|
|
432
|
+
if (method === "GET" && !child) {
|
|
433
|
+
const run = runtime.getCompileRun(runId);
|
|
434
|
+
if (!run)
|
|
435
|
+
sendError(res, 404, "Compile run not found.");
|
|
436
|
+
else
|
|
437
|
+
sendJson(res, 200, run);
|
|
438
|
+
return true;
|
|
439
|
+
}
|
|
440
|
+
if (method === "GET" && child === "events") {
|
|
441
|
+
const events = runtime.getCompileRunEvents(runId);
|
|
442
|
+
if (!events)
|
|
443
|
+
sendError(res, 404, "Compile run not found.");
|
|
444
|
+
else
|
|
445
|
+
sendJson(res, 200, { events });
|
|
446
|
+
return true;
|
|
447
|
+
}
|
|
448
|
+
if (method === "GET" && child === "proof") {
|
|
449
|
+
const proof = runtime.getCompileRunProof(runId);
|
|
450
|
+
if (!proof)
|
|
451
|
+
sendError(res, 404, "Compile run not found.");
|
|
452
|
+
else
|
|
453
|
+
sendJson(res, 200, { proof });
|
|
454
|
+
return true;
|
|
455
|
+
}
|
|
456
|
+
if (method === "GET" && child === "artifacts") {
|
|
457
|
+
const artifacts = runtime.getCompileRunArtifacts(runId);
|
|
458
|
+
if (!artifacts)
|
|
459
|
+
sendError(res, 404, "Compile run not found.");
|
|
460
|
+
else
|
|
461
|
+
sendJson(res, 200, { artifacts });
|
|
462
|
+
return true;
|
|
463
|
+
}
|
|
464
|
+
if (method === "POST" && child === "cancel") {
|
|
465
|
+
sendError(res, 501, "Compile-run cancellation is not implemented yet.");
|
|
466
|
+
return true;
|
|
467
|
+
}
|
|
468
|
+
}
|
|
469
|
+
if (method === "GET" && path === "/v1/test-runs") {
|
|
470
|
+
sendJson(res, 200, { test_runs: runtime.listTestRuns() });
|
|
471
|
+
return true;
|
|
472
|
+
}
|
|
473
|
+
if (method === "POST" && path === "/v1/test-runs") {
|
|
474
|
+
const body = await readJsonBody(req);
|
|
475
|
+
const resource = await runtime.createTestRun(body);
|
|
476
|
+
sendJson(res, 202, resource);
|
|
477
|
+
return true;
|
|
478
|
+
}
|
|
479
|
+
const testRunMatch = path.match(/^\/v1\/test-runs\/([^/]+)$/);
|
|
480
|
+
if (method === "GET" && testRunMatch?.[1]) {
|
|
481
|
+
const run = runtime.getTestRun(decodeURIComponent(testRunMatch[1]));
|
|
482
|
+
if (!run)
|
|
483
|
+
sendError(res, 404, "Readiness check run not found.");
|
|
484
|
+
else
|
|
485
|
+
sendJson(res, 200, run);
|
|
486
|
+
return true;
|
|
487
|
+
}
|
|
488
|
+
if (method === "GET" && path === "/v1/portable-contexts") {
|
|
489
|
+
sendJson(res, 200, { portable_contexts: runtime.listPortableContexts() });
|
|
490
|
+
return true;
|
|
491
|
+
}
|
|
492
|
+
const portableContextMatch = path.match(/^\/v1\/portable-contexts\/([^/]+)$/);
|
|
493
|
+
if (method === "GET" && portableContextMatch?.[1]) {
|
|
494
|
+
const context = runtime.getPortableContext(decodeURIComponent(portableContextMatch[1]));
|
|
495
|
+
if (!context)
|
|
496
|
+
sendError(res, 404, "Portable context not found.");
|
|
497
|
+
else
|
|
498
|
+
sendJson(res, 200, context);
|
|
499
|
+
return true;
|
|
500
|
+
}
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
export function createLocalServiceServer(runtime) {
|
|
504
|
+
return createServer((req, res) => {
|
|
505
|
+
void (async () => {
|
|
506
|
+
try {
|
|
507
|
+
const routed = await routeApi(req, res, runtime);
|
|
508
|
+
if (routed)
|
|
509
|
+
return;
|
|
510
|
+
if (sendCompilerUiAsset(req, res, runtime))
|
|
511
|
+
return;
|
|
512
|
+
sendText(res, 404, "Not found.\n");
|
|
513
|
+
}
|
|
514
|
+
catch (error) {
|
|
515
|
+
sendError(res, 500, error instanceof Error ? error.message : String(error));
|
|
516
|
+
}
|
|
517
|
+
})();
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
function resolvePort(optionPort) {
|
|
521
|
+
if (typeof optionPort === "number")
|
|
522
|
+
return optionPort;
|
|
523
|
+
const envPort = Number.parseInt(process.env.INTERF_SERVICE_PORT ?? "", 10);
|
|
524
|
+
return Number.isInteger(envPort) ? envPort : LOCAL_SERVICE_DEFAULT_PORT;
|
|
525
|
+
}
|
|
526
|
+
export async function startLocalService(options = {}) {
|
|
527
|
+
const config = LocalServiceConfigSchema.parse({
|
|
528
|
+
host: options.host ?? process.env.INTERF_SERVICE_HOST ?? LOCAL_SERVICE_DEFAULT_HOST,
|
|
529
|
+
port: resolvePort(options.port),
|
|
530
|
+
});
|
|
531
|
+
const rootPath = options.rootPath ?? process.cwd();
|
|
532
|
+
const runtime = createLocalServiceRuntime({
|
|
533
|
+
rootPath,
|
|
534
|
+
host: config.host,
|
|
535
|
+
port: config.port,
|
|
536
|
+
packageVersion: options.packageVersion,
|
|
537
|
+
handlers: options.handlers,
|
|
538
|
+
});
|
|
539
|
+
const server = createLocalServiceServer(runtime);
|
|
540
|
+
await new Promise((resolveListen, rejectListen) => {
|
|
541
|
+
const onError = (error) => {
|
|
542
|
+
server.off("listening", onListening);
|
|
543
|
+
rejectListen(error);
|
|
544
|
+
};
|
|
545
|
+
const onListening = () => {
|
|
546
|
+
server.off("error", onError);
|
|
547
|
+
resolveListen();
|
|
548
|
+
};
|
|
549
|
+
server.once("error", onError);
|
|
550
|
+
server.once("listening", onListening);
|
|
551
|
+
server.listen(config.port, config.host);
|
|
552
|
+
});
|
|
553
|
+
const url = runtime.health().service_url;
|
|
554
|
+
writeLocalInstancePointer(rootPath, {
|
|
555
|
+
service_url: url,
|
|
556
|
+
host: config.host,
|
|
557
|
+
port: config.port,
|
|
558
|
+
pid: process.pid,
|
|
559
|
+
control_path: resolve(rootPath),
|
|
560
|
+
started_at: new Date().toISOString(),
|
|
561
|
+
});
|
|
562
|
+
return {
|
|
563
|
+
runtime,
|
|
564
|
+
server,
|
|
565
|
+
url,
|
|
566
|
+
close: () => new Promise((resolveClose, rejectClose) => {
|
|
567
|
+
server.close((error) => {
|
|
568
|
+
if (error) {
|
|
569
|
+
rejectClose(error);
|
|
570
|
+
return;
|
|
571
|
+
}
|
|
572
|
+
removeLocalInstancePointer(rootPath, url);
|
|
573
|
+
resolveClose();
|
|
574
|
+
});
|
|
575
|
+
}),
|
|
576
|
+
};
|
|
577
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export declare function copyDirectory(sourcePath: string, targetPath: string): void;
|
|
2
2
|
export declare function directoriesMatch(leftPath: string, rightPath: string): boolean;
|
|
3
|
-
export interface
|
|
3
|
+
export interface MethodEditShellArtifacts {
|
|
4
4
|
rootPath: string;
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
methodBeforePath: string;
|
|
6
|
+
methodAfterPath: string;
|
|
7
7
|
promptLogPath: string;
|
|
8
8
|
eventLogPath: string;
|
|
9
9
|
statusLogPath: string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
+
import { validateMethodPackage } from "../method-package/local-methods.js";
|
|
3
|
+
import type { SourceReadinessCheck } from "../project-model/lib/schema.js";
|
|
4
|
+
export interface MethodAuthoringRunResult {
|
|
5
|
+
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
6
|
+
changed: boolean;
|
|
7
|
+
summary: string;
|
|
8
|
+
validation: ReturnType<typeof validateMethodPackage> | null;
|
|
9
|
+
methodPath: string;
|
|
10
|
+
shellPath: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function runMethodAuthoringDraft(options: {
|
|
13
|
+
sourcePath: string;
|
|
14
|
+
sourceFolderPath: string;
|
|
15
|
+
baseMethodId?: string;
|
|
16
|
+
methodId: string;
|
|
17
|
+
label: string;
|
|
18
|
+
hint: string;
|
|
19
|
+
taskPrompt: string;
|
|
20
|
+
checks?: SourceReadinessCheck[];
|
|
21
|
+
executor: MethodExecutor;
|
|
22
|
+
onStatus?: (line: string) => void;
|
|
23
|
+
}): Promise<MethodAuthoringRunResult>;
|
|
24
|
+
export declare function resolveMethodDraftPath(sourcePath: string, methodId: string): string;
|