@interf/compiler 0.9.5 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -91
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +143 -38
- package/agent-skills/interf-actions/references/cli.md +134 -67
- package/builtin-methods/interf-default/README.md +3 -4
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
- package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
- package/builtin-methods/interf-default/improve/SKILL.md +1 -1
- package/builtin-methods/interf-default/method.json +10 -4
- package/builtin-methods/interf-default/method.schema.json +0 -9
- package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.d.ts +8 -25
- package/dist/cli/commands/compile.js +83 -359
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +39 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.js +16 -0
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.d.ts +2 -0
- package/dist/cli/commands/method.js +113 -0
- package/dist/cli/commands/prep.d.ts +2 -0
- package/dist/cli/commands/prep.js +152 -0
- package/dist/cli/commands/reset.d.ts +8 -1
- package/dist/cli/commands/reset.js +47 -26
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +120 -0
- package/dist/cli/commands/status.d.ts +6 -1
- package/dist/cli/commands/status.js +68 -111
- package/dist/cli/commands/verify.d.ts +7 -1
- package/dist/cli/commands/verify.js +69 -85
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +201 -121
- package/dist/cli/commands/wizard.d.ts +9 -0
- package/dist/cli/commands/wizard.js +689 -0
- package/dist/cli/index.d.ts +10 -7
- package/dist/cli/index.js +19 -12
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
- package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/contracts/index.d.ts +2 -1
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
- package/dist/packages/contracts/lib/preparation-paths.js +177 -0
- package/dist/packages/contracts/lib/schema.d.ts +187 -13
- package/dist/packages/contracts/lib/schema.js +148 -3
- package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
- package/dist/packages/contracts/utils/filesystem.js +142 -0
- package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
- package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +3 -2
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +5 -5
- package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
- package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
- package/dist/packages/engine/agents/lib/user-config.js +24 -0
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +59 -60
- package/dist/packages/{local-service → engine}/client.js +137 -145
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
- package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
- package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/index.js +1 -0
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
- package/dist/packages/engine/compile/method-runs.d.ts +14 -0
- package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
- package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
- package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
- package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
- package/dist/packages/engine/compile/source-files.d.ts +46 -0
- package/dist/packages/engine/compile/source-files.js +149 -0
- package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
- package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
- package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
- package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
- package/dist/packages/engine/compile/state-paths.js +16 -0
- package/dist/packages/engine/compile/state-view.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
- package/dist/packages/engine/compile/state.d.ts +7 -0
- package/dist/packages/{compiler → engine/compile}/state.js +3 -3
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
- package/dist/packages/engine/connection-config.d.ts +38 -0
- package/dist/packages/engine/connection-config.js +75 -0
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
- package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/engine/instance-paths.d.ts +100 -0
- package/dist/packages/engine/instance-paths.js +165 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
- package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
- package/dist/packages/engine/preparation-store.d.ts +104 -0
- package/dist/packages/engine/preparation-store.js +194 -0
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +78 -0
- package/dist/packages/engine/routes.js +92 -0
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +25 -24
- package/dist/packages/engine/runtime-caches.d.ts +76 -0
- package/dist/packages/engine/runtime-caches.js +191 -0
- package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
- package/dist/packages/engine/runtime-event-applier.js +177 -0
- package/dist/packages/engine/runtime-persistence.d.ts +47 -0
- package/dist/packages/engine/runtime-persistence.js +137 -0
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
- package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
- package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
- package/dist/packages/engine/runtime-resource-builders.js +149 -0
- package/dist/packages/engine/runtime.d.ts +318 -0
- package/dist/packages/{local-service → engine}/runtime.js +835 -1011
- package/dist/packages/{local-service → engine}/server.d.ts +15 -0
- package/dist/packages/engine/server.js +1257 -0
- package/dist/packages/engine/service-registry.d.ts +47 -0
- package/dist/packages/engine/service-registry.js +137 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
- package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
- package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
- package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
- package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
- package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
- package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
- package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test.js +1 -1
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +4 -5
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
- package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
- package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
- package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
- package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
- package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
- package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +3 -31
- package/dist/packages/methods/package/user-methods.d.ts +17 -0
- package/dist/packages/methods/package/user-methods.js +77 -0
- package/dist/packages/{project-model → project}/index.d.ts +0 -1
- package/dist/packages/{project-model → project}/index.js +0 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.d.ts +8 -3
- package/dist/packages/{project-model → project}/interf-detect.js +38 -38
- package/dist/packages/project/interf-scaffold.d.ts +3 -0
- package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +39 -2
- package/dist/packages/project/preparation-entries.d.ts +11 -0
- package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
- package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
- package/dist/packages/{project-model → project}/source-config.js +81 -53
- package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
- package/dist/packages/{project-model → project}/source-folders.js +16 -16
- package/package.json +8 -8
- package/CHANGELOG.md +0 -93
- package/LICENSE +0 -183
- package/dist/cli/commands/action-input-cli.d.ts +0 -25
- package/dist/cli/commands/action-input-cli.js +0 -73
- package/dist/cli/commands/control-path.d.ts +0 -11
- package/dist/cli/commands/control-path.js +0 -72
- package/dist/cli/commands/create-method-wizard.d.ts +0 -64
- package/dist/cli/commands/create-method-wizard.js +0 -434
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/create.js +0 -183
- package/dist/cli/commands/default.d.ts +0 -2
- package/dist/cli/commands/default.js +0 -39
- package/dist/cli/commands/executor-flow.d.ts +0 -29
- package/dist/cli/commands/executor-flow.js +0 -163
- package/dist/cli/commands/init.d.ts +0 -26
- package/dist/cli/commands/init.js +0 -771
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-action.d.ts +0 -8
- package/dist/cli/commands/preparation-action.js +0 -29
- package/dist/cli/commands/preparation-picker.d.ts +0 -5
- package/dist/cli/commands/preparation-picker.js +0 -36
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/service-action-flow.d.ts +0 -9
- package/dist/cli/commands/service-action-flow.js +0 -19
- package/dist/cli/commands/source-config-wizard.d.ts +0 -51
- package/dist/cli/commands/source-config-wizard.js +0 -670
- package/dist/cli/commands/test.d.ts +0 -17
- package/dist/cli/commands/test.js +0 -188
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/agents/lib/user-config.js +0 -16
- package/dist/packages/compiler/method-runs.d.ts +0 -15
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
- package/dist/packages/compiler/raw-snapshot.js +0 -101
- package/dist/packages/compiler/state-artifacts.d.ts +0 -8
- package/dist/packages/compiler/state-paths.js +0 -13
- package/dist/packages/compiler/state-view.d.ts +0 -4
- package/dist/packages/compiler/state.d.ts +0 -7
- package/dist/packages/local-service/index.d.ts +0 -18
- package/dist/packages/local-service/index.js +0 -13
- package/dist/packages/local-service/routes.d.ts +0 -32
- package/dist/packages/local-service/routes.js +0 -37
- package/dist/packages/local-service/runtime.d.ts +0 -133
- package/dist/packages/local-service/server.js +0 -627
- package/dist/packages/method-package/index.d.ts +0 -11
- package/dist/packages/method-package/index.js +0 -11
- package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
- package/dist/packages/method-package/method-stage-policy.js +0 -31
- package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
- package/dist/packages/project-model/preparation-entries.d.ts +0 -11
- package/dist/packages/project-model/project-paths.d.ts +0 -12
- package/dist/packages/project-model/project-paths.js +0 -33
- package/dist/packages/shared/filesystem.d.ts +0 -2
- package/dist/packages/shared/filesystem.js +0 -55
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/index.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
|
@@ -14,8 +14,10 @@ const COMPILE_RUNTIME_RESET_ENTRIES = [
|
|
|
14
14
|
"view-spec.json",
|
|
15
15
|
"inventory.json",
|
|
16
16
|
"run.json",
|
|
17
|
-
"
|
|
17
|
+
"source-files.json",
|
|
18
|
+
"source-snapshot.json",
|
|
18
19
|
"stage-contract.json",
|
|
20
|
+
"stages",
|
|
19
21
|
];
|
|
20
22
|
const PRESERVED_COMPILED_ROOTS = new Set([
|
|
21
23
|
".agents",
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync, } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
4
|
-
import { readJsonFileWithSchema } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
5
5
|
import { METHOD_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
6
6
|
import { RuntimeStageContractSchema, } from "./lib/schema.js";
|
|
7
|
+
import { ACCEPTANCE_RULE_KEYS } from "../../contracts/lib/schema.js";
|
|
7
8
|
import { stageContractPath } from "./runtime-paths.js";
|
|
8
9
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
10
|
import { loadState } from "./state-io.js";
|
|
@@ -17,18 +18,20 @@ function toFiniteNumber(value) {
|
|
|
17
18
|
function hasAcceptanceRules(acceptance) {
|
|
18
19
|
if (!acceptance)
|
|
19
20
|
return false;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
// Drive off the canonical rule-key list so a new key added to
|
|
22
|
+
// contracts/ is automatically considered here.
|
|
23
|
+
for (const key of ACCEPTANCE_RULE_KEYS) {
|
|
24
|
+
const value = acceptance[key];
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
if (value.length > 0)
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
else if (value && typeof value === "object") {
|
|
30
|
+
if (Object.keys(value).length > 0)
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
32
35
|
}
|
|
33
36
|
function readPathValue(record, keyPath) {
|
|
34
37
|
if (!record)
|
|
@@ -39,7 +39,7 @@ export function buildStagePrompt(instructions, contractPath, statusLines) {
|
|
|
39
39
|
"Do not narrate intentions, plans, or reasoning to the user.",
|
|
40
40
|
"Only emit user-visible updates that begin with STATUS:, DONE:, BLOCKED:, or ERROR:.",
|
|
41
41
|
"Those status lines are progress hints for the operator. The CLI decides stage completion from artifacts, validation, and reconcile checks rather than trusting status text alone.",
|
|
42
|
-
"Before any long-running
|
|
42
|
+
"Before any long-running source inspection or shell-based helper step, emit a STATUS: line that names the current subtask.",
|
|
43
43
|
"If work stays in progress, do not remain silent for more than about one minute. Emit another STATUS: line when you switch files, page groups, targets, or extraction methods.",
|
|
44
44
|
"If you respond conversationally instead of executing the stage, the run will be treated as failed.",
|
|
45
45
|
"As soon as the required proof artifacts are complete, stop. Do not keep browsing or auditing after the contract is satisfied.",
|
|
@@ -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 "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
4
|
import { compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
5
|
-
import { parseJsonFrontmatter } from "
|
|
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) {
|
|
@@ -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
|
}
|
|
@@ -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;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type MethodExecutor } from "../agents/lib/executors.js";
|
|
2
2
|
import { type RuntimeRun, type RuntimeStageAcceptance, type RuntimeStageContract, type RuntimeStageInstructions } from "./lib/schema.js";
|
|
3
|
-
import type { MethodId, RuntimeContractType, RuntimeStage } from "
|
|
3
|
+
import type { 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,10 +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
22
|
export interface RuntimeStageAcceptanceValidation {
|
|
27
23
|
ok: boolean;
|
|
28
24
|
summary: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageAcceptanceValidation, RuntimeStageContractDraft, RuntimeStageExecutionOptions,
|
|
1
|
+
export type { RuntimeRunPatch, RuntimeRunStatus, RuntimeStageAcceptanceValidation, RuntimeStageContractDraft, RuntimeStageExecutionOptions, RuntimeStageContractOptions, } from "./runtime-types.js";
|
|
2
2
|
export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, runHistoryPath, runPath, stageContractPath, statusLogPath, } from "./runtime-paths.js";
|
|
3
3
|
export { validateStageContractAcceptance } from "./runtime-acceptance.js";
|
|
4
4
|
export { buildStagePrompt } from "./runtime-prompt.js";
|
|
5
5
|
export { buildRuntimeStageContract, } from "./runtime-contracts.js";
|
|
6
|
-
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage,
|
|
6
|
+
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
|
|
@@ -2,4 +2,4 @@ export { archivedStageContractPath, eventLogPath, logsDirPath, promptLogPath, ru
|
|
|
2
2
|
export { validateStageContractAcceptance } from "./runtime-acceptance.js";
|
|
3
3
|
export { buildStagePrompt } from "./runtime-prompt.js";
|
|
4
4
|
export { buildRuntimeStageContract, } from "./runtime-contracts.js";
|
|
5
|
-
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage,
|
|
5
|
+
export { beginRuntimeRun, loadRuntimeRun, markRuntimeRunFailedAfterValidation, markRuntimeRunSucceededAfterValidation, runExecutorStage, saveRuntimeRun, updateRuntimeRun, writeStageContract, } from "./runtime-runs.js";
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { type SourceFiles, type SourceSnapshot, type StageInputs } from "../../contracts/lib/schema.js";
|
|
2
|
+
export declare function buildCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
3
|
+
export declare function writeCompiledSourceFiles(compiledPath: string, sourcePath?: string, generatedAt?: string): SourceFiles;
|
|
4
|
+
export declare function buildCompiledSourceSnapshot(options: {
|
|
5
|
+
compiledPath: string;
|
|
6
|
+
sourceFiles?: SourceFiles;
|
|
7
|
+
sourcePath?: string;
|
|
8
|
+
runId?: string | null;
|
|
9
|
+
generatedAt?: string;
|
|
10
|
+
}): SourceSnapshot;
|
|
11
|
+
export declare function writeCompiledSourceSnapshot(options: {
|
|
12
|
+
compiledPath: string;
|
|
13
|
+
sourceFiles?: SourceFiles;
|
|
14
|
+
sourcePath?: string;
|
|
15
|
+
runId?: string | null;
|
|
16
|
+
generatedAt?: string;
|
|
17
|
+
}): SourceSnapshot;
|
|
18
|
+
export declare function buildCompiledStageInputs(options: {
|
|
19
|
+
methodId: string;
|
|
20
|
+
stageId: string;
|
|
21
|
+
snapshot: SourceSnapshot;
|
|
22
|
+
runId?: string | null;
|
|
23
|
+
generatedAt?: string;
|
|
24
|
+
}): StageInputs;
|
|
25
|
+
export declare function writeCompiledStageInputs(options: {
|
|
26
|
+
compiledPath: string;
|
|
27
|
+
methodId: string;
|
|
28
|
+
stageId: string;
|
|
29
|
+
snapshot: SourceSnapshot;
|
|
30
|
+
runId?: string | null;
|
|
31
|
+
generatedAt?: string;
|
|
32
|
+
}): StageInputs;
|
|
33
|
+
export declare function writeCompiledSourceRuntime(options: {
|
|
34
|
+
compiledPath: string;
|
|
35
|
+
methodId: string;
|
|
36
|
+
stageIds: string[];
|
|
37
|
+
sourcePath?: string;
|
|
38
|
+
runId?: string | null;
|
|
39
|
+
}): {
|
|
40
|
+
sourceFiles: SourceFiles;
|
|
41
|
+
snapshot: SourceSnapshot;
|
|
42
|
+
stageInputs: StageInputs[];
|
|
43
|
+
};
|
|
44
|
+
export declare function loadCompiledSourceFiles(compiledPath: string): SourceFiles | null;
|
|
45
|
+
export declare function loadCompiledSourceSnapshot(compiledPath: string): SourceSnapshot | null;
|
|
46
|
+
export declare function loadCompiledStageInputs(compiledPath: string, stageId: string): StageInputs | null;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, resolve } from "node:path";
|
|
4
|
+
import { SourceFilesSchema, SourceSnapshotSchema, StageInputsSchema, } from "../../contracts/lib/schema.js";
|
|
5
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
6
|
+
import { discoverSourceFiles } from "./discovery.js";
|
|
7
|
+
import { compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStageInputsPath, } from "./compiled-paths.js";
|
|
8
|
+
import { resolveSourceInputPath } from "../../project/interf-detect.js";
|
|
9
|
+
function shortHash(value, length = 16) {
|
|
10
|
+
return createHash("sha256")
|
|
11
|
+
.update(value)
|
|
12
|
+
.digest("hex")
|
|
13
|
+
.slice(0, length);
|
|
14
|
+
}
|
|
15
|
+
function normalizeRelativePath(path) {
|
|
16
|
+
return path.replaceAll("\\", "/");
|
|
17
|
+
}
|
|
18
|
+
function buildSource(sourcePath) {
|
|
19
|
+
const locator = resolve(sourcePath);
|
|
20
|
+
return {
|
|
21
|
+
id: `src-${shortHash(locator, 12)}`,
|
|
22
|
+
kind: "local-folder",
|
|
23
|
+
locator,
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function buildSourceFile(source, sourcePath, relativePath) {
|
|
27
|
+
const normalizedPath = normalizeRelativePath(relativePath);
|
|
28
|
+
return {
|
|
29
|
+
id: `file-${shortHash(`${source.id}\0${normalizedPath}`)}`,
|
|
30
|
+
path: normalizedPath,
|
|
31
|
+
locator: resolve(sourcePath, relativePath),
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function buildSnapshotId(options) {
|
|
35
|
+
const fingerprint = {
|
|
36
|
+
source: options.sourceFiles.source,
|
|
37
|
+
files: options.sourceFiles.files.map((file) => [file.id, file.path, file.locator]),
|
|
38
|
+
generated_at: options.generatedAt,
|
|
39
|
+
run_id: options.runId ?? null,
|
|
40
|
+
};
|
|
41
|
+
return `snap-${shortHash(JSON.stringify(fingerprint))}`;
|
|
42
|
+
}
|
|
43
|
+
function writeJson(filePath, value) {
|
|
44
|
+
mkdirSync(dirname(filePath), { recursive: true });
|
|
45
|
+
writeFileSync(filePath, `${JSON.stringify(value, null, 2)}\n`);
|
|
46
|
+
}
|
|
47
|
+
export function buildCompiledSourceFiles(compiledPath, sourcePath = resolveSourceInputPath(compiledPath), generatedAt = new Date().toISOString()) {
|
|
48
|
+
const discovery = discoverSourceFiles(sourcePath, compiledPath);
|
|
49
|
+
const source = buildSource(sourcePath);
|
|
50
|
+
const files = discovery.sourceFiles.map((relativePath) => buildSourceFile(source, sourcePath, relativePath));
|
|
51
|
+
return {
|
|
52
|
+
kind: "interf-source-files",
|
|
53
|
+
version: 1,
|
|
54
|
+
generated_at: generatedAt,
|
|
55
|
+
source,
|
|
56
|
+
source_total: files.length,
|
|
57
|
+
files,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export function writeCompiledSourceFiles(compiledPath, sourcePath = resolveSourceInputPath(compiledPath), generatedAt = new Date().toISOString()) {
|
|
61
|
+
const sourceFiles = buildCompiledSourceFiles(compiledPath, sourcePath, generatedAt);
|
|
62
|
+
const parsed = SourceFilesSchema.parse(sourceFiles);
|
|
63
|
+
writeJson(compiledRuntimeSourceFilesPath(compiledPath), parsed);
|
|
64
|
+
return parsed;
|
|
65
|
+
}
|
|
66
|
+
export function buildCompiledSourceSnapshot(options) {
|
|
67
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
68
|
+
const sourceFiles = options.sourceFiles
|
|
69
|
+
?? buildCompiledSourceFiles(options.compiledPath, options.sourcePath ?? resolveSourceInputPath(options.compiledPath), generatedAt);
|
|
70
|
+
return {
|
|
71
|
+
kind: "interf-source-snapshot",
|
|
72
|
+
version: 1,
|
|
73
|
+
snapshot_id: buildSnapshotId({
|
|
74
|
+
sourceFiles,
|
|
75
|
+
generatedAt,
|
|
76
|
+
runId: options.runId ?? null,
|
|
77
|
+
}),
|
|
78
|
+
generated_at: generatedAt,
|
|
79
|
+
run_id: options.runId ?? null,
|
|
80
|
+
source: sourceFiles.source,
|
|
81
|
+
source_total: sourceFiles.source_total,
|
|
82
|
+
files: sourceFiles.files,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
export function writeCompiledSourceSnapshot(options) {
|
|
86
|
+
const snapshot = SourceSnapshotSchema.parse(buildCompiledSourceSnapshot(options));
|
|
87
|
+
writeJson(compiledRuntimeSourceSnapshotPath(options.compiledPath), snapshot);
|
|
88
|
+
return snapshot;
|
|
89
|
+
}
|
|
90
|
+
export function buildCompiledStageInputs(options) {
|
|
91
|
+
const generatedAt = options.generatedAt ?? new Date().toISOString();
|
|
92
|
+
return {
|
|
93
|
+
kind: "interf-stage-inputs",
|
|
94
|
+
version: 1,
|
|
95
|
+
generated_at: generatedAt,
|
|
96
|
+
run_id: options.runId ?? options.snapshot.run_id ?? null,
|
|
97
|
+
method: options.methodId,
|
|
98
|
+
stage: options.stageId,
|
|
99
|
+
source_snapshot_id: options.snapshot.snapshot_id,
|
|
100
|
+
input_total: options.snapshot.files.length,
|
|
101
|
+
inputs: options.snapshot.files.map((file) => ({
|
|
102
|
+
source_file_id: file.id,
|
|
103
|
+
path: file.path,
|
|
104
|
+
locator: file.locator,
|
|
105
|
+
})),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
export function writeCompiledStageInputs(options) {
|
|
109
|
+
const stageInputs = StageInputsSchema.parse(buildCompiledStageInputs(options));
|
|
110
|
+
writeJson(compiledRuntimeStageInputsPath(options.compiledPath, options.stageId), stageInputs);
|
|
111
|
+
return stageInputs;
|
|
112
|
+
}
|
|
113
|
+
export function writeCompiledSourceRuntime(options) {
|
|
114
|
+
const generatedAt = new Date().toISOString();
|
|
115
|
+
const sourceFiles = writeCompiledSourceFiles(options.compiledPath, options.sourcePath ?? resolveSourceInputPath(options.compiledPath), generatedAt);
|
|
116
|
+
const snapshot = writeCompiledSourceSnapshot({
|
|
117
|
+
compiledPath: options.compiledPath,
|
|
118
|
+
sourceFiles,
|
|
119
|
+
runId: options.runId ?? null,
|
|
120
|
+
generatedAt,
|
|
121
|
+
});
|
|
122
|
+
const stageInputs = options.stageIds.map((stageId) => writeCompiledStageInputs({
|
|
123
|
+
compiledPath: options.compiledPath,
|
|
124
|
+
methodId: options.methodId,
|
|
125
|
+
stageId,
|
|
126
|
+
snapshot,
|
|
127
|
+
runId: options.runId ?? null,
|
|
128
|
+
generatedAt,
|
|
129
|
+
}));
|
|
130
|
+
return { sourceFiles, snapshot, stageInputs };
|
|
131
|
+
}
|
|
132
|
+
export function loadCompiledSourceFiles(compiledPath) {
|
|
133
|
+
const filePath = compiledRuntimeSourceFilesPath(compiledPath);
|
|
134
|
+
if (!existsSync(filePath))
|
|
135
|
+
return null;
|
|
136
|
+
return readJsonFileWithSchema(filePath, "compiled source files", SourceFilesSchema);
|
|
137
|
+
}
|
|
138
|
+
export function loadCompiledSourceSnapshot(compiledPath) {
|
|
139
|
+
const filePath = compiledRuntimeSourceSnapshotPath(compiledPath);
|
|
140
|
+
if (!existsSync(filePath))
|
|
141
|
+
return null;
|
|
142
|
+
return readJsonFileWithSchema(filePath, "compiled source snapshot", SourceSnapshotSchema);
|
|
143
|
+
}
|
|
144
|
+
export function loadCompiledStageInputs(compiledPath, stageId) {
|
|
145
|
+
const filePath = compiledRuntimeStageInputsPath(compiledPath, stageId);
|
|
146
|
+
if (!existsSync(filePath))
|
|
147
|
+
return null;
|
|
148
|
+
return readJsonFileWithSchema(filePath, "compiled stage inputs", StageInputsSchema);
|
|
149
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type CompiledHealth, type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
|
+
export declare function refreshCompiledArtifacts(dirPath: string, options?: {
|
|
3
|
+
ensureViewSpec?: boolean;
|
|
4
|
+
}): {
|
|
5
|
+
health: CompiledHealth;
|
|
6
|
+
viewSpec?: CompiledViewSpec;
|
|
7
|
+
sourceFiles: SourceFiles;
|
|
8
|
+
sourceSnapshot: SourceSnapshot;
|
|
9
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { saveCompiledHealth, } from "./state-io.js";
|
|
2
2
|
import { computeCompiledHealth, } from "./state-health.js";
|
|
3
|
-
import {
|
|
3
|
+
import { ensureCompiledSourceFiles, ensureCompiledSourceSnapshot, ensureCompiledViewSpec, } from "./state-view.js";
|
|
4
4
|
export function refreshCompiledArtifacts(dirPath, options) {
|
|
5
5
|
const health = computeCompiledHealth(dirPath);
|
|
6
6
|
saveCompiledHealth(dirPath, health);
|
|
7
|
-
const
|
|
7
|
+
const sourceFiles = ensureCompiledSourceFiles(dirPath);
|
|
8
|
+
const sourceSnapshot = ensureCompiledSourceSnapshot(dirPath, sourceFiles);
|
|
8
9
|
let viewSpec;
|
|
9
10
|
if (options?.ensureViewSpec) {
|
|
10
11
|
viewSpec = ensureCompiledViewSpec(dirPath);
|
|
11
12
|
}
|
|
12
|
-
return { health, viewSpec,
|
|
13
|
+
return { health, viewSpec, sourceFiles, sourceSnapshot };
|
|
13
14
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { basename } from "node:path";
|
|
2
|
-
import { readInterfConfig, resolveSourceFolderPath, } from "
|
|
2
|
+
import { readInterfConfig, resolveSourceFolderPath, } from "../../project/interf-detect.js";
|
|
3
3
|
import { discoverSourceFiles } from "./discovery.js";
|
|
4
4
|
import { loadRuntimeRun } from "./runtime.js";
|
|
5
5
|
import { loadState } from "./state-io.js";
|
|
6
6
|
import { validateCompiled, validateCompiledStage, validateCompiledMethod, } from "./validate.js";
|
|
7
7
|
import { readCompiledSchemaFile } from "./compiled-schema.js";
|
|
8
8
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
|
-
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "
|
|
9
|
+
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
|
|
10
10
|
import { countCompiledZoneArtifacts } from "./artifact-counts.js";
|
|
11
11
|
export function computeCompiledHealth(dirPath) {
|
|
12
12
|
const now = new Date().toISOString();
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { type CompiledHealth, type
|
|
1
|
+
import { type CompiledHealth, type CompiledState, type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
2
|
export declare function loadState<T>(dirPath: string): T | null;
|
|
3
3
|
export declare function saveState<T>(dirPath: string, state: T): void;
|
|
4
4
|
export declare function loadCompiledHealth(dirPath: string): CompiledHealth | null;
|
|
5
5
|
export declare function saveCompiledHealth(dirPath: string, health: CompiledHealth): void;
|
|
6
6
|
export declare function loadCompiledViewSpec(dirPath: string): CompiledViewSpec | null;
|
|
7
7
|
export declare function saveCompiledViewSpec(dirPath: string, viewSpec: CompiledViewSpec): void;
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function loadCompiledSourceFiles(dirPath: string): SourceFiles | null;
|
|
9
|
+
export declare function loadCompiledSourceSnapshot(dirPath: string): SourceSnapshot | null;
|
|
9
10
|
export declare function saveEmptyCompiledInventory(dirPath: string): void;
|
|
10
11
|
export declare function initCompiledState(): CompiledState;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readFileSync, writeFileSync, } from "node:fs";
|
|
2
|
-
import { warnInterf } from "
|
|
3
|
-
import { readJsonFileUnchecked, readJsonFileWithSchema } from "
|
|
4
|
-
import { CompiledHealthSchema,
|
|
2
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
3
|
+
import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
4
|
+
import { CompiledHealthSchema, CompiledStateSchema, CompiledViewSpecSchema, SourceFilesSchema, SourceSnapshotSchema, } from "./lib/schema.js";
|
|
5
5
|
import { emptyCompiledInventory, } from "./runtime-inventory.js";
|
|
6
|
-
import { healthPath,
|
|
6
|
+
import { healthPath, sourceFilesPath, sourceSnapshotPath, statePath, viewSpecPath, } from "./state-paths.js";
|
|
7
7
|
import { compiledRuntimeInventoryPath, compiledRuntimeRoot, } from "./compiled-paths.js";
|
|
8
8
|
export function loadState(dirPath) {
|
|
9
9
|
const path = statePath(dirPath);
|
|
@@ -43,11 +43,17 @@ export function saveCompiledViewSpec(dirPath, viewSpec) {
|
|
|
43
43
|
mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
|
|
44
44
|
writeFileSync(viewSpecPath(dirPath), JSON.stringify(viewSpec, null, 2) + "\n");
|
|
45
45
|
}
|
|
46
|
-
export function
|
|
47
|
-
const path =
|
|
46
|
+
export function loadCompiledSourceFiles(dirPath) {
|
|
47
|
+
const path = sourceFilesPath(dirPath);
|
|
48
48
|
if (!existsSync(path))
|
|
49
49
|
return null;
|
|
50
|
-
return readJsonFileWithSchema(path, "compiled
|
|
50
|
+
return readJsonFileWithSchema(path, "compiled source files", SourceFilesSchema);
|
|
51
|
+
}
|
|
52
|
+
export function loadCompiledSourceSnapshot(dirPath) {
|
|
53
|
+
const path = sourceSnapshotPath(dirPath);
|
|
54
|
+
if (!existsSync(path))
|
|
55
|
+
return null;
|
|
56
|
+
return readJsonFileWithSchema(path, "compiled source snapshot", SourceSnapshotSchema);
|
|
51
57
|
}
|
|
52
58
|
export function saveEmptyCompiledInventory(dirPath) {
|
|
53
59
|
mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare function statePath(dirPath: string): string;
|
|
2
2
|
export declare function healthPath(dirPath: string): string;
|
|
3
3
|
export declare function viewSpecPath(dirPath: string): string;
|
|
4
|
-
export declare function
|
|
4
|
+
export declare function sourceFilesPath(dirPath: string): string;
|
|
5
|
+
export declare function sourceSnapshotPath(dirPath: string): string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { compiledRuntimeHealthPath, compiledRuntimeSourceFilesPath, compiledRuntimeSourceSnapshotPath, compiledRuntimeStatePath, compiledRuntimeViewSpecPath, } from "./compiled-paths.js";
|
|
2
|
+
export function statePath(dirPath) {
|
|
3
|
+
return compiledRuntimeStatePath(dirPath);
|
|
4
|
+
}
|
|
5
|
+
export function healthPath(dirPath) {
|
|
6
|
+
return compiledRuntimeHealthPath(dirPath);
|
|
7
|
+
}
|
|
8
|
+
export function viewSpecPath(dirPath) {
|
|
9
|
+
return compiledRuntimeViewSpecPath(dirPath);
|
|
10
|
+
}
|
|
11
|
+
export function sourceFilesPath(dirPath) {
|
|
12
|
+
return compiledRuntimeSourceFilesPath(dirPath);
|
|
13
|
+
}
|
|
14
|
+
export function sourceSnapshotPath(dirPath) {
|
|
15
|
+
return compiledRuntimeSourceSnapshotPath(dirPath);
|
|
16
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type CompiledViewSpec, type SourceFiles, type SourceSnapshot } from "./lib/schema.js";
|
|
2
|
+
export declare function ensureCompiledViewSpec(dirPath: string): CompiledViewSpec;
|
|
3
|
+
export declare function ensureCompiledSourceFiles(dirPath: string): SourceFiles;
|
|
4
|
+
export declare function ensureCompiledSourceSnapshot(dirPath: string, sourceFiles?: SourceFiles): SourceSnapshot;
|
|
5
|
+
export declare function normalizeCompiledViewSpec(existing: CompiledViewSpec, defaults?: CompiledViewSpec): CompiledViewSpec;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { basename
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
|
|
6
|
-
import { rawSnapshotPath } from "./state-paths.js";
|
|
7
|
-
import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
1
|
+
import { basename } from "node:path";
|
|
2
|
+
import { readInterfConfig, resolveSourceFolderPath } from "../../project/interf-detect.js";
|
|
3
|
+
import { loadCompiledSourceSnapshot, loadCompiledViewSpec, saveCompiledViewSpec, } from "./state-io.js";
|
|
4
|
+
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
8
5
|
import { readCompiledSchemaFile } from "./compiled-schema.js";
|
|
9
|
-
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "
|
|
6
|
+
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig } from "../../methods/package/method-definitions.js";
|
|
7
|
+
import { writeCompiledSourceFiles, writeCompiledSourceSnapshot, } from "./source-files.js";
|
|
10
8
|
export function ensureCompiledViewSpec(dirPath) {
|
|
11
9
|
const existing = loadCompiledViewSpec(dirPath);
|
|
12
10
|
const now = new Date().toISOString();
|
|
@@ -22,29 +20,21 @@ export function ensureCompiledViewSpec(dirPath) {
|
|
|
22
20
|
saveCompiledViewSpec(dirPath, defaults);
|
|
23
21
|
return defaults;
|
|
24
22
|
}
|
|
25
|
-
export function
|
|
26
|
-
const now = new Date().toISOString();
|
|
23
|
+
export function ensureCompiledSourceFiles(dirPath) {
|
|
27
24
|
const config = readInterfConfig(dirPath);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
raw_root: sourceRoot,
|
|
42
|
-
source_total: discovery.totalCount,
|
|
43
|
-
sample_files: sampleFiles,
|
|
44
|
-
};
|
|
45
|
-
mkdirSync(compiledRuntimeRoot(dirPath), { recursive: true });
|
|
46
|
-
writeFileSync(rawSnapshotPath(dirPath), JSON.stringify(artifact, null, 2) + "\n");
|
|
47
|
-
return artifact;
|
|
25
|
+
return writeCompiledSourceFiles(dirPath, resolveSourceFolderPath(dirPath, config));
|
|
26
|
+
}
|
|
27
|
+
export function ensureCompiledSourceSnapshot(dirPath, sourceFiles) {
|
|
28
|
+
const existing = loadCompiledSourceSnapshot(dirPath);
|
|
29
|
+
if (existing)
|
|
30
|
+
return existing;
|
|
31
|
+
const config = readInterfConfig(dirPath);
|
|
32
|
+
const resolvedSourceFiles = sourceFiles ?? writeCompiledSourceFiles(dirPath, resolveSourceFolderPath(dirPath, config));
|
|
33
|
+
return writeCompiledSourceSnapshot({
|
|
34
|
+
compiledPath: dirPath,
|
|
35
|
+
sourceFiles: resolvedSourceFiles,
|
|
36
|
+
runId: null,
|
|
37
|
+
});
|
|
48
38
|
}
|
|
49
39
|
export function normalizeCompiledViewSpec(existing, defaults) {
|
|
50
40
|
const resolvedDefaults = defaults ?? existing;
|