@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
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "
|
|
3
|
-
import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project
|
|
4
|
-
import { PreparationNameSchema, ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
5
|
-
import { ReadinessCheckRunSchema,
|
|
2
|
+
import { ArtifactRefSchema, CompileRunSchema, CompileRunStatusSchema, InterfRunEventSchema, ProofRecordSchema, RunObservabilitySchema, } from "../execution/lib/schema.js";
|
|
3
|
+
import { SourcePreparationConfigSchema, SourceReadinessCheckSchema, } from "../../project/lib/schema.js";
|
|
4
|
+
import { LocatorSchema, PreparationNameSchema, ReadinessStateSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, MethodIdSchema, } from "../../contracts/lib/schema.js";
|
|
5
|
+
import { ReadinessCheckRunSchema, } from "../verify/lib/schema.js";
|
|
6
6
|
const JsonObjectSchema = z.record(z.string(), z.unknown());
|
|
7
7
|
// ───────────────────────────────────────────────────────────────────────────
|
|
8
8
|
// 0.13 — preparation-first additions
|
|
@@ -12,11 +12,13 @@ export const SourceBindingSchema = z.object({
|
|
|
12
12
|
kind: z.enum(["local-folder"]),
|
|
13
13
|
locator: z.string().min(1),
|
|
14
14
|
}).strict();
|
|
15
|
-
/**
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Discriminated locator for an artifact returned by the API. Aliases the
|
|
17
|
+
* canonical `LocatorSchema` from contracts so all three kinds —
|
|
18
|
+
* `local-path`, `remote-url`, `api-served` — flow through the same
|
|
19
|
+
* resource-access pattern.
|
|
20
|
+
*/
|
|
21
|
+
export const ArtifactLocatorSchema = LocatorSchema;
|
|
20
22
|
/** Per-instance metadata from `GET /v1/instance` (replaces /v1/status). */
|
|
21
23
|
export const InstanceResourceSchema = z.object({
|
|
22
24
|
kind: z.literal("interf-instance"),
|
|
@@ -30,17 +32,34 @@ export const InstanceResourceSchema = z.object({
|
|
|
30
32
|
active_run_count: z.number().int().min(0),
|
|
31
33
|
idle_for_seconds: z.number().int().min(0),
|
|
32
34
|
auth_required: z.boolean(),
|
|
35
|
+
/**
|
|
36
|
+
* 0.16 — locator-pattern connection mode. `local` means the engine
|
|
37
|
+
* is bound to a loopback host the user's UI can target with OS-shell
|
|
38
|
+
* actions; `remote` means OS-open is unavailable and resources must
|
|
39
|
+
* be fetched via api-served / signed URLs.
|
|
40
|
+
*/
|
|
41
|
+
connection_kind: z.enum(["local", "remote"]).optional(),
|
|
33
42
|
}).strict();
|
|
34
43
|
/** Body of `POST /v1/preparations` — the 0.13 preparation create request. */
|
|
35
44
|
export const PreparationCreateRequestSchema = z.object({
|
|
36
45
|
id: PreparationNameSchema,
|
|
37
46
|
source: SourceBindingSchema,
|
|
38
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Method binding. Optional — a preparation can be created with no
|
|
49
|
+
* method bound, then have one selected (or drafted) later before the
|
|
50
|
+
* first compile. Null/missing means "method not chosen yet".
|
|
51
|
+
*/
|
|
52
|
+
method_id: MethodIdSchema.nullable().optional(),
|
|
39
53
|
about: z.string().min(1).optional(),
|
|
40
54
|
checks: z.array(SourceReadinessCheckSchema).default([]),
|
|
41
55
|
max_attempts: SourceCompiledMaxAttemptsSchema.optional(),
|
|
42
56
|
max_loops: SourceCompiledMaxLoopsSchema.optional(),
|
|
43
57
|
}).strict();
|
|
58
|
+
/** Body of `PATCH /v1/preparations/<id>` — update mutable preparation fields. */
|
|
59
|
+
export const PreparationUpdateRequestSchema = z.object({
|
|
60
|
+
method_id: MethodIdSchema.nullable().optional(),
|
|
61
|
+
about: z.string().nullable().optional(),
|
|
62
|
+
}).strict();
|
|
44
63
|
/** Body of `POST /v1/methods` — install a Method package by path. */
|
|
45
64
|
export const MethodInstallRequestSchema = z.object({
|
|
46
65
|
source_path: z.string().min(1),
|
|
@@ -105,21 +124,6 @@ export const ServiceRegistryEntrySchema = z.object({
|
|
|
105
124
|
export const ServiceRegistrySchema = z.object({
|
|
106
125
|
services: z.array(ServiceRegistryEntrySchema).default([]),
|
|
107
126
|
}).strict();
|
|
108
|
-
export const WorkspaceRegistrationRequestSchema = z.object({
|
|
109
|
-
control_path: z.string().min(1),
|
|
110
|
-
}).strict();
|
|
111
|
-
export const WorkspaceRegistrationResponseSchema = z.object({
|
|
112
|
-
workspace: ServiceRegistryWorkspaceSchema,
|
|
113
|
-
service: ServiceRegistryEntrySchema,
|
|
114
|
-
}).strict();
|
|
115
|
-
export const WorkspaceListResponseSchema = z.object({
|
|
116
|
-
workspaces: z.array(ServiceRegistryWorkspaceSchema),
|
|
117
|
-
}).strict();
|
|
118
|
-
export const WorkspaceDeregisterResponseSchema = z.object({
|
|
119
|
-
deregistered: z.boolean(),
|
|
120
|
-
control_path: z.string().min(1),
|
|
121
|
-
remaining_workspaces: z.number().int().min(0),
|
|
122
|
-
}).strict();
|
|
123
127
|
export const LocalServiceHealthSchema = z.object({
|
|
124
128
|
kind: z.literal("interf-local-service-health"),
|
|
125
129
|
version: z.literal(1),
|
|
@@ -197,6 +201,12 @@ export const MethodResourceSchema = z.object({
|
|
|
197
201
|
description: z.string().min(1).optional(),
|
|
198
202
|
contract_type: z.string().min(1),
|
|
199
203
|
skill_dir: z.string().min(1),
|
|
204
|
+
/**
|
|
205
|
+
* 0.15 — role hint Methods declare per stage. Defaults to
|
|
206
|
+
* `general` at the runtime layer; the wire shape mirrors that
|
|
207
|
+
* default so older /v1/methods clients always see a string.
|
|
208
|
+
*/
|
|
209
|
+
role: z.string().min(1).default("general"),
|
|
200
210
|
reads: z.array(z.string().min(1)).default([]),
|
|
201
211
|
writes: z.array(z.string().min(1)).default([]),
|
|
202
212
|
acceptance: z.record(z.string(), z.unknown()).optional(),
|
|
@@ -313,24 +323,6 @@ export const PreparationSetupResultSchema = z.object({
|
|
|
313
323
|
submitted_run_id: z.string().min(1).nullable().optional(),
|
|
314
324
|
submitted_run_type: z.literal("compile-run").nullable().optional(),
|
|
315
325
|
}).strict();
|
|
316
|
-
export const WorkspaceBootstrapCreateRequestSchema = z.object({
|
|
317
|
-
source_folder: z.object({
|
|
318
|
-
path: z.string().min(1),
|
|
319
|
-
}).strict().optional(),
|
|
320
|
-
seed_default_method: z.boolean().default(true),
|
|
321
|
-
}).strict();
|
|
322
|
-
export const WorkspaceBootstrapResultSchema = z.object({
|
|
323
|
-
kind: z.literal("interf-workspace-bootstrap-result"),
|
|
324
|
-
version: z.literal(1),
|
|
325
|
-
control_path: z.string().min(1),
|
|
326
|
-
config_path: z.string().min(1),
|
|
327
|
-
source_folder_path: z.string().min(1).nullable(),
|
|
328
|
-
preparations: z.number().int().min(0),
|
|
329
|
-
seeded_default_method: z.boolean(),
|
|
330
|
-
default_method_id: MethodIdSchema.nullable(),
|
|
331
|
-
changed: z.boolean(),
|
|
332
|
-
message: z.string().min(1),
|
|
333
|
-
}).strict();
|
|
334
326
|
export const MethodChangeCreateRequestSchema = z.discriminatedUnion("operation", [
|
|
335
327
|
z.object({
|
|
336
328
|
action_type: z.literal("method-change").optional(),
|
|
@@ -446,16 +438,23 @@ export const LocalJobRunResourceSchema = z.object({
|
|
|
446
438
|
result: z.record(z.string(), z.unknown()).nullable().optional(),
|
|
447
439
|
error: z.string().min(1).nullable().optional(),
|
|
448
440
|
}).strict();
|
|
449
|
-
export const
|
|
450
|
-
|
|
441
|
+
export const VerifyRunStatusSchema = RunStatusSchema;
|
|
442
|
+
/**
|
|
443
|
+
* 0.15 cleanup — `mode` was a 0.13 hold-over from when verify could
|
|
444
|
+
* judge against either the source-files baseline or the compiled
|
|
445
|
+
* portable context. 0.13.1 redirected every verify run to compiled-
|
|
446
|
+
* only, which made `mode` a vestigial field. We drop it here so the
|
|
447
|
+
* wire shape matches the runtime behavior. Older clients sending
|
|
448
|
+
* `mode` get it ignored by the strict-but-tolerant runtime parser
|
|
449
|
+
* upstream.
|
|
450
|
+
*/
|
|
451
|
+
export const VerifyRunCreateRequestSchema = z.object({
|
|
451
452
|
preparation: PreparationNameSchema,
|
|
452
|
-
mode: TestRunModeSchema.default("both"),
|
|
453
453
|
}).strict();
|
|
454
|
-
export const
|
|
454
|
+
export const VerifyRunResourceSchema = z.object({
|
|
455
455
|
run_id: z.string().min(1),
|
|
456
|
-
status:
|
|
456
|
+
status: VerifyRunStatusSchema,
|
|
457
457
|
preparation: PreparationNameSchema,
|
|
458
|
-
mode: TestRunModeSchema,
|
|
459
458
|
source_path: z.string().min(1),
|
|
460
459
|
portable_context_path: z.string().min(1).nullable(),
|
|
461
460
|
started_at: z.string().nullable().optional(),
|
|
@@ -556,7 +555,7 @@ const ActionProposalResourceBaseSchema = z.object({
|
|
|
556
555
|
proposed_by_executor: LocalJobAgentSchema.nullable().optional(),
|
|
557
556
|
approval: ActionProposalApprovalSchema.nullable().optional(),
|
|
558
557
|
submitted_run_id: z.string().min(1).nullable().optional(),
|
|
559
|
-
submitted_run_type: z.enum(["compile-run", "
|
|
558
|
+
submitted_run_type: z.enum(["compile-run", "verify-run", "job-run"]).nullable().optional(),
|
|
560
559
|
error: z.string().min(1).nullable().optional(),
|
|
561
560
|
}).strict();
|
|
562
561
|
export const ActionProposalResourceSchema = z.discriminatedUnion("action_type", [
|
|
@@ -570,7 +569,7 @@ export const ActionProposalResourceSchema = z.discriminatedUnion("action_type",
|
|
|
570
569
|
}).strict(),
|
|
571
570
|
ActionProposalResourceBaseSchema.extend({
|
|
572
571
|
action_type: z.literal("test"),
|
|
573
|
-
request:
|
|
572
|
+
request: VerifyRunCreateRequestSchema,
|
|
574
573
|
}).strict(),
|
|
575
574
|
ActionProposalResourceBaseSchema.extend({
|
|
576
575
|
action_type: z.literal("readiness-check-draft"),
|
|
@@ -630,9 +629,14 @@ export const LocalServiceDiscoverySchema = z.object({
|
|
|
630
629
|
method_authoring_runs: z.string().min(1),
|
|
631
630
|
method_improvement_runs: z.string().min(1),
|
|
632
631
|
compile_runs: z.string().min(1),
|
|
633
|
-
|
|
632
|
+
verify_runs: z.string().min(1),
|
|
634
633
|
reset: z.string().min(1),
|
|
635
634
|
executor: z.string().min(1),
|
|
635
|
+
/**
|
|
636
|
+
* 0.15 — connected agents primitive. Optional during the 0.14 →
|
|
637
|
+
* 0.15 rollout so older clients don't fail discovery validation.
|
|
638
|
+
*/
|
|
639
|
+
agents: z.string().min(1).optional(),
|
|
636
640
|
workspaces: z.string().min(1).optional(),
|
|
637
641
|
status: z.string().min(1).optional(),
|
|
638
642
|
}).strict(),
|
|
@@ -656,8 +660,8 @@ export const CompileRunListResponseSchema = z.object({
|
|
|
656
660
|
export const LocalJobRunListResponseSchema = z.object({
|
|
657
661
|
jobs: z.array(LocalJobRunResourceSchema),
|
|
658
662
|
}).strict();
|
|
659
|
-
export const
|
|
660
|
-
|
|
663
|
+
export const VerifyRunListResponseSchema = z.object({
|
|
664
|
+
verify_runs: z.array(VerifyRunResourceSchema),
|
|
661
665
|
}).strict();
|
|
662
666
|
export const RunObservabilityListResponseSchema = z.object({
|
|
663
667
|
runs: z.array(RunObservabilityResourceSchema),
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
1
|
+
import { type ResolveStageExecutor } from "./compile/method-runs.js";
|
|
2
|
+
import type { MethodExecutionProfile, MethodExecutor } from "./agents/lib/executors.js";
|
|
3
|
+
import type { SourcePreparationConfig } from "../project/lib/schema.js";
|
|
4
|
+
import type { StageShellRetentionMode } from "./compile/method-runs.js";
|
|
5
|
+
import { type RunEventSink } from "./execution/events.js";
|
|
5
6
|
import type { LocalServiceRunHandlers } from "./runtime.js";
|
|
6
7
|
export interface NativeLocalServiceRunHandlerOptions {
|
|
7
8
|
executor?: MethodExecutor;
|
|
@@ -10,6 +11,7 @@ export interface NativeLocalServiceRunHandlerOptions {
|
|
|
10
11
|
export declare function runConfiguredCompiledCompile(options: {
|
|
11
12
|
executor: MethodExecutor;
|
|
12
13
|
testExecutor?: MethodExecutor | null;
|
|
14
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
13
15
|
compiledPath: string;
|
|
14
16
|
sourcePath: string;
|
|
15
17
|
compiledConfig: SourcePreparationConfig | null;
|
|
@@ -20,4 +22,4 @@ export declare function runConfiguredCompiledCompile(options: {
|
|
|
20
22
|
runId?: string;
|
|
21
23
|
events?: RunEventSink;
|
|
22
24
|
}): Promise<boolean>;
|
|
23
|
-
export declare function createNativeLocalServiceRunHandlers(options?: NativeLocalServiceRunHandlerOptions): Pick<LocalServiceRunHandlers, "planActionProposal" | "createCompileRun" | "
|
|
25
|
+
export declare function createNativeLocalServiceRunHandlers(options?: NativeLocalServiceRunHandlerOptions): Pick<LocalServiceRunHandlers, "planActionProposal" | "createCompileRun" | "createVerifyRun" | "createReadinessCheckDraft" | "createMethodAuthoringRun">;
|
|
@@ -2,19 +2,22 @@ import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import chalk from "chalk";
|
|
5
|
-
import { compileCompiled, } from "
|
|
6
|
-
import { readInterfConfig } from "../project
|
|
7
|
-
import { resolveLocalExecutor, } from "
|
|
8
|
-
import { formatMethodExecutionProfile } from "
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
5
|
+
import { compileCompiled, } from "./compile/method-runs.js";
|
|
6
|
+
import { readInterfConfig } from "../project/interf.js";
|
|
7
|
+
import { resolveLocalExecutor, } from "./agents/lib/executors.js";
|
|
8
|
+
import { formatMethodExecutionProfile } from "./agents/lib/execution-profile.js";
|
|
9
|
+
import { loadAgentsRegistry } from "./agents/registry.js";
|
|
10
|
+
import { buildRoleExecutorBundle } from "./agents/role-executors.js";
|
|
11
|
+
import { clearCompiledRuntimeDerivedArtifacts, } from "./compile/reset.js";
|
|
12
|
+
import { formatActiveCompiledMethodStageStep, resolveRequiredCompiledMethodFromConfig, } from "../methods/package/method-definitions.js";
|
|
13
|
+
import { createRunEventId, createRunEventTimestamp, } from "./execution/events.js";
|
|
14
|
+
import { loadCompiledPreparationConfig, resolvePreparationCompileMaxAttempts, resolvePreparationCompileMaxLoops, } from "../project/source-config.js";
|
|
15
|
+
import { runMethodImprovementLoop } from "../methods/authoring/method-improvement.js";
|
|
16
|
+
import { stageExecutionShellsRoot, methodPackagePathForCompiled, } from "./compile/compiled-paths.js";
|
|
17
|
+
import { readCompiledSchemaFile } from "./compile/compiled-schema.js";
|
|
18
|
+
import { initializeCompiledRuntimeState } from "./compile/state.js";
|
|
19
|
+
import { readinessPassRate, runReadinessChecksForExecutor, runSavedPortableContextCheck, } from "./verify/readiness-check-run.js";
|
|
20
|
+
import { runMethodAuthoringDraft, } from "../methods/authoring/method-authoring.js";
|
|
18
21
|
import { draftReadinessChecks, } from "./readiness-check-draft.js";
|
|
19
22
|
import { planActionProposalWithExecutor, } from "./action-planner.js";
|
|
20
23
|
import { ActionProposalPlanSchema, } from "./lib/schema.js";
|
|
@@ -46,6 +49,7 @@ async function compileCompiledWithReporter(executor, compiledPath, options = {})
|
|
|
46
49
|
};
|
|
47
50
|
const result = await compileCompiled({
|
|
48
51
|
executor,
|
|
52
|
+
resolveStageExecutor: options.resolveStageExecutor,
|
|
49
53
|
compiledPath,
|
|
50
54
|
reporter,
|
|
51
55
|
preserveStageShells: options.preserveStageShells,
|
|
@@ -144,6 +148,7 @@ async function runMethodVariation(options) {
|
|
|
144
148
|
preserveStageShells: options.preserveStageShells,
|
|
145
149
|
runId: options.runId,
|
|
146
150
|
events: options.events,
|
|
151
|
+
resolveStageExecutor: options.resolveStageExecutor,
|
|
147
152
|
});
|
|
148
153
|
if (!result.ok) {
|
|
149
154
|
printCompileFailure(options.compiledPath, result.failedStage);
|
|
@@ -269,14 +274,14 @@ function printStageShellReviewHint(compiledPath, preserveStageShells, result) {
|
|
|
269
274
|
function printPostCompileNextStep(options) {
|
|
270
275
|
console.log(chalk.dim(` Portable Context: ${options.compiledPath}`));
|
|
271
276
|
if (options.checks === 0) {
|
|
272
|
-
console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf
|
|
277
|
+
console.log(chalk.dim(" Next: run `interf` to add readiness checks, then `interf verify`."));
|
|
273
278
|
return;
|
|
274
279
|
}
|
|
275
280
|
if (options.testedDuringCompile) {
|
|
276
|
-
console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf
|
|
281
|
+
console.log(chalk.dim(" Next: inspect the Portable Context agents will use, or run `interf verify` if you also want readiness evidence for source files and Portable Context."));
|
|
277
282
|
return;
|
|
278
283
|
}
|
|
279
|
-
console.log(chalk.dim(" Next: run `interf
|
|
284
|
+
console.log(chalk.dim(" Next: run `interf verify` to collect readiness evidence for source files and Portable Context."));
|
|
280
285
|
}
|
|
281
286
|
function formatVariationReadinessSummary(summary) {
|
|
282
287
|
return `${summary.passed_questions}/${summary.total_questions}`;
|
|
@@ -329,6 +334,7 @@ export async function runConfiguredCompiledCompile(options) {
|
|
|
329
334
|
preserveStageShells,
|
|
330
335
|
runId: options.runId,
|
|
331
336
|
events: options.events,
|
|
337
|
+
resolveStageExecutor: options.resolveStageExecutor,
|
|
332
338
|
});
|
|
333
339
|
if (!result.ok) {
|
|
334
340
|
process.exitCode = 1;
|
|
@@ -377,6 +383,7 @@ export async function runConfiguredCompiledCompile(options) {
|
|
|
377
383
|
const baseline = await runMethodVariation({
|
|
378
384
|
executor: options.executor,
|
|
379
385
|
testExecutor: options.testExecutor,
|
|
386
|
+
resolveStageExecutor: options.resolveStageExecutor,
|
|
380
387
|
compiledPath: options.compiledPath,
|
|
381
388
|
sourcePath: options.sourcePath,
|
|
382
389
|
compiledConfig,
|
|
@@ -436,6 +443,7 @@ export async function runConfiguredCompiledCompile(options) {
|
|
|
436
443
|
const variation = await runMethodVariation({
|
|
437
444
|
executor: options.executor,
|
|
438
445
|
testExecutor: options.testExecutor,
|
|
446
|
+
resolveStageExecutor: options.resolveStageExecutor,
|
|
439
447
|
compiledPath: options.compiledPath,
|
|
440
448
|
sourcePath: options.sourcePath,
|
|
441
449
|
compiledConfig,
|
|
@@ -528,9 +536,38 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
|
|
|
528
536
|
async createCompileRun(request, context) {
|
|
529
537
|
const executor = resolveHandlerExecutor(options.executor);
|
|
530
538
|
const testExecutor = resolveHandlerExecutor(options.testExecutor ?? options.executor);
|
|
539
|
+
const registry = loadAgentsRegistry();
|
|
540
|
+
const bundle = buildRoleExecutorBundle({
|
|
541
|
+
agents: registry.agents,
|
|
542
|
+
roleMap: registry.roleMap,
|
|
543
|
+
activeAgent: registry.activeAgent,
|
|
544
|
+
defaultExecutor: executor,
|
|
545
|
+
});
|
|
531
546
|
const ok = await runConfiguredCompiledCompile({
|
|
532
547
|
executor,
|
|
533
548
|
testExecutor,
|
|
549
|
+
resolveStageExecutor(stage) {
|
|
550
|
+
const role = stage.role && stage.role.trim().length > 0 ? stage.role : "general";
|
|
551
|
+
const { executor: stageExecutor, resolved } = bundle.resolveExecutorForRole(role);
|
|
552
|
+
// Best-effort audit trail — do not block the stage if event
|
|
553
|
+
// emission fails. Emits a `log.appended` system event so the
|
|
554
|
+
// run record shows which agent ran which stage.
|
|
555
|
+
try {
|
|
556
|
+
void context.events?.emit({
|
|
557
|
+
type: "log.appended",
|
|
558
|
+
event_id: createRunEventId("event"),
|
|
559
|
+
run_id: context.runId,
|
|
560
|
+
timestamp: createRunEventTimestamp(),
|
|
561
|
+
stage_id: stage.id,
|
|
562
|
+
stream: "system",
|
|
563
|
+
message: `Role ${role} → agent ${resolved.agent.name} (${resolved.source}).`,
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
catch {
|
|
567
|
+
/* best effort */
|
|
568
|
+
}
|
|
569
|
+
return stageExecutor;
|
|
570
|
+
},
|
|
534
571
|
compiledPath: context.compiledPath,
|
|
535
572
|
sourcePath: context.sourcePath,
|
|
536
573
|
compiledConfig: context.preparationConfig,
|
|
@@ -542,24 +579,31 @@ export function createNativeLocalServiceRunHandlers(options = {}) {
|
|
|
542
579
|
});
|
|
543
580
|
return { ok };
|
|
544
581
|
},
|
|
545
|
-
async
|
|
546
|
-
const
|
|
582
|
+
async createVerifyRun(request, context) {
|
|
583
|
+
const fallbackExecutor = resolveHandlerExecutor(options.testExecutor ?? options.executor);
|
|
584
|
+
const registry = loadAgentsRegistry();
|
|
585
|
+
const bundle = buildRoleExecutorBundle({
|
|
586
|
+
agents: registry.agents,
|
|
587
|
+
roleMap: registry.roleMap,
|
|
588
|
+
activeAgent: registry.activeAgent,
|
|
589
|
+
defaultExecutor: fallbackExecutor,
|
|
590
|
+
});
|
|
591
|
+
// Verify runs always use the `verifier` role. We resolve here
|
|
592
|
+
// for symmetry with compile runs — verify-run events are not
|
|
593
|
+
// streamed in 0.15, so the resolution shows up only in the
|
|
594
|
+
// executor field on the saved test run record.
|
|
595
|
+
const { executor } = bundle.resolveExecutorForRole("verifier");
|
|
547
596
|
const result = await runReadinessChecksForExecutor({
|
|
548
597
|
sourcePath: context.sourcePath,
|
|
549
598
|
preparationConfig: context.preparationConfig,
|
|
550
599
|
portableContextPath: context.compiledPath,
|
|
551
|
-
mode: request.mode,
|
|
552
600
|
executor,
|
|
553
601
|
});
|
|
554
|
-
|
|
555
|
-
const missingPortableContext = (request.mode === "compiled" || request.mode === "both") && !result.compiledOutcome;
|
|
556
|
-
if (missingSourceFiles || missingPortableContext) {
|
|
602
|
+
if (!result.compiledOutcome) {
|
|
557
603
|
return {
|
|
558
604
|
ok: false,
|
|
559
605
|
readiness_run: result.readinessRun,
|
|
560
|
-
error:
|
|
561
|
-
? "Portable Context is not ready for readiness checks."
|
|
562
|
-
: "Source files are not ready for readiness checks.",
|
|
606
|
+
error: "Portable Context is not ready for readiness checks.",
|
|
563
607
|
};
|
|
564
608
|
}
|
|
565
609
|
return {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Public callers reach this through the preparation-keyed HTTP routes.
|
|
21
21
|
*/
|
|
22
|
-
import type { SourcePreparationConfig } from "../project
|
|
22
|
+
import type { SourcePreparationConfig } from "../project/lib/schema.js";
|
|
23
23
|
import type { LocalServiceRuntime } from "./runtime.js";
|
|
24
24
|
export interface PreparationCreateInput {
|
|
25
25
|
id: string;
|
|
@@ -27,7 +27,8 @@ export interface PreparationCreateInput {
|
|
|
27
27
|
kind: "local-folder";
|
|
28
28
|
locator: string;
|
|
29
29
|
};
|
|
30
|
-
|
|
30
|
+
/** Method binding. Null/undefined means "not bound yet" — bind later via update. */
|
|
31
|
+
method_id?: string | null;
|
|
31
32
|
about?: string;
|
|
32
33
|
checks?: Array<{
|
|
33
34
|
question: string;
|
|
@@ -38,6 +39,10 @@ export interface PreparationCreateInput {
|
|
|
38
39
|
max_attempts?: number;
|
|
39
40
|
max_loops?: number;
|
|
40
41
|
}
|
|
42
|
+
export interface PreparationUpdateInput {
|
|
43
|
+
method_id?: string | null;
|
|
44
|
+
about?: string | null;
|
|
45
|
+
}
|
|
41
46
|
export interface StoredPreparation {
|
|
42
47
|
id: string;
|
|
43
48
|
prepDataDir: string;
|
|
@@ -45,7 +50,8 @@ export interface StoredPreparation {
|
|
|
45
50
|
kind: "local-folder";
|
|
46
51
|
locator: string;
|
|
47
52
|
};
|
|
48
|
-
|
|
53
|
+
/** Null when no method has been bound to this preparation yet. */
|
|
54
|
+
methodId: string | null;
|
|
49
55
|
about: string | null;
|
|
50
56
|
config: SourcePreparationConfig;
|
|
51
57
|
portableContextPath: string;
|
|
@@ -69,6 +75,12 @@ export declare function createStoredPreparation(runtime: LocalServiceRuntime, in
|
|
|
69
75
|
* was actually removed.
|
|
70
76
|
*/
|
|
71
77
|
export declare function deleteStoredPreparation(runtime: LocalServiceRuntime, prepId: string): boolean;
|
|
78
|
+
/**
|
|
79
|
+
* Update mutable fields on an existing preparation (method binding,
|
|
80
|
+
* about text). Returns the freshly-loaded record. Throws if the
|
|
81
|
+
* preparation does not exist.
|
|
82
|
+
*/
|
|
83
|
+
export declare function updateStoredPreparation(prepId: string, patch: PreparationUpdateInput): StoredPreparation;
|
|
72
84
|
/**
|
|
73
85
|
* Re-register every preparation directory with the runtime on startup so
|
|
74
86
|
* synthetic workspaces survive a `interf web` restart.
|
|
@@ -81,7 +93,7 @@ export declare function preparationWireShape(stored: StoredPreparation): {
|
|
|
81
93
|
kind: string;
|
|
82
94
|
locator: string;
|
|
83
95
|
};
|
|
84
|
-
method_id: string;
|
|
96
|
+
method_id: string | null;
|
|
85
97
|
about: string | null;
|
|
86
98
|
config_path: string;
|
|
87
99
|
portable_context: {
|
|
@@ -19,29 +19,14 @@
|
|
|
19
19
|
*
|
|
20
20
|
* Public callers reach this through the preparation-keyed HTTP routes.
|
|
21
21
|
*/
|
|
22
|
-
import { existsSync, mkdirSync, readdirSync,
|
|
22
|
+
import { existsSync, mkdirSync, readdirSync, rmSync, statSync, } from "node:fs";
|
|
23
23
|
import { join, resolve } from "node:path";
|
|
24
24
|
import { PreparationNameSchema, MethodIdSchema, } from "../contracts/lib/schema.js";
|
|
25
25
|
import { preparationDataDir, preparationsRoot, } from "./instance-paths.js";
|
|
26
|
-
import { saveSourceFolderConfig, loadSourceFolderConfig, } from "../project
|
|
26
|
+
import { saveSourceFolderConfig, loadSourceFolderConfig, } from "../project/source-config.js";
|
|
27
27
|
function ensurePreparationsRoot() {
|
|
28
28
|
mkdirSync(preparationsRoot(), { recursive: true });
|
|
29
29
|
}
|
|
30
|
-
function readSourceFolderBindingFromInterfJson(prepDataDir) {
|
|
31
|
-
const filePath = join(prepDataDir, "interf.json");
|
|
32
|
-
if (!existsSync(filePath))
|
|
33
|
-
return null;
|
|
34
|
-
try {
|
|
35
|
-
const raw = JSON.parse(readFileSync(filePath, "utf8"));
|
|
36
|
-
const sourceFolder = raw.source_folder;
|
|
37
|
-
if (!sourceFolder?.path)
|
|
38
|
-
return null;
|
|
39
|
-
return { path: sourceFolder.path, about: sourceFolder.about ?? null };
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
30
|
function loadStoredPreparation(prepId) {
|
|
46
31
|
const prepDataDir = preparationDataDir(prepId);
|
|
47
32
|
if (!existsSync(prepDataDir) || !statSync(prepDataDir).isDirectory())
|
|
@@ -52,15 +37,15 @@ function loadStoredPreparation(prepId) {
|
|
|
52
37
|
const preparation = config.preparations?.find((p) => p.name === prepId);
|
|
53
38
|
if (!preparation)
|
|
54
39
|
return null;
|
|
55
|
-
const
|
|
56
|
-
if (!
|
|
40
|
+
const sourceFolderPath = config.source_folder?.path;
|
|
41
|
+
if (!sourceFolderPath)
|
|
57
42
|
return null;
|
|
58
43
|
return {
|
|
59
44
|
id: prepId,
|
|
60
45
|
prepDataDir,
|
|
61
|
-
source: { kind: "local-folder", locator:
|
|
62
|
-
methodId: preparation.method ??
|
|
63
|
-
about:
|
|
46
|
+
source: { kind: "local-folder", locator: sourceFolderPath },
|
|
47
|
+
methodId: preparation.method ?? null,
|
|
48
|
+
about: preparation.about ?? null,
|
|
64
49
|
config: preparation,
|
|
65
50
|
portableContextPath: join(prepDataDir, prepId),
|
|
66
51
|
configPath: join(prepDataDir, "interf.json"),
|
|
@@ -95,7 +80,9 @@ export function getStoredPreparation(prepId) {
|
|
|
95
80
|
*/
|
|
96
81
|
export function createStoredPreparation(runtime, input) {
|
|
97
82
|
PreparationNameSchema.parse(input.id);
|
|
98
|
-
|
|
83
|
+
if (input.method_id != null) {
|
|
84
|
+
MethodIdSchema.parse(input.method_id);
|
|
85
|
+
}
|
|
99
86
|
const sourceLocator = resolve(input.source.locator);
|
|
100
87
|
if (!existsSync(sourceLocator)) {
|
|
101
88
|
throw new Error(`Source folder does not exist: ${sourceLocator}`);
|
|
@@ -112,7 +99,7 @@ export function createStoredPreparation(runtime, input) {
|
|
|
112
99
|
const preparation = {
|
|
113
100
|
name: input.id,
|
|
114
101
|
path: input.id,
|
|
115
|
-
method: input.method_id,
|
|
102
|
+
...(input.method_id ? { method: input.method_id } : {}),
|
|
116
103
|
checks: (input.checks ?? []).map((check) => ({
|
|
117
104
|
question: check.question,
|
|
118
105
|
...(check.answer ? { answer: check.answer } : {}),
|
|
@@ -124,7 +111,7 @@ export function createStoredPreparation(runtime, input) {
|
|
|
124
111
|
...(input.max_loops ? { max_loops: input.max_loops } : {}),
|
|
125
112
|
};
|
|
126
113
|
saveSourceFolderConfig(prepDataDir, {
|
|
127
|
-
source_folder: { path: sourceLocator
|
|
114
|
+
source_folder: { path: sourceLocator },
|
|
128
115
|
preparations: [preparation],
|
|
129
116
|
});
|
|
130
117
|
// Hand the synthetic workspace to the runtime so the existing
|
|
@@ -148,6 +135,42 @@ export function deleteStoredPreparation(runtime, prepId) {
|
|
|
148
135
|
rmSync(prepDataDir, { recursive: true, force: true });
|
|
149
136
|
return true;
|
|
150
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Update mutable fields on an existing preparation (method binding,
|
|
140
|
+
* about text). Returns the freshly-loaded record. Throws if the
|
|
141
|
+
* preparation does not exist.
|
|
142
|
+
*/
|
|
143
|
+
export function updateStoredPreparation(prepId, patch) {
|
|
144
|
+
const stored = loadStoredPreparation(prepId);
|
|
145
|
+
if (!stored)
|
|
146
|
+
throw new Error(`Preparation not found: ${prepId}`);
|
|
147
|
+
if (patch.method_id !== undefined && patch.method_id !== null) {
|
|
148
|
+
MethodIdSchema.parse(patch.method_id);
|
|
149
|
+
}
|
|
150
|
+
const nextPreparation = {
|
|
151
|
+
...stored.config,
|
|
152
|
+
...(patch.method_id === null
|
|
153
|
+
? { method: undefined }
|
|
154
|
+
: patch.method_id !== undefined
|
|
155
|
+
? { method: patch.method_id }
|
|
156
|
+
: {}),
|
|
157
|
+
};
|
|
158
|
+
const aboutPatch = patch.about === undefined ? stored.about : patch.about;
|
|
159
|
+
const preparationWithAbout = aboutPatch
|
|
160
|
+
? { ...nextPreparation, about: aboutPatch }
|
|
161
|
+
: (() => {
|
|
162
|
+
const { about: _omitAbout, ...rest } = nextPreparation;
|
|
163
|
+
return rest;
|
|
164
|
+
})();
|
|
165
|
+
saveSourceFolderConfig(stored.prepDataDir, {
|
|
166
|
+
source_folder: { path: stored.source.locator },
|
|
167
|
+
preparations: [preparationWithAbout],
|
|
168
|
+
});
|
|
169
|
+
const next = loadStoredPreparation(prepId);
|
|
170
|
+
if (!next)
|
|
171
|
+
throw new Error(`Failed to reload updated preparation ${prepId}`);
|
|
172
|
+
return next;
|
|
173
|
+
}
|
|
151
174
|
/**
|
|
152
175
|
* Re-register every preparation directory with the runtime on startup so
|
|
153
176
|
* synthetic workspaces survive a `interf web` restart.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import type { SourceReadinessCheck } from "../project
|
|
1
|
+
import type { MethodExecutor } from "./agents/lib/executors.js";
|
|
2
|
+
import type { SourceReadinessCheck } from "../project/lib/schema.js";
|
|
3
3
|
export declare function buildReadinessCheckDraftPrompt(options: {
|
|
4
4
|
preparationName: string;
|
|
5
5
|
sourceFolderPath: string;
|
|
@@ -9,13 +9,23 @@ export declare const LOCAL_SERVICE_ROUTES: {
|
|
|
9
9
|
readonly methods: "/v1/methods";
|
|
10
10
|
readonly runs: "/v1/runs";
|
|
11
11
|
readonly actionProposals: "/v1/action-proposals";
|
|
12
|
+
/**
|
|
13
|
+
* 0.14 single-active-agent shortcut. Kept as a back-compat shim
|
|
14
|
+
* over the role-map's `general` row in 0.15+.
|
|
15
|
+
*/
|
|
12
16
|
readonly executor: "/v1/executor";
|
|
17
|
+
/**
|
|
18
|
+
* 0.15 connected-agents primitive — registry, role-map, role list.
|
|
19
|
+
* `agents/{name}` and `agents/role-map` are sub-resources handled
|
|
20
|
+
* by string match in `server.ts`.
|
|
21
|
+
*/
|
|
22
|
+
readonly agents: "/v1/agents";
|
|
13
23
|
readonly openPath: "/v1/open-path";
|
|
14
24
|
};
|
|
15
25
|
/** Preparation-scoped sub-resources (relative to /v1/preparations/<id>/). */
|
|
16
26
|
export declare const PREPARATION_SUBRESOURCES: {
|
|
17
27
|
readonly compileRuns: "compile-runs";
|
|
18
|
-
readonly
|
|
28
|
+
readonly verifyRuns: "verify-runs";
|
|
19
29
|
readonly methodAuthoringRuns: "method-authoring-runs";
|
|
20
30
|
readonly methodImprovementRuns: "method-improvement-runs";
|
|
21
31
|
readonly readinessCheckDrafts: "readiness-check-drafts";
|
|
@@ -25,6 +35,23 @@ export declare const PREPARATION_SUBRESOURCES: {
|
|
|
25
35
|
readonly readiness: "readiness";
|
|
26
36
|
readonly sourceFiles: "source-files";
|
|
27
37
|
readonly portableContext: "portable-context";
|
|
38
|
+
/**
|
|
39
|
+
* 0.16 — read a portable-context file (read-only, path-guarded
|
|
40
|
+
* inside the prep's portable-context root). Used by the locator
|
|
41
|
+
* pattern's `api-served` kind:
|
|
42
|
+
* GET /v1/preparations/<id>/files/<relpath>
|
|
43
|
+
*/
|
|
44
|
+
readonly files: "files";
|
|
45
|
+
};
|
|
46
|
+
/** Method-scoped sub-resources (relative to /v1/methods/<id>/). */
|
|
47
|
+
export declare const METHOD_SUBRESOURCES: {
|
|
48
|
+
readonly runs: "runs";
|
|
49
|
+
/**
|
|
50
|
+
* 0.16 — read a method package file (read-only, path-guarded inside
|
|
51
|
+
* the method root). Used by the locator pattern's `api-served` kind:
|
|
52
|
+
* GET /v1/methods/<id>/files/<relpath>
|
|
53
|
+
*/
|
|
54
|
+
readonly files: "files";
|
|
28
55
|
};
|
|
29
56
|
/** Run-scoped sub-resources (relative to /v1/runs/<run-id>/). */
|
|
30
57
|
export declare const RUN_SUBRESOURCES: {
|
|
@@ -47,3 +74,5 @@ export declare function runResourcePath(runId: string): string;
|
|
|
47
74
|
export declare function runSubresourcePath(runId: string, sub: keyof typeof RUN_SUBRESOURCES): string;
|
|
48
75
|
/** Path builder: /v1/methods/<id>. */
|
|
49
76
|
export declare function methodResourcePath(methodId: string): string;
|
|
77
|
+
/** Path builder: /v1/methods/<id>/<subresource>. */
|
|
78
|
+
export declare function methodSubresourcePath(methodId: string, sub: keyof typeof METHOD_SUBRESOURCES): string;
|