@interf/compiler 0.21.0 → 0.22.2
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 +65 -63
- package/dist/cli/commands/build-plan.d.ts +2 -0
- package/dist/cli/commands/{method.js → build-plan.js} +89 -72
- package/dist/cli/commands/{compile.d.ts → build.d.ts} +2 -2
- package/dist/cli/commands/{compile.js → build.js} +18 -18
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/mcp.js +48 -48
- package/dist/cli/commands/prep.js +16 -29
- package/dist/cli/commands/reset.d.ts +1 -1
- package/dist/cli/commands/reset.js +6 -6
- package/dist/cli/commands/runs.js +6 -28
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/test.d.ts +1 -1
- package/dist/cli/commands/test.js +8 -8
- package/dist/cli/commands/web.js +3 -3
- package/dist/cli/commands/wizard.js +38 -38
- package/dist/cli/index.d.ts +3 -3
- package/dist/cli/index.js +5 -5
- package/dist/interf-ui/404.html +1 -0
- package/dist/interf-ui/__next.__PAGE__.txt +10 -0
- package/dist/interf-ui/__next._full.txt +20 -0
- package/dist/interf-ui/__next._head.txt +5 -0
- package/dist/interf-ui/__next._index.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/__next._tree.txt +3 -4
- package/dist/interf-ui/_next/static/chunks/0.tjb6f4golw..css +3 -0
- package/dist/interf-ui/_next/static/chunks/085-n_jv2ng_q.css +1 -0
- package/dist/interf-ui/_next/static/chunks/0dn41fa_zvgsl.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0g-ea0zj5d-0k.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0gwqglc4iz583.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0haldgm65ve6l.js +1 -0
- package/dist/interf-ui/_next/static/chunks/0nv3am99vjzn4.js +1 -0
- package/dist/{compiler-ui/_next/static/chunks/02f_.8.ebn556.js → interf-ui/_next/static/chunks/0s77gt_o4jwtx.js} +1 -1
- package/dist/interf-ui/_next/static/chunks/0~a36ujuzpaz..js +116 -0
- package/dist/interf-ui/_next/static/chunks/10jeodxe4nkgj.js +31 -0
- package/dist/interf-ui/_next/static/chunks/119h2rouych2t.js +1 -0
- package/dist/interf-ui/_next/static/chunks/13c8b~m8knjsf.js +1 -0
- package/dist/interf-ui/_next/static/chunks/14dznb2qpt-ho.js +91 -0
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +5 -0
- package/dist/{compiler-ui/_next/static/chunks/turbopack-0apv8vb-nczuy.js → interf-ui/_next/static/chunks/turbopack-0p.pvcjrtq-jh.js} +1 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-0usj_75.8frlw.js +1 -0
- package/dist/interf-ui/_not-found/__next._full.txt +15 -0
- package/dist/interf-ui/_not-found/__next._head.txt +5 -0
- package/dist/interf-ui/_not-found/__next._index.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._not-found.__PAGE__.txt +2 -2
- package/dist/interf-ui/_not-found/__next._not-found.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._tree.txt +2 -3
- package/dist/interf-ui/_not-found.html +1 -0
- package/dist/interf-ui/_not-found.txt +15 -0
- package/dist/interf-ui/index.html +1 -0
- package/dist/interf-ui/index.txt +20 -0
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +36 -0
- package/dist/packages/{methods/authoring/method-authoring.js → build-plans/authoring/build-plan-authoring.js} +52 -52
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +18 -0
- package/dist/packages/{methods/authoring/method-edit-session.js → build-plans/authoring/build-plan-edit-session.js} +34 -34
- package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +23 -0
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +216 -0
- package/dist/packages/build-plans/authoring/index.d.ts +4 -0
- package/dist/packages/build-plans/authoring/index.js +4 -0
- package/dist/packages/{methods/authoring/lib/method-edit-utils.d.ts → build-plans/authoring/lib/build-plan-edit-utils.d.ts} +3 -3
- package/dist/packages/build-plans/build-plan-resolution.d.ts +6 -0
- package/dist/packages/build-plans/build-plan-resolution.js +7 -0
- package/dist/packages/build-plans/index.d.ts +2 -0
- package/dist/packages/build-plans/index.js +2 -0
- package/dist/packages/build-plans/package/build-plan-definitions.d.ts +61 -0
- package/dist/packages/build-plans/package/build-plan-definitions.js +214 -0
- package/dist/packages/{methods/package/method-helpers.d.ts → build-plans/package/build-plan-helpers.d.ts} +7 -7
- package/dist/packages/{methods/package/method-helpers.js → build-plans/package/build-plan-helpers.js} +20 -20
- package/dist/packages/build-plans/package/build-plan-review-paths.d.ts +10 -0
- package/dist/packages/build-plans/package/build-plan-review-paths.js +31 -0
- package/dist/packages/{methods/package/method-stage-runner.d.ts → build-plans/package/build-plan-stage-runner.d.ts} +12 -12
- package/dist/packages/{methods/package/method-stage-runner.js → build-plans/package/build-plan-stage-runner.js} +10 -10
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +37 -0
- package/dist/packages/build-plans/package/builtin-build-plan.js +91 -0
- package/dist/packages/{methods → build-plans}/package/context-interface.d.ts +11 -11
- package/dist/packages/{methods → build-plans}/package/context-interface.js +23 -23
- package/dist/packages/build-plans/package/interf-build-plan-package.d.ts +31 -0
- package/dist/packages/build-plans/package/interf-build-plan-package.js +466 -0
- package/dist/packages/{methods → build-plans}/package/lib/package-root.js +1 -1
- package/dist/packages/build-plans/package/local-build-plans.d.ts +74 -0
- package/dist/packages/{methods/package/local-methods.js → build-plans/package/local-build-plans.js} +152 -152
- package/dist/packages/build-plans/package/user-build-plans.d.ts +17 -0
- package/dist/packages/build-plans/package/user-build-plans.js +77 -0
- package/dist/packages/contracts/index.d.ts +1 -1
- package/dist/packages/contracts/lib/preparation-paths.d.ts +37 -37
- package/dist/packages/contracts/lib/preparation-paths.js +43 -43
- package/dist/packages/contracts/lib/schema.d.ts +34 -41
- package/dist/packages/contracts/lib/schema.js +42 -34
- package/dist/packages/engine/action-definitions.d.ts +60 -60
- package/dist/packages/engine/action-definitions.js +198 -197
- package/dist/packages/engine/action-planner.d.ts +2 -2
- package/dist/packages/engine/action-planner.js +5 -5
- package/dist/packages/engine/action-values.d.ts +1 -1
- package/dist/packages/engine/action-values.js +1 -1
- package/dist/packages/engine/agents/index.d.ts +2 -2
- package/dist/packages/engine/agents/index.js +1 -1
- package/dist/packages/engine/agents/lib/args.d.ts +2 -2
- package/dist/packages/engine/agents/lib/args.js +1 -1
- package/dist/packages/engine/agents/lib/constants.js +1 -1
- package/dist/packages/engine/agents/lib/execution-profile.d.ts +5 -5
- package/dist/packages/engine/agents/lib/execution-profile.js +3 -3
- package/dist/packages/engine/agents/lib/executors.d.ts +11 -11
- package/dist/packages/engine/agents/lib/render.js +4 -4
- package/dist/packages/engine/agents/lib/shells.d.ts +30 -30
- package/dist/packages/engine/agents/lib/shells.js +248 -248
- package/dist/packages/engine/agents/lib/types.d.ts +2 -2
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.d.ts +3 -0
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.js +19 -0
- package/dist/packages/engine/agents/role-executors.d.ts +7 -7
- package/dist/packages/engine/agents/role-executors.js +2 -2
- package/dist/packages/engine/agents/role-router.d.ts +2 -2
- package/dist/packages/engine/agents/role-router.js +1 -1
- package/dist/packages/engine/build/artifact-counts.d.ts +1 -0
- package/dist/packages/engine/{compile → build}/artifact-counts.js +7 -7
- package/dist/packages/engine/{compile → build}/artifact-status.d.ts +8 -8
- package/dist/packages/engine/{compile → build}/artifact-status.js +19 -19
- package/dist/packages/engine/{compile → build}/billing-events.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/billing-events.js +4 -4
- package/dist/packages/engine/build/build-execution.d.ts +4 -0
- package/dist/packages/engine/build/build-execution.js +4 -0
- package/dist/packages/engine/build/build-pipeline.d.ts +56 -0
- package/dist/packages/engine/{compile/compiled-pipeline.js → build/build-pipeline.js} +55 -55
- package/dist/packages/engine/build/build-plan-primitives.d.ts +2 -0
- package/dist/packages/engine/{compile/method-primitives.js → build/build-plan-primitives.js} +1 -1
- package/dist/packages/engine/build/build-plan-runs.d.ts +14 -0
- package/dist/packages/engine/build/build-plan-runs.js +31 -0
- package/dist/packages/engine/build/build-stage-plan.d.ts +16 -0
- package/dist/packages/engine/build/build-stage-plan.js +100 -0
- package/dist/packages/engine/build/build-stage-runner.d.ts +15 -0
- package/dist/packages/engine/{compile/compiled-stage-runner.js → build/build-stage-runner.js} +21 -21
- package/dist/packages/engine/build/build-target.d.ts +11 -0
- package/dist/packages/engine/build/build-target.js +16 -0
- package/dist/packages/engine/{compile → build}/check-evaluator.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/check-evaluator.js +1 -1
- package/dist/packages/engine/{compile → build}/discovery.d.ts +2 -2
- package/dist/packages/engine/{compile → build}/discovery.js +4 -4
- package/dist/packages/engine/{compile → build}/index.d.ts +6 -6
- package/dist/packages/engine/{compile → build}/index.js +5 -5
- package/dist/packages/engine/{compile → build}/lib/schema.d.ts +79 -79
- package/dist/packages/engine/{compile → build}/lib/schema.js +71 -71
- package/dist/packages/engine/build/reset.d.ts +2 -0
- package/dist/packages/engine/build/reset.js +74 -0
- package/dist/packages/engine/{compile → build}/runtime-contracts.js +8 -8
- package/dist/packages/engine/build/runtime-inventory.d.ts +7 -0
- package/dist/packages/engine/{compile → build}/runtime-inventory.js +8 -8
- package/dist/packages/engine/{compile → build}/runtime-paths.js +6 -6
- package/dist/packages/engine/{compile → build}/runtime-prompt.js +11 -11
- package/dist/packages/engine/build/runtime-reconcile.d.ts +2 -0
- package/dist/packages/engine/{compile → build}/runtime-reconcile.js +18 -18
- package/dist/packages/engine/{compile → build}/runtime-runs.js +27 -27
- package/dist/packages/engine/{compile → build}/runtime-types.d.ts +10 -10
- package/dist/packages/engine/build/source-files.d.ts +46 -0
- package/dist/packages/engine/{compile → build}/source-files.js +32 -32
- package/dist/packages/engine/build/state-artifacts.d.ts +9 -0
- package/dist/packages/engine/build/state-artifacts.js +14 -0
- package/dist/packages/engine/build/state-health.d.ts +4 -0
- package/dist/packages/engine/{compile → build}/state-health.js +40 -40
- package/dist/packages/engine/build/state-io.d.ts +11 -0
- package/dist/packages/engine/{compile → build}/state-io.js +22 -22
- package/dist/packages/engine/build/state-paths.js +16 -0
- package/dist/packages/engine/build/state-view.d.ts +5 -0
- package/dist/packages/engine/{compile → build}/state-view.js +29 -29
- package/dist/packages/engine/build/state.d.ts +7 -0
- package/dist/packages/engine/build/state.js +12 -0
- package/dist/packages/engine/build/validate-verifiable-context.d.ts +27 -0
- package/dist/packages/engine/{compile/validate-compiled.js → build/validate-verifiable-context.js} +73 -73
- package/dist/packages/engine/{compile → build}/validate.d.ts +4 -4
- package/dist/packages/engine/{compile → build}/validate.js +27 -27
- package/dist/packages/engine/build/verifiable-context-paths.d.ts +47 -0
- package/dist/packages/engine/build/verifiable-context-paths.js +121 -0
- package/dist/packages/engine/build/verifiable-context-schema.d.ts +21 -0
- package/dist/packages/engine/build/verifiable-context-schema.js +126 -0
- package/dist/packages/engine/client.d.ts +16 -16
- package/dist/packages/engine/client.js +21 -21
- package/dist/packages/engine/cloud-seams.d.ts +3 -3
- package/dist/packages/engine/execution/index.d.ts +2 -2
- package/dist/packages/engine/execution/index.js +1 -1
- package/dist/packages/engine/execution/lib/schema.d.ts +90 -95
- package/dist/packages/engine/execution/lib/schema.js +31 -31
- package/dist/packages/engine/index.d.ts +7 -7
- package/dist/packages/engine/index.js +3 -3
- package/dist/packages/engine/instance-paths.d.ts +39 -39
- package/dist/packages/engine/instance-paths.js +48 -48
- package/dist/packages/engine/lib/schema.d.ts +900 -472
- package/dist/packages/engine/lib/schema.js +137 -153
- package/dist/packages/engine/native-run-handlers.d.ts +12 -12
- package/dist/packages/engine/native-run-handlers.js +135 -135
- package/dist/packages/engine/preparation-store.d.ts +22 -23
- package/dist/packages/engine/preparation-store.js +30 -31
- package/dist/packages/engine/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/readiness-check-draft.js +1 -1
- package/dist/packages/engine/requested-artifacts.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +18 -17
- package/dist/packages/engine/routes.js +20 -19
- package/dist/packages/engine/run-observability.d.ts +5 -3
- package/dist/packages/engine/run-observability.js +101 -89
- package/dist/packages/engine/runtime-caches.d.ts +16 -16
- package/dist/packages/engine/runtime-caches.js +26 -26
- package/dist/packages/engine/runtime-event-applier.d.ts +2 -2
- package/dist/packages/engine/runtime-event-applier.js +1 -1
- package/dist/packages/engine/runtime-persistence.d.ts +9 -9
- package/dist/packages/engine/runtime-persistence.js +16 -16
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +14 -14
- package/dist/packages/engine/runtime-proposal-helpers.js +78 -80
- package/dist/packages/engine/runtime-resource-builders.d.ts +12 -12
- package/dist/packages/engine/runtime-resource-builders.js +19 -19
- package/dist/packages/engine/runtime.d.ts +52 -61
- package/dist/packages/engine/runtime.js +440 -463
- package/dist/packages/engine/server.d.ts +2 -2
- package/dist/packages/engine/server.js +147 -116
- package/dist/packages/engine/service-registry.d.ts +5 -17
- package/dist/packages/engine/service-registry.js +5 -20
- package/dist/packages/engine/verify/lib/schema.d.ts +19 -19
- package/dist/packages/engine/verify/lib/schema.js +36 -8
- package/dist/packages/engine/verify/readiness-check-run.d.ts +15 -16
- package/dist/packages/engine/verify/readiness-check-run.js +46 -46
- package/dist/packages/engine/verify/verify-execution.d.ts +3 -3
- package/dist/packages/engine/verify/verify-execution.js +10 -10
- package/dist/packages/engine/verify/verify-paths.d.ts +4 -4
- package/dist/packages/engine/verify/verify-paths.js +17 -17
- package/dist/packages/engine/verify/verify-sandbox.d.ts +1 -1
- package/dist/packages/engine/verify/verify-sandbox.js +26 -26
- package/dist/packages/engine/verify/verify-targets.d.ts +2 -2
- package/dist/packages/engine/verify/verify-targets.js +17 -17
- package/dist/packages/engine/verify/verify-types.d.ts +2 -2
- package/dist/packages/engine/verify/verify.d.ts +1 -1
- package/dist/packages/engine/verify/verify.js +1 -1
- package/dist/packages/engine/wire-schemas.d.ts +38 -40
- package/dist/packages/engine/wire-schemas.js +13 -13
- package/dist/packages/project/index.d.ts +1 -1
- package/dist/packages/project/interf-bootstrap.d.ts +1 -1
- package/dist/packages/project/interf-bootstrap.js +1 -1
- package/dist/packages/project/interf-detect.d.ts +11 -11
- package/dist/packages/project/interf-detect.js +30 -30
- package/dist/packages/project/interf-scaffold.d.ts +3 -3
- package/dist/packages/project/interf-scaffold.js +72 -72
- package/dist/packages/project/interf.d.ts +4 -4
- package/dist/packages/project/interf.js +3 -3
- package/dist/packages/project/lib/schema.d.ts +12 -12
- package/dist/packages/project/lib/schema.js +14 -14
- package/dist/packages/project/preparation-entries.d.ts +3 -3
- package/dist/packages/project/preparation-entries.js +19 -19
- package/dist/packages/project/source-config.d.ts +10 -10
- package/dist/packages/project/source-config.js +58 -58
- package/package.json +15 -15
- package/public-repo/CONTRIBUTING.md +12 -12
- package/public-repo/README.md +65 -63
- package/public-repo/SECURITY.md +3 -3
- package/public-repo/build-plans/interf-default/README.md +33 -0
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/shape/SKILL.md +10 -10
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/structure/SKILL.md +2 -2
- package/public-repo/{methods/interf-default/compile → build-plans/interf-default/build}/stages/summarize/SKILL.md +1 -1
- package/public-repo/{methods/interf-default/method.json → build-plans/interf-default/build-plan.json} +15 -15
- package/public-repo/{methods/interf-default/method.schema.json → build-plans/interf-default/build-plan.schema.json} +4 -4
- package/public-repo/build-plans/interf-default/improve/SKILL.md +18 -0
- package/public-repo/{methods → build-plans}/interf-default/use/query/SKILL.md +6 -6
- package/public-repo/plugins/README.md +1 -1
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +3 -3
- package/public-repo/plugins/interf/README.md +4 -1
- package/public-repo/plugins/interf/skills/interf/SKILL.md +189 -290
- package/public-repo/skills/interf/SKILL.md +189 -290
- package/LICENSE.md +0 -1
- package/TRADEMARKS.md +0 -8
- package/dist/cli/commands/method.d.ts +0 -2
- package/dist/compiler-ui/404.html +0 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +0 -10
- package/dist/compiler-ui/__next._full.txt +0 -21
- package/dist/compiler-ui/__next._head.txt +0 -5
- package/dist/compiler-ui/__next._index.txt +0 -6
- package/dist/compiler-ui/_next/static/chunks/01646j7yi.w5a.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/02r7siaw-_p5w.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/04d0ly-7xb~-j.js +0 -91
- package/dist/compiler-ui/_next/static/chunks/0fhs9psnxqd8s.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0mssmhpbifj15.css +0 -2
- package/dist/compiler-ui/_next/static/chunks/0nypu~ddwxari.js +0 -116
- package/dist/compiler-ui/_next/static/chunks/0p3s8iyhgcww2.js +0 -31
- package/dist/compiler-ui/_next/static/chunks/0tjf-vu_rz8s0.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/0u6p3fpbbfgtl.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0wpx5..8dnh0w.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0y0uj160p0ts~.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/10t8l~_oenf.c.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/13gz9e7z~imx1.js +0 -5
- package/dist/compiler-ui/_next/static/chunks/156xed-b6czaw.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/turbopack-02-3e_c-yz~5g.js +0 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +0 -16
- package/dist/compiler-ui/_not-found/__next._head.txt +0 -5
- package/dist/compiler-ui/_not-found/__next._index.txt +0 -6
- package/dist/compiler-ui/_not-found/__next._not-found.txt +0 -5
- package/dist/compiler-ui/_not-found.html +0 -1
- package/dist/compiler-ui/_not-found.txt +0 -16
- package/dist/compiler-ui/index.html +0 -1
- package/dist/compiler-ui/index.txt +0 -21
- package/dist/packages/engine/agents/lib/compiled-bootstrap.d.ts +0 -3
- package/dist/packages/engine/agents/lib/compiled-bootstrap.js +0 -19
- package/dist/packages/engine/compile/artifact-counts.d.ts +0 -1
- package/dist/packages/engine/compile/compiled-compile.d.ts +0 -4
- package/dist/packages/engine/compile/compiled-compile.js +0 -4
- package/dist/packages/engine/compile/compiled-paths.d.ts +0 -47
- package/dist/packages/engine/compile/compiled-paths.js +0 -121
- package/dist/packages/engine/compile/compiled-pipeline.d.ts +0 -56
- package/dist/packages/engine/compile/compiled-schema.d.ts +0 -21
- package/dist/packages/engine/compile/compiled-schema.js +0 -126
- package/dist/packages/engine/compile/compiled-stage-plan.d.ts +0 -16
- package/dist/packages/engine/compile/compiled-stage-plan.js +0 -100
- package/dist/packages/engine/compile/compiled-stage-runner.d.ts +0 -15
- package/dist/packages/engine/compile/compiled-target.d.ts +0 -11
- package/dist/packages/engine/compile/compiled-target.js +0 -16
- package/dist/packages/engine/compile/method-primitives.d.ts +0 -2
- package/dist/packages/engine/compile/method-runs.d.ts +0 -14
- package/dist/packages/engine/compile/method-runs.js +0 -31
- package/dist/packages/engine/compile/reset.d.ts +0 -2
- package/dist/packages/engine/compile/reset.js +0 -74
- package/dist/packages/engine/compile/runtime-inventory.d.ts +0 -7
- package/dist/packages/engine/compile/runtime-reconcile.d.ts +0 -2
- package/dist/packages/engine/compile/source-files.d.ts +0 -46
- package/dist/packages/engine/compile/state-artifacts.d.ts +0 -9
- package/dist/packages/engine/compile/state-artifacts.js +0 -14
- package/dist/packages/engine/compile/state-health.d.ts +0 -4
- package/dist/packages/engine/compile/state-io.d.ts +0 -11
- package/dist/packages/engine/compile/state-paths.js +0 -16
- package/dist/packages/engine/compile/state-view.d.ts +0 -5
- package/dist/packages/engine/compile/state.d.ts +0 -7
- package/dist/packages/engine/compile/state.js +0 -12
- package/dist/packages/engine/compile/validate-compiled.d.ts +0 -27
- package/dist/packages/methods/authoring/index.d.ts +0 -4
- package/dist/packages/methods/authoring/index.js +0 -4
- package/dist/packages/methods/authoring/method-authoring.d.ts +0 -36
- package/dist/packages/methods/authoring/method-edit-session.d.ts +0 -18
- package/dist/packages/methods/authoring/method-improvement.d.ts +0 -23
- package/dist/packages/methods/authoring/method-improvement.js +0 -217
- package/dist/packages/methods/index.d.ts +0 -2
- package/dist/packages/methods/index.js +0 -2
- package/dist/packages/methods/method-resolution.d.ts +0 -6
- package/dist/packages/methods/method-resolution.js +0 -7
- package/dist/packages/methods/package/builtin-compiled-method.d.ts +0 -37
- package/dist/packages/methods/package/builtin-compiled-method.js +0 -91
- package/dist/packages/methods/package/interf-method-package.d.ts +0 -31
- package/dist/packages/methods/package/interf-method-package.js +0 -466
- package/dist/packages/methods/package/local-methods.d.ts +0 -74
- package/dist/packages/methods/package/method-definitions.d.ts +0 -61
- package/dist/packages/methods/package/method-definitions.js +0 -214
- package/dist/packages/methods/package/method-review-paths.d.ts +0 -10
- package/dist/packages/methods/package/method-review-paths.js +0 -31
- package/dist/packages/methods/package/user-methods.d.ts +0 -17
- package/dist/packages/methods/package/user-methods.js +0 -77
- package/public-repo/methods/interf-default/README.md +0 -33
- package/public-repo/methods/interf-default/improve/SKILL.md +0 -18
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6}/_buildManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6}/_clientMiddlewareManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/tYHMLL9oKds1yDoNYgkPV → interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6}/_ssgManifest.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/03~yq9q893hmn.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/0y5z3t-z1c8ks.js.map +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- /package/dist/{compiler-ui → interf-ui}/_next/static/media/worker.102zas1s52_pf.js +0 -0
- /package/dist/packages/{methods/authoring/lib/method-edit-utils.js → build-plans/authoring/lib/build-plan-edit-utils.js} +0 -0
- /package/dist/packages/{methods → build-plans}/package/lib/package-root.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-paths.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-runs.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime-types.js +0 -0
- /package/dist/packages/engine/{compile → build}/runtime.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/runtime.js +0 -0
- /package/dist/packages/engine/{compile → build}/state-paths.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/validate-helpers.d.ts +0 -0
- /package/dist/packages/engine/{compile → build}/validate-helpers.js +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type Server } from "node:http";
|
|
2
2
|
import { type LocalServiceRunHandlers, type LocalServiceRuntime } from "./runtime.js";
|
|
3
3
|
import type { IdempotencyStore, RunLeaseStore, TokenValidator } from "./cloud-seams.js";
|
|
4
|
-
import type { BillingEventSink } from "./
|
|
4
|
+
import type { BillingEventSink } from "./build/billing-events.js";
|
|
5
5
|
/** Generate a fresh per-instance bearer token. */
|
|
6
6
|
export declare function createLocalServiceAuthToken(): string;
|
|
7
7
|
export interface StartLocalServiceOptions {
|
|
@@ -53,6 +53,6 @@ export interface StartedLocalService {
|
|
|
53
53
|
url: string;
|
|
54
54
|
close(): Promise<void>;
|
|
55
55
|
}
|
|
56
|
-
export declare function
|
|
56
|
+
export declare function resolveInterfUiStaticRoot(rootPath?: string): string;
|
|
57
57
|
export declare function createLocalServiceServer(runtime: LocalServiceRuntime): Server;
|
|
58
58
|
export declare function startLocalService(options?: StartLocalServiceOptions): Promise<StartedLocalService>;
|
|
@@ -4,16 +4,16 @@ import { randomBytes } from "node:crypto";
|
|
|
4
4
|
import { existsSync, statSync, readFileSync } from "node:fs";
|
|
5
5
|
import { dirname, extname, join, normalize, resolve, sep } from "node:path";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { LOCAL_SERVICE_LOOPBACK_HOSTS, LocalServiceConfigSchema, LocalServiceDiscoverySchema, LocalServiceErrorSchema, OpenPathRequestSchema, PreparationCreateRequestSchema, PreparationUpdateRequestSchema, ServiceRegistryEntrySchema, } from "./lib/schema.js";
|
|
7
|
+
import { LOCAL_SERVICE_LOOPBACK_HOSTS, LocalServiceConfigSchema, LocalServiceDiscoverySchema, LocalServiceErrorSchema, OpenPathRequestSchema, PreparationCreateRequestSchema, PreparationUpdateRequestSchema, ServiceRegistryEntrySchema, BuildPlanSaveRequestSchema, } from "./lib/schema.js";
|
|
8
8
|
import { assertPathWithinRoot, } from "../contracts/utils/path-guards.js";
|
|
9
9
|
import { createLocalServiceRuntime, } from "./runtime.js";
|
|
10
10
|
import { buildLocalServiceUrl, LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, LOCAL_SERVICE_ROUTES, PREPARATION_SUBRESOURCES, } from "./routes.js";
|
|
11
11
|
import { registerServiceLocally, unregisterService, } from "./service-registry.js";
|
|
12
12
|
import { createStoredPreparation, deleteStoredPreparation, getStoredPreparation, listStoredPreparations, preparationWireShape, rehydratePreparations, updateStoredPreparation, } from "./preparation-store.js";
|
|
13
13
|
import { clearConnection, readActiveConnection, writeConnection, } from "./connection-config.js";
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
14
|
+
import { userBuildPlansRoot } from "./instance-paths.js";
|
|
15
|
+
import { builtinBuildPlanPackagePath, buildPlanDefinitionPath, } from "../build-plans/package/local-build-plans.js";
|
|
16
|
+
import { installUserBuildPlan, userBuildPlanPath, userBuildPlanExists } from "../build-plans/package/user-build-plans.js";
|
|
17
17
|
/** HTTP methods that require an authenticated bearer token + Origin guard. */
|
|
18
18
|
const MUTATING_METHODS = new Set(["POST", "PUT", "PATCH", "DELETE"]);
|
|
19
19
|
/** Generate a fresh per-instance bearer token. */
|
|
@@ -122,20 +122,20 @@ function isAuthorizedMutation(req, runtime) {
|
|
|
122
122
|
function packageRoot() {
|
|
123
123
|
return resolve(dirname(fileURLToPath(import.meta.url)), "..", "..", "..");
|
|
124
124
|
}
|
|
125
|
-
export function
|
|
126
|
-
const distRoot = join(rootPath, "dist", "
|
|
127
|
-
const sourceExportRoot = join(rootPath, "src", "apps", "
|
|
125
|
+
export function resolveInterfUiStaticRoot(rootPath = packageRoot()) {
|
|
126
|
+
const distRoot = join(rootPath, "dist", "interf-ui");
|
|
127
|
+
const sourceExportRoot = join(rootPath, "src", "apps", "interf-ui", "out");
|
|
128
128
|
if (existsSync(join(distRoot, "index.html")))
|
|
129
129
|
return distRoot;
|
|
130
130
|
if (existsSync(join(sourceExportRoot, "index.html")))
|
|
131
131
|
return sourceExportRoot;
|
|
132
132
|
return distRoot;
|
|
133
133
|
}
|
|
134
|
-
function
|
|
135
|
-
const explicit = process.env.
|
|
134
|
+
function interfUiStaticRoot() {
|
|
135
|
+
const explicit = process.env.INTERF_UI_STATIC_ROOT?.trim();
|
|
136
136
|
if (explicit)
|
|
137
137
|
return resolve(explicit);
|
|
138
|
-
return
|
|
138
|
+
return resolveInterfUiStaticRoot();
|
|
139
139
|
}
|
|
140
140
|
function contentType(filePath) {
|
|
141
141
|
switch (extname(filePath)) {
|
|
@@ -283,23 +283,23 @@ function safeStaticPath(root, relativePath) {
|
|
|
283
283
|
return absolute;
|
|
284
284
|
}
|
|
285
285
|
/**
|
|
286
|
-
* Resolve the on-disk root path for a
|
|
287
|
-
* `/v1/
|
|
286
|
+
* Resolve the on-disk root path for a Build Plan id. Used by the
|
|
287
|
+
* `/v1/build-plans/<id>/files/<relpath>` route. Resolution order matches
|
|
288
288
|
* the runtime: preparation-draft (if a prep id is supplied) → user
|
|
289
|
-
* library → built-in. Returns `null` when the
|
|
289
|
+
* library → built-in. Returns `null` when the Build Plan id resolves
|
|
290
290
|
* nowhere.
|
|
291
291
|
*/
|
|
292
|
-
function
|
|
292
|
+
function resolveBuildPlanPackageRoot(buildPlanId, prepDataDir) {
|
|
293
293
|
if (prepDataDir) {
|
|
294
|
-
const localPath =
|
|
295
|
-
if (existsSync(join(localPath, "
|
|
294
|
+
const localPath = buildPlanDefinitionPath(prepDataDir, buildPlanId);
|
|
295
|
+
if (existsSync(join(localPath, "build-plan.json")))
|
|
296
296
|
return localPath;
|
|
297
297
|
}
|
|
298
|
-
if (
|
|
299
|
-
return
|
|
298
|
+
if (userBuildPlanExists(buildPlanId)) {
|
|
299
|
+
return userBuildPlanPath(buildPlanId);
|
|
300
300
|
}
|
|
301
|
-
const builtinPath =
|
|
302
|
-
if (existsSync(join(builtinPath, "
|
|
301
|
+
const builtinPath = builtinBuildPlanPackagePath(buildPlanId);
|
|
302
|
+
if (existsSync(join(builtinPath, "build-plan.json")))
|
|
303
303
|
return builtinPath;
|
|
304
304
|
return null;
|
|
305
305
|
}
|
|
@@ -328,9 +328,17 @@ function sendFile(res, filePath) {
|
|
|
328
328
|
return false;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
|
+
function isUsableInterfUiIndexHtml(filePath) {
|
|
332
|
+
if (!existsSync(filePath))
|
|
333
|
+
return false;
|
|
334
|
+
const html = readFileSync(filePath, "utf8");
|
|
335
|
+
return html.includes("</html>")
|
|
336
|
+
&& html.includes("</script>")
|
|
337
|
+
&& html.includes("_next/static/");
|
|
338
|
+
}
|
|
331
339
|
/**
|
|
332
340
|
* Reject any path that contains `..` or absolute segments — used by the
|
|
333
|
-
* 0.16 file-serving endpoints (`/v1/
|
|
341
|
+
* 0.16 file-serving endpoints (`/v1/build-plans/<id>/files/...`,
|
|
334
342
|
* `/v1/preparations/<id>/files/...`). The `safeStaticPath` helper used
|
|
335
343
|
* by the static-asset path silently strips traversal segments; for the
|
|
336
344
|
* API endpoints we want a hard reject so the response is unambiguous.
|
|
@@ -347,11 +355,15 @@ function isTraversalRelativePath(relPath) {
|
|
|
347
355
|
return true;
|
|
348
356
|
return false;
|
|
349
357
|
}
|
|
350
|
-
function
|
|
351
|
-
const staticRoot =
|
|
358
|
+
function sendInterfUiAsset(req, res, _runtime) {
|
|
359
|
+
const staticRoot = interfUiStaticRoot();
|
|
352
360
|
const url = parseRequestUrl(req);
|
|
353
361
|
if (url.pathname === "/") {
|
|
354
362
|
const indexPath = join(staticRoot, "index.html");
|
|
363
|
+
if (!isUsableInterfUiIndexHtml(indexPath)) {
|
|
364
|
+
sendText(res, 503, "Interf UI assets are invalid. Run `npm run web:build`, then restart `interf web`.\n");
|
|
365
|
+
return true;
|
|
366
|
+
}
|
|
355
367
|
if (sendFile(res, indexPath))
|
|
356
368
|
return true;
|
|
357
369
|
sendText(res, 503, "Interf UI assets are missing. Run `npm run web:build`, then restart `interf web`.\n");
|
|
@@ -413,48 +425,48 @@ async function routeApi(req, res, runtime) {
|
|
|
413
425
|
}
|
|
414
426
|
return null;
|
|
415
427
|
};
|
|
416
|
-
const
|
|
428
|
+
const listInstanceBuildPlans = () => {
|
|
417
429
|
const byId = new Map();
|
|
418
430
|
for (const prepDataDir of prepDataDirsForInstance()) {
|
|
419
|
-
for (const
|
|
420
|
-
const existing = byId.get(
|
|
431
|
+
for (const buildPlanResource of runtime.listBuildPlans(prepDataDir)) {
|
|
432
|
+
const existing = byId.get(buildPlanResource.id);
|
|
421
433
|
if (!existing) {
|
|
422
|
-
byId.set(
|
|
434
|
+
byId.set(buildPlanResource.id, buildPlanResource);
|
|
423
435
|
continue;
|
|
424
436
|
}
|
|
425
|
-
const preferred = existing.built_in && !
|
|
426
|
-
?
|
|
437
|
+
const preferred = existing.built_in && !buildPlanResource.built_in
|
|
438
|
+
? buildPlanResource
|
|
427
439
|
: existing;
|
|
428
|
-
byId.set(
|
|
440
|
+
byId.set(buildPlanResource.id, {
|
|
429
441
|
...preferred,
|
|
430
442
|
active_for_preparations: Array.from(new Set([
|
|
431
443
|
...existing.active_for_preparations,
|
|
432
|
-
...
|
|
444
|
+
...buildPlanResource.active_for_preparations,
|
|
433
445
|
])).sort(),
|
|
434
446
|
});
|
|
435
447
|
}
|
|
436
448
|
}
|
|
437
449
|
return [...byId.values()].sort((left, right) => left.id.localeCompare(right.id));
|
|
438
450
|
};
|
|
439
|
-
const
|
|
440
|
-
return
|
|
451
|
+
const findInstanceBuildPlan = (buildPlanId) => {
|
|
452
|
+
return listInstanceBuildPlans().find((buildPlanResource) => buildPlanResource.id === buildPlanId) ?? null;
|
|
441
453
|
};
|
|
442
|
-
const
|
|
454
|
+
const listInstanceBuildPlanRuns = (buildPlanId) => {
|
|
443
455
|
return prepDataDirsForInstance()
|
|
444
|
-
.flatMap((prepDataDir) => runtime.
|
|
456
|
+
.flatMap((prepDataDir) => runtime.listBuildPlanRuns(prepDataDir, buildPlanId))
|
|
445
457
|
.sort((left, right) => {
|
|
446
458
|
const leftMs = Date.parse(left.started_at ?? left.created_at ?? left.finished_at ?? "");
|
|
447
459
|
const rightMs = Date.parse(right.started_at ?? right.created_at ?? right.finished_at ?? "");
|
|
448
460
|
return (Number.isFinite(rightMs) ? rightMs : 0) - (Number.isFinite(leftMs) ? leftMs : 0);
|
|
449
461
|
});
|
|
450
462
|
};
|
|
451
|
-
const
|
|
463
|
+
const resolveInstanceBuildPlanPackageRoot = (buildPlanId) => {
|
|
452
464
|
for (const prepDataDir of prepDataDirsForInstance()) {
|
|
453
|
-
const localPath =
|
|
454
|
-
if (existsSync(join(localPath, "
|
|
465
|
+
const localPath = buildPlanDefinitionPath(prepDataDir, buildPlanId);
|
|
466
|
+
if (existsSync(join(localPath, "build-plan.json")))
|
|
455
467
|
return localPath;
|
|
456
468
|
}
|
|
457
|
-
return
|
|
469
|
+
return resolveBuildPlanPackageRoot(buildPlanId);
|
|
458
470
|
};
|
|
459
471
|
// CORS preflight — answered for allowed origins, refused otherwise.
|
|
460
472
|
if (method === "OPTIONS") {
|
|
@@ -503,7 +515,8 @@ async function routeApi(req, res, runtime) {
|
|
|
503
515
|
resources: {
|
|
504
516
|
instance: LOCAL_SERVICE_ROUTES.instance,
|
|
505
517
|
preparations: LOCAL_SERVICE_ROUTES.preparations,
|
|
506
|
-
|
|
518
|
+
build_plans: LOCAL_SERVICE_ROUTES.buildPlans,
|
|
519
|
+
build_runs: LOCAL_SERVICE_ROUTES.buildRuns,
|
|
507
520
|
runs: LOCAL_SERVICE_ROUTES.runs,
|
|
508
521
|
action_proposals: LOCAL_SERVICE_ROUTES.actionProposals,
|
|
509
522
|
executor: LOCAL_SERVICE_ROUTES.executor,
|
|
@@ -575,7 +588,7 @@ async function routeApi(req, res, runtime) {
|
|
|
575
588
|
const stored = createStoredPreparation(runtime, {
|
|
576
589
|
id: body.id,
|
|
577
590
|
source: { kind: "local-folder", locator: body.source.locator },
|
|
578
|
-
|
|
591
|
+
build_plan_id: body.build_plan_id,
|
|
579
592
|
about: body.about,
|
|
580
593
|
requested_artifacts: body.requested_artifacts,
|
|
581
594
|
source_profile: body.source_profile,
|
|
@@ -623,7 +636,7 @@ async function routeApi(req, res, runtime) {
|
|
|
623
636
|
try {
|
|
624
637
|
const body = PreparationUpdateRequestSchema.parse(await readJsonBody(req));
|
|
625
638
|
const updated = updateStoredPreparation(decodedPrepId, {
|
|
626
|
-
|
|
639
|
+
build_plan_id: body.build_plan_id,
|
|
627
640
|
about: body.about,
|
|
628
641
|
...(body.checks !== undefined ? { checks: body.checks } : {}),
|
|
629
642
|
...(body.requested_artifacts !== undefined ? { requested_artifacts: body.requested_artifacts } : {}),
|
|
@@ -642,10 +655,10 @@ async function routeApi(req, res, runtime) {
|
|
|
642
655
|
return true;
|
|
643
656
|
}
|
|
644
657
|
}
|
|
645
|
-
else if (subPath === PREPARATION_SUBRESOURCES.
|
|
658
|
+
else if (subPath === PREPARATION_SUBRESOURCES.buildRuns) {
|
|
646
659
|
if (method === "POST") {
|
|
647
|
-
if (!storedPrep.
|
|
648
|
-
sendError(res, 400, `Preparation ${storedPrep.id} has no Build Plan selected. Select one via PATCH /v1/preparations/${storedPrep.id} { "
|
|
660
|
+
if (!storedPrep.buildPlanId) {
|
|
661
|
+
sendError(res, 400, `Preparation ${storedPrep.id} has no Build Plan selected. Select one via PATCH /v1/preparations/${storedPrep.id} { "build_plan_id": "<id>" } before building.`);
|
|
649
662
|
return true;
|
|
650
663
|
}
|
|
651
664
|
try {
|
|
@@ -657,18 +670,18 @@ async function routeApi(req, res, runtime) {
|
|
|
657
670
|
: idempotencyKeyRaw;
|
|
658
671
|
const trimmedKey = typeof idempotencyKey === "string" ? idempotencyKey.trim() : "";
|
|
659
672
|
const dedupedRunId = trimmedKey
|
|
660
|
-
? runtime.
|
|
673
|
+
? runtime.findIdempotentBuildRun(storedPrep.prepDataDir, trimmedKey)
|
|
661
674
|
: null;
|
|
662
675
|
if (dedupedRunId) {
|
|
663
|
-
const existing = runtime.
|
|
676
|
+
const existing = runtime.getBuildRun(storedPrep.prepDataDir, dedupedRunId);
|
|
664
677
|
if (existing) {
|
|
665
678
|
sendJson(res, 200, existing);
|
|
666
679
|
return true;
|
|
667
680
|
}
|
|
668
681
|
}
|
|
669
|
-
const resource = await runtime.
|
|
682
|
+
const resource = await runtime.createBuildRun(storedPrep.prepDataDir, request);
|
|
670
683
|
if (trimmedKey) {
|
|
671
|
-
runtime.
|
|
684
|
+
runtime.recordIdempotentBuildRun(storedPrep.prepDataDir, trimmedKey, resource.run.run_id);
|
|
672
685
|
}
|
|
673
686
|
sendJson(res, 201, resource);
|
|
674
687
|
}
|
|
@@ -680,8 +693,8 @@ async function routeApi(req, res, runtime) {
|
|
|
680
693
|
}
|
|
681
694
|
else if (subPath === PREPARATION_SUBRESOURCES.verifyRuns) {
|
|
682
695
|
if (method === "POST") {
|
|
683
|
-
if (!storedPrep.
|
|
684
|
-
sendError(res, 400, `Preparation ${storedPrep.id} has no Build Plan selected. Select one via PATCH /v1/preparations/${storedPrep.id} { "
|
|
696
|
+
if (!storedPrep.buildPlanId) {
|
|
697
|
+
sendError(res, 400, `Preparation ${storedPrep.id} has no Build Plan selected. Select one via PATCH /v1/preparations/${storedPrep.id} { "build_plan_id": "<id>" } before verifying.`);
|
|
685
698
|
return true;
|
|
686
699
|
}
|
|
687
700
|
try {
|
|
@@ -696,11 +709,11 @@ async function routeApi(req, res, runtime) {
|
|
|
696
709
|
return true;
|
|
697
710
|
}
|
|
698
711
|
}
|
|
699
|
-
else if (subPath === PREPARATION_SUBRESOURCES.
|
|
712
|
+
else if (subPath === PREPARATION_SUBRESOURCES.buildPlanDraftRuns) {
|
|
700
713
|
if (method === "POST") {
|
|
701
714
|
try {
|
|
702
715
|
const body = (await readJsonBody(req));
|
|
703
|
-
const job = await runtime.
|
|
716
|
+
const job = await runtime.createBuildPlanAuthoringRun(storedPrep.prepDataDir, body);
|
|
704
717
|
sendJson(res, 202, job);
|
|
705
718
|
}
|
|
706
719
|
catch (error) {
|
|
@@ -709,11 +722,11 @@ async function routeApi(req, res, runtime) {
|
|
|
709
722
|
return true;
|
|
710
723
|
}
|
|
711
724
|
}
|
|
712
|
-
else if (subPath === PREPARATION_SUBRESOURCES.
|
|
725
|
+
else if (subPath === PREPARATION_SUBRESOURCES.buildPlanImprovementRuns) {
|
|
713
726
|
if (method === "POST") {
|
|
714
727
|
try {
|
|
715
728
|
const body = (await readJsonBody(req));
|
|
716
|
-
const job = await runtime.
|
|
729
|
+
const job = await runtime.createBuildPlanAuthoringRun(storedPrep.prepDataDir, body, "build-plan-improvement");
|
|
717
730
|
sendJson(res, 202, job);
|
|
718
731
|
}
|
|
719
732
|
catch (error) {
|
|
@@ -751,7 +764,7 @@ async function routeApi(req, res, runtime) {
|
|
|
751
764
|
if (method === "POST") {
|
|
752
765
|
try {
|
|
753
766
|
const body = (await readJsonBody(req));
|
|
754
|
-
const request = { preparation: storedPrep.id, scope: "
|
|
767
|
+
const request = { preparation: storedPrep.id, scope: "build", ...(body ?? {}) };
|
|
755
768
|
const result = runtime.applyReset(storedPrep.prepDataDir, request);
|
|
756
769
|
sendJson(res, 200, result);
|
|
757
770
|
}
|
|
@@ -770,7 +783,7 @@ async function routeApi(req, res, runtime) {
|
|
|
770
783
|
}
|
|
771
784
|
else if (subPath === PREPARATION_SUBRESOURCES.runs) {
|
|
772
785
|
if (method === "GET") {
|
|
773
|
-
const runs = runtime.
|
|
786
|
+
const runs = runtime.listBuildRunsForPreparation(storedPrep.prepDataDir, storedPrep.id);
|
|
774
787
|
sendJson(res, 200, { runs });
|
|
775
788
|
return true;
|
|
776
789
|
}
|
|
@@ -783,11 +796,11 @@ async function routeApi(req, res, runtime) {
|
|
|
783
796
|
return true;
|
|
784
797
|
}
|
|
785
798
|
}
|
|
786
|
-
else if (subPath === PREPARATION_SUBRESOURCES.
|
|
799
|
+
else if (subPath === PREPARATION_SUBRESOURCES.verifiableContext) {
|
|
787
800
|
if (method === "GET") {
|
|
788
|
-
const context = runtime.
|
|
801
|
+
const context = runtime.getVerifiableContext(storedPrep.prepDataDir, storedPrep.id);
|
|
789
802
|
if (!context)
|
|
790
|
-
sendError(res, 404, "
|
|
803
|
+
sendError(res, 404, "Verifiable context not found.");
|
|
791
804
|
else
|
|
792
805
|
sendJson(res, 200, context);
|
|
793
806
|
return true;
|
|
@@ -795,7 +808,7 @@ async function routeApi(req, res, runtime) {
|
|
|
795
808
|
}
|
|
796
809
|
else if (subPath.startsWith(`${PREPARATION_SUBRESOURCES.files}/`)) {
|
|
797
810
|
// GET /v1/preparations/<id>/files/<relpath> — read-only file
|
|
798
|
-
// serving inside the prep's
|
|
811
|
+
// serving inside the prep's verifiable-context root. Used by the
|
|
799
812
|
// locator pattern's `api-served` kind.
|
|
800
813
|
if (method === "GET") {
|
|
801
814
|
const rawRelPath = subPath.slice(PREPARATION_SUBRESOURCES.files.length + 1);
|
|
@@ -808,12 +821,12 @@ async function routeApi(req, res, runtime) {
|
|
|
808
821
|
return true;
|
|
809
822
|
}
|
|
810
823
|
if (isTraversalRelativePath(relPath)) {
|
|
811
|
-
sendError(res, 400, "File path escapes
|
|
824
|
+
sendError(res, 400, "File path escapes verifiable-context root.");
|
|
812
825
|
return true;
|
|
813
826
|
}
|
|
814
|
-
const safePath = safeStaticPath(storedPrep.
|
|
827
|
+
const safePath = safeStaticPath(storedPrep.verifiableContextPath, relPath);
|
|
815
828
|
if (!safePath) {
|
|
816
|
-
sendError(res, 400, "File path escapes
|
|
829
|
+
sendError(res, 400, "File path escapes verifiable-context root.");
|
|
817
830
|
return true;
|
|
818
831
|
}
|
|
819
832
|
if (!sendFile(res, safePath)) {
|
|
@@ -824,7 +837,7 @@ async function routeApi(req, res, runtime) {
|
|
|
824
837
|
}
|
|
825
838
|
else if (subPath.startsWith(`${PREPARATION_SUBRESOURCES.artifacts}/`)) {
|
|
826
839
|
// GET /v1/preparations/<id>/artifacts/<artifact-id> — per-Artifact
|
|
827
|
-
// status from the latest
|
|
840
|
+
// status from the latest Build run.
|
|
828
841
|
if (method === "GET") {
|
|
829
842
|
const rawArtifactId = subPath.slice(PREPARATION_SUBRESOURCES.artifacts.length + 1);
|
|
830
843
|
let artifactId;
|
|
@@ -849,56 +862,75 @@ async function routeApi(req, res, runtime) {
|
|
|
849
862
|
return true;
|
|
850
863
|
}
|
|
851
864
|
// ─────────────────────────────────────────────────────────────────────────
|
|
852
|
-
//
|
|
865
|
+
// Build Plan resources — preparation-independent (Preparation-local + user lib + bundled).
|
|
853
866
|
// ─────────────────────────────────────────────────────────────────────────
|
|
854
|
-
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.
|
|
855
|
-
sendJson(res, 200, {
|
|
867
|
+
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.buildPlans) {
|
|
868
|
+
sendJson(res, 200, { build_plans: listInstanceBuildPlans() });
|
|
869
|
+
return true;
|
|
870
|
+
}
|
|
871
|
+
if (method === "POST" && path === LOCAL_SERVICE_ROUTES.buildPlans) {
|
|
872
|
+
try {
|
|
873
|
+
const body = BuildPlanSaveRequestSchema.parse(await readJsonBody(req));
|
|
874
|
+
const installed = installUserBuildPlan({
|
|
875
|
+
sourceDir: body.source_path,
|
|
876
|
+
id: body.id,
|
|
877
|
+
overwrite: body.overwrite,
|
|
878
|
+
});
|
|
879
|
+
sendJson(res, 201, {
|
|
880
|
+
build_plan_id: installed.id,
|
|
881
|
+
installed: true,
|
|
882
|
+
path: installed.path,
|
|
883
|
+
});
|
|
884
|
+
}
|
|
885
|
+
catch (error) {
|
|
886
|
+
sendError(res, 400, error instanceof Error ? error.message : String(error));
|
|
887
|
+
}
|
|
856
888
|
return true;
|
|
857
889
|
}
|
|
858
|
-
const
|
|
859
|
-
if (method === "GET" &&
|
|
860
|
-
const
|
|
861
|
-
if (!
|
|
862
|
-
sendError(res, 404, "
|
|
890
|
+
const buildPlanMatch = path.match(/^\/v1\/build-plans\/([^/]+)$/);
|
|
891
|
+
if (method === "GET" && buildPlanMatch?.[1]) {
|
|
892
|
+
const buildPlanResource = findInstanceBuildPlan(decodeURIComponent(buildPlanMatch[1]));
|
|
893
|
+
if (!buildPlanResource)
|
|
894
|
+
sendError(res, 404, "Build Plan not found.");
|
|
863
895
|
else
|
|
864
|
-
sendJson(res, 200,
|
|
896
|
+
sendJson(res, 200, buildPlanResource);
|
|
865
897
|
return true;
|
|
866
898
|
}
|
|
867
|
-
const
|
|
868
|
-
if (method === "GET" &&
|
|
869
|
-
const runs =
|
|
899
|
+
const buildPlanRunsMatch = path.match(/^\/v1\/build-plans\/([^/]+)\/runs$/);
|
|
900
|
+
if (method === "GET" && buildPlanRunsMatch?.[1]) {
|
|
901
|
+
const runs = listInstanceBuildPlanRuns(decodeURIComponent(buildPlanRunsMatch[1]));
|
|
870
902
|
sendJson(res, 200, { runs });
|
|
871
903
|
return true;
|
|
872
904
|
}
|
|
873
|
-
// GET /v1/
|
|
874
|
-
// the
|
|
905
|
+
// GET /v1/build-plans/<id>/files/<relpath> — read-only file serving inside
|
|
906
|
+
// the Build Plan package root. Used by the locator pattern's `api-served` kind so
|
|
875
907
|
// the UI can render SKILL.md / contract files in a side drawer over a
|
|
876
908
|
// remote engine. Resolution: prep-draft (when first prep exists) →
|
|
877
909
|
// user library → built-in. Path-guard rejects any traversal outside
|
|
878
910
|
// the resolved root.
|
|
879
|
-
const
|
|
880
|
-
if (method === "GET" &&
|
|
881
|
-
const
|
|
911
|
+
const buildPlanFilesMatch = path.match(/^\/v1\/build-plans\/([^/]+)\/files\/(.+)$/);
|
|
912
|
+
if (method === "GET" && buildPlanFilesMatch?.[1] && buildPlanFilesMatch[2]) {
|
|
913
|
+
const buildPlanId = decodeURIComponent(buildPlanFilesMatch[1]);
|
|
882
914
|
let relPath;
|
|
883
915
|
try {
|
|
884
|
-
relPath = decodeURIComponent(
|
|
916
|
+
relPath = decodeURIComponent(buildPlanFilesMatch[2]);
|
|
885
917
|
}
|
|
886
918
|
catch {
|
|
887
919
|
sendError(res, 400, "File path is not valid URI-encoded UTF-8.");
|
|
888
920
|
return true;
|
|
889
921
|
}
|
|
890
922
|
if (isTraversalRelativePath(relPath)) {
|
|
891
|
-
sendError(res, 400, "File path escapes
|
|
923
|
+
sendError(res, 400, "File path escapes Build Plan root.");
|
|
892
924
|
return true;
|
|
893
925
|
}
|
|
894
|
-
const root =
|
|
926
|
+
const root = resolveInstanceBuildPlanPackageRoot(buildPlanId);
|
|
895
927
|
if (!root) {
|
|
896
|
-
sendError(res, 404, `
|
|
928
|
+
sendError(res, 404, `Build Plan not found: ${buildPlanId}`);
|
|
897
929
|
return true;
|
|
898
930
|
}
|
|
899
931
|
const safePath = safeStaticPath(root, relPath);
|
|
900
932
|
if (!safePath) {
|
|
901
|
-
sendError(res, 400, "File path escapes
|
|
933
|
+
sendError(res, 400, "File path escapes Build Plan root.");
|
|
902
934
|
return true;
|
|
903
935
|
}
|
|
904
936
|
if (!sendFile(res, safePath)) {
|
|
@@ -907,8 +939,8 @@ async function routeApi(req, res, runtime) {
|
|
|
907
939
|
return true;
|
|
908
940
|
}
|
|
909
941
|
// ─────────────────────────────────────────────────────────────────────────
|
|
910
|
-
// Run observability — instance-wide.
|
|
911
|
-
//
|
|
942
|
+
// Run observability — instance-wide. The runtime takes a "first prep" hint
|
|
943
|
+
// to scan registered Preparations.
|
|
912
944
|
// ─────────────────────────────────────────────────────────────────────────
|
|
913
945
|
if (method === "GET" && path === LOCAL_SERVICE_ROUTES.runs) {
|
|
914
946
|
sendJson(res, 200, { runs: listInstanceRuns() });
|
|
@@ -964,53 +996,53 @@ async function routeApi(req, res, runtime) {
|
|
|
964
996
|
}
|
|
965
997
|
}
|
|
966
998
|
// ─────────────────────────────────────────────────────────────────────────
|
|
967
|
-
//
|
|
999
|
+
// Build-run sub-resources (instance-wide; runs are addressable by run_id).
|
|
968
1000
|
// ─────────────────────────────────────────────────────────────────────────
|
|
969
|
-
const
|
|
970
|
-
if (
|
|
971
|
-
const runId = decodeURIComponent(
|
|
972
|
-
const child =
|
|
1001
|
+
const buildRunMatch = path.match(/^\/v1\/build-runs\/([^/]+)(?:\/([^/]+))?$/);
|
|
1002
|
+
if (buildRunMatch?.[1]) {
|
|
1003
|
+
const runId = decodeURIComponent(buildRunMatch[1]);
|
|
1004
|
+
const child = buildRunMatch[2];
|
|
973
1005
|
const firstPrep = listStoredPreparations()[0];
|
|
974
1006
|
const prepDataDir = firstPrep?.prepDataDir ?? runtime.rootPath;
|
|
975
1007
|
if (method === "GET" && !child) {
|
|
976
|
-
const run = runtime.
|
|
1008
|
+
const run = runtime.getBuildRun(prepDataDir, runId);
|
|
977
1009
|
if (!run)
|
|
978
|
-
sendError(res, 404, "
|
|
1010
|
+
sendError(res, 404, "Build run not found.");
|
|
979
1011
|
else
|
|
980
1012
|
sendJson(res, 200, run);
|
|
981
1013
|
return true;
|
|
982
1014
|
}
|
|
983
1015
|
if (method === "GET" && child === "events") {
|
|
984
|
-
const events = runtime.
|
|
1016
|
+
const events = runtime.getBuildRunEvents(prepDataDir, runId);
|
|
985
1017
|
if (!events)
|
|
986
|
-
sendError(res, 404, "
|
|
1018
|
+
sendError(res, 404, "Build run not found.");
|
|
987
1019
|
else
|
|
988
1020
|
sendJson(res, 200, { events });
|
|
989
1021
|
return true;
|
|
990
1022
|
}
|
|
991
1023
|
if (method === "GET" && child === "proof") {
|
|
992
|
-
const proof = runtime.
|
|
1024
|
+
const proof = runtime.getBuildRunProof(prepDataDir, runId);
|
|
993
1025
|
if (!proof)
|
|
994
|
-
sendError(res, 404, "
|
|
1026
|
+
sendError(res, 404, "Build run not found.");
|
|
995
1027
|
else
|
|
996
1028
|
sendJson(res, 200, { proof });
|
|
997
1029
|
return true;
|
|
998
1030
|
}
|
|
999
1031
|
if (method === "GET" && child === "artifacts") {
|
|
1000
|
-
const artifacts = runtime.
|
|
1032
|
+
const artifacts = runtime.getBuildRunArtifacts(prepDataDir, runId);
|
|
1001
1033
|
if (!artifacts)
|
|
1002
|
-
sendError(res, 404, "
|
|
1034
|
+
sendError(res, 404, "Build run not found.");
|
|
1003
1035
|
else
|
|
1004
1036
|
sendJson(res, 200, { artifacts });
|
|
1005
1037
|
return true;
|
|
1006
1038
|
}
|
|
1007
1039
|
if (method === "POST" && child === "cancel") {
|
|
1008
|
-
const existing = runtime.
|
|
1040
|
+
const existing = runtime.getBuildRun(prepDataDir, runId);
|
|
1009
1041
|
if (!existing) {
|
|
1010
|
-
sendError(res, 404, "
|
|
1042
|
+
sendError(res, 404, "Build run not found.");
|
|
1011
1043
|
return true;
|
|
1012
1044
|
}
|
|
1013
|
-
const result = runtime.
|
|
1045
|
+
const result = runtime.cancelBuildRun(runId);
|
|
1014
1046
|
sendJson(res, 200, result);
|
|
1015
1047
|
return true;
|
|
1016
1048
|
}
|
|
@@ -1160,8 +1192,8 @@ async function routeApi(req, res, runtime) {
|
|
|
1160
1192
|
const body = OpenPathRequestSchema.parse(await readJsonBody(req));
|
|
1161
1193
|
// Permit opening:
|
|
1162
1194
|
// - any registered preparation root or its bound source folder
|
|
1163
|
-
// - the user
|
|
1164
|
-
// - the bundled built-in
|
|
1195
|
+
// - the user buildPlan library at `~/.interf/build-plans/`
|
|
1196
|
+
// - the bundled built-in buildPlan root inside the installed package
|
|
1165
1197
|
// (so SKILL.md / contract files in `interf-default` open correctly)
|
|
1166
1198
|
const allowedRoots = [];
|
|
1167
1199
|
for (const stored of listStoredPreparations()) {
|
|
@@ -1169,8 +1201,8 @@ async function routeApi(req, res, runtime) {
|
|
|
1169
1201
|
if (stored.source.locator)
|
|
1170
1202
|
allowedRoots.push(stored.source.locator);
|
|
1171
1203
|
}
|
|
1172
|
-
allowedRoots.push(
|
|
1173
|
-
allowedRoots.push(packageRoot()); // covers <pkg>/public-repo/
|
|
1204
|
+
allowedRoots.push(userBuildPlansRoot());
|
|
1205
|
+
allowedRoots.push(packageRoot()); // covers <pkg>/public-repo/build-plans/...
|
|
1174
1206
|
const openedPath = await openLocalPath(allowedRoots, body.path);
|
|
1175
1207
|
sendJson(res, 202, { opened: true, path: openedPath });
|
|
1176
1208
|
return true;
|
|
@@ -1183,7 +1215,7 @@ export function createLocalServiceServer(runtime) {
|
|
|
1183
1215
|
// Pre-attach a CORS context so static-asset GETs and the 404
|
|
1184
1216
|
// fallback emit the right headers even before routeApi has a
|
|
1185
1217
|
// chance to set its own. The OPTIONS preflight handling and the
|
|
1186
|
-
// mutating-
|
|
1218
|
+
// mutating-buildPlan guards still happen inside routeApi.
|
|
1187
1219
|
const origin = originHeaderValue(req);
|
|
1188
1220
|
const allowed = buildAllowedOrigins(runtime.host, runtime.port);
|
|
1189
1221
|
attachResponseContext(res, { cors: corsHeadersFor(origin, allowed) });
|
|
@@ -1191,7 +1223,7 @@ export function createLocalServiceServer(runtime) {
|
|
|
1191
1223
|
const routed = await routeApi(req, res, runtime);
|
|
1192
1224
|
if (routed)
|
|
1193
1225
|
return;
|
|
1194
|
-
if (
|
|
1226
|
+
if (sendInterfUiAsset(req, res, runtime))
|
|
1195
1227
|
return;
|
|
1196
1228
|
sendText(res, 404, "Not found.\n");
|
|
1197
1229
|
}
|
|
@@ -1293,8 +1325,8 @@ export async function startLocalService(options = {}) {
|
|
|
1293
1325
|
if (options.tokenValidator) {
|
|
1294
1326
|
runtime.setTokenValidator(options.tokenValidator);
|
|
1295
1327
|
}
|
|
1296
|
-
// Rehydrate
|
|
1297
|
-
//
|
|
1328
|
+
// Rehydrate saved preparations so subsequent
|
|
1329
|
+
// build / test / readiness calls find them after a service restart.
|
|
1298
1330
|
try {
|
|
1299
1331
|
rehydratePreparations(runtime);
|
|
1300
1332
|
}
|
|
@@ -1317,7 +1349,6 @@ export async function startLocalService(options = {}) {
|
|
|
1317
1349
|
port: boundPort,
|
|
1318
1350
|
url,
|
|
1319
1351
|
started_at: startedAt,
|
|
1320
|
-
workspaces: runtime.registeredPreparationSnapshots(),
|
|
1321
1352
|
...(authToken ? { auth_token: authToken } : {}),
|
|
1322
1353
|
}));
|
|
1323
1354
|
}
|
|
@@ -1327,8 +1358,8 @@ export async function startLocalService(options = {}) {
|
|
|
1327
1358
|
};
|
|
1328
1359
|
writeRegistryEntry();
|
|
1329
1360
|
runtime.setOnRegistryChanged(writeRegistryEntry);
|
|
1330
|
-
// Write the
|
|
1331
|
-
// `interf
|
|
1361
|
+
// Write the single-record CLI connection so `interf prep`,
|
|
1362
|
+
// `interf build`, etc. can find this engine without a pointer file.
|
|
1332
1363
|
try {
|
|
1333
1364
|
writeConnection({ url, auth_token: authToken });
|
|
1334
1365
|
}
|