/** * Multi-codebase scope resolution — the PINNED multiscope wire shared by the testing launch * surfaces (`POST /testing/recon`, `POST /campaigns`). * * Both launch bodies accept two OPTIONAL camelCase fields: * * - `repoRefs?: string[]` — explicit codebase attachments. Each ref must resolve in the repo * registry (by id, or by unique name — resolved TO the id) or the whole request fails with a * 400 that NAMES the bad ref. Deduped, first occurrence wins. * - `projectId?: string` — crew resolves the project's `crew.repo` members server-side. * Unknown project ⇒ 404; a project with zero repo members (and no explicit `repoRefs` to * fall back on) ⇒ 400 naming the fix. * * BOTH given ⇒ the union (explicit `repoRefs` order first, then project members not already * named). NEITHER ⇒ `repos: []` and the launch behaves exactly as it did before this wire * existed — backward compatible by construction. * * Fail-closed by doctrine (FINDING-031 posture): a ref that would not launch is refused HERE, * before anything is persisted, with the offending token named — never a silently narrowed * scope or a mid-run "no such repo" a worker discovers for the operator. */ import type { CoreAdapter } from '../core/adapter.js'; /** The two optional launch-body fields, as parsed by the route's zod schema. */ export interface MultiscopeFields { projectId?: string | undefined; repoRefs?: string[] | undefined; } /** A resolved repo — id is what launches carry (`repoRef`/`repo_ref`), name is for display. */ export interface ScopedRepo { id: string; name: string; } export type ScopeResolution = { ok: true; repos: ScopedRepo[]; } | { ok: false; status: 400 | 404 | 409; error: string; }; /** * Resolve the launch scope. Throws only what the adapter throws (notably * `ProjectsUnsupportedError` on a pre-projects addon — the caller maps it to 501, the same * "upgrade the engine" posture every project route holds). */ export declare function resolveScopeRepos(adapter: CoreAdapter, fields: MultiscopeFields): Promise; //# sourceMappingURL=multiscope.d.ts.map