@interf/compiler 0.9.5 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +135 -91
- package/TRADEMARKS.md +2 -13
- package/agent-skills/interf-actions/SKILL.md +143 -38
- package/agent-skills/interf-actions/references/cli.md +134 -67
- package/builtin-methods/interf-default/README.md +3 -4
- package/builtin-methods/interf-default/compile/stages/shape/SKILL.md +2 -2
- package/builtin-methods/interf-default/compile/stages/summarize/SKILL.md +2 -1
- package/builtin-methods/interf-default/improve/SKILL.md +1 -1
- package/builtin-methods/interf-default/method.json +10 -4
- package/builtin-methods/interf-default/method.schema.json +0 -9
- package/builtin-methods/interf-default/use/query/SKILL.md +5 -5
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.d.ts +8 -25
- package/dist/cli/commands/compile.js +83 -359
- package/dist/cli/commands/doctor.js +2 -2
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +39 -0
- package/dist/cli/commands/logout.d.ts +2 -0
- package/dist/cli/commands/logout.js +16 -0
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.d.ts +2 -0
- package/dist/cli/commands/method.js +113 -0
- package/dist/cli/commands/prep.d.ts +2 -0
- package/dist/cli/commands/prep.js +152 -0
- package/dist/cli/commands/reset.d.ts +8 -1
- package/dist/cli/commands/reset.js +47 -26
- package/dist/cli/commands/runs.d.ts +2 -0
- package/dist/cli/commands/runs.js +120 -0
- package/dist/cli/commands/status.d.ts +6 -1
- package/dist/cli/commands/status.js +68 -111
- package/dist/cli/commands/verify.d.ts +7 -1
- package/dist/cli/commands/verify.js +69 -85
- package/dist/cli/commands/web.d.ts +0 -9
- package/dist/cli/commands/web.js +201 -121
- package/dist/cli/commands/wizard.d.ts +9 -0
- package/dist/cli/commands/wizard.js +689 -0
- package/dist/cli/index.d.ts +10 -7
- package/dist/cli/index.js +19 -12
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{177mvn4rse235.js → 0jipmpez3_ehh.js} +16 -16
- package/dist/compiler-ui/_next/static/chunks/{18a8f2jkv3z.c.css → 13awzu4tooflw.css} +1 -1
- package/dist/compiler-ui/_not-found/__next._full.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._head.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._index.txt +2 -2
- package/dist/compiler-ui/_not-found/__next._not-found.__PAGE__.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._not-found.txt +1 -1
- package/dist/compiler-ui/_not-found/__next._tree.txt +2 -2
- package/dist/compiler-ui/_not-found.html +1 -1
- package/dist/compiler-ui/_not-found.txt +2 -2
- package/dist/compiler-ui/index.html +1 -1
- package/dist/compiler-ui/index.txt +3 -3
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/contracts/index.d.ts +2 -1
- package/dist/packages/contracts/index.js +1 -0
- package/dist/packages/contracts/lib/preparation-paths.d.ts +117 -0
- package/dist/packages/contracts/lib/preparation-paths.js +177 -0
- package/dist/packages/contracts/lib/schema.d.ts +187 -13
- package/dist/packages/contracts/lib/schema.js +148 -3
- package/dist/packages/contracts/utils/filesystem.d.ts +9 -0
- package/dist/packages/contracts/utils/filesystem.js +142 -0
- package/dist/packages/{local-service → engine}/action-definitions.d.ts +14 -14
- package/dist/packages/{local-service → engine}/action-definitions.js +35 -29
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +3 -2
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +5 -5
- package/dist/packages/{agents → engine/agents}/lib/shells.js +117 -58
- package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +4 -2
- package/dist/packages/engine/agents/lib/user-config.js +24 -0
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +59 -60
- package/dist/packages/{local-service → engine}/client.js +137 -145
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-paths.d.ts +9 -2
- package/dist/packages/{compiler → engine/compile}/compiled-paths.js +30 -15
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +39 -9
- package/dist/packages/{compiler → engine/compile}/compiled-schema.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-schema.js +4 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-plan.js +8 -4
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-stage-runner.js +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +3 -3
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/index.d.ts +1 -0
- package/dist/packages/{compiler → engine/compile}/index.js +1 -0
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +26 -31
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -13
- package/dist/packages/engine/compile/method-runs.d.ts +14 -0
- package/dist/packages/{compiler → engine/compile}/method-runs.js +5 -6
- package/dist/packages/{compiler → engine/compile}/reset.js +3 -1
- package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
- package/dist/packages/{compiler → engine/compile}/runtime-contracts.js +0 -3
- package/dist/packages/{compiler → engine/compile}/runtime-prompt.js +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/runtime-reconcile.js +12 -10
- package/dist/packages/{compiler → engine/compile}/runtime-runs.d.ts +1 -2
- package/dist/packages/{compiler → engine/compile}/runtime-runs.js +3 -43
- package/dist/packages/{compiler → engine/compile}/runtime-types.d.ts +1 -5
- package/dist/packages/{compiler → engine/compile}/runtime.d.ts +2 -2
- package/dist/packages/{compiler → engine/compile}/runtime.js +1 -1
- package/dist/packages/engine/compile/source-files.d.ts +46 -0
- package/dist/packages/engine/compile/source-files.js +149 -0
- package/dist/packages/engine/compile/state-artifacts.d.ts +9 -0
- package/dist/packages/{compiler → engine/compile}/state-artifacts.js +4 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-io.d.ts +3 -2
- package/dist/packages/{compiler → engine/compile}/state-io.js +13 -7
- package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +2 -1
- package/dist/packages/engine/compile/state-paths.js +16 -0
- package/dist/packages/engine/compile/state-view.d.ts +5 -0
- package/dist/packages/{compiler → engine/compile}/state-view.js +20 -30
- package/dist/packages/engine/compile/state.d.ts +7 -0
- package/dist/packages/{compiler → engine/compile}/state.js +3 -3
- package/dist/packages/{compiler → engine/compile}/validate-compiled.js +2 -2
- package/dist/packages/{compiler → engine/compile}/validate.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/validate.js +3 -3
- package/dist/packages/engine/connection-config.d.ts +38 -0
- package/dist/packages/engine/connection-config.js +75 -0
- package/dist/packages/{execution → engine/execution}/lib/schema.d.ts +52 -72
- package/dist/packages/{execution → engine/execution}/lib/schema.js +3 -3
- package/dist/packages/engine/index.d.ts +22 -0
- package/dist/packages/engine/index.js +15 -0
- package/dist/packages/engine/instance-paths.d.ts +100 -0
- package/dist/packages/engine/instance-paths.js +165 -0
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +392 -2408
- package/dist/packages/{local-service → engine}/lib/schema.js +164 -76
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +71 -27
- package/dist/packages/engine/preparation-store.d.ts +104 -0
- package/dist/packages/engine/preparation-store.js +194 -0
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/engine/routes.d.ts +78 -0
- package/dist/packages/engine/routes.js +92 -0
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +25 -24
- package/dist/packages/engine/runtime-caches.d.ts +76 -0
- package/dist/packages/engine/runtime-caches.js +191 -0
- package/dist/packages/engine/runtime-event-applier.d.ts +12 -0
- package/dist/packages/engine/runtime-event-applier.js +177 -0
- package/dist/packages/engine/runtime-persistence.d.ts +47 -0
- package/dist/packages/engine/runtime-persistence.js +137 -0
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +35 -0
- package/dist/packages/engine/runtime-proposal-helpers.js +251 -0
- package/dist/packages/engine/runtime-resource-builders.d.ts +52 -0
- package/dist/packages/engine/runtime-resource-builders.js +149 -0
- package/dist/packages/engine/runtime.d.ts +318 -0
- package/dist/packages/{local-service → engine}/runtime.js +835 -1011
- package/dist/packages/{local-service → engine}/server.d.ts +15 -0
- package/dist/packages/engine/server.js +1257 -0
- package/dist/packages/engine/service-registry.d.ts +47 -0
- package/dist/packages/engine/service-registry.js +137 -0
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +11 -11
- package/dist/packages/{testing → engine/verify}/lib/schema.js +3 -3
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +9 -16
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +38 -94
- package/dist/packages/{testing → engine/verify}/test-execution.js +6 -6
- package/dist/packages/{testing → engine/verify}/test-paths.js +5 -4
- package/dist/packages/{testing → engine/verify}/test-sandbox.d.ts +0 -1
- package/dist/packages/{testing → engine/verify}/test-sandbox.js +17 -33
- package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.js +9 -9
- package/dist/packages/{testing → engine/verify}/test.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/test.js +1 -1
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +12 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +70 -7
- package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.d.ts +2 -2
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.d.ts +4 -4
- package/dist/packages/{method-authoring → methods/authoring}/method-improvement.js +16 -10
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +4 -5
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +10 -16
- package/dist/packages/{method-package → methods/package}/context-interface.d.ts +5 -41
- package/dist/packages/{method-package → methods/package}/context-interface.js +3 -25
- package/dist/packages/{method-package → methods/package}/interf-method-package.d.ts +4 -4
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +24 -35
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +18 -8
- package/dist/packages/{method-package → methods/package}/local-methods.js +64 -45
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +16 -36
- package/dist/packages/{method-package → methods/package}/method-definitions.js +53 -40
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +2 -14
- package/dist/packages/{method-package → methods/package}/method-helpers.js +12 -46
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +3 -31
- package/dist/packages/methods/package/user-methods.d.ts +17 -0
- package/dist/packages/methods/package/user-methods.js +77 -0
- package/dist/packages/{project-model → project}/index.d.ts +0 -1
- package/dist/packages/{project-model → project}/index.js +0 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.d.ts +8 -3
- package/dist/packages/{project-model → project}/interf-detect.js +38 -38
- package/dist/packages/project/interf-scaffold.d.ts +3 -0
- package/dist/packages/{project-model → project}/interf-scaffold.js +30 -39
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +39 -2
- package/dist/packages/project/preparation-entries.d.ts +11 -0
- package/dist/packages/{project-model → project}/preparation-entries.js +14 -14
- package/dist/packages/{project-model → project}/source-config.d.ts +12 -12
- package/dist/packages/{project-model → project}/source-config.js +81 -53
- package/dist/packages/{project-model → project}/source-folders.d.ts +5 -5
- package/dist/packages/{project-model → project}/source-folders.js +16 -16
- package/package.json +8 -8
- package/CHANGELOG.md +0 -93
- package/LICENSE +0 -183
- package/dist/cli/commands/action-input-cli.d.ts +0 -25
- package/dist/cli/commands/action-input-cli.js +0 -73
- package/dist/cli/commands/control-path.d.ts +0 -11
- package/dist/cli/commands/control-path.js +0 -72
- package/dist/cli/commands/create-method-wizard.d.ts +0 -64
- package/dist/cli/commands/create-method-wizard.js +0 -434
- package/dist/cli/commands/create.d.ts +0 -6
- package/dist/cli/commands/create.js +0 -183
- package/dist/cli/commands/default.d.ts +0 -2
- package/dist/cli/commands/default.js +0 -39
- package/dist/cli/commands/executor-flow.d.ts +0 -29
- package/dist/cli/commands/executor-flow.js +0 -163
- package/dist/cli/commands/init.d.ts +0 -26
- package/dist/cli/commands/init.js +0 -771
- package/dist/cli/commands/list.d.ts +0 -2
- package/dist/cli/commands/list.js +0 -30
- package/dist/cli/commands/preparation-action.d.ts +0 -8
- package/dist/cli/commands/preparation-action.js +0 -29
- package/dist/cli/commands/preparation-picker.d.ts +0 -5
- package/dist/cli/commands/preparation-picker.js +0 -36
- package/dist/cli/commands/preparation-selection.d.ts +0 -6
- package/dist/cli/commands/preparation-selection.js +0 -11
- package/dist/cli/commands/service-action-flow.d.ts +0 -9
- package/dist/cli/commands/service-action-flow.js +0 -19
- package/dist/cli/commands/source-config-wizard.d.ts +0 -51
- package/dist/cli/commands/source-config-wizard.js +0 -670
- package/dist/cli/commands/test.d.ts +0 -17
- package/dist/cli/commands/test.js +0 -188
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- package/dist/packages/agents/lib/user-config.js +0 -16
- package/dist/packages/compiler/method-runs.d.ts +0 -15
- package/dist/packages/compiler/raw-snapshot.d.ts +0 -49
- package/dist/packages/compiler/raw-snapshot.js +0 -101
- package/dist/packages/compiler/state-artifacts.d.ts +0 -8
- package/dist/packages/compiler/state-paths.js +0 -13
- package/dist/packages/compiler/state-view.d.ts +0 -4
- package/dist/packages/compiler/state.d.ts +0 -7
- package/dist/packages/local-service/index.d.ts +0 -18
- package/dist/packages/local-service/index.js +0 -13
- package/dist/packages/local-service/routes.d.ts +0 -32
- package/dist/packages/local-service/routes.js +0 -37
- package/dist/packages/local-service/runtime.d.ts +0 -133
- package/dist/packages/local-service/server.js +0 -627
- package/dist/packages/method-package/index.d.ts +0 -11
- package/dist/packages/method-package/index.js +0 -11
- package/dist/packages/method-package/method-stage-policy.d.ts +0 -5
- package/dist/packages/method-package/method-stage-policy.js +0 -31
- package/dist/packages/project-model/interf-scaffold.d.ts +0 -3
- package/dist/packages/project-model/preparation-entries.d.ts +0 -11
- package/dist/packages/project-model/project-paths.d.ts +0 -12
- package/dist/packages/project-model/project-paths.js +0 -33
- package/dist/packages/shared/filesystem.d.ts +0 -2
- package/dist/packages/shared/filesystem.js +0 -55
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{84FaeF3EzBF9kKTMjSEVN → a3UiUF0DiMEbfWy_0gihg}/_ssgManifest.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/file-types.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/artifact-counts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-compile.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/method-primitives.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/reset.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-acceptance.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-inventory.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{testing → engine/verify}/index.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/index.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-execution.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-paths.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-profile-presets.js +0 -0
- /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-types.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/index.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.d.ts +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/lib/method-edit-utils.js +0 -0
- /package/dist/packages/{method-authoring → methods/authoring}/method-edit-session.js +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type
|
|
1
|
+
import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type VerifyRunCreateRequest, type VerifyRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
|
|
2
|
+
export interface FindOrStartLocalServiceOptions {
|
|
3
|
+
url?: string;
|
|
4
|
+
authToken?: string;
|
|
5
|
+
}
|
|
2
6
|
export interface LocalServiceConnection {
|
|
3
7
|
serviceUrl: string;
|
|
4
8
|
health: LocalServiceHealth;
|
|
9
|
+
authToken: string | null;
|
|
5
10
|
}
|
|
6
11
|
export interface LocalServiceJobSubmission<T> {
|
|
7
12
|
serviceUrl: string;
|
|
@@ -13,69 +18,59 @@ export interface LocalServiceJobSubmitted {
|
|
|
13
18
|
serviceUrl: string;
|
|
14
19
|
job: LocalJobRunResource;
|
|
15
20
|
}
|
|
16
|
-
export interface LocalServiceRunSnapshot {
|
|
17
|
-
jobs: LocalJobRunResource[];
|
|
18
|
-
compileRuns: CompileRunResource[];
|
|
19
|
-
testRuns: TestRunResource[];
|
|
20
|
-
}
|
|
21
21
|
export declare function configuredLocalServiceUrl(): string;
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
/**
|
|
23
|
+
* Resolve the bearer token for the active connection. In 0.13 there is
|
|
24
|
+
* exactly one source of truth: `~/.interf/connection.json` (or the
|
|
25
|
+
* `INTERF_SERVICE_TOKEN` env override).
|
|
26
|
+
*/
|
|
27
|
+
export declare function resolveLocalServiceAuthToken(): string | null;
|
|
28
|
+
/**
|
|
29
|
+
* Resolve a connection. In 0.13 this is the only path to the engine — read
|
|
30
|
+
* `~/.interf/connection.json` (written by `interf web`) or honor the
|
|
31
|
+
* `INTERF_SERVICE_URL` / `INTERF_SERVICE_TOKEN` env overrides.
|
|
32
|
+
*/
|
|
33
|
+
export declare function findLocalService(options?: {
|
|
24
34
|
timeoutMs?: number;
|
|
25
35
|
}): Promise<LocalServiceConnection | null>;
|
|
26
36
|
export declare function submitCompileRunToLocalService(options: {
|
|
27
|
-
|
|
37
|
+
preparationId: string;
|
|
28
38
|
request: CompileRunCreateRequest;
|
|
39
|
+
idempotencyKey?: string;
|
|
29
40
|
}): Promise<{
|
|
30
41
|
serviceUrl: string;
|
|
31
42
|
resource: CompileRunResource;
|
|
32
43
|
} | null>;
|
|
33
|
-
export declare function
|
|
34
|
-
|
|
35
|
-
request:
|
|
36
|
-
}): Promise<{
|
|
37
|
-
serviceUrl: string;
|
|
38
|
-
resource: TestRunResource;
|
|
39
|
-
} | null>;
|
|
40
|
-
export declare function submitPreparationSetupToLocalService(options: {
|
|
41
|
-
projectPath: string;
|
|
42
|
-
request: PreparationSetupCreateRequest;
|
|
44
|
+
export declare function submitVerifyRunToLocalService(options: {
|
|
45
|
+
preparationId: string;
|
|
46
|
+
request: VerifyRunCreateRequest;
|
|
43
47
|
}): Promise<{
|
|
44
48
|
serviceUrl: string;
|
|
45
|
-
|
|
46
|
-
} | null>;
|
|
47
|
-
export declare function submitPreparationChangeToLocalService(options: {
|
|
48
|
-
projectPath: string;
|
|
49
|
-
request: PreparationChangeCreateRequest;
|
|
50
|
-
}): Promise<{
|
|
51
|
-
serviceUrl: string;
|
|
52
|
-
result: PreparationChangeResult;
|
|
49
|
+
resource: VerifyRunResource;
|
|
53
50
|
} | null>;
|
|
54
51
|
export declare function submitResetToLocalService(options: {
|
|
55
|
-
|
|
52
|
+
preparationId: string;
|
|
56
53
|
request: ResetRequest;
|
|
57
54
|
}): Promise<{
|
|
58
55
|
serviceUrl: string;
|
|
59
56
|
result: ResetResult;
|
|
60
57
|
} | null>;
|
|
61
58
|
export declare function createActionProposalInLocalService(options: {
|
|
62
|
-
projectPath: string;
|
|
63
59
|
request: ActionProposalCreateRequest;
|
|
64
60
|
}): Promise<{
|
|
65
61
|
serviceUrl: string;
|
|
66
62
|
resource: ActionProposalResource;
|
|
67
63
|
} | null>;
|
|
68
64
|
export declare function decideActionProposalInLocalService(options: {
|
|
69
|
-
projectPath: string;
|
|
70
65
|
proposalId: string;
|
|
71
66
|
request: ActionProposalApprovalRequest;
|
|
72
67
|
serviceUrl?: string;
|
|
68
|
+
authToken?: string | null;
|
|
73
69
|
}): Promise<{
|
|
74
70
|
serviceUrl: string;
|
|
75
71
|
resource: ActionProposalResource;
|
|
76
72
|
} | null>;
|
|
77
73
|
export declare function approveActionProposalInLocalService(options: {
|
|
78
|
-
projectPath: string;
|
|
79
74
|
request: ActionProposalCreateRequest;
|
|
80
75
|
}): Promise<{
|
|
81
76
|
serviceUrl: string;
|
|
@@ -84,67 +79,71 @@ export declare function approveActionProposalInLocalService(options: {
|
|
|
84
79
|
export declare function getLocalCompileRun(options: {
|
|
85
80
|
serviceUrl: string;
|
|
86
81
|
runId: string;
|
|
82
|
+
authToken?: string | null;
|
|
87
83
|
}): Promise<CompileRunResource>;
|
|
88
|
-
export
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
84
|
+
export interface LocalCompileRunCancelResult {
|
|
85
|
+
cancelled: boolean;
|
|
86
|
+
reason?: string;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Ask the local service to cancel a running compile run by id. Resolves
|
|
90
|
+
* with the typed cancel result on success and throws when the service
|
|
91
|
+
* returns 404 (unknown run id) or any non-2xx status.
|
|
92
|
+
*/
|
|
93
|
+
export declare function cancelLocalCompileRun(options: {
|
|
93
94
|
serviceUrl: string;
|
|
95
|
+
runId: string;
|
|
94
96
|
timeoutMs?: number;
|
|
95
|
-
|
|
97
|
+
authToken?: string | null;
|
|
98
|
+
}): Promise<LocalCompileRunCancelResult>;
|
|
96
99
|
export declare function waitForLocalCompileRun(options: {
|
|
97
100
|
serviceUrl: string;
|
|
98
101
|
runId: string;
|
|
99
102
|
pollMs?: number;
|
|
103
|
+
authToken?: string | null;
|
|
100
104
|
onUpdate?: (resource: CompileRunResource) => void;
|
|
101
105
|
}): Promise<CompileRunResource>;
|
|
102
|
-
export declare function
|
|
106
|
+
export declare function getLocalVerifyRun(options: {
|
|
103
107
|
serviceUrl: string;
|
|
104
108
|
runId: string;
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
timeoutMs?: number;
|
|
109
|
-
}): Promise<TestRunListResponse>;
|
|
110
|
-
export declare function waitForLocalTestRun(options: {
|
|
109
|
+
authToken?: string | null;
|
|
110
|
+
}): Promise<VerifyRunResource>;
|
|
111
|
+
export declare function waitForLocalVerifyRun(options: {
|
|
111
112
|
serviceUrl: string;
|
|
112
113
|
runId: string;
|
|
113
114
|
pollMs?: number;
|
|
114
|
-
|
|
115
|
-
|
|
115
|
+
authToken?: string | null;
|
|
116
|
+
onUpdate?: (resource: VerifyRunResource) => void;
|
|
117
|
+
}): Promise<VerifyRunResource>;
|
|
116
118
|
export declare function getLocalJobRun(options: {
|
|
117
119
|
serviceUrl: string;
|
|
118
120
|
runId: string;
|
|
121
|
+
authToken?: string | null;
|
|
119
122
|
}): Promise<LocalJobRunResource>;
|
|
120
|
-
export declare function listLocalJobRuns(options: {
|
|
121
|
-
serviceUrl: string;
|
|
122
|
-
timeoutMs?: number;
|
|
123
|
-
}): Promise<LocalJobRunListResponse>;
|
|
124
|
-
export declare function readLocalServiceRunSnapshot(options: {
|
|
125
|
-
serviceUrl: string;
|
|
126
|
-
timeoutMs?: number;
|
|
127
|
-
}): Promise<LocalServiceRunSnapshot>;
|
|
128
123
|
export declare function waitForLocalJobRun(options: {
|
|
129
124
|
serviceUrl: string;
|
|
130
125
|
runId: string;
|
|
131
126
|
pollMs?: number;
|
|
132
127
|
timeoutMs?: number;
|
|
128
|
+
authToken?: string | null;
|
|
133
129
|
onUpdate?: (job: LocalJobRunResource) => void;
|
|
134
130
|
}): Promise<LocalJobRunResource>;
|
|
135
131
|
export declare function submitReadinessCheckDraftToLocalService(options: {
|
|
136
|
-
|
|
132
|
+
preparationId: string;
|
|
137
133
|
request: ReadinessCheckDraftCreateRequest;
|
|
138
134
|
onSubmitted?: (submission: LocalServiceJobSubmitted) => void;
|
|
139
135
|
onUpdate?: (job: LocalJobRunResource) => void;
|
|
140
136
|
}): Promise<LocalServiceJobSubmission<ReadinessCheckDraftResult> | null>;
|
|
141
137
|
export declare function submitMethodAuthoringRunToLocalService(options: {
|
|
142
|
-
|
|
138
|
+
preparationId: string;
|
|
143
139
|
request: MethodAuthoringCreateRequest;
|
|
144
140
|
onSubmitted?: (submission: LocalServiceJobSubmitted) => void;
|
|
145
141
|
onUpdate?: (job: LocalJobRunResource) => void;
|
|
146
142
|
}): Promise<LocalServiceJobSubmission<MethodAuthoringResult> | null>;
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
143
|
+
/**
|
|
144
|
+
* Fetch the engine instance health/status.
|
|
145
|
+
*/
|
|
146
|
+
export declare function getLocalServiceHealth(options: {
|
|
147
|
+
serviceUrl: string;
|
|
148
|
+
timeoutMs?: number;
|
|
149
|
+
}): Promise<LocalServiceHealth>;
|
|
@@ -1,7 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { CompileRunCreateRequestSchema, CompileRunResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, VerifyRunCreateRequestSchema, VerifyRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
|
|
2
|
+
import { LOCAL_SERVICE_ROUTES, buildLocalServiceUrl, preparationSubresourcePath, } from "./routes.js";
|
|
3
|
+
import { readActiveConnection } from "./connection-config.js";
|
|
4
|
+
async function connectOrNull(options = {}) {
|
|
5
|
+
const conn = readActiveConnection({
|
|
6
|
+
urlOverride: options.url ?? null,
|
|
7
|
+
authTokenOverride: options.authToken ?? null,
|
|
8
|
+
});
|
|
9
|
+
if (!conn)
|
|
10
|
+
return null;
|
|
11
|
+
// Probe the engine and surface a LocalServiceHealth object that
|
|
12
|
+
// submitCompileRun et al. consume.
|
|
13
|
+
try {
|
|
14
|
+
const headers = {};
|
|
15
|
+
if (conn.auth_token)
|
|
16
|
+
headers["authorization"] = `Bearer ${conn.auth_token}`;
|
|
17
|
+
const response = await fetch(`${conn.url.replace(/\/+$/, "")}/health`, { headers });
|
|
18
|
+
if (response.status !== 200)
|
|
19
|
+
return null;
|
|
20
|
+
const health = (await response.json());
|
|
21
|
+
return { serviceUrl: conn.url, health, authToken: conn.auth_token ?? null };
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
5
27
|
function trimTrailingSlash(value) {
|
|
6
28
|
return value.replace(/\/+$/, "");
|
|
7
29
|
}
|
|
@@ -11,26 +33,17 @@ export function configuredLocalServiceUrl() {
|
|
|
11
33
|
return trimTrailingSlash(explicit);
|
|
12
34
|
return buildLocalServiceUrl();
|
|
13
35
|
}
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
catch {
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
function localServiceUrlCandidates(projectPath) {
|
|
27
|
-
const explicit = process.env.INTERF_SERVICE_URL?.trim();
|
|
36
|
+
/**
|
|
37
|
+
* Resolve the bearer token for the active connection. In 0.13 there is
|
|
38
|
+
* exactly one source of truth: `~/.interf/connection.json` (or the
|
|
39
|
+
* `INTERF_SERVICE_TOKEN` env override).
|
|
40
|
+
*/
|
|
41
|
+
export function resolveLocalServiceAuthToken() {
|
|
42
|
+
const explicit = process.env.INTERF_SERVICE_TOKEN?.trim();
|
|
28
43
|
if (explicit)
|
|
29
|
-
return
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
buildLocalServiceUrl(),
|
|
33
|
-
].filter((value) => Boolean(value))));
|
|
44
|
+
return explicit;
|
|
45
|
+
const conn = readActiveConnection();
|
|
46
|
+
return conn?.auth_token ?? null;
|
|
34
47
|
}
|
|
35
48
|
async function fetchJson(url, options = {}) {
|
|
36
49
|
const controller = new AbortController();
|
|
@@ -54,96 +67,67 @@ async function fetchJson(url, options = {}) {
|
|
|
54
67
|
clearTimeout(timeout);
|
|
55
68
|
}
|
|
56
69
|
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
if (!healthMatchesProject(health, options.projectPath, explicitServiceUrl)) {
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
return { serviceUrl, health };
|
|
76
|
-
}
|
|
77
|
-
catch {
|
|
78
|
-
continue;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}
|
|
70
|
+
/**
|
|
71
|
+
* Resolve a connection. In 0.13 this is the only path to the engine — read
|
|
72
|
+
* `~/.interf/connection.json` (written by `interf web`) or honor the
|
|
73
|
+
* `INTERF_SERVICE_URL` / `INTERF_SERVICE_TOKEN` env overrides.
|
|
74
|
+
*/
|
|
75
|
+
export async function findLocalService(options = {}) {
|
|
76
|
+
void options.timeoutMs;
|
|
77
|
+
return connectOrNull();
|
|
78
|
+
}
|
|
79
|
+
function authHeaders(authToken) {
|
|
80
|
+
return authToken ? { authorization: `Bearer ${authToken}` } : {};
|
|
81
|
+
}
|
|
82
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
83
|
+
// Preparation-keyed run submission helpers (0.13)
|
|
84
|
+
// ─────────────────────────────────────────────────────────────────────────
|
|
83
85
|
export async function submitCompileRunToLocalService(options) {
|
|
84
|
-
const connection = await
|
|
86
|
+
const connection = await connectOrNull();
|
|
85
87
|
if (!connection)
|
|
86
88
|
return null;
|
|
87
89
|
const request = CompileRunCreateRequestSchema.parse(options.request);
|
|
88
|
-
const
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}));
|
|
92
|
-
return {
|
|
93
|
-
serviceUrl: connection.serviceUrl,
|
|
94
|
-
resource,
|
|
90
|
+
const headers = {
|
|
91
|
+
...authHeaders(connection.authToken),
|
|
92
|
+
...(options.idempotencyKey ? { "x-interf-idempotency-key": options.idempotencyKey } : {}),
|
|
95
93
|
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
const connection = await findLocalService({ projectPath: options.projectPath });
|
|
99
|
-
if (!connection)
|
|
100
|
-
return null;
|
|
101
|
-
const request = TestRunCreateRequestSchema.parse(options.request);
|
|
102
|
-
const resource = TestRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${LOCAL_SERVICE_ROUTES.testRuns}`, {
|
|
94
|
+
const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "compileRuns")}`;
|
|
95
|
+
const resource = CompileRunResourceSchema.parse(await fetchJson(url, {
|
|
103
96
|
method: "POST",
|
|
104
97
|
body: JSON.stringify(request),
|
|
98
|
+
headers,
|
|
105
99
|
}));
|
|
106
100
|
return {
|
|
107
101
|
serviceUrl: connection.serviceUrl,
|
|
108
102
|
resource,
|
|
109
103
|
};
|
|
110
104
|
}
|
|
111
|
-
export async function
|
|
112
|
-
const connection = await
|
|
113
|
-
if (!connection)
|
|
114
|
-
return null;
|
|
115
|
-
const request = PreparationSetupCreateRequestSchema.parse(options.request);
|
|
116
|
-
const result = PreparationSetupResultSchema.parse(await fetchJson(`${connection.serviceUrl}${LOCAL_SERVICE_ROUTES.preparationSetups}`, {
|
|
117
|
-
method: "POST",
|
|
118
|
-
body: JSON.stringify(request),
|
|
119
|
-
}));
|
|
120
|
-
return {
|
|
121
|
-
serviceUrl: connection.serviceUrl,
|
|
122
|
-
result,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
export async function submitPreparationChangeToLocalService(options) {
|
|
126
|
-
const connection = await findLocalService({ projectPath: options.projectPath });
|
|
105
|
+
export async function submitVerifyRunToLocalService(options) {
|
|
106
|
+
const connection = await connectOrNull();
|
|
127
107
|
if (!connection)
|
|
128
108
|
return null;
|
|
129
|
-
const request =
|
|
130
|
-
const
|
|
109
|
+
const request = VerifyRunCreateRequestSchema.parse(options.request);
|
|
110
|
+
const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "verifyRuns")}`;
|
|
111
|
+
const resource = VerifyRunResourceSchema.parse(await fetchJson(url, {
|
|
131
112
|
method: "POST",
|
|
132
113
|
body: JSON.stringify(request),
|
|
114
|
+
headers: authHeaders(connection.authToken),
|
|
133
115
|
}));
|
|
134
116
|
return {
|
|
135
117
|
serviceUrl: connection.serviceUrl,
|
|
136
|
-
|
|
118
|
+
resource,
|
|
137
119
|
};
|
|
138
120
|
}
|
|
139
121
|
export async function submitResetToLocalService(options) {
|
|
140
|
-
const connection = await
|
|
122
|
+
const connection = await connectOrNull();
|
|
141
123
|
if (!connection)
|
|
142
124
|
return null;
|
|
143
125
|
const request = ResetRequestSchema.parse(options.request);
|
|
144
|
-
const
|
|
126
|
+
const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "reset")}`;
|
|
127
|
+
const result = ResetResultSchema.parse(await fetchJson(url, {
|
|
145
128
|
method: "POST",
|
|
146
129
|
body: JSON.stringify(request),
|
|
130
|
+
headers: authHeaders(connection.authToken),
|
|
147
131
|
}));
|
|
148
132
|
return {
|
|
149
133
|
serviceUrl: connection.serviceUrl,
|
|
@@ -151,13 +135,14 @@ export async function submitResetToLocalService(options) {
|
|
|
151
135
|
};
|
|
152
136
|
}
|
|
153
137
|
export async function createActionProposalInLocalService(options) {
|
|
154
|
-
const connection = await
|
|
138
|
+
const connection = await connectOrNull();
|
|
155
139
|
if (!connection)
|
|
156
140
|
return null;
|
|
157
141
|
const request = ActionProposalCreateRequestSchema.parse(options.request);
|
|
158
142
|
const resource = ActionProposalResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${LOCAL_SERVICE_ROUTES.actionProposals}`, {
|
|
159
143
|
method: "POST",
|
|
160
144
|
body: JSON.stringify(request),
|
|
145
|
+
headers: authHeaders(connection.authToken),
|
|
161
146
|
}));
|
|
162
147
|
return {
|
|
163
148
|
serviceUrl: connection.serviceUrl,
|
|
@@ -166,14 +151,15 @@ export async function createActionProposalInLocalService(options) {
|
|
|
166
151
|
}
|
|
167
152
|
export async function decideActionProposalInLocalService(options) {
|
|
168
153
|
const connection = options.serviceUrl
|
|
169
|
-
? { serviceUrl: options.serviceUrl }
|
|
170
|
-
: await
|
|
154
|
+
? { serviceUrl: options.serviceUrl, authToken: options.authToken ?? resolveLocalServiceAuthToken() }
|
|
155
|
+
: (await connectOrNull());
|
|
171
156
|
if (!connection)
|
|
172
157
|
return null;
|
|
173
158
|
const request = ActionProposalApprovalRequestSchema.parse(options.request);
|
|
174
159
|
const resource = ActionProposalResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${LOCAL_SERVICE_ROUTES.actionProposals}/${encodeURIComponent(options.proposalId)}/decision`, {
|
|
175
160
|
method: "POST",
|
|
176
161
|
body: JSON.stringify(request),
|
|
162
|
+
headers: authHeaders(connection.authToken ?? null),
|
|
177
163
|
}));
|
|
178
164
|
return {
|
|
179
165
|
serviceUrl: connection.serviceUrl,
|
|
@@ -187,7 +173,6 @@ export async function approveActionProposalInLocalService(options) {
|
|
|
187
173
|
if (proposal.resource.status !== "awaiting_approval")
|
|
188
174
|
return proposal;
|
|
189
175
|
const decided = await decideActionProposalInLocalService({
|
|
190
|
-
projectPath: options.projectPath,
|
|
191
176
|
proposalId: proposal.resource.proposal_id,
|
|
192
177
|
request: { approved: true },
|
|
193
178
|
serviceUrl: proposal.serviceUrl,
|
|
@@ -201,85 +186,88 @@ function isTerminalRunStatus(status) {
|
|
|
201
186
|
return status === "succeeded" || status === "failed" || status === "cancelled";
|
|
202
187
|
}
|
|
203
188
|
export async function getLocalCompileRun(options) {
|
|
204
|
-
return CompileRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}
|
|
189
|
+
return CompileRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/compile-runs/${encodeURIComponent(options.runId)}`, {
|
|
205
190
|
method: "GET",
|
|
206
191
|
timeoutMs: 2000,
|
|
192
|
+
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
207
193
|
}));
|
|
208
194
|
}
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
method: "GET",
|
|
195
|
+
/**
|
|
196
|
+
* Ask the local service to cancel a running compile run by id. Resolves
|
|
197
|
+
* with the typed cancel result on success and throws when the service
|
|
198
|
+
* returns 404 (unknown run id) or any non-2xx status.
|
|
199
|
+
*/
|
|
200
|
+
export async function cancelLocalCompileRun(options) {
|
|
201
|
+
const value = await fetchJson(`${options.serviceUrl}/v1/compile-runs/${encodeURIComponent(options.runId)}/cancel`, {
|
|
202
|
+
method: "POST",
|
|
218
203
|
timeoutMs: options.timeoutMs ?? 2000,
|
|
219
|
-
|
|
204
|
+
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
205
|
+
});
|
|
206
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
207
|
+
throw new Error("Local service returned an unexpected cancel response.");
|
|
208
|
+
}
|
|
209
|
+
const record = value;
|
|
210
|
+
const cancelled = record.cancelled === true;
|
|
211
|
+
const reason = typeof record.reason === "string" && record.reason.trim().length > 0
|
|
212
|
+
? record.reason.trim()
|
|
213
|
+
: undefined;
|
|
214
|
+
return reason ? { cancelled, reason } : { cancelled };
|
|
220
215
|
}
|
|
221
216
|
export async function waitForLocalCompileRun(options) {
|
|
222
|
-
|
|
217
|
+
// Exponential backoff: start at 250ms (responsive for short runs) and
|
|
218
|
+
// double up to 4s (don't hammer the local service for long compile
|
|
219
|
+
// runs). When the caller passes an explicit `pollMs`, honor it as a
|
|
220
|
+
// fixed interval to keep the previous opt-out path.
|
|
221
|
+
const explicit = options.pollMs;
|
|
222
|
+
let delay = explicit ?? 250;
|
|
223
223
|
while (true) {
|
|
224
224
|
const resource = await getLocalCompileRun({
|
|
225
225
|
serviceUrl: options.serviceUrl,
|
|
226
226
|
runId: options.runId,
|
|
227
|
+
authToken: options.authToken ?? null,
|
|
227
228
|
});
|
|
228
229
|
options.onUpdate?.(resource);
|
|
229
230
|
if (isTerminalRunStatus(resource.run.status))
|
|
230
231
|
return resource;
|
|
231
|
-
await new Promise((resolveWait) => setTimeout(resolveWait,
|
|
232
|
+
await new Promise((resolveWait) => setTimeout(resolveWait, delay));
|
|
233
|
+
if (explicit === undefined) {
|
|
234
|
+
delay = Math.min(delay * 2, 4000);
|
|
235
|
+
}
|
|
232
236
|
}
|
|
233
237
|
}
|
|
234
|
-
export async function
|
|
235
|
-
return
|
|
238
|
+
export async function getLocalVerifyRun(options) {
|
|
239
|
+
return VerifyRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/verify-runs/${encodeURIComponent(options.runId)}`, {
|
|
236
240
|
method: "GET",
|
|
237
241
|
timeoutMs: 2000,
|
|
242
|
+
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
238
243
|
}));
|
|
239
244
|
}
|
|
240
|
-
export async function
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}));
|
|
245
|
-
}
|
|
246
|
-
export async function waitForLocalTestRun(options) {
|
|
247
|
-
const pollMs = options.pollMs ?? 1000;
|
|
245
|
+
export async function waitForLocalVerifyRun(options) {
|
|
246
|
+
// Same exponential backoff as `waitForLocalCompileRun`.
|
|
247
|
+
const explicit = options.pollMs;
|
|
248
|
+
let delay = explicit ?? 250;
|
|
248
249
|
while (true) {
|
|
249
|
-
const resource = await
|
|
250
|
+
const resource = await getLocalVerifyRun({
|
|
250
251
|
serviceUrl: options.serviceUrl,
|
|
251
252
|
runId: options.runId,
|
|
253
|
+
authToken: options.authToken ?? null,
|
|
252
254
|
});
|
|
253
255
|
options.onUpdate?.(resource);
|
|
254
256
|
if (isTerminalRunStatus(resource.status))
|
|
255
257
|
return resource;
|
|
256
|
-
await new Promise((resolveWait) => setTimeout(resolveWait,
|
|
258
|
+
await new Promise((resolveWait) => setTimeout(resolveWait, delay));
|
|
259
|
+
if (explicit === undefined) {
|
|
260
|
+
delay = Math.min(delay * 2, 4000);
|
|
261
|
+
}
|
|
257
262
|
}
|
|
258
263
|
}
|
|
259
264
|
export async function getLocalJobRun(options) {
|
|
260
|
-
return LocalJobRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}
|
|
265
|
+
return LocalJobRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/jobs/${encodeURIComponent(options.runId)}`, {
|
|
261
266
|
method: "GET",
|
|
262
267
|
timeoutMs: 2000,
|
|
268
|
+
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
263
269
|
}));
|
|
264
270
|
}
|
|
265
|
-
export async function listLocalJobRuns(options) {
|
|
266
|
-
return LocalJobRunListResponseSchema.parse(await fetchJson(`${options.serviceUrl}${LOCAL_SERVICE_ROUTES.jobs}`, {
|
|
267
|
-
method: "GET",
|
|
268
|
-
timeoutMs: options.timeoutMs ?? 2000,
|
|
269
|
-
}));
|
|
270
|
-
}
|
|
271
|
-
export async function readLocalServiceRunSnapshot(options) {
|
|
272
|
-
const [jobs, compileRuns, testRuns] = await Promise.all([
|
|
273
|
-
listLocalJobRuns(options),
|
|
274
|
-
listLocalCompileRuns(options),
|
|
275
|
-
listLocalTestRuns(options),
|
|
276
|
-
]);
|
|
277
|
-
return {
|
|
278
|
-
jobs: jobs.jobs,
|
|
279
|
-
compileRuns: compileRuns.compile_runs,
|
|
280
|
-
testRuns: testRuns.test_runs,
|
|
281
|
-
};
|
|
282
|
-
}
|
|
283
271
|
export async function waitForLocalJobRun(options) {
|
|
284
272
|
const startedAt = Date.now();
|
|
285
273
|
const pollMs = options.pollMs ?? 1000;
|
|
@@ -287,6 +275,7 @@ export async function waitForLocalJobRun(options) {
|
|
|
287
275
|
const job = await getLocalJobRun({
|
|
288
276
|
serviceUrl: options.serviceUrl,
|
|
289
277
|
runId: options.runId,
|
|
278
|
+
authToken: options.authToken ?? null,
|
|
290
279
|
});
|
|
291
280
|
options.onUpdate?.(job);
|
|
292
281
|
if (isTerminalJobStatus(job.status))
|
|
@@ -306,13 +295,14 @@ function resultError(job, defaultMessage) {
|
|
|
306
295
|
return job.error ?? defaultMessage;
|
|
307
296
|
}
|
|
308
297
|
export async function submitReadinessCheckDraftToLocalService(options) {
|
|
309
|
-
const connection = await
|
|
298
|
+
const connection = await connectOrNull();
|
|
310
299
|
if (!connection)
|
|
311
300
|
return null;
|
|
312
301
|
const request = ReadinessCheckDraftCreateRequestSchema.parse(options.request);
|
|
313
|
-
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${
|
|
302
|
+
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "readinessCheckDrafts")}`, {
|
|
314
303
|
method: "POST",
|
|
315
304
|
body: JSON.stringify(request),
|
|
305
|
+
headers: authHeaders(connection.authToken),
|
|
316
306
|
}));
|
|
317
307
|
options.onSubmitted?.({
|
|
318
308
|
serviceUrl: connection.serviceUrl,
|
|
@@ -321,6 +311,7 @@ export async function submitReadinessCheckDraftToLocalService(options) {
|
|
|
321
311
|
const job = await waitForLocalJobRun({
|
|
322
312
|
serviceUrl: connection.serviceUrl,
|
|
323
313
|
runId: initialJob.run_id,
|
|
314
|
+
authToken: connection.authToken,
|
|
324
315
|
onUpdate: options.onUpdate,
|
|
325
316
|
});
|
|
326
317
|
if (job.status !== "succeeded") {
|
|
@@ -347,13 +338,14 @@ export async function submitReadinessCheckDraftToLocalService(options) {
|
|
|
347
338
|
};
|
|
348
339
|
}
|
|
349
340
|
export async function submitMethodAuthoringRunToLocalService(options) {
|
|
350
|
-
const connection = await
|
|
341
|
+
const connection = await connectOrNull();
|
|
351
342
|
if (!connection)
|
|
352
343
|
return null;
|
|
353
344
|
const request = MethodAuthoringCreateRequestSchema.parse(options.request);
|
|
354
|
-
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${
|
|
345
|
+
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "methodAuthoringRuns")}`, {
|
|
355
346
|
method: "POST",
|
|
356
347
|
body: JSON.stringify(request),
|
|
348
|
+
headers: authHeaders(connection.authToken),
|
|
357
349
|
}));
|
|
358
350
|
options.onSubmitted?.({
|
|
359
351
|
serviceUrl: connection.serviceUrl,
|
|
@@ -362,6 +354,7 @@ export async function submitMethodAuthoringRunToLocalService(options) {
|
|
|
362
354
|
const job = await waitForLocalJobRun({
|
|
363
355
|
serviceUrl: connection.serviceUrl,
|
|
364
356
|
runId: initialJob.run_id,
|
|
357
|
+
authToken: connection.authToken,
|
|
365
358
|
onUpdate: options.onUpdate,
|
|
366
359
|
});
|
|
367
360
|
if (job.status !== "succeeded") {
|
|
@@ -387,13 +380,12 @@ export async function submitMethodAuthoringRunToLocalService(options) {
|
|
|
387
380
|
result: parsed.data,
|
|
388
381
|
};
|
|
389
382
|
}
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
body: JSON.stringify(request),
|
|
383
|
+
/**
|
|
384
|
+
* Fetch the engine instance health/status.
|
|
385
|
+
*/
|
|
386
|
+
export async function getLocalServiceHealth(options) {
|
|
387
|
+
return LocalServiceHealthSchema.parse(await fetchJson(`${options.serviceUrl}${LOCAL_SERVICE_ROUTES.health}`, {
|
|
388
|
+
method: "GET",
|
|
389
|
+
timeoutMs: options.timeoutMs ?? 2000,
|
|
398
390
|
}));
|
|
399
391
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { listFilesRecursive } from "
|
|
2
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
3
3
|
import { compiledZoneAbsolutePath } from "./compiled-schema.js";
|
|
4
4
|
const SCAFFOLD_PLACEHOLDER_SNIPPETS = [
|
|
5
5
|
"Not yet compiled. Run `interf compile` to build the portable context.",
|