@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
|
@@ -2,13 +2,14 @@ import { cpSync, copyFileSync, existsSync, lstatSync, mkdirSync, mkdtempSync, re
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { basename, dirname, join, relative, sep as pathSep } from "node:path";
|
|
4
4
|
import { CHART_APPROXIMATION_NOTES } from "./chart-guidance.js";
|
|
5
|
-
import { buildCompiledSourceFiles } from "../../
|
|
6
|
-
import { METHOD_PACKAGE_DIR } from "
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
5
|
+
import { buildCompiledSourceFiles } from "../../compile/source-files.js";
|
|
6
|
+
import { METHOD_PACKAGE_DIR } from "../../../project/interf-detect.js";
|
|
7
|
+
import { CHECK_KINDS, } from "../../../contracts/lib/schema.js";
|
|
8
|
+
import { CONTEXT_INTERFACE_FILE as METHOD_SCHEMA_FILE, contextInterfaceArtifactAbsolutePath as compiledArtifactAbsolutePath, listContextInterfaceArtifacts, readContextInterface as readCompiledSchemaFile, resolveContextInterfacePath as resolveMethodSchemaPath, } from "../../../methods/package/context-interface.js";
|
|
9
|
+
import { stageExecutionShellsRoot, methodImprovementLoopRoot, methodPackagePathForCompiled, compiledInterfConfigPath, compiledRuntimeRoot, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "../../compile/compiled-paths.js";
|
|
10
|
+
import { ensureCompiledArtifactTargets } from "../../compile/compiled-schema.js";
|
|
11
|
+
import { listFilesRecursive } from "../../../contracts/utils/filesystem.js";
|
|
12
|
+
import { resolveMethodImprovementReviewSourcePaths } from "../../../methods/package/method-review-paths.js";
|
|
12
13
|
const LOCAL_SKILL_ROOTS = [
|
|
13
14
|
".claude/skills",
|
|
14
15
|
".codex/skills",
|
|
@@ -26,18 +27,18 @@ export function writeNativeAgentSurface(rootPath, agentsContent, skillName, skil
|
|
|
26
27
|
function compiledQuerySkillSourcePath(compiledPath) {
|
|
27
28
|
return join(methodPackagePathForCompiled(compiledPath), "use", "query", "SKILL.md");
|
|
28
29
|
}
|
|
29
|
-
function
|
|
30
|
+
function compiledArtifactSummaryLines(compiledPath) {
|
|
30
31
|
const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
|
|
31
32
|
if (!schema)
|
|
32
33
|
return ["- No Method schema is available yet."];
|
|
33
|
-
return schema
|
|
34
|
-
.filter((
|
|
35
|
-
.map((
|
|
34
|
+
return listContextInterfaceArtifacts(schema)
|
|
35
|
+
.filter((artifact) => artifact.kind !== "runtime")
|
|
36
|
+
.map((artifact) => `- \`${artifact.id}\` -> \`${artifact.path}\` (${artifact.role} ${artifact.kind})`);
|
|
36
37
|
}
|
|
37
38
|
export function renderCompiledAgents(compiledPath, name, methodId, about, options = {}) {
|
|
38
39
|
const methodOriginSelected = options.methodOriginSelected ?? methodId;
|
|
39
40
|
const methodLocalDraft = options.methodLocalDraft === true;
|
|
40
|
-
const
|
|
41
|
+
const artifactLines = compiledArtifactSummaryLines(compiledPath);
|
|
41
42
|
return [
|
|
42
43
|
`# ${name}`,
|
|
43
44
|
"",
|
|
@@ -53,7 +54,7 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
|
|
|
53
54
|
"## How to use this portable context",
|
|
54
55
|
"",
|
|
55
56
|
"1. Use the local native `interf-query` skill that Interf generated for this portable context.",
|
|
56
|
-
"2. Let the Method docs and declared
|
|
57
|
+
"2. Let the Method docs and declared Artifacts guide retrieval instead of assuming a fixed note layout.",
|
|
57
58
|
"3. Use `.interf/runtime/source-snapshot.json` when you need to inspect the source references behind the output.",
|
|
58
59
|
"",
|
|
59
60
|
"## How this portable context works",
|
|
@@ -72,8 +73,8 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
|
|
|
72
73
|
"- `.interf/method/compile/stages/` defines stage-specific docs that Interf projects into native execution shells for automated runs.",
|
|
73
74
|
"- Native local query skills are generated under local agent skill directories such as `.claude/skills/` and `.codex/skills/`.",
|
|
74
75
|
"- `.interf/runtime/source-snapshot.json` records the source files assigned to the latest runtime snapshot.",
|
|
75
|
-
`- Method
|
|
76
|
-
...
|
|
76
|
+
`- Method Artifacts are declared in \`.interf/method/${METHOD_SCHEMA_FILE}\`.`,
|
|
77
|
+
...artifactLines,
|
|
77
78
|
"- `.interf/runtime/` holds runtime artifacts written by Interf.",
|
|
78
79
|
"- `.interf/tests/` mirrors the latest saved readiness-check run and keeps detailed target runs plus preserved sandboxes.",
|
|
79
80
|
"- `.interf/tests/targets/` holds detailed source-files and compiled target runs plus preserved test sandboxes.",
|
|
@@ -90,7 +91,7 @@ export function renderCompiledAgents(compiledPath, name, methodId, about, option
|
|
|
90
91
|
"",
|
|
91
92
|
"```",
|
|
92
93
|
"interf compile build this portable context",
|
|
93
|
-
"interf
|
|
94
|
+
"interf verify run checks against this portable context",
|
|
94
95
|
"interf status show deterministic health",
|
|
95
96
|
"```",
|
|
96
97
|
"",
|
|
@@ -110,12 +111,12 @@ export function renderCompiledQuerySkill() {
|
|
|
110
111
|
"",
|
|
111
112
|
"Default loop:",
|
|
112
113
|
"1. Read `.interf/method/README.md` and this file first.",
|
|
113
|
-
`2. Use the Method
|
|
114
|
+
`2. Use the Method Artifacts declared in \`.interf/method/${METHOD_SCHEMA_FILE}\` before consulting source references.`,
|
|
114
115
|
"3. Use `.interf/runtime/source-snapshot.json` for direct quotes, verification, exact lookups, and cases where the portable context is missing the needed evidence or is ambiguous.",
|
|
115
116
|
"",
|
|
116
117
|
"Answering rule:",
|
|
117
118
|
"- do not modify source files while answering",
|
|
118
|
-
"- treat the Method as the portable-context contract and use its
|
|
119
|
+
"- treat the Method as the portable-context contract and use its Artifacts as the working retrieval surface",
|
|
119
120
|
"- say explicitly when an answer depends on approximation, bounded inference, or a source re-check",
|
|
120
121
|
"- use source references to confirm source page, metric family, provenance, or exact wording when the portable context is missing the needed evidence or is ambiguous",
|
|
121
122
|
"- do not invent navigation or note structure beyond what this Method declares",
|
|
@@ -142,7 +143,7 @@ function renderSourceFilesTestAgents() {
|
|
|
142
143
|
"## Rules",
|
|
143
144
|
"",
|
|
144
145
|
"- Answer only from source files listed in `runtime/source-files.json`.",
|
|
145
|
-
"- There is no portable context here, so do not assume any portable-context
|
|
146
|
+
"- There is no portable context here, so do not assume any portable-context Artifacts exist.",
|
|
146
147
|
"- Do not treat hidden runtime files or test artifacts as evidence.",
|
|
147
148
|
...chartNotes,
|
|
148
149
|
"- Write the requested answer and trace files, then stop.",
|
|
@@ -181,24 +182,24 @@ function readCompiledQuerySkillSource(compiledPath) {
|
|
|
181
182
|
function stageShellMethodRoot(shellRoot) {
|
|
182
183
|
return join(shellRoot, METHOD_PACKAGE_DIR);
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
-
return join(shellRoot, "inputs",
|
|
185
|
+
function shellInputArtifactPath(shellRoot, artifactId) {
|
|
186
|
+
return join(shellRoot, "inputs", artifactId);
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
-
return join(shellRoot, "outputs",
|
|
188
|
+
function shellOutputArtifactPath(shellRoot, artifactId) {
|
|
189
|
+
return join(shellRoot, "outputs", artifactId);
|
|
189
190
|
}
|
|
190
|
-
function
|
|
191
|
+
function shellArtifactAliasMountPath(shellRoot, artifact, mountKind) {
|
|
191
192
|
const mountRoot = mountKind === "inputs"
|
|
192
|
-
?
|
|
193
|
-
:
|
|
194
|
-
return
|
|
195
|
-
? join(mountRoot, basename(
|
|
193
|
+
? shellInputArtifactPath(shellRoot, artifact.id)
|
|
194
|
+
: shellOutputArtifactPath(shellRoot, artifact.id);
|
|
195
|
+
return artifact.kind === "file"
|
|
196
|
+
? join(mountRoot, basename(artifact.path))
|
|
196
197
|
: mountRoot;
|
|
197
198
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
200
|
-
? `${mountKind}/${
|
|
201
|
-
: `${mountKind}/${
|
|
199
|
+
function describeShellArtifactAliasMountPath(artifact, mountKind) {
|
|
200
|
+
return artifact.kind === "file"
|
|
201
|
+
? `${mountKind}/${artifact.id}/${basename(artifact.path)}`
|
|
202
|
+
: `${mountKind}/${artifact.id}`;
|
|
202
203
|
}
|
|
203
204
|
function shellRuntimePath(shellRoot, relativePath) {
|
|
204
205
|
return join(shellRoot, "runtime", relativePath);
|
|
@@ -240,15 +241,15 @@ function loadCompiledSchema(compiledPath) {
|
|
|
240
241
|
}
|
|
241
242
|
return schema;
|
|
242
243
|
}
|
|
243
|
-
function
|
|
244
|
-
return new Map(schema.
|
|
244
|
+
function artifactMap(schema) {
|
|
245
|
+
return new Map(listContextInterfaceArtifacts(schema).map((artifact) => [artifact.id, artifact]));
|
|
245
246
|
}
|
|
246
|
-
function
|
|
247
|
-
const
|
|
248
|
-
if (!
|
|
249
|
-
throw new Error(`Missing Method schema
|
|
247
|
+
function artifactOrThrow(artifacts, artifactId) {
|
|
248
|
+
const artifact = artifacts.get(artifactId);
|
|
249
|
+
if (!artifact) {
|
|
250
|
+
throw new Error(`Missing Method schema Artifact "${artifactId}" for stage shell projection.`);
|
|
250
251
|
}
|
|
251
|
-
return
|
|
252
|
+
return artifact;
|
|
252
253
|
}
|
|
253
254
|
function normalizeArtifactRelativePath(path) {
|
|
254
255
|
return path
|
|
@@ -263,28 +264,29 @@ function relativePathEqualsOrWithin(basePath, candidatePath) {
|
|
|
263
264
|
return false;
|
|
264
265
|
return candidate === base || candidate.startsWith(`${base}/`);
|
|
265
266
|
}
|
|
266
|
-
function
|
|
267
|
-
|
|
267
|
+
function stageWriteArtifactSet(schema, stage) {
|
|
268
|
+
const artifacts = listContextInterfaceArtifacts(schema);
|
|
269
|
+
return new Set(stage.writes.filter((artifactId) => artifacts.some((artifact) => artifact.id === artifactId)));
|
|
268
270
|
}
|
|
269
|
-
function
|
|
270
|
-
const materialized =
|
|
271
|
-
for (const
|
|
272
|
-
if (
|
|
273
|
-
materialized.add(
|
|
271
|
+
function stageMaterializedArtifactSet(schema, stage, writeArtifacts = []) {
|
|
272
|
+
const materialized = stageWriteArtifactSet(schema, stage);
|
|
273
|
+
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
274
|
+
if (artifact.kind === "runtime" && stage.reads.includes(artifact.id)) {
|
|
275
|
+
materialized.add(artifact.id);
|
|
274
276
|
}
|
|
275
277
|
}
|
|
276
278
|
for (const artifactPath of writeArtifacts) {
|
|
277
279
|
const normalizedArtifactPath = normalizeArtifactRelativePath(artifactPath);
|
|
278
280
|
if (normalizedArtifactPath.length === 0)
|
|
279
281
|
continue;
|
|
280
|
-
const owner = schema.
|
|
282
|
+
const owner = listContextInterfaceArtifacts(schema).find((artifact) => relativePathEqualsOrWithin(artifact.path, normalizedArtifactPath));
|
|
281
283
|
if (owner) {
|
|
282
284
|
materialized.add(owner.id);
|
|
283
285
|
}
|
|
284
286
|
}
|
|
285
287
|
return materialized;
|
|
286
288
|
}
|
|
287
|
-
function ensureShellLocalProjection(sourcePath, targetPath,
|
|
289
|
+
function ensureShellLocalProjection(sourcePath, targetPath, artifact) {
|
|
288
290
|
if (existsSync(sourcePath)) {
|
|
289
291
|
copyResolvedTree({
|
|
290
292
|
sourcePath,
|
|
@@ -293,7 +295,7 @@ function ensureShellLocalProjection(sourcePath, targetPath, zone) {
|
|
|
293
295
|
});
|
|
294
296
|
return;
|
|
295
297
|
}
|
|
296
|
-
if (
|
|
298
|
+
if (artifact.kind === "file") {
|
|
297
299
|
mkdirSync(dirname(targetPath), { recursive: true });
|
|
298
300
|
return;
|
|
299
301
|
}
|
|
@@ -303,7 +305,7 @@ function ensureCompiledExecutionSurface(compiledPath) {
|
|
|
303
305
|
mkdirSync(compiledRuntimeRoot(compiledPath), { recursive: true });
|
|
304
306
|
mkdirSync(methodPackagePathForCompiled(compiledPath), { recursive: true });
|
|
305
307
|
const schema = loadCompiledSchema(compiledPath);
|
|
306
|
-
|
|
308
|
+
ensureCompiledArtifactTargets(compiledPath, schema);
|
|
307
309
|
return schema;
|
|
308
310
|
}
|
|
309
311
|
function readStageMethodDoc(compiledPath, stage) {
|
|
@@ -332,12 +334,12 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
|
332
334
|
"",
|
|
333
335
|
"## Shell ABI",
|
|
334
336
|
"",
|
|
335
|
-
"- `inputs/<
|
|
336
|
-
"- `outputs/<
|
|
337
|
-
"- For file
|
|
337
|
+
"- `inputs/<artifact-id>/` = read mounts for the current stage.",
|
|
338
|
+
"- `outputs/<artifact-id>/` = write mounts for the current stage.",
|
|
339
|
+
"- For file Artifacts, `runtime/paths.json` points to the exact file path inside those mount roots.",
|
|
338
340
|
"- `runtime/source-snapshot.json` = source references captured for this run.",
|
|
339
341
|
"- `runtime/stage-inputs.json` = exact source references assigned to this stage.",
|
|
340
|
-
"- declared
|
|
342
|
+
"- declared Artifact paths are also projected at the shell root so Method-relative contract paths stay valid.",
|
|
341
343
|
"- `runtime/` = stage contract and machine-readable path map for this shell.",
|
|
342
344
|
"- `method/` = Method metadata, `method.schema.json`, and docs for the current stage only.",
|
|
343
345
|
"",
|
|
@@ -348,9 +350,9 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
|
348
350
|
"- This shell has its own AGENTS/CLAUDE/native skills. It does not inherit the portable-context query shell.",
|
|
349
351
|
"- The portable context root itself is not linked into this shell.",
|
|
350
352
|
"- Do not switch into query mode or act like a user-facing assistant.",
|
|
351
|
-
"- Do not modify files under `inputs/` unless the same
|
|
353
|
+
"- Do not modify files under `inputs/` unless the same Artifact is also mounted under `outputs/`.",
|
|
352
354
|
"",
|
|
353
|
-
"## Current Stage
|
|
355
|
+
"## Current Stage Artifacts",
|
|
354
356
|
"",
|
|
355
357
|
`- reads: ${stage.reads.join(", ")}`,
|
|
356
358
|
`- writes: ${stage.writes.join(", ")}`,
|
|
@@ -359,7 +361,7 @@ function renderStageExecutionAgents(compiledName, methodId, stage) {
|
|
|
359
361
|
"",
|
|
360
362
|
"- complete the current stage",
|
|
361
363
|
"- honor the deterministic contract",
|
|
362
|
-
"- write outputs through the declared
|
|
364
|
+
"- write outputs through the declared Artifact mounts",
|
|
363
365
|
"- stop when the stage is complete",
|
|
364
366
|
"",
|
|
365
367
|
].join("\n");
|
|
@@ -378,7 +380,7 @@ function renderStageExecutionSkill(stage, stageMethodDoc) {
|
|
|
378
380
|
"This local native skill exists for automated Interf stage execution.",
|
|
379
381
|
"Read `runtime/stage-contract.json` first.",
|
|
380
382
|
"Then read `runtime/source-snapshot.json`, `runtime/stage-inputs.json`, and `runtime/paths.json`.",
|
|
381
|
-
"Use the assigned source references and the mounted `inputs/` and `outputs/`
|
|
383
|
+
"Use the assigned source references and the mounted `inputs/` and `outputs/` Artifacts for this stage.",
|
|
382
384
|
"Do not switch into manual query mode.",
|
|
383
385
|
"",
|
|
384
386
|
"## Current Stage",
|
|
@@ -440,33 +442,33 @@ function projectMethodMetadata(compiledPath, shellRoot, stage) {
|
|
|
440
442
|
linkPath(stageDocsPath, join(shellMethodRoot, "compile", "stages", stage.skillDir));
|
|
441
443
|
}
|
|
442
444
|
}
|
|
443
|
-
function
|
|
444
|
-
const
|
|
445
|
-
for (const
|
|
446
|
-
if (
|
|
445
|
+
function projectCompiledSchemaArtifacts(compiledPath, shellRoot, schema, artifactIds, materializedArtifactIds) {
|
|
446
|
+
const allowedArtifactIds = artifactIds ? new Set(artifactIds) : null;
|
|
447
|
+
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
448
|
+
if (allowedArtifactIds && !allowedArtifactIds.has(artifact.id))
|
|
447
449
|
continue;
|
|
448
|
-
const sourcePath =
|
|
449
|
-
const targetPath = join(shellRoot,
|
|
450
|
-
if (
|
|
451
|
-
ensureShellLocalProjection(sourcePath, targetPath,
|
|
450
|
+
const sourcePath = compiledArtifactAbsolutePath(compiledPath, artifact);
|
|
451
|
+
const targetPath = join(shellRoot, artifact.path);
|
|
452
|
+
if (materializedArtifactIds?.has(artifact.id)) {
|
|
453
|
+
ensureShellLocalProjection(sourcePath, targetPath, artifact);
|
|
452
454
|
continue;
|
|
453
455
|
}
|
|
454
456
|
linkPath(sourcePath, targetPath);
|
|
455
457
|
}
|
|
456
458
|
}
|
|
457
|
-
function
|
|
458
|
-
const
|
|
459
|
-
const mountFor = (
|
|
460
|
-
const
|
|
459
|
+
function buildStageArtifactMounts(compiledPath, shellRoot, stage, schema) {
|
|
460
|
+
const artifacts = artifactMap(schema);
|
|
461
|
+
const mountFor = (artifactId) => {
|
|
462
|
+
const artifact = artifactOrThrow(artifacts, artifactId);
|
|
461
463
|
return {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
shell_root_path:
|
|
465
|
-
input_mount_path: stage.reads.includes(
|
|
466
|
-
?
|
|
464
|
+
artifact_id: artifact.id,
|
|
465
|
+
artifact_path: artifact.path,
|
|
466
|
+
shell_root_path: artifact.path,
|
|
467
|
+
input_mount_path: stage.reads.includes(artifactId)
|
|
468
|
+
? describeShellArtifactAliasMountPath(artifact, "inputs")
|
|
467
469
|
: null,
|
|
468
|
-
output_mount_path: stage.writes.includes(
|
|
469
|
-
?
|
|
470
|
+
output_mount_path: stage.writes.includes(artifactId)
|
|
471
|
+
? describeShellArtifactAliasMountPath(artifact, "outputs")
|
|
470
472
|
: null,
|
|
471
473
|
};
|
|
472
474
|
};
|
|
@@ -475,16 +477,16 @@ function buildStageZoneMounts(compiledPath, shellRoot, stage, schema) {
|
|
|
475
477
|
writes: stage.writes.map(mountFor),
|
|
476
478
|
};
|
|
477
479
|
}
|
|
478
|
-
function
|
|
479
|
-
const
|
|
480
|
-
for (const
|
|
481
|
-
const
|
|
482
|
-
const targetPath = join(shellRoot,
|
|
483
|
-
if (stage.reads.includes(
|
|
484
|
-
linkRelativePath(targetPath,
|
|
480
|
+
function projectStageArtifactMountAliases(shellRoot, stage, schema) {
|
|
481
|
+
const artifacts = artifactMap(schema);
|
|
482
|
+
for (const artifactId of new Set([...stage.reads, ...stage.writes])) {
|
|
483
|
+
const artifact = artifactOrThrow(artifacts, artifactId);
|
|
484
|
+
const targetPath = join(shellRoot, artifact.path);
|
|
485
|
+
if (stage.reads.includes(artifactId)) {
|
|
486
|
+
linkRelativePath(targetPath, shellArtifactAliasMountPath(shellRoot, artifact, "inputs"));
|
|
485
487
|
}
|
|
486
|
-
if (stage.writes.includes(
|
|
487
|
-
linkRelativePath(targetPath,
|
|
488
|
+
if (stage.writes.includes(artifactId)) {
|
|
489
|
+
linkRelativePath(targetPath, shellArtifactAliasMountPath(shellRoot, artifact, "outputs"));
|
|
488
490
|
}
|
|
489
491
|
}
|
|
490
492
|
}
|
|
@@ -501,46 +503,46 @@ function writeExecutionShellPathsFile(shellRoot, methodId, stage, mounts) {
|
|
|
501
503
|
}
|
|
502
504
|
export function syncStageExecutionShellWrites(compiledPath, shellRoot, stage, writeArtifacts = []) {
|
|
503
505
|
const schema = ensureCompiledExecutionSurface(compiledPath);
|
|
504
|
-
const
|
|
505
|
-
const
|
|
506
|
-
.map((
|
|
507
|
-
for (const
|
|
508
|
-
const
|
|
509
|
-
const outputAliasPath =
|
|
510
|
-
const
|
|
506
|
+
const artifacts = artifactMap(schema);
|
|
507
|
+
const stageWriteArtifacts = Array.from(stageWriteArtifactSet(schema, stage))
|
|
508
|
+
.map((artifactId) => artifactOrThrow(artifacts, artifactId));
|
|
509
|
+
for (const artifact of stageWriteArtifacts) {
|
|
510
|
+
const canonicalShellArtifactPath = join(shellRoot, artifact.path);
|
|
511
|
+
const outputAliasPath = shellArtifactAliasMountPath(shellRoot, artifact, "outputs");
|
|
512
|
+
const shellArtifactPath = artifact.kind === "file" &&
|
|
511
513
|
existsSync(outputAliasPath) &&
|
|
512
514
|
!lstatSync(outputAliasPath).isSymbolicLink()
|
|
513
515
|
? outputAliasPath
|
|
514
|
-
:
|
|
515
|
-
if (!existsSync(
|
|
516
|
+
: canonicalShellArtifactPath;
|
|
517
|
+
if (!existsSync(shellArtifactPath))
|
|
516
518
|
continue;
|
|
517
|
-
const
|
|
518
|
-
if (
|
|
519
|
+
const shellArtifactStat = lstatSync(shellArtifactPath);
|
|
520
|
+
if (shellArtifactStat.isSymbolicLink())
|
|
519
521
|
continue;
|
|
520
|
-
const
|
|
521
|
-
if (
|
|
522
|
-
const
|
|
523
|
-
const
|
|
524
|
-
? listFilesRecursive(
|
|
522
|
+
const compiledArtifactPath = compiledArtifactAbsolutePath(compiledPath, artifact);
|
|
523
|
+
if (shellArtifactStat.isDirectory()) {
|
|
524
|
+
const shellArtifactFiles = listFilesRecursive(shellArtifactPath);
|
|
525
|
+
const compiledArtifactFiles = existsSync(compiledArtifactPath)
|
|
526
|
+
? listFilesRecursive(compiledArtifactPath)
|
|
525
527
|
: [];
|
|
526
|
-
if (
|
|
528
|
+
if (shellArtifactFiles.length === 0 && compiledArtifactFiles.length > 0) {
|
|
527
529
|
continue;
|
|
528
530
|
}
|
|
529
|
-
rmSync(
|
|
530
|
-
mkdirSync(dirname(
|
|
531
|
-
cpSync(
|
|
531
|
+
rmSync(compiledArtifactPath, { recursive: true, force: true });
|
|
532
|
+
mkdirSync(dirname(compiledArtifactPath), { recursive: true });
|
|
533
|
+
cpSync(shellArtifactPath, compiledArtifactPath, {
|
|
532
534
|
recursive: true,
|
|
533
535
|
force: true,
|
|
534
536
|
});
|
|
535
537
|
continue;
|
|
536
538
|
}
|
|
537
|
-
mkdirSync(dirname(
|
|
538
|
-
copyFileSync(
|
|
539
|
+
mkdirSync(dirname(compiledArtifactPath), { recursive: true });
|
|
540
|
+
copyFileSync(shellArtifactPath, compiledArtifactPath);
|
|
539
541
|
}
|
|
540
542
|
for (const artifactPath of writeArtifacts) {
|
|
541
543
|
const normalizedArtifactPath = normalizeArtifactRelativePath(artifactPath);
|
|
542
544
|
if (normalizedArtifactPath.length === 0 ||
|
|
543
|
-
|
|
545
|
+
stageWriteArtifacts.some((artifact) => relativePathEqualsOrWithin(artifact.path, normalizedArtifactPath))) {
|
|
544
546
|
continue;
|
|
545
547
|
}
|
|
546
548
|
const shellArtifactPath = join(shellRoot, normalizedArtifactPath);
|
|
@@ -747,9 +749,8 @@ function renderMethodAuthoringAgents(options) {
|
|
|
747
749
|
"- Edit only files under `method/`.",
|
|
748
750
|
"- Do not edit source artifacts.",
|
|
749
751
|
"- Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
750
|
-
"- Use kebab-case ids everywhere: stage ids, skill_dir values,
|
|
751
|
-
"-
|
|
752
|
-
"- For file output zones that replace scaffold files, add `artifacts_must_not_contain` entries that reject `Not yet compiled.` placeholder text; its keys must be artifact paths like `home.md`, not zone ids like `home`.",
|
|
752
|
+
"- Use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids. Never use underscores.",
|
|
753
|
+
"- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
|
|
753
754
|
"- Prefer direct file-reading and search tools over shell commands for routine file inspection.",
|
|
754
755
|
"- Do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files.",
|
|
755
756
|
"",
|
|
@@ -757,7 +758,8 @@ function renderMethodAuthoringAgents(options) {
|
|
|
757
758
|
"",
|
|
758
759
|
"- produce one standalone Method package tuned to the source data, desired outputs, and checks in this task",
|
|
759
760
|
"- replace the neutral scaffold topology with the stage graph this agent work needs",
|
|
760
|
-
"- define
|
|
761
|
+
"- define Artifacts and checks so Interf can show whether the data is ready",
|
|
762
|
+
"- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
|
|
761
763
|
"- preserve deterministic stage and context-interface contracts",
|
|
762
764
|
"- stop once the Method edits are complete",
|
|
763
765
|
"",
|
|
@@ -779,10 +781,12 @@ function renderMethodAuthoringSkill() {
|
|
|
779
781
|
"Rules:",
|
|
780
782
|
"- edit only `method/`",
|
|
781
783
|
`- keep \`method.json\`, \`${METHOD_SCHEMA_FILE}\`, and any changed stage docs aligned`,
|
|
782
|
-
"-
|
|
783
|
-
"-
|
|
784
|
+
"- put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks",
|
|
785
|
+
"- use only CheckKind values listed in `runtime/authoring-context.json`; do not invent aliases",
|
|
786
|
+
"- keep Artifact checks and the producing stage docs aligned",
|
|
787
|
+
"- satisfy every `artifact_requirements[]` entry from `runtime/authoring-context.json` when entries are present",
|
|
784
788
|
"- design the stage graph from the source data and preparation-and-evidence brief",
|
|
785
|
-
"- use kebab-case ids everywhere: stage ids, skill_dir values,
|
|
789
|
+
"- use kebab-case ids everywhere: stage ids, skill_dir values, Artifact ids, reads/writes values, and package ids; never use underscores",
|
|
786
790
|
"- replace the placeholder `prepare` stage unless that exact stage is truly the final method",
|
|
787
791
|
"- keep the package standalone; do not introduce runtime inheritance or hidden source-package assumptions",
|
|
788
792
|
"- do not introduce wikilinks unless the Method also creates the target note by exact basename or explicit relative path",
|
|
@@ -790,7 +794,7 @@ function renderMethodAuthoringSkill() {
|
|
|
790
794
|
"- prefer conservative routing changes over speculative note sprawl",
|
|
791
795
|
"- prefer direct file-reading and search tools over shell commands for routine file inspection",
|
|
792
796
|
"- do not use shell helpers like `cat`, `sed`, `ls`, or `find` when a native read/search tool can inspect the same files",
|
|
793
|
-
"- do not hardcode readiness-check answers into Method docs",
|
|
797
|
+
"- do not hardcode readiness-check answers into reusable Method docs",
|
|
794
798
|
"- do not edit source artifacts",
|
|
795
799
|
"",
|
|
796
800
|
].join("\n");
|
|
@@ -812,6 +816,8 @@ export function createMethodAuthoringShell(options) {
|
|
|
812
816
|
method_label: options.label,
|
|
813
817
|
...(options.referenceMethodId ? { reference_method_id: options.referenceMethodId } : {}),
|
|
814
818
|
task_prompt: options.taskPrompt,
|
|
819
|
+
allowed_check_kinds: CHECK_KINDS,
|
|
820
|
+
artifact_requirements: options.artifactRequirements ?? [],
|
|
815
821
|
preparation: {
|
|
816
822
|
source_folder_path: options.sourceFolderPath,
|
|
817
823
|
checks: {
|
|
@@ -866,7 +872,7 @@ function renderMethodImprovementAgents(compiledName, methodId, loopIndex) {
|
|
|
866
872
|
"- Do not edit checks, test specs, source files, or generated context outputs.",
|
|
867
873
|
"- Review context outputs under `artifacts/compiled-view/` and test/runtime evidence under `artifacts/`.",
|
|
868
874
|
"- Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
869
|
-
"-
|
|
875
|
+
"- Put deterministic validation on Artifact `checks[]`; do not add stage `acceptance` blocks.",
|
|
870
876
|
"",
|
|
871
877
|
"## Goal",
|
|
872
878
|
"",
|
|
@@ -916,15 +922,15 @@ function renderMethodImprovementSkill(methodId, loopIndex, improvementDoc) {
|
|
|
916
922
|
function projectCompiledReviewArtifactsSnapshot(compiledPath, shellRoot, schema) {
|
|
917
923
|
const compiledViewRoot = join(shellRoot, "artifacts", "compiled-view");
|
|
918
924
|
mkdirSync(compiledViewRoot, { recursive: true });
|
|
919
|
-
for (const
|
|
920
|
-
if (
|
|
925
|
+
for (const artifact of listContextInterfaceArtifacts(schema)) {
|
|
926
|
+
if (artifact.kind === "runtime" || artifact.path === "source-files")
|
|
921
927
|
continue;
|
|
922
|
-
const sourcePath =
|
|
928
|
+
const sourcePath = compiledArtifactAbsolutePath(compiledPath, artifact);
|
|
923
929
|
if (!existsSync(sourcePath))
|
|
924
930
|
continue;
|
|
925
931
|
copyResolvedTree({
|
|
926
932
|
sourcePath,
|
|
927
|
-
targetPath: join(compiledViewRoot,
|
|
933
|
+
targetPath: join(compiledViewRoot, artifact.path),
|
|
928
934
|
shellType: "method-improvement",
|
|
929
935
|
});
|
|
930
936
|
}
|
|
@@ -970,21 +976,22 @@ export function projectSourceFilesTestQueryShell(rootPath) {
|
|
|
970
976
|
}
|
|
971
977
|
export function createStageExecutionShell(compiledPath, compiledName, methodId, stage, writeArtifacts = []) {
|
|
972
978
|
const schema = ensureCompiledExecutionSurface(compiledPath);
|
|
973
|
-
const
|
|
979
|
+
const materializedArtifacts = stageMaterializedArtifactSet(schema, stage, writeArtifacts);
|
|
974
980
|
const shellsRoot = stageExecutionShellsRoot(compiledPath);
|
|
975
981
|
const shellRoot = join(shellsRoot, `${stage.id}-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 8)}`);
|
|
976
982
|
mkdirSync(shellRoot, { recursive: true });
|
|
977
983
|
mkdirSync(join(shellRoot, "runtime"), { recursive: true });
|
|
984
|
+
mkdirSync(join(shellRoot, ".interf", "runtime"), { recursive: true });
|
|
978
985
|
mkdirSync(join(shellRoot, "inputs"), { recursive: true });
|
|
979
986
|
mkdirSync(join(shellRoot, "outputs"), { recursive: true });
|
|
980
987
|
linkPath(compiledInterfConfigPath(compiledPath), join(shellRoot, "interf.json"));
|
|
981
988
|
linkPath(join(compiledRuntimeRoot(compiledPath), "stage-contract.json"), shellRuntimePath(shellRoot, "stage-contract.json"));
|
|
982
989
|
linkIfExists(compiledRuntimeSourceSnapshotPath(compiledPath), shellRuntimePath(shellRoot, "source-snapshot.json"));
|
|
983
990
|
linkIfExists(compiledRuntimeStageInputsPath(compiledPath, stage.id), shellRuntimePath(shellRoot, "stage-inputs.json"));
|
|
984
|
-
|
|
991
|
+
projectCompiledSchemaArtifacts(compiledPath, shellRoot, schema, new Set([...stage.reads, ...stage.writes]), materializedArtifacts);
|
|
985
992
|
projectMethodMetadata(compiledPath, shellRoot, stage);
|
|
986
|
-
|
|
987
|
-
writeExecutionShellPathsFile(shellRoot, methodId, stage,
|
|
993
|
+
projectStageArtifactMountAliases(shellRoot, stage, schema);
|
|
994
|
+
writeExecutionShellPathsFile(shellRoot, methodId, stage, buildStageArtifactMounts(compiledPath, shellRoot, stage, schema));
|
|
988
995
|
const agentsContent = renderStageExecutionAgents(compiledName, methodId, stage);
|
|
989
996
|
writeNativeAgentSurface(shellRoot, agentsContent, "interf-stage", renderStageExecutionSkill(stage, readStageMethodDoc(compiledPath, stage)));
|
|
990
997
|
return {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { readJsonFileWithSchema } from "
|
|
4
|
-
import { interfHomeRoot } from "
|
|
3
|
+
import { readJsonFileWithSchema } from "../../../contracts/utils/parse.js";
|
|
4
|
+
import { interfHomeRoot } from "../../../contracts/lib/preparation-paths.js";
|
|
5
5
|
import { InterfUserConfigSchema } from "./schema.js";
|
|
6
6
|
/** `~/.interf/` (overridable via `INTERF_USER_HOME`). */
|
|
7
7
|
export function interfHome() {
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { type AgentRecord, type AgentsRegistry, type RoleMap } from "../../contracts/lib/schema.js";
|
|
2
|
+
export declare const AGENTS_REGISTRY_FILENAME = "agents.json";
|
|
3
|
+
/** `~/.interf/agents.json` — persisted custom agents + role-map. */
|
|
4
|
+
export declare function agentsRegistryPath(): string;
|
|
5
|
+
/**
|
|
6
|
+
* Load just the persisted on-disk part of the registry. Built-in agents
|
|
7
|
+
* are NOT included — call `loadAgentsRegistry()` for the merged view.
|
|
8
|
+
*
|
|
9
|
+
* Returns `{ agents: [], role_map: {} }` when the file is missing or
|
|
10
|
+
* unreadable; persisted custom agents always have `source: "user"`.
|
|
11
|
+
*/
|
|
12
|
+
export declare function loadPersistedRegistry(): AgentsRegistry;
|
|
13
|
+
/** Persist the on-disk part of the registry (custom agents + role-map). */
|
|
14
|
+
export declare function savePersistedRegistry(registry: AgentsRegistry): void;
|
|
15
|
+
/**
|
|
16
|
+
* Detect built-in agents present on this machine. Filtered to agents
|
|
17
|
+
* whose marker home directory exists; we do NOT require the command
|
|
18
|
+
* to be on PATH at registry read time — that's a runtime concern.
|
|
19
|
+
*/
|
|
20
|
+
export declare function detectBuiltinAgentRecords(): AgentRecord[];
|
|
21
|
+
/**
|
|
22
|
+
* Same as `detectBuiltinAgentRecords()` but only includes agents the
|
|
23
|
+
* current Interf build can fully drive (Claude Code, Codex). Used by
|
|
24
|
+
* the role-router and the CLI / UI listing as the "available agents"
|
|
25
|
+
* set.
|
|
26
|
+
*/
|
|
27
|
+
export declare function detectAutomatableBuiltinAgentRecords(): AgentRecord[];
|
|
28
|
+
/**
|
|
29
|
+
* Full advertisement set — all built-in agents Interf knows about,
|
|
30
|
+
* regardless of whether they are installed locally. Used by the
|
|
31
|
+
* "install cards" zero-state surface so the UI / wizard can offer
|
|
32
|
+
* the user choices to install.
|
|
33
|
+
*/
|
|
34
|
+
export declare function listKnownBuiltinAgents(): AgentRecord[];
|
|
35
|
+
export interface ResolvedRegistry {
|
|
36
|
+
/** All currently usable agents — built-in detected + persisted custom. */
|
|
37
|
+
agents: AgentRecord[];
|
|
38
|
+
/** Role → agent-name. Includes any persisted user edits. */
|
|
39
|
+
roleMap: RoleMap;
|
|
40
|
+
/**
|
|
41
|
+
* The "active" / default agent. This is whatever the role-map's
|
|
42
|
+
* `general` row points at, falling back to the first available
|
|
43
|
+
* agent when `general` is unset or maps to something that no longer
|
|
44
|
+
* exists in `agents`.
|
|
45
|
+
*/
|
|
46
|
+
activeAgent: AgentRecord | null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Public entry point — read the persisted registry, merge with detected
|
|
50
|
+
* built-ins, and seed the default role-map on first read if needed.
|
|
51
|
+
*
|
|
52
|
+
* Does NOT write back to disk. Callers that mutate the registry should
|
|
53
|
+
* call `savePersistedRegistry()` explicitly with the persisted slice.
|
|
54
|
+
*/
|
|
55
|
+
export declare function loadAgentsRegistry(): ResolvedRegistry;
|
|
56
|
+
/** Pure helper — like `loadAgentsRegistry()` but works off in-memory data. */
|
|
57
|
+
export declare function resolveRegistry(persisted: AgentsRegistry, builtinDetected: AgentRecord[]): ResolvedRegistry;
|
|
58
|
+
/**
|
|
59
|
+
* Update the role-map (full replace). Returns the persisted slice that
|
|
60
|
+
* was written.
|
|
61
|
+
*/
|
|
62
|
+
export declare function updateRoleMap(nextRoleMap: RoleMap): AgentsRegistry;
|
|
63
|
+
/**
|
|
64
|
+
* Patch the role-map with a partial update. Empty-string values clear
|
|
65
|
+
* the role (it falls back to `general` / active agent at run time).
|
|
66
|
+
*/
|
|
67
|
+
export declare function patchRoleMap(patch: Record<string, string>): AgentsRegistry;
|
|
68
|
+
/**
|
|
69
|
+
* Register a new custom agent. Throws if `name` collides with a known
|
|
70
|
+
* built-in or with an already-persisted custom agent.
|
|
71
|
+
*/
|
|
72
|
+
export declare function registerCustomAgent(input: {
|
|
73
|
+
name: string;
|
|
74
|
+
display_name: string;
|
|
75
|
+
command: string;
|
|
76
|
+
}): AgentsRegistry;
|
|
77
|
+
/**
|
|
78
|
+
* Unregister a custom agent. Throws if `name` matches a built-in or no
|
|
79
|
+
* custom record exists. Removes any role-map entry pointing at the
|
|
80
|
+
* removed agent.
|
|
81
|
+
*/
|
|
82
|
+
export declare function unregisterCustomAgent(name: string): AgentsRegistry;
|
|
83
|
+
/**
|
|
84
|
+
* Set the "active" agent — i.e. the agent the role-map's `general` row
|
|
85
|
+
* points at. Also updates any role still pointing at the previous
|
|
86
|
+
* active agent so existing single-active-agent setups don't need
|
|
87
|
+
* per-role edits when switching agents.
|
|
88
|
+
*
|
|
89
|
+
* Throws if `name` is not in the merged agents list.
|
|
90
|
+
*/
|
|
91
|
+
export declare function setActiveAgent(name: string): AgentsRegistry;
|