@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
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { warnInterf } from "
|
|
5
|
-
import { readJsonFileUnchecked } from "
|
|
6
|
-
import { MethodCompiledSchemaSchema,
|
|
7
|
-
import {
|
|
4
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
5
|
+
import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
|
|
6
|
+
import { MethodCompiledSchemaSchema, MethodArtifactIdSchema, } from "../../engine/compile/lib/schema.js";
|
|
7
|
+
import { listBuiltinCompiledArtifactSpecs, requiredCompiledArtifactOwners, } from "./builtin-compiled-method.js";
|
|
8
8
|
// Method packages define the context interface. The compiler persists the
|
|
9
9
|
// same schema on disk, but higher layers should prefer this boundary when they
|
|
10
10
|
// mean "the Method-declared shape a portable context must implement."
|
|
@@ -15,7 +15,7 @@ export const ContextInterfaceSchema = MethodCompiledSchemaSchema;
|
|
|
15
15
|
// Method expects to organize before the compiler materializes the context
|
|
16
16
|
// interface on disk.
|
|
17
17
|
export const MethodInputSpecSchema = z.object({
|
|
18
|
-
id:
|
|
18
|
+
id: MethodArtifactIdSchema,
|
|
19
19
|
label: z.string().min(1),
|
|
20
20
|
description: z.string().min(1),
|
|
21
21
|
required: z.boolean().default(false),
|
|
@@ -27,13 +27,23 @@ function normalizeContextInterface(contextInterface) {
|
|
|
27
27
|
kind: "method-schema",
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
function artifactToMethodArtifact(artifact) {
|
|
31
|
+
const path = artifact.shape.kind === "path" ? artifact.shape.path : artifact.id;
|
|
32
|
+
return {
|
|
33
|
+
id: artifact.id,
|
|
34
|
+
role: "output",
|
|
35
|
+
path,
|
|
36
|
+
kind: artifact.shape.kind === "path" ? artifact.shape.artifact_kind : "directory",
|
|
37
|
+
required: true,
|
|
38
|
+
owned_by: [...artifact.built_by_stages],
|
|
39
|
+
description: artifact.description,
|
|
40
|
+
};
|
|
34
41
|
}
|
|
35
|
-
function
|
|
36
|
-
return
|
|
42
|
+
export function listContextInterfaceArtifacts(contextInterface) {
|
|
43
|
+
return contextInterface.artifacts.map(artifactToMethodArtifact);
|
|
44
|
+
}
|
|
45
|
+
function titleCaseArtifactId(artifactId) {
|
|
46
|
+
return artifactId
|
|
37
47
|
.split("-")
|
|
38
48
|
.filter(Boolean)
|
|
39
49
|
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
@@ -49,53 +59,52 @@ export function resolveContextInterfacePath(rootPath) {
|
|
|
49
59
|
export function contextInterfaceExists(rootPath) {
|
|
50
60
|
return existsSync(contextInterfaceFilePath(rootPath));
|
|
51
61
|
}
|
|
52
|
-
export function
|
|
53
|
-
return join(compiledPath,
|
|
62
|
+
export function contextInterfaceArtifactAbsolutePath(compiledPath, artifact) {
|
|
63
|
+
return join(compiledPath, artifact.path);
|
|
54
64
|
}
|
|
55
|
-
export function contextInterfaceArtifactPath(
|
|
56
|
-
if (
|
|
57
|
-
return
|
|
58
|
-
return
|
|
65
|
+
export function contextInterfaceArtifactPath(artifact) {
|
|
66
|
+
if (artifact.kind === "file")
|
|
67
|
+
return artifact.path;
|
|
68
|
+
return artifact.path.endsWith("/") ? artifact.path : `${artifact.path}/`;
|
|
59
69
|
}
|
|
60
70
|
export function summarizeContextInterface(contextInterface) {
|
|
71
|
+
const artifacts = listContextInterfaceArtifacts(contextInterface);
|
|
61
72
|
return {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
73
|
+
inputArtifacts: artifacts.filter((artifact) => artifact.role === "input"),
|
|
74
|
+
workingArtifacts: artifacts.filter((artifact) => artifact.role === "working"),
|
|
75
|
+
outputArtifacts: artifacts.filter((artifact) => artifact.role === "output"),
|
|
76
|
+
runtimeArtifacts: artifacts.filter((artifact) => artifact.role === "runtime"),
|
|
66
77
|
};
|
|
67
78
|
}
|
|
68
79
|
export function deriveMethodInputsFromContextInterface(contextInterface) {
|
|
69
80
|
if (!contextInterface)
|
|
70
81
|
return [];
|
|
71
|
-
return contextInterface
|
|
72
|
-
.filter((
|
|
73
|
-
.map((
|
|
74
|
-
id:
|
|
75
|
-
label:
|
|
76
|
-
description:
|
|
77
|
-
required:
|
|
82
|
+
return listContextInterfaceArtifacts(contextInterface)
|
|
83
|
+
.filter((artifact) => artifact.role === "input")
|
|
84
|
+
.map((artifact) => ({
|
|
85
|
+
id: artifact.id,
|
|
86
|
+
label: titleCaseArtifactId(artifact.id),
|
|
87
|
+
description: artifact.description,
|
|
88
|
+
required: artifact.required,
|
|
78
89
|
}));
|
|
79
90
|
}
|
|
80
91
|
export function buildContextInterface(stages, label = "Method context interface") {
|
|
81
|
-
const zones = [];
|
|
82
|
-
for (const zone of listBuiltinCompiledZoneSpecs()) {
|
|
83
|
-
pushContextInterfaceZone(zones, {
|
|
84
|
-
id: zone.id,
|
|
85
|
-
role: zone.role,
|
|
86
|
-
path: zone.path,
|
|
87
|
-
kind: zone.kind,
|
|
88
|
-
required: zone.required,
|
|
89
|
-
owned_by: requiredCompiledZoneOwners(stages, zone.id),
|
|
90
|
-
description: zone.description,
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
92
|
return {
|
|
94
93
|
kind: "method-schema",
|
|
95
94
|
version: 1,
|
|
96
95
|
target_type: "compiled",
|
|
97
96
|
label,
|
|
98
|
-
|
|
97
|
+
artifacts: listBuiltinCompiledArtifactSpecs().map((artifact) => ({
|
|
98
|
+
id: artifact.id,
|
|
99
|
+
description: artifact.description,
|
|
100
|
+
shape: {
|
|
101
|
+
kind: "path",
|
|
102
|
+
path: artifact.path,
|
|
103
|
+
artifact_kind: artifact.kind === "file" ? "file" : "directory",
|
|
104
|
+
},
|
|
105
|
+
checks: [],
|
|
106
|
+
built_by_stages: requiredCompiledArtifactOwners(stages, artifact.id),
|
|
107
|
+
})),
|
|
99
108
|
};
|
|
100
109
|
}
|
|
101
110
|
export function writeContextInterfaceFile(rootPath, stages, label) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
-
import { renderCompiledQuerySkill } from "
|
|
3
|
+
import { renderCompiledQuerySkill } from "../../engine/agents/lib/shells.js";
|
|
4
4
|
import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, mergeStagePolicyNotesForStages, } from "./local-methods.js";
|
|
5
5
|
import { getCompiledMethod, } from "./method-definitions.js";
|
|
6
|
-
import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
|
|
7
|
-
import { methodPackagePathForCompiled } from "
|
|
6
|
+
import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, listContextInterfaceArtifacts, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
|
|
7
|
+
import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
8
8
|
function writeMethodStarterDocs(dirPath, docs, options) {
|
|
9
9
|
for (const doc of docs ?? []) {
|
|
10
10
|
const targetPath = join(dirPath, doc.relativePath);
|
|
@@ -47,7 +47,6 @@ function writeMethodPackageJson(rootPath, method, options) {
|
|
|
47
47
|
skill_dir: stage.skillDir,
|
|
48
48
|
reads: stage.reads,
|
|
49
49
|
writes: stage.writes,
|
|
50
|
-
...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
|
|
51
50
|
})),
|
|
52
51
|
...(method.stagePolicyNotes ? { stage_policy_notes: method.stagePolicyNotes } : {}),
|
|
53
52
|
}, null, 2)}\n`);
|
|
@@ -60,9 +59,12 @@ function renderMethodReadme(method) {
|
|
|
60
59
|
const interfaceSummary = contextInterface
|
|
61
60
|
? summarizeContextInterface(contextInterface)
|
|
62
61
|
: null;
|
|
63
|
-
const
|
|
64
|
-
? contextInterface
|
|
65
|
-
|
|
62
|
+
const contextInterfaceArtifacts = contextInterface
|
|
63
|
+
? listContextInterfaceArtifacts(contextInterface)
|
|
64
|
+
: [];
|
|
65
|
+
const contextInterfaceLines = contextInterfaceArtifacts.length > 0
|
|
66
|
+
? contextInterfaceArtifacts
|
|
67
|
+
.map((artifact) => `- \`${artifact.id}\` — ${artifact.role} ${artifact.kind} Artifact at \`${artifact.path}\`: ${artifact.description}`)
|
|
66
68
|
.join("\n")
|
|
67
69
|
: null;
|
|
68
70
|
const inputs = method.inputs?.length
|
|
@@ -75,10 +77,10 @@ function renderMethodReadme(method) {
|
|
|
75
77
|
: null;
|
|
76
78
|
const contextInterfaceSummaryLines = interfaceSummary
|
|
77
79
|
? [
|
|
78
|
-
`- Input
|
|
79
|
-
`- Working
|
|
80
|
-
`- Output
|
|
81
|
-
`- Runtime
|
|
80
|
+
`- Input Artifacts: ${interfaceSummary.inputArtifacts.length > 0 ? interfaceSummary.inputArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
|
|
81
|
+
`- Working Artifacts: ${interfaceSummary.workingArtifacts.length > 0 ? interfaceSummary.workingArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
|
|
82
|
+
`- Output Artifacts: ${interfaceSummary.outputArtifacts.length > 0 ? interfaceSummary.outputArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
|
|
83
|
+
`- Runtime Artifacts: ${interfaceSummary.runtimeArtifacts.length > 0 ? interfaceSummary.runtimeArtifacts.map((artifact) => `\`${artifact.id}\``).join(", ") : "none"}`,
|
|
82
84
|
].join("\n")
|
|
83
85
|
: null;
|
|
84
86
|
return [
|
|
@@ -113,7 +115,7 @@ function renderMethodReadme(method) {
|
|
|
113
115
|
"",
|
|
114
116
|
]
|
|
115
117
|
: []),
|
|
116
|
-
"
|
|
118
|
+
"Artifact map:",
|
|
117
119
|
"",
|
|
118
120
|
contextInterfaceLines,
|
|
119
121
|
]
|
|
@@ -142,7 +144,7 @@ function renderDerivedMethodReadme(options) {
|
|
|
142
144
|
options.hint,
|
|
143
145
|
"",
|
|
144
146
|
`This Method package was forked from \`${options.baseMethodId}\` and materialized as a standalone package for this kind of agent work.`,
|
|
145
|
-
"It starts with that Method's topology; edit the package when the agent work needs different stages,
|
|
147
|
+
"It starts with that Method's topology; edit the package when the agent work needs different stages, Artifacts, or checks.",
|
|
146
148
|
"",
|
|
147
149
|
"Interf runs the local copy of this package directly. Keep purpose, inputs, context interface, and stage docs self-contained in this folder instead of relying on runtime inheritance.",
|
|
148
150
|
"",
|
|
@@ -161,7 +163,7 @@ function renderSeedMethodReadme(options) {
|
|
|
161
163
|
options.hint,
|
|
162
164
|
"",
|
|
163
165
|
`This Method package was forked from \`${options.baseMethodId}\` as a standalone local package.`,
|
|
164
|
-
"It starts with that Method's topology; edit the package when the agent work needs different stages,
|
|
166
|
+
"It starts with that Method's topology; edit the package when the agent work needs different stages, Artifacts, or checks.",
|
|
165
167
|
"",
|
|
166
168
|
"Interf runs the local copy of this package directly. Refine purpose, inputs, context interface, and stage instructions in this folder instead of relying on inheritance.",
|
|
167
169
|
"",
|
|
@@ -206,7 +208,6 @@ function renderImproveSkill(method) {
|
|
|
206
208
|
}
|
|
207
209
|
function renderStageSkill(method, stage) {
|
|
208
210
|
const notes = method.stagePolicyNotes?.[stage.id] ?? [];
|
|
209
|
-
const acceptanceKeys = stage.acceptance ? Object.keys(stage.acceptance) : [];
|
|
210
211
|
const abstractRules = stage.contractType === "compiled-file-evidence"
|
|
211
212
|
? [
|
|
212
213
|
"- Valid abstract forms for deterministic validation are:",
|
|
@@ -223,27 +224,19 @@ function renderStageSkill(method, stage) {
|
|
|
223
224
|
"## Stage Contract",
|
|
224
225
|
"",
|
|
225
226
|
`- Contract type: \`${stage.contractType}\``,
|
|
226
|
-
`- Reads
|
|
227
|
-
`- Writes
|
|
227
|
+
`- Reads Artifacts: ${stage.reads.map((artifactId) => `\`${artifactId}\``).join(", ")}`,
|
|
228
|
+
`- Writes Artifacts: ${stage.writes.map((artifactId) => `\`${artifactId}\``).join(", ")}`,
|
|
228
229
|
"",
|
|
229
230
|
"## Requirements",
|
|
230
231
|
"",
|
|
231
232
|
"- Treat `method.json` and `method.schema.json` as the authoritative package contract for this stage.",
|
|
232
|
-
"- Read only from the declared input
|
|
233
|
-
"- Write only inside the declared output
|
|
234
|
-
"- Keep stage instructions,
|
|
233
|
+
"- Read only from the declared input Artifacts unless this package explicitly documents a broader method.",
|
|
234
|
+
"- Write only inside the declared output Artifacts for this stage. Do not invent undeclared Artifacts or implicit outputs.",
|
|
235
|
+
"- Keep stage instructions, artifact ownership, and Method-level checks aligned when you change this stage.",
|
|
235
236
|
"- Treat runtime files as proof and execution state, not as the source of truth for Method behavior.",
|
|
236
237
|
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
237
238
|
...abstractRules,
|
|
238
239
|
"",
|
|
239
|
-
...(acceptanceKeys.length > 0
|
|
240
|
-
? [
|
|
241
|
-
"## Declarative Acceptance",
|
|
242
|
-
"",
|
|
243
|
-
...acceptanceKeys.map((key) => `- \`${key}\``),
|
|
244
|
-
"",
|
|
245
|
-
]
|
|
246
|
-
: []),
|
|
247
240
|
...(notes.length > 0
|
|
248
241
|
? [
|
|
249
242
|
"## Notes",
|
|
@@ -428,24 +421,15 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
428
421
|
version: 1,
|
|
429
422
|
target_type: "compiled",
|
|
430
423
|
label: `${options.label} Method schema`,
|
|
431
|
-
|
|
424
|
+
artifacts: [
|
|
432
425
|
{
|
|
433
426
|
id: "draft-context",
|
|
434
|
-
|
|
435
|
-
path: "draft",
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
},
|
|
441
|
-
{
|
|
442
|
-
id: "runtime",
|
|
443
|
-
role: "runtime",
|
|
444
|
-
path: ".interf/runtime",
|
|
445
|
-
kind: "runtime",
|
|
446
|
-
required: true,
|
|
447
|
-
owned_by: [],
|
|
448
|
-
description: "CLI-owned runtime state, health, stage contracts, and proof artifacts.",
|
|
427
|
+
description: "Temporary placeholder Artifact for the neutral authoring scaffold. Replace it with task-specific Artifacts.",
|
|
428
|
+
shape: { kind: "path", path: "draft", artifact_kind: "directory" },
|
|
429
|
+
checks: [
|
|
430
|
+
{ id: "exists", kind: "min_file_count", required: true, params: { min: 1 } },
|
|
431
|
+
],
|
|
432
|
+
built_by_stages: ["prepare"],
|
|
449
433
|
},
|
|
450
434
|
],
|
|
451
435
|
},
|
|
@@ -456,17 +440,15 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
456
440
|
description: "Neutral placeholder stage for Method authoring. Replace this stage with the topology this agent work needs.",
|
|
457
441
|
contractType: "method-draft-stage",
|
|
458
442
|
skillDir: "prepare",
|
|
459
|
-
|
|
443
|
+
role: "general",
|
|
444
|
+
reads: [],
|
|
460
445
|
writes: ["draft-context"],
|
|
461
|
-
acceptance: {
|
|
462
|
-
stage_truthy: ["finished_at"],
|
|
463
|
-
},
|
|
464
446
|
},
|
|
465
447
|
],
|
|
466
448
|
stagePolicyNotes: {
|
|
467
449
|
prepare: [
|
|
468
450
|
"This is a neutral authoring scaffold, not a recommended method topology.",
|
|
469
|
-
"Replace this stage,
|
|
451
|
+
"Replace this stage, Artifact, and check when drafting the final method.",
|
|
470
452
|
],
|
|
471
453
|
},
|
|
472
454
|
starterDocs: [
|
|
@@ -2,5 +2,5 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
const __filename = fileURLToPath(import.meta.url);
|
|
4
4
|
const __dirname = dirname(__filename);
|
|
5
|
-
// Package root (dist/packages/
|
|
6
|
-
export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..");
|
|
5
|
+
// Package root (dist/packages/methods/package/lib/ -> package root)
|
|
6
|
+
export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..", "..");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { MethodCompilerApiSchema,
|
|
3
|
-
import { RuntimeContractTypeSchema } from "
|
|
2
|
+
import { MethodCompilerApiSchema, MethodPurposeSchema, type MethodStageArtifactReadAccess, type MethodStageArtifactWriteAccess } from "../../engine/compile/lib/schema.js";
|
|
3
|
+
import { RuntimeContractTypeSchema } from "../../contracts/lib/schema.js";
|
|
4
4
|
import { MethodInputSpecSchema, type ContextInterface, type MethodInputSpec } from "./context-interface.js";
|
|
5
5
|
export interface LocalMethodStarterDoc {
|
|
6
6
|
relativePath: string;
|
|
@@ -12,9 +12,14 @@ export interface LocalMethodStageDefinition {
|
|
|
12
12
|
contract_type: z.infer<typeof RuntimeContractTypeSchema>;
|
|
13
13
|
skill_dir?: string;
|
|
14
14
|
description?: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Optional role hint. Open-ended string; defaults to `general` at the
|
|
17
|
+
* runtime layer when missing. Maps to a connected agent via the user's
|
|
18
|
+
* role-map (`~/.interf/agents.json`).
|
|
19
|
+
*/
|
|
20
|
+
role?: string;
|
|
21
|
+
reads: MethodStageArtifactReadAccess;
|
|
22
|
+
writes: MethodStageArtifactWriteAccess;
|
|
18
23
|
}
|
|
19
24
|
export interface LocalMethodDefinition {
|
|
20
25
|
id: string;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { basename, dirname, join, relative } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { listFilesRecursive } from "
|
|
5
|
-
import { warnInterf } from "
|
|
6
|
-
import { readJsonFileUnchecked, readJsonFileWithSchema } from "
|
|
7
|
-
import { isMarkdownFile } from "
|
|
8
|
-
import { MethodCompilerApiSchema,
|
|
9
|
-
import { RuntimeContractTypeSchema, InterfIdPattern, } from "
|
|
10
|
-
import { asPreparationDataDir, preparationMethodsRoot, } from "
|
|
11
|
-
import {
|
|
12
|
-
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
|
|
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";
|
|
13
12
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
14
13
|
const LocalMethodStageDefinitionSchema = z.object({
|
|
15
14
|
id: z.string().regex(InterfIdPattern),
|
|
@@ -17,9 +16,9 @@ const LocalMethodStageDefinitionSchema = z.object({
|
|
|
17
16
|
contract_type: RuntimeContractTypeSchema,
|
|
18
17
|
skill_dir: z.string().regex(InterfIdPattern).optional(),
|
|
19
18
|
description: z.string().min(1).optional(),
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
role: z.string().min(1).optional(),
|
|
20
|
+
reads: MethodStageArtifactReadAccessSchema,
|
|
21
|
+
writes: MethodStageArtifactWriteAccessSchema,
|
|
23
22
|
});
|
|
24
23
|
const LocalMethodDefinitionSchema = z.object({
|
|
25
24
|
id: z.string().regex(InterfIdPattern),
|
|
@@ -364,8 +363,9 @@ export function validateMethodPackage(dirPath) {
|
|
|
364
363
|
const stages = def.stages ?? [];
|
|
365
364
|
const stageIds = new Set(stages.map((stage) => stage.id));
|
|
366
365
|
const seenPaths = new Map();
|
|
367
|
-
const
|
|
368
|
-
const
|
|
366
|
+
const seenArtifactIds = new Set();
|
|
367
|
+
const schemaArtifacts = listContextInterfaceArtifacts(methodSchema);
|
|
368
|
+
const artifactById = new Map(schemaArtifacts.map((artifact) => [artifact.id, artifact]));
|
|
369
369
|
const normalizedParts = (value) => value.replaceAll("\\", "/").split("/").filter(Boolean);
|
|
370
370
|
const hasOverlappingPath = (value, other) => {
|
|
371
371
|
const a = normalizedParts(value);
|
|
@@ -374,78 +374,51 @@ export function validateMethodPackage(dirPath) {
|
|
|
374
374
|
const longer = a.length <= b.length ? b : a;
|
|
375
375
|
return shorter.every((part, index) => longer[index] === part);
|
|
376
376
|
};
|
|
377
|
-
for (const
|
|
378
|
-
if (
|
|
379
|
-
errors.push(`method.schema.json repeats
|
|
377
|
+
for (const artifact of schemaArtifacts) {
|
|
378
|
+
if (seenArtifactIds.has(artifact.id)) {
|
|
379
|
+
errors.push(`method.schema.json repeats Artifact id "${artifact.id}".`);
|
|
380
380
|
}
|
|
381
|
-
|
|
382
|
-
const existingPathOwner = seenPaths.get(
|
|
381
|
+
seenArtifactIds.add(artifact.id);
|
|
382
|
+
const existingPathOwner = seenPaths.get(artifact.path);
|
|
383
383
|
if (existingPathOwner) {
|
|
384
|
-
errors.push(`method.schema.json repeats
|
|
384
|
+
errors.push(`method.schema.json repeats Artifact path "${artifact.path}".`);
|
|
385
385
|
}
|
|
386
386
|
for (const [existingPath, existingZoneId] of seenPaths.entries()) {
|
|
387
|
-
if (existingPath ===
|
|
387
|
+
if (existingPath === artifact.path)
|
|
388
388
|
continue;
|
|
389
|
-
if (hasOverlappingPath(
|
|
390
|
-
errors.push(`method.schema.json
|
|
389
|
+
if (hasOverlappingPath(artifact.path, existingPath)) {
|
|
390
|
+
errors.push(`method.schema.json Artifacts "${artifact.id}" and "${existingZoneId}" overlap on path "${artifact.path}" / "${existingPath}".`);
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
seenPaths.set(
|
|
394
|
-
if ((
|
|
395
|
-
errors.push(`method.schema.json
|
|
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
396
|
}
|
|
397
|
-
for (const owner of
|
|
397
|
+
for (const owner of artifact.owned_by) {
|
|
398
398
|
if (!stageIds.has(owner)) {
|
|
399
|
-
errors.push(`method.schema.json references unknown stage "${owner}" for
|
|
399
|
+
errors.push(`method.schema.json references unknown stage "${owner}" for Artifact path "${artifact.path}".`);
|
|
400
400
|
}
|
|
401
401
|
}
|
|
402
402
|
}
|
|
403
403
|
for (const stage of stages) {
|
|
404
|
-
for (const
|
|
405
|
-
if (!
|
|
406
|
-
errors.push(`Stage "${stage.id}" reads unknown
|
|
404
|
+
for (const artifactId of stage.reads) {
|
|
405
|
+
if (!artifactById.has(artifactId)) {
|
|
406
|
+
errors.push(`Stage "${stage.id}" reads unknown Artifact "${artifactId}".`);
|
|
407
407
|
}
|
|
408
408
|
}
|
|
409
|
-
for (const
|
|
410
|
-
const
|
|
411
|
-
if (!
|
|
412
|
-
errors.push(`Stage "${stage.id}" writes unknown
|
|
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
413
|
continue;
|
|
414
414
|
}
|
|
415
|
-
if (
|
|
416
|
-
errors.push(`Stage "${stage.id}" writes
|
|
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
417
|
}
|
|
418
|
-
if (!
|
|
419
|
-
errors.push(`Stage "${stage.id}" writes
|
|
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
420
|
}
|
|
421
421
|
}
|
|
422
|
-
for (const artifactPath of Object.keys(stage.acceptance?.artifacts_must_not_contain ?? {})) {
|
|
423
|
-
const normalizedArtifactPath = artifactPath.replaceAll("\\", "/");
|
|
424
|
-
const artifactParts = normalizedArtifactPath.split("/").filter(Boolean);
|
|
425
|
-
if (artifactPath.startsWith("/") ||
|
|
426
|
-
artifactPath.startsWith("\\") ||
|
|
427
|
-
artifactParts.some((part) => part === "..")) {
|
|
428
|
-
errors.push(`Stage "${stage.id}" artifacts_must_not_contain key "${artifactPath}" must be a portable-context relative artifact path.`);
|
|
429
|
-
continue;
|
|
430
|
-
}
|
|
431
|
-
const matchingZone = zoneById.get(artifactPath);
|
|
432
|
-
if (matchingZone) {
|
|
433
|
-
errors.push(`Stage "${stage.id}" artifacts_must_not_contain key "${artifactPath}" is a zone id. Use the zone path "${matchingZone.path}" instead.`);
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
}
|
|
437
|
-
for (const requiredZone of listBuiltinCompiledZoneSpecs().filter((zone) => zone.id === "runtime")) {
|
|
438
|
-
const match = zoneById.get(requiredZone.id);
|
|
439
|
-
if (!match) {
|
|
440
|
-
errors.push(`method.schema.json is missing required zone "${requiredZone.id}".`);
|
|
441
|
-
continue;
|
|
442
|
-
}
|
|
443
|
-
if (match.kind !== requiredZone.kind) {
|
|
444
|
-
errors.push(`method.schema.json zone "${requiredZone.id}" should be kind "${requiredZone.kind}".`);
|
|
445
|
-
}
|
|
446
|
-
if (match.role !== requiredZone.role) {
|
|
447
|
-
errors.push(`method.schema.json zone "${requiredZone.id}" should have role "${requiredZone.role}".`);
|
|
448
|
-
}
|
|
449
422
|
}
|
|
450
423
|
}
|
|
451
424
|
const stageDirs = existsSync(join(dirPath, "compile", "stages"))
|
|
@@ -454,8 +427,8 @@ export function validateMethodPackage(dirPath) {
|
|
|
454
427
|
const counts = {
|
|
455
428
|
starter_docs: collectStarterDocs(dirPath).length,
|
|
456
429
|
compile_stage_docs: stageDirs.length,
|
|
457
|
-
|
|
458
|
-
|
|
430
|
+
compiled_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
|
|
431
|
+
method_artifacts: methodSchema ? listContextInterfaceArtifacts(methodSchema).length : 0,
|
|
459
432
|
};
|
|
460
433
|
return {
|
|
461
434
|
ok: errors.length === 0,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type LocalMethodDefinition } from "./local-methods.js";
|
|
2
|
-
import type {
|
|
3
|
-
import type { MethodId, RuntimeContractType } from "
|
|
4
|
-
import { type ContextInterface, type
|
|
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
5
|
export interface MethodStarterDoc {
|
|
6
6
|
relativePath: string;
|
|
7
7
|
content: string;
|
|
@@ -12,9 +12,14 @@ export interface MethodStageDefinition {
|
|
|
12
12
|
description: string;
|
|
13
13
|
contractType: RuntimeContractType;
|
|
14
14
|
skillDir: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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[];
|
|
18
23
|
}
|
|
19
24
|
export interface MethodDefinition<TId extends string> {
|
|
20
25
|
id: TId;
|
|
@@ -53,5 +58,4 @@ export declare function getMethodStagePosition(methodId: MethodId, stage: string
|
|
|
53
58
|
export declare function getMethodStages(methodId: MethodId, prepDataDir?: string): string[];
|
|
54
59
|
export declare function getActiveCompiledStages(compiledPath: string): string[];
|
|
55
60
|
export declare function getActiveCompiledStagePolicyNotes(compiledPath: string, stage: string): string[];
|
|
56
|
-
export declare function resolveActiveCompiledStageAcceptance(compiledPath: string, stage: string): MethodStageDefinition["acceptance"] | undefined;
|
|
57
61
|
export declare function formatActiveCompiledMethodStageStep(compiledPath: string, stage: string): string;
|
|
@@ -2,10 +2,10 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { builtinMethodPackagePath, isMethodId, listLocalMethodDefinitions, loadLocalMethodDefinition, loadMethodDefinitionFromDir, mergeStagePolicyNotesForStages, } from "./local-methods.js";
|
|
4
4
|
import { listUserMethodDefinitions, loadUserMethodDefinition, } from "./user-methods.js";
|
|
5
|
-
import { warnInterf } from "
|
|
6
|
-
import { methodPackagePathForCompiled } from "
|
|
7
|
-
import { asPreparationDataDir, preparationMethodPackagePath } from "
|
|
8
|
-
import { resolveSourceControlPath } from "
|
|
5
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
6
|
+
import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
7
|
+
import { asPreparationDataDir, preparationMethodPackagePath } from "../../contracts/lib/preparation-paths.js";
|
|
8
|
+
import { resolveSourceControlPath } from "../../project/interf.js";
|
|
9
9
|
import { deriveMethodInputsFromContextInterface, } from "./context-interface.js";
|
|
10
10
|
const DEFAULT_METHOD_ID = "interf-default";
|
|
11
11
|
let builtinDefaultMethodCache = null;
|
|
@@ -16,9 +16,9 @@ function toMethodStages(stages) {
|
|
|
16
16
|
description: stage.description ?? stage.label,
|
|
17
17
|
contractType: stage.contract_type,
|
|
18
18
|
skillDir: stage.skill_dir ?? stage.id,
|
|
19
|
+
role: stage.role && stage.role.trim().length > 0 ? stage.role : "general",
|
|
19
20
|
reads: [...stage.reads],
|
|
20
21
|
writes: [...stage.writes],
|
|
21
|
-
...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
|
|
22
22
|
}));
|
|
23
23
|
}
|
|
24
24
|
export function standaloneMethodDefinitionFromLocalPackage(local) {
|
|
@@ -209,9 +209,6 @@ export function getActiveCompiledStagePolicyNotes(compiledPath, stage) {
|
|
|
209
209
|
const method = getActiveCompiledMethod(compiledPath);
|
|
210
210
|
return [...(method.stagePolicyNotes?.[stage] ?? [])];
|
|
211
211
|
}
|
|
212
|
-
export function resolveActiveCompiledStageAcceptance(compiledPath, stage) {
|
|
213
|
-
return getActiveCompiledMethod(compiledPath).stages.find((candidate) => candidate.id === stage)?.acceptance;
|
|
214
|
-
}
|
|
215
212
|
export function formatActiveCompiledMethodStageStep(compiledPath, stage) {
|
|
216
213
|
return formatMethodStageStep(getActiveCompiledMethod(compiledPath), stage);
|
|
217
214
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "
|
|
2
|
-
import { type MethodStageDefinition } from "./method-definitions.js";
|
|
1
|
+
import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "../../engine/compile/lib/schema.js";
|
|
3
2
|
export interface MethodReporter {
|
|
4
3
|
line?: (message: string) => void;
|
|
5
4
|
blankLine?: () => void;
|
|
@@ -23,4 +22,3 @@ export declare function buildStageInstructions(stageSkillDir: string, localSkill
|
|
|
23
22
|
export declare function reportLine(reporter: MethodReporter | undefined, message: string): void;
|
|
24
23
|
export declare function reportBlankLine(reporter: MethodReporter | undefined): void;
|
|
25
24
|
export declare function reportValidationFailure(reporter: MethodReporter | undefined, summary: string, errors?: string[]): void;
|
|
26
|
-
export declare function resolveStageAcceptance(methodId: string, stageId: string, prepDataDir?: string): MethodStageDefinition["acceptance"] | undefined;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join, relative, sep } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
4
|
-
import { parseJsonFrontmatter } from "
|
|
5
|
-
import { isMarkdownFile } from "
|
|
6
|
-
import {
|
|
7
|
-
import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "../compiler/compiled-paths.js";
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
|
|
5
|
+
import { isMarkdownFile } from "../../contracts/utils/file-types.js";
|
|
6
|
+
import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
8
7
|
const LOCAL_SKILL_READ_LIMIT = 50;
|
|
9
8
|
export function methodCompileStageDirectory(stageDir) {
|
|
10
9
|
return `${COMPILED_METHOD_DIR}/compile/stages/${stageDir}`;
|
|
@@ -128,6 +127,3 @@ export function reportValidationFailure(reporter, summary, errors = []) {
|
|
|
128
127
|
reportLine(reporter, `- ${error}`);
|
|
129
128
|
}
|
|
130
129
|
}
|
|
131
|
-
export function resolveStageAcceptance(methodId, stageId, prepDataDir) {
|
|
132
|
-
return getCompiledMethod(methodId, { prepDataDir }).stages.find((stage) => stage.id === stageId)?.acceptance;
|
|
133
|
-
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MethodImprovementContext } from "
|
|
1
|
+
import type { MethodImprovementContext } from "../../engine/compile/lib/schema.js";
|
|
2
2
|
export interface MethodImprovementReviewSourcePaths {
|
|
3
3
|
compiledRuntime: string | null;
|
|
4
4
|
readinessRuns: string | null;
|