@interf/compiler 0.22.0 → 0.33.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 +268 -0
- 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 -4
- package/dist/cli/commands/auth.d.ts +20 -0
- package/dist/cli/commands/auth.js +161 -0
- package/dist/cli/commands/benchmark.d.ts +10 -0
- package/dist/cli/commands/benchmark.js +88 -0
- package/dist/cli/commands/build-plan.js +95 -103
- package/dist/cli/commands/build.d.ts +1 -1
- package/dist/cli/commands/build.js +16 -15
- package/dist/cli/commands/doctor.js +3 -3
- package/dist/cli/commands/graphs.d.ts +2 -0
- package/dist/cli/commands/graphs.js +199 -0
- package/dist/cli/commands/login.js +4 -6
- package/dist/cli/commands/logout.js +1 -1
- package/dist/cli/commands/mcp.d.ts +3 -2
- package/dist/cli/commands/mcp.js +721 -204
- package/dist/cli/commands/project.d.ts +2 -0
- package/dist/cli/commands/project.js +202 -0
- package/dist/cli/commands/reset.d.ts +1 -1
- package/dist/cli/commands/reset.js +10 -10
- package/dist/cli/commands/runs.js +52 -26
- 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 +33 -22
- package/dist/cli/commands/traces.d.ts +2 -0
- package/dist/cli/commands/traces.js +125 -0
- package/dist/cli/commands/wizard.js +155 -150
- package/dist/cli/index.d.ts +7 -4
- package/dist/cli/index.js +13 -7
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/packages/build-plans/authoring/brief.d.ts +517 -0
- package/dist/packages/build-plans/authoring/brief.js +89 -0
- package/dist/packages/build-plans/authoring/build-plan-authoring.d.ts +10 -10
- package/dist/packages/build-plans/authoring/build-plan-authoring.js +66 -26
- package/dist/packages/build-plans/authoring/build-plan-edit-session.d.ts +1 -1
- package/dist/packages/build-plans/authoring/build-plan-edit-session.js +8 -2
- package/dist/packages/build-plans/authoring/build-plan-improvement.d.ts +9 -6
- package/dist/packages/build-plans/authoring/build-plan-improvement.js +39 -42
- 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 -12
- package/dist/packages/build-plans/package/build-plan-definitions.js +40 -39
- 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 +4 -4
- package/dist/packages/build-plans/package/build-plan-stage-runner.js +22 -11
- package/dist/packages/build-plans/package/builtin-build-plan.d.ts +5 -6
- package/dist/packages/build-plans/package/builtin-build-plan.js +7 -8
- package/dist/packages/build-plans/package/context-interface.d.ts +11 -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 +56 -52
- package/dist/packages/build-plans/package/local-build-plans.d.ts +12 -10
- package/dist/packages/build-plans/package/local-build-plans.js +56 -31
- package/dist/packages/build-plans/package/user-build-plans.js +1 -1
- package/dist/packages/contracts/index.d.ts +4 -2
- package/dist/packages/contracts/index.js +2 -1
- package/dist/packages/contracts/lib/project-paths.d.ts +137 -0
- package/dist/packages/contracts/lib/project-paths.js +211 -0
- package/dist/packages/contracts/lib/project-schema.d.ts +160 -0
- package/dist/packages/contracts/lib/project-schema.js +113 -0
- package/dist/packages/contracts/lib/schema.d.ts +739 -80
- package/dist/packages/contracts/lib/schema.js +410 -75
- 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 +79 -0
- package/dist/packages/projects/lib/schema.js +89 -0
- package/dist/packages/projects/source-config.d.ts +58 -0
- package/dist/packages/projects/source-config.js +352 -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 +82 -0
- package/dist/packages/runtime/actions/form-builders.d.ts +14 -0
- package/dist/packages/runtime/actions/form-builders.js +619 -0
- package/dist/packages/runtime/actions/form-validators.d.ts +8 -0
- package/dist/packages/runtime/actions/form-validators.js +128 -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 +158 -0
- package/dist/packages/runtime/actions/schemas.d.ts +154 -0
- package/dist/packages/runtime/actions/schemas.js +36 -0
- package/dist/packages/runtime/agent-handoff.d.ts +11 -0
- package/dist/packages/runtime/agent-handoff.js +101 -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.js +8 -14
- package/dist/packages/{engine → runtime}/agents/lib/execution.js +14 -4
- package/dist/packages/{engine → runtime}/agents/lib/preflight.js +15 -13
- package/dist/packages/{engine → runtime}/agents/lib/render.js +4 -4
- 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 +452 -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 +63 -0
- package/dist/packages/runtime/agents/lib/shells.js +383 -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 +64 -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 +7 -6
- 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 +88 -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 +20 -0
- package/dist/packages/runtime/benchmark-question-draft.js +124 -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 +5 -5
- package/dist/packages/{engine → runtime}/build/artifact-status.js +25 -23
- 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 +15 -0
- package/dist/packages/runtime/build/build-evidence.js +173 -0
- package/dist/packages/{engine → runtime}/build/build-pipeline.d.ts +12 -8
- package/dist/packages/runtime/build/build-pipeline.js +304 -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/{engine → runtime}/build/build-stage-plan.js +28 -29
- package/dist/packages/{engine → runtime}/build/build-stage-runner.d.ts +2 -1
- package/dist/packages/runtime/build/build-stage-runner.js +165 -0
- package/dist/packages/{engine → runtime}/build/build-target.d.ts +4 -4
- package/dist/packages/runtime/build/build-target.js +16 -0
- package/dist/packages/{engine → runtime}/build/check-evaluator.d.ts +14 -16
- package/dist/packages/runtime/build/check-evaluator.js +575 -0
- package/dist/packages/runtime/build/context-graph-paths.d.ts +51 -0
- package/dist/packages/runtime/build/context-graph-paths.js +133 -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 +5 -3
- package/dist/packages/{engine → runtime}/build/index.js +5 -3
- package/dist/packages/{engine → runtime}/build/lib/schema.d.ts +221 -88
- package/dist/packages/{engine → runtime}/build/lib/schema.js +61 -41
- 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 +5 -5
- 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/{engine → runtime}/build/runtime-paths.js +6 -6
- package/dist/packages/{engine → runtime}/build/runtime-prompt.js +7 -6
- 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 +265 -0
- package/dist/packages/{engine → runtime}/build/runtime-types.d.ts +6 -6
- package/dist/packages/runtime/build/runtime-types.js +1 -0
- package/dist/packages/runtime/build/runtime.d.ts +6 -0
- package/dist/packages/runtime/build/runtime.js +5 -0
- package/dist/packages/runtime/build/source-files.d.ts +58 -0
- package/dist/packages/runtime/build/source-files.js +184 -0
- package/dist/packages/runtime/build/source-inventory.d.ts +27 -0
- package/dist/packages/runtime/build/source-inventory.js +273 -0
- package/dist/packages/runtime/build/source-manifest.d.ts +52 -0
- package/dist/packages/runtime/build/source-manifest.js +192 -0
- package/dist/packages/runtime/build/stage-evidence.d.ts +22 -0
- package/dist/packages/runtime/build/stage-evidence.js +317 -0
- package/dist/packages/runtime/build/stage-reuse.d.ts +11 -0
- package/dist/packages/runtime/build/stage-reuse.js +142 -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 +119 -0
- package/dist/packages/{engine → runtime}/build/state-paths.d.ts +3 -1
- package/dist/packages/runtime/build/state-paths.js +22 -0
- package/dist/packages/runtime/build/state-view.d.ts +5 -0
- package/dist/packages/{engine → runtime}/build/state-view.js +60 -33
- package/dist/packages/runtime/build/state.d.ts +7 -0
- package/dist/packages/runtime/build/state.js +12 -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} +48 -35
- 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 +15 -15
- package/dist/packages/{engine → runtime}/client.js +41 -24
- 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 +114 -0
- package/dist/packages/runtime/context-graph-scaffold.d.ts +9 -0
- package/dist/packages/runtime/context-graph-scaffold.js +134 -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 +270 -192
- 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/{engine → runtime}/native-run-handlers.d.ts +4 -4
- package/dist/packages/{engine → runtime}/native-run-handlers.js +184 -152
- 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 +53 -0
- package/dist/packages/runtime/project-store.d.ts +85 -0
- package/dist/packages/runtime/project-store.js +168 -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 +166 -84
- 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 +131 -0
- package/dist/packages/runtime/runtime-build-runs.d.ts +47 -0
- package/dist/packages/runtime/runtime-build-runs.js +562 -0
- package/dist/packages/runtime/runtime-caches.d.ts +91 -0
- package/dist/packages/{engine → runtime}/runtime-caches.js +77 -49
- 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 +64 -0
- package/dist/packages/runtime/runtime-project-reads.d.ts +15 -0
- package/dist/packages/runtime/runtime-project-reads.js +381 -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 +21 -16
- package/dist/packages/{engine → runtime}/runtime-resource-builders.js +48 -38
- package/dist/packages/runtime/runtime-verify-runs.d.ts +84 -0
- package/dist/packages/runtime/runtime-verify-runs.js +295 -0
- package/dist/packages/runtime/runtime.d.ts +1165 -0
- package/dist/packages/runtime/runtime.js +417 -0
- package/dist/packages/runtime/schemas/actions.d.ts +1182 -0
- package/dist/packages/runtime/schemas/actions.js +117 -0
- package/dist/packages/runtime/schemas/agents.d.ts +76 -0
- package/dist/packages/runtime/schemas/agents.js +41 -0
- package/dist/packages/runtime/schemas/build-plans.d.ts +959 -0
- package/dist/packages/runtime/schemas/build-plans.js +107 -0
- package/dist/packages/runtime/schemas/files.d.ts +567 -0
- package/dist/packages/runtime/schemas/files.js +51 -0
- package/dist/packages/runtime/schemas/index.d.ts +8 -0
- package/dist/packages/runtime/schemas/index.js +12 -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 +103 -0
- package/dist/packages/runtime/schemas/projects.d.ts +339 -0
- package/dist/packages/runtime/schemas/projects.js +136 -0
- package/dist/packages/runtime/schemas/runs.d.ts +2676 -0
- package/dist/packages/runtime/schemas/runs.js +98 -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 +117 -0
- package/dist/packages/runtime/service/operations.d.ts +1490 -0
- package/dist/packages/runtime/service/operations.js +245 -0
- package/dist/packages/runtime/service/routes.d.ts +106 -0
- package/dist/packages/runtime/service/routes.js +120 -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 +27 -0
- package/dist/packages/runtime/service/server-helpers.js +89 -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 +43 -0
- package/dist/packages/runtime/service/server-routes-agents.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-agents.js +198 -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 +83 -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 +192 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.d.ts +9 -0
- package/dist/packages/runtime/service/server-routes-project-jobs.js +130 -0
- package/dist/packages/runtime/service/server-routes-project-runs.d.ts +14 -0
- package/dist/packages/runtime/service/server-routes-project-runs.js +85 -0
- package/dist/packages/runtime/service/server-routes-projects.d.ts +4 -0
- package/dist/packages/runtime/service/server-routes-projects.js +92 -0
- package/dist/packages/runtime/service/server-routes-runs.d.ts +3 -0
- package/dist/packages/runtime/service/server-routes-runs.js +112 -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 +26 -18
- package/dist/packages/{engine → runtime}/verify/verify-execution.js +11 -11
- package/dist/packages/{engine → runtime}/verify/verify-paths.d.ts +4 -4
- package/dist/packages/runtime/verify/verify-paths.js +61 -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/{engine → runtime}/verify/verify-specs.js +5 -3
- 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 +40 -30
- package/public-repo/CONTRIBUTING.md +7 -16
- package/public-repo/README.md +175 -234
- package/public-repo/SECURITY.md +3 -4
- package/public-repo/build-plans/interf-default/README.md +19 -14
- package/public-repo/build-plans/interf-default/build/stages/shape/SKILL.md +18 -11
- package/public-repo/build-plans/interf-default/build/stages/structure/SKILL.md +12 -5
- package/public-repo/build-plans/interf-default/build/stages/summarize/SKILL.md +16 -4
- package/public-repo/build-plans/interf-default/build-plan.json +34 -28
- package/public-repo/build-plans/interf-default/build-plan.schema.json +54 -32
- package/public-repo/build-plans/interf-default/improve/SKILL.md +3 -3
- package/public-repo/build-plans/interf-default/use/query/SKILL.md +17 -11
- package/public-repo/openapi/local-service.openapi.json +6803 -0
- package/public-repo/skills/interf/SKILL.md +460 -179
- 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/_qJKnA0dammQ306MG_zMq/_buildManifest.js +0 -11
- package/dist/interf-ui/_next/static/_qJKnA0dammQ306MG_zMq/_clientMiddlewareManifest.js +0 -1
- package/dist/interf-ui/_next/static/_qJKnA0dammQ306MG_zMq/_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/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-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/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-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.js +0 -16
- package/dist/packages/engine/build/state-view.d.ts +0 -5
- 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/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-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-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/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-profile.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/execution.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/executors.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/executors.js +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/logs.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/logs.js +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/preflight.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/render.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/status.d.ts +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/status.js +0 -0
- /package/dist/packages/{engine → runtime}/agents/lib/types.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-paths.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-execution.d.ts +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
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ResetResult } from "./schemas/index.js";
|
|
2
|
+
import type { ProjectConfig } from "../projects/lib/schema.js";
|
|
3
|
+
import type { LocalServiceRuntime } from "./runtime.js";
|
|
4
|
+
export declare function applyReset(runtime: LocalServiceRuntime, projectDataDir: string, requestValue: unknown): ResetResult;
|
|
5
|
+
export declare function resolveProjectConfig(projectDataDir: string, projectName: string, overrides?: Partial<Pick<ProjectConfig, "build_plan">>): ProjectConfig;
|
|
6
|
+
export declare function ensureContextGraphForRun(projectDataDir: string, projectConfig: ProjectConfig, runId: string): string;
|
|
7
|
+
export declare function defaultProjectId(projectDataDir: string): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { asProjectDataDir, projectContextGraphPath, projectRunContextGraphPath, } from "../contracts/lib/project-paths.js";
|
|
3
|
+
import { buildPlanIdForProjectConfig, findProjectConfig, listProjectConfigs, loadSourceFolderConfig, syncContextGraphInterfConfigFromProjectConfig, } from "../projects/source-config.js";
|
|
4
|
+
import { ensureContextGraphScaffoldAt, } from "./context-graph-scaffold.js";
|
|
5
|
+
import { resetBuildGeneratedState, } from "./build/reset.js";
|
|
6
|
+
import { ResetRequestSchema, ResetResultSchema, } from "./schemas/index.js";
|
|
7
|
+
import { requireSelectedBuildPlan } from "./runtime-proposal-helpers.js";
|
|
8
|
+
export function applyReset(runtime, projectDataDir, requestValue) {
|
|
9
|
+
const request = ResetRequestSchema.parse(requestValue);
|
|
10
|
+
const project = findProjectConfig(loadSourceFolderConfig(projectDataDir), request.project);
|
|
11
|
+
if (!project) {
|
|
12
|
+
throw new Error(`Project "${request.project}" is not saved.`);
|
|
13
|
+
}
|
|
14
|
+
const projectData = asProjectDataDir(projectDataDir);
|
|
15
|
+
const contextGraphPath = project.latest_context_graph_run_id
|
|
16
|
+
? projectRunContextGraphPath(projectData, project.latest_context_graph_run_id)
|
|
17
|
+
: projectContextGraphPath(projectData, request.project);
|
|
18
|
+
if (!existsSync(contextGraphPath)) {
|
|
19
|
+
throw new Error(`Context Graph for Project "${request.project}" does not exist.`);
|
|
20
|
+
}
|
|
21
|
+
resetBuildGeneratedState(contextGraphPath, request.scope);
|
|
22
|
+
// Reset wipes generated state, including saved Build/benchmark/readiness records.
|
|
23
|
+
runtime.buildRunCache.invalidateProject(projectDataDir, request.project);
|
|
24
|
+
runtime.verifyRunCache.invalidateProject(projectDataDir, request.project);
|
|
25
|
+
runtime.readinessCache.invalidateProject(projectDataDir, request.project);
|
|
26
|
+
return ResetResultSchema.parse({
|
|
27
|
+
kind: "interf-reset-result",
|
|
28
|
+
version: 1,
|
|
29
|
+
project: request.project,
|
|
30
|
+
scope: request.scope,
|
|
31
|
+
context_graph_path: contextGraphPath,
|
|
32
|
+
changed: true,
|
|
33
|
+
message: `Reset ${request.scope} state for Project ${request.project}.`,
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function resolveProjectConfig(projectDataDir, projectName, overrides = {}) {
|
|
37
|
+
const project = findProjectConfig(loadSourceFolderConfig(projectDataDir), projectName);
|
|
38
|
+
if (!project) {
|
|
39
|
+
throw new Error(`Project "${projectName}" is not saved in this control plane folder.`);
|
|
40
|
+
}
|
|
41
|
+
const buildPlan = overrides.build_plan ?? buildPlanIdForProjectConfig(project) ?? undefined;
|
|
42
|
+
return {
|
|
43
|
+
...project,
|
|
44
|
+
...(buildPlan ? { build_plan: buildPlan } : {}),
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export function ensureContextGraphForRun(projectDataDir, projectConfig, runId) {
|
|
48
|
+
const buildPlanId = requireSelectedBuildPlan(projectConfig);
|
|
49
|
+
const contextGraphPath = ensureContextGraphScaffoldAt({
|
|
50
|
+
projectDataDir,
|
|
51
|
+
contextGraphPath: projectRunContextGraphPath(asProjectDataDir(projectDataDir), runId),
|
|
52
|
+
projectName: projectConfig.name,
|
|
53
|
+
buildPlanId,
|
|
54
|
+
});
|
|
55
|
+
syncContextGraphInterfConfigFromProjectConfig(contextGraphPath, projectConfig);
|
|
56
|
+
return contextGraphPath;
|
|
57
|
+
}
|
|
58
|
+
export function defaultProjectId(projectDataDir) {
|
|
59
|
+
const project = listProjectConfigs(loadSourceFolderConfig(projectDataDir))[0];
|
|
60
|
+
if (!project) {
|
|
61
|
+
throw new Error("No Project is saved in this control plane folder.");
|
|
62
|
+
}
|
|
63
|
+
return project.name;
|
|
64
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type Readiness } from "../contracts/lib/schema.js";
|
|
2
|
+
import { type ProjectResource, type SourceFileResource, type ContextGraphResource } from "./schemas/index.js";
|
|
3
|
+
import type { ProjectConfig } from "../projects/lib/schema.js";
|
|
4
|
+
import type { LocalServiceRuntime } from "./runtime.js";
|
|
5
|
+
export declare function listProjects(runtime: LocalServiceRuntime, projectDataDir: string): ProjectResource[];
|
|
6
|
+
export declare function getProject(runtime: LocalServiceRuntime, projectDataDir: string, projectName: string): ProjectResource | null;
|
|
7
|
+
export declare function listProjectReadiness(runtime: LocalServiceRuntime, projectDataDir: string): Readiness[];
|
|
8
|
+
export declare function getProjectReadiness(runtime: LocalServiceRuntime, projectDataDir: string, projectName: string): Readiness | null;
|
|
9
|
+
export declare function listReadiness(runtime: LocalServiceRuntime, projectDataDir: string): Readiness[];
|
|
10
|
+
export declare function getReadiness(runtime: LocalServiceRuntime, projectDataDir: string, projectName: string): Readiness | null;
|
|
11
|
+
export declare function computeProjectReadiness(runtime: LocalServiceRuntime, projectDataDir: string, project: ProjectConfig): Readiness;
|
|
12
|
+
export declare function listSourceFiles(runtime: LocalServiceRuntime, projectDataDir: string, projectName?: string | null): SourceFileResource[];
|
|
13
|
+
export declare function listContextGraphs(runtime: LocalServiceRuntime, projectDataDir: string, projectName?: string | null): ContextGraphResource[];
|
|
14
|
+
export declare function getContextGraph(runtime: LocalServiceRuntime, projectDataDir: string, graphId: string): ContextGraphResource | null;
|
|
15
|
+
export declare function getLatestContextGraph(runtime: LocalServiceRuntime, projectDataDir: string, projectName: string): ContextGraphResource | null;
|
|
@@ -0,0 +1,381 @@
|
|
|
1
|
+
import { existsSync } from "node:fs";
|
|
2
|
+
import { asProjectDataDir, projectConfigPath, } from "../contracts/lib/project-paths.js";
|
|
3
|
+
import { buildPlanIdForProjectConfig, buildTestSpecFromSourceFolderConfig, fingerprintSavedBenchmarkSpec, findProjectConfig, listProjectConfigs, loadSourceFolderConfig, resolveProjectSourceBindingPath, } from "../projects/source-config.js";
|
|
4
|
+
import { ReadinessSchema, } from "../contracts/lib/schema.js";
|
|
5
|
+
import { readInterfConfig, } from "../projects/interf.js";
|
|
6
|
+
import { loadContextGraphSourceManifest, } from "./build/source-manifest.js";
|
|
7
|
+
import { buildProjectResource, readinessStateToProjectReadiness, readinessSummaryForStatus, readinessTargetResult, } from "./runtime-resource-builders.js";
|
|
8
|
+
import { aggregateArtifactVerdict, } from "./build/artifact-status.js";
|
|
9
|
+
import { buildBuildEvidence, } from "./build/build-evidence.js";
|
|
10
|
+
import { validateContextGraph } from "./build/validate.js";
|
|
11
|
+
import { SourceFileResourceSchema, ContextGraphResourceSchema, } from "./schemas/index.js";
|
|
12
|
+
import { uniqueArtifacts } from "./run-observability.js";
|
|
13
|
+
import { listBuildRunsForProject, } from "./runtime-build-runs.js";
|
|
14
|
+
import { readExecutionStageLedgerHistory } from "./runtime-persistence.js";
|
|
15
|
+
import { getBuildPlan } from "../build-plans/package/build-plan-definitions.js";
|
|
16
|
+
import { listContextInterfaceArtifacts } from "../build-plans/package/context-interface.js";
|
|
17
|
+
import { latestTopLevelVerifyRun, listVerifyRunsForProject, readLatestBenchmarkRun, } from "./runtime-verify-runs.js";
|
|
18
|
+
export function listProjects(runtime, projectDataDir) {
|
|
19
|
+
const config = loadSourceFolderConfig(projectDataDir);
|
|
20
|
+
return listProjectConfigs(config).map((project) => {
|
|
21
|
+
const buildRuns = listBuildRunsForProject(runtime, projectDataDir, project.name);
|
|
22
|
+
const verifyRuns = listVerifyRunsForProject(runtime, projectDataDir, project.name);
|
|
23
|
+
const latestVerifyRun = latestTopLevelVerifyRun(verifyRuns);
|
|
24
|
+
const contextGraphRun = latestContextGraphBuildRun(project, buildRuns);
|
|
25
|
+
const readiness = computeProjectReadiness(runtime, projectDataDir, project);
|
|
26
|
+
return buildProjectResource(project, readiness, {
|
|
27
|
+
latestBuildRunId: buildRuns[0]?.run_id ?? null,
|
|
28
|
+
latestContextGraphBuildRunId: contextGraphRun?.run_id ?? null,
|
|
29
|
+
latestTestRunId: latestVerifyRun?.run_id ?? null,
|
|
30
|
+
}, resolveProjectSourceBindingPath(projectDataDir, project, config), projectConfigPath(asProjectDataDir(projectDataDir)),
|
|
31
|
+
// Surface per-Artifact status from the latest Build run so the UI can
|
|
32
|
+
// render Artifact rows on the Project page without a separate fetch.
|
|
33
|
+
contextGraphRun?.artifacts ?? []);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
export function getProject(runtime, projectDataDir, projectName) {
|
|
37
|
+
return listProjects(runtime, projectDataDir).find((project) => project.name === projectName) ?? null;
|
|
38
|
+
}
|
|
39
|
+
export function listProjectReadiness(runtime, projectDataDir) {
|
|
40
|
+
return listReadiness(runtime, projectDataDir).map(readinessStateToProjectReadiness);
|
|
41
|
+
}
|
|
42
|
+
export function getProjectReadiness(runtime, projectDataDir, projectName) {
|
|
43
|
+
const readiness = getReadiness(runtime, projectDataDir, projectName);
|
|
44
|
+
return readiness ? readinessStateToProjectReadiness(readiness) : null;
|
|
45
|
+
}
|
|
46
|
+
export function listReadiness(runtime, projectDataDir) {
|
|
47
|
+
const config = loadSourceFolderConfig(projectDataDir);
|
|
48
|
+
return listProjectConfigs(config).map((project) => computeProjectReadiness(runtime, projectDataDir, project));
|
|
49
|
+
}
|
|
50
|
+
export function getReadiness(runtime, projectDataDir, projectName) {
|
|
51
|
+
const project = findProjectConfig(loadSourceFolderConfig(projectDataDir), projectName);
|
|
52
|
+
return project ? computeProjectReadiness(runtime, projectDataDir, project) : null;
|
|
53
|
+
}
|
|
54
|
+
export function computeProjectReadiness(runtime, projectDataDir, project) {
|
|
55
|
+
return runtime.readinessCache.get(projectDataDir, project.name, () => computeProjectReadinessUncached(runtime, projectDataDir, project));
|
|
56
|
+
}
|
|
57
|
+
function latestContextGraphBuildRun(project, buildRuns) {
|
|
58
|
+
const selected = project.latest_context_graph_run_id
|
|
59
|
+
? buildRuns.find((run) => run.run_id === project.latest_context_graph_run_id && run.status === "succeeded") ?? null
|
|
60
|
+
: null;
|
|
61
|
+
return selected ?? buildRuns.find((run) => run.status === "succeeded") ?? null;
|
|
62
|
+
}
|
|
63
|
+
function computeProjectReadinessUncached(runtime, projectDataDir, project) {
|
|
64
|
+
const generatedAt = new Date().toISOString();
|
|
65
|
+
const buildRuns = listBuildRunsForProject(runtime, projectDataDir, project.name);
|
|
66
|
+
const buildRun = buildRuns[0] ?? null;
|
|
67
|
+
const contextGraphRun = latestContextGraphBuildRun(project, buildRuns);
|
|
68
|
+
const contextGraphPath = contextGraphRun?.context_graph_path ?? null;
|
|
69
|
+
const contextExists = Boolean(contextGraphPath && existsSync(contextGraphPath));
|
|
70
|
+
const contextGraphValidation = contextGraphPath && contextExists
|
|
71
|
+
? validateContextGraph(contextGraphPath)
|
|
72
|
+
: null;
|
|
73
|
+
const contextReady = Boolean(contextGraphRun && contextGraphValidation?.ok);
|
|
74
|
+
const verifyRun = latestTopLevelVerifyRun(listVerifyRunsForProject(runtime, projectDataDir, project.name));
|
|
75
|
+
const benchmarkRun = readLatestBenchmarkRun(projectDataDir, project.name);
|
|
76
|
+
const artifactStatuses = contextGraphRun?.artifacts ?? [];
|
|
77
|
+
const hasArtifactContract = artifactStatuses.length > 0;
|
|
78
|
+
const artifactVerdict = aggregateArtifactVerdict(artifactStatuses);
|
|
79
|
+
const artifactFailures = artifactStatuses.filter((artifact) => artifact.status !== "ready");
|
|
80
|
+
const artifactCheckResults = artifactStatuses.flatMap((artifact) => artifact.check_results ?? []);
|
|
81
|
+
const requiredArtifactCheckResults = artifactCheckResults.filter((result) => result.required !== false);
|
|
82
|
+
const passedArtifactCheckResults = requiredArtifactCheckResults.filter((result) => result.passed);
|
|
83
|
+
const requiredContextChecks = (contextGraphRun?.context_checks ?? []).filter((check) => check.required !== false);
|
|
84
|
+
const failedContextChecks = requiredContextChecks.filter((check) => check.status !== "passed");
|
|
85
|
+
const contextChecksPassed = requiredContextChecks.length === 0 || failedContextChecks.length === 0;
|
|
86
|
+
const savedBenchmarkSpec = buildTestSpecFromSourceFolderConfig({
|
|
87
|
+
projectDataDir,
|
|
88
|
+
targetName: project.name,
|
|
89
|
+
targetType: "context-graph",
|
|
90
|
+
});
|
|
91
|
+
const configuredChecks = savedBenchmarkSpec?.cases.length ?? 0;
|
|
92
|
+
const currentFingerprint = savedBenchmarkSpec
|
|
93
|
+
? fingerprintSavedBenchmarkSpec({
|
|
94
|
+
projectDataDir,
|
|
95
|
+
projectName: project.name,
|
|
96
|
+
targetType: "context-graph",
|
|
97
|
+
})
|
|
98
|
+
: null;
|
|
99
|
+
const benchmarkRunFingerprint = benchmarkRun?.checks_fingerprint ?? null;
|
|
100
|
+
const sourceResult = readinessTargetResult(benchmarkRun?.source_files, currentFingerprint, benchmarkRunFingerprint);
|
|
101
|
+
const contextResult = readinessTargetResult(benchmarkRun?.context_graph, currentFingerprint, benchmarkRunFingerprint);
|
|
102
|
+
const checksStale = Boolean(currentFingerprint && benchmarkRunFingerprint && currentFingerprint !== benchmarkRunFingerprint);
|
|
103
|
+
const buildCheck = (() => {
|
|
104
|
+
if (!buildRun) {
|
|
105
|
+
return {
|
|
106
|
+
gate: "build-run",
|
|
107
|
+
ok: false,
|
|
108
|
+
status: "not-built",
|
|
109
|
+
summary: "Context Graph has not been built yet.",
|
|
110
|
+
artifact_path: contextReady ? contextGraphPath : null,
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
if (buildRun.status === "succeeded") {
|
|
114
|
+
return {
|
|
115
|
+
gate: "build-run",
|
|
116
|
+
ok: contextReady,
|
|
117
|
+
status: contextReady ? "built" : "failed",
|
|
118
|
+
summary: contextReady
|
|
119
|
+
? "Latest Build produced the Context Graph."
|
|
120
|
+
: "Latest Build finished but did not produce a Context Graph.",
|
|
121
|
+
run_id: buildRun.run_id,
|
|
122
|
+
artifact_path: contextReady ? contextGraphPath : null,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
if (buildRun.status === "queued" || buildRun.status === "running") {
|
|
126
|
+
return {
|
|
127
|
+
gate: "build-run",
|
|
128
|
+
ok: false,
|
|
129
|
+
status: "building",
|
|
130
|
+
summary: "Build is in progress.",
|
|
131
|
+
run_id: buildRun.run_id,
|
|
132
|
+
artifact_path: contextExists ? contextGraphPath : null,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
return {
|
|
136
|
+
gate: "build-run",
|
|
137
|
+
ok: false,
|
|
138
|
+
status: "failed",
|
|
139
|
+
summary: buildRun.status === "cancelled"
|
|
140
|
+
? "Latest Build was cancelled."
|
|
141
|
+
: "Latest Build failed.",
|
|
142
|
+
run_id: buildRun.run_id,
|
|
143
|
+
artifact_path: contextReady ? contextGraphPath : null,
|
|
144
|
+
};
|
|
145
|
+
})();
|
|
146
|
+
// Drop the tautological "Project is saved" gate — if this readiness object
|
|
147
|
+
// exists, the Project exists. Keep the Context Graph / Build / Artifact /
|
|
148
|
+
// benchmark gates in product vocabulary.
|
|
149
|
+
const checks = [
|
|
150
|
+
{
|
|
151
|
+
gate: "context-graph",
|
|
152
|
+
ok: contextReady,
|
|
153
|
+
status: contextReady ? "built" : "not-built",
|
|
154
|
+
summary: contextReady
|
|
155
|
+
? "Context Graph is built."
|
|
156
|
+
: "Context Graph has not been built yet.",
|
|
157
|
+
artifact_path: contextReady ? contextGraphPath : null,
|
|
158
|
+
},
|
|
159
|
+
buildCheck,
|
|
160
|
+
{
|
|
161
|
+
gate: "artifact-diagnostics",
|
|
162
|
+
ok: !hasArtifactContract || artifactVerdict === "ready",
|
|
163
|
+
status: !hasArtifactContract
|
|
164
|
+
? "not-configured"
|
|
165
|
+
: artifactVerdict === "ready" ? "ready" : "not-ready",
|
|
166
|
+
summary: !hasArtifactContract
|
|
167
|
+
? "No Artifacts declared by the selected Build Plan."
|
|
168
|
+
: artifactVerdict === "ready"
|
|
169
|
+
? `${artifactStatuses.length} Artifact${artifactStatuses.length === 1 ? "" : "s"} ready; ${passedArtifactCheckResults.length}/${requiredArtifactCheckResults.length} required diagnostic${requiredArtifactCheckResults.length === 1 ? "" : "s"} passed.`
|
|
170
|
+
: `${artifactFailures.length} Artifact${artifactFailures.length === 1 ? "" : "s"} not ready.`,
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
gate: "context-checks",
|
|
174
|
+
ok: contextChecksPassed,
|
|
175
|
+
status: requiredContextChecks.length === 0
|
|
176
|
+
? "not-configured"
|
|
177
|
+
: contextChecksPassed ? "ready" : "not-ready",
|
|
178
|
+
summary: requiredContextChecks.length === 0
|
|
179
|
+
? "No Context Checks declared by the selected Build Plan."
|
|
180
|
+
: contextChecksPassed
|
|
181
|
+
? `${requiredContextChecks.length} required Context Check${requiredContextChecks.length === 1 ? "" : "s"} passed.`
|
|
182
|
+
: `${failedContextChecks.length} required Context Check${failedContextChecks.length === 1 ? "" : "s"} not passed.`,
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
gate: "benchmarks",
|
|
186
|
+
ok: true,
|
|
187
|
+
status: configuredChecks > 0 ? "built" : "not-configured",
|
|
188
|
+
summary: configuredChecks > 0
|
|
189
|
+
? `${configuredChecks} benchmark check${configuredChecks === 1 ? "" : "s"} configured.`
|
|
190
|
+
: "No benchmark checks configured yet.",
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
gate: "benchmarks-current",
|
|
194
|
+
ok: !checksStale,
|
|
195
|
+
status: checksStale ? "stale" : "built",
|
|
196
|
+
summary: checksStale
|
|
197
|
+
? "Latest benchmark result is stale — your checks have changed since."
|
|
198
|
+
: "Latest benchmark result matches the saved checks.",
|
|
199
|
+
},
|
|
200
|
+
];
|
|
201
|
+
const status = (() => {
|
|
202
|
+
if (buildRun?.status === "queued" || buildRun?.status === "running")
|
|
203
|
+
return "building";
|
|
204
|
+
if (verifyRun?.status === "queued" || verifyRun?.status === "running")
|
|
205
|
+
return "checking";
|
|
206
|
+
if (buildRun?.status === "failed" || buildRun?.status === "cancelled")
|
|
207
|
+
return "failed";
|
|
208
|
+
if (!buildRun || !contextReady)
|
|
209
|
+
return "not-built";
|
|
210
|
+
if (hasArtifactContract && artifactVerdict !== "ready")
|
|
211
|
+
return "not-ready";
|
|
212
|
+
if (!contextChecksPassed)
|
|
213
|
+
return "not-ready";
|
|
214
|
+
if (checksStale)
|
|
215
|
+
return "stale";
|
|
216
|
+
if (configuredChecks === 0)
|
|
217
|
+
return hasArtifactContract ? "ready" : "built";
|
|
218
|
+
if (!contextResult)
|
|
219
|
+
return "built";
|
|
220
|
+
return contextResult.total > 0 && contextResult.passed === contextResult.total ? "ready" : "not-ready";
|
|
221
|
+
})();
|
|
222
|
+
const ready = status === "ready";
|
|
223
|
+
return ReadinessSchema.parse({
|
|
224
|
+
kind: "interf-readiness-state",
|
|
225
|
+
version: 1,
|
|
226
|
+
generated_at: generatedAt,
|
|
227
|
+
project: project.name,
|
|
228
|
+
status,
|
|
229
|
+
ready,
|
|
230
|
+
summary: readinessSummaryForStatus(status),
|
|
231
|
+
context_graph_path: contextReady ? contextGraphPath : null,
|
|
232
|
+
latest_build_run_id: buildRun?.run_id ?? null,
|
|
233
|
+
latest_benchmark_run_id: verifyRun?.run_id ?? null,
|
|
234
|
+
build: buildCheck,
|
|
235
|
+
check_results: {
|
|
236
|
+
configured: configuredChecks,
|
|
237
|
+
fingerprint: currentFingerprint,
|
|
238
|
+
source_files: sourceResult,
|
|
239
|
+
context_graph: contextResult,
|
|
240
|
+
},
|
|
241
|
+
checks,
|
|
242
|
+
});
|
|
243
|
+
}
|
|
244
|
+
export function listSourceFiles(runtime, projectDataDir, projectName) {
|
|
245
|
+
const config = loadSourceFolderConfig(projectDataDir);
|
|
246
|
+
const projects = listProjectConfigs(config)
|
|
247
|
+
.filter((project) => !projectName || project.name === projectName);
|
|
248
|
+
return projects.flatMap((project) => {
|
|
249
|
+
const buildRuns = listBuildRunsForProject(runtime, projectDataDir, project.name);
|
|
250
|
+
const latestRun = latestContextGraphBuildRun(project, buildRuns);
|
|
251
|
+
const contextGraphPath = latestRun?.context_graph_path ?? null;
|
|
252
|
+
const manifest = contextGraphPath ? loadContextGraphSourceManifest(contextGraphPath) : null;
|
|
253
|
+
if (!manifest)
|
|
254
|
+
return [];
|
|
255
|
+
return manifest.files.map((file) => SourceFileResourceSchema.parse({
|
|
256
|
+
project: project.name,
|
|
257
|
+
source_manifest_id: manifest.manifest_id,
|
|
258
|
+
source_file_id: file.id,
|
|
259
|
+
path: file.path,
|
|
260
|
+
locator: file.locator,
|
|
261
|
+
kind: file.kind,
|
|
262
|
+
absolute_path: file.locator,
|
|
263
|
+
size_bytes: file.size_bytes ?? 0,
|
|
264
|
+
modified_at: null,
|
|
265
|
+
source_folder_path: manifest.source.locator,
|
|
266
|
+
}));
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
export function listContextGraphs(runtime, projectDataDir, projectName) {
|
|
270
|
+
return listProjectConfigs(loadSourceFolderConfig(projectDataDir))
|
|
271
|
+
.filter((project) => !projectName || project.name === projectName)
|
|
272
|
+
.flatMap((project) => listProjectContextGraphs(runtime, projectDataDir, project))
|
|
273
|
+
.filter((graph) => graph !== null);
|
|
274
|
+
}
|
|
275
|
+
export function getContextGraph(runtime, projectDataDir, graphId) {
|
|
276
|
+
return listContextGraphs(runtime, projectDataDir)
|
|
277
|
+
.find((graph) => graph.graph_id === graphId || graph.build_run_id === graphId) ?? null;
|
|
278
|
+
}
|
|
279
|
+
export function getLatestContextGraph(runtime, projectDataDir, projectName) {
|
|
280
|
+
const project = findProjectConfig(loadSourceFolderConfig(projectDataDir), projectName);
|
|
281
|
+
if (!project)
|
|
282
|
+
return null;
|
|
283
|
+
const buildRuns = listBuildRunsForProject(runtime, projectDataDir, project.name);
|
|
284
|
+
const contextGraphRun = latestContextGraphBuildRun(project, buildRuns);
|
|
285
|
+
const context = getProjectContextGraph(runtime, projectDataDir, project, contextGraphRun);
|
|
286
|
+
if (!context?.exists || !context.path)
|
|
287
|
+
return null;
|
|
288
|
+
const buildRunId = contextGraphRun?.run_id ?? null;
|
|
289
|
+
const rows = context.build_evidence?.rows ?? [];
|
|
290
|
+
const passing = rows.filter((row) => !row.issue_state || row.issue_state === "pass").length;
|
|
291
|
+
return ContextGraphResourceSchema.parse({
|
|
292
|
+
...context,
|
|
293
|
+
kind: "interf-context-graph",
|
|
294
|
+
version: 1,
|
|
295
|
+
graph_id: buildRunId ?? `${projectName}-latest`,
|
|
296
|
+
project_id: projectName,
|
|
297
|
+
build_run_id: buildRunId,
|
|
298
|
+
created_at: contextGraphRun?.finished_at ?? contextGraphRun?.started_at ?? contextGraphRun?.created_at ?? context.readiness.generated_at,
|
|
299
|
+
is_latest: true,
|
|
300
|
+
build_evidence: context.build_evidence
|
|
301
|
+
? {
|
|
302
|
+
...context.build_evidence,
|
|
303
|
+
summary: `${context.build_evidence.summary} · ${passing}/${rows.length} checks`,
|
|
304
|
+
}
|
|
305
|
+
: context.build_evidence,
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
function listProjectContextGraphs(runtime, projectDataDir, project) {
|
|
309
|
+
const buildRuns = listBuildRunsForProject(runtime, projectDataDir, project.name);
|
|
310
|
+
const latest = latestContextGraphBuildRun(project, buildRuns);
|
|
311
|
+
const graphs = buildRuns
|
|
312
|
+
.filter((run) => run.status === "succeeded")
|
|
313
|
+
.map((run) => getProjectContextGraph(runtime, projectDataDir, project, run, run.run_id === latest?.run_id))
|
|
314
|
+
.filter((graph) => graph !== null);
|
|
315
|
+
return graphs;
|
|
316
|
+
}
|
|
317
|
+
function getProjectContextGraph(runtime, projectDataDir, project, buildRun, isLatest = true) {
|
|
318
|
+
if (!buildRun)
|
|
319
|
+
return null;
|
|
320
|
+
const path = buildRun.context_graph_path;
|
|
321
|
+
const config = readInterfConfig(path);
|
|
322
|
+
const verifyRuns = listVerifyRunsForProject(runtime, projectDataDir, project.name);
|
|
323
|
+
const latestVerifyRun = latestTopLevelVerifyRun(verifyRuns);
|
|
324
|
+
const readiness = computeProjectReadiness(runtime, projectDataDir, project);
|
|
325
|
+
const buildPlan = config?.build_plan ?? buildRun.build_plan ?? buildPlanIdForProjectConfig(project);
|
|
326
|
+
const sourceFileCount = listSourceFiles(runtime, projectDataDir, project.name).length;
|
|
327
|
+
let expectedStageCount;
|
|
328
|
+
let expectedOutputCount;
|
|
329
|
+
if (buildPlan) {
|
|
330
|
+
try {
|
|
331
|
+
const activeBuildPlan = getBuildPlan(buildPlan, { projectDataDir });
|
|
332
|
+
expectedStageCount = activeBuildPlan.stages.length;
|
|
333
|
+
const contextInterface = activeBuildPlan.contextInterface ?? activeBuildPlan.schema;
|
|
334
|
+
expectedOutputCount = contextInterface ? listContextInterfaceArtifacts(contextInterface).length : undefined;
|
|
335
|
+
}
|
|
336
|
+
catch {
|
|
337
|
+
expectedStageCount = undefined;
|
|
338
|
+
expectedOutputCount = undefined;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
return ContextGraphResourceSchema.parse({
|
|
342
|
+
kind: "interf-context-graph",
|
|
343
|
+
version: 1,
|
|
344
|
+
graph_id: buildRun.run_id,
|
|
345
|
+
project_id: project.name,
|
|
346
|
+
build_run_id: buildRun.run_id,
|
|
347
|
+
created_at: buildRun.finished_at ?? buildRun.started_at ?? buildRun.created_at ?? readiness.generated_at,
|
|
348
|
+
is_latest: isLatest,
|
|
349
|
+
project: project.name,
|
|
350
|
+
path,
|
|
351
|
+
exists: existsSync(path),
|
|
352
|
+
readiness,
|
|
353
|
+
build_plan: buildPlan,
|
|
354
|
+
latest_build_run_id: buildRun.run_id,
|
|
355
|
+
latest_benchmark_run_id: latestVerifyRun?.run_id ?? null,
|
|
356
|
+
artifacts: uniqueArtifacts(buildRun.stages.flatMap((stage) => stage.artifacts)),
|
|
357
|
+
build_evidence: buildBuildEvidence({
|
|
358
|
+
projectId: project.name,
|
|
359
|
+
buildRun,
|
|
360
|
+
readiness,
|
|
361
|
+
sourceFileCount,
|
|
362
|
+
expectedStageCount,
|
|
363
|
+
expectedOutputCount,
|
|
364
|
+
stageEvidence: latestStageEvidenceForContext(path),
|
|
365
|
+
}),
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
function latestStageEvidenceForContext(contextGraphPath) {
|
|
369
|
+
const latestByStage = new Map();
|
|
370
|
+
for (const entry of readExecutionStageLedgerHistory(contextGraphPath)) {
|
|
371
|
+
if (!entry.evidence)
|
|
372
|
+
continue;
|
|
373
|
+
const existing = latestByStage.get(entry.stage);
|
|
374
|
+
if (!existing || entry.updated_at >= existing.updated_at) {
|
|
375
|
+
latestByStage.set(entry.stage, entry);
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
return [...latestByStage.values()]
|
|
379
|
+
.map((entry) => entry.evidence)
|
|
380
|
+
.filter((entry) => entry !== undefined);
|
|
381
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ProjectConfig } from "../projects/lib/schema.js";
|
|
2
|
+
import { type ActionProposalPlanActionType, type ActionProposalResource } from "./schemas/index.js";
|
|
3
|
+
export declare const ACTION_PLANNER_CLARIFICATION_MESSAGE = "I can help with this Interf instance. Ask a question about Interf, or ask me to create a Project, build a Context Graph, run a benchmark, improve a Build Plan, or draft a Build Plan and I will prepare an approval proposal.";
|
|
4
|
+
export type LocalTestMode = "source-files" | "context-graph" | "both";
|
|
5
|
+
export declare function createActionProposalId(): string;
|
|
6
|
+
export declare function sanitizeActionProposalPlan(value: unknown): unknown;
|
|
7
|
+
export declare function stringValue(values: Record<string, unknown> | undefined, key: string): string | null;
|
|
8
|
+
export declare function actionTypeFromValues(values: Record<string, unknown> | undefined): ActionProposalPlanActionType | null;
|
|
9
|
+
export declare function directServiceEndpointForAction(actionType: ActionProposalPlanActionType, options?: {
|
|
10
|
+
project?: string | null;
|
|
11
|
+
}): string | null;
|
|
12
|
+
export declare function numberValue(values: Record<string, unknown> | undefined, key: string): number | null;
|
|
13
|
+
export declare function benchmarkModeFromValues(values: Record<string, unknown> | undefined): LocalTestMode | null;
|
|
14
|
+
export declare function buildPlanIdForProposal(message: string, values: Record<string, unknown> | undefined): string;
|
|
15
|
+
export declare function actionValueBuildPlanIntent(values: Record<string, unknown> | undefined): string | null;
|
|
16
|
+
export declare function buildPlanAuthoringPromptFallback(message: string, buildPlanId: string): string;
|
|
17
|
+
export declare function buildPlanAuthoringHintFromPrompt(prompt: string): string;
|
|
18
|
+
export declare function buildPlanLabelFromId(buildPlanId: string): string;
|
|
19
|
+
export declare function requireSelectedBuildPlan(project: ProjectConfig): string;
|
|
20
|
+
export declare function actionCommandPreview(actionType: ActionProposalResource["action_type"], projectName: string | null, buildPlanId: string | null, values: Record<string, unknown> | undefined): string;
|
|
21
|
+
export declare function hasContextGraphBenchmarkTarget(sourcePath: string, projectConfig: ProjectConfig): boolean;
|
|
22
|
+
export declare function actionAssistantMessage(actionType: ActionProposalResource["action_type"], projectName: string | null, commandPreview: string): string;
|