@interf/compiler 0.9.5 → 0.16.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/README.md +135 -91
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +143 -38
- package/agent-skills/interf-actions/references/cli.md +134 -67
- package/builtin-methods/interf-default/README.md +3 -4
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
- package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
- package/builtin-methods/interf-default/improve/SKILL.md +1 -1
- package/builtin-methods/interf-default/method.json +10 -4
- package/builtin-methods/interf-default/method.schema.json +0 -9
- package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.d.ts +8 -25
- package/dist/cli/commands/compile.js +83 -359
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +39 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.js +16 -0
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.d.ts +2 -0
- package/dist/cli/commands/method.js +113 -0
- package/dist/cli/commands/prep.d.ts +2 -0
- package/dist/cli/commands/prep.js +152 -0
- package/dist/cli/commands/reset.d.ts +8 -1
- package/dist/cli/commands/reset.js +47 -26
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +120 -0
- package/dist/cli/commands/status.d.ts +6 -1
- package/dist/cli/commands/status.js +68 -111
- package/dist/cli/commands/verify.d.ts +7 -1
- package/dist/cli/commands/verify.js +69 -85
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +201 -121
- package/dist/cli/commands/wizard.d.ts +9 -0
- package/dist/cli/commands/wizard.js +689 -0
- package/dist/cli/index.d.ts +10 -7
- package/dist/cli/index.js +19 -12
- 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/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
- package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
- 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/preparation-paths.d.ts +117 -0
- package/dist/packages/contracts/lib/preparation-paths.js +177 -0
- package/dist/packages/contracts/lib/schema.d.ts +187 -13
- package/dist/packages/contracts/lib/schema.js +148 -3
- package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
- package/dist/packages/contracts/utils/filesystem.js +142 -0
- package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
- package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +3 -2
- 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 +5 -5
- package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
- package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
- package/dist/packages/engine/agents/lib/user-config.js +24 -0
- 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 +59 -60
- package/dist/packages/{local-service → engine}/client.js +137 -145
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
- package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
- package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/index.js +1 -0
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
- package/dist/packages/engine/compile/method-runs.d.ts +14 -0
- package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
- package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
- package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
- package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
- package/dist/packages/engine/compile/source-files.d.ts +46 -0
- package/dist/packages/engine/compile/source-files.js +149 -0
- package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
- package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
- package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
- package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
- package/dist/packages/engine/compile/state-paths.js +16 -0
- package/dist/packages/engine/compile/state-view.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
- package/dist/packages/engine/compile/state.d.ts +7 -0
- package/dist/packages/{compiler → engine/compile}/state.js +3 -3
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
- package/dist/packages/engine/connection-config.d.ts +38 -0
- package/dist/packages/engine/connection-config.js +75 -0
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
- package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/engine/instance-paths.d.ts +100 -0
- package/dist/packages/engine/instance-paths.js +165 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
- package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
- package/dist/packages/engine/preparation-store.d.ts +104 -0
- package/dist/packages/engine/preparation-store.js +194 -0
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +78 -0
- package/dist/packages/engine/routes.js +92 -0
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +25 -24
- package/dist/packages/engine/runtime-caches.d.ts +76 -0
- package/dist/packages/engine/runtime-caches.js +191 -0
- package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
- package/dist/packages/engine/runtime-event-applier.js +177 -0
- package/dist/packages/engine/runtime-persistence.d.ts +47 -0
- package/dist/packages/engine/runtime-persistence.js +137 -0
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
- package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
- package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
- package/dist/packages/engine/runtime-resource-builders.js +149 -0
- package/dist/packages/engine/runtime.d.ts +318 -0
- package/dist/packages/{local-service → engine}/runtime.js +835 -1011
- package/dist/packages/{local-service → engine}/server.d.ts +15 -0
- package/dist/packages/engine/server.js +1257 -0
- package/dist/packages/engine/service-registry.d.ts +47 -0
- package/dist/packages/engine/service-registry.js +137 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
- package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
- package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
- package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
- package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
- package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
- package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
- package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test.js +1 -1
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- 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 +4 -5
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
- package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
- package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
- package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
- package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
- package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
- package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
- 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 +3 -31
- package/dist/packages/methods/package/user-methods.d.ts +17 -0
- package/dist/packages/methods/package/user-methods.js +77 -0
- package/dist/packages/{project-model → project}/index.d.ts +0 -1
- package/dist/packages/{project-model → project}/index.js +0 -1
- 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.d.ts +8 -3
- package/dist/packages/{project-model → project}/interf-detect.js +38 -38
- package/dist/packages/project/interf-scaffold.d.ts +3 -0
- package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +39 -2
- package/dist/packages/project/preparation-entries.d.ts +11 -0
- package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
- package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
- package/dist/packages/{project-model → project}/source-config.js +81 -53
- package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
- package/dist/packages/{project-model → project}/source-folders.js +16 -16
- package/package.json +8 -8
- package/CHANGELOG.md +0 -93
- package/LICENSE +0 -183
- package/dist/cli/commands/action-input-cli.d.ts +0 -25
- package/dist/cli/commands/action-input-cli.js +0 -73
- package/dist/cli/commands/control-path.d.ts +0 -11
- package/dist/cli/commands/control-path.js +0 -72
- package/dist/cli/commands/create-method-wizard.d.ts +0 -64
- package/dist/cli/commands/create-method-wizard.js +0 -434
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/create.js +0 -183
- package/dist/cli/commands/default.d.ts +0 -2
- package/dist/cli/commands/default.js +0 -39
- package/dist/cli/commands/executor-flow.d.ts +0 -29
- package/dist/cli/commands/executor-flow.js +0 -163
- package/dist/cli/commands/init.d.ts +0 -26
- package/dist/cli/commands/init.js +0 -771
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-action.d.ts +0 -8
- package/dist/cli/commands/preparation-action.js +0 -29
- package/dist/cli/commands/preparation-picker.d.ts +0 -5
- package/dist/cli/commands/preparation-picker.js +0 -36
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/service-action-flow.d.ts +0 -9
- package/dist/cli/commands/service-action-flow.js +0 -19
- package/dist/cli/commands/source-config-wizard.d.ts +0 -51
- package/dist/cli/commands/source-config-wizard.js +0 -670
- package/dist/cli/commands/test.d.ts +0 -17
- package/dist/cli/commands/test.js +0 -188
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/agents/lib/user-config.js +0 -16
- package/dist/packages/compiler/method-runs.d.ts +0 -15
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
- package/dist/packages/compiler/raw-snapshot.js +0 -101
- package/dist/packages/compiler/state-artifacts.d.ts +0 -8
- package/dist/packages/compiler/state-paths.js +0 -13
- package/dist/packages/compiler/state-view.d.ts +0 -4
- package/dist/packages/compiler/state.d.ts +0 -7
- package/dist/packages/local-service/index.d.ts +0 -18
- package/dist/packages/local-service/index.js +0 -13
- package/dist/packages/local-service/routes.d.ts +0 -32
- package/dist/packages/local-service/routes.js +0 -37
- package/dist/packages/local-service/runtime.d.ts +0 -133
- package/dist/packages/local-service/server.js +0 -627
- package/dist/packages/method-package/index.d.ts +0 -11
- package/dist/packages/method-package/index.js +0 -11
- package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
- package/dist/packages/method-package/method-stage-policy.js +0 -31
- package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
- package/dist/packages/project-model/preparation-entries.d.ts +0 -11
- package/dist/packages/project-model/project-paths.d.ts +0 -12
- package/dist/packages/project-model/project-paths.js +0 -33
- package/dist/packages/shared/filesystem.d.ts +0 -2
- package/dist/packages/shared/filesystem.js +0 -55
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_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}/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-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/{compiler → engine/compile}/artifact-counts.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}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.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-health.d.ts +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/{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}/readiness-check-draft.js +0 -0
- /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/index.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-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-authoring → methods/authoring}/method-edit-session.js +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.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
|
@@ -1,18 +1,15 @@
|
|
|
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,
|
|
4
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
5
|
+
import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
|
|
6
|
+
import { MethodCompiledSchemaSchema, MethodZoneIdSchema, } from "../../engine/compile/lib/schema.js";
|
|
7
7
|
import { listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } 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."
|
|
11
11
|
export const CONTEXT_INTERFACE_FILE = "method.schema.json";
|
|
12
12
|
export const ContextInterfaceSchema = MethodCompiledSchemaSchema;
|
|
13
|
-
export const ContextInterfaceZoneSchema = MethodCompiledZoneSchema;
|
|
14
|
-
export const ContextInterfaceZoneIdSchema = MethodZoneIdSchema;
|
|
15
|
-
export const ContextInterfaceZoneRoleSchema = MethodZoneRoleSchema;
|
|
16
13
|
// Package-owned input contract for authoring, review, and future authoring flows.
|
|
17
14
|
// This does not change compiler execution semantics; it describes what data a
|
|
18
15
|
// Method expects to organize before the compiler materializes the context
|
|
@@ -24,7 +21,6 @@ export const MethodInputSpecSchema = z.object({
|
|
|
24
21
|
required: z.boolean().default(false),
|
|
25
22
|
examples: z.array(z.string().min(1)).optional(),
|
|
26
23
|
}).strict();
|
|
27
|
-
export const MethodInputContractSchema = z.array(MethodInputSpecSchema);
|
|
28
24
|
function normalizeContextInterface(contextInterface) {
|
|
29
25
|
return {
|
|
30
26
|
...contextInterface,
|
|
@@ -53,15 +49,6 @@ export function resolveContextInterfacePath(rootPath) {
|
|
|
53
49
|
export function contextInterfaceExists(rootPath) {
|
|
54
50
|
return existsSync(contextInterfaceFilePath(rootPath));
|
|
55
51
|
}
|
|
56
|
-
export function contextInterfaceRelativePath() {
|
|
57
|
-
return `method/${CONTEXT_INTERFACE_FILE}`;
|
|
58
|
-
}
|
|
59
|
-
export function listContextInterfaceZones(contextInterface) {
|
|
60
|
-
return [...contextInterface.zones];
|
|
61
|
-
}
|
|
62
|
-
export function findContextInterfaceZone(contextInterface, zoneId) {
|
|
63
|
-
return contextInterface.zones.find((zone) => zone.id === zoneId) ?? null;
|
|
64
|
-
}
|
|
65
52
|
export function contextInterfaceZoneAbsolutePath(compiledPath, zone) {
|
|
66
53
|
return join(compiledPath, zone.path);
|
|
67
54
|
}
|
|
@@ -70,15 +57,6 @@ export function contextInterfaceArtifactPath(zone) {
|
|
|
70
57
|
return zone.path;
|
|
71
58
|
return zone.path.endsWith("/") ? zone.path : `${zone.path}/`;
|
|
72
59
|
}
|
|
73
|
-
export function contextInterfaceArtifactPathsForZoneIds(contextInterface, zoneIds) {
|
|
74
|
-
return zoneIds.map((zoneId) => {
|
|
75
|
-
const zone = findContextInterfaceZone(contextInterface, zoneId);
|
|
76
|
-
if (!zone) {
|
|
77
|
-
throw new Error(`Context interface is missing declared zone "${zoneId}".`);
|
|
78
|
-
}
|
|
79
|
-
return contextInterfaceArtifactPath(zone);
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
60
|
export function summarizeContextInterface(contextInterface) {
|
|
83
61
|
return {
|
|
84
62
|
inputZones: contextInterface.zones.filter((zone) => zone.role === "input"),
|
|
@@ -5,11 +5,11 @@ export declare function writeMethodPackageToDir(methodDir: string, method: Metho
|
|
|
5
5
|
}): void;
|
|
6
6
|
export declare function seedCompiledMethodPackage(options: {
|
|
7
7
|
compiledPath: string;
|
|
8
|
-
|
|
8
|
+
prepDataDir: string;
|
|
9
9
|
methodId: string;
|
|
10
10
|
}): void;
|
|
11
11
|
export declare function createLocalMethodPackageFromTemplate(options: {
|
|
12
|
-
|
|
12
|
+
prepDataDir: string;
|
|
13
13
|
baseMethodId: string;
|
|
14
14
|
methodId: string;
|
|
15
15
|
label: string;
|
|
@@ -17,14 +17,14 @@ export declare function createLocalMethodPackageFromTemplate(options: {
|
|
|
17
17
|
stagePolicyNotes: Record<string, string[]>;
|
|
18
18
|
}): string;
|
|
19
19
|
export declare function seedLocalMethodPackageFromBase(options: {
|
|
20
|
-
|
|
20
|
+
prepDataDir: string;
|
|
21
21
|
baseMethodId: string;
|
|
22
22
|
methodId: string;
|
|
23
23
|
label: string;
|
|
24
24
|
hint: string;
|
|
25
25
|
}): string;
|
|
26
26
|
export declare function createScratchLocalMethodPackage(options: {
|
|
27
|
-
|
|
27
|
+
prepDataDir: string;
|
|
28
28
|
methodId: string;
|
|
29
29
|
label: string;
|
|
30
30
|
hint: string;
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
-
import { renderCompiledQuerySkill } from "
|
|
4
|
-
import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, } from "./local-methods.js";
|
|
3
|
+
import { renderCompiledQuerySkill } from "../../engine/agents/lib/shells.js";
|
|
4
|
+
import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, mergeStagePolicyNotesForStages, } from "./local-methods.js";
|
|
5
5
|
import { getCompiledMethod, } from "./method-definitions.js";
|
|
6
6
|
import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
|
|
7
|
-
import { methodPackagePathForCompiled } from "
|
|
8
|
-
import { mergeStagePolicyNotesForStages } from "./method-stage-policy.js";
|
|
9
|
-
function methodPackagePath(dirPath) {
|
|
10
|
-
return methodPackagePathForCompiled(dirPath);
|
|
11
|
-
}
|
|
7
|
+
import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
12
8
|
function writeMethodStarterDocs(dirPath, docs, options) {
|
|
13
9
|
for (const doc of docs ?? []) {
|
|
14
10
|
const targetPath = join(dirPath, doc.relativePath);
|
|
@@ -200,7 +196,7 @@ function renderImproveSkill(method) {
|
|
|
200
196
|
`4. Keep purpose, inputs, \`method.json\`, \`${CONTEXT_INTERFACE_FILE}\`, and any changed stage docs aligned.`,
|
|
201
197
|
"",
|
|
202
198
|
"Guardrails:",
|
|
203
|
-
"- do not edit checks, test specs, or
|
|
199
|
+
"- do not edit checks, test specs, or source artifacts",
|
|
204
200
|
"- do not hardcode expected answers into Method docs",
|
|
205
201
|
"- keep this package standalone; do not rely on runtime inheritance",
|
|
206
202
|
"- keep the Method stack coherent: purpose, inputs, context interface, and stages should describe the same job",
|
|
@@ -259,7 +255,7 @@ function renderStageSkill(method, stage) {
|
|
|
259
255
|
].join("\n");
|
|
260
256
|
}
|
|
261
257
|
export function writeCompiledMethodPackage(compiledPath, method) {
|
|
262
|
-
writeMethodPackageToDir(
|
|
258
|
+
writeMethodPackageToDir(methodPackagePathForCompiled(compiledPath), method);
|
|
263
259
|
}
|
|
264
260
|
export function writeMethodPackageToDir(methodDir, method, options = {}) {
|
|
265
261
|
const overwrite = options.overwrite ?? true;
|
|
@@ -301,23 +297,24 @@ export function writeMethodPackageToDir(methodDir, method, options = {}) {
|
|
|
301
297
|
}
|
|
302
298
|
export function seedCompiledMethodPackage(options) {
|
|
303
299
|
const resolvedMethod = getCompiledMethod(options.methodId, {
|
|
304
|
-
|
|
300
|
+
prepDataDir: options.prepDataDir,
|
|
305
301
|
});
|
|
306
|
-
const sourceMethodPath = resolveMethodPackageSourcePath(options.
|
|
302
|
+
const sourceMethodPath = resolveMethodPackageSourcePath(options.prepDataDir, resolvedMethod.id);
|
|
307
303
|
if (sourceMethodPath && isPortableMethodPackage(sourceMethodPath)) {
|
|
308
304
|
// Portable seed packages can be copied directly because compile runs the
|
|
309
305
|
// local package folder without reading source-root Method packages.
|
|
310
|
-
copyMethodPackageDirectory(sourceMethodPath,
|
|
311
|
-
patchMethodPackageMetadata(
|
|
306
|
+
copyMethodPackageDirectory(sourceMethodPath, methodPackagePathForCompiled(options.compiledPath));
|
|
307
|
+
patchMethodPackageMetadata(methodPackagePathForCompiled(options.compiledPath), {
|
|
312
308
|
id: resolvedMethod.id,
|
|
313
309
|
inputs: resolvedMethod.inputs,
|
|
314
310
|
label: resolvedMethod.label,
|
|
315
311
|
hint: resolvedMethod.hint,
|
|
316
312
|
stagePolicyNotes: resolvedMethod.stagePolicyNotes,
|
|
317
313
|
});
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
314
|
+
// The portable-context README is always derived from the resolved Method;
|
|
315
|
+
// any hand-authored README belongs in the workspace draft at
|
|
316
|
+
// <workspace>/methods/<id>/, not in the compiled copy.
|
|
317
|
+
writeFileSync(join(methodPackagePathForCompiled(options.compiledPath), "README.md"), renderMethodReadme(resolvedMethod));
|
|
321
318
|
return;
|
|
322
319
|
}
|
|
323
320
|
// Legacy or partially-defined seed packages are resolved once and
|
|
@@ -326,14 +323,14 @@ export function seedCompiledMethodPackage(options) {
|
|
|
326
323
|
}
|
|
327
324
|
export function createLocalMethodPackageFromTemplate(options) {
|
|
328
325
|
const targetPath = seedLocalMethodPackageFromBase({
|
|
329
|
-
|
|
326
|
+
prepDataDir: options.prepDataDir,
|
|
330
327
|
baseMethodId: options.baseMethodId,
|
|
331
328
|
methodId: options.methodId,
|
|
332
329
|
label: options.label,
|
|
333
330
|
hint: options.hint,
|
|
334
331
|
});
|
|
335
332
|
const baseMethod = getCompiledMethod(options.baseMethodId, {
|
|
336
|
-
|
|
333
|
+
prepDataDir: options.prepDataDir,
|
|
337
334
|
});
|
|
338
335
|
const stagePolicyNotes = mergeStagePolicyNotesForStages(baseMethod.stages, baseMethod.stagePolicyNotes, options.stagePolicyNotes);
|
|
339
336
|
patchMethodPackageMetadata(targetPath, {
|
|
@@ -358,10 +355,10 @@ export function createLocalMethodPackageFromTemplate(options) {
|
|
|
358
355
|
}
|
|
359
356
|
export function seedLocalMethodPackageFromBase(options) {
|
|
360
357
|
const baseMethod = getCompiledMethod(options.baseMethodId, {
|
|
361
|
-
|
|
358
|
+
prepDataDir: options.prepDataDir,
|
|
362
359
|
});
|
|
363
|
-
const sourceMethodPath = resolveMethodPackageSourcePath(options.
|
|
364
|
-
const targetPath = methodDefinitionPath(options.
|
|
360
|
+
const sourceMethodPath = resolveMethodPackageSourcePath(options.prepDataDir, options.baseMethodId);
|
|
361
|
+
const targetPath = methodDefinitionPath(options.prepDataDir, options.methodId);
|
|
365
362
|
if (sourceMethodPath && isPortableMethodPackage(sourceMethodPath)) {
|
|
366
363
|
// Copy directly when the base package is already portable and standalone.
|
|
367
364
|
copyMethodPackageDirectory(sourceMethodPath, targetPath);
|
|
@@ -403,7 +400,7 @@ export function seedLocalMethodPackageFromBase(options) {
|
|
|
403
400
|
return targetPath;
|
|
404
401
|
}
|
|
405
402
|
export function createScratchLocalMethodPackage(options) {
|
|
406
|
-
const targetPath = methodDefinitionPath(options.
|
|
403
|
+
const targetPath = methodDefinitionPath(options.prepDataDir, options.methodId);
|
|
407
404
|
const method = {
|
|
408
405
|
id: options.methodId,
|
|
409
406
|
compilerApi: {
|
|
@@ -416,9 +413,9 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
416
413
|
},
|
|
417
414
|
inputs: [
|
|
418
415
|
{
|
|
419
|
-
id: "
|
|
420
|
-
label: "
|
|
421
|
-
description: "Source
|
|
416
|
+
id: "source",
|
|
417
|
+
label: "Source",
|
|
418
|
+
description: "Source references assigned to each stage by Interf runtime.",
|
|
422
419
|
required: true,
|
|
423
420
|
},
|
|
424
421
|
],
|
|
@@ -432,15 +429,6 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
432
429
|
target_type: "compiled",
|
|
433
430
|
label: `${options.label} Method schema`,
|
|
434
431
|
zones: [
|
|
435
|
-
{
|
|
436
|
-
id: "raw",
|
|
437
|
-
role: "input",
|
|
438
|
-
path: "raw",
|
|
439
|
-
kind: "directory",
|
|
440
|
-
required: true,
|
|
441
|
-
owned_by: [],
|
|
442
|
-
description: "Source-folder raw snapshot copied into the Preparation for direct evidence and verification.",
|
|
443
|
-
},
|
|
444
432
|
{
|
|
445
433
|
id: "draft-context",
|
|
446
434
|
role: "output",
|
|
@@ -468,7 +456,8 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
468
456
|
description: "Neutral placeholder stage for Method authoring. Replace this stage with the topology this agent work needs.",
|
|
469
457
|
contractType: "method-draft-stage",
|
|
470
458
|
skillDir: "prepare",
|
|
471
|
-
|
|
459
|
+
role: "general",
|
|
460
|
+
reads: ["runtime"],
|
|
472
461
|
writes: ["draft-context"],
|
|
473
462
|
acceptance: {
|
|
474
463
|
stage_truthy: ["finished_at"],
|
|
@@ -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, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } from "
|
|
3
|
-
import { RuntimeContractTypeSchema } from "
|
|
2
|
+
import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } 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,6 +12,12 @@ export interface LocalMethodStageDefinition {
|
|
|
12
12
|
contract_type: z.infer<typeof RuntimeContractTypeSchema>;
|
|
13
13
|
skill_dir?: string;
|
|
14
14
|
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional role hint. Open-ended string; defaults to `general` at the
|
|
17
|
+
* runtime layer when missing. Maps to a connected agent via the user's
|
|
18
|
+
* role-map (`~/.interf/agents.json`).
|
|
19
|
+
*/
|
|
20
|
+
role?: string;
|
|
15
21
|
reads: z.infer<typeof MethodStageZoneAccessSchema>;
|
|
16
22
|
writes: z.infer<typeof MethodStageZoneAccessSchema>;
|
|
17
23
|
acceptance?: z.infer<typeof RuntimeStageAcceptanceSchema>;
|
|
@@ -32,20 +38,24 @@ export interface LocalMethodDefinition {
|
|
|
32
38
|
methodPath: string;
|
|
33
39
|
methodSchemaPath: string;
|
|
34
40
|
}
|
|
35
|
-
export declare function
|
|
41
|
+
export declare function mergeStagePolicyNotesForStages(stages: readonly {
|
|
42
|
+
id: string;
|
|
43
|
+
}[], baseNotes: unknown, overrideNotes: Record<string, string[]> | undefined): Record<string, string[]> | undefined;
|
|
44
|
+
export declare function builtinMethodPackagePath(methodId: string): string;
|
|
45
|
+
export declare function methodDefinitionPath(prepDataDir: string, id: string): string;
|
|
36
46
|
export declare function loadMethodDefinitionFromDir(dirPath: string): LocalMethodDefinition | null;
|
|
37
|
-
export declare function listLocalMethodDefinitions(
|
|
38
|
-
export declare function loadLocalMethodDefinition(
|
|
39
|
-
export declare function resolveMethodPackageSourcePath(
|
|
47
|
+
export declare function listLocalMethodDefinitions(prepDataDir: string): LocalMethodDefinition[];
|
|
48
|
+
export declare function loadLocalMethodDefinition(prepDataDir: string, id: string): LocalMethodDefinition | null;
|
|
49
|
+
export declare function resolveMethodPackageSourcePath(prepDataDir: string, methodId: string): string | null;
|
|
40
50
|
export declare function seedLocalDefaultMethod(options: {
|
|
41
|
-
|
|
51
|
+
prepDataDir: string;
|
|
42
52
|
}): {
|
|
43
53
|
methodId: string;
|
|
44
54
|
targetPath: string;
|
|
45
55
|
alreadyExisted: boolean;
|
|
46
56
|
};
|
|
47
57
|
export declare function isMethodId(value: string): boolean;
|
|
48
|
-
export declare function patchMethodPackageMetadata(dirPath: string, options
|
|
58
|
+
export declare function patchMethodPackageMetadata(dirPath: string, options: {
|
|
49
59
|
id?: string;
|
|
50
60
|
inputs?: MethodInputSpec[];
|
|
51
61
|
label?: string;
|
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { dirname, join, relative } from "node:path";
|
|
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, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema, } from "
|
|
9
|
-
import { RuntimeContractTypeSchema, InterfIdPattern, } from "
|
|
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, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema, } 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";
|
|
10
11
|
import { listBuiltinCompiledZoneSpecs, } from "./builtin-compiled-method.js";
|
|
11
12
|
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
|
|
12
13
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
13
|
-
import { mergeStagePolicyNotesForStages } from "./method-stage-policy.js";
|
|
14
14
|
const LocalMethodStageDefinitionSchema = z.object({
|
|
15
15
|
id: z.string().regex(InterfIdPattern),
|
|
16
16
|
label: z.string().min(1),
|
|
17
17
|
contract_type: RuntimeContractTypeSchema,
|
|
18
18
|
skill_dir: z.string().regex(InterfIdPattern).optional(),
|
|
19
19
|
description: z.string().min(1).optional(),
|
|
20
|
+
role: z.string().min(1).optional(),
|
|
20
21
|
reads: MethodStageZoneAccessSchema,
|
|
21
22
|
writes: MethodStageZoneAccessSchema,
|
|
22
23
|
acceptance: RuntimeStageAcceptanceSchema.optional(),
|
|
@@ -32,14 +33,45 @@ const LocalMethodDefinitionSchema = z.object({
|
|
|
32
33
|
stages: z.array(LocalMethodStageDefinitionSchema).min(1).optional(),
|
|
33
34
|
stage_policy_notes: z.record(z.string(), z.array(z.string())).optional(),
|
|
34
35
|
});
|
|
35
|
-
function
|
|
36
|
-
|
|
36
|
+
function normalizeStagePolicyNotes(value) {
|
|
37
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
38
|
+
return undefined;
|
|
39
|
+
const normalized = {};
|
|
40
|
+
for (const [stageId, notes] of Object.entries(value)) {
|
|
41
|
+
if (!Array.isArray(notes))
|
|
42
|
+
continue;
|
|
43
|
+
const cleaned = Array.from(new Set(notes
|
|
44
|
+
.filter((note) => typeof note === "string")
|
|
45
|
+
.map((note) => note.trim())
|
|
46
|
+
.filter((note) => note.length > 0)));
|
|
47
|
+
if (cleaned.length > 0) {
|
|
48
|
+
normalized[stageId] = cleaned;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return Object.keys(normalized).length > 0 ? normalized : undefined;
|
|
37
52
|
}
|
|
38
|
-
function
|
|
53
|
+
export function mergeStagePolicyNotesForStages(stages, baseNotes, overrideNotes) {
|
|
54
|
+
const normalizedBase = normalizeStagePolicyNotes(baseNotes);
|
|
55
|
+
const merged = {};
|
|
56
|
+
for (const stage of stages) {
|
|
57
|
+
const combined = Array.from(new Set([
|
|
58
|
+
...(normalizedBase?.[stage.id] ?? []),
|
|
59
|
+
...((overrideNotes?.[stage.id] ?? []).map((note) => note.trim()).filter((note) => note.length > 0)),
|
|
60
|
+
]));
|
|
61
|
+
if (combined.length > 0) {
|
|
62
|
+
merged[stage.id] = combined;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
return Object.keys(merged).length > 0 ? merged : undefined;
|
|
66
|
+
}
|
|
67
|
+
function methodRootPath(prepDataDir) {
|
|
68
|
+
return preparationMethodsRoot(asPreparationDataDir(prepDataDir));
|
|
69
|
+
}
|
|
70
|
+
export function builtinMethodPackagePath(methodId) {
|
|
39
71
|
return join(PACKAGE_ROOT, "builtin-methods", methodId);
|
|
40
72
|
}
|
|
41
|
-
export function methodDefinitionPath(
|
|
42
|
-
return join(methodRootPath(
|
|
73
|
+
export function methodDefinitionPath(prepDataDir, id) {
|
|
74
|
+
return join(methodRootPath(prepDataDir), id);
|
|
43
75
|
}
|
|
44
76
|
function isSupportedMethodStarterDocPath(relativePath) {
|
|
45
77
|
if (relativePath === "README.md")
|
|
@@ -109,9 +141,9 @@ export function loadMethodDefinitionFromDir(dirPath) {
|
|
|
109
141
|
methodSchemaPath: contextInterfaceFilePath(dirPath),
|
|
110
142
|
};
|
|
111
143
|
}
|
|
112
|
-
export function listLocalMethodDefinitions(
|
|
144
|
+
export function listLocalMethodDefinitions(prepDataDir) {
|
|
113
145
|
const definitions = new Map();
|
|
114
|
-
const root = methodRootPath(
|
|
146
|
+
const root = methodRootPath(prepDataDir);
|
|
115
147
|
if (existsSync(root)) {
|
|
116
148
|
for (const entryPath of readdirSync(root).map((entry) => join(root, entry))) {
|
|
117
149
|
try {
|
|
@@ -128,25 +160,25 @@ export function listLocalMethodDefinitions(sourcePath) {
|
|
|
128
160
|
}
|
|
129
161
|
return [...definitions.values()].sort((a, b) => a.label.localeCompare(b.label));
|
|
130
162
|
}
|
|
131
|
-
export function loadLocalMethodDefinition(
|
|
132
|
-
return loadMethodDefinitionFromDir(methodDefinitionPath(
|
|
163
|
+
export function loadLocalMethodDefinition(prepDataDir, id) {
|
|
164
|
+
return loadMethodDefinitionFromDir(methodDefinitionPath(prepDataDir, id));
|
|
133
165
|
}
|
|
134
|
-
export function resolveMethodPackageSourcePath(
|
|
135
|
-
const localPath = methodDefinitionPath(
|
|
166
|
+
export function resolveMethodPackageSourcePath(prepDataDir, methodId) {
|
|
167
|
+
const localPath = methodDefinitionPath(prepDataDir, methodId);
|
|
136
168
|
if (loadMethodDefinitionFromDir(localPath))
|
|
137
169
|
return localPath;
|
|
138
|
-
const builtinPath =
|
|
170
|
+
const builtinPath = builtinMethodPackagePath(methodId);
|
|
139
171
|
if (loadMethodDefinitionFromDir(builtinPath))
|
|
140
172
|
return builtinPath;
|
|
141
173
|
return null;
|
|
142
174
|
}
|
|
143
175
|
export function seedLocalDefaultMethod(options) {
|
|
144
176
|
const methodId = "interf-default";
|
|
145
|
-
const targetPath = methodDefinitionPath(options.
|
|
177
|
+
const targetPath = methodDefinitionPath(options.prepDataDir, methodId);
|
|
146
178
|
if (existsSync(join(targetPath, "method.json"))) {
|
|
147
179
|
return { methodId, targetPath, alreadyExisted: true };
|
|
148
180
|
}
|
|
149
|
-
const builtinInterfPath =
|
|
181
|
+
const builtinInterfPath = builtinMethodPackagePath(methodId);
|
|
150
182
|
if (!existsSync(join(builtinInterfPath, "method.json"))) {
|
|
151
183
|
throw new Error(`Built-in "${methodId}" Method package not found at ${builtinInterfPath}.`);
|
|
152
184
|
}
|
|
@@ -169,7 +201,7 @@ function readMethodJsonObject(dirPath) {
|
|
|
169
201
|
}
|
|
170
202
|
return { ...raw };
|
|
171
203
|
}
|
|
172
|
-
export function patchMethodPackageMetadata(dirPath, options
|
|
204
|
+
export function patchMethodPackageMetadata(dirPath, options) {
|
|
173
205
|
const methodPath = join(dirPath, "method.json");
|
|
174
206
|
const methodJson = readMethodJsonObject(dirPath);
|
|
175
207
|
const normalizedStages = Array.isArray(methodJson.stages) && methodJson.stages.length > 0
|
|
@@ -209,6 +241,11 @@ export function patchMethodPackageMetadata(dirPath, options = {}) {
|
|
|
209
241
|
label: schemaLabel,
|
|
210
242
|
});
|
|
211
243
|
}
|
|
244
|
+
function resolveStageSkillDir(stage) {
|
|
245
|
+
return typeof stage.skill_dir === "string" && stage.skill_dir.trim().length > 0
|
|
246
|
+
? stage.skill_dir
|
|
247
|
+
: stage.id;
|
|
248
|
+
}
|
|
212
249
|
function collectMethodPackageStructureIssues(dirPath, stages) {
|
|
213
250
|
const issues = [];
|
|
214
251
|
const methodPath = join(dirPath, "method.json");
|
|
@@ -225,23 +262,7 @@ function collectMethodPackageStructureIssues(dirPath, stages) {
|
|
|
225
262
|
if (!stages)
|
|
226
263
|
return issues;
|
|
227
264
|
for (const stage of stages) {
|
|
228
|
-
const skillDir =
|
|
229
|
-
? stage.skill_dir
|
|
230
|
-
: stage.id;
|
|
231
|
-
if (!existsSync(join(dirPath, "compile", "stages", skillDir, "SKILL.md"))) {
|
|
232
|
-
issues.push(`missing compile/stages/${skillDir}/SKILL.md`);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
return issues;
|
|
236
|
-
}
|
|
237
|
-
function collectMethodStageSkillIssues(dirPath, stages) {
|
|
238
|
-
if (!stages)
|
|
239
|
-
return [];
|
|
240
|
-
const issues = [];
|
|
241
|
-
for (const stage of stages) {
|
|
242
|
-
const skillDir = typeof stage.skill_dir === "string" && stage.skill_dir.trim().length > 0
|
|
243
|
-
? stage.skill_dir
|
|
244
|
-
: stage.id;
|
|
265
|
+
const skillDir = resolveStageSkillDir(stage);
|
|
245
266
|
if (!existsSync(join(dirPath, "compile", "stages", skillDir, "SKILL.md"))) {
|
|
246
267
|
issues.push(`missing compile/stages/${skillDir}/SKILL.md`);
|
|
247
268
|
}
|
|
@@ -271,9 +292,10 @@ export function describeMethodPackagePortability(dirPath) {
|
|
|
271
292
|
issues.push("method.json must declare explicit stages for a portable Method package");
|
|
272
293
|
return issues;
|
|
273
294
|
}
|
|
295
|
+
// Structural issues already returned earlier; only stage-skill files can be missing now.
|
|
274
296
|
return [
|
|
275
297
|
...issues,
|
|
276
|
-
...
|
|
298
|
+
...collectMethodPackageStructureIssues(dirPath, parsed.data.stages ?? null),
|
|
277
299
|
];
|
|
278
300
|
}
|
|
279
301
|
export function isPortableMethodPackage(dirPath) {
|
|
@@ -413,7 +435,7 @@ export function validateMethodPackage(dirPath) {
|
|
|
413
435
|
}
|
|
414
436
|
}
|
|
415
437
|
}
|
|
416
|
-
for (const requiredZone of listBuiltinCompiledZoneSpecs().filter((zone) => zone.id === "
|
|
438
|
+
for (const requiredZone of listBuiltinCompiledZoneSpecs().filter((zone) => zone.id === "runtime")) {
|
|
417
439
|
const match = zoneById.get(requiredZone.id);
|
|
418
440
|
if (!match) {
|
|
419
441
|
errors.push(`method.schema.json is missing required zone "${requiredZone.id}".`);
|
|
@@ -461,6 +483,3 @@ function describeContextInterfaceValidationIssues(dirPath) {
|
|
|
461
483
|
return `method.schema.json ${path}: ${issue.message}`;
|
|
462
484
|
});
|
|
463
485
|
}
|
|
464
|
-
function basename(filePath) {
|
|
465
|
-
return filePath.split(/[\\/]/).pop() ?? filePath;
|
|
466
|
-
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
1
|
+
import { type LocalMethodDefinition } from "./local-methods.js";
|
|
2
|
+
import type { RuntimeStageAcceptance, MethodCompilerApi } from "../../engine/compile/lib/schema.js";
|
|
3
|
+
import type { MethodId, RuntimeContractType } from "../../contracts/lib/schema.js";
|
|
3
4
|
import { type ContextInterface, type ContextInterfaceZoneId, type MethodInputSpec } from "./context-interface.js";
|
|
4
5
|
export interface MethodStarterDoc {
|
|
5
6
|
relativePath: string;
|
|
@@ -11,6 +12,12 @@ export interface MethodStageDefinition {
|
|
|
11
12
|
description: string;
|
|
12
13
|
contractType: RuntimeContractType;
|
|
13
14
|
skillDir: string;
|
|
15
|
+
/**
|
|
16
|
+
* Role hint declared by the Method package. Defaults to `general` when
|
|
17
|
+
* absent; mapped to a connected agent via the user's role-map at run
|
|
18
|
+
* time.
|
|
19
|
+
*/
|
|
20
|
+
role: string;
|
|
14
21
|
reads: ContextInterfaceZoneId[];
|
|
15
22
|
writes: ContextInterfaceZoneId[];
|
|
16
23
|
acceptance?: RuntimeStageAcceptance;
|
|
@@ -31,53 +38,26 @@ export interface MethodDefinition<TId extends string> {
|
|
|
31
38
|
stages: MethodStageDefinition[];
|
|
32
39
|
stagePolicyNotes?: Record<string, string[]>;
|
|
33
40
|
starterDocs?: MethodStarterDoc[];
|
|
34
|
-
scope?: "builtin" | "local";
|
|
41
|
+
scope?: "builtin" | "user" | "local";
|
|
35
42
|
}
|
|
36
43
|
export type CompiledMethodId = string;
|
|
37
|
-
export declare function standaloneMethodDefinitionFromLocalPackage(local:
|
|
38
|
-
|
|
39
|
-
compiler_api?: MethodCompilerApi;
|
|
40
|
-
purpose?: {
|
|
41
|
-
label: string;
|
|
42
|
-
task_hint: string;
|
|
43
|
-
};
|
|
44
|
-
inputs?: MethodInputSpec[];
|
|
45
|
-
label: string;
|
|
46
|
-
hint: string;
|
|
47
|
-
stages?: Array<{
|
|
48
|
-
id: string;
|
|
49
|
-
label: string;
|
|
50
|
-
description?: string;
|
|
51
|
-
contract_type: RuntimeContractType;
|
|
52
|
-
skill_dir?: string;
|
|
53
|
-
reads: ContextInterfaceZoneId[];
|
|
54
|
-
writes: ContextInterfaceZoneId[];
|
|
55
|
-
acceptance?: RuntimeStageAcceptance;
|
|
56
|
-
}>;
|
|
57
|
-
stage_policy_notes?: Record<string, string[]>;
|
|
58
|
-
method_schema?: ContextInterface;
|
|
59
|
-
starter_docs: MethodStarterDoc[];
|
|
60
|
-
}): MethodDefinition<string>;
|
|
61
|
-
export declare function listCompiledMethodChoices(sourcePath?: string): MethodDefinition<string>[];
|
|
44
|
+
export declare function standaloneMethodDefinitionFromLocalPackage(local: LocalMethodDefinition): MethodDefinition<string>;
|
|
45
|
+
export declare function listCompiledMethodChoices(prepDataDir?: string): MethodDefinition<string>[];
|
|
62
46
|
export declare function getCompiledMethod(methodId: CompiledMethodId, options?: {
|
|
63
|
-
|
|
47
|
+
prepDataDir?: string;
|
|
64
48
|
}): MethodDefinition<string>;
|
|
65
49
|
export declare function getActiveCompiledMethod(compiledPath: string): MethodDefinition<string>;
|
|
66
50
|
export declare function resolveCompiledMethodId(value: unknown): CompiledMethodId | null;
|
|
67
51
|
export declare function resolveCompiledMethodFromConfig(config: unknown): CompiledMethodId | null;
|
|
68
52
|
export declare function resolveRequiredCompiledMethodFromConfig(config: unknown, label?: string): CompiledMethodId;
|
|
69
|
-
export declare function
|
|
70
|
-
|
|
71
|
-
}): string;
|
|
72
|
-
export declare function getMethodStageDefinition(methodId: MethodId, stage: string, sourcePath?: string): MethodStageDefinition | null;
|
|
73
|
-
export declare function getMethodStagePosition(methodId: MethodId, stage: string, sourcePath?: string): {
|
|
53
|
+
export declare function getMethodStageDefinition(methodId: MethodId, stage: string, prepDataDir?: string): MethodStageDefinition | null;
|
|
54
|
+
export declare function getMethodStagePosition(methodId: MethodId, stage: string, prepDataDir?: string): {
|
|
74
55
|
stageIndex: number;
|
|
75
56
|
stageTotal: number;
|
|
76
57
|
stages: string[];
|
|
77
58
|
} | null;
|
|
78
|
-
export declare function getMethodStages(methodId: MethodId,
|
|
59
|
+
export declare function getMethodStages(methodId: MethodId, prepDataDir?: string): string[];
|
|
79
60
|
export declare function getActiveCompiledStages(compiledPath: string): string[];
|
|
80
|
-
export declare function getMethodStagePolicyNotes(methodId: MethodId, stage: string, sourcePath?: string): string[];
|
|
81
61
|
export declare function getActiveCompiledStagePolicyNotes(compiledPath: string, stage: string): string[];
|
|
82
62
|
export declare function resolveActiveCompiledStageAcceptance(compiledPath: string, stage: string): MethodStageDefinition["acceptance"] | undefined;
|
|
83
63
|
export declare function formatActiveCompiledMethodStageStep(compiledPath: string, stage: string): string;
|