@interf/compiler 0.13.0 → 0.18.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/LICENSE.md +1 -0
- package/README.md +50 -7
- package/TRADEMARKS.md +4 -4
- package/agent-skills/interf-actions/SKILL.md +51 -5
- package/agent-skills/interf-actions/references/cli.md +82 -82
- package/builtin-methods/interf-default/README.md +6 -7
- package/builtin-methods/interf-default/method.json +7 -68
- package/builtin-methods/interf-default/method.schema.json +52 -50
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.js +10 -1
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/login.js +1 -1
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.js +1 -1
- package/dist/cli/commands/prep.js +81 -7
- package/dist/cli/commands/reset.js +1 -1
- package/dist/cli/commands/runs.js +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/verify.d.ts +10 -0
- package/dist/cli/commands/{test.js → verify.js} +30 -15
- package/dist/cli/commands/web.js +71 -18
- package/dist/cli/commands/wizard.js +462 -107
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.js +7 -3
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
- package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/contracts/index.d.ts +2 -1
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +324 -31
- package/dist/packages/contracts/lib/schema.js +281 -21
- package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +1 -1
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
- package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
- package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +9 -9
- package/dist/packages/{local-service → engine}/client.js +11 -11
- package/dist/packages/engine/cloud-seams.d.ts +115 -0
- package/dist/packages/engine/cloud-seams.js +84 -0
- package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
- package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
- package/dist/packages/engine/compile/artifact-status.js +166 -0
- package/dist/packages/engine/compile/billing-events.d.ts +89 -0
- package/dist/packages/engine/compile/billing-events.js +74 -0
- package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
- package/dist/packages/engine/compile/check-evaluator.js +298 -0
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
- package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
- package/dist/packages/engine/compile/compiled-schema.js +126 -0
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
- package/dist/packages/{compiler → engine/compile}/index.js +0 -1
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
- package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
- package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
- package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
- package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
- package/dist/packages/engine/compile/runtime.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
- package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
- package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
- package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
- package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
- package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
- package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
- package/dist/packages/{local-service → engine}/routes.js +38 -1
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +15 -15
- package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
- package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
- package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
- package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
- package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
- package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
- package/dist/packages/{local-service → engine}/runtime.js +333 -205
- package/dist/packages/{local-service → engine}/server.d.ts +25 -0
- package/dist/packages/{local-service → engine}/server.js +338 -17
- package/dist/packages/engine/verify/index.d.ts +13 -0
- package/dist/packages/engine/verify/index.js +10 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
- package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
- package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
- package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
- package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
- package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
- package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
- package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
- package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
- package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
- package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
- package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
- package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
- package/dist/packages/engine/wire-schemas.d.ts +545 -0
- package/dist/packages/engine/wire-schemas.js +59 -0
- package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
- package/dist/packages/methods/authoring/method-authoring.js +260 -0
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
- package/dist/packages/methods/package/context-interface.d.ts +73 -0
- package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
- package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
- package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
- package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
- package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.js +4 -4
- package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +1 -1
- package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
- package/dist/packages/{project-model → project}/source-config.js +9 -8
- package/dist/packages/{project-model → project}/source-folders.js +2 -2
- package/package.json +7 -16
- package/dist/cli/commands/test.d.ts +0 -9
- package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/compiler/artifact-counts.d.ts +0 -1
- package/dist/packages/compiler/compiled-schema.d.ts +0 -31
- package/dist/packages/compiler/compiled-schema.js +0 -141
- package/dist/packages/compiler/method-primitives.d.ts +0 -2
- package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
- package/dist/packages/compiler/runtime-acceptance.js +0 -262
- package/dist/packages/compiler/runtime.d.ts +0 -6
- package/dist/packages/local-service/index.d.ts +0 -22
- package/dist/packages/local-service/index.js +0 -15
- package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
- package/dist/packages/method-authoring/method-authoring.js +0 -116
- package/dist/packages/method-package/context-interface.d.ts +0 -60
- package/dist/packages/testing/index.d.ts +0 -13
- package/dist/packages/testing/index.js +0 -10
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
- /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
- /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
- /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
- /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
- /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.js +0 -0
- /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
- /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { type Check, type CheckKind, type Proof } from "../../contracts/lib/schema.js";
|
|
2
|
+
/**
|
|
3
|
+
* 0.17 — Check evaluator for the locked verification vocabulary.
|
|
4
|
+
*
|
|
5
|
+
* One evaluator per `CheckKind` from `CHECK_KINDS`. The evaluator is
|
|
6
|
+
* scope-agnostic: it takes a Check, a target path, and optional
|
|
7
|
+
* runtime context (counts, source-file totals); it returns a Proof.
|
|
8
|
+
*
|
|
9
|
+
* The same evaluator serves stage-level checks, artifact-level checks,
|
|
10
|
+
* and (for `qa_match`) user-level checks. Methods and user-defined
|
|
11
|
+
* verification declare `Check[]`; the runtime invokes this evaluator
|
|
12
|
+
* to produce `Proof[]`.
|
|
13
|
+
*
|
|
14
|
+
* This evaluator is the source of truth for declared verification
|
|
15
|
+
* checks. Legacy stage-acceptance rules were retired after the
|
|
16
|
+
* artifact-first migration.
|
|
17
|
+
*/
|
|
18
|
+
export interface CheckEvaluationContext {
|
|
19
|
+
/**
|
|
20
|
+
* Filesystem root the check evaluates against. For artifact checks
|
|
21
|
+
* this is the portable-context root; the artifact's path is
|
|
22
|
+
* resolved relative to it. For stage checks this can be the same
|
|
23
|
+
* root or a stage-output sub-directory.
|
|
24
|
+
*/
|
|
25
|
+
rootPath: string;
|
|
26
|
+
/**
|
|
27
|
+
* Optional: the path the check targets. For artifact-scoped checks
|
|
28
|
+
* this is the artifact's `shape.path`; for stage-scoped checks
|
|
29
|
+
* this is the stage's writes path. Some kinds (qa_match) ignore
|
|
30
|
+
* targetPath because they operate on agent answers, not files.
|
|
31
|
+
*/
|
|
32
|
+
targetPath?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Optional runtime-derived counts used by `min_file_count_matches_source`
|
|
35
|
+
* and similar rules. `source_total` is the canonical key for "how
|
|
36
|
+
* many source files were processed." Methods reference it in check
|
|
37
|
+
* params via `{ match: "source_total" }`.
|
|
38
|
+
*/
|
|
39
|
+
counts?: Record<string, number>;
|
|
40
|
+
/**
|
|
41
|
+
* Optional: the agent's answer for a `qa_match` check. Provided by
|
|
42
|
+
* the verify-run flow, not relevant for compile-time evaluation.
|
|
43
|
+
*/
|
|
44
|
+
agentAnswer?: string;
|
|
45
|
+
}
|
|
46
|
+
export type CheckEvaluator = (check: Check, context: CheckEvaluationContext) => Proof;
|
|
47
|
+
/**
|
|
48
|
+
* Evaluate a single Check against a context, returning a Proof.
|
|
49
|
+
*/
|
|
50
|
+
export declare function evaluateCheck(check: Check, context: CheckEvaluationContext): Proof;
|
|
51
|
+
/**
|
|
52
|
+
* Evaluate a list of checks. Aggregate ready/not_ready verdict over
|
|
53
|
+
* the proofs: `ready` if every required check passed, otherwise
|
|
54
|
+
* `not_ready`. Soft checks (required: false) that fail produce a
|
|
55
|
+
* proof but don't change the verdict.
|
|
56
|
+
*/
|
|
57
|
+
export declare function evaluateChecks(checks: readonly Check[], context: CheckEvaluationContext): {
|
|
58
|
+
proofs: Proof[];
|
|
59
|
+
ready: boolean;
|
|
60
|
+
failures: Proof[];
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Type guard for the canonical CheckKinds. Useful at parse boundaries
|
|
64
|
+
* where a string came from on-disk JSON.
|
|
65
|
+
*/
|
|
66
|
+
export declare function isCheckKind(value: unknown): value is CheckKind;
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
import { existsSync, readFileSync, statSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { CheckKindSchema, } from "../../contracts/lib/schema.js";
|
|
5
|
+
import { countBrokenWikilinks, isOutputMarkdownFile, validateSynthFiles, } from "./validate.js";
|
|
6
|
+
/**
|
|
7
|
+
* Build a Proof envelope from an evaluator outcome. Centralizes the
|
|
8
|
+
* timestamp + required-flag plumbing so individual evaluators can
|
|
9
|
+
* focus on the pass/fail decision and a one-line summary.
|
|
10
|
+
*/
|
|
11
|
+
function makeProof(check, passed, summary, details) {
|
|
12
|
+
return {
|
|
13
|
+
check_id: check.id,
|
|
14
|
+
kind: check.kind,
|
|
15
|
+
passed,
|
|
16
|
+
required: check.required,
|
|
17
|
+
summary,
|
|
18
|
+
...(details !== undefined ? { details } : {}),
|
|
19
|
+
evaluated_at: new Date().toISOString(),
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function resolveTargetPath(check, context) {
|
|
23
|
+
const target = context.targetPath;
|
|
24
|
+
if (!target)
|
|
25
|
+
return null;
|
|
26
|
+
const root = resolve(context.rootPath);
|
|
27
|
+
const absolute = resolve(root, target);
|
|
28
|
+
// Defense in depth — schema-level validation already rejects path
|
|
29
|
+
// traversal, but a hand-edited Method or stale on-disk fixture could
|
|
30
|
+
// slip through. Reject anything that escapes the root.
|
|
31
|
+
if (absolute !== root && !absolute.startsWith(`${root}/`)) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
return absolute;
|
|
35
|
+
}
|
|
36
|
+
function listMarkdownFiles(absolutePath) {
|
|
37
|
+
if (!existsSync(absolutePath))
|
|
38
|
+
return [];
|
|
39
|
+
try {
|
|
40
|
+
const stats = statSync(absolutePath);
|
|
41
|
+
if (stats.isFile()) {
|
|
42
|
+
return isOutputMarkdownFile(absolutePath) ? [absolutePath] : [];
|
|
43
|
+
}
|
|
44
|
+
if (stats.isDirectory()) {
|
|
45
|
+
return listFilesRecursive(absolutePath, isOutputMarkdownFile);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return [];
|
|
50
|
+
}
|
|
51
|
+
return [];
|
|
52
|
+
}
|
|
53
|
+
function countFiles(absolutePath) {
|
|
54
|
+
if (!existsSync(absolutePath))
|
|
55
|
+
return 0;
|
|
56
|
+
try {
|
|
57
|
+
const stats = statSync(absolutePath);
|
|
58
|
+
if (stats.isFile())
|
|
59
|
+
return 1;
|
|
60
|
+
if (stats.isDirectory()) {
|
|
61
|
+
return listFilesRecursive(absolutePath, () => true).length;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return 0;
|
|
66
|
+
}
|
|
67
|
+
return 0;
|
|
68
|
+
}
|
|
69
|
+
const EVALUATORS = {
|
|
70
|
+
file_exists(check, context) {
|
|
71
|
+
const target = resolveTargetPath(check, context);
|
|
72
|
+
if (!target) {
|
|
73
|
+
return makeProof(check, false, "No target path provided for file_exists check.");
|
|
74
|
+
}
|
|
75
|
+
if (!existsSync(target)) {
|
|
76
|
+
return makeProof(check, false, "File or directory does not exist.", { path: context.targetPath });
|
|
77
|
+
}
|
|
78
|
+
try {
|
|
79
|
+
const stats = statSync(target);
|
|
80
|
+
if (stats.isFile() && stats.size === 0) {
|
|
81
|
+
return makeProof(check, false, "File exists but is empty.", { path: context.targetPath });
|
|
82
|
+
}
|
|
83
|
+
return makeProof(check, true, `Path exists (${stats.isDirectory() ? "directory" : "file"}).`);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
return makeProof(check, false, "Could not stat target path.", { path: context.targetPath });
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
min_file_count(check, context) {
|
|
90
|
+
const target = resolveTargetPath(check, context);
|
|
91
|
+
if (!target) {
|
|
92
|
+
return makeProof(check, false, "No target path provided for min_file_count check.");
|
|
93
|
+
}
|
|
94
|
+
const min = typeof check.params?.min === "number" ? check.params.min : 1;
|
|
95
|
+
const actual = countFiles(target);
|
|
96
|
+
if (actual >= min) {
|
|
97
|
+
return makeProof(check, true, `${actual} file(s) (≥ ${min}).`, { actual, min });
|
|
98
|
+
}
|
|
99
|
+
return makeProof(check, false, `Found ${actual} file(s); expected at least ${min}.`, { actual, min });
|
|
100
|
+
},
|
|
101
|
+
min_file_count_matches_source(check, context) {
|
|
102
|
+
const target = resolveTargetPath(check, context);
|
|
103
|
+
if (!target) {
|
|
104
|
+
return makeProof(check, false, "No target path provided for min_file_count_matches_source check.");
|
|
105
|
+
}
|
|
106
|
+
const matchKey = typeof check.params?.match === "string" ? check.params.match : "source_total";
|
|
107
|
+
const expected = context.counts?.[matchKey];
|
|
108
|
+
if (typeof expected !== "number") {
|
|
109
|
+
return makeProof(check, false, `Cannot evaluate: count "${matchKey}" not available in context.`, { matchKey });
|
|
110
|
+
}
|
|
111
|
+
const actual = countFiles(target);
|
|
112
|
+
if (actual >= expected) {
|
|
113
|
+
return makeProof(check, true, `${actual} of ${expected} source files covered.`, { actual, expected });
|
|
114
|
+
}
|
|
115
|
+
return makeProof(check, false, `Only ${actual} of ${expected} source files covered.`, { actual, expected, matchKey });
|
|
116
|
+
},
|
|
117
|
+
frontmatter_valid(check, context) {
|
|
118
|
+
const target = resolveTargetPath(check, context);
|
|
119
|
+
if (!target) {
|
|
120
|
+
return makeProof(check, false, "No target path provided for frontmatter_valid check.");
|
|
121
|
+
}
|
|
122
|
+
const files = listMarkdownFiles(target);
|
|
123
|
+
if (files.length === 0) {
|
|
124
|
+
return makeProof(check, true, "No markdown files to validate.");
|
|
125
|
+
}
|
|
126
|
+
const validation = validateSynthFiles(files);
|
|
127
|
+
if (validation.invalid_frontmatter === 0) {
|
|
128
|
+
return makeProof(check, true, `${files.length} markdown file(s) have valid frontmatter.`);
|
|
129
|
+
}
|
|
130
|
+
return makeProof(check, false, `${validation.invalid_frontmatter} of ${files.length} markdown file(s) have invalid frontmatter.`, { invalid: validation.invalid_frontmatter, total: files.length });
|
|
131
|
+
},
|
|
132
|
+
frontmatter_required_keys(check, context) {
|
|
133
|
+
const target = resolveTargetPath(check, context);
|
|
134
|
+
if (!target) {
|
|
135
|
+
return makeProof(check, false, "No target path provided for frontmatter_required_keys check.");
|
|
136
|
+
}
|
|
137
|
+
const keys = Array.isArray(check.params?.keys) ? check.params.keys.filter((k) => typeof k === "string") : [];
|
|
138
|
+
if (keys.length === 0) {
|
|
139
|
+
return makeProof(check, false, "frontmatter_required_keys check requires `params.keys: string[]`.");
|
|
140
|
+
}
|
|
141
|
+
const files = listMarkdownFiles(target);
|
|
142
|
+
if (files.length === 0) {
|
|
143
|
+
return makeProof(check, true, "No markdown files to validate.");
|
|
144
|
+
}
|
|
145
|
+
const validation = validateSynthFiles(files, { requiredFrontmatterKeys: keys });
|
|
146
|
+
if (validation.invalid_frontmatter === 0) {
|
|
147
|
+
return makeProof(check, true, `All ${files.length} markdown file(s) have required keys: ${keys.join(", ")}.`);
|
|
148
|
+
}
|
|
149
|
+
return makeProof(check, false, `${validation.invalid_frontmatter} of ${files.length} file(s) missing required keys (${keys.join(", ")}).`, { invalid: validation.invalid_frontmatter, total: files.length, requiredKeys: keys });
|
|
150
|
+
},
|
|
151
|
+
wikilinks_valid(check, context) {
|
|
152
|
+
const target = resolveTargetPath(check, context);
|
|
153
|
+
if (!target) {
|
|
154
|
+
return makeProof(check, false, "No target path provided for wikilinks_valid check.");
|
|
155
|
+
}
|
|
156
|
+
const broken = countBrokenWikilinks(context.rootPath, [context.rootPath], [target]);
|
|
157
|
+
if (broken === 0) {
|
|
158
|
+
return makeProof(check, true, "All wikilinks resolve.");
|
|
159
|
+
}
|
|
160
|
+
return makeProof(check, false, `${broken} broken wikilink(s).`, { broken });
|
|
161
|
+
},
|
|
162
|
+
must_not_contain(check, context) {
|
|
163
|
+
const target = resolveTargetPath(check, context);
|
|
164
|
+
if (!target || !existsSync(target)) {
|
|
165
|
+
return makeProof(check, false, "Target path does not exist.", { path: context.targetPath });
|
|
166
|
+
}
|
|
167
|
+
const phrases = Array.isArray(check.params?.phrases)
|
|
168
|
+
? check.params.phrases.filter((p) => typeof p === "string")
|
|
169
|
+
: [];
|
|
170
|
+
if (phrases.length === 0) {
|
|
171
|
+
return makeProof(check, false, "must_not_contain check requires `params.phrases: string[]`.");
|
|
172
|
+
}
|
|
173
|
+
try {
|
|
174
|
+
const stats = statSync(target);
|
|
175
|
+
const files = stats.isFile() ? [target] : listFilesRecursive(target, () => true);
|
|
176
|
+
const offenders = [];
|
|
177
|
+
for (const file of files) {
|
|
178
|
+
const content = readFileSync(file, "utf8");
|
|
179
|
+
for (const phrase of phrases) {
|
|
180
|
+
if (content.includes(phrase)) {
|
|
181
|
+
offenders.push(`${file}: contains "${phrase}"`);
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (offenders.length === 0) {
|
|
187
|
+
return makeProof(check, true, `No forbidden phrases found across ${files.length} file(s).`);
|
|
188
|
+
}
|
|
189
|
+
return makeProof(check, false, `${offenders.length} file(s) contain forbidden phrases.`, { offenders, phrases });
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
return makeProof(check, false, `Error reading target: ${error instanceof Error ? error.message : String(error)}`);
|
|
193
|
+
}
|
|
194
|
+
},
|
|
195
|
+
must_contain(check, context) {
|
|
196
|
+
const target = resolveTargetPath(check, context);
|
|
197
|
+
if (!target || !existsSync(target)) {
|
|
198
|
+
return makeProof(check, false, "Target path does not exist.", { path: context.targetPath });
|
|
199
|
+
}
|
|
200
|
+
const phrases = Array.isArray(check.params?.phrases)
|
|
201
|
+
? check.params.phrases.filter((p) => typeof p === "string")
|
|
202
|
+
: [];
|
|
203
|
+
if (phrases.length === 0) {
|
|
204
|
+
return makeProof(check, false, "must_contain check requires `params.phrases: string[]`.");
|
|
205
|
+
}
|
|
206
|
+
try {
|
|
207
|
+
const stats = statSync(target);
|
|
208
|
+
// For directories, must_contain checks across ALL files (every phrase
|
|
209
|
+
// must appear in at least one file). For files, all phrases must
|
|
210
|
+
// appear in that single file.
|
|
211
|
+
if (stats.isFile()) {
|
|
212
|
+
const content = readFileSync(target, "utf8");
|
|
213
|
+
const missing = phrases.filter((phrase) => !content.includes(phrase));
|
|
214
|
+
if (missing.length === 0) {
|
|
215
|
+
return makeProof(check, true, `All ${phrases.length} required phrase(s) present.`);
|
|
216
|
+
}
|
|
217
|
+
return makeProof(check, false, `${missing.length} required phrase(s) missing.`, { missing });
|
|
218
|
+
}
|
|
219
|
+
const files = listFilesRecursive(target, () => true);
|
|
220
|
+
const remaining = new Set(phrases);
|
|
221
|
+
for (const file of files) {
|
|
222
|
+
const content = readFileSync(file, "utf8");
|
|
223
|
+
for (const phrase of [...remaining]) {
|
|
224
|
+
if (content.includes(phrase))
|
|
225
|
+
remaining.delete(phrase);
|
|
226
|
+
}
|
|
227
|
+
if (remaining.size === 0)
|
|
228
|
+
break;
|
|
229
|
+
}
|
|
230
|
+
if (remaining.size === 0) {
|
|
231
|
+
return makeProof(check, true, `All ${phrases.length} required phrase(s) found across files.`);
|
|
232
|
+
}
|
|
233
|
+
return makeProof(check, false, `${remaining.size} required phrase(s) missing across all files.`, { missing: [...remaining] });
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
return makeProof(check, false, `Error reading target: ${error instanceof Error ? error.message : String(error)}`);
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
qa_match(check, context) {
|
|
240
|
+
const expected = typeof check.params?.expected === "string" ? check.params.expected : "";
|
|
241
|
+
const strictness = typeof check.params?.strictness === "string" ? check.params.strictness : "loose";
|
|
242
|
+
const answer = context.agentAnswer ?? "";
|
|
243
|
+
if (!expected) {
|
|
244
|
+
return makeProof(check, false, "qa_match check requires `params.expected: string`.");
|
|
245
|
+
}
|
|
246
|
+
if (!answer) {
|
|
247
|
+
return makeProof(check, false, "No agent answer available for qa_match evaluation.");
|
|
248
|
+
}
|
|
249
|
+
if (strictness === "strict") {
|
|
250
|
+
const passed = answer.trim() === expected.trim();
|
|
251
|
+
return makeProof(check, passed, passed ? "Answer matches expected exactly." : "Answer does not match expected.");
|
|
252
|
+
}
|
|
253
|
+
// Loose: case-insensitive substring match either direction.
|
|
254
|
+
const a = answer.trim().toLowerCase();
|
|
255
|
+
const e = expected.trim().toLowerCase();
|
|
256
|
+
const passed = a.includes(e) || e.includes(a);
|
|
257
|
+
return makeProof(check, passed, passed ? "Answer matches expected (loose)." : "Answer does not match expected.");
|
|
258
|
+
},
|
|
259
|
+
};
|
|
260
|
+
/**
|
|
261
|
+
* Evaluate a single Check against a context, returning a Proof.
|
|
262
|
+
*/
|
|
263
|
+
export function evaluateCheck(check, context) {
|
|
264
|
+
const evaluator = EVALUATORS[check.kind];
|
|
265
|
+
if (!evaluator) {
|
|
266
|
+
return {
|
|
267
|
+
check_id: check.id,
|
|
268
|
+
kind: check.kind,
|
|
269
|
+
passed: false,
|
|
270
|
+
required: check.required,
|
|
271
|
+
summary: `Unknown check kind: ${check.kind}`,
|
|
272
|
+
evaluated_at: new Date().toISOString(),
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
return evaluator(check, context);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Evaluate a list of checks. Aggregate ready/not_ready verdict over
|
|
279
|
+
* the proofs: `ready` if every required check passed, otherwise
|
|
280
|
+
* `not_ready`. Soft checks (required: false) that fail produce a
|
|
281
|
+
* proof but don't change the verdict.
|
|
282
|
+
*/
|
|
283
|
+
export function evaluateChecks(checks, context) {
|
|
284
|
+
const proofs = checks.map((check) => evaluateCheck(check, context));
|
|
285
|
+
const failures = proofs.filter((proof) => !proof.passed && proof.required);
|
|
286
|
+
return {
|
|
287
|
+
proofs,
|
|
288
|
+
ready: failures.length === 0,
|
|
289
|
+
failures,
|
|
290
|
+
};
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Type guard for the canonical CheckKinds. Useful at parse boundaries
|
|
294
|
+
* where a string came from on-disk JSON.
|
|
295
|
+
*/
|
|
296
|
+
export function isCheckKind(value) {
|
|
297
|
+
return CheckKindSchema.safeParse(value).success;
|
|
298
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
-
import { type MethodReporter, type MethodStageResult } from "
|
|
2
|
+
import { type MethodReporter, type MethodStageResult } from "../../methods/package/method-helpers.js";
|
|
3
3
|
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import type { RunEventSink } from "../execution/events.js";
|
|
5
5
|
export interface CompiledSummarizeResult extends MethodStageResult {
|
|
@@ -15,8 +15,17 @@ export interface CompiledCompileResult {
|
|
|
15
15
|
failedStage: string | null;
|
|
16
16
|
}
|
|
17
17
|
export type StageShellRetentionMode = "on-failure" | "always";
|
|
18
|
+
/**
|
|
19
|
+
* Per-stage executor resolver. When provided, the pipeline calls this
|
|
20
|
+
* for each stage and uses the returned executor instead of the
|
|
21
|
+
* top-level `executor`. The top-level `executor` stays as the default
|
|
22
|
+
* fallback so single-active-agent setups keep working without any
|
|
23
|
+
* resolver wired up.
|
|
24
|
+
*/
|
|
25
|
+
export type ResolveStageExecutor = (stage: CompiledStageExecutionDefinition) => MethodExecutor;
|
|
18
26
|
export declare function runCompiledSummarize(options: {
|
|
19
27
|
executor: MethodExecutor;
|
|
28
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
20
29
|
compiledPath: string;
|
|
21
30
|
reporter?: MethodReporter;
|
|
22
31
|
reportSummary?: boolean;
|
|
@@ -28,6 +37,7 @@ export declare function runCompiledSummarize(options: {
|
|
|
28
37
|
}): Promise<CompiledSummarizeResult>;
|
|
29
38
|
export declare function runCompiledCompile(options: {
|
|
30
39
|
executor: MethodExecutor;
|
|
40
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
31
41
|
compiledPath: string;
|
|
32
42
|
reporter?: MethodReporter;
|
|
33
43
|
reportStep?: boolean;
|
|
@@ -37,6 +47,7 @@ export declare function runCompiledCompile(options: {
|
|
|
37
47
|
}): Promise<MethodStageResult>;
|
|
38
48
|
export declare function compileCompiled(options: {
|
|
39
49
|
executor: MethodExecutor;
|
|
50
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
40
51
|
compiledPath: string;
|
|
41
52
|
reporter?: MethodReporter;
|
|
42
53
|
preserveStageShells?: StageShellRetentionMode;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { refreshCompiledBootstrapGuidance, } from "../agents/lib/compiled-bootstrap.js";
|
|
2
|
-
import { validateMethodPackage } from "
|
|
3
|
-
import { reportValidationFailure, } from "
|
|
2
|
+
import { validateMethodPackage } from "../../methods/package/local-methods.js";
|
|
3
|
+
import { reportValidationFailure, } from "../../methods/package/method-helpers.js";
|
|
4
4
|
import { validateCompiledMethod, } from "./validate.js";
|
|
5
5
|
import { pruneStageExecutionShells, } from "../agents/lib/shells.js";
|
|
6
6
|
import { resetCompiledGeneratedState } from "./reset.js";
|
|
7
7
|
import { compiledExecutionStages, resolveCompiledContext, } from "./compiled-target.js";
|
|
8
8
|
import { discoverSourceFiles } from "./discovery.js";
|
|
9
9
|
import { runCompiledStage } from "./compiled-stage-runner.js";
|
|
10
|
-
import { resolveSourceInputPath } from "
|
|
10
|
+
import { resolveSourceInputPath } from "../../project/interf-detect.js";
|
|
11
11
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
12
12
|
import { writeCompiledSourceRuntime } from "./source-files.js";
|
|
13
|
+
function pickStageExecutor(fallback, stage, resolve) {
|
|
14
|
+
if (!resolve)
|
|
15
|
+
return fallback;
|
|
16
|
+
try {
|
|
17
|
+
return resolve(stage) ?? fallback;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return fallback;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
export async function runCompiledSummarize(options) {
|
|
14
24
|
const context = resolveCompiledContext(options.compiledPath);
|
|
15
25
|
const stageDefinition = options.stageDefinition
|
|
@@ -31,7 +41,7 @@ export async function runCompiledSummarize(options) {
|
|
|
31
41
|
runId: options.runId ?? null,
|
|
32
42
|
});
|
|
33
43
|
const result = await runCompiledStage({
|
|
34
|
-
executor: options.executor,
|
|
44
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
35
45
|
compiledPath: options.compiledPath,
|
|
36
46
|
reporter: options.reporter,
|
|
37
47
|
reportStep: options.reportStep,
|
|
@@ -66,7 +76,7 @@ export async function runCompiledCompile(options) {
|
|
|
66
76
|
});
|
|
67
77
|
for (const [index, stageDefinition] of stages.entries()) {
|
|
68
78
|
const result = await runCompiledStage({
|
|
69
|
-
executor: options.executor,
|
|
79
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
70
80
|
compiledPath: options.compiledPath,
|
|
71
81
|
reporter: options.reporter,
|
|
72
82
|
reportStep: options.reportStep,
|
|
@@ -130,7 +140,7 @@ export async function compileCompiled(options) {
|
|
|
130
140
|
});
|
|
131
141
|
for (const [index, stageDefinition] of stages.entries()) {
|
|
132
142
|
const stageResult = await runCompiledStage({
|
|
133
|
-
executor: options.executor,
|
|
143
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
134
144
|
compiledPath: options.compiledPath,
|
|
135
145
|
reporter: options.reporter,
|
|
136
146
|
reportStep: true,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type MethodCompiledSchema, type MethodCompiledArtifact, type MethodArtifactId } from "./lib/schema.js";
|
|
2
|
+
export interface MethodSchemaStageLike {
|
|
3
|
+
id: string;
|
|
4
|
+
writes: readonly string[];
|
|
5
|
+
}
|
|
6
|
+
export declare const METHOD_SCHEMA_FILE = "method.schema.json";
|
|
7
|
+
export declare function methodSchemaFilePath(rootPath: string): string;
|
|
8
|
+
export declare function resolveMethodSchemaPath(rootPath: string): string | null;
|
|
9
|
+
export declare function methodSchemaExists(rootPath: string): boolean;
|
|
10
|
+
export declare function methodSchemaRelativePath(): string;
|
|
11
|
+
export declare function listCompiledSchemaArtifacts(schema: MethodCompiledSchema): MethodCompiledArtifact[];
|
|
12
|
+
export declare function findCompiledSchemaArtifact(schema: MethodCompiledSchema, artifactId: MethodArtifactId): MethodCompiledArtifact | null;
|
|
13
|
+
export declare function compiledArtifactAbsolutePath(compiledPath: string, artifact: Pick<MethodCompiledArtifact, "path">): string;
|
|
14
|
+
export declare function compiledContractArtifactPath(artifact: Pick<MethodCompiledArtifact, "path" | "kind">): string;
|
|
15
|
+
export declare function compiledContractArtifactPathsForArtifactIds(schema: MethodCompiledSchema, artifactIds: readonly MethodArtifactId[]): string[];
|
|
16
|
+
export declare function ensureCompiledArtifactTargets(compiledPath: string, schema: MethodCompiledSchema): void;
|
|
17
|
+
export declare function buildMethodSchema(stages: MethodSchemaStageLike[], label?: string): MethodCompiledSchema;
|
|
18
|
+
export declare function writeMethodSchemaFile(rootPath: string, stages: MethodSchemaStageLike[], label?: string): MethodCompiledSchema;
|
|
19
|
+
export declare function writeMethodSchemaDocument(rootPath: string, schema: MethodCompiledSchema): MethodCompiledSchema;
|
|
20
|
+
export declare function readMethodSchemaFile(rootPath: string): MethodCompiledSchema | null;
|
|
21
|
+
export declare function readCompiledSchemaFile(rootPath: string): MethodCompiledSchema | null;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join } from "node:path";
|
|
3
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
4
|
+
import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
|
|
5
|
+
import { listBuiltinCompiledArtifactSpecs, requiredCompiledArtifactOwners, } from "../../methods/package/builtin-compiled-method.js";
|
|
6
|
+
import { MethodCompiledSchemaSchema, } from "./lib/schema.js";
|
|
7
|
+
export const METHOD_SCHEMA_FILE = "method.schema.json";
|
|
8
|
+
export function methodSchemaFilePath(rootPath) {
|
|
9
|
+
return join(rootPath, METHOD_SCHEMA_FILE);
|
|
10
|
+
}
|
|
11
|
+
export function resolveMethodSchemaPath(rootPath) {
|
|
12
|
+
const path = methodSchemaFilePath(rootPath);
|
|
13
|
+
return existsSync(path) ? path : null;
|
|
14
|
+
}
|
|
15
|
+
export function methodSchemaExists(rootPath) {
|
|
16
|
+
return existsSync(methodSchemaFilePath(rootPath));
|
|
17
|
+
}
|
|
18
|
+
export function methodSchemaRelativePath() {
|
|
19
|
+
return `method/${METHOD_SCHEMA_FILE}`;
|
|
20
|
+
}
|
|
21
|
+
export function listCompiledSchemaArtifacts(schema) {
|
|
22
|
+
return schema.artifacts.map(artifactToMethodArtifact);
|
|
23
|
+
}
|
|
24
|
+
export function findCompiledSchemaArtifact(schema, artifactId) {
|
|
25
|
+
return listCompiledSchemaArtifacts(schema).find((artifact) => artifact.id === artifactId) ?? null;
|
|
26
|
+
}
|
|
27
|
+
export function compiledArtifactAbsolutePath(compiledPath, artifact) {
|
|
28
|
+
return join(compiledPath, artifact.path);
|
|
29
|
+
}
|
|
30
|
+
export function compiledContractArtifactPath(artifact) {
|
|
31
|
+
if (artifact.kind === "file")
|
|
32
|
+
return artifact.path;
|
|
33
|
+
return artifact.path.endsWith("/") ? artifact.path : `${artifact.path}/`;
|
|
34
|
+
}
|
|
35
|
+
export function compiledContractArtifactPathsForArtifactIds(schema, artifactIds) {
|
|
36
|
+
return artifactIds.map((artifactId) => {
|
|
37
|
+
const artifact = findCompiledSchemaArtifact(schema, artifactId);
|
|
38
|
+
if (!artifact) {
|
|
39
|
+
throw new Error(`Compiled schema is missing declared Artifact "${artifactId}".`);
|
|
40
|
+
}
|
|
41
|
+
return compiledContractArtifactPath(artifact);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
export function ensureCompiledArtifactTargets(compiledPath, schema) {
|
|
45
|
+
for (const artifact of listCompiledSchemaArtifacts(schema)) {
|
|
46
|
+
if (artifact.kind === "directory" || artifact.kind === "runtime") {
|
|
47
|
+
mkdirSync(compiledArtifactAbsolutePath(compiledPath, artifact), { recursive: true });
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
mkdirSync(dirname(compiledArtifactAbsolutePath(compiledPath, artifact)), { recursive: true });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function normalizeMethodSchema(schema) {
|
|
54
|
+
return {
|
|
55
|
+
...schema,
|
|
56
|
+
kind: "method-schema",
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
function artifactToMethodArtifact(artifact) {
|
|
60
|
+
if (artifact.shape.kind !== "path") {
|
|
61
|
+
return {
|
|
62
|
+
id: artifact.id,
|
|
63
|
+
role: "output",
|
|
64
|
+
path: artifact.id,
|
|
65
|
+
kind: "directory",
|
|
66
|
+
required: true,
|
|
67
|
+
owned_by: [...artifact.built_by_stages],
|
|
68
|
+
description: artifact.description,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
id: artifact.id,
|
|
73
|
+
role: "output",
|
|
74
|
+
path: artifact.shape.path,
|
|
75
|
+
kind: artifact.shape.artifact_kind,
|
|
76
|
+
required: true,
|
|
77
|
+
owned_by: [...artifact.built_by_stages],
|
|
78
|
+
description: artifact.description,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
export function buildMethodSchema(stages, label = "Method schema") {
|
|
82
|
+
return {
|
|
83
|
+
kind: "method-schema",
|
|
84
|
+
version: 1,
|
|
85
|
+
target_type: "compiled",
|
|
86
|
+
label,
|
|
87
|
+
artifacts: listBuiltinCompiledArtifactSpecs().map((artifact) => ({
|
|
88
|
+
id: artifact.id,
|
|
89
|
+
description: artifact.description,
|
|
90
|
+
shape: {
|
|
91
|
+
kind: "path",
|
|
92
|
+
path: artifact.path,
|
|
93
|
+
artifact_kind: artifact.kind === "file" ? "file" : "directory",
|
|
94
|
+
},
|
|
95
|
+
checks: [],
|
|
96
|
+
built_by_stages: requiredCompiledArtifactOwners(stages, artifact.id),
|
|
97
|
+
})),
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
export function writeMethodSchemaFile(rootPath, stages, label) {
|
|
101
|
+
const schema = buildMethodSchema(stages, label);
|
|
102
|
+
writeMethodSchemaDocument(rootPath, schema);
|
|
103
|
+
return schema;
|
|
104
|
+
}
|
|
105
|
+
export function writeMethodSchemaDocument(rootPath, schema) {
|
|
106
|
+
const normalized = normalizeMethodSchema(schema);
|
|
107
|
+
writeFileSync(methodSchemaFilePath(rootPath), `${JSON.stringify(normalized, null, 2)}\n`);
|
|
108
|
+
return normalized;
|
|
109
|
+
}
|
|
110
|
+
export function readMethodSchemaFile(rootPath) {
|
|
111
|
+
const path = methodSchemaFilePath(rootPath);
|
|
112
|
+
if (!existsSync(path))
|
|
113
|
+
return null;
|
|
114
|
+
const raw = readJsonFileUnchecked(path, "Method schema");
|
|
115
|
+
if (raw === null)
|
|
116
|
+
return null;
|
|
117
|
+
const parsed = MethodCompiledSchemaSchema.safeParse(raw);
|
|
118
|
+
if (!parsed.success) {
|
|
119
|
+
warnInterf(`Warning: failed to validate Method schema at ${path}: ${parsed.error.issues.map((issue) => issue.message).join("; ")}`);
|
|
120
|
+
return null;
|
|
121
|
+
}
|
|
122
|
+
return normalizeMethodSchema(parsed.data);
|
|
123
|
+
}
|
|
124
|
+
export function readCompiledSchemaFile(rootPath) {
|
|
125
|
+
return readMethodSchemaFile(rootPath);
|
|
126
|
+
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { type RuntimeStageContractDraft } from "./runtime.js";
|
|
2
|
-
import { type MethodStageDefinition } from "
|
|
2
|
+
import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
|
|
3
3
|
import { resolveCompiledContext, type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import type { RuntimeStageInstructions } from "./lib/schema.js";
|
|
5
5
|
export declare function resolveStageContractArtifacts(compiledPath: string, stageDefinition: Pick<MethodStageDefinition, "id" | "reads" | "writes">): {
|
|
6
6
|
reads: string[];
|
|
7
7
|
writes: string[];
|
|
8
|
+
writeContracts: RuntimeStageContractDraft["artifacts"]["write_contracts"];
|
|
8
9
|
};
|
|
9
10
|
export declare function buildStageCounts(compiledPath: string, stageDefinition: MethodStageDefinition): Record<string, number>;
|
|
10
11
|
export declare function buildStageContract(compiledPath: string, stageDefinition: MethodStageDefinition, instructions: RuntimeStageInstructions): RuntimeStageContractDraft;
|