@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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { BuildPlanEngineApiSchema, BuildPlanPurposeSchema, type BuildPlanStageArtifactReadAccess, type BuildPlanStageArtifactWriteAccess } from "../../engine/build/lib/schema.js";
|
|
3
|
+
import { RuntimeContractTypeSchema } from "../../contracts/lib/schema.js";
|
|
4
|
+
import { BuildPlanInputSpecSchema, type ContextInterface, type BuildPlanInputSpec } from "./context-interface.js";
|
|
5
|
+
export interface LocalBuildPlanStarterDoc {
|
|
6
|
+
relativePath: string;
|
|
7
|
+
content: string;
|
|
8
|
+
}
|
|
9
|
+
export interface LocalBuildPlanStageDefinition {
|
|
10
|
+
id: string;
|
|
11
|
+
label: string;
|
|
12
|
+
contract_type: z.infer<typeof RuntimeContractTypeSchema>;
|
|
13
|
+
skill_dir?: string;
|
|
14
|
+
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional role hint. Open-ended string; defaults to `general` at the
|
|
17
|
+
* runtime layer when missing. Maps to a connected agent via the user's
|
|
18
|
+
* role-map (`~/.interf/agents.json`).
|
|
19
|
+
*/
|
|
20
|
+
role?: string;
|
|
21
|
+
reads: BuildPlanStageArtifactReadAccess;
|
|
22
|
+
writes: BuildPlanStageArtifactWriteAccess;
|
|
23
|
+
}
|
|
24
|
+
export interface LocalBuildPlanDefinition {
|
|
25
|
+
id: string;
|
|
26
|
+
type: "build-plan";
|
|
27
|
+
engine_api?: z.infer<typeof BuildPlanEngineApiSchema>;
|
|
28
|
+
purpose?: z.infer<typeof BuildPlanPurposeSchema>;
|
|
29
|
+
inputs?: Array<z.infer<typeof BuildPlanInputSpecSchema>>;
|
|
30
|
+
label: string;
|
|
31
|
+
hint: string;
|
|
32
|
+
stages?: LocalBuildPlanStageDefinition[];
|
|
33
|
+
stage_policy_notes?: Record<string, string[]>;
|
|
34
|
+
build_plan_schema: ContextInterface;
|
|
35
|
+
starter_docs: LocalBuildPlanStarterDoc[];
|
|
36
|
+
directoryPath: string;
|
|
37
|
+
buildPlanPath: string;
|
|
38
|
+
buildPlanSchemaPath: string;
|
|
39
|
+
}
|
|
40
|
+
export declare function mergeStagePolicyNotesForStages(stages: readonly {
|
|
41
|
+
id: string;
|
|
42
|
+
}[], baseNotes: unknown, overrideNotes: Record<string, string[]> | undefined): Record<string, string[]> | undefined;
|
|
43
|
+
export declare function builtinBuildPlanPackagePath(buildPlanId: string): string;
|
|
44
|
+
export declare function buildPlanDefinitionPath(prepDataDir: string, id: string): string;
|
|
45
|
+
export declare function loadBuildPlanDefinitionFromDir(dirPath: string): LocalBuildPlanDefinition | null;
|
|
46
|
+
export declare function isNeutralScaffoldBuildPlanDefinition(definition: Pick<LocalBuildPlanDefinition, "purpose" | "stages" | "build_plan_schema">): boolean;
|
|
47
|
+
export declare function listLocalBuildPlanDefinitions(prepDataDir: string): LocalBuildPlanDefinition[];
|
|
48
|
+
export declare function loadLocalBuildPlanDefinition(prepDataDir: string, id: string): LocalBuildPlanDefinition | null;
|
|
49
|
+
export declare function resolveBuildPlanPackageSourcePath(prepDataDir: string, buildPlanId: string): string | null;
|
|
50
|
+
export declare function seedLocalDefaultBuildPlan(options: {
|
|
51
|
+
prepDataDir: string;
|
|
52
|
+
}): {
|
|
53
|
+
buildPlanId: string;
|
|
54
|
+
targetPath: string;
|
|
55
|
+
alreadyExisted: boolean;
|
|
56
|
+
};
|
|
57
|
+
export declare function isBuildPlanId(value: string): boolean;
|
|
58
|
+
export declare function patchBuildPlanPackageMetadata(dirPath: string, options: {
|
|
59
|
+
id?: string;
|
|
60
|
+
inputs?: BuildPlanInputSpec[];
|
|
61
|
+
label?: string;
|
|
62
|
+
hint?: string;
|
|
63
|
+
stagePolicyNotes?: Record<string, string[]>;
|
|
64
|
+
}): void;
|
|
65
|
+
export declare function describeBuildPlanPackagePortability(dirPath: string): string[];
|
|
66
|
+
export declare function isPortableBuildPlanPackage(dirPath: string): boolean;
|
|
67
|
+
export declare function copyBuildPlanPackageDirectory(sourceBuildPlanPath: string, targetBuildPlanPath: string): void;
|
|
68
|
+
export interface BuildPlanValidationResult {
|
|
69
|
+
ok: boolean;
|
|
70
|
+
summary: string;
|
|
71
|
+
errors: string[];
|
|
72
|
+
counts: Record<string, number>;
|
|
73
|
+
}
|
|
74
|
+
export declare function validateBuildPlanPackage(dirPath: string): BuildPlanValidationResult;
|
package/dist/packages/{methods/package/local-methods.js → build-plans/package/local-build-plans.js}
RENAMED
|
@@ -5,30 +5,30 @@ import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
|
5
5
|
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
6
6
|
import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
7
7
|
import { isMarkdownFile } from "../../contracts/utils/file-types.js";
|
|
8
|
-
import {
|
|
8
|
+
import { BuildPlanEngineApiSchema, BuildPlanPurposeSchema, BuildPlanStageArtifactReadAccessSchema, BuildPlanStageArtifactWriteAccessSchema, } from "../../engine/build/lib/schema.js";
|
|
9
9
|
import { RuntimeContractTypeSchema, InterfIdPattern, } from "../../contracts/lib/schema.js";
|
|
10
|
-
import { asPreparationDataDir,
|
|
11
|
-
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, listContextInterfaceArtifacts, readContextInterface,
|
|
10
|
+
import { asPreparationDataDir, preparationBuildPlansRoot, } from "../../contracts/lib/preparation-paths.js";
|
|
11
|
+
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, listContextInterfaceArtifacts, readContextInterface, BuildPlanInputSpecSchema, writeContextInterface, } from "./context-interface.js";
|
|
12
12
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
13
|
-
const
|
|
13
|
+
const LocalBuildPlanStageDefinitionSchema = z.object({
|
|
14
14
|
id: z.string().regex(InterfIdPattern),
|
|
15
15
|
label: z.string().min(1),
|
|
16
16
|
contract_type: RuntimeContractTypeSchema,
|
|
17
17
|
skill_dir: z.string().regex(InterfIdPattern).optional(),
|
|
18
18
|
description: z.string().min(1).optional(),
|
|
19
19
|
role: z.string().min(1).optional(),
|
|
20
|
-
reads:
|
|
21
|
-
writes:
|
|
20
|
+
reads: BuildPlanStageArtifactReadAccessSchema,
|
|
21
|
+
writes: BuildPlanStageArtifactWriteAccessSchema,
|
|
22
22
|
});
|
|
23
|
-
const
|
|
23
|
+
const LocalBuildPlanDefinitionSchema = z.object({
|
|
24
24
|
id: z.string().regex(InterfIdPattern),
|
|
25
|
-
type: z.literal("
|
|
26
|
-
|
|
27
|
-
purpose:
|
|
28
|
-
inputs: z.array(
|
|
25
|
+
type: z.literal("build-plan"),
|
|
26
|
+
engine_api: BuildPlanEngineApiSchema.optional(),
|
|
27
|
+
purpose: BuildPlanPurposeSchema.optional(),
|
|
28
|
+
inputs: z.array(BuildPlanInputSpecSchema).min(1).optional(),
|
|
29
29
|
label: z.string().min(1),
|
|
30
30
|
hint: z.string().min(1),
|
|
31
|
-
stages: z.array(
|
|
31
|
+
stages: z.array(LocalBuildPlanStageDefinitionSchema).min(1).optional(),
|
|
32
32
|
stage_policy_notes: z.record(z.string(), z.array(z.string())).optional(),
|
|
33
33
|
});
|
|
34
34
|
function normalizeStagePolicyNotes(value) {
|
|
@@ -62,39 +62,39 @@ export function mergeStagePolicyNotesForStages(stages, baseNotes, overrideNotes)
|
|
|
62
62
|
}
|
|
63
63
|
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
64
64
|
}
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function buildPlanRootPath(prepDataDir) {
|
|
66
|
+
return preparationBuildPlansRoot(asPreparationDataDir(prepDataDir));
|
|
67
67
|
}
|
|
68
|
-
export function
|
|
69
|
-
return join(PACKAGE_ROOT, "public-repo", "
|
|
68
|
+
export function builtinBuildPlanPackagePath(buildPlanId) {
|
|
69
|
+
return join(PACKAGE_ROOT, "public-repo", "build-plans", buildPlanId);
|
|
70
70
|
}
|
|
71
|
-
export function
|
|
72
|
-
return join(
|
|
71
|
+
export function buildPlanDefinitionPath(prepDataDir, id) {
|
|
72
|
+
return join(buildPlanRootPath(prepDataDir), id);
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function isSupportedBuildPlanStarterDocPath(relativePath) {
|
|
75
75
|
if (relativePath === "README.md")
|
|
76
76
|
return true;
|
|
77
77
|
if (relativePath.startsWith("improve/"))
|
|
78
78
|
return true;
|
|
79
79
|
if (relativePath.startsWith("use/query/"))
|
|
80
80
|
return true;
|
|
81
|
-
if (relativePath.startsWith("
|
|
81
|
+
if (relativePath.startsWith("build/stages/"))
|
|
82
82
|
return true;
|
|
83
83
|
return false;
|
|
84
84
|
}
|
|
85
85
|
function collectStarterDocs(dirPath) {
|
|
86
86
|
return listFilesRecursive(dirPath, isMarkdownFile)
|
|
87
87
|
.map((filePath) => relative(dirPath, filePath).replaceAll("\\", "/"))
|
|
88
|
-
.filter((relativePath) =>
|
|
88
|
+
.filter((relativePath) => isSupportedBuildPlanStarterDocPath(relativePath))
|
|
89
89
|
.map((relativePath) => ({
|
|
90
90
|
relativePath,
|
|
91
91
|
content: readFileSync(join(dirPath, relativePath), "utf8"),
|
|
92
92
|
}))
|
|
93
93
|
.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function buildPlanPackageCopyPaths(dirPath) {
|
|
96
96
|
return [
|
|
97
|
-
"
|
|
97
|
+
"build-plan.json",
|
|
98
98
|
CONTEXT_INTERFACE_FILE,
|
|
99
99
|
...collectStarterDocs(dirPath).map((doc) => doc.relativePath),
|
|
100
100
|
];
|
|
@@ -107,51 +107,51 @@ function copyRelativeFile(sourceRoot, targetRoot, relativePath) {
|
|
|
107
107
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
108
108
|
cpSync(sourcePath, targetPath, { force: true });
|
|
109
109
|
}
|
|
110
|
-
function
|
|
111
|
-
rmSync(
|
|
112
|
-
mkdirSync(
|
|
113
|
-
for (const relativePath of
|
|
114
|
-
copyRelativeFile(
|
|
110
|
+
function copyBuildPlanPackageFiles(sourceBuildPlanPath, targetBuildPlanPath) {
|
|
111
|
+
rmSync(targetBuildPlanPath, { recursive: true, force: true });
|
|
112
|
+
mkdirSync(targetBuildPlanPath, { recursive: true });
|
|
113
|
+
for (const relativePath of buildPlanPackageCopyPaths(sourceBuildPlanPath)) {
|
|
114
|
+
copyRelativeFile(sourceBuildPlanPath, targetBuildPlanPath, relativePath);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
|
-
export function
|
|
118
|
-
const
|
|
119
|
-
? join(dirPath, "
|
|
117
|
+
export function loadBuildPlanDefinitionFromDir(dirPath) {
|
|
118
|
+
const buildPlanPath = existsSync(join(dirPath, "build-plan.json"))
|
|
119
|
+
? join(dirPath, "build-plan.json")
|
|
120
120
|
: null;
|
|
121
|
-
if (!
|
|
121
|
+
if (!buildPlanPath)
|
|
122
122
|
return null;
|
|
123
|
-
const definition = readJsonFileWithSchema(
|
|
123
|
+
const definition = readJsonFileWithSchema(buildPlanPath, "local Build Plan definition", LocalBuildPlanDefinitionSchema);
|
|
124
124
|
if (!definition)
|
|
125
125
|
return null;
|
|
126
|
-
const
|
|
127
|
-
if (!
|
|
126
|
+
const buildPlanSchema = readContextInterface(dirPath);
|
|
127
|
+
if (!buildPlanSchema)
|
|
128
128
|
return null;
|
|
129
|
-
if (definition.type !== "
|
|
130
|
-
warnInterf(`Warning: local
|
|
129
|
+
if (definition.type !== "build-plan") {
|
|
130
|
+
warnInterf(`Warning: local Build Plan definition at ${buildPlanPath} has unexpected type "${definition.type}".`);
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
133
|
return {
|
|
134
134
|
...definition,
|
|
135
|
-
|
|
135
|
+
build_plan_schema: buildPlanSchema,
|
|
136
136
|
starter_docs: collectStarterDocs(dirPath),
|
|
137
137
|
directoryPath: dirPath,
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
buildPlanPath,
|
|
139
|
+
buildPlanSchemaPath: contextInterfaceFilePath(dirPath),
|
|
140
140
|
};
|
|
141
141
|
}
|
|
142
|
-
export function
|
|
143
|
-
const hasScaffoldPurpose = definition.purpose?.label === "From-scratch
|
|
142
|
+
export function isNeutralScaffoldBuildPlanDefinition(definition) {
|
|
143
|
+
const hasScaffoldPurpose = definition.purpose?.label === "From-scratch Build Plan draft" ||
|
|
144
144
|
Boolean(definition.purpose?.task_hint?.includes("Replace this neutral scaffold"));
|
|
145
145
|
const hasScaffoldStage = Boolean(definition.stages?.some((stage) => stage.id === "prepare" &&
|
|
146
|
-
stage.contract_type === "
|
|
146
|
+
stage.contract_type === "build-plan-draft-stage" &&
|
|
147
147
|
stage.writes.includes("draft-context")));
|
|
148
|
-
const hasScaffoldArtifact = listContextInterfaceArtifacts(definition.
|
|
148
|
+
const hasScaffoldArtifact = listContextInterfaceArtifacts(definition.build_plan_schema).some((artifact) => artifact.id === "draft-context" &&
|
|
149
149
|
artifact.description.includes("neutral authoring scaffold"));
|
|
150
150
|
return hasScaffoldPurpose || hasScaffoldStage || hasScaffoldArtifact;
|
|
151
151
|
}
|
|
152
|
-
export function
|
|
152
|
+
export function listLocalBuildPlanDefinitions(prepDataDir) {
|
|
153
153
|
const definitions = new Map();
|
|
154
|
-
const root =
|
|
154
|
+
const root = buildPlanRootPath(prepDataDir);
|
|
155
155
|
if (existsSync(root)) {
|
|
156
156
|
for (const entryPath of readdirSync(root).map((entry) => join(root, entry))) {
|
|
157
157
|
try {
|
|
@@ -161,73 +161,73 @@ export function listLocalMethodDefinitions(prepDataDir) {
|
|
|
161
161
|
catch {
|
|
162
162
|
continue;
|
|
163
163
|
}
|
|
164
|
-
const definition =
|
|
165
|
-
if (definition && !
|
|
164
|
+
const definition = loadBuildPlanDefinitionFromDir(entryPath);
|
|
165
|
+
if (definition && !isNeutralScaffoldBuildPlanDefinition(definition)) {
|
|
166
166
|
definitions.set(definition.id, definition);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
}
|
|
170
170
|
return [...definitions.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
171
171
|
}
|
|
172
|
-
export function
|
|
173
|
-
const definition =
|
|
174
|
-
if (!definition ||
|
|
172
|
+
export function loadLocalBuildPlanDefinition(prepDataDir, id) {
|
|
173
|
+
const definition = loadBuildPlanDefinitionFromDir(buildPlanDefinitionPath(prepDataDir, id));
|
|
174
|
+
if (!definition || isNeutralScaffoldBuildPlanDefinition(definition))
|
|
175
175
|
return null;
|
|
176
176
|
return definition;
|
|
177
177
|
}
|
|
178
|
-
export function
|
|
179
|
-
const localPath =
|
|
180
|
-
const local =
|
|
181
|
-
if (local && !
|
|
178
|
+
export function resolveBuildPlanPackageSourcePath(prepDataDir, buildPlanId) {
|
|
179
|
+
const localPath = buildPlanDefinitionPath(prepDataDir, buildPlanId);
|
|
180
|
+
const local = loadBuildPlanDefinitionFromDir(localPath);
|
|
181
|
+
if (local && !isNeutralScaffoldBuildPlanDefinition(local))
|
|
182
182
|
return localPath;
|
|
183
|
-
const builtinPath =
|
|
184
|
-
if (
|
|
183
|
+
const builtinPath = builtinBuildPlanPackagePath(buildPlanId);
|
|
184
|
+
if (loadBuildPlanDefinitionFromDir(builtinPath))
|
|
185
185
|
return builtinPath;
|
|
186
186
|
return null;
|
|
187
187
|
}
|
|
188
|
-
export function
|
|
189
|
-
const
|
|
190
|
-
const targetPath =
|
|
191
|
-
if (existsSync(join(targetPath, "
|
|
192
|
-
return {
|
|
188
|
+
export function seedLocalDefaultBuildPlan(options) {
|
|
189
|
+
const buildPlanId = "interf-default";
|
|
190
|
+
const targetPath = buildPlanDefinitionPath(options.prepDataDir, buildPlanId);
|
|
191
|
+
if (existsSync(join(targetPath, "build-plan.json"))) {
|
|
192
|
+
return { buildPlanId, targetPath, alreadyExisted: true };
|
|
193
193
|
}
|
|
194
|
-
const builtinInterfPath =
|
|
195
|
-
if (!existsSync(join(builtinInterfPath, "
|
|
196
|
-
throw new Error(`Built-in "${
|
|
194
|
+
const builtinInterfPath = builtinBuildPlanPackagePath(buildPlanId);
|
|
195
|
+
if (!existsSync(join(builtinInterfPath, "build-plan.json"))) {
|
|
196
|
+
throw new Error(`Built-in "${buildPlanId}" Build Plan package not found at ${builtinInterfPath}.`);
|
|
197
197
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
id:
|
|
201
|
-
label: "Built-in Interf
|
|
202
|
-
hint: "Built-in file-processing
|
|
198
|
+
copyBuildPlanPackageDirectory(builtinInterfPath, targetPath);
|
|
199
|
+
patchBuildPlanPackageMetadata(targetPath, {
|
|
200
|
+
id: buildPlanId,
|
|
201
|
+
label: "Built-in Interf Build Plan",
|
|
202
|
+
hint: "Built-in file-processing Build Plan: summarize source-grounded evidence, structure cross-file connections, and shape verifiable context around the saved readiness checks.",
|
|
203
203
|
});
|
|
204
|
-
return {
|
|
204
|
+
return { buildPlanId, targetPath, alreadyExisted: false };
|
|
205
205
|
}
|
|
206
|
-
export function
|
|
206
|
+
export function isBuildPlanId(value) {
|
|
207
207
|
return InterfIdPattern.test(value);
|
|
208
208
|
}
|
|
209
|
-
function
|
|
210
|
-
const
|
|
211
|
-
const raw = readJsonFileUnchecked(
|
|
209
|
+
function readBuildPlanJsonObject(dirPath) {
|
|
210
|
+
const buildPlanPath = join(dirPath, "build-plan.json");
|
|
211
|
+
const raw = readJsonFileUnchecked(buildPlanPath, "Build Plan package");
|
|
212
212
|
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
213
|
-
throw new Error(`
|
|
213
|
+
throw new Error(`Build Plan package at ${dirPath} is missing a valid build-plan.json.`);
|
|
214
214
|
}
|
|
215
215
|
return { ...raw };
|
|
216
216
|
}
|
|
217
|
-
export function
|
|
218
|
-
const
|
|
219
|
-
const
|
|
220
|
-
const normalizedStages = Array.isArray(
|
|
221
|
-
?
|
|
217
|
+
export function patchBuildPlanPackageMetadata(dirPath, options) {
|
|
218
|
+
const buildPlanPath = join(dirPath, "build-plan.json");
|
|
219
|
+
const buildPlanJson = readBuildPlanJsonObject(dirPath);
|
|
220
|
+
const normalizedStages = Array.isArray(buildPlanJson.stages) && buildPlanJson.stages.length > 0
|
|
221
|
+
? buildPlanJson.stages
|
|
222
222
|
: null;
|
|
223
223
|
if (!normalizedStages) {
|
|
224
|
-
throw new Error(`Cannot patch
|
|
224
|
+
throw new Error(`Cannot patch Build Plan package at ${dirPath}: build-plan.json must declare explicit stages before it can be copied or rewritten.`);
|
|
225
225
|
}
|
|
226
|
-
const
|
|
227
|
-
...
|
|
228
|
-
type: "
|
|
229
|
-
|
|
230
|
-
kind: "
|
|
226
|
+
const nextBuildPlanJson = {
|
|
227
|
+
...buildPlanJson,
|
|
228
|
+
type: "build-plan",
|
|
229
|
+
engine_api: buildPlanJson.engine_api ?? {
|
|
230
|
+
kind: "build",
|
|
231
231
|
version: 1,
|
|
232
232
|
},
|
|
233
233
|
stages: normalizedStages,
|
|
@@ -236,18 +236,18 @@ export function patchMethodPackageMetadata(dirPath, options) {
|
|
|
236
236
|
...(options.label ? { label: options.label } : {}),
|
|
237
237
|
...(options.hint ? { hint: options.hint } : {}),
|
|
238
238
|
};
|
|
239
|
-
const mergedStagePolicyNotes = mergeStagePolicyNotesForStages(normalizedStages,
|
|
239
|
+
const mergedStagePolicyNotes = mergeStagePolicyNotesForStages(normalizedStages, buildPlanJson.stage_policy_notes, options.stagePolicyNotes);
|
|
240
240
|
if (mergedStagePolicyNotes) {
|
|
241
|
-
|
|
241
|
+
nextBuildPlanJson.stage_policy_notes = mergedStagePolicyNotes;
|
|
242
242
|
}
|
|
243
243
|
else {
|
|
244
|
-
delete
|
|
244
|
+
delete nextBuildPlanJson.stage_policy_notes;
|
|
245
245
|
}
|
|
246
|
-
writeFileSync(
|
|
247
|
-
const schemaLabel = `${String(
|
|
246
|
+
writeFileSync(buildPlanPath, JSON.stringify(nextBuildPlanJson, null, 2) + "\n");
|
|
247
|
+
const schemaLabel = `${String(nextBuildPlanJson.label ?? buildPlanJson.label ?? options.id ?? "Build Plan")} Build Plan schema`;
|
|
248
248
|
const existingSchema = readContextInterface(dirPath);
|
|
249
249
|
if (!existingSchema) {
|
|
250
|
-
throw new Error(`Cannot patch
|
|
250
|
+
throw new Error(`Cannot patch Build Plan package at ${dirPath}: missing ${CONTEXT_INTERFACE_FILE}. Restore or reseed the package instead of regenerating a schema from build-plan.json.`);
|
|
251
251
|
}
|
|
252
252
|
writeContextInterface(dirPath, {
|
|
253
253
|
...existingSchema,
|
|
@@ -259,13 +259,13 @@ function resolveStageSkillDir(stage) {
|
|
|
259
259
|
? stage.skill_dir
|
|
260
260
|
: stage.id;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function collectBuildPlanPackageStructureIssues(dirPath, stages) {
|
|
263
263
|
const issues = [];
|
|
264
|
-
const
|
|
265
|
-
if (!existsSync(
|
|
266
|
-
issues.push("missing
|
|
264
|
+
const buildPlanPath = join(dirPath, "build-plan.json");
|
|
265
|
+
if (!existsSync(buildPlanPath))
|
|
266
|
+
issues.push("missing build-plan.json");
|
|
267
267
|
if (!contextInterfaceExists(dirPath))
|
|
268
|
-
issues.push("missing
|
|
268
|
+
issues.push("missing build-plan.schema.json");
|
|
269
269
|
if (!existsSync(join(dirPath, "README.md")))
|
|
270
270
|
issues.push("missing README.md");
|
|
271
271
|
if (!existsSync(join(dirPath, "improve", "SKILL.md")))
|
|
@@ -276,77 +276,77 @@ function collectMethodPackageStructureIssues(dirPath, stages) {
|
|
|
276
276
|
return issues;
|
|
277
277
|
for (const stage of stages) {
|
|
278
278
|
const skillDir = resolveStageSkillDir(stage);
|
|
279
|
-
if (!existsSync(join(dirPath, "
|
|
280
|
-
issues.push(`missing
|
|
279
|
+
if (!existsSync(join(dirPath, "build", "stages", skillDir, "SKILL.md"))) {
|
|
280
|
+
issues.push(`missing build/stages/${skillDir}/SKILL.md`);
|
|
281
281
|
}
|
|
282
282
|
}
|
|
283
283
|
return issues;
|
|
284
284
|
}
|
|
285
|
-
export function
|
|
286
|
-
const issues =
|
|
285
|
+
export function describeBuildPlanPackagePortability(dirPath) {
|
|
286
|
+
const issues = collectBuildPlanPackageStructureIssues(dirPath, null);
|
|
287
287
|
if (issues.length > 0)
|
|
288
288
|
return issues;
|
|
289
|
-
let
|
|
289
|
+
let buildPlanJson;
|
|
290
290
|
try {
|
|
291
|
-
|
|
291
|
+
buildPlanJson = readBuildPlanJsonObject(dirPath);
|
|
292
292
|
}
|
|
293
293
|
catch (error) {
|
|
294
294
|
issues.push(error instanceof Error ? error.message : String(error));
|
|
295
295
|
return issues;
|
|
296
296
|
}
|
|
297
|
-
const parsed =
|
|
297
|
+
const parsed = LocalBuildPlanDefinitionSchema.safeParse(buildPlanJson);
|
|
298
298
|
if (!parsed.success) {
|
|
299
299
|
issues.push(...parsed.error.issues.map((issue) => issue.path.length > 0
|
|
300
|
-
? `
|
|
301
|
-
: `
|
|
300
|
+
? `build-plan.json ${issue.path.join(".")}: ${issue.message}`
|
|
301
|
+
: `build-plan.json: ${issue.message}`));
|
|
302
302
|
return issues;
|
|
303
303
|
}
|
|
304
304
|
if (!parsed.data.stages || parsed.data.stages.length === 0) {
|
|
305
|
-
issues.push("
|
|
305
|
+
issues.push("build-plan.json must declare explicit stages for a portable Build Plan package");
|
|
306
306
|
return issues;
|
|
307
307
|
}
|
|
308
308
|
// Structural issues already returned earlier; only stage-skill files can be missing now.
|
|
309
309
|
return [
|
|
310
310
|
...issues,
|
|
311
|
-
...
|
|
311
|
+
...collectBuildPlanPackageStructureIssues(dirPath, parsed.data.stages ?? null),
|
|
312
312
|
];
|
|
313
313
|
}
|
|
314
|
-
export function
|
|
315
|
-
return
|
|
314
|
+
export function isPortableBuildPlanPackage(dirPath) {
|
|
315
|
+
return describeBuildPlanPackagePortability(dirPath).length === 0;
|
|
316
316
|
}
|
|
317
|
-
export function
|
|
318
|
-
const portabilityIssues =
|
|
317
|
+
export function copyBuildPlanPackageDirectory(sourceBuildPlanPath, targetBuildPlanPath) {
|
|
318
|
+
const portabilityIssues = describeBuildPlanPackagePortability(sourceBuildPlanPath);
|
|
319
319
|
if (portabilityIssues.length > 0) {
|
|
320
|
-
throw new Error(`
|
|
320
|
+
throw new Error(`Build Plan package at ${sourceBuildPlanPath} is not directly copyable: ${portabilityIssues.join("; ")}.`);
|
|
321
321
|
}
|
|
322
|
-
mkdirSync(dirname(
|
|
323
|
-
|
|
322
|
+
mkdirSync(dirname(targetBuildPlanPath), { recursive: true });
|
|
323
|
+
copyBuildPlanPackageFiles(sourceBuildPlanPath, targetBuildPlanPath);
|
|
324
324
|
}
|
|
325
|
-
export function
|
|
326
|
-
const
|
|
327
|
-
if (!existsSync(
|
|
325
|
+
export function validateBuildPlanPackage(dirPath) {
|
|
326
|
+
const buildPlanPath = join(dirPath, "build-plan.json");
|
|
327
|
+
if (!existsSync(buildPlanPath)) {
|
|
328
328
|
return {
|
|
329
329
|
ok: false,
|
|
330
|
-
summary: `No
|
|
331
|
-
errors: ["Missing
|
|
330
|
+
summary: `No build-plan.json found at ${dirPath}`,
|
|
331
|
+
errors: ["Missing build-plan.json"],
|
|
332
332
|
counts: {},
|
|
333
333
|
};
|
|
334
334
|
}
|
|
335
|
-
const raw = readJsonFileUnchecked(
|
|
335
|
+
const raw = readJsonFileUnchecked(buildPlanPath, "Build Plan package");
|
|
336
336
|
if (!raw) {
|
|
337
337
|
return {
|
|
338
338
|
ok: false,
|
|
339
|
-
summary: `Failed to parse
|
|
340
|
-
errors: ["Invalid JSON in
|
|
339
|
+
summary: `Failed to parse build-plan.json at ${buildPlanPath}`,
|
|
340
|
+
errors: ["Invalid JSON in build-plan.json"],
|
|
341
341
|
counts: {},
|
|
342
342
|
};
|
|
343
343
|
}
|
|
344
|
-
const parsed =
|
|
344
|
+
const parsed = LocalBuildPlanDefinitionSchema.safeParse(raw);
|
|
345
345
|
if (!parsed.success) {
|
|
346
346
|
const issues = parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`);
|
|
347
347
|
return {
|
|
348
348
|
ok: false,
|
|
349
|
-
summary: `
|
|
349
|
+
summary: `build-plan.json failed validation: ${issues.length} issue(s)`,
|
|
350
350
|
errors: issues,
|
|
351
351
|
counts: {},
|
|
352
352
|
};
|
|
@@ -354,32 +354,32 @@ export function validateMethodPackage(dirPath) {
|
|
|
354
354
|
const def = parsed.data;
|
|
355
355
|
const errors = [];
|
|
356
356
|
if (!def.stages || def.stages.length === 0) {
|
|
357
|
-
errors.push("
|
|
357
|
+
errors.push("build-plan.json must declare explicit stages.");
|
|
358
358
|
}
|
|
359
359
|
if (def.stage_policy_notes && def.stages) {
|
|
360
360
|
const stageIds = new Set(def.stages.map((stage) => stage.id));
|
|
361
361
|
for (const stageId of Object.keys(def.stage_policy_notes)) {
|
|
362
362
|
if (!stageIds.has(stageId)) {
|
|
363
|
-
errors.push(`
|
|
363
|
+
errors.push(`build-plan.json stage_policy_notes references unknown stage "${stageId}".`);
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
}
|
|
367
|
-
for (const issue of
|
|
367
|
+
for (const issue of collectBuildPlanPackageStructureIssues(dirPath, def.stages ?? null)) {
|
|
368
368
|
const formatted = issue.startsWith("missing ")
|
|
369
369
|
? `Missing ${issue.slice("missing ".length)}.`
|
|
370
370
|
: issue;
|
|
371
371
|
errors.push(formatted);
|
|
372
372
|
}
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
373
|
+
const buildPlanSchema = readContextInterface(dirPath);
|
|
374
|
+
if (!buildPlanSchema) {
|
|
375
375
|
errors.push(...describeContextInterfaceValidationIssues(dirPath));
|
|
376
376
|
}
|
|
377
|
-
if (
|
|
377
|
+
if (buildPlanSchema) {
|
|
378
378
|
const stages = def.stages ?? [];
|
|
379
379
|
const stageIds = new Set(stages.map((stage) => stage.id));
|
|
380
380
|
const seenPaths = new Map();
|
|
381
381
|
const seenArtifactIds = new Set();
|
|
382
|
-
const schemaArtifacts = listContextInterfaceArtifacts(
|
|
382
|
+
const schemaArtifacts = listContextInterfaceArtifacts(buildPlanSchema);
|
|
383
383
|
const artifactById = new Map(schemaArtifacts.map((artifact) => [artifact.id, artifact]));
|
|
384
384
|
const normalizedParts = (value) => value.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
385
385
|
const hasOverlappingPath = (value, other) => {
|
|
@@ -391,27 +391,27 @@ export function validateMethodPackage(dirPath) {
|
|
|
391
391
|
};
|
|
392
392
|
for (const artifact of schemaArtifacts) {
|
|
393
393
|
if (seenArtifactIds.has(artifact.id)) {
|
|
394
|
-
errors.push(`
|
|
394
|
+
errors.push(`build-plan.schema.json repeats Artifact id "${artifact.id}".`);
|
|
395
395
|
}
|
|
396
396
|
seenArtifactIds.add(artifact.id);
|
|
397
397
|
const existingPathOwner = seenPaths.get(artifact.path);
|
|
398
398
|
if (existingPathOwner) {
|
|
399
|
-
errors.push(`
|
|
399
|
+
errors.push(`build-plan.schema.json repeats Artifact path "${artifact.path}".`);
|
|
400
400
|
}
|
|
401
401
|
for (const [existingPath, existingZoneId] of seenPaths.entries()) {
|
|
402
402
|
if (existingPath === artifact.path)
|
|
403
403
|
continue;
|
|
404
404
|
if (hasOverlappingPath(artifact.path, existingPath)) {
|
|
405
|
-
errors.push(`
|
|
405
|
+
errors.push(`build-plan.schema.json Artifacts "${artifact.id}" and "${existingZoneId}" overlap on path "${artifact.path}" / "${existingPath}".`);
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
408
|
seenPaths.set(artifact.path, artifact.id);
|
|
409
409
|
if ((artifact.role === "input" || artifact.role === "runtime") && artifact.owned_by.length > 0) {
|
|
410
|
-
errors.push(`
|
|
410
|
+
errors.push(`build-plan.schema.json Artifact "${artifact.id}" cannot declare owners because its role is "${artifact.role}".`);
|
|
411
411
|
}
|
|
412
412
|
for (const owner of artifact.owned_by) {
|
|
413
413
|
if (!stageIds.has(owner)) {
|
|
414
|
-
errors.push(`
|
|
414
|
+
errors.push(`build-plan.schema.json references unknown stage "${owner}" for Artifact path "${artifact.path}".`);
|
|
415
415
|
}
|
|
416
416
|
}
|
|
417
417
|
}
|
|
@@ -431,42 +431,42 @@ export function validateMethodPackage(dirPath) {
|
|
|
431
431
|
errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but Artifacts with role "${artifact.role}" are engine-owned inputs, not writable stage outputs.`);
|
|
432
432
|
}
|
|
433
433
|
if (!artifact.owned_by.includes(stage.id)) {
|
|
434
|
-
errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but that Artifact is not owned by the stage in
|
|
434
|
+
errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but that Artifact is not owned by the stage in build-plan.schema.json.`);
|
|
435
435
|
}
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
438
|
}
|
|
439
|
-
const stageDirs = existsSync(join(dirPath, "
|
|
440
|
-
? listFilesRecursive(join(dirPath, "
|
|
439
|
+
const stageDirs = existsSync(join(dirPath, "build", "stages"))
|
|
440
|
+
? listFilesRecursive(join(dirPath, "build", "stages"), (filePath) => basename(filePath) === "SKILL.md")
|
|
441
441
|
: [];
|
|
442
442
|
const counts = {
|
|
443
443
|
starter_docs: collectStarterDocs(dirPath).length,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
444
|
+
build_stage_docs: stageDirs.length,
|
|
445
|
+
build_artifacts: buildPlanSchema ? listContextInterfaceArtifacts(buildPlanSchema).length : 0,
|
|
446
|
+
build_plan_artifacts: buildPlanSchema ? listContextInterfaceArtifacts(buildPlanSchema).length : 0,
|
|
447
447
|
};
|
|
448
448
|
return {
|
|
449
449
|
ok: errors.length === 0,
|
|
450
|
-
summary: errors.length === 0 ? "
|
|
450
|
+
summary: errors.length === 0 ? "Build Plan package is valid." : `Build Plan package has ${errors.length} issue(s).`,
|
|
451
451
|
errors,
|
|
452
452
|
counts,
|
|
453
453
|
};
|
|
454
454
|
}
|
|
455
455
|
function describeContextInterfaceValidationIssues(dirPath) {
|
|
456
|
-
const
|
|
457
|
-
if (!existsSync(
|
|
458
|
-
return ["
|
|
456
|
+
const buildPlanSchemaPath = contextInterfaceFilePath(dirPath);
|
|
457
|
+
if (!existsSync(buildPlanSchemaPath)) {
|
|
458
|
+
return ["build-plan.schema.json is missing."];
|
|
459
459
|
}
|
|
460
|
-
const raw = readJsonFileUnchecked(
|
|
460
|
+
const raw = readJsonFileUnchecked(buildPlanSchemaPath, "Build Plan context interface");
|
|
461
461
|
if (raw === null) {
|
|
462
|
-
return ["
|
|
462
|
+
return ["build-plan.schema.json is invalid JSON."];
|
|
463
463
|
}
|
|
464
464
|
const parsed = ContextInterfaceSchema.safeParse(raw);
|
|
465
465
|
if (parsed.success) {
|
|
466
|
-
return ["
|
|
466
|
+
return ["build-plan.schema.json is missing or invalid."];
|
|
467
467
|
}
|
|
468
468
|
return parsed.error.issues.map((issue) => {
|
|
469
469
|
const path = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
470
|
-
return `
|
|
470
|
+
return `build-plan.schema.json ${path}: ${issue.message}`;
|
|
471
471
|
});
|
|
472
472
|
}
|