@interf/compiler 0.22.2 → 0.50.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 +119 -282
- package/dist/bin-mcp.d.ts +2 -0
- package/dist/bin-mcp.js +63 -0
- package/dist/bin-runtime.d.ts +2 -0
- package/dist/bin-runtime.js +111 -0
- package/dist/cli/commands/agents.js +4 -35
- package/dist/cli/commands/auth.d.ts +20 -0
- package/dist/cli/commands/auth.js +161 -0
- package/dist/cli/commands/benchmark.d.ts +9 -0
- package/dist/cli/commands/benchmark.js +58 -0
- package/dist/cli/commands/build-plan.js +107 -139
- package/dist/cli/commands/build.d.ts +3 -4
- package/dist/cli/commands/build.js +16 -45
- package/dist/cli/commands/doctor.js +3 -3
- package/dist/cli/commands/graphs.d.ts +2 -0
- package/dist/cli/commands/graphs.js +344 -0
- package/dist/cli/commands/login.js +4 -6
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +4 -2
- package/dist/cli/commands/mcp.js +846 -232
- package/dist/cli/commands/project.d.ts +2 -0
- package/dist/cli/commands/project.js +176 -0
- package/dist/cli/commands/reset.d.ts +3 -4
- package/dist/cli/commands/reset.js +10 -31
- package/dist/cli/commands/runs.js +136 -57
- package/dist/cli/commands/runtime.d.ts +24 -0
- package/dist/cli/commands/runtime.js +373 -0
- package/dist/cli/commands/status.d.ts +1 -0
- package/dist/cli/commands/status.js +35 -45
- package/dist/cli/commands/traces.d.ts +2 -0
- package/dist/cli/commands/traces.js +97 -0
- package/dist/cli/commands/wizard.js +171 -178
- package/dist/cli/index.d.ts +7 -4
- package/dist/cli/index.js +13 -7
- package/dist/cli/lib/http-client.d.ts +39 -0
- package/dist/cli/lib/http-client.js +73 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/build-plans/authoring/brief.d.ts +538 -0
- package/dist/packages/build-plans/authoring/brief.js +89 -0
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +52 -11
- package/dist/packages/build-plans/authoring/build-plan-authoring.js +493 -46
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +10 -1
- package/dist/packages/build-plans/authoring/build-plan-edit-session.js +27 -4
- package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +9 -6
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +97 -46
- package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.d.ts +1 -0
- package/dist/packages/build-plans/authoring/lib/build-plan-edit-utils.js +7 -7
- package/dist/packages/build-plans/build-plan-resolution.d.ts +1 -1
- package/dist/packages/build-plans/build-plan-resolution.js +3 -3
- package/dist/packages/build-plans/index.d.ts +1 -1
- package/dist/packages/build-plans/index.js +1 -1
- package/dist/packages/build-plans/package/build-plan-definitions.d.ts +14 -13
- package/dist/packages/build-plans/package/build-plan-definitions.js +45 -42
- package/dist/packages/build-plans/package/build-plan-helpers.d.ts +3 -2
- package/dist/packages/build-plans/package/build-plan-helpers.js +27 -13
- package/dist/packages/build-plans/package/build-plan-review-paths.d.ts +5 -5
- package/dist/packages/build-plans/package/build-plan-review-paths.js +15 -15
- package/dist/packages/build-plans/package/build-plan-stage-runner.d.ts +5 -4
- package/dist/packages/build-plans/package/build-plan-stage-runner.js +23 -11
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +7 -8
- package/dist/packages/build-plans/package/builtin-build-plan.js +10 -11
- package/dist/packages/build-plans/package/context-interface.d.ts +14 -9
- package/dist/packages/build-plans/package/context-interface.js +14 -33
- package/dist/packages/build-plans/package/interf-build-plan-package.d.ts +6 -17
- package/dist/packages/build-plans/package/interf-build-plan-package.js +68 -64
- package/dist/packages/build-plans/package/local-build-plans.d.ts +21 -14
- package/dist/packages/build-plans/package/local-build-plans.js +105 -55
- package/dist/packages/build-plans/package/user-build-plans.js +1 -1
- package/dist/packages/contracts/index.d.ts +5 -2
- package/dist/packages/contracts/index.js +3 -1
- package/dist/packages/contracts/lib/context-graph-layer.d.ts +161 -0
- package/dist/packages/contracts/lib/context-graph-layer.js +216 -0
- package/dist/packages/contracts/lib/project-paths.d.ts +144 -0
- package/dist/packages/contracts/lib/project-paths.js +220 -0
- package/dist/packages/contracts/lib/project-schema.d.ts +423 -0
- package/dist/packages/contracts/lib/project-schema.js +138 -0
- package/dist/packages/contracts/lib/schema.d.ts +1273 -81
- package/dist/packages/contracts/lib/schema.js +675 -79
- package/dist/packages/contracts/utils/filesystem.d.ts +1 -0
- package/dist/packages/contracts/utils/filesystem.js +29 -1
- package/dist/packages/contracts/utils/parse.js +67 -0
- package/dist/packages/projects/index.d.ts +6 -0
- package/dist/packages/{project → projects}/index.js +0 -3
- package/dist/packages/{project → projects}/interf-detect.d.ts +12 -12
- package/dist/packages/{project → projects}/interf-detect.js +56 -50
- package/dist/packages/projects/interf.d.ts +2 -0
- package/dist/packages/projects/interf.js +1 -0
- package/dist/packages/projects/lib/schema.d.ts +77 -0
- package/dist/packages/projects/lib/schema.js +91 -0
- package/dist/packages/projects/source-config.d.ts +53 -0
- package/dist/packages/projects/source-config.js +339 -0
- package/dist/packages/projects/source-folders.d.ts +11 -0
- package/dist/packages/{project → projects}/source-folders.js +26 -26
- package/dist/packages/{engine → runtime}/action-planner.d.ts +1 -1
- package/dist/packages/{engine → runtime}/action-planner.js +20 -22
- package/dist/packages/runtime/action-values.d.ts +1 -0
- package/dist/packages/runtime/action-values.js +1 -0
- package/dist/packages/runtime/actions/errors.d.ts +2 -0
- package/dist/packages/runtime/actions/errors.js +12 -0
- package/dist/packages/runtime/actions/fields.d.ts +86 -0
- package/dist/packages/runtime/actions/form-builders.d.ts +14 -0
- package/dist/packages/runtime/actions/form-builders.js +667 -0
- package/dist/packages/runtime/actions/form-validators.d.ts +8 -0
- package/dist/packages/runtime/actions/form-validators.js +134 -0
- package/dist/packages/runtime/actions/helpers.d.ts +11 -0
- package/dist/packages/runtime/actions/helpers.js +80 -0
- package/dist/packages/runtime/actions/index.d.ts +8 -0
- package/dist/packages/runtime/actions/index.js +11 -0
- package/dist/packages/runtime/actions/registry.d.ts +64 -0
- package/dist/packages/runtime/actions/registry.js +62 -0
- package/dist/packages/runtime/actions/requests.d.ts +45 -0
- package/dist/packages/runtime/actions/requests.js +164 -0
- package/dist/packages/runtime/actions/schemas.d.ts +161 -0
- package/dist/packages/runtime/actions/schemas.js +37 -0
- package/dist/packages/runtime/agent-handoff.d.ts +11 -0
- package/dist/packages/runtime/agent-handoff.js +102 -0
- package/dist/packages/{engine → runtime}/agents/index.d.ts +1 -2
- package/dist/packages/{engine → runtime}/agents/index.js +1 -2
- package/dist/packages/runtime/agents/lib/args.d.ts +14 -0
- package/dist/packages/runtime/agents/lib/args.js +24 -0
- package/dist/packages/{engine → runtime}/agents/lib/constants.d.ts +4 -1
- package/dist/packages/runtime/agents/lib/constants.js +13 -0
- package/dist/packages/runtime/agents/lib/context-graph-bootstrap.d.ts +3 -0
- package/dist/packages/{engine/agents/lib/verifiable-context-bootstrap.js → runtime/agents/lib/context-graph-bootstrap.js} +5 -6
- package/dist/packages/{engine → runtime}/agents/lib/detection.d.ts +5 -0
- package/dist/packages/{engine → runtime}/agents/lib/detection.js +16 -7
- package/dist/packages/{engine → runtime}/agents/lib/execution-profile.d.ts +14 -0
- package/dist/packages/{engine → runtime}/agents/lib/execution-profile.js +31 -14
- package/dist/packages/{engine → runtime}/agents/lib/execution.js +22 -6
- package/dist/packages/{engine → runtime}/agents/lib/executors.d.ts +1 -0
- package/dist/packages/{engine → runtime}/agents/lib/executors.js +11 -2
- package/dist/packages/runtime/agents/lib/logs.d.ts +12 -0
- package/dist/packages/runtime/agents/lib/logs.js +41 -0
- package/dist/packages/{engine → runtime}/agents/lib/preflight.js +19 -14
- package/dist/packages/runtime/agents/lib/render.d.ts +26 -0
- package/dist/packages/{engine → runtime}/agents/lib/render.js +48 -22
- package/dist/packages/runtime/agents/lib/shell-fs.d.ts +18 -0
- package/dist/packages/runtime/agents/lib/shell-fs.js +190 -0
- package/dist/packages/runtime/agents/lib/shell-paths.d.ts +16 -0
- package/dist/packages/runtime/agents/lib/shell-paths.js +63 -0
- package/dist/packages/runtime/agents/lib/shell-projection.d.ts +25 -0
- package/dist/packages/runtime/agents/lib/shell-projection.js +314 -0
- package/dist/packages/runtime/agents/lib/shell-templates.d.ts +30 -0
- package/dist/packages/runtime/agents/lib/shell-templates.js +494 -0
- package/dist/packages/runtime/agents/lib/shell-workspace.d.ts +17 -0
- package/dist/packages/runtime/agents/lib/shell-workspace.js +70 -0
- package/dist/packages/runtime/agents/lib/shells.d.ts +92 -0
- package/dist/packages/runtime/agents/lib/shells.js +509 -0
- package/dist/packages/runtime/agents/lib/source-context-scan.d.ts +10 -0
- package/dist/packages/runtime/agents/lib/source-context-scan.js +388 -0
- package/dist/packages/{engine → runtime}/agents/lib/status.js +1 -14
- package/dist/packages/runtime/agents/lib/string-utils.d.ts +16 -0
- package/dist/packages/runtime/agents/lib/string-utils.js +36 -0
- package/dist/packages/{engine → runtime}/agents/lib/types.d.ts +1 -0
- package/dist/packages/{engine → runtime}/agents/lib/user-config.d.ts +8 -2
- package/dist/packages/{engine → runtime}/agents/lib/user-config.js +8 -2
- package/dist/packages/runtime/agents/providers/claude-code.d.ts +13 -0
- package/dist/packages/runtime/agents/providers/claude-code.js +45 -0
- package/dist/packages/runtime/agents/providers/codex.d.ts +17 -0
- package/dist/packages/runtime/agents/providers/codex.js +66 -0
- package/dist/packages/runtime/agents/providers/cursor.d.ts +9 -0
- package/dist/packages/runtime/agents/providers/cursor.js +24 -0
- package/dist/packages/runtime/agents/providers/index.d.ts +9 -0
- package/dist/packages/runtime/agents/providers/index.js +31 -0
- package/dist/packages/runtime/agents/providers/types.d.ts +50 -0
- package/dist/packages/{engine → runtime}/agents/registry.d.ts +13 -2
- package/dist/packages/{engine → runtime}/agents/registry.js +48 -10
- package/dist/packages/{engine → runtime}/agents/role-executors.d.ts +1 -1
- package/dist/packages/{engine → runtime}/agents/role-executors.js +9 -7
- package/dist/packages/{engine → runtime}/agents/role-router.js +7 -5
- package/dist/packages/runtime/auth/account-context.d.ts +52 -0
- package/dist/packages/runtime/auth/account-context.js +68 -0
- package/dist/packages/runtime/auth/auth-flow.d.ts +73 -0
- package/dist/packages/runtime/auth/auth-flow.js +189 -0
- package/dist/packages/runtime/auth/jwt-validator.d.ts +58 -0
- package/dist/packages/runtime/auth/jwt-validator.js +86 -0
- package/dist/packages/runtime/auth/keychain.d.ts +35 -0
- package/dist/packages/runtime/auth/keychain.js +85 -0
- package/dist/packages/runtime/auth/session-store.d.ts +38 -0
- package/dist/packages/runtime/auth/session-store.js +96 -0
- package/dist/packages/runtime/auth/workos-client.d.ts +58 -0
- package/dist/packages/runtime/auth/workos-client.js +87 -0
- package/dist/packages/runtime/benchmark-question-draft.d.ts +23 -0
- package/dist/packages/runtime/benchmark-question-draft.js +153 -0
- package/dist/packages/runtime/build/artifact-counts.d.ts +1 -0
- package/dist/packages/{engine → runtime}/build/artifact-counts.js +5 -9
- package/dist/packages/{engine → runtime}/build/artifact-status.d.ts +6 -6
- package/dist/packages/{engine → runtime}/build/artifact-status.js +26 -24
- package/dist/packages/runtime/build/atomic-fs.d.ts +3 -0
- package/dist/packages/runtime/build/atomic-fs.js +95 -0
- package/dist/packages/runtime/build/billing-events.d.ts +78 -0
- package/dist/packages/{engine → runtime}/build/billing-events.js +17 -19
- package/dist/packages/runtime/build/build-evidence.d.ts +16 -0
- package/dist/packages/runtime/build/build-evidence.js +179 -0
- package/dist/packages/{engine → runtime}/build/build-pipeline.d.ts +12 -8
- package/dist/packages/runtime/build/build-pipeline.js +388 -0
- package/dist/packages/{engine → runtime}/build/build-plan-primitives.d.ts +1 -1
- package/dist/packages/{engine → runtime}/build/build-plan-primitives.js +0 -1
- package/dist/packages/runtime/build/build-plan-runs.d.ts +14 -0
- package/dist/packages/runtime/build/build-plan-runs.js +31 -0
- package/dist/packages/runtime/build/build-stage-plan.d.ts +16 -0
- package/dist/packages/runtime/build/build-stage-plan.js +101 -0
- package/dist/packages/{engine → runtime}/build/build-stage-runner.d.ts +2 -1
- package/dist/packages/runtime/build/build-stage-runner.js +302 -0
- package/dist/packages/{engine → runtime}/build/build-target.d.ts +7 -4
- package/dist/packages/runtime/build/build-target.js +40 -0
- package/dist/packages/{engine → runtime}/build/check-evaluator.d.ts +14 -16
- package/dist/packages/runtime/build/check-evaluator.js +1226 -0
- package/dist/packages/runtime/build/context-graph-paths.d.ts +64 -0
- package/dist/packages/runtime/build/context-graph-paths.js +160 -0
- package/dist/packages/runtime/build/context-graph-schema.d.ts +19 -0
- package/dist/packages/runtime/build/context-graph-schema.js +39 -0
- package/dist/packages/{engine → runtime}/build/discovery.d.ts +2 -2
- package/dist/packages/{engine → runtime}/build/discovery.js +4 -4
- package/dist/packages/{engine → runtime}/build/index.d.ts +7 -5
- package/dist/packages/{engine → runtime}/build/index.js +7 -5
- package/dist/packages/runtime/build/inspect-map.d.ts +10 -0
- package/dist/packages/runtime/build/inspect-map.js +270 -0
- package/dist/packages/{engine → runtime}/build/lib/schema.d.ts +449 -123
- package/dist/packages/runtime/build/lib/schema.js +494 -0
- package/dist/packages/runtime/build/native-entrypoint.d.ts +2 -0
- package/dist/packages/runtime/build/native-entrypoint.js +286 -0
- package/dist/packages/runtime/build/reset.d.ts +2 -0
- package/dist/packages/runtime/build/reset.js +62 -0
- package/dist/packages/{engine → runtime}/build/runtime-contracts.js +13 -7
- package/dist/packages/runtime/build/runtime-inventory.d.ts +7 -0
- package/dist/packages/{engine → runtime}/build/runtime-inventory.js +3 -3
- package/dist/packages/runtime/build/runtime-log-paths.d.ts +3 -0
- package/dist/packages/runtime/build/runtime-log-paths.js +16 -0
- package/dist/packages/{engine → runtime}/build/runtime-prompt.js +12 -9
- package/dist/packages/{engine → runtime}/build/runtime-reconcile.d.ts +1 -1
- package/dist/packages/{engine → runtime}/build/runtime-reconcile.js +25 -21
- package/dist/packages/runtime/build/runtime-runs.d.ts +10 -0
- package/dist/packages/runtime/build/runtime-runs.js +318 -0
- package/dist/packages/{engine → runtime}/build/runtime-types.d.ts +9 -6
- package/dist/packages/runtime/build/runtime-types.js +1 -0
- package/dist/packages/runtime/build/runtime.d.ts +8 -0
- package/dist/packages/runtime/build/runtime.js +7 -0
- package/dist/packages/runtime/build/source-files.d.ts +58 -0
- package/dist/packages/runtime/build/source-files.js +193 -0
- package/dist/packages/runtime/build/source-inventory.d.ts +28 -0
- package/dist/packages/runtime/build/source-inventory.js +512 -0
- package/dist/packages/runtime/build/source-manifest.d.ts +63 -0
- package/dist/packages/runtime/build/source-manifest.js +220 -0
- package/dist/packages/runtime/build/stage-evidence.d.ts +22 -0
- package/dist/packages/runtime/build/stage-evidence.js +386 -0
- package/dist/packages/runtime/build/stage-manifest.d.ts +45 -0
- package/dist/packages/runtime/build/stage-manifest.js +1125 -0
- package/dist/packages/runtime/build/stage-reuse.d.ts +11 -0
- package/dist/packages/runtime/build/stage-reuse.js +154 -0
- package/dist/packages/runtime/build/stage-session.d.ts +81 -0
- package/dist/packages/runtime/build/stage-session.js +308 -0
- package/dist/packages/runtime/build/state-artifacts.d.ts +9 -0
- package/dist/packages/runtime/build/state-artifacts.js +14 -0
- package/dist/packages/runtime/build/state-health.d.ts +4 -0
- package/dist/packages/{engine → runtime}/build/state-health.js +21 -26
- package/dist/packages/runtime/build/state-io.d.ts +12 -0
- package/dist/packages/runtime/build/state-io.js +118 -0
- package/dist/packages/runtime/build/state-view.d.ts +5 -0
- package/dist/packages/runtime/build/state-view.js +121 -0
- package/dist/packages/runtime/build/state.d.ts +7 -0
- package/dist/packages/runtime/build/state.js +12 -0
- package/dist/packages/runtime/build/summary-coverage-index.d.ts +21 -0
- package/dist/packages/runtime/build/summary-coverage-index.js +189 -0
- package/dist/packages/runtime/build/traces.d.ts +30 -0
- package/dist/packages/runtime/build/traces.js +133 -0
- package/dist/packages/{engine/build/validate-verifiable-context.d.ts → runtime/build/validate-context-graph.d.ts} +6 -6
- package/dist/packages/{engine/build/validate-verifiable-context.js → runtime/build/validate-context-graph.js} +49 -36
- package/dist/packages/{engine → runtime}/build/validate.d.ts +5 -5
- package/dist/packages/{engine → runtime}/build/validate.js +26 -26
- package/dist/packages/{engine → runtime}/client.d.ts +18 -18
- package/dist/packages/{engine → runtime}/client.js +48 -36
- package/dist/packages/{engine → runtime}/connection-config.d.ts +3 -2
- package/dist/packages/{engine → runtime}/connection-config.js +9 -8
- package/dist/packages/runtime/context-checks.d.ts +10 -0
- package/dist/packages/runtime/context-checks.js +127 -0
- package/dist/packages/runtime/context-graph-scaffold.d.ts +9 -0
- package/dist/packages/runtime/context-graph-scaffold.js +135 -0
- package/dist/packages/runtime/context-graph-semantic-graph.d.ts +9 -0
- package/dist/packages/runtime/context-graph-semantic-graph.js +416 -0
- package/dist/packages/runtime/entitlement-guard.d.ts +43 -0
- package/dist/packages/runtime/entitlement-guard.js +70 -0
- package/dist/packages/{engine → runtime}/execution/index.d.ts +2 -2
- package/dist/packages/{engine → runtime}/execution/index.js +1 -1
- package/dist/packages/{engine → runtime}/execution/lib/schema.d.ts +272 -191
- package/dist/packages/{engine → runtime}/execution/lib/schema.js +35 -32
- package/dist/packages/runtime/index.d.ts +29 -0
- package/dist/packages/runtime/index.js +21 -0
- package/dist/packages/runtime/instance-paths.d.ts +30 -0
- package/dist/packages/runtime/instance-paths.js +29 -0
- package/dist/packages/runtime/native-run-handlers.d.ts +63 -0
- package/dist/packages/{engine → runtime}/native-run-handlers.js +217 -166
- package/dist/packages/runtime/plan-artifact-contract.d.ts +17 -0
- package/dist/packages/runtime/plan-artifact-contract.js +42 -0
- package/dist/packages/runtime/project-entries.d.ts +11 -0
- package/dist/packages/runtime/project-entries.js +49 -0
- package/dist/packages/runtime/project-source-state.d.ts +26 -0
- package/dist/packages/runtime/project-source-state.js +56 -0
- package/dist/packages/runtime/project-store.d.ts +90 -0
- package/dist/packages/runtime/project-store.js +195 -0
- package/dist/packages/runtime/requested-artifacts.d.ts +7 -0
- package/dist/packages/{engine → runtime}/requested-artifacts.js +23 -1
- package/dist/packages/{engine → runtime}/run-observability.d.ts +2 -1
- package/dist/packages/{engine → runtime}/run-observability.js +174 -87
- package/dist/packages/runtime/runtime-action-proposals.d.ts +7 -0
- package/dist/packages/runtime/runtime-action-proposals.js +542 -0
- package/dist/packages/runtime/runtime-build-plans.d.ts +5 -0
- package/dist/packages/runtime/runtime-build-plans.js +175 -0
- package/dist/packages/runtime/runtime-build-runs.d.ts +47 -0
- package/dist/packages/runtime/runtime-build-runs.js +555 -0
- package/dist/packages/runtime/runtime-caches.d.ts +117 -0
- package/dist/packages/runtime/runtime-caches.js +266 -0
- package/dist/packages/{engine → runtime}/runtime-event-applier.d.ts +3 -1
- package/dist/packages/{engine → runtime}/runtime-event-applier.js +53 -17
- package/dist/packages/runtime/runtime-executor.d.ts +22 -0
- package/dist/packages/runtime/runtime-executor.js +131 -0
- package/dist/packages/runtime/runtime-jobs.d.ts +13 -0
- package/dist/packages/runtime/runtime-jobs.js +463 -0
- package/dist/packages/runtime/runtime-observability.d.ts +11 -0
- package/dist/packages/runtime/runtime-observability.js +39 -0
- package/dist/packages/{engine → runtime}/runtime-persistence.d.ts +9 -18
- package/dist/packages/{engine → runtime}/runtime-persistence.js +25 -25
- package/dist/packages/runtime/runtime-project-mutations.d.ts +7 -0
- package/dist/packages/runtime/runtime-project-mutations.js +65 -0
- package/dist/packages/runtime/runtime-project-reads.d.ts +18 -0
- package/dist/packages/runtime/runtime-project-reads.js +574 -0
- package/dist/packages/runtime/runtime-proposal-helpers.d.ts +22 -0
- package/dist/packages/runtime/runtime-proposal-helpers.js +223 -0
- package/dist/packages/{engine → runtime}/runtime-resource-builders.d.ts +23 -16
- package/dist/packages/{engine → runtime}/runtime-resource-builders.js +58 -46
- package/dist/packages/runtime/runtime-status.d.ts +14 -0
- package/dist/packages/runtime/runtime-status.js +15 -0
- package/dist/packages/runtime/runtime-verify-runs.d.ts +84 -0
- package/dist/packages/runtime/runtime-verify-runs.js +296 -0
- package/dist/packages/runtime/runtime.d.ts +1582 -0
- package/dist/packages/runtime/runtime.js +431 -0
- package/dist/packages/runtime/schemas/actions.d.ts +1206 -0
- package/dist/packages/runtime/schemas/actions.js +117 -0
- package/dist/packages/runtime/schemas/agents.d.ts +104 -0
- package/dist/packages/runtime/schemas/agents.js +74 -0
- package/dist/packages/runtime/schemas/build-plans.d.ts +1132 -0
- package/dist/packages/runtime/schemas/build-plans.js +141 -0
- package/dist/packages/runtime/schemas/context-graphs.d.ts +1522 -0
- package/dist/packages/runtime/schemas/context-graphs.js +110 -0
- package/dist/packages/runtime/schemas/files.d.ts +227 -0
- package/dist/packages/runtime/schemas/files.js +28 -0
- package/dist/packages/runtime/schemas/index.d.ts +9 -0
- package/dist/packages/runtime/schemas/index.js +13 -0
- package/dist/packages/runtime/schemas/instance.d.ts +141 -0
- package/dist/packages/runtime/schemas/instance.js +143 -0
- package/dist/packages/runtime/schemas/jobs.d.ts +339 -0
- package/dist/packages/runtime/schemas/jobs.js +107 -0
- package/dist/packages/runtime/schemas/projects.d.ts +366 -0
- package/dist/packages/runtime/schemas/projects.js +160 -0
- package/dist/packages/runtime/schemas/runs.d.ts +3445 -0
- package/dist/packages/runtime/schemas/runs.js +115 -0
- package/dist/packages/runtime/service/index.d.ts +3 -0
- package/dist/packages/runtime/service/index.js +3 -0
- package/dist/packages/runtime/service/openapi.d.ts +7 -0
- package/dist/packages/runtime/service/openapi.js +118 -0
- package/dist/packages/runtime/service/operations.d.ts +3011 -0
- package/dist/packages/runtime/service/operations.js +375 -0
- package/dist/packages/runtime/service/routes.d.ts +114 -0
- package/dist/packages/runtime/service/routes.js +128 -0
- package/dist/packages/runtime/service/server-api-files.d.ts +10 -0
- package/dist/packages/runtime/service/server-api-files.js +85 -0
- package/dist/packages/runtime/service/server-app-boot.d.ts +4 -0
- package/dist/packages/runtime/service/server-app-boot.js +46 -0
- package/dist/packages/runtime/service/server-guards.d.ts +63 -0
- package/dist/packages/runtime/service/server-guards.js +181 -0
- package/dist/packages/runtime/service/server-helpers.d.ts +38 -0
- package/dist/packages/runtime/service/server-helpers.js +108 -0
- package/dist/packages/runtime/service/server-instance-helpers.d.ts +30 -0
- package/dist/packages/runtime/service/server-instance-helpers.js +114 -0
- package/dist/packages/runtime/service/server-routes-action-proposals.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-action-proposals.js +45 -0
- package/dist/packages/runtime/service/server-routes-agents.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-agents.js +132 -0
- package/dist/packages/runtime/service/server-routes-auth.d.ts +33 -0
- package/dist/packages/runtime/service/server-routes-auth.js +138 -0
- package/dist/packages/runtime/service/server-routes-build-plans.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-build-plans.js +86 -0
- package/dist/packages/runtime/service/server-routes-discovery.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-discovery.js +196 -0
- package/dist/packages/runtime/service/server-routes-events.d.ts +5 -0
- package/dist/packages/runtime/service/server-routes-events.js +99 -0
- package/dist/packages/runtime/service/server-routes-project-context.d.ts +9 -0
- package/dist/packages/runtime/service/server-routes-project-context.js +287 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.d.ts +9 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.js +137 -0
- package/dist/packages/runtime/service/server-routes-project-runs.d.ts +14 -0
- package/dist/packages/runtime/service/server-routes-project-runs.js +88 -0
- package/dist/packages/runtime/service/server-routes-projects.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-projects.js +96 -0
- package/dist/packages/runtime/service/server-routes-runs.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-runs.js +119 -0
- package/dist/packages/runtime/service/server.d.ts +37 -0
- package/dist/packages/runtime/service/server.js +300 -0
- package/dist/packages/{engine → runtime/service}/service-registry.d.ts +5 -5
- package/dist/packages/{engine → runtime/service}/service-registry.js +7 -7
- package/dist/packages/runtime/verify/benchmark-run.d.ts +81 -0
- package/dist/packages/runtime/verify/benchmark-run.js +303 -0
- package/dist/packages/{engine → runtime}/verify/index.d.ts +2 -2
- package/dist/packages/{engine → runtime}/verify/index.js +1 -1
- package/dist/packages/{engine → runtime}/verify/lib/schema.d.ts +83 -16
- package/dist/packages/{engine → runtime}/verify/lib/schema.js +38 -18
- package/dist/packages/runtime/verify/test-file-guard.d.ts +2 -0
- package/dist/packages/runtime/verify/test-file-guard.js +29 -0
- package/dist/packages/{engine → runtime}/verify/verify-execution.d.ts +7 -0
- package/dist/packages/{engine → runtime}/verify/verify-execution.js +119 -45
- package/dist/packages/{engine → runtime}/verify/verify-paths.d.ts +5 -4
- package/dist/packages/runtime/verify/verify-paths.js +65 -0
- package/dist/packages/{engine → runtime}/verify/verify-sandbox.d.ts +1 -1
- package/dist/packages/runtime/verify/verify-sandbox.js +88 -0
- package/dist/packages/{engine → runtime}/verify/verify-specs.d.ts +2 -0
- package/dist/packages/runtime/verify/verify-specs.js +126 -0
- package/dist/packages/runtime/verify/verify-targets.d.ts +5 -0
- package/dist/packages/{engine → runtime}/verify/verify-targets.js +12 -12
- package/dist/packages/runtime/verify/verify-types.js +1 -0
- package/dist/packages/{engine → runtime}/verify/verify.d.ts +1 -1
- package/dist/packages/{engine → runtime}/verify/verify.js +1 -1
- package/dist/packages/runtime/wire-schemas.d.ts +18 -0
- package/dist/packages/runtime/wire-schemas.js +27 -0
- package/package.json +32 -30
- package/public-repo/CONTRIBUTING.md +16 -18
- package/public-repo/README.md +119 -282
- package/public-repo/SECURITY.md +3 -4
- package/public-repo/build-plans/interf-default/README.md +24 -16
- package/public-repo/build-plans/interf-default/build/stages/entrypoint/SKILL.md +74 -0
- package/public-repo/build-plans/interf-default/build/stages/knowledge/SKILL.md +95 -0
- package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +49 -4
- package/public-repo/build-plans/interf-default/build-plan.json +49 -39
- package/public-repo/build-plans/interf-default/build-plan.schema.json +59 -33
- package/public-repo/build-plans/interf-default/improve/SKILL.md +3 -3
- package/public-repo/build-plans/interf-default/use/query/SKILL.md +18 -11
- package/public-repo/openapi/local-service.openapi.json +14227 -0
- package/public-repo/skills/interf/SKILL.md +508 -187
- package/dist/cli/commands/prep.d.ts +0 -2
- package/dist/cli/commands/prep.js +0 -240
- package/dist/cli/commands/test.d.ts +0 -10
- package/dist/cli/commands/test.js +0 -85
- package/dist/cli/commands/web.d.ts +0 -2
- package/dist/cli/commands/web.js +0 -286
- package/dist/interf-ui/404.html +0 -1
- package/dist/interf-ui/__next.__PAGE__.txt +0 -10
- package/dist/interf-ui/__next._full.txt +0 -20
- package/dist/interf-ui/__next._head.txt +0 -5
- package/dist/interf-ui/__next._index.txt +0 -5
- package/dist/interf-ui/__next._tree.txt +0 -5
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_buildManifest.js +0 -11
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_clientMiddlewareManifest.js +0 -1
- package/dist/interf-ui/_next/static/--reS3xBzM5zc6QxNjZd6/_ssgManifest.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0.tjb6f4golw..css +0 -3
- package/dist/interf-ui/_next/static/chunks/03~yq9q893hmn.js +0 -1
- package/dist/interf-ui/_next/static/chunks/085-n_jv2ng_q.css +0 -1
- package/dist/interf-ui/_next/static/chunks/0dn41fa_zvgsl.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0g-ea0zj5d-0k.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0gwqglc4iz583.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0haldgm65ve6l.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0nv3am99vjzn4.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0s77gt_o4jwtx.js +0 -1
- package/dist/interf-ui/_next/static/chunks/0y5z3t-z1c8ks.js.map +0 -5
- package/dist/interf-ui/_next/static/chunks/0~a36ujuzpaz..js +0 -116
- package/dist/interf-ui/_next/static/chunks/10jeodxe4nkgj.js +0 -31
- package/dist/interf-ui/_next/static/chunks/119h2rouych2t.js +0 -1
- package/dist/interf-ui/_next/static/chunks/13c8b~m8knjsf.js +0 -1
- package/dist/interf-ui/_next/static/chunks/14dznb2qpt-ho.js +0 -91
- package/dist/interf-ui/_next/static/chunks/15z_en80lrq-3.js +0 -5
- package/dist/interf-ui/_next/static/chunks/turbopack-0p.pvcjrtq-jh.js +0 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-0usj_75.8frlw.js +0 -1
- package/dist/interf-ui/_next/static/chunks/turbopack-worker-0sjn--fhq~1cg.js +0 -1
- package/dist/interf-ui/_next/static/media/GeistMono_Variable.p.17jn9btb_52pq.woff2 +0 -0
- package/dist/interf-ui/_next/static/media/Geist_Variable-s.p.0-te~ja_gpvcf.woff2 +0 -0
- package/dist/interf-ui/_next/static/media/worker.102zas1s52_pf.js +0 -109
- package/dist/interf-ui/_not-found/__next._full.txt +0 -15
- package/dist/interf-ui/_not-found/__next._head.txt +0 -5
- package/dist/interf-ui/_not-found/__next._index.txt +0 -5
- package/dist/interf-ui/_not-found/__next._not-found.__PAGE__.txt +0 -5
- package/dist/interf-ui/_not-found/__next._not-found.txt +0 -5
- package/dist/interf-ui/_not-found/__next._tree.txt +0 -2
- package/dist/interf-ui/_not-found.html +0 -1
- package/dist/interf-ui/_not-found.txt +0 -15
- package/dist/interf-ui/index.html +0 -1
- package/dist/interf-ui/index.txt +0 -20
- package/dist/packages/contracts/lib/preparation-paths.d.ts +0 -117
- package/dist/packages/contracts/lib/preparation-paths.js +0 -177
- package/dist/packages/engine/action-definitions.d.ts +0 -407
- package/dist/packages/engine/action-definitions.js +0 -1158
- package/dist/packages/engine/action-values.d.ts +0 -1
- package/dist/packages/engine/action-values.js +0 -1
- package/dist/packages/engine/agents/lib/args.d.ts +0 -4
- package/dist/packages/engine/agents/lib/args.js +0 -52
- package/dist/packages/engine/agents/lib/chart-guidance.d.ts +0 -1
- package/dist/packages/engine/agents/lib/chart-guidance.js +0 -8
- package/dist/packages/engine/agents/lib/constants.js +0 -28
- package/dist/packages/engine/agents/lib/logs.d.ts +0 -2
- package/dist/packages/engine/agents/lib/logs.js +0 -17
- package/dist/packages/engine/agents/lib/render.d.ts +0 -8
- package/dist/packages/engine/agents/lib/schema.d.ts +0 -8
- package/dist/packages/engine/agents/lib/schema.js +0 -7
- package/dist/packages/engine/agents/lib/shells.d.ts +0 -74
- package/dist/packages/engine/agents/lib/shells.js +0 -1052
- package/dist/packages/engine/agents/lib/verifiable-context-bootstrap.d.ts +0 -3
- package/dist/packages/engine/build/artifact-counts.d.ts +0 -1
- package/dist/packages/engine/build/billing-events.d.ts +0 -89
- package/dist/packages/engine/build/build-pipeline.js +0 -175
- package/dist/packages/engine/build/build-plan-runs.d.ts +0 -14
- package/dist/packages/engine/build/build-plan-runs.js +0 -31
- package/dist/packages/engine/build/build-stage-plan.d.ts +0 -16
- package/dist/packages/engine/build/build-stage-plan.js +0 -100
- package/dist/packages/engine/build/build-stage-runner.js +0 -94
- package/dist/packages/engine/build/build-target.js +0 -16
- package/dist/packages/engine/build/check-evaluator.js +0 -298
- package/dist/packages/engine/build/lib/schema.js +0 -316
- package/dist/packages/engine/build/reset.d.ts +0 -2
- package/dist/packages/engine/build/reset.js +0 -74
- package/dist/packages/engine/build/runtime-inventory.d.ts +0 -7
- package/dist/packages/engine/build/runtime-paths.d.ts +0 -8
- package/dist/packages/engine/build/runtime-paths.js +0 -26
- package/dist/packages/engine/build/runtime-runs.d.ts +0 -10
- package/dist/packages/engine/build/runtime-runs.js +0 -224
- package/dist/packages/engine/build/runtime.d.ts +0 -5
- package/dist/packages/engine/build/runtime.js +0 -4
- package/dist/packages/engine/build/source-files.d.ts +0 -46
- package/dist/packages/engine/build/source-files.js +0 -149
- package/dist/packages/engine/build/state-artifacts.d.ts +0 -9
- package/dist/packages/engine/build/state-artifacts.js +0 -14
- package/dist/packages/engine/build/state-health.d.ts +0 -4
- package/dist/packages/engine/build/state-io.d.ts +0 -11
- package/dist/packages/engine/build/state-io.js +0 -82
- package/dist/packages/engine/build/state-paths.d.ts +0 -5
- package/dist/packages/engine/build/state-paths.js +0 -16
- package/dist/packages/engine/build/state-view.d.ts +0 -5
- package/dist/packages/engine/build/state-view.js +0 -94
- package/dist/packages/engine/build/state.d.ts +0 -7
- package/dist/packages/engine/build/state.js +0 -12
- package/dist/packages/engine/build/validate-helpers.d.ts +0 -12
- package/dist/packages/engine/build/validate-helpers.js +0 -41
- package/dist/packages/engine/build/verifiable-context-paths.d.ts +0 -47
- package/dist/packages/engine/build/verifiable-context-paths.js +0 -121
- package/dist/packages/engine/build/verifiable-context-schema.d.ts +0 -21
- package/dist/packages/engine/build/verifiable-context-schema.js +0 -126
- package/dist/packages/engine/cloud-seams.d.ts +0 -115
- package/dist/packages/engine/cloud-seams.js +0 -84
- package/dist/packages/engine/index.d.ts +0 -22
- package/dist/packages/engine/index.js +0 -15
- package/dist/packages/engine/instance-paths.d.ts +0 -106
- package/dist/packages/engine/instance-paths.js +0 -171
- package/dist/packages/engine/lib/schema.d.ts +0 -6304
- package/dist/packages/engine/lib/schema.js +0 -730
- package/dist/packages/engine/native-run-handlers.d.ts +0 -25
- package/dist/packages/engine/preparation-store.d.ts +0 -105
- package/dist/packages/engine/preparation-store.js +0 -213
- package/dist/packages/engine/readiness-check-draft.d.ts +0 -20
- package/dist/packages/engine/readiness-check-draft.js +0 -111
- package/dist/packages/engine/requested-artifacts.d.ts +0 -5
- package/dist/packages/engine/routes.d.ts +0 -85
- package/dist/packages/engine/routes.js +0 -99
- package/dist/packages/engine/runtime-caches.d.ts +0 -76
- package/dist/packages/engine/runtime-caches.js +0 -191
- package/dist/packages/engine/runtime-proposal-helpers.d.ts +0 -35
- package/dist/packages/engine/runtime-proposal-helpers.js +0 -247
- package/dist/packages/engine/runtime.d.ts +0 -371
- package/dist/packages/engine/runtime.js +0 -2463
- package/dist/packages/engine/server.d.ts +0 -58
- package/dist/packages/engine/server.js +0 -1399
- package/dist/packages/engine/verify/readiness-check-run.d.ts +0 -82
- package/dist/packages/engine/verify/readiness-check-run.js +0 -265
- package/dist/packages/engine/verify/verify-paths.js +0 -61
- package/dist/packages/engine/verify/verify-sandbox.js +0 -88
- package/dist/packages/engine/verify/verify-specs.js +0 -114
- package/dist/packages/engine/verify/verify-targets.d.ts +0 -5
- package/dist/packages/engine/wire-schemas.d.ts +0 -547
- package/dist/packages/engine/wire-schemas.js +0 -59
- package/dist/packages/project/index.d.ts +0 -9
- package/dist/packages/project/interf-bootstrap.d.ts +0 -1
- package/dist/packages/project/interf-bootstrap.js +0 -1
- package/dist/packages/project/interf-scaffold.d.ts +0 -3
- package/dist/packages/project/interf-scaffold.js +0 -136
- package/dist/packages/project/interf.d.ts +0 -4
- package/dist/packages/project/interf.js +0 -3
- package/dist/packages/project/lib/schema.d.ts +0 -328
- package/dist/packages/project/lib/schema.js +0 -136
- package/dist/packages/project/preparation-entries.d.ts +0 -11
- package/dist/packages/project/preparation-entries.js +0 -49
- package/dist/packages/project/source-config.d.ts +0 -46
- package/dist/packages/project/source-config.js +0 -394
- package/dist/packages/project/source-folders.d.ts +0 -11
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +0 -27
- package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +0 -21
- package/public-repo/plugins/README.md +0 -9
- package/public-repo/plugins/interf/.claude-plugin/plugin.json +0 -21
- package/public-repo/plugins/interf/.mcp.json +0 -12
- package/public-repo/plugins/interf/README.md +0 -32
- package/public-repo/plugins/interf/skills/interf/SKILL.md +0 -376
- /package/dist/packages/{engine/agents/lib/types.js → runtime/actions/fields.js} +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/agents.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/agents.js +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/execution.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/preflight.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/status.d.ts +0 -0
- /package/dist/packages/{engine/build/runtime-types.js → runtime/agents/lib/types.js} +0 -0
- /package/dist/packages/{engine/verify/verify-types.js → runtime/agents/providers/types.js} +0 -0
- /package/dist/packages/{engine → runtime}/agents/role-router.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/build-execution.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/build-execution.js +0 -0
- /package/dist/packages/{engine → runtime}/build/runtime-contracts.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/build/runtime-prompt.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/adapters.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/adapters.js +0 -0
- /package/dist/packages/{engine → runtime}/execution/events.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/execution/events.js +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-profile-presets.js +0 -0
- /package/dist/packages/{engine → runtime}/verify/verify-types.d.ts +0 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { LOCAL_SERVICE_ROUTES, buildLocalServiceUrl,
|
|
3
|
-
import { readActiveConnection } from "./connection-config.js";
|
|
1
|
+
import { BuildRunListResponseSchema, BuildRunResourceSchema, RunObservabilityResourceSchema, ActionProposalApprovalRequestSchema, ActionProposalCreateRequestSchema, ActionProposalResourceSchema, LocalJobRunResourceSchema, LocalServiceHealthSchema, BenchmarkQuestionDraftCreateRequestSchema, BenchmarkQuestionDraftResultSchema, ResetResultSchema, ProjectBuildRunCreateRequestSchema, ProjectResetRequestSchema, ProjectVerifyRunCreateRequestSchema, VerifyRunResourceSchema, BuildPlanAuthoringCreateRequestSchema, BuildPlanAuthoringResultSchema, } from "./schemas/index.js";
|
|
2
|
+
import { LOCAL_SERVICE_ROUTES, buildLocalServiceUrl, projectSubresourcePath, } from "./service/routes.js";
|
|
3
|
+
import { INTERF_AUTH_TOKEN_ENV, readActiveConnection } from "./connection-config.js";
|
|
4
|
+
import { isTerminalStatus } from "./runtime-status.js";
|
|
4
5
|
async function connectOrNull(options = {}) {
|
|
5
6
|
const conn = readActiveConnection({
|
|
6
7
|
urlOverride: options.url ?? null,
|
|
@@ -34,12 +35,12 @@ export function configuredLocalServiceUrl() {
|
|
|
34
35
|
return buildLocalServiceUrl();
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
|
-
* Resolve the bearer token for the active connection.
|
|
38
|
-
*
|
|
39
|
-
* `
|
|
38
|
+
* Resolve the bearer token for the active connection. There is exactly
|
|
39
|
+
* one source of truth: `~/.interf/connection.json` (or the
|
|
40
|
+
* `INTERF_AUTH_TOKEN` env override).
|
|
40
41
|
*/
|
|
41
42
|
export function resolveLocalServiceAuthToken() {
|
|
42
|
-
const explicit = process.env
|
|
43
|
+
const explicit = process.env[INTERF_AUTH_TOKEN_ENV]?.trim();
|
|
43
44
|
if (explicit)
|
|
44
45
|
return explicit;
|
|
45
46
|
const conn = readActiveConnection();
|
|
@@ -68,9 +69,9 @@ async function fetchJson(url, options = {}) {
|
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
71
|
/**
|
|
71
|
-
* Resolve a connection
|
|
72
|
-
* `~/.interf/connection.json` (written by `interf
|
|
73
|
-
* `INTERF_SERVICE_URL` / `
|
|
72
|
+
* Resolve a connection — the only path to the engine. Read
|
|
73
|
+
* `~/.interf/connection.json` (written by `interf runtime`) or honor the
|
|
74
|
+
* `INTERF_SERVICE_URL` / `INTERF_AUTH_TOKEN` env overrides.
|
|
74
75
|
*/
|
|
75
76
|
export async function findLocalService(options = {}) {
|
|
76
77
|
void options.timeoutMs;
|
|
@@ -80,18 +81,18 @@ function authHeaders(authToken) {
|
|
|
80
81
|
return authToken ? { authorization: `Bearer ${authToken}` } : {};
|
|
81
82
|
}
|
|
82
83
|
// ─────────────────────────────────────────────────────────────────────────
|
|
83
|
-
//
|
|
84
|
+
// Project-keyed run submission helpers
|
|
84
85
|
// ─────────────────────────────────────────────────────────────────────────
|
|
85
86
|
export async function submitBuildRunToLocalService(options) {
|
|
86
87
|
const connection = await connectOrNull();
|
|
87
88
|
if (!connection)
|
|
88
89
|
return null;
|
|
89
|
-
const request =
|
|
90
|
+
const request = ProjectBuildRunCreateRequestSchema.parse(options.request);
|
|
90
91
|
const headers = {
|
|
91
92
|
...authHeaders(connection.authToken),
|
|
92
93
|
...(options.idempotencyKey ? { "x-interf-idempotency-key": options.idempotencyKey } : {}),
|
|
93
94
|
};
|
|
94
|
-
const url = `${connection.serviceUrl}${
|
|
95
|
+
const url = `${connection.serviceUrl}${projectSubresourcePath(options.projectId, "buildRuns")}`;
|
|
95
96
|
const resource = BuildRunResourceSchema.parse(await fetchJson(url, {
|
|
96
97
|
method: "POST",
|
|
97
98
|
body: JSON.stringify(request),
|
|
@@ -106,8 +107,8 @@ export async function submitVerifyRunToLocalService(options) {
|
|
|
106
107
|
const connection = await connectOrNull();
|
|
107
108
|
if (!connection)
|
|
108
109
|
return null;
|
|
109
|
-
const request =
|
|
110
|
-
const url = `${connection.serviceUrl}${
|
|
110
|
+
const request = ProjectVerifyRunCreateRequestSchema.parse(options.request);
|
|
111
|
+
const url = `${connection.serviceUrl}${projectSubresourcePath(options.projectId, "verifyRuns")}`;
|
|
111
112
|
const resource = VerifyRunResourceSchema.parse(await fetchJson(url, {
|
|
112
113
|
method: "POST",
|
|
113
114
|
body: JSON.stringify(request),
|
|
@@ -122,8 +123,8 @@ export async function submitResetToLocalService(options) {
|
|
|
122
123
|
const connection = await connectOrNull();
|
|
123
124
|
if (!connection)
|
|
124
125
|
return null;
|
|
125
|
-
const request =
|
|
126
|
-
const url = `${connection.serviceUrl}${
|
|
126
|
+
const request = ProjectResetRequestSchema.parse(options.request);
|
|
127
|
+
const url = `${connection.serviceUrl}${projectSubresourcePath(options.projectId, "reset")}`;
|
|
127
128
|
const result = ResetResultSchema.parse(await fetchJson(url, {
|
|
128
129
|
method: "POST",
|
|
129
130
|
body: JSON.stringify(request),
|
|
@@ -179,18 +180,29 @@ export async function approveActionProposalInLocalService(options) {
|
|
|
179
180
|
});
|
|
180
181
|
return decided ?? proposal;
|
|
181
182
|
}
|
|
182
|
-
function isTerminalJobStatus(status) {
|
|
183
|
-
return status === "succeeded" || status === "failed" || status === "cancelled";
|
|
184
|
-
}
|
|
185
|
-
function isTerminalRunStatus(status) {
|
|
186
|
-
return status === "succeeded" || status === "failed" || status === "cancelled";
|
|
187
|
-
}
|
|
188
183
|
export async function getLocalBuildRun(options) {
|
|
189
|
-
|
|
184
|
+
const headers = authHeaders(options.authToken ?? resolveLocalServiceAuthToken());
|
|
185
|
+
const runValue = await fetchJson(`${options.serviceUrl}/v1/runs/${encodeURIComponent(options.runId)}`, {
|
|
190
186
|
method: "GET",
|
|
191
187
|
timeoutMs: 2000,
|
|
192
|
-
headers
|
|
188
|
+
headers,
|
|
189
|
+
});
|
|
190
|
+
const direct = BuildRunResourceSchema.safeParse(runValue);
|
|
191
|
+
if (direct.success)
|
|
192
|
+
return direct.data;
|
|
193
|
+
const observable = RunObservabilityResourceSchema.parse(runValue);
|
|
194
|
+
if (observable.run_type !== "build" || !observable.project) {
|
|
195
|
+
throw new Error(`Run ${options.runId} is not a Build run.`);
|
|
196
|
+
}
|
|
197
|
+
const projectRuns = BuildRunListResponseSchema.parse(await fetchJson(`${options.serviceUrl}/v1/projects/${encodeURIComponent(observable.project)}/runs`, {
|
|
198
|
+
method: "GET",
|
|
199
|
+
timeoutMs: 2000,
|
|
200
|
+
headers,
|
|
193
201
|
}));
|
|
202
|
+
const run = projectRuns.runs.find((candidate) => candidate.run_id === options.runId);
|
|
203
|
+
if (!run)
|
|
204
|
+
throw new Error(`Build run ${options.runId} was not found in Project ${observable.project}.`);
|
|
205
|
+
return BuildRunResourceSchema.parse({ run });
|
|
194
206
|
}
|
|
195
207
|
/**
|
|
196
208
|
* Ask the local service to cancel a running Build run by id. Resolves
|
|
@@ -198,7 +210,7 @@ export async function getLocalBuildRun(options) {
|
|
|
198
210
|
* returns 404 (unknown run id) or any non-2xx status.
|
|
199
211
|
*/
|
|
200
212
|
export async function cancelLocalBuildRun(options) {
|
|
201
|
-
const value = await fetchJson(`${options.serviceUrl}/v1/
|
|
213
|
+
const value = await fetchJson(`${options.serviceUrl}/v1/runs/${encodeURIComponent(options.runId)}/cancel`, {
|
|
202
214
|
method: "POST",
|
|
203
215
|
timeoutMs: options.timeoutMs ?? 2000,
|
|
204
216
|
headers: authHeaders(options.authToken ?? resolveLocalServiceAuthToken()),
|
|
@@ -227,7 +239,7 @@ export async function waitForLocalBuildRun(options) {
|
|
|
227
239
|
authToken: options.authToken ?? null,
|
|
228
240
|
});
|
|
229
241
|
options.onUpdate?.(resource);
|
|
230
|
-
if (
|
|
242
|
+
if (isTerminalStatus(resource.run.status))
|
|
231
243
|
return resource;
|
|
232
244
|
await new Promise((resolveWait) => setTimeout(resolveWait, delay));
|
|
233
245
|
if (explicit === undefined) {
|
|
@@ -253,7 +265,7 @@ export async function waitForLocalVerifyRun(options) {
|
|
|
253
265
|
authToken: options.authToken ?? null,
|
|
254
266
|
});
|
|
255
267
|
options.onUpdate?.(resource);
|
|
256
|
-
if (
|
|
268
|
+
if (isTerminalStatus(resource.status))
|
|
257
269
|
return resource;
|
|
258
270
|
await new Promise((resolveWait) => setTimeout(resolveWait, delay));
|
|
259
271
|
if (explicit === undefined) {
|
|
@@ -278,7 +290,7 @@ export async function waitForLocalJobRun(options) {
|
|
|
278
290
|
authToken: options.authToken ?? null,
|
|
279
291
|
});
|
|
280
292
|
options.onUpdate?.(job);
|
|
281
|
-
if (
|
|
293
|
+
if (isTerminalStatus(job.status))
|
|
282
294
|
return job;
|
|
283
295
|
if (options.timeoutMs && Date.now() - startedAt > options.timeoutMs) {
|
|
284
296
|
throw new Error(`Timed out waiting for local job ${options.runId}.`);
|
|
@@ -294,12 +306,12 @@ function resultError(job, defaultMessage) {
|
|
|
294
306
|
}
|
|
295
307
|
return job.error ?? defaultMessage;
|
|
296
308
|
}
|
|
297
|
-
export async function
|
|
309
|
+
export async function submitBenchmarkQuestionDraftToLocalService(options) {
|
|
298
310
|
const connection = await connectOrNull();
|
|
299
311
|
if (!connection)
|
|
300
312
|
return null;
|
|
301
|
-
const request =
|
|
302
|
-
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${
|
|
313
|
+
const request = BenchmarkQuestionDraftCreateRequestSchema.parse(options.request);
|
|
314
|
+
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${projectSubresourcePath(options.projectId, "benchmarkQuestionDrafts")}`, {
|
|
303
315
|
method: "POST",
|
|
304
316
|
body: JSON.stringify(request),
|
|
305
317
|
headers: authHeaders(connection.authToken),
|
|
@@ -319,16 +331,16 @@ export async function submitReadinessCheckDraftToLocalService(options) {
|
|
|
319
331
|
serviceUrl: connection.serviceUrl,
|
|
320
332
|
job,
|
|
321
333
|
result: null,
|
|
322
|
-
error: resultError(job, "Drafting
|
|
334
|
+
error: resultError(job, "Drafting benchmark questions failed in the local Interf service."),
|
|
323
335
|
};
|
|
324
336
|
}
|
|
325
|
-
const parsed =
|
|
337
|
+
const parsed = BenchmarkQuestionDraftResultSchema.safeParse(job.result);
|
|
326
338
|
if (!parsed.success) {
|
|
327
339
|
return {
|
|
328
340
|
serviceUrl: connection.serviceUrl,
|
|
329
341
|
job,
|
|
330
342
|
result: null,
|
|
331
|
-
error: "Drafting
|
|
343
|
+
error: "Drafting benchmark questions finished without a valid result.",
|
|
332
344
|
};
|
|
333
345
|
}
|
|
334
346
|
return {
|
|
@@ -342,7 +354,7 @@ export async function submitBuildPlanAuthoringRunToLocalService(options) {
|
|
|
342
354
|
if (!connection)
|
|
343
355
|
return null;
|
|
344
356
|
const request = BuildPlanAuthoringCreateRequestSchema.parse(options.request);
|
|
345
|
-
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${
|
|
357
|
+
const initialJob = LocalJobRunResourceSchema.parse(await fetchJson(`${connection.serviceUrl}${projectSubresourcePath(options.projectId, "buildPlanDraftRuns")}`, {
|
|
346
358
|
method: "POST",
|
|
347
359
|
body: JSON.stringify(request),
|
|
348
360
|
headers: authHeaders(connection.authToken),
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
* Single CLI connection record at `~/.interf/connection.json`.
|
|
3
3
|
*
|
|
4
4
|
* The CLI is a thin authorized client of one connected instance. Switch by
|
|
5
|
-
* starting `interf
|
|
6
|
-
* remote connection), or by passing `--url` / env vars to override
|
|
5
|
+
* starting `interf runtime` (writes a local connection), `interf login`
|
|
6
|
+
* (writes a remote connection), or by passing `--url` / env vars to override
|
|
7
|
+
* per-call.
|
|
7
8
|
*
|
|
8
9
|
* No per-folder pointer files. No registry of multiple connections.
|
|
9
10
|
*/
|
|
@@ -2,18 +2,19 @@
|
|
|
2
2
|
* Single CLI connection record at `~/.interf/connection.json`.
|
|
3
3
|
*
|
|
4
4
|
* The CLI is a thin authorized client of one connected instance. Switch by
|
|
5
|
-
* starting `interf
|
|
6
|
-
* remote connection), or by passing `--url` / env vars to override
|
|
5
|
+
* starting `interf runtime` (writes a local connection), `interf login`
|
|
6
|
+
* (writes a remote connection), or by passing `--url` / env vars to override
|
|
7
|
+
* per-call.
|
|
7
8
|
*
|
|
8
9
|
* No per-folder pointer files. No registry of multiple connections.
|
|
9
10
|
*/
|
|
10
11
|
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
11
12
|
import { dirname } from "node:path";
|
|
12
13
|
import { z } from "zod";
|
|
13
|
-
import { connectionConfigPath, interfHomeRoot } from "
|
|
14
|
+
import { connectionConfigPath, interfHomeRoot } from "../contracts/lib/project-paths.js";
|
|
14
15
|
export const ConnectionRecordSchema = z.object({
|
|
15
16
|
url: z.string().url(),
|
|
16
|
-
/** Bearer token for
|
|
17
|
+
/** Bearer token for token-required local or remote instances. Null only for explicit tokenless dev/test instances. */
|
|
17
18
|
auth_token: z.string().min(1).nullable().default(null),
|
|
18
19
|
}).strict();
|
|
19
20
|
export const INTERF_SERVICE_URL_ENV = "INTERF_SERVICE_URL";
|
|
@@ -57,8 +58,8 @@ export function readActiveConnection(options = {}) {
|
|
|
57
58
|
export function writeConnection(record) {
|
|
58
59
|
const validated = ConnectionRecordSchema.parse(record);
|
|
59
60
|
const configPath = connectionConfigPath();
|
|
60
|
-
mkdirSync(dirname(configPath), { recursive: true });
|
|
61
|
-
writeFileSync(configPath, `${JSON.stringify(validated, null, 2)}\n
|
|
61
|
+
mkdirSync(dirname(configPath), { recursive: true, mode: 0o700 });
|
|
62
|
+
writeFileSync(configPath, `${JSON.stringify(validated, null, 2)}\n`, { mode: 0o600 });
|
|
62
63
|
}
|
|
63
64
|
/** Clear the connection record. No-op if missing. */
|
|
64
65
|
export function clearConnection() {
|
|
@@ -68,8 +69,8 @@ export function clearConnection() {
|
|
|
68
69
|
}
|
|
69
70
|
/** Ensure `~/.interf/` exists and is a directory. */
|
|
70
71
|
export function ensureInterfHome() {
|
|
71
|
-
mkdirSync(interfHomeRoot(), { recursive: true });
|
|
72
|
+
mkdirSync(interfHomeRoot(), { recursive: true, mode: 0o700 });
|
|
72
73
|
}
|
|
73
74
|
/** Canonical message printed when a CLI command needs a connection but has none. */
|
|
74
75
|
export const CONNECT_OR_ERROR_HINT = "Not connected to any Interf instance.\n" +
|
|
75
|
-
"Start one with `interf
|
|
76
|
+
"Start one with `interf runtime` or `interf runtime start`, or set --url / `interf login` for a remote one.";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Artifact, type ArtifactStatus, type ContextCheck } from "../contracts/lib/schema.js";
|
|
2
|
+
import type { BuildPlanAuthoringBrief } from "../build-plans/authoring/brief.js";
|
|
3
|
+
export declare function buildPlanContextChecks(input: {
|
|
4
|
+
brief?: BuildPlanAuthoringBrief | null;
|
|
5
|
+
artifacts: readonly Artifact[];
|
|
6
|
+
}): ContextCheck[];
|
|
7
|
+
export declare function projectContextChecksForRun(input: {
|
|
8
|
+
contextChecks: readonly ContextCheck[];
|
|
9
|
+
artifactStatuses: readonly ArtifactStatus[];
|
|
10
|
+
}): ContextCheck[];
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// COMPAT — legacy Context Check derivation, scheduled for removal once the
|
|
2
|
+
// Graph Manifest readiness rollup is the only path readers consume.
|
|
3
|
+
//
|
|
4
|
+
// The new product spine is primary_metrics + readiness in GraphManifest
|
|
5
|
+
// (see internal/plans/stage-manifest-context-graph-execution-plan-2026-05-27.md
|
|
6
|
+
// Phase 7). This module still runs because:
|
|
7
|
+
// 1. runtime-build-runs writes context_checks into the immutable Run record
|
|
8
|
+
// so old Run records remain consistent.
|
|
9
|
+
// 2. runtime-project-reads exposes a fallback "context-checks" gate when no
|
|
10
|
+
// GraphManifest exists yet (pre-refactor builds).
|
|
11
|
+
// Removal path: once all live instances have at least one GraphManifest-backed
|
|
12
|
+
// Build, drop the writes in runtime-build-runs and the fallback gate in
|
|
13
|
+
// runtime-project-reads, then delete this file. Do not add new callers.
|
|
14
|
+
import { ContextCheckSchema, } from "../contracts/lib/schema.js";
|
|
15
|
+
import { slugify } from "../contracts/utils/naming.js";
|
|
16
|
+
function boundedContextCheckId(value, fallback) {
|
|
17
|
+
const normalized = slugify(value) || fallback;
|
|
18
|
+
if (normalized.length <= 80)
|
|
19
|
+
return normalized;
|
|
20
|
+
return normalized.slice(0, 80).replace(/-+$/g, "") || fallback;
|
|
21
|
+
}
|
|
22
|
+
function uniqueContextCheckId(value, used) {
|
|
23
|
+
const base = boundedContextCheckId(value, "context-check");
|
|
24
|
+
if (!used.has(base)) {
|
|
25
|
+
used.add(base);
|
|
26
|
+
return base;
|
|
27
|
+
}
|
|
28
|
+
for (let index = 2; index < 1000; index += 1) {
|
|
29
|
+
const suffix = `-${index}`;
|
|
30
|
+
const candidate = `${base.slice(0, 80 - suffix.length).replace(/-+$/g, "")}${suffix}`;
|
|
31
|
+
if (!used.has(candidate)) {
|
|
32
|
+
used.add(candidate);
|
|
33
|
+
return candidate;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
throw new Error(`Could not allocate a unique Context Check id for ${value}.`);
|
|
37
|
+
}
|
|
38
|
+
function contextCheckId(check, index, used) {
|
|
39
|
+
return uniqueContextCheckId(check.id ?? check.label ?? `context-check-${index + 1}`, used);
|
|
40
|
+
}
|
|
41
|
+
function derivedContextCheckForArtifact(artifact, used) {
|
|
42
|
+
const firstCheck = artifact.checks.find((check) => check.required !== false) ?? artifact.checks[0] ?? null;
|
|
43
|
+
return ContextCheckSchema.parse({
|
|
44
|
+
id: uniqueContextCheckId(`artifact-${artifact.id}`, used),
|
|
45
|
+
label: firstCheck?.description ?? artifact.description,
|
|
46
|
+
backed_by_artifact_ids: [artifact.id],
|
|
47
|
+
required: firstCheck?.required ?? true,
|
|
48
|
+
evidence_expectation: artifact.description,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
export function buildPlanContextChecks(input) {
|
|
52
|
+
const authoredChecks = input.brief?.checks ?? [];
|
|
53
|
+
const used = new Set();
|
|
54
|
+
if (authoredChecks.length > 0) {
|
|
55
|
+
return authoredChecks.map((check, index) => ContextCheckSchema.parse({
|
|
56
|
+
id: contextCheckId(check, index, used),
|
|
57
|
+
label: check.label,
|
|
58
|
+
...(check.description ? { description: check.description } : {}),
|
|
59
|
+
backed_by_artifact_ids: check.backed_by_artifact_ids,
|
|
60
|
+
required: check.required,
|
|
61
|
+
...(check.evidence_expectation ?? check.evidence
|
|
62
|
+
? { evidence_expectation: check.evidence_expectation ?? check.evidence }
|
|
63
|
+
: {}),
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
return input.artifacts.map((artifact) => derivedContextCheckForArtifact(artifact, used));
|
|
67
|
+
}
|
|
68
|
+
function artifactStatusMap(statuses) {
|
|
69
|
+
return new Map(statuses.map((status) => [status.artifact_id, status]));
|
|
70
|
+
}
|
|
71
|
+
function statusForBackedArtifacts(statuses) {
|
|
72
|
+
if (statuses.length === 0)
|
|
73
|
+
return "pending";
|
|
74
|
+
if (statuses.some((status) => status.status === "failed"))
|
|
75
|
+
return "failed";
|
|
76
|
+
if (statuses.some((status) => status.status === "not_ready"))
|
|
77
|
+
return "pending";
|
|
78
|
+
if (statuses.every((status) => status.status === "ready"))
|
|
79
|
+
return "passed";
|
|
80
|
+
if (statuses.every((status) => status.status === "skipped"))
|
|
81
|
+
return "skipped";
|
|
82
|
+
return "pending";
|
|
83
|
+
}
|
|
84
|
+
function firstIssue(statuses) {
|
|
85
|
+
for (const status of statuses) {
|
|
86
|
+
const failedCheck = status.check_results.find((result) => result.required !== false && !result.passed);
|
|
87
|
+
if (failedCheck)
|
|
88
|
+
return failedCheck.summary;
|
|
89
|
+
if (status.status === "failed" && status.summary)
|
|
90
|
+
return status.summary;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function evidenceSummary(check, statuses) {
|
|
95
|
+
const ready = statuses.filter((status) => status.status === "ready").length;
|
|
96
|
+
if (statuses.length > 0 && ready === statuses.length) {
|
|
97
|
+
return check.evidence_expectation ?? `${ready}/${statuses.length} backed Artifact${statuses.length === 1 ? "" : "s"} accepted.`;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
export function projectContextChecksForRun(input) {
|
|
102
|
+
const statusesByArtifact = artifactStatusMap(input.artifactStatuses);
|
|
103
|
+
return input.contextChecks.map((check) => {
|
|
104
|
+
const missingArtifactIds = check.backed_by_artifact_ids
|
|
105
|
+
.filter((artifactId) => !statusesByArtifact.has(artifactId));
|
|
106
|
+
const backedStatuses = check.backed_by_artifact_ids
|
|
107
|
+
.map((artifactId) => statusesByArtifact.get(artifactId) ?? null)
|
|
108
|
+
.filter((status) => status !== null);
|
|
109
|
+
const checkStatuses = backedStatuses;
|
|
110
|
+
const status = statusForBackedArtifacts(checkStatuses);
|
|
111
|
+
const issue = check.backed_by_artifact_ids.length === 0
|
|
112
|
+
? "Context Check is not backed by a requested Artifact."
|
|
113
|
+
: missingArtifactIds.length > 0
|
|
114
|
+
? `Context Check references missing requested Artifact${missingArtifactIds.length === 1 ? "" : "s"}: ${missingArtifactIds.join(", ")}.`
|
|
115
|
+
: status === "failed" ? firstIssue(checkStatuses) : null;
|
|
116
|
+
const projectedStatus = issue && check.required !== false
|
|
117
|
+
? "failed"
|
|
118
|
+
: status;
|
|
119
|
+
const evidence = projectedStatus === "passed" ? evidenceSummary(check, checkStatuses) : null;
|
|
120
|
+
return ContextCheckSchema.parse({
|
|
121
|
+
...check,
|
|
122
|
+
status: projectedStatus,
|
|
123
|
+
...(evidence ? { evidence } : {}),
|
|
124
|
+
...(issue ? { issue } : {}),
|
|
125
|
+
});
|
|
126
|
+
});
|
|
127
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export declare function ensureContextGraphScaffold(projectDataDir: string, projectName: string, buildPlanId?: string): string;
|
|
2
|
+
export declare function ensureContextGraphScaffoldAt(options: {
|
|
3
|
+
projectDataDir: string;
|
|
4
|
+
contextGraphPath: string;
|
|
5
|
+
projectName: string;
|
|
6
|
+
buildPlanId?: string;
|
|
7
|
+
}): string;
|
|
8
|
+
export declare function createContextGraph(name: string, projectDataDir: string, buildPlanId: string | undefined, sourceFolderPath: string): string;
|
|
9
|
+
export declare function defaultContextGraphNameForSource(projectDataDir: string): string;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { mkdirSync, existsSync, writeFileSync, } from "node:fs";
|
|
2
|
+
import { basename, join, relative, sep } from "node:path";
|
|
3
|
+
import { getBuildPlan } from "../build-plans/package/build-plan-definitions.js";
|
|
4
|
+
import { loadBuildPlanDefinitionFromDir, seedLocalDefaultBuildPlan } from "../build-plans/package/local-build-plans.js";
|
|
5
|
+
import { initializeBuildRuntimeState, } from "./build/state.js";
|
|
6
|
+
import { refreshContextGraphBootstrapGuidance } from "./agents/lib/context-graph-bootstrap.js";
|
|
7
|
+
import { assertContextGraphContainer, assertContextGraphName, } from "../projects/interf-detect.js";
|
|
8
|
+
import { seedContextGraphBuildPlanPackage } from "../build-plans/package/interf-build-plan-package.js";
|
|
9
|
+
import { asProjectDataDir, projectContextGraphPath, } from "../contracts/lib/project-paths.js";
|
|
10
|
+
import { ensureBuildPlanArtifactTargets, listBuildPlanContextArtifacts, readBuildPlanContextFile } from "./build/context-graph-schema.js";
|
|
11
|
+
import { findProjectConfig, loadSourceFolderConfig, buildPlanIdForProjectConfig, resolveProjectSourceBindingPath, saveContextGraphInterfConfig, } from "../projects/source-config.js";
|
|
12
|
+
import { defaultControlPathForContextGraph, testRootForContextGraph, buildPlanPackagePathForContextGraph } from "./build/context-graph-paths.js";
|
|
13
|
+
import { DEFAULT_BUILD_PLAN_ID } from "../build-plans/build-plan-resolution.js";
|
|
14
|
+
const DEFAULT_INTERFIGNORE = [
|
|
15
|
+
".claude/",
|
|
16
|
+
".codex/",
|
|
17
|
+
".agents/",
|
|
18
|
+
".cursor/",
|
|
19
|
+
".interf/tests/",
|
|
20
|
+
".interf/tests/targets/sandboxes/",
|
|
21
|
+
".interf/runtime/",
|
|
22
|
+
"",
|
|
23
|
+
].join("\n");
|
|
24
|
+
const UNBUILT_CONTEXT_GRAPH_PLACEHOLDER = "Not yet built. Run `interf build` to build this Context Graph.";
|
|
25
|
+
function renderUnbuiltContextGraphFile(contextGraphName, relativePath) {
|
|
26
|
+
return [
|
|
27
|
+
`# ${contextGraphName} — ${relativePath}`,
|
|
28
|
+
"",
|
|
29
|
+
UNBUILT_CONTEXT_GRAPH_PLACEHOLDER,
|
|
30
|
+
"",
|
|
31
|
+
].join("\n");
|
|
32
|
+
}
|
|
33
|
+
function contextGraphGitignoreEntries(contextGraphPath) {
|
|
34
|
+
const schema = readBuildPlanContextFile(buildPlanPackagePathForContextGraph(contextGraphPath));
|
|
35
|
+
const artifactEntries = (schema ? listBuildPlanContextArtifacts(schema) : [])
|
|
36
|
+
.map((artifact) => artifact.kind === "file" ? artifact.path : `${artifact.path}/`);
|
|
37
|
+
return [
|
|
38
|
+
...artifactEntries,
|
|
39
|
+
".claude/",
|
|
40
|
+
".codex/",
|
|
41
|
+
".agents/",
|
|
42
|
+
".cursor/",
|
|
43
|
+
".interf/tests/",
|
|
44
|
+
".interf/tests/targets/sandboxes/",
|
|
45
|
+
".interf/runtime/",
|
|
46
|
+
];
|
|
47
|
+
}
|
|
48
|
+
function scaffoldContextGraphOutputs(contextGraphPath, contextGraphName) {
|
|
49
|
+
const schema = readBuildPlanContextFile(buildPlanPackagePathForContextGraph(contextGraphPath));
|
|
50
|
+
if (!schema) {
|
|
51
|
+
throw new Error(`Missing Build Plan schema at ${buildPlanPackagePathForContextGraph(contextGraphPath)}.`);
|
|
52
|
+
}
|
|
53
|
+
ensureBuildPlanArtifactTargets(contextGraphPath, schema);
|
|
54
|
+
for (const artifact of listBuildPlanContextArtifacts(schema)) {
|
|
55
|
+
if (!artifact.required || artifact.kind !== "file")
|
|
56
|
+
continue;
|
|
57
|
+
const targetPath = join(contextGraphPath, artifact.path);
|
|
58
|
+
if (existsSync(targetPath))
|
|
59
|
+
continue;
|
|
60
|
+
writeFileSync(targetPath, renderUnbuiltContextGraphFile(contextGraphName, artifact.path));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function localBuildPlanMatches(contextGraphPath, buildPlanId) {
|
|
64
|
+
const localBuildPlan = loadBuildPlanDefinitionFromDir(buildPlanPackagePathForContextGraph(contextGraphPath));
|
|
65
|
+
return localBuildPlan?.id === buildPlanId;
|
|
66
|
+
}
|
|
67
|
+
export function ensureContextGraphScaffold(projectDataDir, projectName, buildPlanId = DEFAULT_BUILD_PLAN_ID) {
|
|
68
|
+
const contextGraphPath = projectContextGraphPath(asProjectDataDir(projectDataDir), projectName);
|
|
69
|
+
return ensureContextGraphScaffoldAt({
|
|
70
|
+
projectDataDir,
|
|
71
|
+
contextGraphPath,
|
|
72
|
+
projectName,
|
|
73
|
+
buildPlanId,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
export function ensureContextGraphScaffoldAt(options) {
|
|
77
|
+
const { projectDataDir, contextGraphPath, projectName, buildPlanId = DEFAULT_BUILD_PLAN_ID, } = options;
|
|
78
|
+
assertContextGraphName(projectName, "Context Graph");
|
|
79
|
+
assertContextGraphContainer(projectDataDir);
|
|
80
|
+
mkdirSync(contextGraphPath, { recursive: true });
|
|
81
|
+
mkdirSync(testRootForContextGraph(contextGraphPath), { recursive: true });
|
|
82
|
+
if (buildPlanId === DEFAULT_BUILD_PLAN_ID) {
|
|
83
|
+
seedLocalDefaultBuildPlan({ projectDataDir });
|
|
84
|
+
}
|
|
85
|
+
const selectedBuildPlan = getBuildPlan(buildPlanId, { projectDataDir });
|
|
86
|
+
if (!localBuildPlanMatches(contextGraphPath, selectedBuildPlan.id)) {
|
|
87
|
+
seedContextGraphBuildPlanPackage({
|
|
88
|
+
contextGraphPath,
|
|
89
|
+
projectDataDir,
|
|
90
|
+
buildPlanId: selectedBuildPlan.id,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (!existsSync(join(contextGraphPath, ".gitignore"))) {
|
|
94
|
+
writeFileSync(join(contextGraphPath, ".gitignore"), [...contextGraphGitignoreEntries(contextGraphPath), ""].join("\n"));
|
|
95
|
+
}
|
|
96
|
+
return contextGraphPath;
|
|
97
|
+
}
|
|
98
|
+
export function createContextGraph(name, projectDataDir, buildPlanId = DEFAULT_BUILD_PLAN_ID, sourceFolderPath) {
|
|
99
|
+
assertContextGraphName(name, "Context Graph");
|
|
100
|
+
if (!sourceFolderPath || typeof sourceFolderPath !== "string") {
|
|
101
|
+
throw new Error("createContextGraph requires an explicit sourceFolderPath. Pass the absolute Source Folder path the Context Graph binds to.");
|
|
102
|
+
}
|
|
103
|
+
const savedProject = findProjectConfig(loadSourceFolderConfig(projectDataDir), name);
|
|
104
|
+
const effectiveBuildPlanId = buildPlanIdForProjectConfig(savedProject) ?? buildPlanId;
|
|
105
|
+
const selectedBuildPlan = getBuildPlan(effectiveBuildPlanId, { projectDataDir });
|
|
106
|
+
const contextGraphPath = ensureContextGraphScaffold(projectDataDir, name, selectedBuildPlan.id);
|
|
107
|
+
const resolvedSourceFolderPath = savedProject
|
|
108
|
+
? resolveProjectSourceBindingPath(projectDataDir, savedProject)
|
|
109
|
+
: sourceFolderPath;
|
|
110
|
+
const sourceRelativePath = relative(contextGraphPath, resolvedSourceFolderPath).split(sep).join("/") || ".";
|
|
111
|
+
saveContextGraphInterfConfig(contextGraphPath, {
|
|
112
|
+
type: "context-graph",
|
|
113
|
+
name,
|
|
114
|
+
intent: savedProject?.intent ?? "",
|
|
115
|
+
build_plan: selectedBuildPlan.id,
|
|
116
|
+
build_plan_origin: {
|
|
117
|
+
selected: selectedBuildPlan.id,
|
|
118
|
+
local_draft: false,
|
|
119
|
+
},
|
|
120
|
+
source: {
|
|
121
|
+
path: sourceRelativePath,
|
|
122
|
+
control_path: defaultControlPathForContextGraph(contextGraphPath),
|
|
123
|
+
project_path: sourceRelativePath,
|
|
124
|
+
},
|
|
125
|
+
});
|
|
126
|
+
writeFileSync(join(contextGraphPath, ".interfignore"), DEFAULT_INTERFIGNORE);
|
|
127
|
+
scaffoldContextGraphOutputs(contextGraphPath, name);
|
|
128
|
+
refreshContextGraphBootstrapGuidance(contextGraphPath);
|
|
129
|
+
writeFileSync(join(contextGraphPath, ".gitignore"), [...contextGraphGitignoreEntries(contextGraphPath), ""].join("\n"));
|
|
130
|
+
initializeBuildRuntimeState(contextGraphPath);
|
|
131
|
+
return contextGraphPath;
|
|
132
|
+
}
|
|
133
|
+
export function defaultContextGraphNameForSource(projectDataDir) {
|
|
134
|
+
return basename(projectDataDir);
|
|
135
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ContextGraphSemanticGraph } from "./schemas/index.js";
|
|
2
|
+
import type { SourceManifest } from "../contracts/lib/schema.js";
|
|
3
|
+
export declare function buildContextGraphSemanticGraph(options: {
|
|
4
|
+
contextGraphPath: string;
|
|
5
|
+
projectId: string;
|
|
6
|
+
generatedAt?: string;
|
|
7
|
+
sourceManifest?: SourceManifest | null;
|
|
8
|
+
entrypointPath?: string | null;
|
|
9
|
+
}): ContextGraphSemanticGraph;
|