@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
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Role router — picks which connected agent runs a given stage role.
|
|
3
|
+
*
|
|
4
|
+
* The compile pipeline calls `resolveAgentForRole` for each agent-typed
|
|
5
|
+
* stage, passing the stage's declared role and the current registry +
|
|
6
|
+
* active agent. The verify pipeline always passes role `"verifier"`.
|
|
7
|
+
*
|
|
8
|
+
* Resolution priority (lean / explicit):
|
|
9
|
+
* 1. Explicit role-map entry for the requested role.
|
|
10
|
+
* 2. Role-map's `general` row (when the requested role isn't mapped).
|
|
11
|
+
* 3. The active agent (when `general` isn't mapped either).
|
|
12
|
+
*
|
|
13
|
+
* If the role-map points at an agent name that no longer exists in the
|
|
14
|
+
* merged agents list (e.g. user uninstalled it), we fall through to
|
|
15
|
+
* `general` then `activeAgent`. Only when ALL three are missing does the
|
|
16
|
+
* router return an error.
|
|
17
|
+
*/
|
|
18
|
+
import type { AgentRecord, RoleMap } from "../../contracts/lib/schema.js";
|
|
19
|
+
export type RoleResolutionSource = "explicit" | "fallback-general" | "fallback-active";
|
|
20
|
+
export interface ResolvedAgent {
|
|
21
|
+
agent: AgentRecord;
|
|
22
|
+
/** The role the caller asked for (kept for audit / logging). */
|
|
23
|
+
role: string;
|
|
24
|
+
/** Which fallback rung the agent came from. */
|
|
25
|
+
source: RoleResolutionSource;
|
|
26
|
+
}
|
|
27
|
+
export interface RoleResolutionContext {
|
|
28
|
+
roleMap: RoleMap;
|
|
29
|
+
agents: AgentRecord[];
|
|
30
|
+
/**
|
|
31
|
+
* The agent the role-map's `general` row points at — or, when no
|
|
32
|
+
* role-map exists yet, the first detected agent. Pass `null` when
|
|
33
|
+
* there is no agent available; the router then returns an error.
|
|
34
|
+
*/
|
|
35
|
+
activeAgent: AgentRecord | null;
|
|
36
|
+
}
|
|
37
|
+
export type RoleResolutionError = {
|
|
38
|
+
error: "no-agents";
|
|
39
|
+
detail: string;
|
|
40
|
+
} | {
|
|
41
|
+
error: "mapped-agent-missing";
|
|
42
|
+
detail: string;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a stage role to an agent + provenance trail. Returns
|
|
46
|
+
* `{ agent, role, source }` on success or `{ error, detail }` on
|
|
47
|
+
* failure.
|
|
48
|
+
*/
|
|
49
|
+
export declare function resolveAgentForRole(role: string, context: RoleResolutionContext): ResolvedAgent | RoleResolutionError;
|
|
50
|
+
/**
|
|
51
|
+
* Resolve every role declared by a Method's stages. Useful for
|
|
52
|
+
* pre-flight: returns either `{ resolutions }` (one entry per stage)
|
|
53
|
+
* or `{ error, role }` if any stage cannot resolve.
|
|
54
|
+
*/
|
|
55
|
+
export declare function resolveAgentsForStages(stages: ReadonlyArray<{
|
|
56
|
+
id: string;
|
|
57
|
+
role: string;
|
|
58
|
+
}>, context: RoleResolutionContext): {
|
|
59
|
+
resolutions: Array<{
|
|
60
|
+
stageId: string;
|
|
61
|
+
resolved: ResolvedAgent;
|
|
62
|
+
}>;
|
|
63
|
+
} | (RoleResolutionError & {
|
|
64
|
+
stageId: string;
|
|
65
|
+
role: string;
|
|
66
|
+
});
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve a stage role to an agent + provenance trail. Returns
|
|
3
|
+
* `{ agent, role, source }` on success or `{ error, detail }` on
|
|
4
|
+
* failure.
|
|
5
|
+
*/
|
|
6
|
+
export function resolveAgentForRole(role, context) {
|
|
7
|
+
if (context.agents.length === 0) {
|
|
8
|
+
return {
|
|
9
|
+
error: "no-agents",
|
|
10
|
+
detail: "No agents are available. Install Claude Code, Codex, or another agent CLI, " +
|
|
11
|
+
"or register a custom CLI with `interf agents register`.",
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
const trimmedRole = role && role.trim().length > 0 ? role.trim() : "general";
|
|
15
|
+
// 1. Explicit role-map entry for the requested role.
|
|
16
|
+
const explicitName = context.roleMap[trimmedRole];
|
|
17
|
+
if (explicitName) {
|
|
18
|
+
const found = context.agents.find((agent) => agent.name === explicitName);
|
|
19
|
+
if (found) {
|
|
20
|
+
return { agent: found, role: trimmedRole, source: "explicit" };
|
|
21
|
+
}
|
|
22
|
+
// Map exists but points at a missing agent. Fall through to
|
|
23
|
+
// `general` and ultimately `activeAgent`. We do NOT return
|
|
24
|
+
// `mapped-agent-missing` here because the resolution priority
|
|
25
|
+
// explicitly allows fallback through `general` and active —
|
|
26
|
+
// returning an error would block a usable agent.
|
|
27
|
+
}
|
|
28
|
+
// 2. Role-map's `general` row, if the requested role isn't `general`.
|
|
29
|
+
if (trimmedRole !== "general") {
|
|
30
|
+
const generalName = context.roleMap["general"];
|
|
31
|
+
if (generalName) {
|
|
32
|
+
const found = context.agents.find((agent) => agent.name === generalName);
|
|
33
|
+
if (found) {
|
|
34
|
+
return { agent: found, role: trimmedRole, source: "fallback-general" };
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// 3. Active agent.
|
|
39
|
+
if (context.activeAgent) {
|
|
40
|
+
return {
|
|
41
|
+
agent: context.activeAgent,
|
|
42
|
+
role: trimmedRole,
|
|
43
|
+
source: "fallback-active",
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
// Map points at an agent we cannot find AND there is no active fallback.
|
|
47
|
+
if (explicitName) {
|
|
48
|
+
return {
|
|
49
|
+
error: "mapped-agent-missing",
|
|
50
|
+
detail: `Role "${trimmedRole}" maps to agent "${explicitName}", which is not detected or registered.`,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
error: "no-agents",
|
|
55
|
+
detail: `No agent is mapped to role "${trimmedRole}" and no active agent fallback is available.`,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Resolve every role declared by a Method's stages. Useful for
|
|
60
|
+
* pre-flight: returns either `{ resolutions }` (one entry per stage)
|
|
61
|
+
* or `{ error, role }` if any stage cannot resolve.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveAgentsForStages(stages, context) {
|
|
64
|
+
const resolutions = [];
|
|
65
|
+
for (const stage of stages) {
|
|
66
|
+
const result = resolveAgentForRole(stage.role, context);
|
|
67
|
+
if ("error" in result) {
|
|
68
|
+
return { ...result, stageId: stage.id, role: stage.role };
|
|
69
|
+
}
|
|
70
|
+
resolutions.push({ stageId: stage.id, resolved: result });
|
|
71
|
+
}
|
|
72
|
+
return { resolutions };
|
|
73
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type
|
|
1
|
+
import { type ActionProposalApprovalRequest, type ActionProposalCreateRequest, type ActionProposalResource, type CompileRunCreateRequest, type CompileRunResource, type LocalJobRunResource, type LocalServiceHealth, type ReadinessCheckDraftCreateRequest, type ReadinessCheckDraftResult, type ResetRequest, type ResetResult, type VerifyRunCreateRequest, type VerifyRunResource, type MethodAuthoringCreateRequest, type MethodAuthoringResult } from "./lib/schema.js";
|
|
2
2
|
export interface FindOrStartLocalServiceOptions {
|
|
3
3
|
url?: string;
|
|
4
4
|
authToken?: string;
|
|
@@ -41,12 +41,12 @@ export declare function submitCompileRunToLocalService(options: {
|
|
|
41
41
|
serviceUrl: string;
|
|
42
42
|
resource: CompileRunResource;
|
|
43
43
|
} | null>;
|
|
44
|
-
export declare function
|
|
44
|
+
export declare function submitVerifyRunToLocalService(options: {
|
|
45
45
|
preparationId: string;
|
|
46
|
-
request:
|
|
46
|
+
request: VerifyRunCreateRequest;
|
|
47
47
|
}): Promise<{
|
|
48
48
|
serviceUrl: string;
|
|
49
|
-
resource:
|
|
49
|
+
resource: VerifyRunResource;
|
|
50
50
|
} | null>;
|
|
51
51
|
export declare function submitResetToLocalService(options: {
|
|
52
52
|
preparationId: string;
|
|
@@ -103,18 +103,18 @@ export declare function waitForLocalCompileRun(options: {
|
|
|
103
103
|
authToken?: string | null;
|
|
104
104
|
onUpdate?: (resource: CompileRunResource) => void;
|
|
105
105
|
}): Promise<CompileRunResource>;
|
|
106
|
-
export declare function
|
|
106
|
+
export declare function getLocalVerifyRun(options: {
|
|
107
107
|
serviceUrl: string;
|
|
108
108
|
runId: string;
|
|
109
109
|
authToken?: string | null;
|
|
110
|
-
}): Promise<
|
|
111
|
-
export declare function
|
|
110
|
+
}): Promise<VerifyRunResource>;
|
|
111
|
+
export declare function waitForLocalVerifyRun(options: {
|
|
112
112
|
serviceUrl: string;
|
|
113
113
|
runId: string;
|
|
114
114
|
pollMs?: number;
|
|
115
115
|
authToken?: string | null;
|
|
116
|
-
onUpdate?: (resource:
|
|
117
|
-
}): Promise<
|
|
116
|
+
onUpdate?: (resource: VerifyRunResource) => void;
|
|
117
|
+
}): Promise<VerifyRunResource>;
|
|
118
118
|
export declare function getLocalJobRun(options: {
|
|
119
119
|
serviceUrl: string;
|
|
120
120
|
runId: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CompileRunCreateRequestSchema, CompileRunResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema,
|
|
1
|
+
import { CompileRunCreateRequestSchema, CompileRunResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, ReadinessCheckDraftCreateRequestSchema, ReadinessCheckDraftResultSchema, ResetRequestSchema, ResetResultSchema, VerifyRunCreateRequestSchema, VerifyRunResourceSchema, MethodAuthoringCreateRequestSchema, MethodAuthoringResultSchema, } from "./lib/schema.js";
|
|
2
2
|
import { LOCAL_SERVICE_ROUTES, buildLocalServiceUrl, preparationSubresourcePath, } from "./routes.js";
|
|
3
3
|
import { readActiveConnection } from "./connection-config.js";
|
|
4
4
|
async function connectOrNull(options = {}) {
|
|
@@ -8,8 +8,8 @@ async function connectOrNull(options = {}) {
|
|
|
8
8
|
});
|
|
9
9
|
if (!conn)
|
|
10
10
|
return null;
|
|
11
|
-
// Probe the engine
|
|
12
|
-
//
|
|
11
|
+
// Probe the engine and surface a LocalServiceHealth object that
|
|
12
|
+
// submitCompileRun et al. consume.
|
|
13
13
|
try {
|
|
14
14
|
const headers = {};
|
|
15
15
|
if (conn.auth_token)
|
|
@@ -102,13 +102,13 @@ export async function submitCompileRunToLocalService(options) {
|
|
|
102
102
|
resource,
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
|
-
export async function
|
|
105
|
+
export async function submitVerifyRunToLocalService(options) {
|
|
106
106
|
const connection = await connectOrNull();
|
|
107
107
|
if (!connection)
|
|
108
108
|
return null;
|
|
109
|
-
const request =
|
|
110
|
-
const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "
|
|
111
|
-
const resource =
|
|
109
|
+
const request = VerifyRunCreateRequestSchema.parse(options.request);
|
|
110
|
+
const url = `${connection.serviceUrl}${preparationSubresourcePath(options.preparationId, "verifyRuns")}`;
|
|
111
|
+
const resource = VerifyRunResourceSchema.parse(await fetchJson(url, {
|
|
112
112
|
method: "POST",
|
|
113
113
|
body: JSON.stringify(request),
|
|
114
114
|
headers: authHeaders(connection.authToken),
|
|
@@ -235,19 +235,19 @@ export async function waitForLocalCompileRun(options) {
|
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
export async function
|
|
239
|
-
return
|
|
238
|
+
export async function getLocalVerifyRun(options) {
|
|
239
|
+
return VerifyRunResourceSchema.parse(await fetchJson(`${options.serviceUrl}/v1/verify-runs/${encodeURIComponent(options.runId)}`, {
|
|
240
240
|
method: "GET",
|
|
241
241
|
timeoutMs: 2000,
|
|
242
242
|
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
243
243
|
}));
|
|
244
244
|
}
|
|
245
|
-
export async function
|
|
245
|
+
export async function waitForLocalVerifyRun(options) {
|
|
246
246
|
// Same exponential backoff as `waitForLocalCompileRun`.
|
|
247
247
|
const explicit = options.pollMs;
|
|
248
248
|
let delay = explicit ?? 250;
|
|
249
249
|
while (true) {
|
|
250
|
-
const resource = await
|
|
250
|
+
const resource = await getLocalVerifyRun({
|
|
251
251
|
serviceUrl: options.serviceUrl,
|
|
252
252
|
runId: options.runId,
|
|
253
253
|
authToken: options.authToken ?? null,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
-
import { listFilesRecursive } from "
|
|
2
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
3
3
|
import { compiledZoneAbsolutePath } from "./compiled-schema.js";
|
|
4
4
|
const SCAFFOLD_PLACEHOLDER_SNIPPETS = [
|
|
5
5
|
"Not yet compiled. Run `interf compile` to build the portable context.",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
-
import { type MethodReporter, type MethodStageResult } from "
|
|
2
|
+
import { type MethodReporter, type MethodStageResult } from "../../methods/package/method-helpers.js";
|
|
3
3
|
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import type { RunEventSink } from "../execution/events.js";
|
|
5
5
|
export interface CompiledSummarizeResult extends MethodStageResult {
|
|
@@ -15,8 +15,17 @@ export interface CompiledCompileResult {
|
|
|
15
15
|
failedStage: string | null;
|
|
16
16
|
}
|
|
17
17
|
export type StageShellRetentionMode = "on-failure" | "always";
|
|
18
|
+
/**
|
|
19
|
+
* Per-stage executor resolver. When provided, the pipeline calls this
|
|
20
|
+
* for each stage and uses the returned executor instead of the
|
|
21
|
+
* top-level `executor`. The top-level `executor` stays as the default
|
|
22
|
+
* fallback so single-active-agent setups keep working without any
|
|
23
|
+
* resolver wired up.
|
|
24
|
+
*/
|
|
25
|
+
export type ResolveStageExecutor = (stage: CompiledStageExecutionDefinition) => MethodExecutor;
|
|
18
26
|
export declare function runCompiledSummarize(options: {
|
|
19
27
|
executor: MethodExecutor;
|
|
28
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
20
29
|
compiledPath: string;
|
|
21
30
|
reporter?: MethodReporter;
|
|
22
31
|
reportSummary?: boolean;
|
|
@@ -28,6 +37,7 @@ export declare function runCompiledSummarize(options: {
|
|
|
28
37
|
}): Promise<CompiledSummarizeResult>;
|
|
29
38
|
export declare function runCompiledCompile(options: {
|
|
30
39
|
executor: MethodExecutor;
|
|
40
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
31
41
|
compiledPath: string;
|
|
32
42
|
reporter?: MethodReporter;
|
|
33
43
|
reportStep?: boolean;
|
|
@@ -37,6 +47,7 @@ export declare function runCompiledCompile(options: {
|
|
|
37
47
|
}): Promise<MethodStageResult>;
|
|
38
48
|
export declare function compileCompiled(options: {
|
|
39
49
|
executor: MethodExecutor;
|
|
50
|
+
resolveStageExecutor?: ResolveStageExecutor;
|
|
40
51
|
compiledPath: string;
|
|
41
52
|
reporter?: MethodReporter;
|
|
42
53
|
preserveStageShells?: StageShellRetentionMode;
|
|
@@ -1,15 +1,25 @@
|
|
|
1
1
|
import { refreshCompiledBootstrapGuidance, } from "../agents/lib/compiled-bootstrap.js";
|
|
2
|
-
import { validateMethodPackage } from "
|
|
3
|
-
import { reportValidationFailure, } from "
|
|
2
|
+
import { validateMethodPackage } from "../../methods/package/local-methods.js";
|
|
3
|
+
import { reportValidationFailure, } from "../../methods/package/method-helpers.js";
|
|
4
4
|
import { validateCompiledMethod, } from "./validate.js";
|
|
5
5
|
import { pruneStageExecutionShells, } from "../agents/lib/shells.js";
|
|
6
6
|
import { resetCompiledGeneratedState } from "./reset.js";
|
|
7
7
|
import { compiledExecutionStages, resolveCompiledContext, } from "./compiled-target.js";
|
|
8
8
|
import { discoverSourceFiles } from "./discovery.js";
|
|
9
9
|
import { runCompiledStage } from "./compiled-stage-runner.js";
|
|
10
|
-
import { resolveSourceInputPath } from "
|
|
10
|
+
import { resolveSourceInputPath } from "../../project/interf-detect.js";
|
|
11
11
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
12
12
|
import { writeCompiledSourceRuntime } from "./source-files.js";
|
|
13
|
+
function pickStageExecutor(fallback, stage, resolve) {
|
|
14
|
+
if (!resolve)
|
|
15
|
+
return fallback;
|
|
16
|
+
try {
|
|
17
|
+
return resolve(stage) ?? fallback;
|
|
18
|
+
}
|
|
19
|
+
catch {
|
|
20
|
+
return fallback;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
13
23
|
export async function runCompiledSummarize(options) {
|
|
14
24
|
const context = resolveCompiledContext(options.compiledPath);
|
|
15
25
|
const stageDefinition = options.stageDefinition
|
|
@@ -31,7 +41,7 @@ export async function runCompiledSummarize(options) {
|
|
|
31
41
|
runId: options.runId ?? null,
|
|
32
42
|
});
|
|
33
43
|
const result = await runCompiledStage({
|
|
34
|
-
executor: options.executor,
|
|
44
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
35
45
|
compiledPath: options.compiledPath,
|
|
36
46
|
reporter: options.reporter,
|
|
37
47
|
reportStep: options.reportStep,
|
|
@@ -66,7 +76,7 @@ export async function runCompiledCompile(options) {
|
|
|
66
76
|
});
|
|
67
77
|
for (const [index, stageDefinition] of stages.entries()) {
|
|
68
78
|
const result = await runCompiledStage({
|
|
69
|
-
executor: options.executor,
|
|
79
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
70
80
|
compiledPath: options.compiledPath,
|
|
71
81
|
reporter: options.reporter,
|
|
72
82
|
reportStep: options.reportStep,
|
|
@@ -130,7 +140,7 @@ export async function compileCompiled(options) {
|
|
|
130
140
|
});
|
|
131
141
|
for (const [index, stageDefinition] of stages.entries()) {
|
|
132
142
|
const stageResult = await runCompiledStage({
|
|
133
|
-
executor: options.executor,
|
|
143
|
+
executor: pickStageExecutor(options.executor, stageDefinition, options.resolveStageExecutor),
|
|
134
144
|
compiledPath: options.compiledPath,
|
|
135
145
|
reporter: options.reporter,
|
|
136
146
|
reportStep: true,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { type BuiltinCompiledZoneId } from "
|
|
1
|
+
import { type BuiltinCompiledZoneId } from "../../methods/package/builtin-compiled-method.js";
|
|
2
2
|
import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "./lib/schema.js";
|
|
3
3
|
export interface MethodSchemaStageLike {
|
|
4
4
|
id: string;
|
|
5
5
|
writes: readonly string[];
|
|
6
6
|
}
|
|
7
|
-
export { BUILTIN_COMPILED_ZONE_IDS } from "
|
|
7
|
+
export { BUILTIN_COMPILED_ZONE_IDS } from "../../methods/package/builtin-compiled-method.js";
|
|
8
8
|
export declare const METHOD_SCHEMA_FILE = "method.schema.json";
|
|
9
9
|
export declare function methodSchemaFilePath(rootPath: string): string;
|
|
10
10
|
export declare function resolveMethodSchemaPath(rootPath: string): string | null;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
-
import { warnInterf } from "
|
|
4
|
-
import { readJsonFileUnchecked } from "
|
|
5
|
-
import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "
|
|
3
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
4
|
+
import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
|
|
5
|
+
import { BUILTIN_COMPILED_ZONE_IDS, listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "../../methods/package/builtin-compiled-method.js";
|
|
6
6
|
import { MethodCompiledSchemaSchema, } from "./lib/schema.js";
|
|
7
|
-
export { BUILTIN_COMPILED_ZONE_IDS } from "
|
|
7
|
+
export { BUILTIN_COMPILED_ZONE_IDS } from "../../methods/package/builtin-compiled-method.js";
|
|
8
8
|
export const METHOD_SCHEMA_FILE = "method.schema.json";
|
|
9
9
|
const BUILTIN_COMPILED_ZONE_SPEC_BY_ID = new Map(listBuiltinCompiledZoneSpecs().map((zone) => [zone.id, zone]));
|
|
10
10
|
export function methodSchemaFilePath(rootPath) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type RuntimeStageContractDraft } from "./runtime.js";
|
|
2
|
-
import { type MethodStageDefinition } from "
|
|
2
|
+
import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
|
|
3
3
|
import { resolveCompiledContext, type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import type { RuntimeStageInstructions } from "./lib/schema.js";
|
|
5
5
|
export declare function resolveStageContractArtifacts(compiledPath: string, stageDefinition: Pick<MethodStageDefinition, "id" | "reads" | "writes">): {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { buildRuntimeStageContract, } from "./runtime.js";
|
|
3
3
|
import { discoverSourceFiles } from "./discovery.js";
|
|
4
|
-
import { listFilesRecursive } from "
|
|
4
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
5
5
|
import { compiledContractArtifactPathsForZoneIds, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
6
|
-
import { buildLocalSkillContractExtension, buildStageInstructions, methodCompileStageDirectory, } from "
|
|
7
|
-
import { getActiveCompiledStagePolicyNotes, resolveActiveCompiledStageAcceptance, } from "
|
|
6
|
+
import { buildLocalSkillContractExtension, buildStageInstructions, methodCompileStageDirectory, } from "../../methods/package/method-helpers.js";
|
|
7
|
+
import { getActiveCompiledStagePolicyNotes, resolveActiveCompiledStageAcceptance, } from "../../methods/package/method-definitions.js";
|
|
8
8
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
|
-
import { readInterfConfig } from "
|
|
9
|
+
import { readInterfConfig } from "../../project/interf-detect.js";
|
|
10
10
|
import { resolveCompiledContext, } from "./compiled-target.js";
|
|
11
11
|
function zoneArtifactCount(compiledPath, zonePath, kind) {
|
|
12
12
|
const absolutePath = join(compiledPath, zonePath);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MethodExecutor } from "../agents/lib/executors.js";
|
|
2
|
-
import { type MethodReporter, type MethodStageResult } from "
|
|
2
|
+
import { type MethodReporter, type MethodStageResult } from "../../methods/package/method-helpers.js";
|
|
3
3
|
import { type CompiledStageExecutionDefinition } from "./compiled-target.js";
|
|
4
4
|
import { type RunEventSink } from "../execution/events.js";
|
|
5
5
|
export declare function runCompiledStage(options: {
|
|
@@ -2,9 +2,9 @@ import { createStageExecutionShell, freezeStageExecutionShell, syncStageExecutio
|
|
|
2
2
|
import { reconcileCompiledStageRun } from "./runtime-reconcile.js";
|
|
3
3
|
import { refreshCompiledArtifacts } from "./state.js";
|
|
4
4
|
import { validateCompiledStage } from "./validate.js";
|
|
5
|
-
import { executeValidatedStage, } from "
|
|
6
|
-
import { formatActiveCompiledMethodStageStep, } from "
|
|
7
|
-
import { reportBlankLine, reportLine, } from "
|
|
5
|
+
import { executeValidatedStage, } from "../../methods/package/method-stage-runner.js";
|
|
6
|
+
import { formatActiveCompiledMethodStageStep, } from "../../methods/package/method-definitions.js";
|
|
7
|
+
import { reportBlankLine, reportLine, } from "../../methods/package/method-helpers.js";
|
|
8
8
|
import { buildCompiledStageExecutionPlan, } from "./compiled-stage-plan.js";
|
|
9
9
|
import { createRunEventId, createRunEventTimestamp, } from "../execution/events.js";
|
|
10
10
|
async function emitRunEvent(sink, event) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type MethodStageDefinition } from "
|
|
2
|
-
import { type CompiledMethodId } from "
|
|
1
|
+
import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
|
|
2
|
+
import { type CompiledMethodId } from "../../methods/package/method-definitions.js";
|
|
3
3
|
export interface CompiledStageExecutionDefinition extends MethodStageDefinition {
|
|
4
4
|
}
|
|
5
5
|
export declare function resolveCompiledContext(compiledPath: string): {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "
|
|
2
|
-
import { readInterfConfig, resolveSourceFolderPath, resolveSourceControlPath, } from "
|
|
1
|
+
import { getActiveCompiledMethod, resolveRequiredCompiledMethodFromConfig, } from "../../methods/package/method-definitions.js";
|
|
2
|
+
import { readInterfConfig, resolveSourceFolderPath, resolveSourceControlPath, } from "../../project/interf-detect.js";
|
|
3
3
|
export function resolveCompiledContext(compiledPath) {
|
|
4
4
|
const config = readInterfConfig(compiledPath);
|
|
5
5
|
const methodId = resolveRequiredCompiledMethodFromConfig(config, `.interf/interf.json for ${compiledPath}`);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
4
|
const DEFAULT_IGNORE_DIRS = new Set([
|
|
5
5
|
"interf",
|
|
6
6
|
".interf",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "
|
|
3
|
-
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "
|
|
2
|
+
import { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, TestCaseExpectSchema, TestTargetTypeSchema, MethodIdSchema } from "../../../contracts/lib/schema.js";
|
|
3
|
+
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
|
|
4
4
|
export type RuntimeStatus = "idle" | "running" | "compiled" | "stale" | "failed";
|
|
5
5
|
export type CompiledStage = "idle" | "compiled" | "failed" | string;
|
|
6
6
|
export declare const MethodZoneIdSchema: z.ZodString;
|
|
@@ -264,8 +264,8 @@ export declare const ExecutionShellPathsSchema: z.ZodObject<{
|
|
|
264
264
|
export declare const RuntimeStageInstructionsSchema: z.ZodObject<{
|
|
265
265
|
stage_skill_dir: z.ZodString;
|
|
266
266
|
effective_mode: z.ZodEnum<{
|
|
267
|
-
override: "override";
|
|
268
267
|
builtin: "builtin";
|
|
268
|
+
override: "override";
|
|
269
269
|
extend: "extend";
|
|
270
270
|
}>;
|
|
271
271
|
local_mode: z.ZodNullable<z.ZodEnum<{
|
|
@@ -324,8 +324,8 @@ export declare const RuntimeStageContractSchema: z.ZodObject<{
|
|
|
324
324
|
instructions: z.ZodObject<{
|
|
325
325
|
stage_skill_dir: z.ZodString;
|
|
326
326
|
effective_mode: z.ZodEnum<{
|
|
327
|
-
override: "override";
|
|
328
327
|
builtin: "builtin";
|
|
328
|
+
override: "override";
|
|
329
329
|
extend: "extend";
|
|
330
330
|
}>;
|
|
331
331
|
local_mode: z.ZodNullable<z.ZodEnum<{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { COMPILED_ZONE_KINDS, } from "../method-primitives.js";
|
|
3
|
-
import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "
|
|
4
|
-
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "
|
|
3
|
+
import { RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
|
|
4
|
+
export { ReadinessCheckSchema, ReadinessGateSchema, ReadinessStateSchema, ReadinessStatusSchema, ReadinessTargetResultSchema, RuntimeContractTypeSchema, RuntimeExecutorInfoSchema, RuntimeStageSchema, RuntimeTargetTypeSchema, SourceFilesSchema, SourceFileSchema, SourceKindSchema, SourceSchema, SourceSnapshotSchema, StageInputSchema, StageInputsSchema, SourceCompiledMaxAttemptsSchema, SourceCompiledMaxLoopsSchema, TestCaseExpectSchema, TestTargetTypeSchema, InterfIdPattern, MethodIdSchema, } from "../../../contracts/lib/schema.js";
|
|
5
5
|
const JsonRecordSchema = z.record(z.string(), z.unknown());
|
|
6
6
|
const COMPILED_RELATIVE_PATH_SEGMENT = /^(?!\.{1,2}$)[^/\\]+$/;
|
|
7
7
|
function isCompiledRelativePath(value) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type InterfConfig } from "
|
|
2
|
-
export type { MethodReporter } from "
|
|
1
|
+
import { type InterfConfig } from "../../project/interf-detect.js";
|
|
2
|
+
export type { MethodReporter } from "../../methods/package/method-helpers.js";
|
|
3
3
|
export type CompiledCheck = "compiled" | "stage";
|
|
4
4
|
export interface DetectedInterfTarget {
|
|
5
5
|
path: string;
|
|
@@ -11,4 +11,4 @@ export declare function detectCompiled(cwd: string): DetectedInterfTarget | null
|
|
|
11
11
|
export declare function createCompiled(name: string, sourcePath: string, methodId: string | undefined, about: string | undefined, sourceFolderPath: string): string;
|
|
12
12
|
export declare function verifyCompiledCheck(check: CompiledCheck, compiledPath: string): import("./validate-compiled.js").CompiledMethodValidation;
|
|
13
13
|
export { runCompiledSummarize, runCompiledCompile, compileCompiled, resolveCompiledContext, compiledExecutionStages, } from "./compiled-compile.js";
|
|
14
|
-
export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, } from "./compiled-compile.js";
|
|
14
|
+
export type { CompiledSummarizeResult, CompiledCompileResult, CompiledStageExecutionDefinition, StageShellRetentionMode, ResolveStageExecutor, } from "./compiled-compile.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createCompiled as createCompiledScaffold, } from "
|
|
2
|
-
import { detectInterf } from "
|
|
1
|
+
import { createCompiled as createCompiledScaffold, } from "../../project/interf-scaffold.js";
|
|
2
|
+
import { detectInterf } from "../../project/interf-detect.js";
|
|
3
3
|
import { validateCompiledCompile, } from "./validate.js";
|
|
4
|
-
import { DEFAULT_METHOD_ID } from "
|
|
4
|
+
import { DEFAULT_METHOD_ID } from "../../methods/method-resolution.js";
|
|
5
5
|
export function detectCompiled(cwd) {
|
|
6
6
|
const detected = detectInterf(cwd);
|
|
7
7
|
if (!detected)
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { existsSync, } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
4
|
-
import { readJsonFileWithSchema } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
5
5
|
import { METHOD_SCHEMA_FILE, compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
6
6
|
import { RuntimeStageContractSchema, } from "./lib/schema.js";
|
|
7
|
+
import { ACCEPTANCE_RULE_KEYS } from "../../contracts/lib/schema.js";
|
|
7
8
|
import { stageContractPath } from "./runtime-paths.js";
|
|
8
9
|
import { methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
9
10
|
import { loadState } from "./state-io.js";
|
|
@@ -17,18 +18,20 @@ function toFiniteNumber(value) {
|
|
|
17
18
|
function hasAcceptanceRules(acceptance) {
|
|
18
19
|
if (!acceptance)
|
|
19
20
|
return false;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
21
|
+
// Drive off the canonical rule-key list so a new key added to
|
|
22
|
+
// contracts/ is automatically considered here.
|
|
23
|
+
for (const key of ACCEPTANCE_RULE_KEYS) {
|
|
24
|
+
const value = acceptance[key];
|
|
25
|
+
if (Array.isArray(value)) {
|
|
26
|
+
if (value.length > 0)
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
else if (value && typeof value === "object") {
|
|
30
|
+
if (Object.keys(value).length > 0)
|
|
31
|
+
return true;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return false;
|
|
32
35
|
}
|
|
33
36
|
function readPathValue(record, keyPath) {
|
|
34
37
|
if (!record)
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type MethodStageDefinition } from "
|
|
1
|
+
import { type MethodStageDefinition } from "../../methods/package/method-definitions.js";
|
|
2
2
|
export declare function reconcileCompiledStageRun(dirPath: string, stage: Pick<MethodStageDefinition, "id" | "contractType" | "reads" | "writes">): boolean;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { existsSync, readFileSync, statSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { extname, join, relative } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
4
|
import { compiledZoneAbsolutePath, findCompiledSchemaZone, readCompiledSchemaFile, } from "./compiled-schema.js";
|
|
5
|
-
import { parseJsonFrontmatter } from "
|
|
5
|
+
import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
|
|
6
6
|
import { loadRuntimeRun } from "./runtime.js";
|
|
7
7
|
import { initCompiledState, loadState, refreshCompiledArtifacts, saveState, } from "./state.js";
|
|
8
8
|
import { compiledInventoryFromEntries } from "./runtime-inventory.js";
|
|
9
|
+
import { STANDARD_EVIDENCE_FRONTMATTER_KEYS, } from "../../contracts/lib/schema.js";
|
|
9
10
|
import { compiledRuntimeRoot, methodPackagePathForCompiled } from "./compiled-paths.js";
|
|
10
11
|
import { extractSynthAbstract, isOutputMarkdownFile } from "./validate.js";
|
|
11
12
|
function readActiveRunStartedAtMs(dirPath) {
|
|
@@ -80,15 +81,16 @@ function buildInventoryMetadata(options) {
|
|
|
80
81
|
metadata.abstract = abstract;
|
|
81
82
|
metadata.abstract_read = true;
|
|
82
83
|
}
|
|
84
|
+
// Project the standard evidence frontmatter keys onto the inventory
|
|
85
|
+
// metadata. Method authors that emit the canonical evidence keys
|
|
86
|
+
// (`STANDARD_EVIDENCE_FRONTMATTER_KEYS` in contracts) get them
|
|
87
|
+
// surfaced on stage inventory entries; non-standard keys are ignored.
|
|
83
88
|
const frontmatter = options.parsedFrontmatter.frontmatter;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
if (typeof frontmatter.truth_mode === "string") {
|
|
91
|
-
metadata.truth_mode = frontmatter.truth_mode;
|
|
89
|
+
for (const key of STANDARD_EVIDENCE_FRONTMATTER_KEYS) {
|
|
90
|
+
const value = frontmatter[key];
|
|
91
|
+
if (typeof value === "string") {
|
|
92
|
+
metadata[key] = value;
|
|
93
|
+
}
|
|
92
94
|
}
|
|
93
95
|
return metadata;
|
|
94
96
|
}
|