@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
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure helpers used by the runtime's action-proposal and method-authoring
|
|
3
|
+
* paths. None of these depend on runtime state — they shape strings, parse
|
|
4
|
+
* proposal values, and build CLI previews. Keeping them out of runtime.ts
|
|
5
|
+
* lets the coordinator stay small and means future tests can reach these
|
|
6
|
+
* helpers without booting a runtime.
|
|
7
|
+
*/
|
|
8
|
+
import { existsSync } from "node:fs";
|
|
9
|
+
import { AGENTS, } from "./agents/lib/constants.js";
|
|
10
|
+
import { detectAgents, supportsAutomatedRuns, } from "./agents/lib/detection.js";
|
|
11
|
+
import { loadUserConfig, } from "./agents/lib/user-config.js";
|
|
12
|
+
import { asPreparationDataDir, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
|
|
13
|
+
import { DEFAULT_METHOD_ID, methodIdForSourcePreparationConfig, } from "../project/source-config.js";
|
|
14
|
+
import { createCompiledTestTarget, } from "./verify/test-targets.js";
|
|
15
|
+
import { methodAuthoringTaskPrompt, MethodAuthoringActionValuesSchema, } from "./action-values.js";
|
|
16
|
+
import { ActionProposalPlanActionTypeSchema, } from "./lib/schema.js";
|
|
17
|
+
export const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf Workspace. Ask a question about Interf, or ask me to create a Preparation, prepare, check readiness, improve, or draft a Method and I will prepare an approval proposal.";
|
|
18
|
+
export function createActionProposalId() {
|
|
19
|
+
return `action_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
20
|
+
}
|
|
21
|
+
export function sanitizeActionProposalPlan(value) {
|
|
22
|
+
if (!value || typeof value !== "object" || Array.isArray(value))
|
|
23
|
+
return value;
|
|
24
|
+
const plan = { ...value };
|
|
25
|
+
for (const key of ["preparation", "method", "title", "summary", "assistant_message", "command_preview"]) {
|
|
26
|
+
const current = plan[key];
|
|
27
|
+
if (current === null || current === undefined) {
|
|
28
|
+
delete plan[key];
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (typeof current === "string" && current.trim().length === 0) {
|
|
32
|
+
delete plan[key];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return plan;
|
|
36
|
+
}
|
|
37
|
+
export function configuredAgentName() {
|
|
38
|
+
const config = loadUserConfig();
|
|
39
|
+
if (!config)
|
|
40
|
+
return null;
|
|
41
|
+
const configured = AGENTS.find((agent) => agent.command === config.agentCommand) ??
|
|
42
|
+
AGENTS.find((agent) => agent.name === config.agent) ??
|
|
43
|
+
AGENTS.find((agent) => agent.displayName === config.agent);
|
|
44
|
+
return configured?.name ?? null;
|
|
45
|
+
}
|
|
46
|
+
export function detectedExecutorOptions(currentAgentName) {
|
|
47
|
+
return detectAgents()
|
|
48
|
+
.filter(supportsAutomatedRuns)
|
|
49
|
+
.map((agent) => ({
|
|
50
|
+
name: agent.name,
|
|
51
|
+
display_name: agent.displayName,
|
|
52
|
+
command: agent.command,
|
|
53
|
+
current: agent.name === currentAgentName,
|
|
54
|
+
}));
|
|
55
|
+
}
|
|
56
|
+
export function slugFromText(value) {
|
|
57
|
+
const slug = value
|
|
58
|
+
.toLowerCase()
|
|
59
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
60
|
+
.replace(/^-+|-+$/g, "")
|
|
61
|
+
.slice(0, 42)
|
|
62
|
+
.replace(/-+$/g, "");
|
|
63
|
+
return slug || "custom";
|
|
64
|
+
}
|
|
65
|
+
export function escapeRegExp(value) {
|
|
66
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
67
|
+
}
|
|
68
|
+
export function stringValue(values, key) {
|
|
69
|
+
const value = values?.[key];
|
|
70
|
+
return typeof value === "string" && value.trim().length > 0 ? value.trim() : null;
|
|
71
|
+
}
|
|
72
|
+
export function actionTypeFromValues(values) {
|
|
73
|
+
const explicit = stringValue(values, "action_type") ?? stringValue(values, "service_action");
|
|
74
|
+
if (explicit) {
|
|
75
|
+
const parsed = ActionProposalPlanActionTypeSchema.safeParse(explicit);
|
|
76
|
+
if (parsed.success && parsed.data !== "clarification")
|
|
77
|
+
return parsed.data;
|
|
78
|
+
}
|
|
79
|
+
const action = stringValue(values, "action");
|
|
80
|
+
if (action === "compile" || action === "compile-run" || action === "run-preparation")
|
|
81
|
+
return "compile";
|
|
82
|
+
if (action === "test" || action === "check-readiness")
|
|
83
|
+
return "test";
|
|
84
|
+
if (action === "draft-readiness-checks" || action === "readiness-check-draft")
|
|
85
|
+
return "readiness-check-draft";
|
|
86
|
+
if (action === "create-method" || action === "method-authoring")
|
|
87
|
+
return "method-authoring";
|
|
88
|
+
if (action === "method-duplicate" || action === "method-remove" || action === "method-change")
|
|
89
|
+
return "method-change";
|
|
90
|
+
if (action === "preparation-remove" || action === "preparation-change")
|
|
91
|
+
return "preparation-change";
|
|
92
|
+
if (action === "improve-preparation" || action === "method-improvement")
|
|
93
|
+
return "method-improvement";
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
|
+
export function directServiceEndpointForAction(actionType) {
|
|
97
|
+
if (actionType === "preparation-setup")
|
|
98
|
+
return "/v1/preparation-setups";
|
|
99
|
+
if (actionType === "method-change")
|
|
100
|
+
return "/v1/method-changes";
|
|
101
|
+
if (actionType === "preparation-change")
|
|
102
|
+
return "/v1/preparation-changes";
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
export function numberValue(values, key) {
|
|
106
|
+
const value = values?.[key];
|
|
107
|
+
return typeof value === "number" && Number.isFinite(value) ? value : null;
|
|
108
|
+
}
|
|
109
|
+
export function testModeFromValues(values) {
|
|
110
|
+
const value = stringValue(values, "mode") ?? stringValue(values, "target");
|
|
111
|
+
if (value === "portable-context")
|
|
112
|
+
return "compiled";
|
|
113
|
+
return value === "source-files" || value === "compiled" || value === "both" ? value : null;
|
|
114
|
+
}
|
|
115
|
+
export function testModeValue(values, defaultMode = "both") {
|
|
116
|
+
return testModeFromValues(values) ?? defaultMode;
|
|
117
|
+
}
|
|
118
|
+
export function testModeCliTarget(mode) {
|
|
119
|
+
if (mode === "source-files")
|
|
120
|
+
return "source-files";
|
|
121
|
+
if (mode === "compiled")
|
|
122
|
+
return "portable-context";
|
|
123
|
+
return "both";
|
|
124
|
+
}
|
|
125
|
+
export function methodIdForProposal(message, values) {
|
|
126
|
+
const explicit = stringValue(values, "method_id") ??
|
|
127
|
+
stringValue(values, "method");
|
|
128
|
+
const fromMessage = message.match(/\b(?:create|reate|eate|draft|author|build|make)\s+(?:a\s+new\s+)?(?:interf\s+)?method\s+([a-z0-9][a-z0-9-]{0,79})\b/i)?.[1];
|
|
129
|
+
return explicit ?? fromMessage ?? `custom-${slugFromText(message)}`;
|
|
130
|
+
}
|
|
131
|
+
export function actionValueMethodTaskPrompt(values) {
|
|
132
|
+
const parsed = MethodAuthoringActionValuesSchema.safeParse(values);
|
|
133
|
+
return parsed.success ? methodAuthoringTaskPrompt(parsed.data) : null;
|
|
134
|
+
}
|
|
135
|
+
const METHOD_AUTHORING_INTERNAL_INSTRUCTION = /Use the attached values as the Method authoring request before proposing the action\.?/gi;
|
|
136
|
+
const METHOD_AUTHORING_LABELS = [
|
|
137
|
+
"Agent work",
|
|
138
|
+
"Portable-context output",
|
|
139
|
+
"Readiness checks",
|
|
140
|
+
"CLI preview",
|
|
141
|
+
];
|
|
142
|
+
export function normalizeMethodAuthoringText(value) {
|
|
143
|
+
return value
|
|
144
|
+
.replace(/[│]+/g, " ")
|
|
145
|
+
.replace(METHOD_AUTHORING_INTERNAL_INSTRUCTION, " ")
|
|
146
|
+
.replace(/\s+/g, " ")
|
|
147
|
+
.trim();
|
|
148
|
+
}
|
|
149
|
+
export function extractMethodAuthoringSection(value, label) {
|
|
150
|
+
const otherLabels = METHOD_AUTHORING_LABELS
|
|
151
|
+
.filter((candidate) => candidate !== label)
|
|
152
|
+
.map(escapeRegExp)
|
|
153
|
+
.join("|");
|
|
154
|
+
const match = value.match(new RegExp(`${escapeRegExp(label)}\\s*:\\s*([\\s\\S]*?)(?=\\s*(?:${otherLabels})\\s*:|$)`, "i"));
|
|
155
|
+
return match?.[1] ? normalizeMethodAuthoringText(match[1]) : null;
|
|
156
|
+
}
|
|
157
|
+
export function stripMethodCommandPrefix(value, methodId) {
|
|
158
|
+
const specific = new RegExp(`^(?:create|reate|eate|draft|author|build|make)\\s+(?:a\\s+new\\s+)?(?:interf\\s+)?method\\s+${escapeRegExp(methodId)}\\.?\\s*`, "i");
|
|
159
|
+
const generic = /^(?:create|reate|eate|draft|author|build|make)\s+(?:a\s+new\s+)?(?:interf\s+)?method\b[^.]{0,180}\.\s*/i;
|
|
160
|
+
const stripped = normalizeMethodAuthoringText(value)
|
|
161
|
+
.replace(specific, "")
|
|
162
|
+
.replace(generic, "")
|
|
163
|
+
.trim();
|
|
164
|
+
return stripped || normalizeMethodAuthoringText(value);
|
|
165
|
+
}
|
|
166
|
+
export function methodAuthoringPromptFallback(message, methodId) {
|
|
167
|
+
const cleaned = message
|
|
168
|
+
.replace(/[│]+/g, " ")
|
|
169
|
+
.replace(METHOD_AUTHORING_INTERNAL_INSTRUCTION, " ")
|
|
170
|
+
.trim();
|
|
171
|
+
const agentWork = extractMethodAuthoringSection(cleaned, "Agent work");
|
|
172
|
+
const portableOutput = extractMethodAuthoringSection(cleaned, "Portable-context output");
|
|
173
|
+
const readinessNotes = extractMethodAuthoringSection(cleaned, "Readiness checks");
|
|
174
|
+
const lines = [
|
|
175
|
+
agentWork ? `Agent work: ${stripMethodCommandPrefix(agentWork, methodId)}` : null,
|
|
176
|
+
portableOutput ? `Portable-context output: ${portableOutput}` : null,
|
|
177
|
+
readinessNotes ? `Readiness checks: ${readinessNotes}` : null,
|
|
178
|
+
].filter((line) => Boolean(line));
|
|
179
|
+
if (lines.length > 0)
|
|
180
|
+
return lines.join("\n");
|
|
181
|
+
return stripMethodCommandPrefix(cleaned, methodId);
|
|
182
|
+
}
|
|
183
|
+
export function methodAuthoringHintFromPrompt(prompt) {
|
|
184
|
+
const plain = normalizeMethodAuthoringText(prompt.replace(/\b(?:Agent work|Portable-context output|Readiness checks)\s*:/gi, " "));
|
|
185
|
+
if (plain.length <= 180)
|
|
186
|
+
return plain || "Custom Method";
|
|
187
|
+
const clipped = plain.slice(0, 177).replace(/\s+\S*$/, "").trim();
|
|
188
|
+
return `${clipped || plain.slice(0, 177)}...`;
|
|
189
|
+
}
|
|
190
|
+
export function methodLabelFromId(methodId) {
|
|
191
|
+
return methodId
|
|
192
|
+
.split("-")
|
|
193
|
+
.filter(Boolean)
|
|
194
|
+
.map((part) => `${part.slice(0, 1).toUpperCase()}${part.slice(1)}`)
|
|
195
|
+
.join(" ") || methodId;
|
|
196
|
+
}
|
|
197
|
+
export function detachMethodFromPreparation(preparation, methodId) {
|
|
198
|
+
if (methodIdForSourcePreparationConfig(preparation) !== methodId)
|
|
199
|
+
return preparation;
|
|
200
|
+
const { method: _removedMethod, ...detachedPreparation } = preparation;
|
|
201
|
+
return detachedPreparation;
|
|
202
|
+
}
|
|
203
|
+
export function requireSelectedMethod(preparation) {
|
|
204
|
+
const methodId = methodIdForSourcePreparationConfig(preparation);
|
|
205
|
+
if (methodId)
|
|
206
|
+
return methodId;
|
|
207
|
+
throw new Error(`Select a Method for Preparation "${preparation.name}" before preparing it.`);
|
|
208
|
+
}
|
|
209
|
+
export function actionCommandPreview(actionType, preparationName, methodId, values) {
|
|
210
|
+
if (actionType === "compile") {
|
|
211
|
+
const methodSuffix = methodId ? ` # Method: ${methodId}` : "";
|
|
212
|
+
return preparationName
|
|
213
|
+
? `interf compile --preparation ${preparationName}${methodSuffix}`
|
|
214
|
+
: `interf compile${methodSuffix}`;
|
|
215
|
+
}
|
|
216
|
+
if (actionType === "test") {
|
|
217
|
+
const mode = testModeCliTarget(testModeValue(values));
|
|
218
|
+
return preparationName
|
|
219
|
+
? `interf test --preparation ${preparationName} --target ${mode}`
|
|
220
|
+
: `interf test --target ${mode}`;
|
|
221
|
+
}
|
|
222
|
+
if (actionType === "readiness-check-draft") {
|
|
223
|
+
return "interf # choose Auto-create readiness checks";
|
|
224
|
+
}
|
|
225
|
+
if (actionType === "method-authoring" || actionType === "method-improvement") {
|
|
226
|
+
return "interf create method";
|
|
227
|
+
}
|
|
228
|
+
return "Try: create a Preparation, prepare, check readiness, draft readiness checks, or draft a Method.";
|
|
229
|
+
}
|
|
230
|
+
export function hasCompiledTestTarget(sourcePath, preparationConfig) {
|
|
231
|
+
const compiledPath = preparationPortableContextPath(asPreparationDataDir(sourcePath), preparationConfig.name);
|
|
232
|
+
if (!existsSync(compiledPath))
|
|
233
|
+
return false;
|
|
234
|
+
return createCompiledTestTarget(compiledPath, preparationConfig.name, methodIdForSourcePreparationConfig(preparationConfig) ?? DEFAULT_METHOD_ID).eligible;
|
|
235
|
+
}
|
|
236
|
+
export function actionAssistantMessage(actionType, preparationName, commandPreview) {
|
|
237
|
+
const preparationSuffix = preparationName ? ` for Preparation "${preparationName}"` : "";
|
|
238
|
+
if (actionType === "compile") {
|
|
239
|
+
return `Interf prepared a compile-run proposal${preparationSuffix}. Approve to submit it through the local Interf service and watch the run in Interf. CLI equivalent: ${commandPreview}`;
|
|
240
|
+
}
|
|
241
|
+
if (actionType === "test") {
|
|
242
|
+
return `Interf prepared a readiness-check proposal${preparationSuffix}. Approve to run the requested target against saved readiness checks. CLI equivalent: ${commandPreview}`;
|
|
243
|
+
}
|
|
244
|
+
if (actionType === "readiness-check-draft") {
|
|
245
|
+
return `Interf prepared a proposal to draft readiness checks${preparationSuffix}. Approve to ask the configured local executor to draft saved checks as a visible run. CLI equivalent: ${commandPreview}`;
|
|
246
|
+
}
|
|
247
|
+
if (actionType === "method-authoring" || actionType === "method-improvement") {
|
|
248
|
+
return `Interf prepared a Method draft proposal${preparationSuffix}. Approve to draft a reusable local Method as a visible run. CLI equivalent: ${commandPreview}`;
|
|
249
|
+
}
|
|
250
|
+
return "I could not map that to a safe Interf action. Ask for one action in plain English, such as create a Preparation, prepare the data, check readiness, draft readiness checks, or draft a Method.";
|
|
251
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure shaping helpers used by the runtime to assemble resource payloads
|
|
3
|
+
* (preparations, methods, proofs, log paths, readiness summaries) from
|
|
4
|
+
* raw state/run records. No I/O, no `this` — every input is passed in.
|
|
5
|
+
*
|
|
6
|
+
* Splitting these out keeps the runtime coordinator focused on
|
|
7
|
+
* orchestration rather than payload formatting.
|
|
8
|
+
*/
|
|
9
|
+
import { type ArtifactRef, type ProofRecord } from "./execution/lib/schema.js";
|
|
10
|
+
import { type CompiledState } from "./compile/state.js";
|
|
11
|
+
import { type RuntimeRun } from "./compile/lib/schema.js";
|
|
12
|
+
import { type ReadinessState, type ReadinessTargetResult } from "../contracts/lib/schema.js";
|
|
13
|
+
import { type TestRunTargetSummary } from "./verify/lib/schema.js";
|
|
14
|
+
import { type SourcePreparationConfig } from "../project/lib/schema.js";
|
|
15
|
+
import { type MethodResource, type PreparationResource } from "./lib/schema.js";
|
|
16
|
+
export declare function createRunId(prefix: "compile" | "verify" | "job"): string;
|
|
17
|
+
export declare function stageArtifactRefs(stageId: string, artifacts: string[] | undefined): ArtifactRef[];
|
|
18
|
+
export declare function proofForStage(options: {
|
|
19
|
+
runId: string;
|
|
20
|
+
stageId: string;
|
|
21
|
+
summary?: string | null;
|
|
22
|
+
stageState: NonNullable<CompiledState["stages"]>[string];
|
|
23
|
+
artifacts: ArtifactRef[];
|
|
24
|
+
}): ProofRecord;
|
|
25
|
+
export declare function logsForStageRun(stageState: NonNullable<CompiledState["stages"]>[string] | undefined): {
|
|
26
|
+
prompt_path: string;
|
|
27
|
+
event_stream_path: string;
|
|
28
|
+
status_path: string;
|
|
29
|
+
contract_path: string;
|
|
30
|
+
} | undefined;
|
|
31
|
+
export declare function logsForRuntimeRun(run: RuntimeRun | undefined): {
|
|
32
|
+
contract_path: string;
|
|
33
|
+
status_path?: string | undefined;
|
|
34
|
+
event_stream_path?: string | undefined;
|
|
35
|
+
prompt_path?: string | undefined;
|
|
36
|
+
} | undefined;
|
|
37
|
+
export declare function passRate(passed: number, total: number): number | null;
|
|
38
|
+
export declare function readinessTargetResult(summary: TestRunTargetSummary | null | undefined, currentFingerprint: string | null, readinessRunFingerprint: string | null | undefined): ReadinessTargetResult | null;
|
|
39
|
+
export declare function readinessSummaryForStatus(status: ReadinessState["status"]): string;
|
|
40
|
+
export declare function readinessStateToPreparationReadiness(readiness: ReadinessState): ReadinessState;
|
|
41
|
+
export declare function buildPreparationResource(rootPath: string, preparation: SourcePreparationConfig, readiness: ReadinessState, latestCompileRunId: string | null, latestTestRunId: string | null): PreparationResource;
|
|
42
|
+
export declare function buildMethodResource(resource: {
|
|
43
|
+
id: string;
|
|
44
|
+
path: string;
|
|
45
|
+
label?: string;
|
|
46
|
+
hint?: string;
|
|
47
|
+
source_kind: "builtin" | "local";
|
|
48
|
+
built_in: boolean;
|
|
49
|
+
active_for_preparations: string[];
|
|
50
|
+
output_paths: string[];
|
|
51
|
+
stages: MethodResource["stages"];
|
|
52
|
+
}): MethodResource;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { ReadinessStateSchema, } from "../contracts/lib/schema.js";
|
|
2
|
+
import { methodIdForSourcePreparationConfig, resolveSourcePreparationPath, } from "../project/source-config.js";
|
|
3
|
+
import { MethodResourceSchema, PreparationResourceSchema, } from "./lib/schema.js";
|
|
4
|
+
export function createRunId(prefix) {
|
|
5
|
+
return `${prefix}_${Date.now().toString(36)}_${Math.random().toString(36).slice(2, 8)}`;
|
|
6
|
+
}
|
|
7
|
+
export function stageArtifactRefs(stageId, artifacts) {
|
|
8
|
+
return (artifacts ?? []).map((path) => ({
|
|
9
|
+
path,
|
|
10
|
+
role: "output",
|
|
11
|
+
stage_id: stageId,
|
|
12
|
+
label: path,
|
|
13
|
+
}));
|
|
14
|
+
}
|
|
15
|
+
export function proofForStage(options) {
|
|
16
|
+
return {
|
|
17
|
+
id: `${options.runId}-${options.stageId}-proof`,
|
|
18
|
+
run_id: options.runId,
|
|
19
|
+
stage_id: options.stageId,
|
|
20
|
+
generated_at: options.stageState.finished_at ?? new Date().toISOString(),
|
|
21
|
+
summary: options.summary ?? `${options.stageId} produced stage evidence.`,
|
|
22
|
+
files_processed: options.stageState.counts?.source_total,
|
|
23
|
+
artifacts: options.artifacts,
|
|
24
|
+
checks: [
|
|
25
|
+
{
|
|
26
|
+
id: `${options.stageId}-status`,
|
|
27
|
+
label: "stage completed",
|
|
28
|
+
ok: options.stageState.status === "succeeded",
|
|
29
|
+
...(options.stageState.status === "succeeded"
|
|
30
|
+
? {}
|
|
31
|
+
: { detail: options.stageState.summary ?? "Stage did not complete successfully." }),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
id: `${options.stageId}-artifacts`,
|
|
35
|
+
label: "artifacts recorded",
|
|
36
|
+
ok: options.artifacts.length > 0,
|
|
37
|
+
...(options.artifacts.length > 0
|
|
38
|
+
? {}
|
|
39
|
+
: { detail: "No stage artifacts were recorded." }),
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export function logsForStageRun(stageState) {
|
|
45
|
+
const runId = stageState?.run_id;
|
|
46
|
+
if (!runId)
|
|
47
|
+
return undefined;
|
|
48
|
+
return {
|
|
49
|
+
prompt_path: `.interf/runtime/logs/${runId}.prompt.txt`,
|
|
50
|
+
event_stream_path: `.interf/runtime/logs/${runId}.events.ndjson`,
|
|
51
|
+
status_path: `.interf/runtime/logs/${runId}.status.log`,
|
|
52
|
+
contract_path: `.interf/runtime/logs/${runId}.stage-contract.json`,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export function logsForRuntimeRun(run) {
|
|
56
|
+
if (!run)
|
|
57
|
+
return undefined;
|
|
58
|
+
return {
|
|
59
|
+
...(run.logs?.prompt_path ? { prompt_path: run.logs.prompt_path } : {}),
|
|
60
|
+
...(run.logs?.event_stream_path ? { event_stream_path: run.logs.event_stream_path } : {}),
|
|
61
|
+
...(run.logs?.status_path ? { status_path: run.logs.status_path } : {}),
|
|
62
|
+
contract_path: run.contract_path,
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
export function passRate(passed, total) {
|
|
66
|
+
if (total <= 0)
|
|
67
|
+
return null;
|
|
68
|
+
return Math.round((passed / total) * 100);
|
|
69
|
+
}
|
|
70
|
+
export function readinessTargetResult(summary, currentFingerprint, readinessRunFingerprint) {
|
|
71
|
+
if (!summary)
|
|
72
|
+
return null;
|
|
73
|
+
const resultFingerprint = readinessRunFingerprint ?? null;
|
|
74
|
+
return {
|
|
75
|
+
passed: summary.passed_cases,
|
|
76
|
+
total: summary.total_cases,
|
|
77
|
+
pass_rate: passRate(summary.passed_cases, summary.total_cases),
|
|
78
|
+
checks_fingerprint: resultFingerprint,
|
|
79
|
+
stale: Boolean(currentFingerprint && resultFingerprint && currentFingerprint !== resultFingerprint),
|
|
80
|
+
run_id: null,
|
|
81
|
+
run_path: summary.run_path,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export function readinessSummaryForStatus(status) {
|
|
85
|
+
if (status === "ready")
|
|
86
|
+
return "Ready for agent work.";
|
|
87
|
+
if (status === "not-ready")
|
|
88
|
+
return "Readiness checks did not pass.";
|
|
89
|
+
if (status === "stale")
|
|
90
|
+
return "Readiness checks are stale for the current saved checks.";
|
|
91
|
+
if (status === "checking")
|
|
92
|
+
return "Readiness checks are running.";
|
|
93
|
+
if (status === "building")
|
|
94
|
+
return "Portable context is building.";
|
|
95
|
+
if (status === "built")
|
|
96
|
+
return "Portable context is built; readiness has not been proven yet.";
|
|
97
|
+
if (status === "not-built")
|
|
98
|
+
return "Portable context has not been built yet.";
|
|
99
|
+
if (status === "not-configured")
|
|
100
|
+
return "No readiness checks are configured.";
|
|
101
|
+
return "Latest preparation failed.";
|
|
102
|
+
}
|
|
103
|
+
export function readinessStateToPreparationReadiness(readiness) {
|
|
104
|
+
return ReadinessStateSchema.parse({
|
|
105
|
+
...readiness,
|
|
106
|
+
checks: readiness.checks.map((check) => ({ ...check })),
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
export function buildPreparationResource(rootPath, preparation, readiness, latestCompileRunId, latestTestRunId) {
|
|
110
|
+
const methodId = methodIdForSourcePreparationConfig(preparation);
|
|
111
|
+
return PreparationResourceSchema.parse({
|
|
112
|
+
id: preparation.name,
|
|
113
|
+
name: preparation.name,
|
|
114
|
+
preparation,
|
|
115
|
+
source_path: resolveSourcePreparationPath(rootPath, preparation),
|
|
116
|
+
method_id: methodId,
|
|
117
|
+
checks: preparation.checks,
|
|
118
|
+
portable_context: {
|
|
119
|
+
preparation: preparation.name,
|
|
120
|
+
path: readiness.portable_context_path,
|
|
121
|
+
exists: readiness.portable_context_path !== null,
|
|
122
|
+
method_id: methodId,
|
|
123
|
+
latest_compile_run_id: latestCompileRunId,
|
|
124
|
+
latest_test_run_id: latestTestRunId,
|
|
125
|
+
},
|
|
126
|
+
portable_context_path: readiness.portable_context_path,
|
|
127
|
+
readiness: readinessStateToPreparationReadiness(readiness),
|
|
128
|
+
runs: {
|
|
129
|
+
latest_compile_run_id: latestCompileRunId,
|
|
130
|
+
latest_test_run_id: latestTestRunId,
|
|
131
|
+
},
|
|
132
|
+
latest_compile_run_id: latestCompileRunId,
|
|
133
|
+
latest_test_run_id: latestTestRunId,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
export function buildMethodResource(resource) {
|
|
137
|
+
return MethodResourceSchema.parse({
|
|
138
|
+
id: resource.id,
|
|
139
|
+
method_id: resource.id,
|
|
140
|
+
path: resource.path,
|
|
141
|
+
...(resource.label ? { label: resource.label } : {}),
|
|
142
|
+
...(resource.hint ? { hint: resource.hint } : {}),
|
|
143
|
+
source_kind: resource.source_kind,
|
|
144
|
+
built_in: resource.built_in,
|
|
145
|
+
active_for_preparations: resource.active_for_preparations,
|
|
146
|
+
output_paths: resource.output_paths,
|
|
147
|
+
stages: resource.stages,
|
|
148
|
+
});
|
|
149
|
+
}
|