/** * `GET /api/v1/projects/:projectId/interactive/api/docs` — the project-attributed docs list * (crew#472). * * The bridge's own `GET /api/docs` lists the docs of ONE root and knows nothing about crew's * projects: a row says `name`/`kind`/`head`/`versions`/`updated_at`, never which project it was * listed for. With docs roots partitioned per project (`bridge-root.ts`), the mount a list was * fetched under IS the attribution — so this route relays the bridge's rows field-for-field and * stamps each with the `projectId` of the mount, the one fact the bridge cannot supply and a * client rendering docs from several projects at once cannot otherwise recover. * * Deliberately NOT part of the pure-transport proxy (`proxy-routes.ts` stays response-sniffing * free, the same posture as the governed delete): this is its own route, one static segment more * specific than the proxy's wildcard, so fastify routes exactly this GET here while every other * method on the same path — `POST /api/docs` creates a doc — and every other path keep flowing * through the proxy verbatim. The query string (`?includeRetired=1`) is forwarded untouched. * * Non-list answers are relayed rather than reshaped: a bridge that fails its own listing answers * with its status and body; a bridge that answers 200 with something other than a JSON array of * doc summaries — a non-JSON body, a JSON object, a list holding `null` or a string where a row * should be — is a 502 that says which, never an empty list pretending nothing exists and never * `[{ projectId }]` minted from nothing. And a body that is malformed is told apart from a body * that never fully ARRIVED: the first is the bridge's answer (no retry would change it), the * second is a transport failure that takes the same invalidate → retry-once → diagnostic path a * refused connect does. */ import type { FastifyInstance } from 'fastify'; import type { CoreAdapter } from '../core/adapter.js'; import { type InteractiveBridgePool } from './bridge-pool.js'; import type { ProjectSettingsStore } from '../projects/settings.js'; import type { DocGroundingStore } from './doc-grounding.js'; export interface DocListDeps { settings: ProjectSettingsStore; pool: InteractiveBridgePool; env?: NodeJS.ProcessEnv; /** The daemon state home the DEFAULT docs root hangs off (crew ≥ 0.7.35, D-L7-1; tests point it at a scratch dir). */ stateHome?: string; /** The HOME a leading `~` in an EXPLICIT `interactiveRoot` expands against. */ home?: string; log?: (msg: string) => void; /** Budget for the bridge's list call (tests shorten it). The list is a directory scan. */ upstreamTimeoutMs?: number; /** crew#512: the `crew-grounding.json` sidecars beside the docs under this mount's root — a row * whose draft launch resolved its grounding carries it as `grounding`. Absent = rows as the * bridge lists them. */ groundingStore?: DocGroundingStore; } export declare function registerInteractiveDocList(app: FastifyInstance, adapter: CoreAdapter, deps: DocListDeps): void; //# sourceMappingURL=doc-list-routes.d.ts.map