@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,367 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `interf compile <prep-id>` — start a compile run for a preparation.
|
|
3
|
+
*
|
|
4
|
+
* interf compile bristol
|
|
5
|
+
* interf compile bristol --quiet # only the locator on stdout (scripting)
|
|
6
|
+
* interf compile bristol --watch # stream events
|
|
7
|
+
*
|
|
8
|
+
* Requires an active connection. Hits POST /v1/preparations/<id>/compile-runs.
|
|
9
|
+
*/
|
|
1
10
|
import chalk from "chalk";
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
command: "compile",
|
|
14
|
-
describe: "Prepare files and write Portable Context agents can use",
|
|
15
|
-
builder: (yargs) => yargs.option("preparation", {
|
|
16
|
-
type: "string",
|
|
17
|
-
describe: "Preparation id to compile when this Source Folder has more than one Preparation",
|
|
18
|
-
}).option("max-attempts", {
|
|
19
|
-
type: "number",
|
|
20
|
-
describe: "Retry the prepare run and run saved readiness checks with the same Method until the Preparation is ready or reaches this total attempt limit",
|
|
21
|
-
}).option("max-loops", {
|
|
22
|
-
type: "number",
|
|
23
|
-
describe: "After retries fail, let Interf edit the Method and run saved readiness checks on new Method variations for this Preparation up to this loop limit",
|
|
24
|
-
}).option("keep-stage-shells", {
|
|
25
|
-
type: "boolean",
|
|
26
|
-
default: false,
|
|
27
|
-
describe: "Keep every executed stage shell under .interf/runtime/execution-shells for review instead of pruning successful shells",
|
|
28
|
-
}),
|
|
29
|
-
handler: async (argv) => {
|
|
30
|
-
await runCompileCommand(argv);
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
const defaultCompileCommandDeps = {
|
|
34
|
-
choosePreparationConfig,
|
|
35
|
-
confirm: p.confirm,
|
|
36
|
-
detectInterf,
|
|
37
|
-
resolveInteractiveCompileLoopOverrides,
|
|
38
|
-
};
|
|
39
|
-
function readHintedSourcePath(argv) {
|
|
40
|
-
return typeof argv.sourcePath === "string" && argv.sourcePath.trim().length > 0
|
|
41
|
-
? argv.sourcePath.trim()
|
|
42
|
-
: null;
|
|
43
|
-
}
|
|
44
|
-
function readRequestedPreparationName(argv) {
|
|
45
|
-
const raw = argv.preparation;
|
|
46
|
-
return typeof raw === "string" && raw.trim().length > 0
|
|
47
|
-
? raw.trim()
|
|
48
|
-
: null;
|
|
49
|
-
}
|
|
50
|
-
function shouldSkipCompileConfirm(argv) {
|
|
51
|
-
return argv.skipConfirm === true;
|
|
52
|
-
}
|
|
53
|
-
function shouldSkipPreparationBanner(argv) {
|
|
54
|
-
return argv.skipPreparationBanner === true;
|
|
55
|
-
}
|
|
56
|
-
function compileRunTests(options) {
|
|
57
|
-
const checks = options.compiledConfig?.checks ?? [];
|
|
58
|
-
if (checks.length === 0)
|
|
59
|
-
return false;
|
|
60
|
-
const configuredMaxAttempts = resolvePreparationCompileMaxAttempts(options.compiledConfig ?? { max_attempts: undefined }, options.maxAttemptsOverride);
|
|
61
|
-
const maxLoops = resolvePreparationCompileMaxLoops(options.compiledConfig ?? { max_loops: undefined }, options.maxLoopsOverride);
|
|
62
|
-
const maxAttempts = configuredMaxAttempts ?? (maxLoops != null ? 1 : null);
|
|
63
|
-
return maxAttempts != null;
|
|
11
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
12
|
+
function resolveConnection(args) {
|
|
13
|
+
const conn = readActiveConnection({
|
|
14
|
+
urlOverride: args.url,
|
|
15
|
+
authTokenOverride: args.token,
|
|
16
|
+
});
|
|
17
|
+
if (!conn) {
|
|
18
|
+
console.error(CONNECT_OR_ERROR_HINT);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
return { url: conn.url.replace(/\/+$/, ""), token: conn.auth_token };
|
|
64
22
|
}
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
const
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
compiledPath = detected.path;
|
|
81
|
-
sourcePath = resolveSourceControlPath(detected.path);
|
|
82
|
-
compiledConfig = loadCompiledPreparationConfig(detected.path)
|
|
83
|
-
?? sourcePreparationConfigFromInterfConfig(detected.config);
|
|
84
|
-
if (!skipConfirm && process.stdin.isTTY && process.stdout.isTTY) {
|
|
85
|
-
const confirmed = await helpers.confirm({
|
|
86
|
-
message: `Prepare files for Preparation "${detected.config.name}" now?`,
|
|
87
|
-
initialValue: true,
|
|
88
|
-
});
|
|
89
|
-
if (p.isCancel(confirmed) || !confirmed)
|
|
90
|
-
return null;
|
|
23
|
+
async function callJson(url, token, init = {}) {
|
|
24
|
+
const headers = new Headers(init.headers ?? {});
|
|
25
|
+
if (token)
|
|
26
|
+
headers.set("authorization", `Bearer ${token}`);
|
|
27
|
+
if (init.body && !headers.has("content-type"))
|
|
28
|
+
headers.set("content-type", "application/json");
|
|
29
|
+
const response = await fetch(url, { ...init, headers });
|
|
30
|
+
const raw = await response.text();
|
|
31
|
+
let body = null;
|
|
32
|
+
if (raw.length > 0) {
|
|
33
|
+
try {
|
|
34
|
+
body = JSON.parse(raw);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
body = null;
|
|
91
38
|
}
|
|
92
39
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
40
|
+
return { status: response.status, body, raw };
|
|
41
|
+
}
|
|
42
|
+
export const compileCommand = {
|
|
43
|
+
command: "compile <prep-id>",
|
|
44
|
+
describe: "Start a compile run for a preparation",
|
|
45
|
+
builder: (yargs) => yargs
|
|
46
|
+
.positional("prep-id", { type: "string", demandOption: true, describe: "Preparation id" })
|
|
47
|
+
.option("watch", { type: "boolean", default: false, describe: "Stream run events" })
|
|
48
|
+
.option("quiet", { type: "boolean", default: false, describe: "Print only the portable-context locator on success" })
|
|
49
|
+
.option("idempotency-key", { type: "string", describe: "Client-supplied dedupe key" })
|
|
50
|
+
.option("url", { type: "string", describe: "Override the active connection URL" })
|
|
51
|
+
.option("token", { type: "string", describe: "Override the active bearer token" }),
|
|
52
|
+
handler: async (args) => {
|
|
53
|
+
const { url, token } = resolveConnection(args);
|
|
54
|
+
// 0.15 hard-error: refuse to start a compile if the engine has zero
|
|
55
|
+
// connected agents — the compile pipeline can't run without one.
|
|
56
|
+
const instance = await callJson(`${url}/v1/instance`, token);
|
|
57
|
+
if (instance.body && instance.body.agent_count === 0) {
|
|
58
|
+
console.error(chalk.red(" Cannot compile — no agents available."));
|
|
59
|
+
console.error(" Install Claude Code, Codex, Gemini, or another agent CLI, or");
|
|
60
|
+
console.error(" register a custom CLI: `interf agents register <name> --command <cmd>`.");
|
|
61
|
+
process.exit(1);
|
|
117
62
|
}
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
63
|
+
const headers = {};
|
|
64
|
+
if (args.idempotencyKey)
|
|
65
|
+
headers["x-interf-idempotency-key"] = args.idempotencyKey;
|
|
66
|
+
const { status, body, raw } = await callJson(`${url}/v1/preparations/${encodeURIComponent(args.prepId)}/compile-runs`, token, { method: "POST", headers, body: JSON.stringify({}) });
|
|
67
|
+
if (status !== 201 && status !== 200 && status !== 202) {
|
|
68
|
+
console.error(chalk.red(`Failed to start compile run for ${args.prepId} (HTTP ${status}).`));
|
|
69
|
+
if (raw)
|
|
70
|
+
console.error(raw);
|
|
71
|
+
process.exit(1);
|
|
125
72
|
}
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
73
|
+
const run = body?.run;
|
|
74
|
+
const runId = run?.run_id ?? "(unknown run)";
|
|
75
|
+
const locator = run?.portable_context_path ?? "(no locator)";
|
|
76
|
+
if (args.quiet) {
|
|
77
|
+
console.log(locator);
|
|
78
|
+
return;
|
|
130
79
|
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
process.exitCode = 1;
|
|
140
|
-
console.log(chalk.red(error instanceof Error ? error.message : String(error)));
|
|
141
|
-
return null;
|
|
142
|
-
}
|
|
143
|
-
const interactiveOverrides = await helpers.resolveInteractiveCompileLoopOverrides({
|
|
144
|
-
compiledPath,
|
|
145
|
-
compiledConfig,
|
|
146
|
-
maxAttemptsOverride,
|
|
147
|
-
maxLoopsOverride,
|
|
148
|
-
});
|
|
149
|
-
if (!interactiveOverrides)
|
|
150
|
-
return null;
|
|
151
|
-
compiledConfig = interactiveOverrides.compiledConfig;
|
|
152
|
-
maxAttemptsOverride = interactiveOverrides.maxAttemptsOverride;
|
|
153
|
-
maxLoopsOverride = interactiveOverrides.maxLoopsOverride;
|
|
154
|
-
const testedDuringCompile = compileRunTests({
|
|
155
|
-
compiledConfig,
|
|
156
|
-
maxAttemptsOverride,
|
|
157
|
-
maxLoopsOverride,
|
|
158
|
-
});
|
|
159
|
-
if (compiledConfig) {
|
|
160
|
-
const submitted = await submitCompileRunToLocalService({
|
|
161
|
-
projectPath: sourcePath,
|
|
162
|
-
request: {
|
|
163
|
-
preparation: compiledConfig.name,
|
|
164
|
-
...(compiledConfig.method ? { method: compiledConfig.method } : {}),
|
|
165
|
-
...(maxAttemptsOverride != null ? { max_attempts: maxAttemptsOverride } : {}),
|
|
166
|
-
...(maxLoopsOverride != null ? { max_loops: maxLoopsOverride } : {}),
|
|
167
|
-
preserve_stage_shells: readStageShellRetentionMode(argv),
|
|
168
|
-
},
|
|
169
|
-
});
|
|
170
|
-
if (submitted) {
|
|
171
|
-
console.log(chalk.dim(` Visible in Interf: ${submitted.serviceUrl}/`));
|
|
172
|
-
let lastStatus = "";
|
|
173
|
-
let lastStage = "";
|
|
174
|
-
const completed = await waitForLocalCompileRun({
|
|
175
|
-
serviceUrl: submitted.serviceUrl,
|
|
176
|
-
runId: submitted.resource.run.run_id,
|
|
177
|
-
onUpdate(resource) {
|
|
178
|
-
const activeStage = resource.run.stages.find((stage) => stage.status === "running")
|
|
179
|
-
?? [...resource.run.stages].reverse().find((stage) => stage.status === "succeeded" || stage.status === "failed")
|
|
180
|
-
?? null;
|
|
181
|
-
const statusKey = `${resource.run.status}:${activeStage?.stage_id ?? ""}:${activeStage?.status ?? ""}`;
|
|
182
|
-
if (statusKey === `${lastStatus}:${lastStage}`)
|
|
183
|
-
return;
|
|
184
|
-
lastStatus = resource.run.status;
|
|
185
|
-
lastStage = `${activeStage?.stage_id ?? ""}:${activeStage?.status ?? ""}`;
|
|
186
|
-
if (activeStage) {
|
|
187
|
-
console.log(chalk.dim(` ${activeStage.stage_label ?? activeStage.stage_id}: ${activeStage.status}`));
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
console.log(chalk.dim(` Prepare run: ${resource.run.status}`));
|
|
191
|
-
}
|
|
192
|
-
},
|
|
193
|
-
});
|
|
194
|
-
if (completed.run.status !== "succeeded") {
|
|
195
|
-
process.exitCode = 1;
|
|
196
|
-
const failure = completed.run.stages.find((stage) => stage.status === "failed");
|
|
197
|
-
console.log(chalk.red(` Prepare run ${completed.run.status}.`));
|
|
198
|
-
if (failure?.failure)
|
|
199
|
-
console.log(chalk.red(` ${failure.failure}`));
|
|
200
|
-
return null;
|
|
201
|
-
}
|
|
202
|
-
console.log(chalk.green(" Portable Context ready."));
|
|
203
|
-
return {
|
|
204
|
-
compiledPath: completed.run.portable_context_path,
|
|
205
|
-
testedDuringCompile,
|
|
206
|
-
};
|
|
80
|
+
console.log();
|
|
81
|
+
console.log(` Run ${chalk.bold(runId)} ${chalk.dim(`(${run?.status ?? "started"})`)}`);
|
|
82
|
+
console.log(` Portable context: ${locator}`);
|
|
83
|
+
if (run?.status === "succeeded" || run?.finished_at) {
|
|
84
|
+
const prepResp = await callJson(`${url}/v1/preparations/${encodeURIComponent(args.prepId)}`, token);
|
|
85
|
+
const readiness = prepResp.body?.readiness?.status;
|
|
86
|
+
if (readiness)
|
|
87
|
+
console.log(` Readiness: ${readiness}`);
|
|
207
88
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
return null;
|
|
212
|
-
}
|
|
213
|
-
process.exitCode = 1;
|
|
214
|
-
console.log(chalk.red(" Interf could not resolve a saved Preparation for this prepare run."));
|
|
215
|
-
console.log(chalk.dim(" Run `interf list` to inspect saved Preparations, then rerun `interf compile --preparation <id>`."));
|
|
216
|
-
return null;
|
|
217
|
-
}
|
|
218
|
-
export async function resolveInteractiveCompileLoopOverrides(options) {
|
|
219
|
-
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
220
|
-
return {
|
|
221
|
-
compiledConfig: options.compiledConfig,
|
|
222
|
-
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
223
|
-
maxLoopsOverride: options.maxLoopsOverride,
|
|
224
|
-
};
|
|
225
|
-
}
|
|
226
|
-
if (options.maxAttemptsOverride != null || options.maxLoopsOverride != null) {
|
|
227
|
-
return {
|
|
228
|
-
compiledConfig: options.compiledConfig,
|
|
229
|
-
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
230
|
-
maxLoopsOverride: options.maxLoopsOverride,
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
const currentConfig = readInterfConfig(options.compiledPath);
|
|
234
|
-
const checks = options.compiledConfig?.checks.length
|
|
235
|
-
? options.compiledConfig.checks
|
|
236
|
-
: (currentConfig?.checks ?? []);
|
|
237
|
-
if (checks.length === 0) {
|
|
238
|
-
return {
|
|
239
|
-
compiledConfig: options.compiledConfig,
|
|
240
|
-
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
241
|
-
maxLoopsOverride: options.maxLoopsOverride,
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
const savedCompiledConfig = options.compiledConfig
|
|
245
|
-
?? (currentConfig
|
|
246
|
-
? (loadCompiledPreparationConfig(options.compiledPath)
|
|
247
|
-
?? sourcePreparationConfigFromInterfConfig(currentConfig))
|
|
248
|
-
: null);
|
|
249
|
-
if (!savedCompiledConfig) {
|
|
250
|
-
return {
|
|
251
|
-
compiledConfig: options.compiledConfig,
|
|
252
|
-
maxAttemptsOverride: options.maxAttemptsOverride,
|
|
253
|
-
maxLoopsOverride: options.maxLoopsOverride,
|
|
254
|
-
};
|
|
255
|
-
}
|
|
256
|
-
const hasSavedPolicy = typeof savedCompiledConfig.max_attempts === "number" ||
|
|
257
|
-
typeof savedCompiledConfig.max_loops === "number";
|
|
258
|
-
if (!hasSavedPolicy) {
|
|
259
|
-
const overrideSelection = await promptCompileLoopSelection({
|
|
260
|
-
hasChecks: true,
|
|
261
|
-
initialMaxAttempts: savedCompiledConfig.max_attempts,
|
|
262
|
-
initialMaxLoops: savedCompiledConfig.max_loops,
|
|
263
|
-
intro: [
|
|
264
|
-
`Method: ${resolveMethodId(savedCompiledConfig, resolveMethodId(currentConfig))}`,
|
|
265
|
-
"This selection applies to this prepare run only. It does not change the saved Preparation.",
|
|
266
|
-
],
|
|
267
|
-
message: "How should this prepare run work?",
|
|
268
|
-
});
|
|
269
|
-
if (overrideSelection === null)
|
|
270
|
-
return null;
|
|
271
|
-
return {
|
|
272
|
-
compiledConfig: {
|
|
273
|
-
...savedCompiledConfig,
|
|
274
|
-
max_attempts: undefined,
|
|
275
|
-
max_loops: undefined,
|
|
276
|
-
},
|
|
277
|
-
maxAttemptsOverride: overrideSelection.max_attempts ?? null,
|
|
278
|
-
maxLoopsOverride: overrideSelection.max_loops ?? null,
|
|
279
|
-
};
|
|
280
|
-
}
|
|
281
|
-
const savedMode = await p.select({
|
|
282
|
-
message: "Which prepare mode should this run use?",
|
|
283
|
-
options: [
|
|
284
|
-
{
|
|
285
|
-
value: "saved",
|
|
286
|
-
label: "Use saved prepare mode (Recommended)",
|
|
287
|
-
hint: `${savedCompiledConfig.max_loops ? "Self-improving" : savedCompiledConfig.max_attempts && savedCompiledConfig.max_attempts > 1 ? "Retry" : "Single attempt"} · ${formatCompileModeHint(savedCompiledConfig)}`,
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
value: "override",
|
|
291
|
-
label: "Change it for this run only",
|
|
292
|
-
hint: "Keep the saved Preparation unchanged",
|
|
293
|
-
},
|
|
294
|
-
],
|
|
295
|
-
});
|
|
296
|
-
if (p.isCancel(savedMode))
|
|
297
|
-
return null;
|
|
298
|
-
if (savedMode === "saved") {
|
|
299
|
-
return {
|
|
300
|
-
compiledConfig: savedCompiledConfig,
|
|
301
|
-
maxAttemptsOverride: null,
|
|
302
|
-
maxLoopsOverride: null,
|
|
303
|
-
};
|
|
304
|
-
}
|
|
305
|
-
const selection = await promptCompileLoopSelection({
|
|
306
|
-
hasChecks: true,
|
|
307
|
-
initialMaxAttempts: savedCompiledConfig.max_attempts,
|
|
308
|
-
initialMaxLoops: savedCompiledConfig.max_loops,
|
|
309
|
-
intro: [
|
|
310
|
-
`Method: ${resolveMethodId(savedCompiledConfig, resolveMethodId(currentConfig))}`,
|
|
311
|
-
"This applies to this prepare run only. It does not change the saved Preparation.",
|
|
312
|
-
],
|
|
313
|
-
message: "Override the prepare mode for this run",
|
|
314
|
-
});
|
|
315
|
-
if (selection === null)
|
|
316
|
-
return null;
|
|
317
|
-
return {
|
|
318
|
-
...savedCompiledConfig,
|
|
319
|
-
compiledConfig: {
|
|
320
|
-
...savedCompiledConfig,
|
|
321
|
-
max_attempts: undefined,
|
|
322
|
-
max_loops: undefined,
|
|
323
|
-
},
|
|
324
|
-
maxAttemptsOverride: selection.max_attempts ?? null,
|
|
325
|
-
maxLoopsOverride: selection.max_loops ?? null,
|
|
326
|
-
};
|
|
327
|
-
}
|
|
328
|
-
function formatCompileModeHint(compiledConfig) {
|
|
329
|
-
if (typeof compiledConfig.max_loops === "number" && compiledConfig.max_loops > 0) {
|
|
330
|
-
const attempts = compiledConfig.max_attempts ?? 1;
|
|
331
|
-
return `${attempts} attempt${attempts === 1 ? "" : "s"} per variation, ${compiledConfig.max_loops} loop${compiledConfig.max_loops === 1 ? "" : "s"}`;
|
|
332
|
-
}
|
|
333
|
-
if (typeof compiledConfig.max_attempts === "number" && compiledConfig.max_attempts > 1) {
|
|
334
|
-
return `${compiledConfig.max_attempts} attempts`;
|
|
335
|
-
}
|
|
336
|
-
return "1 attempt";
|
|
337
|
-
}
|
|
338
|
-
function readCompileMaxAttemptsOverride(argv) {
|
|
339
|
-
const raw = argv["max-attempts"] ??
|
|
340
|
-
argv.maxAttempts ??
|
|
341
|
-
argv["max-retries"] ??
|
|
342
|
-
argv.maxRetries;
|
|
343
|
-
if (raw == null)
|
|
344
|
-
return null;
|
|
345
|
-
const parsed = Number.parseInt(String(raw), 10);
|
|
346
|
-
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 5) {
|
|
347
|
-
throw new Error("`--max-attempts` must be a whole number from 1 to 5.");
|
|
348
|
-
}
|
|
349
|
-
return parsed;
|
|
350
|
-
}
|
|
351
|
-
function readStageShellRetentionMode(argv) {
|
|
352
|
-
const enabled = argv["keep-stage-shells"] ??
|
|
353
|
-
argv.keepStageShells ??
|
|
354
|
-
false;
|
|
355
|
-
return enabled ? "always" : "on-failure";
|
|
356
|
-
}
|
|
357
|
-
function readCompileMaxLoopsOverride(argv) {
|
|
358
|
-
const raw = argv["max-loops"] ??
|
|
359
|
-
argv.maxLoops;
|
|
360
|
-
if (raw == null)
|
|
361
|
-
return null;
|
|
362
|
-
const parsed = Number.parseInt(String(raw), 10);
|
|
363
|
-
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 3) {
|
|
364
|
-
throw new Error("`--max-loops` must be a whole number from 1 to 3.");
|
|
365
|
-
}
|
|
366
|
-
return parsed;
|
|
367
|
-
}
|
|
89
|
+
console.log();
|
|
90
|
+
},
|
|
91
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
|
-
import { agents, userConfig } from "../../packages/agents/index.js";
|
|
2
|
+
import { agents, userConfig } from "../../packages/engine/agents/index.js";
|
|
3
3
|
function iconFor(status) {
|
|
4
4
|
if (status === "pass")
|
|
5
5
|
return chalk.green("✓");
|
|
@@ -97,7 +97,7 @@ export const doctorCommand = {
|
|
|
97
97
|
id: "live",
|
|
98
98
|
label: "Live executor preflight",
|
|
99
99
|
status: "skipped",
|
|
100
|
-
message: "Skipped. Run `interf doctor --live` to exercise the real local agent before drafting readiness checks, Method authoring, a readiness check, or a
|
|
100
|
+
message: "Skipped. Run `interf doctor --live` to exercise the real local agent before drafting readiness checks, Method authoring, a readiness check, or a compile run.",
|
|
101
101
|
});
|
|
102
102
|
}
|
|
103
103
|
const ok = checks.every((check) => check.status !== "fail");
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `interf login` — set the active connection record.
|
|
3
|
+
*
|
|
4
|
+
* interf login --url <url> [--token <token>]
|
|
5
|
+
*
|
|
6
|
+
* Writes `~/.interf/connection.json` so subsequent CLI commands target the
|
|
7
|
+
* remote (or alternate local) URL. There is no remote backend in 0.13 — this
|
|
8
|
+
* is the on-disk config layer that the cloud product will consume. Equivalent
|
|
9
|
+
* to running `interf web` (which writes a local connection record on
|
|
10
|
+
* startup).
|
|
11
|
+
*/
|
|
12
|
+
import chalk from "chalk";
|
|
13
|
+
import { ConnectionRecordSchema, writeConnection, } from "../../packages/engine/connection-config.js";
|
|
14
|
+
export const loginCommand = {
|
|
15
|
+
command: "login",
|
|
16
|
+
describe: "Set the active Interf instance connection (URL + optional bearer token)",
|
|
17
|
+
builder: (yargs) => yargs
|
|
18
|
+
.option("url", {
|
|
19
|
+
type: "string",
|
|
20
|
+
demandOption: true,
|
|
21
|
+
describe: "Engine URL, e.g. https://api.interf.cloud or http://127.0.0.1:4873",
|
|
22
|
+
})
|
|
23
|
+
.option("token", {
|
|
24
|
+
type: "string",
|
|
25
|
+
describe: "Bearer token for non-loopback connections",
|
|
26
|
+
}),
|
|
27
|
+
handler: (args) => {
|
|
28
|
+
const url = args.url.trim();
|
|
29
|
+
const token = args.token?.trim();
|
|
30
|
+
const record = ConnectionRecordSchema.parse({
|
|
31
|
+
url,
|
|
32
|
+
auth_token: token && token.length > 0 ? token : null,
|
|
33
|
+
});
|
|
34
|
+
writeConnection(record);
|
|
35
|
+
console.log(chalk.green(`Connection saved.`));
|
|
36
|
+
console.log(chalk.dim(` url: ${record.url}`));
|
|
37
|
+
console.log(chalk.dim(` auth: ${record.auth_token ? "(token set)" : "(loopback / no token)"}`));
|
|
38
|
+
},
|
|
39
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `interf logout` — clear the active connection record.
|
|
3
|
+
*
|
|
4
|
+
* Removes `~/.interf/connection.json`. Subsequent CLI commands will exit
|
|
5
|
+
* non-zero with the connect-or-error hint until a new connection is set.
|
|
6
|
+
*/
|
|
7
|
+
import chalk from "chalk";
|
|
8
|
+
import { clearConnection } from "../../packages/engine/connection-config.js";
|
|
9
|
+
export const logoutCommand = {
|
|
10
|
+
command: "logout",
|
|
11
|
+
describe: "Clear the active Interf instance connection",
|
|
12
|
+
handler: () => {
|
|
13
|
+
clearConnection();
|
|
14
|
+
console.log(chalk.green("Connection cleared."));
|
|
15
|
+
},
|
|
16
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `interf mcp` — Model Context Protocol server.
|
|
3
|
+
*
|
|
4
|
+
* Wraps the local-service HTTP API as a typed agent surface so coding
|
|
5
|
+
* agents can interact with Interf the same way they call other MCP tools
|
|
6
|
+
* (instead of shelling out to the CLI).
|
|
7
|
+
*
|
|
8
|
+
* interf mcp # stdio transport (default)
|
|
9
|
+
* interf mcp --transport=http --port=4889 # advanced: HTTP transport
|
|
10
|
+
*
|
|
11
|
+
* The server reads `~/.interf/connection.json` (the same file every other
|
|
12
|
+
* client uses) and exits non-zero with the connect-or-error hint if no
|
|
13
|
+
* instance is reachable. Tools call straight through to the API; the
|
|
14
|
+
* server itself holds no state. The transport options are intentionally
|
|
15
|
+
* minimal — agents speaking MCP today are stdio-first.
|
|
16
|
+
*
|
|
17
|
+
* Tool list mirrors the API verbatim:
|
|
18
|
+
* prep_list GET /v1/preparations
|
|
19
|
+
* prep_create POST /v1/preparations
|
|
20
|
+
* prep_show GET /v1/preparations/{id}
|
|
21
|
+
* prep_set_method PATCH /v1/preparations/{id}
|
|
22
|
+
* prep_remove DELETE /v1/preparations/{id}
|
|
23
|
+
* prep_compile POST /v1/preparations/{id}/compile-runs
|
|
24
|
+
* prep_verify POST /v1/preparations/{id}/verify-runs
|
|
25
|
+
* method_list GET /v1/methods
|
|
26
|
+
* method_install POST /v1/methods (preparation-scoped via `prep_id`)
|
|
27
|
+
* method_draft POST /v1/preparations/{id}/method-authoring-runs
|
|
28
|
+
* method_improve POST /v1/preparations/{id}/method-improvement-runs
|
|
29
|
+
* runs_status GET /v1/runs/{run-id}
|
|
30
|
+
* runs_watch GET /v1/runs/{run-id}/events (snapshot, not SSE)
|
|
31
|
+
* runs_cancel POST /v1/runs/{run-id}/cancel
|
|
32
|
+
* runs_fetch GET /v1/runs/{run-id}/artifacts
|
|
33
|
+
* instance_status GET /v1/instance
|
|
34
|
+
*/
|
|
35
|
+
import type { CommandModule } from "yargs";
|
|
36
|
+
interface McpArgs {
|
|
37
|
+
transport?: "stdio" | "http";
|
|
38
|
+
url?: string;
|
|
39
|
+
token?: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const mcpCommand: CommandModule<unknown, McpArgs>;
|
|
42
|
+
export {};
|