@interf/compiler 0.13.0 → 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 +40 -0
- package/agent-skills/interf-actions/SKILL.md +51 -5
- package/agent-skills/interf-actions/references/cli.md +82 -82
- package/dist/cli/commands/agents.d.ts +2 -0
- package/dist/cli/commands/agents.js +213 -0
- package/dist/cli/commands/compile.js +10 -1
- package/dist/cli/commands/doctor.js +1 -1
- package/dist/cli/commands/login.js +1 -1
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +42 -0
- package/dist/cli/commands/mcp.js +239 -0
- package/dist/cli/commands/method.js +1 -1
- package/dist/cli/commands/prep.js +23 -5
- package/dist/cli/commands/reset.js +1 -1
- package/dist/cli/commands/runs.js +1 -1
- package/dist/cli/commands/status.js +1 -1
- package/dist/cli/commands/verify.d.ts +8 -0
- package/dist/cli/commands/{test.js → verify.js} +24 -18
- package/dist/cli/commands/web.js +71 -18
- package/dist/cli/commands/wizard.js +373 -126
- package/dist/cli/index.d.ts +4 -2
- package/dist/cli/index.js +7 -3
- package/dist/compiler-ui/404.html +1 -1
- package/dist/compiler-ui/__next.__PAGE__.txt +2 -2
- package/dist/compiler-ui/__next._full.txt +3 -3
- package/dist/compiler-ui/__next._head.txt +1 -1
- package/dist/compiler-ui/__next._index.txt +2 -2
- package/dist/compiler-ui/__next._tree.txt +2 -2
- package/dist/compiler-ui/_next/static/chunks/{17t-lulmyawg5.js → 0jipmpez3_ehh.js} +16 -16
- package/dist/compiler-ui/_next/static/chunks/{045gole2ojo3g.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/schema.d.ts +102 -8
- package/dist/packages/contracts/lib/schema.js +102 -2
- package/dist/packages/{local-service → engine}/action-definitions.js +8 -1
- package/dist/packages/{local-service → engine}/action-planner.d.ts +1 -1
- package/dist/packages/{local-service → engine}/action-planner.js +1 -1
- package/dist/packages/{agents → engine/agents}/index.d.ts +3 -0
- package/dist/packages/{agents → engine/agents}/index.js +3 -0
- package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.js +2 -2
- package/dist/packages/engine/agents/lib/detection.d.ts +13 -0
- package/dist/packages/{agents → engine/agents}/lib/detection.js +11 -0
- package/dist/packages/{agents → engine/agents}/lib/executors.d.ts +2 -2
- package/dist/packages/{agents → engine/agents}/lib/shells.d.ts +4 -4
- package/dist/packages/{agents → engine/agents}/lib/shells.js +8 -8
- package/dist/packages/{agents → engine/agents}/lib/user-config.js +2 -2
- package/dist/packages/engine/agents/registry.d.ts +91 -0
- package/dist/packages/engine/agents/registry.js +321 -0
- package/dist/packages/engine/agents/role-executors.d.ts +35 -0
- package/dist/packages/engine/agents/role-executors.js +88 -0
- package/dist/packages/engine/agents/role-router.d.ts +66 -0
- package/dist/packages/engine/agents/role-router.js +73 -0
- package/dist/packages/{local-service → engine}/client.d.ts +9 -9
- package/dist/packages/{local-service → engine}/client.js +11 -11
- package/dist/packages/{compiler → engine/compile}/artifact-counts.js +1 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.d.ts +12 -1
- package/dist/packages/{compiler → engine/compile}/compiled-pipeline.js +16 -6
- package/dist/packages/{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 +4 -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 +2 -2
- package/dist/packages/{compiler → engine/compile}/compiled-target.js +2 -2
- package/dist/packages/{compiler → engine/compile}/discovery.js +1 -1
- package/dist/packages/{compiler → engine/compile}/lib/schema.d.ts +4 -4
- package/dist/packages/{compiler → engine/compile}/lib/schema.js +2 -2
- package/dist/packages/{compiler → engine/compile}/method-runs.d.ts +3 -3
- package/dist/packages/{compiler → engine/compile}/method-runs.js +3 -3
- package/dist/packages/{compiler → engine/compile}/runtime-acceptance.js +17 -14
- 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/{compiler → engine/compile}/source-files.d.ts +1 -1
- package/dist/packages/{compiler → engine/compile}/source-files.js +3 -3
- package/dist/packages/{compiler → engine/compile}/state-health.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-io.js +2 -2
- package/dist/packages/{compiler → engine/compile}/state-view.js +2 -2
- 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/{execution → engine/execution}/lib/schema.d.ts +2 -22
- package/dist/packages/{execution → engine/execution}/lib/schema.js +2 -2
- package/dist/packages/{local-service → engine}/index.d.ts +4 -4
- package/dist/packages/{local-service → engine}/index.js +2 -2
- package/dist/packages/{local-service → engine}/lib/schema.d.ts +85 -209
- package/dist/packages/{local-service → engine}/lib/schema.js +58 -54
- package/dist/packages/{local-service → engine}/native-run-handlers.d.ts +7 -5
- package/dist/packages/{local-service → engine}/native-run-handlers.js +69 -25
- package/dist/packages/{local-service → engine}/preparation-store.d.ts +16 -4
- package/dist/packages/{local-service → engine}/preparation-store.js +48 -25
- package/dist/packages/{local-service → engine}/readiness-check-draft.d.ts +2 -2
- package/dist/packages/{local-service → engine}/routes.d.ts +30 -1
- package/dist/packages/{local-service → engine}/routes.js +32 -1
- package/dist/packages/{local-service → engine}/run-observability.d.ts +3 -3
- package/dist/packages/{local-service → engine}/run-observability.js +14 -13
- package/dist/packages/{local-service → engine}/runtime-event-applier.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-persistence.d.ts +6 -6
- package/dist/packages/{local-service → engine}/runtime-persistence.js +9 -9
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.d.ts +1 -1
- package/dist/packages/{local-service → engine}/runtime-proposal-helpers.js +5 -5
- package/dist/packages/{local-service → engine}/runtime-resource-builders.d.ts +6 -6
- package/dist/packages/{local-service → engine}/runtime-resource-builders.js +1 -1
- package/dist/packages/{local-service → engine}/runtime.d.ts +80 -49
- package/dist/packages/{local-service → engine}/runtime.js +177 -179
- package/dist/packages/{local-service → engine}/server.js +276 -14
- package/dist/packages/{testing → engine/verify}/lib/schema.d.ts +1 -1
- package/dist/packages/{testing → engine/verify}/lib/schema.js +1 -1
- package/dist/packages/{testing → engine/verify}/readiness-check-run.d.ts +6 -13
- package/dist/packages/{testing → engine/verify}/readiness-check-run.js +25 -81
- package/dist/packages/{testing → engine/verify}/test-paths.js +2 -2
- package/dist/packages/{testing → engine/verify}/test-sandbox.js +6 -6
- package/dist/packages/{testing → engine/verify}/test-specs.js +1 -1
- package/dist/packages/{testing → engine/verify}/test-targets.js +3 -3
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.d.ts +11 -3
- package/dist/packages/{method-authoring → methods/authoring}/method-authoring.js +68 -5
- 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 +15 -9
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/builtin-compiled-method.js +2 -2
- package/dist/packages/{method-package → methods/package}/context-interface.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/context-interface.js +3 -3
- package/dist/packages/{method-package → methods/package}/interf-method-package.js +3 -2
- package/dist/packages/{method-package → methods/package}/lib/package-root.js +2 -2
- package/dist/packages/{method-package → methods/package}/local-methods.d.ts +8 -2
- package/dist/packages/{method-package → methods/package}/local-methods.js +8 -7
- package/dist/packages/{method-package → methods/package}/method-definitions.d.ts +8 -2
- package/dist/packages/{method-package → methods/package}/method-definitions.js +5 -4
- package/dist/packages/{method-package → methods/package}/method-helpers.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-helpers.js +4 -4
- package/dist/packages/{method-package → methods/package}/method-review-paths.d.ts +1 -1
- package/dist/packages/{method-package → methods/package}/method-review-paths.js +1 -1
- package/dist/packages/{method-package → methods/package}/method-stage-runner.d.ts +4 -9
- package/dist/packages/{method-package → methods/package}/method-stage-runner.js +1 -29
- package/dist/packages/{method-package → methods/package}/user-methods.js +2 -2
- package/dist/packages/{project-model → project}/interf-bootstrap.d.ts +1 -1
- package/dist/packages/{project-model → project}/interf-bootstrap.js +1 -1
- package/dist/packages/{project-model → project}/interf-detect.js +4 -4
- package/dist/packages/{project-model → project}/interf-scaffold.js +7 -7
- package/dist/packages/{project-model → project}/lib/schema.d.ts +2 -2
- package/dist/packages/{project-model → project}/lib/schema.js +1 -1
- package/dist/packages/{project-model → project}/source-config.d.ts +1 -1
- package/dist/packages/{project-model → project}/source-config.js +7 -7
- package/dist/packages/{project-model → project}/source-folders.js +2 -2
- package/package.json +6 -5
- package/dist/cli/commands/test.d.ts +0 -9
- package/dist/packages/agents/lib/detection.d.ts +0 -7
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_buildManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → a3UiUF0DiMEbfWy_0gihg}/_clientMiddlewareManifest.js +0 -0
- /package/dist/compiler-ui/_next/static/{C6vVfy3aeYuIO3d2AoNvC → 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}/filesystem.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/filesystem.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/logger.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/naming.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/parse.js +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.d.ts +0 -0
- /package/dist/packages/{shared → contracts/utils}/path-guards.js +0 -0
- /package/dist/packages/{local-service → engine}/action-definitions.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/action-values.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/agents.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/args.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/chart-guidance.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/compiled-bootstrap.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/constants.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution-profile.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/execution.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/executors.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/logs.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/preflight.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/render.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/schema.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/status.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.d.ts +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/types.js +0 -0
- /package/dist/packages/{agents → engine/agents}/lib/user-config.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/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}/compiled-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/compiled-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/discovery.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/index.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/index.js +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}/reset.js +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-contracts.js +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-prompt.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/runtime-types.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-artifacts.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-health.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-io.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-paths.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/state-view.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/state.js +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-compiled.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.d.ts +0 -0
- /package/dist/packages/{compiler → engine/compile}/validate-helpers.js +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/connection-config.js +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/adapters.js +0 -0
- /package/dist/packages/{execution → engine/execution}/events.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/events.js +0 -0
- /package/dist/packages/{execution → engine/execution}/index.d.ts +0 -0
- /package/dist/packages/{execution → engine/execution}/index.js +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/instance-paths.js +0 -0
- /package/dist/packages/{local-service → engine}/readiness-check-draft.js +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/runtime-caches.js +0 -0
- /package/dist/packages/{local-service → engine}/runtime-event-applier.js +0 -0
- /package/dist/packages/{local-service → engine}/server.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.d.ts +0 -0
- /package/dist/packages/{local-service → engine}/service-registry.js +0 -0
- /package/dist/packages/{testing → 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-execution.js +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-sandbox.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-specs.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test-targets.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/{testing → engine/verify}/test.d.ts +0 -0
- /package/dist/packages/{testing → engine/verify}/test.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}/interf-method-package.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/lib/package-root.d.ts +0 -0
- /package/dist/packages/{method-package → methods/package}/user-methods.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.d.ts +0 -0
- /package/dist/packages/{project-model → project}/index.js +0 -0
- /package/dist/packages/{project-model → project}/interf-detect.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf-scaffold.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.d.ts +0 -0
- /package/dist/packages/{project-model → project}/interf.js +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.d.ts +0 -0
- /package/dist/packages/{project-model → project}/preparation-entries.js +0 -0
- /package/dist/packages/{project-model → project}/source-folders.d.ts +0 -0
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* Requires an active connection. Hits POST /v1/preparations/<id>/compile-runs.
|
|
9
9
|
*/
|
|
10
10
|
import chalk from "chalk";
|
|
11
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
11
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
12
12
|
function resolveConnection(args) {
|
|
13
13
|
const conn = readActiveConnection({
|
|
14
14
|
urlOverride: args.url,
|
|
@@ -51,6 +51,15 @@ export const compileCommand = {
|
|
|
51
51
|
.option("token", { type: "string", describe: "Override the active bearer token" }),
|
|
52
52
|
handler: async (args) => {
|
|
53
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);
|
|
62
|
+
}
|
|
54
63
|
const headers = {};
|
|
55
64
|
if (args.idempotencyKey)
|
|
56
65
|
headers["x-interf-idempotency-key"] = args.idempotencyKey;
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* startup).
|
|
11
11
|
*/
|
|
12
12
|
import chalk from "chalk";
|
|
13
|
-
import { ConnectionRecordSchema, writeConnection, } from "../../packages/
|
|
13
|
+
import { ConnectionRecordSchema, writeConnection, } from "../../packages/engine/connection-config.js";
|
|
14
14
|
export const loginCommand = {
|
|
15
15
|
command: "login",
|
|
16
16
|
describe: "Set the active Interf instance connection (URL + optional bearer token)",
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* non-zero with the connect-or-error hint until a new connection is set.
|
|
6
6
|
*/
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
-
import { clearConnection } from "../../packages/
|
|
8
|
+
import { clearConnection } from "../../packages/engine/connection-config.js";
|
|
9
9
|
export const logoutCommand = {
|
|
10
10
|
command: "logout",
|
|
11
11
|
describe: "Clear the active Interf instance connection",
|
|
@@ -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 {};
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
3
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
4
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection, } from "../../packages/engine/connection-config.js";
|
|
5
|
+
import { LOCAL_SERVICE_ROUTES, preparationResourcePath, preparationSubresourcePath, runResourcePath, runSubresourcePath, } from "../../packages/engine/routes.js";
|
|
6
|
+
function trimTrailingSlash(value) {
|
|
7
|
+
return value.replace(/\/+$/, "");
|
|
8
|
+
}
|
|
9
|
+
function resolveConnection(args) {
|
|
10
|
+
const conn = readActiveConnection({
|
|
11
|
+
urlOverride: args.url ?? null,
|
|
12
|
+
authTokenOverride: args.token ?? null,
|
|
13
|
+
});
|
|
14
|
+
if (!conn) {
|
|
15
|
+
process.stderr.write(`${CONNECT_OR_ERROR_HINT}\n`);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
return {
|
|
19
|
+
url: trimTrailingSlash(conn.url),
|
|
20
|
+
token: conn.auth_token ?? null,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
async function callApi(conn, path, init = {}) {
|
|
24
|
+
const headers = new Headers(init.headers ?? {});
|
|
25
|
+
if (conn.token)
|
|
26
|
+
headers.set("authorization", `Bearer ${conn.token}`);
|
|
27
|
+
if (init.body && !headers.has("content-type")) {
|
|
28
|
+
headers.set("content-type", "application/json");
|
|
29
|
+
}
|
|
30
|
+
const response = await fetch(`${conn.url}${path}`, { ...init, headers });
|
|
31
|
+
const raw = await response.text();
|
|
32
|
+
let body = null;
|
|
33
|
+
if (raw.length > 0) {
|
|
34
|
+
try {
|
|
35
|
+
body = JSON.parse(raw);
|
|
36
|
+
}
|
|
37
|
+
catch {
|
|
38
|
+
body = raw;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return { status: response.status, body, raw };
|
|
42
|
+
}
|
|
43
|
+
function toolResultJson(payload) {
|
|
44
|
+
const text = typeof payload === "string"
|
|
45
|
+
? payload
|
|
46
|
+
: JSON.stringify(payload, null, 2);
|
|
47
|
+
return {
|
|
48
|
+
content: [{ type: "text", text }],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function toolErrorJson(message, payload) {
|
|
52
|
+
const text = payload !== undefined
|
|
53
|
+
? `${message}\n${typeof payload === "string" ? payload : JSON.stringify(payload, null, 2)}`
|
|
54
|
+
: message;
|
|
55
|
+
return {
|
|
56
|
+
content: [{ type: "text", text }],
|
|
57
|
+
isError: true,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
async function callAndReturn(conn, path, init = {}) {
|
|
61
|
+
const response = await callApi(conn, path, init);
|
|
62
|
+
if (response.status >= 200 && response.status < 300) {
|
|
63
|
+
return toolResultJson(response.body ?? response.raw);
|
|
64
|
+
}
|
|
65
|
+
return toolErrorJson(`Local service responded with HTTP ${response.status}.`, response.body ?? response.raw);
|
|
66
|
+
}
|
|
67
|
+
function registerTools(server, conn) {
|
|
68
|
+
// ── Preparations ────────────────────────────────────────────────────────
|
|
69
|
+
server.registerTool("prep_list", {
|
|
70
|
+
title: "List preparations",
|
|
71
|
+
description: "List every Preparation registered on the connected Interf instance, "
|
|
72
|
+
+ "with source binding, Method id, and current readiness.",
|
|
73
|
+
inputSchema: {},
|
|
74
|
+
}, async () => callAndReturn(conn, LOCAL_SERVICE_ROUTES.preparations));
|
|
75
|
+
server.registerTool("prep_create", {
|
|
76
|
+
title: "Create a preparation",
|
|
77
|
+
description: "Create a new Preparation. The Preparation binds a Source Folder "
|
|
78
|
+
+ "to an optional Method and is the saved unit of work for compile runs.",
|
|
79
|
+
inputSchema: {
|
|
80
|
+
id: z.string().min(1).describe("Preparation id (kebab-case)."),
|
|
81
|
+
source_path: z.string().min(1).describe("Absolute or workspace-relative Source Folder path."),
|
|
82
|
+
method_id: z.string().min(1).optional().describe("Optional Method id to bind. Bind later with prep_set_method if omitted."),
|
|
83
|
+
about: z.string().min(1).optional().describe("Optional human-readable description."),
|
|
84
|
+
},
|
|
85
|
+
}, async (args) => callAndReturn(conn, LOCAL_SERVICE_ROUTES.preparations, {
|
|
86
|
+
method: "POST",
|
|
87
|
+
body: JSON.stringify({
|
|
88
|
+
id: args.id,
|
|
89
|
+
source: { kind: "local-folder", locator: args.source_path },
|
|
90
|
+
...(args.method_id ? { method_id: args.method_id } : {}),
|
|
91
|
+
...(args.about ? { about: args.about } : {}),
|
|
92
|
+
}),
|
|
93
|
+
}));
|
|
94
|
+
server.registerTool("prep_show", {
|
|
95
|
+
title: "Show one preparation",
|
|
96
|
+
description: "Return the full resource for one Preparation by id.",
|
|
97
|
+
inputSchema: {
|
|
98
|
+
id: z.string().min(1).describe("Preparation id."),
|
|
99
|
+
},
|
|
100
|
+
}, async (args) => callAndReturn(conn, preparationResourcePath(args.id)));
|
|
101
|
+
server.registerTool("prep_set_method", {
|
|
102
|
+
title: "Bind a Method to a preparation",
|
|
103
|
+
description: "Update the Method binding on a Preparation. Use this to swap "
|
|
104
|
+
+ "Methods between compile runs without rebuilding the Preparation.",
|
|
105
|
+
inputSchema: {
|
|
106
|
+
id: z.string().min(1).describe("Preparation id."),
|
|
107
|
+
method_id: z.string().min(1).describe("Method id to bind."),
|
|
108
|
+
},
|
|
109
|
+
}, async (args) => callAndReturn(conn, preparationResourcePath(args.id), {
|
|
110
|
+
method: "PATCH",
|
|
111
|
+
body: JSON.stringify({ method_id: args.method_id }),
|
|
112
|
+
}));
|
|
113
|
+
server.registerTool("prep_remove", {
|
|
114
|
+
title: "Remove a preparation",
|
|
115
|
+
description: "Delete a Preparation. Portable context is removed too.",
|
|
116
|
+
inputSchema: {
|
|
117
|
+
id: z.string().min(1).describe("Preparation id."),
|
|
118
|
+
},
|
|
119
|
+
}, async (args) => callAndReturn(conn, preparationResourcePath(args.id), {
|
|
120
|
+
method: "DELETE",
|
|
121
|
+
}));
|
|
122
|
+
// ── Compile + verify runs ──────────────────────────────────────────────
|
|
123
|
+
server.registerTool("prep_compile", {
|
|
124
|
+
title: "Start a compile run",
|
|
125
|
+
description: "Kick off a compile run for a Preparation. Returns the new run "
|
|
126
|
+
+ "resource immediately; use runs_status to poll progress and "
|
|
127
|
+
+ "runs_fetch when the run finishes.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
id: z.string().min(1).describe("Preparation id."),
|
|
130
|
+
},
|
|
131
|
+
}, async (args) => callAndReturn(conn, preparationSubresourcePath(args.id, "compileRuns"), { method: "POST", body: "{}" }));
|
|
132
|
+
server.registerTool("prep_verify", {
|
|
133
|
+
title: "Run readiness checks",
|
|
134
|
+
description: "Run the Preparation's readiness checks against the latest portable "
|
|
135
|
+
+ "context. Verify runs always judge against the compiled output in 0.15+.",
|
|
136
|
+
inputSchema: {
|
|
137
|
+
id: z.string().min(1).describe("Preparation id."),
|
|
138
|
+
},
|
|
139
|
+
}, async (args) => callAndReturn(conn, preparationSubresourcePath(args.id, "verifyRuns"), {
|
|
140
|
+
method: "POST",
|
|
141
|
+
body: JSON.stringify({}),
|
|
142
|
+
}));
|
|
143
|
+
// ── Methods ─────────────────────────────────────────────────────────────
|
|
144
|
+
server.registerTool("method_list", {
|
|
145
|
+
title: "List Methods",
|
|
146
|
+
description: "List every Method visible to the connected instance: workspace "
|
|
147
|
+
+ "drafts, the user library at ~/.interf/methods/, and bundled Methods.",
|
|
148
|
+
inputSchema: {},
|
|
149
|
+
}, async () => callAndReturn(conn, LOCAL_SERVICE_ROUTES.methods));
|
|
150
|
+
server.registerTool("method_draft", {
|
|
151
|
+
title: "Author a new Method draft",
|
|
152
|
+
description: "Run the Method-authoring agent for a Preparation. Produces a new "
|
|
153
|
+
+ "Method package draft under <workspace>/methods/<id>/.",
|
|
154
|
+
inputSchema: {
|
|
155
|
+
prep_id: z.string().min(1).describe("Preparation id."),
|
|
156
|
+
},
|
|
157
|
+
}, async (args) => callAndReturn(conn, preparationSubresourcePath(args.prep_id, "methodAuthoringRuns"), { method: "POST", body: "{}" }));
|
|
158
|
+
server.registerTool("method_improve", {
|
|
159
|
+
title: "Run Method improvement",
|
|
160
|
+
description: "Run the Method-improvement agent for a Preparation. Iterates on "
|
|
161
|
+
+ "the bound Method based on the latest readiness-check results.",
|
|
162
|
+
inputSchema: {
|
|
163
|
+
prep_id: z.string().min(1).describe("Preparation id."),
|
|
164
|
+
},
|
|
165
|
+
}, async (args) => callAndReturn(conn, preparationSubresourcePath(args.prep_id, "methodImprovementRuns"), { method: "POST", body: "{}" }));
|
|
166
|
+
// ── Runs ────────────────────────────────────────────────────────────────
|
|
167
|
+
server.registerTool("runs_status", {
|
|
168
|
+
title: "Get run status",
|
|
169
|
+
description: "Return the run record for one observable run.",
|
|
170
|
+
inputSchema: {
|
|
171
|
+
run_id: z.string().min(1).describe("Run id."),
|
|
172
|
+
},
|
|
173
|
+
}, async (args) => callAndReturn(conn, runResourcePath(args.run_id)));
|
|
174
|
+
server.registerTool("runs_watch", {
|
|
175
|
+
title: "Read run events",
|
|
176
|
+
description: "Read the events log for one run as a snapshot. Returns the same "
|
|
177
|
+
+ "stream the UI consumes via SSE; agents that need live progress "
|
|
178
|
+
+ "should poll runs_status until the run reaches a terminal state.",
|
|
179
|
+
inputSchema: {
|
|
180
|
+
run_id: z.string().min(1).describe("Run id."),
|
|
181
|
+
},
|
|
182
|
+
}, async (args) => callAndReturn(conn, runSubresourcePath(args.run_id, "events")));
|
|
183
|
+
server.registerTool("runs_cancel", {
|
|
184
|
+
title: "Cancel a run",
|
|
185
|
+
description: "Request cancellation of an in-flight run.",
|
|
186
|
+
inputSchema: {
|
|
187
|
+
run_id: z.string().min(1).describe("Run id."),
|
|
188
|
+
},
|
|
189
|
+
}, async (args) => callAndReturn(conn, runSubresourcePath(args.run_id, "cancel"), { method: "POST", body: "{}" }));
|
|
190
|
+
server.registerTool("runs_fetch", {
|
|
191
|
+
title: "Fetch run artifacts",
|
|
192
|
+
description: "Return the artifact manifest for a finished run (portable context, "
|
|
193
|
+
+ "proof records, logs, run-scoped audit trail).",
|
|
194
|
+
inputSchema: {
|
|
195
|
+
run_id: z.string().min(1).describe("Run id."),
|
|
196
|
+
},
|
|
197
|
+
}, async (args) => callAndReturn(conn, runSubresourcePath(args.run_id, "artifacts")));
|
|
198
|
+
// ── Instance ────────────────────────────────────────────────────────────
|
|
199
|
+
server.registerTool("instance_status", {
|
|
200
|
+
title: "Show instance status",
|
|
201
|
+
description: "Return the engine's instance resource: started_at, package "
|
|
202
|
+
+ "version, registered preparations, active runs, idle seconds.",
|
|
203
|
+
inputSchema: {},
|
|
204
|
+
}, async () => callAndReturn(conn, LOCAL_SERVICE_ROUTES.instance));
|
|
205
|
+
}
|
|
206
|
+
async function startStdioServer(args) {
|
|
207
|
+
const conn = resolveConnection(args);
|
|
208
|
+
const server = new McpServer({ name: "interf", version: "0.14.0" }, { capabilities: { tools: {} } });
|
|
209
|
+
registerTools(server, conn);
|
|
210
|
+
const transport = new StdioServerTransport();
|
|
211
|
+
await server.connect(transport);
|
|
212
|
+
}
|
|
213
|
+
export const mcpCommand = {
|
|
214
|
+
command: "mcp",
|
|
215
|
+
describe: "Run the Interf Model Context Protocol server (stdio by default).",
|
|
216
|
+
builder: (yargs) => yargs
|
|
217
|
+
.option("transport", {
|
|
218
|
+
type: "string",
|
|
219
|
+
choices: ["stdio", "http"],
|
|
220
|
+
default: "stdio",
|
|
221
|
+
describe: "Transport for the MCP server.",
|
|
222
|
+
})
|
|
223
|
+
.option("url", {
|
|
224
|
+
type: "string",
|
|
225
|
+
describe: "Override the active connection URL.",
|
|
226
|
+
})
|
|
227
|
+
.option("token", {
|
|
228
|
+
type: "string",
|
|
229
|
+
describe: "Override the active bearer token.",
|
|
230
|
+
}),
|
|
231
|
+
handler: async (args) => {
|
|
232
|
+
if (args.transport && args.transport !== "stdio") {
|
|
233
|
+
process.stderr.write("interf mcp: only the stdio transport is implemented today. "
|
|
234
|
+
+ "Open an issue if you need --transport=http.\n");
|
|
235
|
+
process.exit(2);
|
|
236
|
+
}
|
|
237
|
+
await startStdioServer(args);
|
|
238
|
+
},
|
|
239
|
+
};
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { resolve } from "node:path";
|
|
11
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
11
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
12
12
|
function resolveConnection(args) {
|
|
13
13
|
const conn = readActiveConnection({
|
|
14
14
|
urlOverride: args.url,
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
*/
|
|
13
13
|
import { resolve } from "node:path";
|
|
14
14
|
import chalk from "chalk";
|
|
15
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection, } from "../../packages/
|
|
16
|
-
import { preparationResourcePath } from "../../packages/
|
|
15
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection, } from "../../packages/engine/connection-config.js";
|
|
16
|
+
import { preparationResourcePath } from "../../packages/engine/routes.js";
|
|
17
17
|
function requireConnection(args) {
|
|
18
18
|
const conn = readActiveConnection({
|
|
19
19
|
urlOverride: args.url,
|
|
@@ -78,17 +78,17 @@ export const prepCommand = {
|
|
|
78
78
|
console.log(chalk.dim(` readiness: ${readiness}`));
|
|
79
79
|
}
|
|
80
80
|
})
|
|
81
|
-
.command("create <prep-id>", "Create a preparation", (y) => y
|
|
81
|
+
.command("create <prep-id>", "Create a preparation (method binding optional — set later if you don't have one yet)", (y) => y
|
|
82
82
|
.positional("prep-id", { type: "string", demandOption: true, describe: "Preparation id (lowercase, dash-separated)" })
|
|
83
83
|
.option("source", { type: "string", demandOption: true, describe: "Path to the Source Folder" })
|
|
84
|
-
.option("method", { type: "string",
|
|
84
|
+
.option("method", { type: "string", describe: "Method id (e.g. interf-default). Optional — bind later via `interf prep set-method`." })
|
|
85
85
|
.option("about", { type: "string", describe: "One-line description of the agent work" }), async (args) => {
|
|
86
86
|
const { url, token } = requireConnection(args);
|
|
87
87
|
const sourceAbs = resolve(process.cwd(), args.source);
|
|
88
88
|
const requestBody = {
|
|
89
89
|
id: args.prepId,
|
|
90
90
|
source: { kind: "local-folder", locator: sourceAbs },
|
|
91
|
-
method_id: args.method,
|
|
91
|
+
...(args.method ? { method_id: args.method } : {}),
|
|
92
92
|
about: args.about,
|
|
93
93
|
checks: [],
|
|
94
94
|
};
|
|
@@ -100,9 +100,27 @@ export const prepCommand = {
|
|
|
100
100
|
process.exit(1);
|
|
101
101
|
}
|
|
102
102
|
console.log(chalk.green(`Created preparation ${chalk.bold(args.prepId)}.`));
|
|
103
|
+
if (!args.method) {
|
|
104
|
+
console.log(chalk.dim(` no method bound yet — pick or draft one before compiling:`));
|
|
105
|
+
console.log(chalk.dim(` interf prep set-method ${args.prepId} <method-id>`));
|
|
106
|
+
console.log(chalk.dim(` interf method draft ${args.prepId}`));
|
|
107
|
+
}
|
|
103
108
|
if (body?.portable_context?.value) {
|
|
104
109
|
console.log(chalk.dim(` portable context (locator): ${body.portable_context.value}`));
|
|
105
110
|
}
|
|
111
|
+
})
|
|
112
|
+
.command("set-method <prep-id> <method-id>", "Bind a method to a preparation (or change which method it uses)", (y) => y
|
|
113
|
+
.positional("prep-id", { type: "string", demandOption: true, describe: "Preparation id" })
|
|
114
|
+
.positional("method-id", { type: "string", demandOption: true, describe: "Method id to bind" }), async (args) => {
|
|
115
|
+
const { url, token } = requireConnection(args);
|
|
116
|
+
const { status, raw } = await callJson(`${url}${preparationResourcePath(args.prepId)}`, token, { method: "PATCH", body: JSON.stringify({ method_id: args.methodId }) });
|
|
117
|
+
if (status !== 200) {
|
|
118
|
+
console.error(chalk.red(`Failed to set method (HTTP ${status}).`));
|
|
119
|
+
if (raw)
|
|
120
|
+
console.error(raw);
|
|
121
|
+
process.exit(1);
|
|
122
|
+
}
|
|
123
|
+
console.log(chalk.green(`Bound ${chalk.bold(args.methodId)} to ${chalk.bold(args.prepId)}.`));
|
|
106
124
|
})
|
|
107
125
|
.command("show <prep-id>", "Show a preparation's full record", (y) => y.positional("prep-id", { type: "string", demandOption: true, describe: "Preparation id" }), async (args) => {
|
|
108
126
|
const { url, token } = requireConnection(args);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* interf reset bristol --mode all # also clear method draft / runs
|
|
6
6
|
*/
|
|
7
7
|
import chalk from "chalk";
|
|
8
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
8
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
9
9
|
function resolveConnection(args) {
|
|
10
10
|
const conn = readActiveConnection({
|
|
11
11
|
urlOverride: args.url,
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import chalk from "chalk";
|
|
10
10
|
import { mkdirSync, writeFileSync } from "node:fs";
|
|
11
11
|
import { dirname, isAbsolute, resolve } from "node:path";
|
|
12
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
12
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
13
13
|
function resolveConnection(args) {
|
|
14
14
|
const conn = readActiveConnection({
|
|
15
15
|
urlOverride: args.url,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* `interf status` — print connection state + preparation summary.
|
|
3
3
|
*/
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
5
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
6
6
|
async function callJson(url, token) {
|
|
7
7
|
const headers = new Headers();
|
|
8
8
|
if (token)
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `interf
|
|
2
|
+
* `interf verify <prep-id>` — verify a preparation's claim-checks via a
|
|
3
|
+
* judge against the latest compiled portable context. Together with the
|
|
4
|
+
* method's structural checks (auto-run on every `interf compile`), this
|
|
5
|
+
* feeds the preparation's overall readiness state.
|
|
3
6
|
*
|
|
4
|
-
* interf
|
|
5
|
-
* interf test bristol --target source-files
|
|
6
|
-
* interf test bristol --target portable-context
|
|
7
|
-
* interf test bristol --target both
|
|
7
|
+
* interf verify bristol
|
|
8
8
|
*/
|
|
9
9
|
import chalk from "chalk";
|
|
10
|
-
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/
|
|
10
|
+
import { CONNECT_OR_ERROR_HINT, readActiveConnection } from "../../packages/engine/connection-config.js";
|
|
11
11
|
function resolveConnection(args) {
|
|
12
12
|
const conn = readActiveConnection({
|
|
13
13
|
urlOverride: args.url,
|
|
@@ -38,25 +38,31 @@ async function callJson(url, token, init = {}) {
|
|
|
38
38
|
}
|
|
39
39
|
return { status: response.status, body, raw };
|
|
40
40
|
}
|
|
41
|
-
export const
|
|
42
|
-
command: "
|
|
43
|
-
describe: "
|
|
41
|
+
export const verifyCommand = {
|
|
42
|
+
command: "verify <prep-id>",
|
|
43
|
+
describe: "Verify a preparation's claim-checks against its portable context",
|
|
44
44
|
builder: (yargs) => yargs
|
|
45
45
|
.positional("prep-id", { type: "string", demandOption: true, describe: "Preparation id" })
|
|
46
|
-
.option("target", {
|
|
47
|
-
type: "string",
|
|
48
|
-
choices: ["source-files", "portable-context", "both"],
|
|
49
|
-
default: "both",
|
|
50
|
-
describe: "Which surface to test against",
|
|
51
|
-
})
|
|
52
46
|
.option("url", { type: "string", describe: "Override the active connection URL" })
|
|
53
47
|
.option("token", { type: "string", describe: "Override the active bearer token" }),
|
|
54
48
|
handler: async (args) => {
|
|
55
49
|
const { url, token } = resolveConnection(args);
|
|
56
|
-
|
|
57
|
-
|
|
50
|
+
// 0.15 hard-error: refuse to start a verify run if the engine has
|
|
51
|
+
// zero connected agents — verifier-role stages can't run without
|
|
52
|
+
// one.
|
|
53
|
+
const instance = await callJson(`${url}/v1/instance`, token);
|
|
54
|
+
if (instance.body && instance.body.agent_count === 0) {
|
|
55
|
+
console.error(chalk.red(" Cannot verify — no agents available."));
|
|
56
|
+
console.error(" Install Claude Code, Codex, Gemini, or another agent CLI, or");
|
|
57
|
+
console.error(" register a custom CLI: `interf agents register <name> --command <cmd>`.");
|
|
58
|
+
process.exit(1);
|
|
59
|
+
}
|
|
60
|
+
// Verify the user's claims against the compiled portable context.
|
|
61
|
+
// The legacy "source-files" / "both" targets (file-as-is judging)
|
|
62
|
+
// are gone — claims are evaluated against the compiled output only.
|
|
63
|
+
const { status, body, raw } = await callJson(`${url}/v1/preparations/${encodeURIComponent(args.prepId)}/verify-runs`, token, { method: "POST", body: JSON.stringify({ mode: "compiled" }) });
|
|
58
64
|
if (status !== 201 && status !== 200) {
|
|
59
|
-
console.error(chalk.red(`Failed to start
|
|
65
|
+
console.error(chalk.red(`Failed to start verify run for ${args.prepId} (HTTP ${status}).`));
|
|
60
66
|
if (raw)
|
|
61
67
|
console.error(raw);
|
|
62
68
|
process.exit(1);
|
package/dist/cli/commands/web.js
CHANGED
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import chalk from "chalk";
|
|
13
13
|
import { readFileSync } from "node:fs";
|
|
14
|
-
import { LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, buildLocalServiceUrl, } from "../../packages/
|
|
15
|
-
import { startLocalService } from "../../packages/
|
|
16
|
-
import { createNativeLocalServiceRunHandlers } from "../../packages/
|
|
17
|
-
import { CONNECT_OR_ERROR_HINT, clearConnection, readActiveConnection, } from "../../packages/
|
|
18
|
-
import { serviceRegistryPath } from "../../packages/
|
|
14
|
+
import { LOCAL_SERVICE_DEFAULT_HOST, LOCAL_SERVICE_DEFAULT_PORT, buildLocalServiceUrl, } from "../../packages/engine/routes.js";
|
|
15
|
+
import { startLocalService } from "../../packages/engine/server.js";
|
|
16
|
+
import { createNativeLocalServiceRunHandlers } from "../../packages/engine/native-run-handlers.js";
|
|
17
|
+
import { CONNECT_OR_ERROR_HINT, clearConnection, readActiveConnection, } from "../../packages/engine/connection-config.js";
|
|
18
|
+
import { serviceRegistryPath } from "../../packages/engine/instance-paths.js";
|
|
19
19
|
function packageVersionFromManifest() {
|
|
20
20
|
try {
|
|
21
21
|
const url = new URL("../../../package.json", import.meta.url);
|
|
@@ -85,28 +85,81 @@ function findEnginePidByUrl(url) {
|
|
|
85
85
|
return null;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
+
function isPidAlive(pid) {
|
|
89
|
+
try {
|
|
90
|
+
// Signal 0 is a no-op probe — succeeds if the PID exists and we can
|
|
91
|
+
// signal it; throws ESRCH otherwise.
|
|
92
|
+
process.kill(pid, 0);
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
return false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Scan ~/.interf/services.json for engines whose PID is still alive.
|
|
101
|
+
* Used by `interf web stop` when ~/.interf/connection.json is missing
|
|
102
|
+
* — the registry tells us which engine processes are actually running
|
|
103
|
+
* regardless of which one the wizard last connected to.
|
|
104
|
+
*/
|
|
105
|
+
function listLiveEnginesFromRegistry() {
|
|
106
|
+
try {
|
|
107
|
+
const raw = readFileSync(serviceRegistryPath(), "utf8");
|
|
108
|
+
const parsed = JSON.parse(raw);
|
|
109
|
+
return (parsed.services ?? []).filter((entry) => typeof entry.pid === "number" && isPidAlive(entry.pid));
|
|
110
|
+
}
|
|
111
|
+
catch {
|
|
112
|
+
return [];
|
|
113
|
+
}
|
|
114
|
+
}
|
|
88
115
|
async function runWebStop(args) {
|
|
116
|
+
// Resolution order: explicit --url override → active connection.json
|
|
117
|
+
// → fall back to scanning services.json for any live engine. The
|
|
118
|
+
// last fallback recovers from the case where connection.json was
|
|
119
|
+
// cleared while an engine was still running (e.g. another `interf
|
|
120
|
+
// web` attempt failed mid-startup, or `interf logout` was run while
|
|
121
|
+
// the engine kept going).
|
|
89
122
|
const conn = readActiveConnection({
|
|
90
123
|
urlOverride: args.url,
|
|
91
124
|
authTokenOverride: args.token,
|
|
92
125
|
});
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
126
|
+
let urlToStop = conn ? conn.url.replace(/\/+$/, "") : null;
|
|
127
|
+
let pidToStop = urlToStop ? findEnginePidByUrl(urlToStop) : null;
|
|
128
|
+
if (!pidToStop) {
|
|
129
|
+
const liveEngines = listLiveEnginesFromRegistry();
|
|
130
|
+
if (liveEngines.length === 0) {
|
|
131
|
+
console.error("No live Interf engine to stop.");
|
|
132
|
+
console.error("Checked ~/.interf/connection.json and ~/.interf/services.json — neither pointed at a running process.");
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
if (liveEngines.length > 1 && !urlToStop) {
|
|
136
|
+
console.error(`Multiple live Interf engines registered. Pick one with --url:`);
|
|
137
|
+
for (const entry of liveEngines) {
|
|
138
|
+
console.error(` ${entry.url} (pid ${entry.pid})`);
|
|
139
|
+
}
|
|
140
|
+
process.exit(1);
|
|
141
|
+
}
|
|
142
|
+
const target = urlToStop
|
|
143
|
+
? liveEngines.find((entry) => entry.url === urlToStop)
|
|
144
|
+
: liveEngines[0];
|
|
145
|
+
if (!target) {
|
|
146
|
+
console.error(`No live engine matches ${urlToStop ?? "the active connection"} in services.json.`);
|
|
147
|
+
process.exit(1);
|
|
148
|
+
}
|
|
149
|
+
urlToStop = target.url;
|
|
150
|
+
pidToStop = target.pid;
|
|
151
|
+
if (!conn) {
|
|
152
|
+
console.log(chalk.dim(` No active connection.json — recovering engine pid ${pidToStop} from services.json.`));
|
|
153
|
+
}
|
|
102
154
|
}
|
|
103
155
|
try {
|
|
104
|
-
process.kill(
|
|
105
|
-
console.log(chalk.green(`Sent SIGTERM to engine pid ${
|
|
106
|
-
|
|
156
|
+
process.kill(pidToStop, "SIGTERM");
|
|
157
|
+
console.log(chalk.green(`Sent SIGTERM to engine pid ${pidToStop} (${urlToStop}).`));
|
|
158
|
+
if (conn)
|
|
159
|
+
clearConnection();
|
|
107
160
|
}
|
|
108
161
|
catch (error) {
|
|
109
|
-
console.error(`Failed to stop engine pid ${
|
|
162
|
+
console.error(`Failed to stop engine pid ${pidToStop}: ${error instanceof Error ? error.message : String(error)}`);
|
|
110
163
|
process.exit(1);
|
|
111
164
|
}
|
|
112
165
|
}
|