@interf/compiler 0.13.0 → 0.18.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -0
- package/README.md +50 -7
- package/TRADEMARKS.md +4 -4
- package/agent-skills/interf-actions/SKILL.md +51 -5
- package/agent-skills/interf-actions/references/cli.md +82 -82
- package/builtin-methods/interf-default/README.md +6 -7
- package/builtin-methods/interf-default/method.json +7 -68
- package/builtin-methods/interf-default/method.schema.json +52 -50
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.js +10 -1
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/login.js +1 -1
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.js +1 -1
- package/dist/cli/commands/prep.js +81 -7
- package/dist/cli/commands/reset.js +1 -1
- package/dist/cli/commands/runs.js +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/verify.d.ts +10 -0
- package/dist/cli/commands/{test.js → verify.js} +30 -15
- package/dist/cli/commands/web.js +71 -18
- package/dist/cli/commands/wizard.js +462 -107
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.js +7 -3
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.css → 0_c_tvh-cukjz.css} +1 -1
- package/dist/compiler-ui/_next/static/chunks/0f_geuwdesg_c.js +114 -0
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/contracts/index.d.ts +2 -1
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/schema.d.ts +324 -31
- package/dist/packages/contracts/lib/schema.js +281 -21
- package/dist/packages/{local-service → engine}/action-definitions.js +9 -2
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +1 -1
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +14 -6
- package/dist/packages/{agents → engine/agents}/lib/shells.js +133 -126
- package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +9 -9
- package/dist/packages/{local-service → engine}/client.js +11 -11
- package/dist/packages/engine/cloud-seams.d.ts +115 -0
- package/dist/packages/engine/cloud-seams.js +84 -0
- package/dist/packages/engine/compile/artifact-counts.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +4 -4
- package/dist/packages/engine/compile/artifact-status.d.ts +41 -0
- package/dist/packages/engine/compile/artifact-status.js +166 -0
- package/dist/packages/engine/compile/billing-events.d.ts +89 -0
- package/dist/packages/engine/compile/billing-events.js +74 -0
- package/dist/packages/engine/compile/check-evaluator.d.ts +66 -0
- package/dist/packages/engine/compile/check-evaluator.js +298 -0
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
- package/dist/packages/engine/compile/compiled-schema.d.ts +21 -0
- package/dist/packages/engine/compile/compiled-schema.js +126 -0
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +2 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +35 -18
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -1
- package/dist/packages/{compiler → engine/compile}/index.js +0 -1
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +113 -94
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +35 -39
- package/dist/packages/engine/compile/method-primitives.d.ts +2 -0
- package/dist/packages/{compiler → engine/compile}/method-primitives.js +1 -1
- package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
- package/dist/packages/{compiler → engine/compile}/reset.js +4 -4
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +2 -1
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +3 -2
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +47 -45
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -44
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +7 -12
- package/dist/packages/engine/compile/runtime.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -2
- package/dist/packages/{compiler → engine/compile}/source-files.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +8 -8
- package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-view.js +9 -8
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +63 -32
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +29 -27
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +81 -55
- package/dist/packages/{execution → engine/execution}/lib/schema.js +14 -6
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +620 -435
- package/dist/packages/{local-service → engine}/lib/schema.js +103 -63
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +81 -29
- package/dist/packages/{local-service → engine}/preparation-store.d.ts +22 -4
- package/dist/packages/{local-service → engine}/preparation-store.js +56 -25
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/{local-service → engine}/routes.d.ts +36 -1
- package/dist/packages/{local-service → engine}/routes.js +38 -1
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +15 -15
- package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-event-applier.js +7 -0
- package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
- package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
- package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +12 -12
- package/dist/packages/{local-service → engine}/runtime-resource-builders.js +6 -5
- package/dist/packages/{local-service → engine}/runtime.d.ts +147 -56
- package/dist/packages/{local-service → engine}/runtime.js +333 -205
- package/dist/packages/{local-service → engine}/server.d.ts +25 -0
- package/dist/packages/{local-service → engine}/server.js +338 -17
- package/dist/packages/engine/verify/index.d.ts +13 -0
- package/dist/packages/engine/verify/index.js +10 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +27 -11
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +72 -60
- package/dist/packages/{testing/test-execution.d.ts → engine/verify/verify-execution.d.ts} +2 -2
- package/dist/packages/{testing/test-execution.js → engine/verify/verify-execution.js} +2 -2
- package/dist/packages/{testing/test-paths.d.ts → engine/verify/verify-paths.d.ts} +1 -1
- package/dist/packages/{testing/test-paths.js → engine/verify/verify-paths.js} +2 -2
- package/dist/packages/{testing/test-sandbox.d.ts → engine/verify/verify-sandbox.d.ts} +1 -1
- package/dist/packages/{testing/test-sandbox.js → engine/verify/verify-sandbox.js} +6 -6
- package/dist/packages/{testing/test-specs.d.ts → engine/verify/verify-specs.d.ts} +1 -1
- package/dist/packages/{testing/test-specs.js → engine/verify/verify-specs.js} +2 -2
- package/dist/packages/{testing/test-targets.d.ts → engine/verify/verify-targets.d.ts} +1 -1
- package/dist/packages/{testing/test-targets.js → engine/verify/verify-targets.js} +3 -3
- package/dist/packages/{testing/test.d.ts → engine/verify/verify.d.ts} +4 -4
- package/dist/packages/{testing/test.js → engine/verify/verify.js} +3 -3
- package/dist/packages/engine/wire-schemas.d.ts +545 -0
- package/dist/packages/engine/wire-schemas.js +59 -0
- package/dist/packages/methods/authoring/method-authoring.d.ts +34 -0
- package/dist/packages/methods/authoring/method-authoring.js +260 -0
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +5 -5
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +12 -12
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +27 -24
- package/dist/packages/methods/package/context-interface.d.ts +73 -0
- package/dist/packages/{method-package → methods/package}/context-interface.js +50 -41
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +31 -49
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +10 -5
- package/dist/packages/{method-package → methods/package}/local-methods.js +41 -68
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +11 -7
- package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -8
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -3
- package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -8
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
- package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.js +4 -4
- package/dist/packages/{project-model → project}/interf-scaffold.js +18 -18
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +1 -1
- package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
- package/dist/packages/{project-model → project}/source-config.js +9 -8
- package/dist/packages/{project-model → project}/source-folders.js +2 -2
- package/package.json +7 -16
- package/dist/cli/commands/test.d.ts +0 -9
- package/dist/compiler-ui/_next/static/chunks/17t-lulmyawg5.js +0 -89
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/compiler/artifact-counts.d.ts +0 -1
- package/dist/packages/compiler/compiled-schema.d.ts +0 -31
- package/dist/packages/compiler/compiled-schema.js +0 -141
- package/dist/packages/compiler/method-primitives.d.ts +0 -2
- package/dist/packages/compiler/runtime-acceptance.d.ts +0 -9
- package/dist/packages/compiler/runtime-acceptance.js +0 -262
- package/dist/packages/compiler/runtime.d.ts +0 -6
- package/dist/packages/local-service/index.d.ts +0 -22
- package/dist/packages/local-service/index.js +0 -15
- package/dist/packages/method-authoring/method-authoring.d.ts +0 -24
- package/dist/packages/method-authoring/method-authoring.js +0 -116
- package/dist/packages/method-package/context-interface.d.ts +0 -60
- package/dist/packages/testing/index.d.ts +0 -13
- package/dist/packages/testing/index.js +0 -10
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 6qyE1u9m_oBUkvAhhoCmO}/_ssgManifest.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/filesystem.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
- /package/dist/packages/{testing/test-profile-presets.d.ts → engine/verify/verify-profile-presets.d.ts} +0 -0
- /package/dist/packages/{testing/test-profile-presets.js → engine/verify/verify-profile-presets.js} +0 -0
- /package/dist/packages/{testing/test-types.d.ts → engine/verify/verify-types.d.ts} +0 -0
- /package/dist/packages/{testing/test-types.js → engine/verify/verify-types.js} +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
- /package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.js +0 -0
- /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
- /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import {
|
|
3
|
-
import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "
|
|
4
|
-
|
|
2
|
+
import { COMPILED_ARTIFACT_KINDS, } from "../method-primitives.js";
|
|
3
|
+
import { ArtifactIdSchema, ArtifactSchema, CheckSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
|
|
4
|
+
// `ArtifactSchema` is used internally below in `MethodSchemaSchema`'s
|
|
5
|
+
// `artifacts[]` field. The other Artifact* schemas/types are NOT
|
|
6
|
+
// re-exported through this module — callers import them directly
|
|
7
|
+
// from `contracts/lib/schema.js`. The 0.17 PR cross-check pruned
|
|
8
|
+
// re-exports that had zero consumers.
|
|
9
|
+
export { GateStatusSchema, ReadinessGateSchema, ReadinessSchema, ReadinessStatusSchema, VerifyTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
|
|
5
10
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
6
11
|
const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
|
|
7
12
|
function isCompiledRelativePath(value) {
|
|
@@ -13,9 +18,9 @@ function isCompiledRelativePath(value) {
|
|
|
13
18
|
.split(/[\\/]+/)
|
|
14
19
|
.every((segment) => COMPILED_RELATIVE_PATH_SEGMENT.test(segment));
|
|
15
20
|
}
|
|
16
|
-
export const
|
|
17
|
-
export const
|
|
18
|
-
export const
|
|
21
|
+
export const MethodArtifactIdSchema = z.string().regex(InterfIdPattern);
|
|
22
|
+
export const MethodCompiledArtifactKindSchema = z.enum(COMPILED_ARTIFACT_KINDS);
|
|
23
|
+
export const MethodArtifactRoleSchema = z.enum(["input", "working", "output", "runtime"]);
|
|
19
24
|
export const CompiledStageStatusSchema = z.enum(["idle", "running", "succeeded", "failed"]);
|
|
20
25
|
export const CompiledStageStateSchema = z.object({
|
|
21
26
|
contract_type: RuntimeContractTypeSchema.optional(),
|
|
@@ -23,7 +28,7 @@ export const CompiledStageStateSchema = z.object({
|
|
|
23
28
|
started_at: z.string().nullable().optional(),
|
|
24
29
|
finished_at: z.string().nullable().optional(),
|
|
25
30
|
counts: z.record(z.string(), z.number()).optional(),
|
|
26
|
-
|
|
31
|
+
artifact_counts: z.record(z.string(), z.number()).optional(),
|
|
27
32
|
artifacts: z.array(z.string()).optional(),
|
|
28
33
|
summary: z.string().nullable().optional(),
|
|
29
34
|
run_id: z.string().nullable().optional(),
|
|
@@ -81,36 +86,37 @@ export const MethodPurposeSchema = z.object({
|
|
|
81
86
|
label: z.string().min(1),
|
|
82
87
|
task_hint: z.string().min(1),
|
|
83
88
|
}).strict();
|
|
84
|
-
export const
|
|
85
|
-
id:
|
|
86
|
-
role:
|
|
89
|
+
export const MethodCompiledArtifactProjectionSchema = z.object({
|
|
90
|
+
id: MethodArtifactIdSchema,
|
|
91
|
+
role: MethodArtifactRoleSchema,
|
|
87
92
|
path: z.string().min(1).refine(isCompiledRelativePath, {
|
|
88
|
-
message: "
|
|
93
|
+
message: "Artifact paths must stay inside the compiled root",
|
|
89
94
|
}),
|
|
90
|
-
kind:
|
|
95
|
+
kind: MethodCompiledArtifactKindSchema,
|
|
91
96
|
required: z.boolean(),
|
|
92
97
|
owned_by: z.array(z.string().regex(InterfIdPattern)),
|
|
93
98
|
description: z.string().min(1),
|
|
94
99
|
});
|
|
95
|
-
export const
|
|
96
|
-
// Persisted schema for the method-defined
|
|
100
|
+
export const MethodCompiledArtifactSchema = MethodCompiledArtifactProjectionSchema;
|
|
101
|
+
// Persisted schema for the method-defined artifact interface that one
|
|
97
102
|
// portable context must implement on disk.
|
|
98
103
|
export const MethodSchemaSchema = z.object({
|
|
99
104
|
kind: z.literal("method-schema"),
|
|
100
105
|
version: z.literal(1),
|
|
101
106
|
target_type: z.literal("compiled"),
|
|
102
107
|
label: z.string().min(1),
|
|
103
|
-
|
|
104
|
-
});
|
|
108
|
+
artifacts: z.array(ArtifactSchema).min(1),
|
|
109
|
+
}).strict();
|
|
105
110
|
export const MethodCompiledSchemaSchema = MethodSchemaSchema;
|
|
106
111
|
export const MethodCompilerApiSchema = z.object({
|
|
107
112
|
kind: z.literal("compiled"),
|
|
108
113
|
version: z.literal(1),
|
|
109
114
|
});
|
|
110
|
-
export const
|
|
111
|
-
export const
|
|
112
|
-
|
|
113
|
-
|
|
115
|
+
export const MethodStageArtifactReadAccessSchema = z.array(ArtifactIdSchema);
|
|
116
|
+
export const MethodStageArtifactWriteAccessSchema = z.array(ArtifactIdSchema).min(1);
|
|
117
|
+
export const ExecutionShellArtifactMountSchema = z.object({
|
|
118
|
+
artifact_id: ArtifactIdSchema,
|
|
119
|
+
artifact_path: z.string(),
|
|
114
120
|
shell_root_path: z.string(),
|
|
115
121
|
input_mount_path: z.string().nullable(),
|
|
116
122
|
output_mount_path: z.string().nullable(),
|
|
@@ -120,8 +126,8 @@ export const ExecutionShellPathsSchema = z.object({
|
|
|
120
126
|
version: z.literal(1),
|
|
121
127
|
method: MethodIdSchema,
|
|
122
128
|
stage: RuntimeStageSchema,
|
|
123
|
-
reads: z.array(
|
|
124
|
-
writes: z.array(
|
|
129
|
+
reads: z.array(ExecutionShellArtifactMountSchema),
|
|
130
|
+
writes: z.array(ExecutionShellArtifactMountSchema),
|
|
125
131
|
});
|
|
126
132
|
export const RuntimeStageInstructionsSchema = z.object({
|
|
127
133
|
stage_skill_dir: z.string().regex(InterfIdPattern),
|
|
@@ -130,20 +136,6 @@ export const RuntimeStageInstructionsSchema = z.object({
|
|
|
130
136
|
local_docs: z.array(z.string()),
|
|
131
137
|
mode_sources: z.array(z.string()),
|
|
132
138
|
}).strict();
|
|
133
|
-
export const RuntimeStageAcceptanceSchema = z.object({
|
|
134
|
-
artifacts_exist: z.array(z.string()).optional(),
|
|
135
|
-
stage_truthy: z.array(z.string()).optional(),
|
|
136
|
-
stage_equals_counts: z.record(z.string(), z.string()).optional(),
|
|
137
|
-
stage_at_least: z.record(z.string(), z.number()).optional(),
|
|
138
|
-
stage_at_least_counts: z.record(z.string(), z.string()).optional(),
|
|
139
|
-
zone_counts_at_least: z.record(z.string().regex(InterfIdPattern), z.number()).optional(),
|
|
140
|
-
zone_counts_at_least_counts: z.record(z.string().regex(InterfIdPattern), z.string()).optional(),
|
|
141
|
-
markdown_frontmatter_valid_zones: z.array(MethodZoneIdSchema).optional(),
|
|
142
|
-
frontmatter_required_keys_in_zones: z.record(MethodZoneIdSchema, z.array(z.string().min(1)).min(1)).optional(),
|
|
143
|
-
markdown_abstract_valid_zones: z.array(MethodZoneIdSchema).optional(),
|
|
144
|
-
wikilinks_valid_in_zones: z.array(MethodZoneIdSchema).optional(),
|
|
145
|
-
artifacts_must_not_contain: z.record(z.string(), z.array(z.string().min(1))).optional(),
|
|
146
|
-
}).strict();
|
|
147
139
|
export const RuntimeStageContractSchema = z.object({
|
|
148
140
|
kind: z.literal("interf-stage-contract"),
|
|
149
141
|
version: z.literal(1),
|
|
@@ -163,10 +155,14 @@ export const RuntimeStageContractSchema = z.object({
|
|
|
163
155
|
executor: RuntimeExecutorInfoSchema,
|
|
164
156
|
instructions: RuntimeStageInstructionsSchema,
|
|
165
157
|
counts: z.record(z.string(), z.number()),
|
|
166
|
-
acceptance: RuntimeStageAcceptanceSchema.optional(),
|
|
167
158
|
artifacts: z.object({
|
|
168
159
|
reads: z.array(z.string()),
|
|
169
160
|
writes: z.array(z.string()),
|
|
161
|
+
write_contracts: z.array(z.object({
|
|
162
|
+
artifact_id: ArtifactIdSchema,
|
|
163
|
+
path: z.string().min(1),
|
|
164
|
+
checks: z.array(CheckSchema),
|
|
165
|
+
}).strict()).default([]),
|
|
170
166
|
}),
|
|
171
167
|
policies: z.object({
|
|
172
168
|
execution_mode: z.literal("deterministic"),
|
|
@@ -211,9 +207,9 @@ export const RuntimeRunSchema = z.object({
|
|
|
211
207
|
error: z.string().nullable(),
|
|
212
208
|
});
|
|
213
209
|
export const CompiledInventoryEntrySchema = z.object({
|
|
214
|
-
|
|
210
|
+
input_artifact: ArtifactIdSchema.optional(),
|
|
215
211
|
input_path: z.string().min(1).optional(),
|
|
216
|
-
|
|
212
|
+
output_artifact: ArtifactIdSchema,
|
|
217
213
|
output_path: z.string().min(1),
|
|
218
214
|
state: z.string().min(1).optional(),
|
|
219
215
|
metadata: JsonRecordSchema.optional(),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type InterfConfig } from "
|
|
2
|
-
export type { MethodReporter } from "
|
|
1
|
+
import { type InterfConfig } from "../../project/interf-detect.js";
|
|
2
|
+
export type { MethodReporter } from "../../methods/package/method-helpers.js";
|
|
3
3
|
export type CompiledCheck = "compiled" | "stage";
|
|
4
4
|
export interface DetectedInterfTarget {
|
|
5
5
|
path: string;
|
|
@@ -11,4 +11,4 @@ export declare function detectCompiled(cwd: string): DetectedInterfTarget | null
|
|
|
11
11
|
export declare function createCompiled(name: string, sourcePath: string, methodId: string | undefined, about: string | undefined, sourceFolderPath: string): string;
|
|
12
12
|
export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
|
|
13
13
|
export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
|
|
14
|
-
export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
|
|
14
|
+
export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, ResolveStageExecutor, } from "./compiled-compile.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createCompiled as createCompiledScaffold, } from "
|
|
2
|
-
import { detectInterf } from "
|
|
1
|
+
import { createCompiled as createCompiledScaffold, } from "../../project/interf-scaffold.js";
|
|
2
|
+
import { detectInterf } from "../../project/interf-detect.js";
|
|
3
3
|
import { validateCompiledCompile, } from "./validate.js";
|
|
4
|
-
import { DEFAULT_METHOD_ID } from "
|
|
4
|
+
import { DEFAULT_METHOD_ID } from "../../methods/method-resolution.js";
|
|
5
5
|
export function detectCompiled(cwd) {
|
|
6
6
|
const detected = detectInterf(cwd);
|
|
7
7
|
if (!detected)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readdirSync, rmSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { readCompiledSchemaFile } from "./compiled-schema.js";
|
|
3
|
+
import { listCompiledSchemaArtifacts, readCompiledSchemaFile } from "./compiled-schema.js";
|
|
4
4
|
import { initializeCompiledRuntimeState } from "./state.js";
|
|
5
5
|
import { stageExecutionShellsRoot, testRootForCompiled, testTargetsRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeRoot, compiledRuntimeLogsRoot, methodPackagePathForCompiled, } from "./compiled-paths.js";
|
|
6
6
|
function removeIfExists(path) {
|
|
@@ -40,10 +40,10 @@ export function clearCompiledRuntimeDerivedArtifacts(compiledPath) {
|
|
|
40
40
|
function activeCompiledInputRoots(compiledPath) {
|
|
41
41
|
const schema = readCompiledSchemaFile(methodPackagePathForCompiled(compiledPath));
|
|
42
42
|
const roots = new Set();
|
|
43
|
-
for (const
|
|
44
|
-
if (
|
|
43
|
+
for (const artifact of schema ? listCompiledSchemaArtifacts(schema) : []) {
|
|
44
|
+
if (artifact.role !== "input")
|
|
45
45
|
continue;
|
|
46
|
-
const root =
|
|
46
|
+
const root = artifact.path.split("/")[0]?.trim();
|
|
47
47
|
if (root)
|
|
48
48
|
roots.add(root);
|
|
49
49
|
}
|
|
@@ -8,7 +8,6 @@ export function buildRuntimeStageContract(options) {
|
|
|
8
8
|
...(options.counts ?? {}),
|
|
9
9
|
local_skill_docs: localSkillDocs.length,
|
|
10
10
|
},
|
|
11
|
-
...(options.acceptance ? { acceptance: options.acceptance } : {}),
|
|
12
11
|
artifacts: {
|
|
13
12
|
reads: [
|
|
14
13
|
"interf.json",
|
|
@@ -18,6 +17,7 @@ export function buildRuntimeStageContract(options) {
|
|
|
18
17
|
...localSkillDocs,
|
|
19
18
|
],
|
|
20
19
|
writes: options.stageWriteArtifacts,
|
|
20
|
+
write_contracts: options.stageWriteContracts ?? [],
|
|
21
21
|
},
|
|
22
22
|
policies: {
|
|
23
23
|
execution_mode: "deterministic",
|
|
@@ -28,6 +28,7 @@ export function buildRuntimeStageContract(options) {
|
|
|
28
28
|
`Use \`method/${METHOD_SCHEMA_FILE}\` as the deterministic context-interface reference for this portable context.`,
|
|
29
29
|
"Honor the declared read and write artifacts instead of inventing a parallel process.",
|
|
30
30
|
"Only create or update files that fall under the declared write targets for this stage.",
|
|
31
|
+
"Before emitting DONE, satisfy every check listed under `artifacts.write_contracts[]` for the write Artifacts this stage owns.",
|
|
31
32
|
"Interf writes `.interf/runtime/` ledgers such as run, state, health, and view-spec files. Read them if needed, but do not create, edit, or replace them in this stage unless the contract explicitly marks a runtime artifact as stage-owned.",
|
|
32
33
|
"Keep scratch extraction commands single-purpose and non-destructive. Avoid wildcard cleanup and multi-command chains.",
|
|
33
34
|
...methodNotes,
|
|
@@ -21,9 +21,10 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
|
|
|
21
21
|
"The user has already invoked this stage through the Interf CLI. Execute it now.",
|
|
22
22
|
"Do not ask what the user wants, offer help, list tools, or wait for another instruction.",
|
|
23
23
|
`Read \`${contractPath}\` first. It is the authoritative contract for this stage.`,
|
|
24
|
-
"If `runtime/paths.json` exists in this shell, read it next. It maps Method
|
|
25
|
-
"For file
|
|
24
|
+
"If `runtime/paths.json` exists in this shell, read it next. It maps Method Artifact ids onto the shell-local `inputs/` and `outputs/` mounts for this stage.",
|
|
25
|
+
"For file Artifact mounts, `runtime/paths.json` also gives the exact file path inside the `inputs/` or `outputs/` mount root.",
|
|
26
26
|
"Honor the contract's counts, artifact paths, and policies instead of inventing another Method.",
|
|
27
|
+
"The contract's `artifacts.write_contracts[]` lists the checks Interf will run against the Artifacts this stage writes. Treat those checks as required output constraints.",
|
|
27
28
|
"Read only the files named by the contract's `artifacts.reads` list plus any paths they explicitly direct you to open.",
|
|
28
29
|
"Prefer direct file-reading and search tools over shell commands when you inspect inputs, docs, or generated outputs.",
|
|
29
30
|
"Do not use shell helpers like `cat`, `sed`, `ls`, or `find` for routine file inspection if a native read/search tool can do the same job.",
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type MethodStageDefinition } from "
|
|
1
|
+
import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
|
|
2
2
|
export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<MethodStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { existsSync, readFileSync, statSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { extname, join, relative } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
4
|
-
import {
|
|
5
|
-
import { parseJsonFrontmatter } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { compiledArtifactAbsolutePath, findCompiledSchemaArtifact, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
5
|
+
import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
|
|
6
6
|
import { loadRuntimeRun } from "./runtime.js";
|
|
7
7
|
import { initCompiledState, loadState, refreshCompiledArtifacts, saveState, } from "./state.js";
|
|
8
8
|
import { compiledInventoryFromEntries } from "./runtime-inventory.js";
|
|
9
|
+
import { STANDARD_EVIDENCE_FRONTMATTER_KEYS, } from "../../contracts/lib/schema.js";
|
|
9
10
|
import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
10
11
|
import { extractSynthAbstract, isOutputMarkdownFile } from "./validate.js";
|
|
11
12
|
function readActiveRunStartedAtMs(dirPath) {
|
|
@@ -37,8 +38,8 @@ function anyPathUpdatedSince(absolutePath, sinceMs) {
|
|
|
37
38
|
}
|
|
38
39
|
return false;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
const absolutePath =
|
|
41
|
+
function artifactCount(dirPath, artifactPath, kind) {
|
|
42
|
+
const absolutePath = compiledArtifactAbsolutePath(dirPath, { path: artifactPath });
|
|
42
43
|
if (!existsSync(absolutePath))
|
|
43
44
|
return 0;
|
|
44
45
|
if (kind === "file")
|
|
@@ -51,11 +52,11 @@ function summaryAbstract(content) {
|
|
|
51
52
|
return null;
|
|
52
53
|
return extractSynthAbstract(parsed.frontmatter, parsed.body);
|
|
53
54
|
}
|
|
54
|
-
function listZoneArtifacts(dirPath,
|
|
55
|
-
const absolutePath =
|
|
56
|
-
if (!existsSync(absolutePath) ||
|
|
55
|
+
function listZoneArtifacts(dirPath, artifact) {
|
|
56
|
+
const absolutePath = compiledArtifactAbsolutePath(dirPath, artifact);
|
|
57
|
+
if (!existsSync(absolutePath) || artifact.kind === "runtime")
|
|
57
58
|
return [];
|
|
58
|
-
if (
|
|
59
|
+
if (artifact.kind === "file") {
|
|
59
60
|
try {
|
|
60
61
|
return statSync(absolutePath).isFile() ? [absolutePath] : [];
|
|
61
62
|
}
|
|
@@ -67,8 +68,8 @@ function listZoneArtifacts(dirPath, zone) {
|
|
|
67
68
|
}
|
|
68
69
|
function buildInventoryMetadata(options) {
|
|
69
70
|
const metadata = {
|
|
70
|
-
|
|
71
|
-
|
|
71
|
+
artifact_id: options.artifactId,
|
|
72
|
+
artifact_kind: options.artifactKind,
|
|
72
73
|
file_extension: extname(options.filePath).toLowerCase() || null,
|
|
73
74
|
};
|
|
74
75
|
if (!options.parsedFrontmatter) {
|
|
@@ -80,15 +81,16 @@ function buildInventoryMetadata(options) {
|
|
|
80
81
|
metadata.abstract = abstract;
|
|
81
82
|
metadata.abstract_read = true;
|
|
82
83
|
}
|
|
84
|
+
// Project the standard evidence frontmatter keys onto the inventory
|
|
85
|
+
// metadata. Method authors that emit the canonical evidence keys
|
|
86
|
+
// (`STANDARD_EVIDENCE_FRONTMATTER_KEYS` in contracts) get them
|
|
87
|
+
// surfaced on stage inventory entries; non-standard keys are ignored.
|
|
83
88
|
const frontmatter = options.parsedFrontmatter.frontmatter;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
if (typeof frontmatter.truth_mode === "string") {
|
|
91
|
-
metadata.truth_mode = frontmatter.truth_mode;
|
|
89
|
+
for (const key of STANDARD_EVIDENCE_FRONTMATTER_KEYS) {
|
|
90
|
+
const value = frontmatter[key];
|
|
91
|
+
if (typeof value === "string") {
|
|
92
|
+
metadata[key] = value;
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
95
|
return metadata;
|
|
94
96
|
}
|
|
@@ -96,16 +98,16 @@ function buildStageInventoryEntries(dirPath, stage) {
|
|
|
96
98
|
const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
|
|
97
99
|
if (!schema)
|
|
98
100
|
return [];
|
|
99
|
-
const
|
|
100
|
-
.map((
|
|
101
|
-
.filter((
|
|
102
|
-
const
|
|
103
|
-
.map((
|
|
104
|
-
.filter((
|
|
105
|
-
if (
|
|
101
|
+
const readableInputArtifacts = stage.reads
|
|
102
|
+
.map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
|
|
103
|
+
.filter((artifact) => artifact !== null && artifact.kind !== "runtime");
|
|
104
|
+
const outputArtifacts = stage.writes
|
|
105
|
+
.map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
|
|
106
|
+
.filter((artifact) => artifact !== null && artifact.kind !== "runtime");
|
|
107
|
+
if (outputArtifacts.length === 0)
|
|
106
108
|
return [];
|
|
107
109
|
const entries = [];
|
|
108
|
-
for (const outputZone of
|
|
110
|
+
for (const outputZone of outputArtifacts) {
|
|
109
111
|
for (const filePath of listZoneArtifacts(dirPath, outputZone)) {
|
|
110
112
|
const relativeOutputPath = relative(dirPath, filePath).replaceAll("\\", "/");
|
|
111
113
|
const parsed = isOutputMarkdownFile(filePath)
|
|
@@ -114,36 +116,36 @@ function buildStageInventoryEntries(dirPath, stage) {
|
|
|
114
116
|
const sourcePath = typeof parsed?.frontmatter.source === "string"
|
|
115
117
|
? parsed.frontmatter.source.trim()
|
|
116
118
|
: "";
|
|
117
|
-
const
|
|
118
|
-
? parsed.frontmatter.
|
|
119
|
+
const sourceArtifactId = typeof parsed?.frontmatter.source_artifact === "string"
|
|
120
|
+
? parsed.frontmatter.source_artifact.trim()
|
|
119
121
|
: "";
|
|
120
|
-
const inputZone =
|
|
121
|
-
?
|
|
122
|
-
:
|
|
123
|
-
?
|
|
122
|
+
const inputZone = sourceArtifactId.length > 0
|
|
123
|
+
? readableInputArtifacts.find((artifact) => artifact.id === sourceArtifactId) ?? null
|
|
124
|
+
: readableInputArtifacts.length === 1
|
|
125
|
+
? readableInputArtifacts[0]
|
|
124
126
|
: null;
|
|
125
127
|
entries.push({
|
|
126
128
|
...(inputZone && sourcePath.length > 0
|
|
127
129
|
? {
|
|
128
|
-
|
|
130
|
+
input_artifact: inputZone.id,
|
|
129
131
|
input_path: sourcePath,
|
|
130
132
|
}
|
|
131
133
|
: {}),
|
|
132
|
-
|
|
134
|
+
output_artifact: outputZone.id,
|
|
133
135
|
output_path: relativeOutputPath,
|
|
134
136
|
...(typeof parsed?.frontmatter.state === "string"
|
|
135
137
|
? { state: parsed.frontmatter.state }
|
|
136
138
|
: {}),
|
|
137
139
|
metadata: buildInventoryMetadata({
|
|
138
|
-
|
|
139
|
-
|
|
140
|
+
artifactId: outputZone.id,
|
|
141
|
+
artifactKind: outputZone.kind,
|
|
140
142
|
filePath,
|
|
141
143
|
parsedFrontmatter: parsed,
|
|
142
144
|
}),
|
|
143
145
|
});
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
|
-
return entries.sort((left, right) => `${left.
|
|
148
|
+
return entries.sort((left, right) => `${left.output_artifact}:${left.output_path}`.localeCompare(`${right.output_artifact}:${right.output_path}`));
|
|
147
149
|
}
|
|
148
150
|
function writeStageInventory(dirPath, stageId, entries) {
|
|
149
151
|
writeFileSync(join(compiledRuntimeRoot(dirPath), "inventory.json"), JSON.stringify(compiledInventoryFromEntries(entries, stageId), null, 2) + "\n");
|
|
@@ -158,12 +160,12 @@ export function reconcileCompiledStageRun(dirPath, stage) {
|
|
|
158
160
|
const schema = readCompiledSchemaFile(methodPackagePathForCompiled(dirPath));
|
|
159
161
|
if (!schema)
|
|
160
162
|
return false;
|
|
161
|
-
const
|
|
162
|
-
.map((
|
|
163
|
-
.filter((
|
|
164
|
-
if (
|
|
163
|
+
const writeArtifacts = stage.writes
|
|
164
|
+
.map((artifactId) => findCompiledSchemaArtifact(schema, artifactId))
|
|
165
|
+
.filter((artifact) => artifact !== null);
|
|
166
|
+
if (writeArtifacts.length === 0)
|
|
165
167
|
return false;
|
|
166
|
-
if (!
|
|
168
|
+
if (!writeArtifacts.some((artifact) => anyPathUpdatedSince(compiledArtifactAbsolutePath(dirPath, artifact), startedAtMs))) {
|
|
167
169
|
return false;
|
|
168
170
|
}
|
|
169
171
|
writeStageInventory(dirPath, stage.id, buildStageInventoryEntries(dirPath, stage));
|
|
@@ -181,8 +183,8 @@ export function reconcileCompiledStageRun(dirPath, stage) {
|
|
|
181
183
|
started_at: loadRuntimeRun(dirPath)?.started_at ?? now,
|
|
182
184
|
finished_at: now,
|
|
183
185
|
counts: activeRunCounts(dirPath),
|
|
184
|
-
|
|
185
|
-
artifacts:
|
|
186
|
+
artifact_counts: Object.fromEntries(writeArtifacts.map((artifact) => [artifact.id, artifactCount(dirPath, artifact.path, artifact.kind)])),
|
|
187
|
+
artifacts: writeArtifacts.map((artifact) => artifact.kind === "file" ? artifact.path : `${artifact.path}/`),
|
|
186
188
|
summary: loadRuntimeRun(dirPath)?.summary ?? null,
|
|
187
189
|
run_id: loadRuntimeRun(dirPath)?.run_id ?? null,
|
|
188
190
|
};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { type RuntimeRun, type RuntimeStageContract } from "./lib/schema.js";
|
|
2
|
-
import { type RuntimeRunPatch, type RuntimeStageExecutionOptions
|
|
2
|
+
import { type RuntimeRunPatch, type RuntimeStageExecutionOptions } from "./runtime-types.js";
|
|
3
3
|
export declare function loadRuntimeRun(dirPath: string): RuntimeRun | null;
|
|
4
4
|
export declare function saveRuntimeRun(dirPath: string, run: RuntimeRun): void;
|
|
5
5
|
export declare function writeStageContract(dirPath: string, contract: RuntimeStageContract): string;
|
|
6
6
|
export declare function runExecutorStage(options: RuntimeStageExecutionOptions): Promise<number>;
|
|
7
|
-
export declare function runExecutorSummarizeStage(options: RuntimeSummarizeExecutionOptions): Promise<number>;
|
|
8
7
|
export declare function beginRuntimeRun(dirPath: string, run: RuntimeRun): RuntimeRun;
|
|
9
8
|
export declare function updateRuntimeRun(dirPath: string, patch: RuntimeRunPatch): RuntimeRun | null;
|
|
10
9
|
export declare function markRuntimeRunFailedAfterValidation(dirPath: string, summary: string): RuntimeRun | null;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { appendFileSync, mkdirSync, existsSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { dirname,
|
|
3
|
-
import chalk from "chalk";
|
|
4
|
-
import { countFilesRecursive } from "../shared/filesystem.js";
|
|
2
|
+
import { dirname, relative } from "node:path";
|
|
5
3
|
import { buildRuntimeExecutorInfo } from "../agents/lib/executors.js";
|
|
6
4
|
import { RuntimeRunSchema, } from "./lib/schema.js";
|
|
7
|
-
import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "
|
|
5
|
+
import { getMethodStageDefinition, getMethodStagePosition, getMethodStages, } from "../../methods/package/method-definitions.js";
|
|
8
6
|
import { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
|
|
9
|
-
import { warnInterf } from "
|
|
7
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
10
8
|
export function loadRuntimeRun(dirPath) {
|
|
11
9
|
const path = runPath(dirPath);
|
|
12
10
|
if (!existsSync(path))
|
|
@@ -54,44 +52,6 @@ export async function runExecutorStage(options) {
|
|
|
54
52
|
finalizeRuntimeRun(options.compiledPath, code);
|
|
55
53
|
return code;
|
|
56
54
|
}
|
|
57
|
-
export async function runExecutorSummarizeStage(options) {
|
|
58
|
-
const startedRun = startRuntimeRun(options);
|
|
59
|
-
const prompt = options.buildPrompt(startedRun.activeContractPath);
|
|
60
|
-
let lastReported = 0;
|
|
61
|
-
writeRuntimeRunPrompt(options.compiledPath, startedRun.run.run_id, prompt);
|
|
62
|
-
const executionPath = options.executionPath ?? options.compiledPath;
|
|
63
|
-
const progressPromise = options.executor.execute(executionPath, prompt, {
|
|
64
|
-
eventLogPath: eventLogPath(options.compiledPath, startedRun.run.run_id),
|
|
65
|
-
statusLogPath: statusLogPath(options.compiledPath, startedRun.run.run_id),
|
|
66
|
-
completionCheck: options.completionCheck,
|
|
67
|
-
onStatus: options.onStatus,
|
|
68
|
-
});
|
|
69
|
-
const timer = setInterval(() => {
|
|
70
|
-
const currentSummaryCount = countFilesRecursive(join(options.compiledPath, "summaries"));
|
|
71
|
-
const completed = Math.max(0, Math.min(options.targetCount, currentSummaryCount - options.startingSummaryCount));
|
|
72
|
-
if (completed <= lastReported)
|
|
73
|
-
return;
|
|
74
|
-
lastReported = completed;
|
|
75
|
-
updateRuntimeRun(options.compiledPath, {
|
|
76
|
-
counts: {
|
|
77
|
-
...startedRun.run.counts,
|
|
78
|
-
completed_summaries: completed,
|
|
79
|
-
target_summaries: options.targetCount,
|
|
80
|
-
},
|
|
81
|
-
summary: `${options.stageLabel} ${completed}/${options.targetCount} source files into summaries.`,
|
|
82
|
-
});
|
|
83
|
-
console.log(chalk.dim(` STATUS: wrote ${completed}/${options.targetCount} summaries`));
|
|
84
|
-
options.onStatus?.(`STATUS: wrote ${completed}/${options.targetCount} summaries`);
|
|
85
|
-
}, 10000);
|
|
86
|
-
try {
|
|
87
|
-
const code = await progressPromise;
|
|
88
|
-
finalizeRuntimeRun(options.compiledPath, code);
|
|
89
|
-
return code;
|
|
90
|
-
}
|
|
91
|
-
finally {
|
|
92
|
-
clearInterval(timer);
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
55
|
export function beginRuntimeRun(dirPath, run) {
|
|
96
56
|
saveRuntimeRun(dirPath, run);
|
|
97
57
|
return run;
|
|
@@ -169,7 +129,6 @@ function startRuntimeRun(options) {
|
|
|
169
129
|
executor: buildRuntimeExecutorInfo(options.executor),
|
|
170
130
|
instructions: options.contract.instructions,
|
|
171
131
|
counts: options.contract.counts,
|
|
172
|
-
...(options.contract.acceptance ? { acceptance: options.contract.acceptance } : {}),
|
|
173
132
|
artifacts: options.contract.artifacts,
|
|
174
133
|
policies: options.contract.policies,
|
|
175
134
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
-
import { type RuntimeRun, type
|
|
3
|
-
import type { MethodId, RuntimeContractType, RuntimeStage } from "
|
|
2
|
+
import { type RuntimeRun, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
|
|
3
|
+
import type { Check, MethodId, RuntimeContractType, RuntimeStage } from "../../contracts/lib/schema.js";
|
|
4
4
|
export type RuntimeRunStatus = "running" | "succeeded" | "failed";
|
|
5
5
|
export type RuntimeStageContractDraft = Omit<RuntimeStageContract, "kind" | "version" | "generated_at" | "run_id" | "target_type" | "target_name" | "method" | "stage" | "stage_label" | "contract_type" | "executor">;
|
|
6
6
|
export interface RuntimeStageExecutionOptions {
|
|
@@ -19,15 +19,6 @@ export interface RuntimeStageExecutionOptions {
|
|
|
19
19
|
completionCheck?: (() => boolean) | null;
|
|
20
20
|
onStatus?: (line: string) => void;
|
|
21
21
|
}
|
|
22
|
-
export interface RuntimeSummarizeExecutionOptions extends RuntimeStageExecutionOptions {
|
|
23
|
-
startingSummaryCount: number;
|
|
24
|
-
targetCount: number;
|
|
25
|
-
}
|
|
26
|
-
export interface RuntimeStageAcceptanceValidation {
|
|
27
|
-
ok: boolean;
|
|
28
|
-
summary: string;
|
|
29
|
-
failures: string[];
|
|
30
|
-
}
|
|
31
22
|
export interface RuntimeStageContractOptions {
|
|
32
23
|
compiledName: string;
|
|
33
24
|
stageId: string;
|
|
@@ -36,10 +27,14 @@ export interface RuntimeStageContractOptions {
|
|
|
36
27
|
extraReadArtifacts?: string[];
|
|
37
28
|
stageReadArtifacts: string[];
|
|
38
29
|
stageWriteArtifacts: string[];
|
|
30
|
+
stageWriteContracts?: Array<{
|
|
31
|
+
artifact_id: string;
|
|
32
|
+
path: string;
|
|
33
|
+
checks: Check[];
|
|
34
|
+
}>;
|
|
39
35
|
methodNotes?: string[];
|
|
40
36
|
localSkillDocs?: string[];
|
|
41
37
|
instructions: RuntimeStageInstructions;
|
|
42
|
-
acceptance?: RuntimeStageAcceptance;
|
|
43
38
|
}
|
|
44
39
|
export interface RuntimeRunPatch extends Partial<Pick<RuntimeRun, "counts" | "summary" | "status" | "error" | "exit_code" | "finished_at">> {
|
|
45
40
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageContractDraft, RuntimeStageExecutionOptions, RuntimeStageContractOptions, } from "./runtime-types.js";
|
|
2
|
+
export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
|
|
3
|
+
export { buildStagePrompt } from "./runtime-prompt.js";
|
|
4
|
+
export { buildRuntimeStageContract, } from "./runtime-contracts.js";
|
|
5
|
+
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
|
|
2
|
-
export { validateStageContractAcceptance } from "./runtime-acceptance.js";
|
|
3
2
|
export { buildStagePrompt } from "./runtime-prompt.js";
|
|
4
3
|
export { buildRuntimeStageContract, } from "./runtime-contracts.js";
|
|
5
|
-
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage,
|
|
4
|
+
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type SourceFiles, type SourceSnapshot, type StageInputs } from "
|
|
1
|
+
import { type SourceFiles, type SourceSnapshot, type StageInputs } from "../../contracts/lib/schema.js";
|
|
2
2
|
export declare function buildCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
3
3
|
export declare function writeCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
4
4
|
export declare function buildCompiledSourceSnapshot(options: {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createHash } from "node:crypto";
|
|
2
2
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { dirname, resolve } from "node:path";
|
|
4
|
-
import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "
|
|
5
|
-
import { readJsonFileWithSchema } from "
|
|
4
|
+
import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "../../contracts/lib/schema.js";
|
|
5
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
6
6
|
import { discoverSourceFiles } from "./discovery.js";
|
|
7
7
|
import { compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "./compiled-paths.js";
|
|
8
|
-
import { resolveSourceInputPath } from "
|
|
8
|
+
import { resolveSourceInputPath } from "../../project/interf-detect.js";
|
|
9
9
|
function shortHash(value, length = 16) {
|
|
10
10
|
return createHash("sha256")
|
|
11
11
|
.update(value)
|