/** * Studio OS behaviour 8, "Capture anything": transcripts, photos and notes become intents, * decisions and memories in the right project — PROPOSED, never silently learned. * * POST /projects/:id/capture notes + text files + photos land in a per-run inbox on the daemon * host, and a small repo-less team run is launched THROUGH `POST /runs` * (one launch path: membership, the state-home and roster checks, the * audit trail), filed to the project, one read-only `understand` step. * The run's only output is proposals in the EXISTING estate queue * (`proposal.submit`), reviewed on `/proposals` like everything else. * * And the review's "edit" verb, {@link approveEdited}: estate has no proposal edit, so an accept WITH * an edit submits the edited copy to the same queue, approves the copy, then rejects the original. * * Confidentiality ("patterns cross projects; client details never do") is estate's facet admission: * a memory faceted `project:` is recalled only under an intent naming that project, and the * garden shim stamps the run's project onto every proposal it files. Crossing projects is therefore * only ever a human accept that names `reach: "pattern"`, on a memory-class capture — the copy then * drops its `project`/`repo` facets. Everything else (what is an intent, a decision, a memory; which * seat reads the photo) is the team's judgment, stated in the brief, not code here. */ import type { FastifyInstance } from 'fastify'; import { z } from 'zod'; /** Notes are prose; a transcript is the biggest thing a person pastes. */ export declare const CAPTURE_NOTES_MAX_BYTES: number; /** One dropped text file (a transcript, a meeting note). */ export declare const CAPTURE_TEXT_MAX_BYTES: number; /** One decoded photo — a phone camera JPEG fits with room. */ export declare const CAPTURE_IMAGE_MAX_BYTES: number; /** Every decoded byte of one capture together. */ export declare const CAPTURE_TOTAL_MAX_BYTES: number; export declare const CAPTURE_MAX_FILES = 8; /** The route's JSON body limit: the decoded total as base64 (4/3) plus the JSON around it. */ export declare const CAPTURE_BODY_LIMIT: number; /** The image types a vision-capable seat reads, and the extension each lands with. */ export declare const CAPTURE_IMAGE_TYPES: Readonly>; export declare const CaptureSchema: z.ZodObject<{ notes: z.ZodOptional; files: z.ZodOptional, z.ZodObject<{ name: z.ZodString; mediaType: z.ZodString; dataBase64: z.ZodString; }, "strict", z.ZodTypeAny, { name: string; mediaType: string; dataBase64: string; }, { name: string; mediaType: string; dataBase64: string; }>]>, "many">>; /** wicked-core#850 — the explicit reduced-assurance opt-in, forwarded to `POST /runs` only when `true`. */ reducedAssurance: z.ZodOptional; }, "strict", z.ZodTypeAny, { reducedAssurance?: boolean | undefined; files?: ({ name: string; text: string; } | { name: string; mediaType: string; dataBase64: string; })[] | undefined; notes?: string | undefined; }, { reducedAssurance?: boolean | undefined; files?: ({ name: string; text: string; } | { name: string; mediaType: string; dataBase64: string; })[] | undefined; notes?: string | undefined; }>; /** `POST /proposals/:id/approve` body — present only for an accept WITH an edit. */ export declare const ApproveEditSchema: z.ZodObject<{ content: z.ZodOptional; reach: z.ZodOptional>; }, "strict", z.ZodTypeAny, { content?: string | undefined; reach?: "project" | "operator" | "pattern" | undefined; }, { content?: string | undefined; reach?: "project" | "operator" | "pattern" | undefined; }>; /** `POST /proposals` body — one preference a person files from a skin (studio's takes). Strict: the * kind, tier and capture marker are the daemon's, never the caller's. */ export declare const FileProposalSchema: z.ZodObject<{ content: z.ZodString; project: z.ZodOptional; source: z.ZodOptional; }, "strict", z.ZodTypeAny, { content: string; source?: string | undefined; project?: string | undefined; }, { content: string; source?: string | undefined; project?: string | undefined; }>; /** Where a capture's materials land: a per-run inbox on the daemon host (the steering-author * pattern — runs read the daemon's filesystem; only paths ride the problem statement). */ export declare function captureInboxDir(runId: string): string; /** * The capture inbox of each capture launch in flight, keyed by its run id. A worker's boundary is * {sandbox, extraWriteRoots, ~/.claude/plugins} — even READS outside it are denied — so the run must * declare its inbox as an extra root (the steering-author inbox does the same). `POST /runs` takes * no roots from its body; it reads this in-process entry for the run id the capture route minted * (a fresh UUID), so the root is never something a caller can ask for. */ export declare const captureLaunchRoots: Map; /** The brief the capture run reads: the materials and the filing contract, in one file so the * problem statement stays one short line. */ export declare function captureBrief(projectId: string, paths: readonly string[]): string; export declare function registerCaptureRoutes(app: FastifyInstance): void; type EstateTool = (tool: string, args: Record) => Promise; /** The outcome of {@link approveEdited}: an HTTP status and its body. */ export type EditedApproval = { status: number; body: Record; }; /** * Accept a pending MEMORY proposal WITH an edit — submit the edited copy, approve the copy, then * reject the original — and return the copy's approve outcome plus `edited: {from, to}`. The * original stays pending until the copy is approved, so a failed approve loses nothing (the copy is * withdrawn, so a retry leaves no duplicate pending); a reject * that fails AFTER the approve answers 200 with `edited.originalPending: true` (the edit landed; * the original is still in the queue for the person to reject), never a 502 inviting a retry that * would promote a second copy. A * `reach: "pattern"` copy drops the `project` and `repo` facets (it may now be recalled on any * project); it is refused on anything but a captured memory (`payload.capture: "memory"`) — a * decision or an intent is always the project's, and a memory no capture filed is not this verb's. A * `reach: "project"` row keeps (or, when the worker filed none, gains) the project facet — the * capture run's project, read from `projectOf(provenance.run_id)`. When nothing changes, the * original is approved as filed (no copy). */ export declare function approveEdited(estateTool: EstateTool, id: string, edit: z.infer, projectOf: (runId: string) => string | undefined): Promise; /** A plain approve or a reject of a proposal whose accept-with-edit is in flight is refused (409): * it would decide the original while the edit is promoting its copy. */ export declare function editInFlight(id: string): boolean; export {}; //# sourceMappingURL=capture.d.ts.map