@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
|
@@ -2,13 +2,13 @@ import { cpSync, mkdirSync, mkdtempSync, renameSync, rmSync, writeFileSync, } fr
|
|
|
2
2
|
import { tmpdir } from "node:os";
|
|
3
3
|
import { dirname, join } from "node:path";
|
|
4
4
|
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
5
|
-
import { readInterfConfig, resolveSourceInputPath } from "
|
|
5
|
+
import { readInterfConfig, resolveSourceInputPath } from "../../project/interf.js";
|
|
6
6
|
import { projectSourceFilesTestQueryShell } from "../agents/lib/shells.js";
|
|
7
|
-
import { asPreparationDataDir, preparationPortableContextPath, } from "
|
|
8
|
-
import { saveCompiledInterfConfig } from "
|
|
9
|
-
import { buildCompiledSourceFiles } from "../
|
|
10
|
-
import { refreshCompiledArtifacts } from "../
|
|
11
|
-
import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../
|
|
7
|
+
import { asPreparationDataDir, preparationPortableContextPath, } from "../../contracts/lib/preparation-paths.js";
|
|
8
|
+
import { saveCompiledInterfConfig } from "../../project/source-config.js";
|
|
9
|
+
import { buildCompiledSourceFiles } from "../compile/source-files.js";
|
|
10
|
+
import { refreshCompiledArtifacts } from "../compile/state.js";
|
|
11
|
+
import { testRootForCompiled, stageExecutionShellsRoot, targetTestSandboxesRootForCompiled, methodImprovementLoopsRoot, compiledQueryAcceptanceRoot, compiledRuntimeLogsRoot, } from "../compile/compiled-paths.js";
|
|
12
12
|
function sanitizeCompiledArtifacts(compiledPath) {
|
|
13
13
|
for (const absolutePath of [
|
|
14
14
|
testRootForCompiled(compiledPath),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, readdirSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { basename, extname, join } from "node:path";
|
|
3
|
-
import { readJsonFileWithSchema } from "
|
|
3
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
4
4
|
import { TestSpecSchema } from "./lib/schema.js";
|
|
5
5
|
import { TEST_SPEC_EXTENSIONS, assertTestId, assertWritableTestSpecPath, testSpecFilePath, testSpecTypePath, normalizeTestId, } from "./test-paths.js";
|
|
6
6
|
function readTestSpecFile(filePath) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { listPortableContextsForSourceFolder } from "
|
|
2
|
-
import { computeCompiledHealth } from "../
|
|
3
|
-
import { DEFAULT_METHOD_ID, resolveMethodId } from "
|
|
1
|
+
import { listPortableContextsForSourceFolder } from "../../project/interf-detect.js";
|
|
2
|
+
import { computeCompiledHealth } from "../compile/state.js";
|
|
3
|
+
import { DEFAULT_METHOD_ID, resolveMethodId } from "../../methods/method-resolution.js";
|
|
4
4
|
function summarizeTargetSortKey(target) {
|
|
5
5
|
return `${target.name}\u0000${target.method}`;
|
|
6
6
|
}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import { validateMethodPackage } from "../
|
|
3
|
-
import type { SourceReadinessCheck } from "
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import { validateMethodPackage } from "../package/local-methods.js";
|
|
3
|
+
import type { SourceReadinessCheck } from "../../project/lib/schema.js";
|
|
4
|
+
/**
|
|
5
|
+
* Walk method.json after a successful authoring run and fill in
|
|
6
|
+
* `role: "general"` for any stage missing a role field. Custom role
|
|
7
|
+
* names are kept as-is. Idempotent — does nothing when every stage
|
|
8
|
+
* already declares a role. Returns the list of stage ids that were
|
|
9
|
+
* touched so the runtime can surface that to the user.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ensureStageRoles(methodPath: string): string[];
|
|
4
12
|
export interface MethodAuthoringRunResult {
|
|
5
13
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
6
14
|
changed: boolean;
|
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
import { rmSync } from "node:fs";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { existsSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { createMethodAuthoringShell } from "../../engine/agents/lib/shells.js";
|
|
4
|
+
import { createScratchLocalMethodPackage } from "../package/interf-method-package.js";
|
|
5
|
+
import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
|
|
6
|
+
import { loadMethodDefinitionFromDir, validateMethodPackage, methodDefinitionPath, } from "../package/local-methods.js";
|
|
6
7
|
import { runMethodEditSession } from "./method-edit-session.js";
|
|
8
|
+
/**
|
|
9
|
+
* Walk method.json after a successful authoring run and fill in
|
|
10
|
+
* `role: "general"` for any stage missing a role field. Custom role
|
|
11
|
+
* names are kept as-is. Idempotent — does nothing when every stage
|
|
12
|
+
* already declares a role. Returns the list of stage ids that were
|
|
13
|
+
* touched so the runtime can surface that to the user.
|
|
14
|
+
*/
|
|
15
|
+
export function ensureStageRoles(methodPath) {
|
|
16
|
+
const methodJsonPath = join(methodPath, "method.json");
|
|
17
|
+
if (!existsSync(methodJsonPath))
|
|
18
|
+
return [];
|
|
19
|
+
let raw;
|
|
20
|
+
try {
|
|
21
|
+
raw = readFileSync(methodJsonPath, "utf8");
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
let parsed;
|
|
27
|
+
try {
|
|
28
|
+
parsed = JSON.parse(raw);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
return [];
|
|
32
|
+
}
|
|
33
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
34
|
+
return [];
|
|
35
|
+
const value = parsed;
|
|
36
|
+
if (!Array.isArray(value.stages))
|
|
37
|
+
return [];
|
|
38
|
+
const touched = [];
|
|
39
|
+
let changed = false;
|
|
40
|
+
const nextStages = value.stages.map((stage) => {
|
|
41
|
+
if (!stage || typeof stage !== "object" || Array.isArray(stage))
|
|
42
|
+
return stage;
|
|
43
|
+
const stageRecord = stage;
|
|
44
|
+
const declaredRole = typeof stageRecord.role === "string" && stageRecord.role.trim().length > 0
|
|
45
|
+
? stageRecord.role.trim()
|
|
46
|
+
: null;
|
|
47
|
+
if (declaredRole)
|
|
48
|
+
return stage;
|
|
49
|
+
const id = typeof stageRecord.id === "string" ? stageRecord.id : "(unknown)";
|
|
50
|
+
touched.push(id);
|
|
51
|
+
changed = true;
|
|
52
|
+
return { ...stageRecord, role: "general" };
|
|
53
|
+
});
|
|
54
|
+
if (!changed)
|
|
55
|
+
return [];
|
|
56
|
+
value.stages = nextStages;
|
|
57
|
+
writeFileSync(methodJsonPath, `${JSON.stringify(value, null, 2)}\n`);
|
|
58
|
+
return touched;
|
|
59
|
+
}
|
|
7
60
|
function buildMethodAuthoringPrompt() {
|
|
8
61
|
return [
|
|
9
62
|
"This is an automated Interf Method-authoring run, not an open-ended chat session.",
|
|
@@ -21,6 +74,7 @@ function buildMethodAuthoringPrompt() {
|
|
|
21
74
|
"Keep the Method package valid for the current compiler API and `method.schema.json`.",
|
|
22
75
|
"Choose stage ids, stage order, reads, writes, acceptance criteria, and stage docs from the source data and preparation-and-evidence brief.",
|
|
23
76
|
"Use kebab-case ids everywhere: stage ids, skill_dir values, zone ids, reads/writes values, and package ids. Never use underscores.",
|
|
77
|
+
"Each stage MAY declare a `role`: one of `extractor`, `summarizer`, `structurer`, `verifier`, or `general`. Pick the role that best matches what the stage's prompt asks the agent to do. Omit `role` (or use `general`) when the stage doesn't fit any specialized role. Custom role names are allowed; the engine treats unknown roles as `general`.",
|
|
24
78
|
"Do not preserve the placeholder `prepare` stage unless the final Method genuinely needs a stage with that exact role.",
|
|
25
79
|
"When editing acceptance criteria: `zone_counts_at_least` maps declared zone ids to fixed numeric minimums.",
|
|
26
80
|
"`zone_counts_at_least_counts` also maps declared zone ids to runtime count-key strings such as `source_total`; `source_total` is a value, never a zone key.",
|
|
@@ -102,6 +156,15 @@ export async function runMethodAuthoringDraft(options) {
|
|
|
102
156
|
if (session.status !== "updated") {
|
|
103
157
|
rmSync(methodPath, { recursive: true, force: true });
|
|
104
158
|
}
|
|
159
|
+
else {
|
|
160
|
+
// 0.15 — auto-fill `role: "general"` for any stage the agent
|
|
161
|
+
// didn't explicitly tag. Idempotent and silent when every stage
|
|
162
|
+
// already declares a role.
|
|
163
|
+
const touched = ensureStageRoles(methodPath);
|
|
164
|
+
if (touched.length > 0 && options.onStatus) {
|
|
165
|
+
options.onStatus(`STATUS: filled role=general on ${touched.length} stage(s) the author didn't tag (${touched.join(", ")}).`);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
105
168
|
return {
|
|
106
169
|
status: session.status,
|
|
107
170
|
changed: session.changed,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import type { MethodValidationResult } from "../
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import type { MethodValidationResult } from "../package/local-methods.js";
|
|
3
3
|
import { type MethodEditShellArtifacts } from "./lib/method-edit-utils.js";
|
|
4
4
|
export interface MethodEditSessionResult {
|
|
5
5
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { MethodExecutor } from "
|
|
2
|
-
import { type MethodValidationResult } from "../
|
|
3
|
-
import type { SourcePreparationConfig } from "
|
|
4
|
-
import type { MethodImprovementLoopSummary } from "
|
|
1
|
+
import type { MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import { type MethodValidationResult } from "../package/local-methods.js";
|
|
3
|
+
import type { SourcePreparationConfig } from "../../project/lib/schema.js";
|
|
4
|
+
import type { MethodImprovementLoopSummary } from "../../engine/compile/lib/schema.js";
|
|
5
5
|
export interface MethodImprovementRunResult {
|
|
6
6
|
status: "updated" | "no-change" | "invalid" | "executor-failed";
|
|
7
7
|
changed: boolean;
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { appendFileSync, existsSync, mkdirSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { join, relative } from "node:path";
|
|
3
|
-
import { createMethodImprovementShell, freezeMethodImprovementShell, } from "
|
|
4
|
-
import { validateMethodPackage } from "../
|
|
5
|
-
import { CONTEXT_INTERFACE_FILE } from "../
|
|
6
|
-
import { readJsonFileWithSchema } from "
|
|
7
|
-
import { resolveMethodImprovementReviewPaths } from "../
|
|
8
|
-
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "
|
|
9
|
-
import { readInterfConfig } from "
|
|
10
|
-
import { saveCompiledInterfConfig } from "
|
|
11
|
-
import { MethodImprovementRunLedgerSchema, } from "
|
|
3
|
+
import { createMethodImprovementShell, freezeMethodImprovementShell, } from "../../engine/agents/lib/shells.js";
|
|
4
|
+
import { validateMethodPackage } from "../package/local-methods.js";
|
|
5
|
+
import { CONTEXT_INTERFACE_FILE } from "../package/context-interface.js";
|
|
6
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
7
|
+
import { resolveMethodImprovementReviewPaths } from "../package/method-review-paths.js";
|
|
8
|
+
import { targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, methodImprovementRunRoot, methodPackagePathForCompiled, } from "../../engine/compile/compiled-paths.js";
|
|
9
|
+
import { readInterfConfig } from "../../project/interf.js";
|
|
10
|
+
import { saveCompiledInterfConfig } from "../../project/source-config.js";
|
|
11
|
+
import { MethodImprovementRunLedgerSchema, } from "../../engine/compile/lib/schema.js";
|
|
12
12
|
import { runMethodEditSession } from "./method-edit-session.js";
|
|
13
|
+
import { ensureStageRoles } from "./method-authoring.js";
|
|
13
14
|
function toShellArtifactPath(absolutePath, sourceRoot, shellRoot) {
|
|
14
15
|
if (!absolutePath)
|
|
15
16
|
return null;
|
|
@@ -169,6 +170,11 @@ export async function runMethodImprovementLoop(options) {
|
|
|
169
170
|
validate: validateMethodPackage,
|
|
170
171
|
maxValidationRepairAttempts: 1,
|
|
171
172
|
});
|
|
173
|
+
if (session.status === "updated") {
|
|
174
|
+
// 0.15 — fill role=general on any stage the improvement run
|
|
175
|
+
// dropped a role from. Idempotent and silent when complete.
|
|
176
|
+
ensureStageRoles(methodRoot);
|
|
177
|
+
}
|
|
172
178
|
const preservedShellManifestPath = freezeMethodImprovementShell(shell.rootPath);
|
|
173
179
|
writeMethodImprovementRunLedger(options.compiledPath, options.runId, buildMethodImprovementLoopRecord({
|
|
174
180
|
targetName: compiledName,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type CompiledZoneKind } from "
|
|
1
|
+
import { type CompiledZoneKind } from "../../engine/compile/method-primitives.js";
|
|
2
2
|
declare const BUILTIN_COMPILED_STAGE_IDS: {
|
|
3
3
|
readonly SUMMARIZE: "summarize";
|
|
4
4
|
readonly STRUCTURE: "structure";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { join } from "node:path";
|
|
2
2
|
import { z } from "zod";
|
|
3
|
-
import { readJsonFileWithSchema } from "
|
|
4
|
-
import { MethodCompiledSchemaSchema } from "
|
|
3
|
+
import { readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
4
|
+
import { MethodCompiledSchemaSchema } from "../../engine/compile/lib/schema.js";
|
|
5
5
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
6
6
|
const BUILTIN_COMPILED_STAGE_IDS = {
|
|
7
7
|
SUMMARIZE: "summarize",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "
|
|
2
|
+
import { type MethodCompiledSchema, type MethodCompiledZone, type MethodZoneId } from "../../engine/compile/lib/schema.js";
|
|
3
3
|
export declare const CONTEXT_INTERFACE_FILE = "method.schema.json";
|
|
4
4
|
export declare const ContextInterfaceSchema: z.ZodObject<{
|
|
5
5
|
kind: z.ZodLiteral<"method-schema">;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { warnInterf } from "
|
|
5
|
-
import { readJsonFileUnchecked } from "
|
|
6
|
-
import { MethodCompiledSchemaSchema, MethodZoneIdSchema, } from "
|
|
4
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
5
|
+
import { readJsonFileUnchecked } from "../../contracts/utils/parse.js";
|
|
6
|
+
import { MethodCompiledSchemaSchema, MethodZoneIdSchema, } from "../../engine/compile/lib/schema.js";
|
|
7
7
|
import { listBuiltinCompiledZoneSpecs, requiredCompiledZoneOwners, } from "./builtin-compiled-method.js";
|
|
8
8
|
// Method packages define the context interface. The compiler persists the
|
|
9
9
|
// same schema on disk, but higher layers should prefer this boundary when they
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, mkdirSync, writeFileSync } from "node:fs";
|
|
2
2
|
import { dirname, join } from "node:path";
|
|
3
|
-
import { renderCompiledQuerySkill } from "
|
|
3
|
+
import { renderCompiledQuerySkill } from "../../engine/agents/lib/shells.js";
|
|
4
4
|
import { copyMethodPackageDirectory, isPortableMethodPackage, patchMethodPackageMetadata, resolveMethodPackageSourcePath, methodDefinitionPath, mergeStagePolicyNotesForStages, } from "./local-methods.js";
|
|
5
5
|
import { getCompiledMethod, } from "./method-definitions.js";
|
|
6
6
|
import { CONTEXT_INTERFACE_FILE, deriveMethodInputsFromContextInterface, summarizeContextInterface, writeContextInterface, writeContextInterfaceFile, } from "./context-interface.js";
|
|
7
|
-
import { methodPackagePathForCompiled } from "
|
|
7
|
+
import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
8
8
|
function writeMethodStarterDocs(dirPath, docs, options) {
|
|
9
9
|
for (const doc of docs ?? []) {
|
|
10
10
|
const targetPath = join(dirPath, doc.relativePath);
|
|
@@ -456,6 +456,7 @@ export function createScratchLocalMethodPackage(options) {
|
|
|
456
456
|
description: "Neutral placeholder stage for Method authoring. Replace this stage with the topology this agent work needs.",
|
|
457
457
|
contractType: "method-draft-stage",
|
|
458
458
|
skillDir: "prepare",
|
|
459
|
+
role: "general",
|
|
459
460
|
reads: ["runtime"],
|
|
460
461
|
writes: ["draft-context"],
|
|
461
462
|
acceptance: {
|
|
@@ -2,5 +2,5 @@ import { dirname, join } from "node:path";
|
|
|
2
2
|
import { fileURLToPath } from "node:url";
|
|
3
3
|
const __filename = fileURLToPath(import.meta.url);
|
|
4
4
|
const __dirname = dirname(__filename);
|
|
5
|
-
// Package root (dist/packages/
|
|
6
|
-
export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..");
|
|
5
|
+
// Package root (dist/packages/methods/package/lib/ -> package root)
|
|
6
|
+
export const PACKAGE_ROOT = join(__dirname, "..", "..", "..", "..", "..");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } from "
|
|
3
|
-
import { RuntimeContractTypeSchema } from "
|
|
2
|
+
import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema } from "../../engine/compile/lib/schema.js";
|
|
3
|
+
import { RuntimeContractTypeSchema } from "../../contracts/lib/schema.js";
|
|
4
4
|
import { MethodInputSpecSchema, type ContextInterface, type MethodInputSpec } from "./context-interface.js";
|
|
5
5
|
export interface LocalMethodStarterDoc {
|
|
6
6
|
relativePath: string;
|
|
@@ -12,6 +12,12 @@ export interface LocalMethodStageDefinition {
|
|
|
12
12
|
contract_type: z.infer<typeof RuntimeContractTypeSchema>;
|
|
13
13
|
skill_dir?: string;
|
|
14
14
|
description?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Optional role hint. Open-ended string; defaults to `general` at the
|
|
17
|
+
* runtime layer when missing. Maps to a connected agent via the user's
|
|
18
|
+
* role-map (`~/.interf/agents.json`).
|
|
19
|
+
*/
|
|
20
|
+
role?: string;
|
|
15
21
|
reads: z.infer<typeof MethodStageZoneAccessSchema>;
|
|
16
22
|
writes: z.infer<typeof MethodStageZoneAccessSchema>;
|
|
17
23
|
acceptance?: z.infer<typeof RuntimeStageAcceptanceSchema>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { cpSync, existsSync, mkdirSync, readdirSync, readFileSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { basename, dirname, join, relative } from "node:path";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { listFilesRecursive } from "
|
|
5
|
-
import { warnInterf } from "
|
|
6
|
-
import { readJsonFileUnchecked, readJsonFileWithSchema } from "
|
|
7
|
-
import { isMarkdownFile } from "
|
|
8
|
-
import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema, } from "
|
|
9
|
-
import { RuntimeContractTypeSchema, InterfIdPattern, } from "
|
|
10
|
-
import { asPreparationDataDir, preparationMethodsRoot, } from "
|
|
4
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
5
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
6
|
+
import { readJsonFileUnchecked, readJsonFileWithSchema } from "../../contracts/utils/parse.js";
|
|
7
|
+
import { isMarkdownFile } from "../../contracts/utils/file-types.js";
|
|
8
|
+
import { MethodCompilerApiSchema, RuntimeStageAcceptanceSchema, MethodPurposeSchema, MethodStageZoneAccessSchema, } from "../../engine/compile/lib/schema.js";
|
|
9
|
+
import { RuntimeContractTypeSchema, InterfIdPattern, } from "../../contracts/lib/schema.js";
|
|
10
|
+
import { asPreparationDataDir, preparationMethodsRoot, } from "../../contracts/lib/preparation-paths.js";
|
|
11
11
|
import { listBuiltinCompiledZoneSpecs, } from "./builtin-compiled-method.js";
|
|
12
12
|
import { CONTEXT_INTERFACE_FILE, ContextInterfaceSchema, contextInterfaceExists, contextInterfaceFilePath, readContextInterface, MethodInputSpecSchema, writeContextInterface, } from "./context-interface.js";
|
|
13
13
|
import { PACKAGE_ROOT } from "./lib/package-root.js";
|
|
@@ -17,6 +17,7 @@ const LocalMethodStageDefinitionSchema = z.object({
|
|
|
17
17
|
contract_type: RuntimeContractTypeSchema,
|
|
18
18
|
skill_dir: z.string().regex(InterfIdPattern).optional(),
|
|
19
19
|
description: z.string().min(1).optional(),
|
|
20
|
+
role: z.string().min(1).optional(),
|
|
20
21
|
reads: MethodStageZoneAccessSchema,
|
|
21
22
|
writes: MethodStageZoneAccessSchema,
|
|
22
23
|
acceptance: RuntimeStageAcceptanceSchema.optional(),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LocalMethodDefinition } from "./local-methods.js";
|
|
2
|
-
import type { RuntimeStageAcceptance, MethodCompilerApi } from "
|
|
3
|
-
import type { MethodId, RuntimeContractType } from "
|
|
2
|
+
import type { RuntimeStageAcceptance, MethodCompilerApi } from "../../engine/compile/lib/schema.js";
|
|
3
|
+
import type { MethodId, RuntimeContractType } from "../../contracts/lib/schema.js";
|
|
4
4
|
import { type ContextInterface, type ContextInterfaceZoneId, type MethodInputSpec } from "./context-interface.js";
|
|
5
5
|
export interface MethodStarterDoc {
|
|
6
6
|
relativePath: string;
|
|
@@ -12,6 +12,12 @@ export interface MethodStageDefinition {
|
|
|
12
12
|
description: string;
|
|
13
13
|
contractType: RuntimeContractType;
|
|
14
14
|
skillDir: string;
|
|
15
|
+
/**
|
|
16
|
+
* Role hint declared by the Method package. Defaults to `general` when
|
|
17
|
+
* absent; mapped to a connected agent via the user's role-map at run
|
|
18
|
+
* time.
|
|
19
|
+
*/
|
|
20
|
+
role: string;
|
|
15
21
|
reads: ContextInterfaceZoneId[];
|
|
16
22
|
writes: ContextInterfaceZoneId[];
|
|
17
23
|
acceptance?: RuntimeStageAcceptance;
|
|
@@ -2,10 +2,10 @@ import { existsSync } from "node:fs";
|
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { builtinMethodPackagePath, isMethodId, listLocalMethodDefinitions, loadLocalMethodDefinition, loadMethodDefinitionFromDir, mergeStagePolicyNotesForStages, } from "./local-methods.js";
|
|
4
4
|
import { listUserMethodDefinitions, loadUserMethodDefinition, } from "./user-methods.js";
|
|
5
|
-
import { warnInterf } from "
|
|
6
|
-
import { methodPackagePathForCompiled } from "
|
|
7
|
-
import { asPreparationDataDir, preparationMethodPackagePath } from "
|
|
8
|
-
import { resolveSourceControlPath } from "
|
|
5
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
6
|
+
import { methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
7
|
+
import { asPreparationDataDir, preparationMethodPackagePath } from "../../contracts/lib/preparation-paths.js";
|
|
8
|
+
import { resolveSourceControlPath } from "../../project/interf.js";
|
|
9
9
|
import { deriveMethodInputsFromContextInterface, } from "./context-interface.js";
|
|
10
10
|
const DEFAULT_METHOD_ID = "interf-default";
|
|
11
11
|
let builtinDefaultMethodCache = null;
|
|
@@ -16,6 +16,7 @@ function toMethodStages(stages) {
|
|
|
16
16
|
description: stage.description ?? stage.label,
|
|
17
17
|
contractType: stage.contract_type,
|
|
18
18
|
skillDir: stage.skill_dir ?? stage.id,
|
|
19
|
+
role: stage.role && stage.role.trim().length > 0 ? stage.role : "general",
|
|
19
20
|
reads: [...stage.reads],
|
|
20
21
|
writes: [...stage.writes],
|
|
21
22
|
...(stage.acceptance ? { acceptance: stage.acceptance } : {}),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "
|
|
1
|
+
import { type LocalInstructionMode, type RuntimeInstructionMode, type RuntimeStageInstructions } from "../../engine/compile/lib/schema.js";
|
|
2
2
|
import { type MethodStageDefinition } from "./method-definitions.js";
|
|
3
3
|
export interface MethodReporter {
|
|
4
4
|
line?: (message: string) => void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { existsSync, readFileSync } from "node:fs";
|
|
2
2
|
import { join, relative, sep } from "node:path";
|
|
3
|
-
import { listFilesRecursive } from "
|
|
4
|
-
import { parseJsonFrontmatter } from "
|
|
5
|
-
import { isMarkdownFile } from "
|
|
3
|
+
import { listFilesRecursive } from "../../contracts/utils/filesystem.js";
|
|
4
|
+
import { parseJsonFrontmatter } from "../../contracts/utils/parse.js";
|
|
5
|
+
import { isMarkdownFile } from "../../contracts/utils/file-types.js";
|
|
6
6
|
import { getCompiledMethod, } from "./method-definitions.js";
|
|
7
|
-
import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "
|
|
7
|
+
import { COMPILED_METHOD_DIR, methodPackagePathForCompiled } from "../../engine/compile/compiled-paths.js";
|
|
8
8
|
const LOCAL_SKILL_READ_LIMIT = 50;
|
|
9
9
|
export function methodCompileStageDirectory(stageDir) {
|
|
10
10
|
return `${COMPILED_METHOD_DIR}/compile/stages/${stageDir}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MethodImprovementContext } from "
|
|
1
|
+
import type { MethodImprovementContext } from "../../engine/compile/lib/schema.js";
|
|
2
2
|
export interface MethodImprovementReviewSourcePaths {
|
|
3
3
|
compiledRuntime: string | null;
|
|
4
4
|
readinessRuns: string | null;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { existsSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
|
-
import { testRootForCompiled, targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, stageExecutionShellsRoot, compiledRuntimeRoot, } from "
|
|
3
|
+
import { testRootForCompiled, targetTestRunsRootForCompiled, targetTestSandboxesRootForCompiled, stageExecutionShellsRoot, compiledRuntimeRoot, } from "../../engine/compile/compiled-paths.js";
|
|
4
4
|
export function resolveMethodImprovementReviewSourcePaths(compiledPath) {
|
|
5
5
|
const compiledRuntime = compiledRuntimeRoot(compiledPath);
|
|
6
6
|
const readinessRuns = testRootForCompiled(compiledPath);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type MethodExecutor } from "
|
|
2
|
-
import { type RuntimeStageInstructions } from "
|
|
3
|
-
import type { RuntimeContractType } from "
|
|
4
|
-
import { type RuntimeStageContractDraft } from "
|
|
1
|
+
import { type MethodExecutor } from "../../engine/agents/lib/executors.js";
|
|
2
|
+
import { type RuntimeStageInstructions } from "../../engine/compile/lib/schema.js";
|
|
3
|
+
import type { RuntimeContractType } from "../../contracts/lib/schema.js";
|
|
4
|
+
import { type RuntimeStageContractDraft } from "../../engine/compile/runtime.js";
|
|
5
5
|
import { type MethodReporter, type MethodStageResult } from "./method-helpers.js";
|
|
6
6
|
interface MethodStageShape<TContractType extends RuntimeContractType> {
|
|
7
7
|
id: string;
|
|
@@ -31,13 +31,8 @@ interface ExecuteValidatedStageOptions<TContractType extends RuntimeContractType
|
|
|
31
31
|
summary: string;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
interface ExecuteValidatedSummarizeStageOptions<TContractType extends RuntimeContractType> extends ExecuteValidatedStageOptions<TContractType> {
|
|
35
|
-
startingSummaryCount: number;
|
|
36
|
-
targetCount: number;
|
|
37
|
-
}
|
|
38
34
|
export declare function findStageByContractType<TStage extends {
|
|
39
35
|
contractType: string;
|
|
40
36
|
}>(stages: TStage[], contractType: TStage["contractType"]): TStage;
|
|
41
37
|
export declare function executeValidatedStage<TContractType extends RuntimeContractType>(options: ExecuteValidatedStageOptions<TContractType>): Promise<MethodStageResult>;
|
|
42
|
-
export declare function executeValidatedSummarizeStage<TContractType extends RuntimeContractType>(options: ExecuteValidatedSummarizeStageOptions<TContractType>): Promise<MethodStageResult>;
|
|
43
38
|
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { markRuntimeRunSucceededAfterValidation, buildStagePrompt, markRuntimeRunFailedAfterValidation, runExecutorStage,
|
|
1
|
+
import { markRuntimeRunSucceededAfterValidation, buildStagePrompt, markRuntimeRunFailedAfterValidation, runExecutorStage, } from "../../engine/compile/runtime.js";
|
|
2
2
|
import { reportValidationFailure, } from "./method-helpers.js";
|
|
3
3
|
export function findStageByContractType(stages, contractType) {
|
|
4
4
|
const stage = stages.find((candidate) => candidate.contractType === contractType);
|
|
@@ -33,34 +33,6 @@ export async function executeValidatedStage(options) {
|
|
|
33
33
|
});
|
|
34
34
|
return finalizeValidatedStage(options, code);
|
|
35
35
|
}
|
|
36
|
-
export async function executeValidatedSummarizeStage(options) {
|
|
37
|
-
const completionCheck = options.completionCheck
|
|
38
|
-
? () => {
|
|
39
|
-
options.syncWrites?.();
|
|
40
|
-
options.reconcile?.();
|
|
41
|
-
return options.completionCheck?.() === true;
|
|
42
|
-
}
|
|
43
|
-
: undefined;
|
|
44
|
-
const code = await runExecutorSummarizeStage({
|
|
45
|
-
executor: options.executor,
|
|
46
|
-
compiledPath: options.compiledPath,
|
|
47
|
-
executionPath: options.executionPath,
|
|
48
|
-
compiledName: options.targetName,
|
|
49
|
-
method: options.method,
|
|
50
|
-
methodSourcePath: options.methodSourcePath,
|
|
51
|
-
stage: options.stageDefinition.id,
|
|
52
|
-
stageLabel: options.stageDefinition.label,
|
|
53
|
-
contractType: options.stageDefinition.contractType,
|
|
54
|
-
summary: options.summary,
|
|
55
|
-
contract: options.contract,
|
|
56
|
-
buildPrompt: (contractPath) => buildStagePrompt(options.instructions, contractPath, options.statusLines),
|
|
57
|
-
completionCheck,
|
|
58
|
-
onStatus: options.onStatus,
|
|
59
|
-
startingSummaryCount: options.startingSummaryCount,
|
|
60
|
-
targetCount: options.targetCount,
|
|
61
|
-
});
|
|
62
|
-
return finalizeValidatedStage(options, code);
|
|
63
|
-
}
|
|
64
36
|
function finalizeValidatedStage(options, code) {
|
|
65
37
|
const refreshAndValidate = () => {
|
|
66
38
|
options.syncWrites?.();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { cpSync, existsSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { dirname, join, resolve } from "node:path";
|
|
3
|
-
import { warnInterf } from "
|
|
4
|
-
import { userMethodPackagePath, userMethodsRoot, } from "
|
|
3
|
+
import { warnInterf } from "../../contracts/utils/logger.js";
|
|
4
|
+
import { userMethodPackagePath, userMethodsRoot, } from "../../contracts/lib/preparation-paths.js";
|
|
5
5
|
import { loadMethodDefinitionFromDir, } from "./local-methods.js";
|
|
6
6
|
export function userMethodPath(id) {
|
|
7
7
|
return userMethodPackagePath(id);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "../agents/lib/compiled-bootstrap.js";
|
|
1
|
+
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "../engine/agents/lib/compiled-bootstrap.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "../agents/lib/compiled-bootstrap.js";
|
|
1
|
+
export { refreshCompiledBootstrapGuidance, renderClaudeBootstrap, } from "../engine/agents/lib/compiled-bootstrap.js";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { existsSync, readdirSync, statSync, } from "node:fs";
|
|
2
2
|
import { join, resolve } from "node:path";
|
|
3
|
-
import { warnInterf } from "../
|
|
4
|
-
import { readJsonFileUnchecked } from "../
|
|
3
|
+
import { warnInterf } from "../contracts/utils/logger.js";
|
|
4
|
+
import { readJsonFileUnchecked } from "../contracts/utils/parse.js";
|
|
5
5
|
import { asPreparationDataDir, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
|
|
6
|
-
import { resolveSourceControlPathForCompiled, compiledInterfConfigPath, } from "../
|
|
6
|
+
import { resolveSourceControlPathForCompiled, compiledInterfConfigPath, } from "../engine/compile/compiled-paths.js";
|
|
7
7
|
import { InterfConfigSchema, } from "./lib/schema.js";
|
|
8
|
-
import { assertPathWithinRoot } from "../
|
|
8
|
+
import { assertPathWithinRoot } from "../contracts/utils/path-guards.js";
|
|
9
9
|
export const INTERF_CONTAINER_NAME = "interf";
|
|
10
10
|
export const METHOD_CONTAINER_NAME = "methods";
|
|
11
11
|
export const TEST_CONTAINER_NAME = "tests";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { mkdirSync, existsSync, writeFileSync, } from "node:fs";
|
|
2
2
|
import { basename, join, relative, sep } from "node:path";
|
|
3
|
-
import { getCompiledMethod } from "../
|
|
4
|
-
import { loadMethodDefinitionFromDir, seedLocalDefaultMethod } from "../
|
|
5
|
-
import { initializeCompiledRuntimeState, } from "../
|
|
6
|
-
import { refreshCompiledBootstrapGuidance } from "../agents/lib/compiled-bootstrap.js";
|
|
3
|
+
import { getCompiledMethod } from "../methods/package/method-definitions.js";
|
|
4
|
+
import { loadMethodDefinitionFromDir, seedLocalDefaultMethod } from "../methods/package/local-methods.js";
|
|
5
|
+
import { initializeCompiledRuntimeState, } from "../engine/compile/state.js";
|
|
6
|
+
import { refreshCompiledBootstrapGuidance } from "../engine/agents/lib/compiled-bootstrap.js";
|
|
7
7
|
import { assertCompiledContainer, assertCompiledName, } from "./interf-detect.js";
|
|
8
|
-
import { seedCompiledMethodPackage } from "../
|
|
8
|
+
import { seedCompiledMethodPackage } from "../methods/package/interf-method-package.js";
|
|
9
9
|
import { asPreparationDataDir, preparationPortableContextPath, } from "../contracts/lib/preparation-paths.js";
|
|
10
|
-
import { ensureCompiledZoneTargets, readCompiledSchemaFile } from "../
|
|
10
|
+
import { ensureCompiledZoneTargets, readCompiledSchemaFile } from "../engine/compile/compiled-schema.js";
|
|
11
11
|
import { findSourcePreparationConfig, loadSourceFolderConfig, methodIdForSourcePreparationConfig, resolveSourcePreparationPath, saveCompiledInterfConfig, } from "./source-config.js";
|
|
12
|
-
import { defaultControlPathForCompiled, testRootForCompiled, methodPackagePathForCompiled } from "../
|
|
12
|
+
import { defaultControlPathForCompiled, testRootForCompiled, methodPackagePathForCompiled } from "../engine/compile/compiled-paths.js";
|
|
13
13
|
import { DEFAULT_METHOD_ID } from "../methods/method-resolution.js";
|
|
14
14
|
const DEFAULT_INTERFIGNORE = [
|
|
15
15
|
".claude/",
|
|
@@ -38,7 +38,7 @@ export declare const SourcePreparationConfigSchema: z.ZodObject<{
|
|
|
38
38
|
}, z.core.$strict>;
|
|
39
39
|
export declare const SourceFolderBindingSchema: z.ZodObject<{
|
|
40
40
|
path: z.ZodString;
|
|
41
|
-
}, z.core.$
|
|
41
|
+
}, z.core.$loose>;
|
|
42
42
|
export declare const CompiledInterfConfigSchema: z.ZodObject<{
|
|
43
43
|
type: z.ZodLiteral<"compiled">;
|
|
44
44
|
name: z.ZodString;
|
|
@@ -102,7 +102,7 @@ export declare const InterfConfigSchema: z.ZodObject<{
|
|
|
102
102
|
export declare const SourceFolderConfigSchema: z.ZodObject<{
|
|
103
103
|
source_folder: z.ZodOptional<z.ZodObject<{
|
|
104
104
|
path: z.ZodString;
|
|
105
|
-
}, z.core.$
|
|
105
|
+
}, z.core.$loose>>;
|
|
106
106
|
preparations: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
107
107
|
id: z.ZodOptional<z.ZodString>;
|
|
108
108
|
name: z.ZodString;
|
|
@@ -65,7 +65,7 @@ export const SourcePreparationConfigSchema = z.object({
|
|
|
65
65
|
}).strict();
|
|
66
66
|
export const SourceFolderBindingSchema = z.object({
|
|
67
67
|
path: z.string().min(1),
|
|
68
|
-
}).
|
|
68
|
+
}).passthrough();
|
|
69
69
|
export const CompiledInterfConfigSchema = z.object({
|
|
70
70
|
type: z.literal("compiled"),
|
|
71
71
|
name: PreparationNameSchema,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type InterfConfig, type SourceFolderBinding, type SourceReadinessCheck, type SourcePreparationConfig, type SourceFolderConfig } from "./lib/schema.js";
|
|
2
|
-
import type { TestSpec, TestTargetType } from "../
|
|
2
|
+
import type { TestSpec, TestTargetType } from "../engine/verify/lib/schema.js";
|
|
3
3
|
export declare const SOURCE_FOLDER_CONFIG_FILE = "interf.json";
|
|
4
4
|
export declare const SOURCE_FOLDER_CONFIG_PATH = "interf.json";
|
|
5
5
|
export interface LoadedSourceTestSpec extends TestSpec {
|