@interf/compiler 0.18.0 → 0.22.0
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/dist/cli/commands/build-plan.d.ts +2 -0
- package/dist/cli/commands/build-plan.js +376 -0
- 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.d.ts +0 -34
- package/dist/cli/commands/mcp.js +261 -60
- package/dist/cli/commands/prep.js +67 -35
- package/dist/cli/commands/reset.d.ts +1 -1
- package/dist/cli/commands/reset.js +6 -6
- package/dist/cli/commands/runs.js +105 -33
- package/dist/cli/commands/status.js +4 -2
- package/dist/cli/commands/test.d.ts +10 -0
- package/dist/cli/commands/{verify.js → test.js} +19 -21
- package/dist/cli/commands/web.js +82 -8
- package/dist/cli/commands/wizard.js +63 -64
- package/dist/cli/index.d.ts +4 -4
- package/dist/cli/index.js +7 -7
- package/dist/interf-ui/404.html +1 -0
- package/dist/interf-ui/__next.__PAGE__.txt +10 -0
- package/dist/{compiler-ui → interf-ui}/__next._full.txt +12 -12
- package/dist/interf-ui/__next._head.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/__next._index.txt +4 -4
- package/dist/{compiler-ui → interf-ui}/__next._tree.txt +3 -3
- 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/{compiler-ui/_next/static/chunks/0_i-3_5l9t2qe.js → interf-ui/_next/static/chunks/0dn41fa_zvgsl.js} +1 -1
- 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/{compiler-ui/_next/static/chunks/08g7lvje.te.u.js → interf-ui/_next/static/chunks/0nv3am99vjzn4.js} +1 -1
- package/dist/{compiler-ui/_next/static/chunks/0n51hrfoufc7g.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/{compiler-ui/_next/static/chunks/08m7vf5asqlsm.js → interf-ui/_next/static/chunks/14dznb2qpt-ho.js} +5 -5
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +5 -0
- package/dist/{compiler-ui/_next/static/chunks/turbopack-10e~t1yzi4svj.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/{compiler-ui → interf-ui}/_not-found/__next._full.txt +9 -9
- package/dist/interf-ui/_not-found/__next._head.txt +5 -0
- package/dist/{compiler-ui → interf-ui}/_not-found/__next._index.txt +4 -4
- 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 -2
- package/dist/interf-ui/_not-found.html +1 -0
- package/dist/{compiler-ui → interf-ui}/_not-found.txt +9 -9
- package/dist/interf-ui/index.html +1 -0
- package/dist/{compiler-ui → interf-ui}/index.txt +12 -12
- 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} +57 -88
- 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/build-plans/package/local-build-plans.js +472 -0
- 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 +38 -41
- package/dist/packages/contracts/lib/schema.js +44 -35
- package/dist/packages/engine/action-definitions.d.ts +228 -67
- package/dist/packages/engine/action-definitions.js +277 -273
- package/dist/packages/engine/action-planner.d.ts +2 -2
- package/dist/packages/engine/action-planner.js +8 -15
- 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 +33 -31
- package/dist/packages/engine/agents/lib/shells.js +254 -250
- 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/connection-config.js +1 -1
- 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 +100 -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 +45 -39
- package/dist/packages/engine/instance-paths.js +54 -48
- package/dist/packages/engine/lib/schema.d.ts +1568 -484
- package/dist/packages/engine/lib/schema.js +172 -161
- package/dist/packages/engine/native-run-handlers.d.ts +12 -12
- package/dist/packages/engine/native-run-handlers.js +138 -136
- package/dist/packages/engine/preparation-store.d.ts +31 -36
- package/dist/packages/engine/preparation-store.js +42 -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 +5 -0
- package/dist/packages/engine/requested-artifacts.js +36 -0
- 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 +103 -90
- 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 +15 -15
- package/dist/packages/engine/runtime-proposal-helpers.js +81 -85
- package/dist/packages/engine/runtime-resource-builders.d.ts +16 -11
- package/dist/packages/engine/runtime-resource-builders.js +32 -21
- package/dist/packages/engine/runtime.d.ts +53 -60
- package/dist/packages/engine/runtime.js +555 -453
- package/dist/packages/engine/server.d.ts +2 -2
- package/dist/packages/engine/server.js +226 -143
- 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 +42 -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 +36 -36
- 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 +205 -12
- package/dist/packages/project/lib/schema.js +59 -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 +62 -58
- package/dist/packages/project/source-folders.js +1 -1
- package/package.json +14 -17
- package/public-repo/CONTRIBUTING.md +47 -0
- package/public-repo/README.md +327 -0
- package/public-repo/SECURITY.md +67 -0
- package/public-repo/build-plans/interf-default/README.md +33 -0
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +27 -0
- package/{builtin-methods/interf-default/compile → public-repo/build-plans/interf-default/build}/stages/structure/SKILL.md +2 -2
- package/{builtin-methods/interf-default/compile → public-repo/build-plans/interf-default/build}/stages/summarize/SKILL.md +1 -1
- package/{builtin-methods/interf-default/method.json → public-repo/build-plans/interf-default/build-plan.json} +16 -16
- package/{builtin-methods/interf-default/method.schema.json → public-repo/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/build-plans/interf-default/use/query/SKILL.md +23 -0
- package/public-repo/plugins/README.md +9 -0
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +21 -0
- package/public-repo/plugins/interf/.mcp.json +12 -0
- package/public-repo/plugins/interf/README.md +32 -0
- package/public-repo/plugins/interf/skills/interf/SKILL.md +376 -0
- package/public-repo/skills/interf/SKILL.md +376 -0
- package/README.md +0 -311
- package/agent-skills/interf-actions/SKILL.md +0 -185
- package/agent-skills/interf-actions/references/cli.md +0 -243
- package/builtin-methods/interf-default/README.md +0 -29
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +0 -31
- package/builtin-methods/interf-default/improve/SKILL.md +0 -18
- package/builtin-methods/interf-default/use/query/SKILL.md +0 -28
- package/dist/cli/commands/method.d.ts +0 -2
- package/dist/cli/commands/method.js +0 -113
- package/dist/cli/commands/verify.d.ts +0 -10
- package/dist/compiler-ui/404.html +0 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +0 -10
- package/dist/compiler-ui/__next._head.txt +0 -5
- package/dist/compiler-ui/_next/static/chunks/06yhdspx~ca5-.js +0 -5
- package/dist/compiler-ui/_next/static/chunks/06z~l3kwb891e.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0_c_tvh-cukjz.css +0 -3
- package/dist/compiler-ui/_next/static/chunks/0b-ywny_j0g~0.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0b52v41o1gixx.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +0 -114
- package/dist/compiler-ui/_next/static/chunks/0gpzgsv0w.q~m.js +0 -31
- package/dist/compiler-ui/_next/static/chunks/0ilwfezfvu6~-.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/0xxmf45eskdt~.css +0 -1
- package/dist/compiler-ui/_next/static/chunks/14wtz~vq25~qq.js +0 -1
- package/dist/compiler-ui/_next/static/chunks/turbopack-0.uq1k8c0j4s..js +0 -1
- package/dist/compiler-ui/_not-found/__next._head.txt +0 -5
- 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/index.html +0 -1
- 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 -34
- 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 -73
- package/dist/packages/methods/package/local-methods.js +0 -457
- 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/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_buildManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_clientMiddlewareManifest.js +0 -0
- /package/dist/{compiler-ui/_next/static/6qyE1u9m_oBUkvAhhoCmO → interf-ui/_next/static/_qJKnA0dammQ306MG_zMq}/_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
- /package/{LICENSE.md → public-repo/LICENSE.md} +0 -0
- /package/{TRADEMARKS.md → public-repo/TRADEMARKS.md} +0 -0
|
@@ -1,457 +0,0 @@
|
|
|
1
|
-
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { basename, dirname, join, relative } from "node:path";
|
|
3
|
-
import { z } from "zod";
|
|
4
|
-
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
5
|
-
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
6
|
-
import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
7
|
-
import { isMarkdownFile } from "../../contracts/utils/file-types.js";
|
|
8
|
-
import { MethodCompilerApiSchema, MethodPurposeSchema, MethodStageArtifactReadAccessSchema, MethodStageArtifactWriteAccessSchema, } from "../../engine/compile/lib/schema.js";
|
|
9
|
-
import { RuntimeContractTypeSchema, InterfIdPattern, } from "../../contracts/lib/schema.js";
|
|
10
|
-
import { asPreparationDataDir, preparationMethodsRoot, } from "../../contracts/lib/preparation-paths.js";
|
|
11
|
-
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, listContextInterfaceArtifacts, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
|
|
12
|
-
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
13
|
-
const LocalMethodStageDefinitionSchema = z.object({
|
|
14
|
-
id: z.string().regex(InterfIdPattern),
|
|
15
|
-
label: z.string().min(1),
|
|
16
|
-
contract_type: RuntimeContractTypeSchema,
|
|
17
|
-
skill_dir: z.string().regex(InterfIdPattern).optional(),
|
|
18
|
-
description: z.string().min(1).optional(),
|
|
19
|
-
role: z.string().min(1).optional(),
|
|
20
|
-
reads: MethodStageArtifactReadAccessSchema,
|
|
21
|
-
writes: MethodStageArtifactWriteAccessSchema,
|
|
22
|
-
});
|
|
23
|
-
const LocalMethodDefinitionSchema = z.object({
|
|
24
|
-
id: z.string().regex(InterfIdPattern),
|
|
25
|
-
type: z.literal("compiled"),
|
|
26
|
-
compiler_api: MethodCompilerApiSchema.optional(),
|
|
27
|
-
purpose: MethodPurposeSchema.optional(),
|
|
28
|
-
inputs: z.array(MethodInputSpecSchema).min(1).optional(),
|
|
29
|
-
label: z.string().min(1),
|
|
30
|
-
hint: z.string().min(1),
|
|
31
|
-
stages: z.array(LocalMethodStageDefinitionSchema).min(1).optional(),
|
|
32
|
-
stage_policy_notes: z.record(z.string(), z.array(z.string())).optional(),
|
|
33
|
-
});
|
|
34
|
-
function normalizeStagePolicyNotes(value) {
|
|
35
|
-
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
36
|
-
return undefined;
|
|
37
|
-
const normalized = {};
|
|
38
|
-
for (const [stageId, notes] of Object.entries(value)) {
|
|
39
|
-
if (!Array.isArray(notes))
|
|
40
|
-
continue;
|
|
41
|
-
const cleaned = Array.from(new Set(notes
|
|
42
|
-
.filter((note) => typeof note === "string")
|
|
43
|
-
.map((note) => note.trim())
|
|
44
|
-
.filter((note) => note.length > 0)));
|
|
45
|
-
if (cleaned.length > 0) {
|
|
46
|
-
normalized[stageId] = cleaned;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
50
|
-
}
|
|
51
|
-
export function mergeStagePolicyNotesForStages(stages, baseNotes, overrideNotes) {
|
|
52
|
-
const normalizedBase = normalizeStagePolicyNotes(baseNotes);
|
|
53
|
-
const merged = {};
|
|
54
|
-
for (const stage of stages) {
|
|
55
|
-
const combined = Array.from(new Set([
|
|
56
|
-
...(normalizedBase?.[stage.id] ?? []),
|
|
57
|
-
...((overrideNotes?.[stage.id] ?? []).map((note) => note.trim()).filter((note) => note.length > 0)),
|
|
58
|
-
]));
|
|
59
|
-
if (combined.length > 0) {
|
|
60
|
-
merged[stage.id] = combined;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
64
|
-
}
|
|
65
|
-
function methodRootPath(prepDataDir) {
|
|
66
|
-
return preparationMethodsRoot(asPreparationDataDir(prepDataDir));
|
|
67
|
-
}
|
|
68
|
-
export function builtinMethodPackagePath(methodId) {
|
|
69
|
-
return join(PACKAGE_ROOT, "builtin-methods", methodId);
|
|
70
|
-
}
|
|
71
|
-
export function methodDefinitionPath(prepDataDir, id) {
|
|
72
|
-
return join(methodRootPath(prepDataDir), id);
|
|
73
|
-
}
|
|
74
|
-
function isSupportedMethodStarterDocPath(relativePath) {
|
|
75
|
-
if (relativePath === "README.md")
|
|
76
|
-
return true;
|
|
77
|
-
if (relativePath.startsWith("improve/"))
|
|
78
|
-
return true;
|
|
79
|
-
if (relativePath.startsWith("use/query/"))
|
|
80
|
-
return true;
|
|
81
|
-
if (relativePath.startsWith("compile/stages/"))
|
|
82
|
-
return true;
|
|
83
|
-
return false;
|
|
84
|
-
}
|
|
85
|
-
function collectStarterDocs(dirPath) {
|
|
86
|
-
return listFilesRecursive(dirPath, isMarkdownFile)
|
|
87
|
-
.map((filePath) => relative(dirPath, filePath).replaceAll("\\", "/"))
|
|
88
|
-
.filter((relativePath) => isSupportedMethodStarterDocPath(relativePath))
|
|
89
|
-
.map((relativePath) => ({
|
|
90
|
-
relativePath,
|
|
91
|
-
content: readFileSync(join(dirPath, relativePath), "utf8"),
|
|
92
|
-
}))
|
|
93
|
-
.sort((a, b) => a.relativePath.localeCompare(b.relativePath));
|
|
94
|
-
}
|
|
95
|
-
function methodPackageCopyPaths(dirPath) {
|
|
96
|
-
return [
|
|
97
|
-
"method.json",
|
|
98
|
-
CONTEXT_INTERFACE_FILE,
|
|
99
|
-
...collectStarterDocs(dirPath).map((doc) => doc.relativePath),
|
|
100
|
-
];
|
|
101
|
-
}
|
|
102
|
-
function copyRelativeFile(sourceRoot, targetRoot, relativePath) {
|
|
103
|
-
const sourcePath = join(sourceRoot, relativePath);
|
|
104
|
-
if (!existsSync(sourcePath))
|
|
105
|
-
return;
|
|
106
|
-
const targetPath = join(targetRoot, relativePath);
|
|
107
|
-
mkdirSync(dirname(targetPath), { recursive: true });
|
|
108
|
-
cpSync(sourcePath, targetPath, { force: true });
|
|
109
|
-
}
|
|
110
|
-
function copyMethodPackageFiles(sourceMethodPath, targetMethodPath) {
|
|
111
|
-
rmSync(targetMethodPath, { recursive: true, force: true });
|
|
112
|
-
mkdirSync(targetMethodPath, { recursive: true });
|
|
113
|
-
for (const relativePath of methodPackageCopyPaths(sourceMethodPath)) {
|
|
114
|
-
copyRelativeFile(sourceMethodPath, targetMethodPath, relativePath);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
export function loadMethodDefinitionFromDir(dirPath) {
|
|
118
|
-
const methodPath = existsSync(join(dirPath, "method.json"))
|
|
119
|
-
? join(dirPath, "method.json")
|
|
120
|
-
: null;
|
|
121
|
-
if (!methodPath)
|
|
122
|
-
return null;
|
|
123
|
-
const definition = readJsonFileWithSchema(methodPath, "local Method definition", LocalMethodDefinitionSchema);
|
|
124
|
-
if (!definition)
|
|
125
|
-
return null;
|
|
126
|
-
const methodSchema = readContextInterface(dirPath);
|
|
127
|
-
if (!methodSchema)
|
|
128
|
-
return null;
|
|
129
|
-
if (definition.type !== "compiled") {
|
|
130
|
-
warnInterf(`Warning: local Method definition at ${methodPath} has unexpected type "${definition.type}".`);
|
|
131
|
-
return null;
|
|
132
|
-
}
|
|
133
|
-
return {
|
|
134
|
-
...definition,
|
|
135
|
-
method_schema: methodSchema,
|
|
136
|
-
starter_docs: collectStarterDocs(dirPath),
|
|
137
|
-
directoryPath: dirPath,
|
|
138
|
-
methodPath,
|
|
139
|
-
methodSchemaPath: contextInterfaceFilePath(dirPath),
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
export function listLocalMethodDefinitions(prepDataDir) {
|
|
143
|
-
const definitions = new Map();
|
|
144
|
-
const root = methodRootPath(prepDataDir);
|
|
145
|
-
if (existsSync(root)) {
|
|
146
|
-
for (const entryPath of readdirSync(root).map((entry) => join(root, entry))) {
|
|
147
|
-
try {
|
|
148
|
-
if (!statSync(entryPath).isDirectory())
|
|
149
|
-
continue;
|
|
150
|
-
}
|
|
151
|
-
catch {
|
|
152
|
-
continue;
|
|
153
|
-
}
|
|
154
|
-
const definition = loadMethodDefinitionFromDir(entryPath);
|
|
155
|
-
if (definition)
|
|
156
|
-
definitions.set(definition.id, definition);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
return [...definitions.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
160
|
-
}
|
|
161
|
-
export function loadLocalMethodDefinition(prepDataDir, id) {
|
|
162
|
-
return loadMethodDefinitionFromDir(methodDefinitionPath(prepDataDir, id));
|
|
163
|
-
}
|
|
164
|
-
export function resolveMethodPackageSourcePath(prepDataDir, methodId) {
|
|
165
|
-
const localPath = methodDefinitionPath(prepDataDir, methodId);
|
|
166
|
-
if (loadMethodDefinitionFromDir(localPath))
|
|
167
|
-
return localPath;
|
|
168
|
-
const builtinPath = builtinMethodPackagePath(methodId);
|
|
169
|
-
if (loadMethodDefinitionFromDir(builtinPath))
|
|
170
|
-
return builtinPath;
|
|
171
|
-
return null;
|
|
172
|
-
}
|
|
173
|
-
export function seedLocalDefaultMethod(options) {
|
|
174
|
-
const methodId = "interf-default";
|
|
175
|
-
const targetPath = methodDefinitionPath(options.prepDataDir, methodId);
|
|
176
|
-
if (existsSync(join(targetPath, "method.json"))) {
|
|
177
|
-
return { methodId, targetPath, alreadyExisted: true };
|
|
178
|
-
}
|
|
179
|
-
const builtinInterfPath = builtinMethodPackagePath(methodId);
|
|
180
|
-
if (!existsSync(join(builtinInterfPath, "method.json"))) {
|
|
181
|
-
throw new Error(`Built-in "${methodId}" Method package not found at ${builtinInterfPath}.`);
|
|
182
|
-
}
|
|
183
|
-
copyMethodPackageDirectory(builtinInterfPath, targetPath);
|
|
184
|
-
patchMethodPackageMetadata(targetPath, {
|
|
185
|
-
id: methodId,
|
|
186
|
-
label: "Built-in Interf Method",
|
|
187
|
-
hint: "Built-in file-processing Method: summarize source-grounded evidence, structure cross-file connections, and shape portable context around the saved readiness checks.",
|
|
188
|
-
});
|
|
189
|
-
return { methodId, targetPath, alreadyExisted: false };
|
|
190
|
-
}
|
|
191
|
-
export function isMethodId(value) {
|
|
192
|
-
return InterfIdPattern.test(value);
|
|
193
|
-
}
|
|
194
|
-
function readMethodJsonObject(dirPath) {
|
|
195
|
-
const methodPath = join(dirPath, "method.json");
|
|
196
|
-
const raw = readJsonFileUnchecked(methodPath, "Method package");
|
|
197
|
-
if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
|
|
198
|
-
throw new Error(`Method package at ${dirPath} is missing a valid method.json.`);
|
|
199
|
-
}
|
|
200
|
-
return { ...raw };
|
|
201
|
-
}
|
|
202
|
-
export function patchMethodPackageMetadata(dirPath, options) {
|
|
203
|
-
const methodPath = join(dirPath, "method.json");
|
|
204
|
-
const methodJson = readMethodJsonObject(dirPath);
|
|
205
|
-
const normalizedStages = Array.isArray(methodJson.stages) && methodJson.stages.length > 0
|
|
206
|
-
? methodJson.stages
|
|
207
|
-
: null;
|
|
208
|
-
if (!normalizedStages) {
|
|
209
|
-
throw new Error(`Cannot patch Method package at ${dirPath}: method.json must declare explicit stages before it can be copied or rewritten.`);
|
|
210
|
-
}
|
|
211
|
-
const nextMethodJson = {
|
|
212
|
-
...methodJson,
|
|
213
|
-
type: "compiled",
|
|
214
|
-
compiler_api: methodJson.compiler_api ?? {
|
|
215
|
-
kind: "compiled",
|
|
216
|
-
version: 1,
|
|
217
|
-
},
|
|
218
|
-
stages: normalizedStages,
|
|
219
|
-
...(options.id ? { id: options.id } : {}),
|
|
220
|
-
...(options.inputs && options.inputs.length > 0 ? { inputs: options.inputs } : {}),
|
|
221
|
-
...(options.label ? { label: options.label } : {}),
|
|
222
|
-
...(options.hint ? { hint: options.hint } : {}),
|
|
223
|
-
};
|
|
224
|
-
const mergedStagePolicyNotes = mergeStagePolicyNotesForStages(normalizedStages, methodJson.stage_policy_notes, options.stagePolicyNotes);
|
|
225
|
-
if (mergedStagePolicyNotes) {
|
|
226
|
-
nextMethodJson.stage_policy_notes = mergedStagePolicyNotes;
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
delete nextMethodJson.stage_policy_notes;
|
|
230
|
-
}
|
|
231
|
-
writeFileSync(methodPath, JSON.stringify(nextMethodJson, null, 2) + "\n");
|
|
232
|
-
const schemaLabel = `${String(nextMethodJson.label ?? methodJson.label ?? options.id ?? "Method")} Method schema`;
|
|
233
|
-
const existingSchema = readContextInterface(dirPath);
|
|
234
|
-
if (!existingSchema) {
|
|
235
|
-
throw new Error(`Cannot patch Method package at ${dirPath}: missing ${CONTEXT_INTERFACE_FILE}. Restore or reseed the package instead of regenerating a schema from method.json.`);
|
|
236
|
-
}
|
|
237
|
-
writeContextInterface(dirPath, {
|
|
238
|
-
...existingSchema,
|
|
239
|
-
label: schemaLabel,
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
function resolveStageSkillDir(stage) {
|
|
243
|
-
return typeof stage.skill_dir === "string" && stage.skill_dir.trim().length > 0
|
|
244
|
-
? stage.skill_dir
|
|
245
|
-
: stage.id;
|
|
246
|
-
}
|
|
247
|
-
function collectMethodPackageStructureIssues(dirPath, stages) {
|
|
248
|
-
const issues = [];
|
|
249
|
-
const methodPath = join(dirPath, "method.json");
|
|
250
|
-
if (!existsSync(methodPath))
|
|
251
|
-
issues.push("missing method.json");
|
|
252
|
-
if (!contextInterfaceExists(dirPath))
|
|
253
|
-
issues.push("missing method.schema.json");
|
|
254
|
-
if (!existsSync(join(dirPath, "README.md")))
|
|
255
|
-
issues.push("missing README.md");
|
|
256
|
-
if (!existsSync(join(dirPath, "improve", "SKILL.md")))
|
|
257
|
-
issues.push("missing improve/SKILL.md");
|
|
258
|
-
if (!existsSync(join(dirPath, "use", "query", "SKILL.md")))
|
|
259
|
-
issues.push("missing use/query/SKILL.md");
|
|
260
|
-
if (!stages)
|
|
261
|
-
return issues;
|
|
262
|
-
for (const stage of stages) {
|
|
263
|
-
const skillDir = resolveStageSkillDir(stage);
|
|
264
|
-
if (!existsSync(join(dirPath, "compile", "stages", skillDir, "SKILL.md"))) {
|
|
265
|
-
issues.push(`missing compile/stages/${skillDir}/SKILL.md`);
|
|
266
|
-
}
|
|
267
|
-
}
|
|
268
|
-
return issues;
|
|
269
|
-
}
|
|
270
|
-
export function describeMethodPackagePortability(dirPath) {
|
|
271
|
-
const issues = collectMethodPackageStructureIssues(dirPath, null);
|
|
272
|
-
if (issues.length > 0)
|
|
273
|
-
return issues;
|
|
274
|
-
let methodJson;
|
|
275
|
-
try {
|
|
276
|
-
methodJson = readMethodJsonObject(dirPath);
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
issues.push(error instanceof Error ? error.message : String(error));
|
|
280
|
-
return issues;
|
|
281
|
-
}
|
|
282
|
-
const parsed = LocalMethodDefinitionSchema.safeParse(methodJson);
|
|
283
|
-
if (!parsed.success) {
|
|
284
|
-
issues.push(...parsed.error.issues.map((issue) => issue.path.length > 0
|
|
285
|
-
? `method.json ${issue.path.join(".")}: ${issue.message}`
|
|
286
|
-
: `method.json: ${issue.message}`));
|
|
287
|
-
return issues;
|
|
288
|
-
}
|
|
289
|
-
if (!parsed.data.stages || parsed.data.stages.length === 0) {
|
|
290
|
-
issues.push("method.json must declare explicit stages for a portable Method package");
|
|
291
|
-
return issues;
|
|
292
|
-
}
|
|
293
|
-
// Structural issues already returned earlier; only stage-skill files can be missing now.
|
|
294
|
-
return [
|
|
295
|
-
...issues,
|
|
296
|
-
...collectMethodPackageStructureIssues(dirPath, parsed.data.stages ?? null),
|
|
297
|
-
];
|
|
298
|
-
}
|
|
299
|
-
export function isPortableMethodPackage(dirPath) {
|
|
300
|
-
return describeMethodPackagePortability(dirPath).length === 0;
|
|
301
|
-
}
|
|
302
|
-
export function copyMethodPackageDirectory(sourceMethodPath, targetMethodPath) {
|
|
303
|
-
const portabilityIssues = describeMethodPackagePortability(sourceMethodPath);
|
|
304
|
-
if (portabilityIssues.length > 0) {
|
|
305
|
-
throw new Error(`Method package at ${sourceMethodPath} is not directly copyable: ${portabilityIssues.join("; ")}.`);
|
|
306
|
-
}
|
|
307
|
-
mkdirSync(dirname(targetMethodPath), { recursive: true });
|
|
308
|
-
copyMethodPackageFiles(sourceMethodPath, targetMethodPath);
|
|
309
|
-
}
|
|
310
|
-
export function validateMethodPackage(dirPath) {
|
|
311
|
-
const methodPath = join(dirPath, "method.json");
|
|
312
|
-
if (!existsSync(methodPath)) {
|
|
313
|
-
return {
|
|
314
|
-
ok: false,
|
|
315
|
-
summary: `No method.json found at ${dirPath}`,
|
|
316
|
-
errors: ["Missing method.json"],
|
|
317
|
-
counts: {},
|
|
318
|
-
};
|
|
319
|
-
}
|
|
320
|
-
const raw = readJsonFileUnchecked(methodPath, "Method package");
|
|
321
|
-
if (!raw) {
|
|
322
|
-
return {
|
|
323
|
-
ok: false,
|
|
324
|
-
summary: `Failed to parse method.json at ${methodPath}`,
|
|
325
|
-
errors: ["Invalid JSON in method.json"],
|
|
326
|
-
counts: {},
|
|
327
|
-
};
|
|
328
|
-
}
|
|
329
|
-
const parsed = LocalMethodDefinitionSchema.safeParse(raw);
|
|
330
|
-
if (!parsed.success) {
|
|
331
|
-
const issues = parsed.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`);
|
|
332
|
-
return {
|
|
333
|
-
ok: false,
|
|
334
|
-
summary: `method.json failed validation: ${issues.length} issue(s)`,
|
|
335
|
-
errors: issues,
|
|
336
|
-
counts: {},
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
const def = parsed.data;
|
|
340
|
-
const errors = [];
|
|
341
|
-
if (!def.stages || def.stages.length === 0) {
|
|
342
|
-
errors.push("method.json must declare explicit stages.");
|
|
343
|
-
}
|
|
344
|
-
if (def.stage_policy_notes && def.stages) {
|
|
345
|
-
const stageIds = new Set(def.stages.map((stage) => stage.id));
|
|
346
|
-
for (const stageId of Object.keys(def.stage_policy_notes)) {
|
|
347
|
-
if (!stageIds.has(stageId)) {
|
|
348
|
-
errors.push(`method.json stage_policy_notes references unknown stage "${stageId}".`);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
}
|
|
352
|
-
for (const issue of collectMethodPackageStructureIssues(dirPath, def.stages ?? null)) {
|
|
353
|
-
const formatted = issue.startsWith("missing ")
|
|
354
|
-
? `Missing ${issue.slice("missing ".length)}.`
|
|
355
|
-
: issue;
|
|
356
|
-
errors.push(formatted);
|
|
357
|
-
}
|
|
358
|
-
const methodSchema = readContextInterface(dirPath);
|
|
359
|
-
if (!methodSchema) {
|
|
360
|
-
errors.push(...describeContextInterfaceValidationIssues(dirPath));
|
|
361
|
-
}
|
|
362
|
-
if (methodSchema) {
|
|
363
|
-
const stages = def.stages ?? [];
|
|
364
|
-
const stageIds = new Set(stages.map((stage) => stage.id));
|
|
365
|
-
const seenPaths = new Map();
|
|
366
|
-
const seenArtifactIds = new Set();
|
|
367
|
-
const schemaArtifacts = listContextInterfaceArtifacts(methodSchema);
|
|
368
|
-
const artifactById = new Map(schemaArtifacts.map((artifact) => [artifact.id, artifact]));
|
|
369
|
-
const normalizedParts = (value) => value.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
370
|
-
const hasOverlappingPath = (value, other) => {
|
|
371
|
-
const a = normalizedParts(value);
|
|
372
|
-
const b = normalizedParts(other);
|
|
373
|
-
const shorter = a.length <= b.length ? a : b;
|
|
374
|
-
const longer = a.length <= b.length ? b : a;
|
|
375
|
-
return shorter.every((part, index) => longer[index] === part);
|
|
376
|
-
};
|
|
377
|
-
for (const artifact of schemaArtifacts) {
|
|
378
|
-
if (seenArtifactIds.has(artifact.id)) {
|
|
379
|
-
errors.push(`method.schema.json repeats Artifact id "${artifact.id}".`);
|
|
380
|
-
}
|
|
381
|
-
seenArtifactIds.add(artifact.id);
|
|
382
|
-
const existingPathOwner = seenPaths.get(artifact.path);
|
|
383
|
-
if (existingPathOwner) {
|
|
384
|
-
errors.push(`method.schema.json repeats Artifact path "${artifact.path}".`);
|
|
385
|
-
}
|
|
386
|
-
for (const [existingPath, existingZoneId] of seenPaths.entries()) {
|
|
387
|
-
if (existingPath === artifact.path)
|
|
388
|
-
continue;
|
|
389
|
-
if (hasOverlappingPath(artifact.path, existingPath)) {
|
|
390
|
-
errors.push(`method.schema.json Artifacts "${artifact.id}" and "${existingZoneId}" overlap on path "${artifact.path}" / "${existingPath}".`);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
seenPaths.set(artifact.path, artifact.id);
|
|
394
|
-
if ((artifact.role === "input" || artifact.role === "runtime") && artifact.owned_by.length > 0) {
|
|
395
|
-
errors.push(`method.schema.json Artifact "${artifact.id}" cannot declare owners because its role is "${artifact.role}".`);
|
|
396
|
-
}
|
|
397
|
-
for (const owner of artifact.owned_by) {
|
|
398
|
-
if (!stageIds.has(owner)) {
|
|
399
|
-
errors.push(`method.schema.json references unknown stage "${owner}" for Artifact path "${artifact.path}".`);
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
}
|
|
403
|
-
for (const stage of stages) {
|
|
404
|
-
for (const artifactId of stage.reads) {
|
|
405
|
-
if (!artifactById.has(artifactId)) {
|
|
406
|
-
errors.push(`Stage "${stage.id}" reads unknown Artifact "${artifactId}".`);
|
|
407
|
-
}
|
|
408
|
-
}
|
|
409
|
-
for (const artifactId of stage.writes) {
|
|
410
|
-
const artifact = artifactById.get(artifactId);
|
|
411
|
-
if (!artifact) {
|
|
412
|
-
errors.push(`Stage "${stage.id}" writes unknown Artifact "${artifactId}".`);
|
|
413
|
-
continue;
|
|
414
|
-
}
|
|
415
|
-
if (artifact.role === "input" || artifact.role === "runtime") {
|
|
416
|
-
errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but Artifacts with role "${artifact.role}" are engine-owned inputs, not writable stage outputs.`);
|
|
417
|
-
}
|
|
418
|
-
if (!artifact.owned_by.includes(stage.id)) {
|
|
419
|
-
errors.push(`Stage "${stage.id}" writes Artifact "${artifactId}" but that Artifact is not owned by the stage in method.schema.json.`);
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
}
|
|
424
|
-
const stageDirs = existsSync(join(dirPath, "compile", "stages"))
|
|
425
|
-
? listFilesRecursive(join(dirPath, "compile", "stages"), (filePath) => basename(filePath) === "SKILL.md")
|
|
426
|
-
: [];
|
|
427
|
-
const counts = {
|
|
428
|
-
starter_docs: collectStarterDocs(dirPath).length,
|
|
429
|
-
compile_stage_docs: stageDirs.length,
|
|
430
|
-
compiled_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
|
|
431
|
-
method_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
|
|
432
|
-
};
|
|
433
|
-
return {
|
|
434
|
-
ok: errors.length === 0,
|
|
435
|
-
summary: errors.length === 0 ? "Method package is valid." : `Method package has ${errors.length} issue(s).`,
|
|
436
|
-
errors,
|
|
437
|
-
counts,
|
|
438
|
-
};
|
|
439
|
-
}
|
|
440
|
-
function describeContextInterfaceValidationIssues(dirPath) {
|
|
441
|
-
const methodSchemaPath = contextInterfaceFilePath(dirPath);
|
|
442
|
-
if (!existsSync(methodSchemaPath)) {
|
|
443
|
-
return ["method.schema.json is missing."];
|
|
444
|
-
}
|
|
445
|
-
const raw = readJsonFileUnchecked(methodSchemaPath, "Method context interface");
|
|
446
|
-
if (raw === null) {
|
|
447
|
-
return ["method.schema.json is invalid JSON."];
|
|
448
|
-
}
|
|
449
|
-
const parsed = ContextInterfaceSchema.safeParse(raw);
|
|
450
|
-
if (parsed.success) {
|
|
451
|
-
return ["method.schema.json is missing or invalid."];
|
|
452
|
-
}
|
|
453
|
-
return parsed.error.issues.map((issue) => {
|
|
454
|
-
const path = issue.path.length > 0 ? issue.path.join(".") : "<root>";
|
|
455
|
-
return `method.schema.json ${path}: ${issue.message}`;
|
|
456
|
-
});
|
|
457
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { type LocalMethodDefinition } from "./local-methods.js";
|
|
2
|
-
import type { MethodCompilerApi } from "../../engine/compile/lib/schema.js";
|
|
3
|
-
import type { MethodId, RuntimeContractType } from "../../contracts/lib/schema.js";
|
|
4
|
-
import { type ContextInterface, type ContextInterfaceArtifactId, type MethodInputSpec } from "./context-interface.js";
|
|
5
|
-
export interface MethodStarterDoc {
|
|
6
|
-
relativePath: string;
|
|
7
|
-
content: string;
|
|
8
|
-
}
|
|
9
|
-
export interface MethodStageDefinition {
|
|
10
|
-
id: string;
|
|
11
|
-
label: string;
|
|
12
|
-
description: string;
|
|
13
|
-
contractType: RuntimeContractType;
|
|
14
|
-
skillDir: string;
|
|
15
|
-
/**
|
|
16
|
-
* Role hint declared by the Method package. Defaults to `general` when
|
|
17
|
-
* absent; mapped to a connected agent via the user's role-map at run
|
|
18
|
-
* time.
|
|
19
|
-
*/
|
|
20
|
-
role: string;
|
|
21
|
-
reads: ContextInterfaceArtifactId[];
|
|
22
|
-
writes: ContextInterfaceArtifactId[];
|
|
23
|
-
}
|
|
24
|
-
export interface MethodDefinition<TId extends string> {
|
|
25
|
-
id: TId;
|
|
26
|
-
compilerApi?: MethodCompilerApi;
|
|
27
|
-
purpose?: {
|
|
28
|
-
label: string;
|
|
29
|
-
taskHint: string;
|
|
30
|
-
};
|
|
31
|
-
inputs?: MethodInputSpec[];
|
|
32
|
-
label: string;
|
|
33
|
-
hint: string;
|
|
34
|
-
recommended?: boolean;
|
|
35
|
-
contextInterface?: ContextInterface;
|
|
36
|
-
schema?: ContextInterface;
|
|
37
|
-
stages: MethodStageDefinition[];
|
|
38
|
-
stagePolicyNotes?: Record<string, string[]>;
|
|
39
|
-
starterDocs?: MethodStarterDoc[];
|
|
40
|
-
scope?: "builtin" | "user" | "local";
|
|
41
|
-
}
|
|
42
|
-
export type CompiledMethodId = string;
|
|
43
|
-
export declare function standaloneMethodDefinitionFromLocalPackage(local: LocalMethodDefinition): MethodDefinition<string>;
|
|
44
|
-
export declare function listCompiledMethodChoices(prepDataDir?: string): MethodDefinition<string>[];
|
|
45
|
-
export declare function getCompiledMethod(methodId: CompiledMethodId, options?: {
|
|
46
|
-
prepDataDir?: string;
|
|
47
|
-
}): MethodDefinition<string>;
|
|
48
|
-
export declare function getActiveCompiledMethod(compiledPath: string): MethodDefinition<string>;
|
|
49
|
-
export declare function resolveCompiledMethodId(value: unknown): CompiledMethodId | null;
|
|
50
|
-
export declare function resolveCompiledMethodFromConfig(config: unknown): CompiledMethodId | null;
|
|
51
|
-
export declare function resolveRequiredCompiledMethodFromConfig(config: unknown, label?: string): CompiledMethodId;
|
|
52
|
-
export declare function getMethodStageDefinition(methodId: MethodId, stage: string, prepDataDir?: string): MethodStageDefinition | null;
|
|
53
|
-
export declare function getMethodStagePosition(methodId: MethodId, stage: string, prepDataDir?: string): {
|
|
54
|
-
stageIndex: number;
|
|
55
|
-
stageTotal: number;
|
|
56
|
-
stages: string[];
|
|
57
|
-
} | null;
|
|
58
|
-
export declare function getMethodStages(methodId: MethodId, prepDataDir?: string): string[];
|
|
59
|
-
export declare function getActiveCompiledStages(compiledPath: string): string[];
|
|
60
|
-
export declare function getActiveCompiledStagePolicyNotes(compiledPath: string, stage: string): string[];
|
|
61
|
-
export declare function formatActiveCompiledMethodStageStep(compiledPath: string, stage: string): string;
|