A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
feat: retain letter draft request provenance through review and history
Amruth Pillai8003f2cb5771
diff --git a/apps/mobile/scripts/letter-draft-keep.test.mjs b/apps/mobile/scripts/letter-draft-keep.test.mjsindex 5704b84ed..20c6f116f 100644--- a/apps/mobile/scripts/letter-draft-keep.test.mjs+++ b/apps/mobile/scripts/letter-draft-keep.test.mjs@@ -9,7 +9,7 @@ const root = fileURLToPath(new URL("../../..", import.meta.url));const req = createRequire(`${root}/apps/server/package.json`);const { buildSync } = createRequire(req.resolve("tsx"))("esbuild");-function fixture() {+function fixture(options = {}) {let account = "account-A";let server = "https://rx.example";let document = { id: "letter-A", revision: 1 };@@ -28,11 +28,15 @@ function fixture() {"@/api/client": {streamClient: {coverLetters: {- draft: async () => {+ draft: async (input) => {+ assert.equal(input.includeProvenance, true);paidCalls++;return (async function* () {+ yield { aiOperationId: `server-operation-${paidCalls}` };yield "REPLACEMENT";yield " draft";+ options.onText?.();+ await options.hold;})();},},@@ -159,7 +163,7 @@ function seedReady(f, text = "OLD A PRIVATE DRAFT") {f.setDocument(current);f.draft.useLetterDrafting.setState({owner: f.draft.letterDraftOwner(current.id),- draft: { phase: "ready", text, revision: 1, operation: "op-seed", versions: [] },+ draft: { phase: "ready", text, revision: 1, operation: "op-seed", aiOperationIds: ["server-seed"], versions: [] },});return current;}@@ -183,7 +187,8 @@ for (const change of ["account", "server", "both"]) {test("current Keep works and a discarded callback cannot overwrite its replacement", async () => {const f = fixture();const current = seedReady(f, "CURRENT DRAFT");- captureKeep(f, current)("CURRENT DRAFT");+ captureKeep(f, current)("CURRENT DRAFT", ["server-seed"]);+ assert.deepEqual(current.aiOperationIds, ["server-seed"]);assert.equal(current.content, "<p>CURRENT DRAFT</p>");assert.equal(f.draft.useLetterDrafting.getState().draft.phase, "idle");const keep = captureKeep(f, seedReady(f));@@ -195,3 +200,50 @@ test("current Keep works and a discarded callback cannot overwrite its replacemeassert.equal(f.draft.useLetterDrafting.getState().draft, replacement);assert.equal(replacement.text, "REPLACEMENT draft");});++test("native per-version sources survive revision and account-bound recovery without replacing the Keep nonce", async () => {+ const f = fixture();+ const current = seedReady(f);+ await f.draft.startLetterDraft("shorter", "OLD A PRIVATE DRAFT", ["server-seed"]);+ const ready = f.draft.useLetterDrafting.getState().draft;+ assert.deepEqual(ready.aiOperationIds, ["server-seed", "server-operation-1"]);+ assert.deepEqual(ready.versions, [{ text: "OLD A PRIVATE DRAFT", aiOperationIds: ["server-seed"] }]);+ assert.notEqual(ready.operation, "server-operation-1");+ const stored = JSON.parse(f.storage.get(f.draft.letterDraftOwner(current.id)));+ assert.deepEqual(stored.versions, ["OLD A PRIVATE DRAFT"], "older bundles retain earlier draft text");+ assert.deepEqual(stored.versionAiOperationIds, [["server-seed"]]);+ f.draft.useLetterDrafting.setState({ draft: { phase: "idle" } });+ await f.draft.restoreLetterDraft(current.id);+ const restored = f.draft.useLetterDrafting.getState().draft;+ assert.deepEqual(restored.aiOperationIds, ready.aiOperationIds);+ assert.deepEqual(restored.versions, ready.versions);+ assert.equal(f.paid(), 1);+ captureKeep(f, current)(restored.text, restored.aiOperationIds);+ assert.deepEqual(current.aiOperationIds, ["server-seed", "server-operation-1"]);+ assert.equal(current.content, "<p>REPLACEMENT draft</p>");+});++test("native Stop retains partial request lineage through recovery without another provider call", async () => {+ let release;+ let arrived;+ const hold = new Promise((resolve) => {+ release = resolve;+ });+ const text = new Promise((resolve) => {+ arrived = resolve;+ });+ const f = fixture({ hold, onText: arrived });+ const current = seedReady(f);+ const pending = f.draft.startLetterDraft("personal", "OLD A PRIVATE DRAFT", ["server-seed"]);+ await text;+ f.draft.stopLetterDraftKeepingText();+ const stopped = f.draft.useLetterDrafting.getState().draft;+ assert.equal(stopped.stopped, true);+ assert.deepEqual(stopped.aiOperationIds, ["server-seed", "server-operation-1"]);+ release();+ await pending;+ f.draft.useLetterDrafting.setState({ draft: { phase: "idle" } });+ await f.draft.restoreLetterDraft(current.id);+ assert.deepEqual(f.draft.useLetterDrafting.getState().draft.aiOperationIds, stopped.aiOperationIds);+ assert.equal(f.paid(), 1);+});diff --git a/apps/mobile/scripts/letter-sender.test.mjs b/apps/mobile/scripts/letter-sender.test.mjsindex 9880bc5b1..81072a027 100644--- a/apps/mobile/scripts/letter-sender.test.mjs+++ b/apps/mobile/scripts/letter-sender.test.mjs@@ -123,3 +123,37 @@ test("an unlinked letter saves the header details it prints: headline, links andconst merged = letterAdapter.merge(saved, baseline, current);assert.deepEqual(merged.style.picture, { url: "/uploads/current.png", hidden: true, size: 64 });});++test("native body undo saves source removal atomically and keeps newer sources while an earlier save returns", async () => {+ const kept = {+ ...structuredClone(baseline),+ content: "Kept body",+ aiOperationIds: ["kept-op"],+ aiUsage: { requests: 1, models: [] },+ };+ const undone = letterAdapter.withData(kept, { ...baseline, content: "Authored body" });+ assert.deepEqual(undone.aiOperationIds, []);+ assert.equal(undone.aiUsage, null);+ await letterAdapter.save(undone, kept, "session", false, "fixture", undefined, "v1");+ assert.deepEqual(calls.pop(), {+ id: "letter",+ expectedRevision: 1,+ sessionId: "session",+ proposalSafety: "v1",+ content: "Authored body",+ aiOperationIds: [],+ });+ const current = { ...kept, content: "Newer body", aiOperationIds: ["newer-op"] };+ const merged = letterAdapter.merge({ ...kept, revision: 2 }, kept, current);+ assert.deepEqual(merged.aiOperationIds, ["newer-op"]);+ assert.equal(merged.aiUsage, null);+ await letterAdapter.save(merged, { ...kept, revision: 2 }, "session", false, "fixture", undefined, "v1");+ assert.deepEqual(calls.pop(), {+ id: "letter",+ expectedRevision: 2,+ sessionId: "session",+ proposalSafety: "v1",+ content: "Newer body",+ aiOperationIds: ["newer-op"],+ });+});diff --git a/apps/mobile/src/draft/adapters.ts b/apps/mobile/src/draft/adapters.tsindex 687b256d2..22812f76c 100644--- a/apps/mobile/src/draft/adapters.ts+++ b/apps/mobile/src/draft/adapters.ts@@ -32,6 +32,7 @@ function letterFields(document: LetterDocument) {name: document.name,recipient: document.recipient,content: document.content,+ aiOperationIds: document.aiOperationIds ?? [],greeting: document.greeting,signOff: document.signOff,recipientName: document.recipientName,@@ -119,12 +120,17 @@ export const letterAdapter: DraftAdapter<LetterDocument, LetterDocument> = {delay: 800,read: (id) => client.coverLetters.getById({ id }),data: (document) => document,- withData: (document, data) => ({ ...document, ...letterFields(data) }),+ withData: (document, data) => ({+ ...document,+ ...letterFields(data),+ ...(JSON.stringify(document.aiOperationIds) !== JSON.stringify(data.aiOperationIds) ? { aiUsage: null } : {}),+ }),version: (document) => document.revision,matches: (left, right) => Object.keys(changedFields(letterFields(left), letterFields(right))).length === 0,merge: (saved, submitted, current) => ({...saved,...changedFields(letterFields(current), letterFields(submitted)),+ ...(JSON.stringify(saved.aiOperationIds) !== JSON.stringify(current.aiOperationIds) ? { aiUsage: null } : {}),// Unlinking resolves fresh resume details; retain only fields edited while that request was pending.style: {...saved.style,@@ -147,6 +153,9 @@ export const letterAdapter: DraftAdapter<LetterDocument, LetterDocument> = {...("name" in changes ? { name: document.name } : {}),...("recipient" in changes ? { recipient: document.recipient } : {}),...("content" in changes ? { content: document.content } : {}),+ ...("aiOperationIds" in changes && document.aiOperationIds !== undefined+ ? { aiOperationIds: document.aiOperationIds }+ : {}),...("greeting" in changes ? { greeting: document.greeting } : {}),...("signOff" in changes ? { signOff: document.signOff } : {}),...("recipientName" in changes ? { recipientName: document.recipientName } : {}),@@ -190,6 +199,7 @@ export const letterAdapter: DraftAdapter<LetterDocument, LetterDocument> = {if (copyId) return;const copy = await client.coverLetters.import({+ ...(document.aiOperationIds ? { aiOperationIds: document.aiOperationIds } : {}),document: {format: "reactive-resume-cover-letter",version: 1,diff --git a/apps/mobile/src/features/letters/drafting.ts b/apps/mobile/src/features/letters/drafting.tsindex 738c02cb6..009e235a4 100644--- a/apps/mobile/src/features/letters/drafting.ts+++ b/apps/mobile/src/features/letters/drafting.ts@@ -1,7 +1,9 @@// AI draft of the letter body, streamed over SSE. Ported from startLetterDraft in apps/web/src/features/letters/store.ts.+import type { CoverLetterDraftVersion } from "@reactive-resume/schema/cover-letter/data";import { ORPCError } from "@orpc/client";import Storage from "expo-sqlite/kv-store";import { create } from "zustand";+import { coverLetterDraftVersionSchema } from "@reactive-resume/schema/cover-letter/data";import { draftForOwner, letterDraftOwnerKey } from "./draft-owner";import { saveLetter } from "./save";import { streamClient } from "@/api/client";@@ -20,16 +22,21 @@ export type LetterDraft =| {phase: "streaming" | "ready";text: string;+ aiOperationIds: string[];revision: number;operation: string;- versions: string[];+ versions: CoverLetterDraftVersion[];stopped?: true;}- | { phase: "failed"; provider: string | null; error: unknown; versions: string[] }+ | { phase: "failed"; provider: string | null; error: unknown; versions: CoverLetterDraftVersion[] }/** What's typed couldn't be saved (offline, error, conflict), so the server would draft from stale links. */| { phase: "unsaved" };-type LastDraft = { variant: DraftVariant; previous?: string | undefined };+type LastDraft = {+ variant: DraftVariant;+ previous?: string | undefined;+ previousAiOperationIds?: string[] | undefined;+};type DraftingState = {/** The account, server and letter that own this draft. A different letter/account sees idle, never this text. */owner: string | null;@@ -41,9 +48,18 @@ const idle: LetterDraft = { phase: "idle" };/** The most drafts kept side by side: the current one and up to four before it. */const MAX_DRAFT_VERSIONS = 5;-const asVersions = (value: unknown) =>+const asVersions = (value: unknown, sources: unknown) =>Array.isArray(value)- ? value.filter((version): version is string => typeof version === "string").slice(-(MAX_DRAFT_VERSIONS - 1))+ ? value+ .flatMap((version, index) => {+ const parsed = coverLetterDraftVersionSchema.safeParse(+ typeof version === "string"+ ? { text: version, aiOperationIds: Array.isArray(sources) ? sources[index] : undefined }+ : version,+ );+ return parsed.success ? [parsed.data] : [];+ })+ .slice(-(MAX_DRAFT_VERSIONS - 1)): [];const defaultLast: LastDraft = { variant: "draft" };@@ -89,9 +105,11 @@ export async function restoreLetterDraft(id: string) {const value = raw? (JSON.parse(raw) as {text?: unknown;+ aiOperationIds?: unknown;variant?: unknown;revision?: unknown;versions?: unknown;+ versionAiOperationIds?: unknown;stopped?: unknown;}): null;@@ -117,9 +135,13 @@ export async function restoreLetterDraft(id: string) {draft: {phase: "ready",text: value.text as string,+ aiOperationIds: coverLetterDraftVersionSchema.parse({+ text: value.text,+ aiOperationIds: value.aiOperationIds,+ }).aiOperationIds,revision,operation: nextOperation(),- versions: asVersions(value.versions),+ versions: asVersions(value.versions, value.versionAiOperationIds),...(value.stopped === true ? { stopped: true as const } : {}),},last: { variant },@@ -131,11 +153,26 @@ export async function restoreLetterDraft(id: string) {}}-type StoredDraft = { text: string; variant: DraftVariant; revision: number; versions: string[]; stopped?: true };+type StoredDraft = {+ text: string;+ aiOperationIds: string[];+ variant: DraftVariant;+ revision: number;+ versions: CoverLetterDraftVersion[];+ stopped?: true;+};async function storeDraft(owner: string, draft: StoredDraft) {try {- await Storage.setItem(owner, JSON.stringify(draft));+ // Keep text-only versions readable by older app bundles.+ await Storage.setItem(+ owner,+ JSON.stringify({+ ...draft,+ versions: draft.versions.map((version) => version.text),+ versionAiOperationIds: draft.versions.map((version) => version.aiOperationIds),+ }),+ );} catch {// Storage full or unavailable: the draft stays in this view.}@@ -150,7 +187,11 @@ async function clearDraft(owner: string) {}/** Streams a draft (or a Shorter / More personal revision of `previous`) into `useLetterDrafting`. */-export async function startLetterDraft(variant: DraftVariant = "draft", previous?: string) {+export async function startLetterDraft(+ variant: DraftVariant = "draft",+ previous?: string,+ previousAiOperationIds: string[] = [],+) {const letter = useLetterStore.getState().document;if (!letter) return;const owner = letterDraftOwner(letter.id);@@ -165,7 +206,7 @@ export async function startLetterDraft(variant: DraftVariant = "draft", previousconst prior = before.owner === owner ? before.draft : idle;const versions = (prior.phase === "ready"- ? [...prior.versions, prior.text]+ ? [...prior.versions, { text: prior.text, aiOperationIds: prior.aiOperationIds }]: prior.phase === "streaming" || prior.phase === "failed"? prior.versions: []@@ -174,9 +215,10 @@ export async function startLetterDraft(variant: DraftVariant = "draft", previousif (drafting !== controller || letterDraftOwner(letter.id) !== owner) return;useLetterDrafting.setState((state) => (state.owner === owner ? { draft } : state));};- useLetterDrafting.setState({ owner, last: { variant, previous } });+ useLetterDrafting.setState({ owner, last: { variant, previous, previousAiOperationIds } });void clearDraft(owner);- set({ phase: "streaming", text: "", revision, operation, versions });+ let aiOperationIds = variant === "draft" ? [] : previousAiOperationIds;+ set({ phase: "streaming", text: "", aiOperationIds, revision, operation, versions });try {// The server drafts from the saved letter's links, so links chosen a moment ago must reach it first.@@ -193,16 +235,18 @@ export async function startLetterDraft(variant: DraftVariant = "draft", previousif (!saved) return set({ phase: "unsaved" });revision = savedLetter.revision;const stream = await streamClient.coverLetters.draft(- { id: letter.id, variant, ...(previous ? { previous } : {}) },+ { id: letter.id, variant, includeProvenance: true, ...(previous ? { previous } : {}) },{ signal: controller.signal },);let text = "";for await (const chunk of stream) {- text += chunk;- set({ phase: "streaming", text, revision, operation, versions });+ if (typeof chunk !== "string") {+ aiOperationIds = [...new Set([...aiOperationIds, chunk.aiOperationId])];+ } else text += chunk;+ set({ phase: "streaming", text, aiOperationIds, revision, operation, versions });}if (!text.trim()) throw new Error("The draft came back empty.");- set({ phase: "ready", text: text.trim(), revision, operation, versions });+ set({ phase: "ready", text: text.trim(), aiOperationIds, revision, operation, versions });// A late completion after leave/account/letter change may not persist into the new owner's namespace.if (drafting === controller &&@@ -211,7 +255,7 @@ export async function startLetterDraft(variant: DraftVariant = "draft", previoususeLetterDrafting.getState().owner === owner &&useLetterStore.getState().document?.id === letter.id)- void storeDraft(owner, { text: text.trim(), variant, revision, versions });+ void storeDraft(owner, { text: text.trim(), aiOperationIds, variant, revision, versions });} catch (error) {if (controller.signal.aborted) return;const data = error instanceof ORPCError ? (error.data as { provider?: unknown } | undefined) : undefined;@@ -220,23 +264,32 @@ export async function startLetterDraft(variant: DraftVariant = "draft", previous}/** What's left when a run stops or its failure is dismissed: its text when any arrived, else the draft before it. */-function settle(owner: string, text: string, versions: string[], revision: number, stopped: boolean): LetterDraft {+function settle(+ owner: string,+ text: string,+ versions: CoverLetterDraftVersion[],+ revision: number,+ stopped: boolean,+ aiOperationIds: string[] = [],+): LetterDraft {const last = versions.at(-1);const draft: LetterDraft = text.trim()? {phase: "ready",text: text.trim(),+ aiOperationIds,revision,operation: nextOperation(),versions,...(stopped ? { stopped: true as const } : {}),}: last !== undefined- ? { phase: "ready", text: last, revision, operation: nextOperation(), versions: versions.slice(0, -1) }+ ? { phase: "ready", ...last, revision, operation: nextOperation(), versions: versions.slice(0, -1) }: idle;if (draft.phase === "ready")void storeDraft(owner, {text: draft.text,+ aiOperationIds: draft.aiOperationIds,variant: "draft",revision,versions: draft.versions,@@ -256,7 +309,17 @@ export function stopLetterDraftKeepingText() {const owner = letterDraftOwner(letter.id);useLetterDrafting.setState((state) =>state.owner === owner && state.draft.phase === "streaming"- ? { ...state, draft: settle(owner, state.draft.text, state.draft.versions, letter.revision, true) }+ ? {+ ...state,+ draft: settle(+ owner,+ state.draft.text,+ state.draft.versions,+ letter.revision,+ true,+ state.draft.aiOperationIds,+ ),+ }: state,);}diff --git a/apps/mobile/src/features/letters/share.tsx b/apps/mobile/src/features/letters/share.tsxindex 16d7df9b2..0410fe0e3 100644--- a/apps/mobile/src/features/letters/share.tsx+++ b/apps/mobile/src/features/letters/share.tsx@@ -15,6 +15,7 @@ import { useResumes } from "./queries";import { restoreLetterVersion, saveLetter } from "./save";import { client, orpc } from "@/api/client";import { useLetterStore } from "@/draft";+import { AiResultUsage } from "@/features/ai/usage";import { useDocumentOperations } from "@/features/documents/queries";import { exportDirectory, exportFile, shareExport } from "@/features/share/files";import { letterWords } from "@/features/share/letter";@@ -487,8 +488,11 @@ function VersionPage({ letter, versionId }: { letter: LetterDocument; versionId:/>);return (- <View style={{ height: size.hit * 10 }}>- <LetterPages data={data} zoomBar={false} />+ <View>+ <AiResultUsage usage={version.data?.aiUsage} />+ <View style={{ height: size.hit * 10 }}>+ <LetterPages data={data} zoomBar={false} />+ </View></View>);}diff --git a/apps/mobile/src/features/letters/write.tsx b/apps/mobile/src/features/letters/write.tsxindex 576c57b92..942e81acd 100644--- a/apps/mobile/src/features/letters/write.tsx+++ b/apps/mobile/src/features/letters/write.tsx@@ -35,6 +35,7 @@ import { relinkLetter } from "./save";import { useSession } from "@/auth/session";import { letterFieldFocus, useLetterStore } from "@/draft";import { AIProviderSetupSheet, useHasAIProvider } from "@/features/ai/providers";+import { AiResultUsage } from "@/features/ai/usage";import { WallClockField } from "@/features/application-detail/date-field";import { useApplicationLanes } from "@/features/applications/lane-queries";import { getLaneLabel, resolveLane } from "@/features/applications/lanes";@@ -581,7 +582,7 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {<DraftBoxletter={letter}application={application}- onKeep={(text) => {+ onKeep={(text, aiOperationIds) => {// A captured callback may run after another letter/account opened: it may only write its own letter,// at the revision this ready draft came from.const current = useLetterStore.getState().document;@@ -598,9 +599,13 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {owned.draft.operation !== draft.operation)return;- useLetterStore.getState().update((value) => void (value.content = coverLetterTextToHtml(text)), {- newStep: true,- });+ useLetterStore.getState().update(+ (value) => {+ value.content = coverLetterTextToHtml(text);+ value.aiOperationIds = aiOperationIds;+ },+ { newStep: true },+ );discardLetterDraft();setWriting(true);showToast({ message: t`Draft kept. Edit anything you like.` });@@ -632,6 +637,7 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {/>) : null}{body}+ {(letter.aiOperationIds?.length ?? 0) > 0 && <AiResultUsage usage={letter.aiUsage} />}{structured && words ? (<View style={{ gap: space.s2 }}><FramingField@@ -772,7 +778,11 @@ function EmptyBody({ letter, application, disabled, onWrite }: EmptyBodyProps) {);}-type DraftBoxProps = { letter: LetterDocument; application: Application | null; onKeep: (text: string) => void };+type DraftBoxProps = {+ letter: LetterDocument;+ application: Application | null;+ onKeep: (text: string, aiOperationIds: string[]) => void;+};/** The draft on its green wash, then Keep, Shorter, More personal or Discard. */function DraftBox({ letter, application, onKeep }: DraftBoxProps) {@@ -796,7 +806,7 @@ function DraftBox({ letter, application, onKeep }: DraftBoxProps) {size="sm"variant="secondary"label={t`Try again`}- onPress={() => void startLetterDraft(last.variant, last.previous)}+ onPress={() => void startLetterDraft(last.variant, last.previous, last.previousAiOperationIds)}/><Button size="sm" variant="ghost" label={t`Dismiss`} onPress={discardLetterDraft} /></View>@@ -820,7 +830,7 @@ function DraftBox({ letter, application, onKeep }: DraftBoxProps) {size="sm"variant="secondary"label={t`Try again`}- onPress={() => void startLetterDraft(last.variant, last.previous)}+ onPress={() => void startLetterDraft(last.variant, last.previous, last.previousAiOperationIds)}/><Button size="sm" variant="ghost" label={t`Dismiss`} onPress={dismissLetterDraftFailure} /></View>@@ -830,9 +840,10 @@ function DraftBox({ letter, application, onKeep }: DraftBoxProps) {const streaming = draft.phase === "streaming";// Earlier versions stay side by side with the newest: "2 of 3", and Accept or a revision uses the one shown.- const all = streaming ? [draft.text] : [...draft.versions, draft.text];+ const currentVersion = { text: draft.text, aiOperationIds: draft.aiOperationIds ?? [] };+ const all = streaming ? [currentVersion] : [...draft.versions, currentVersion];const index = pick?.operation === draft.operation ? Math.min(pick.index, all.length - 1) : all.length - 1;- const shown = all[index] ?? draft.text;+ const shown = all[index] ?? currentVersion;const sources =letter.sourceResumeId && application? t`Draft · uses only your resume and the posting`@@ -858,7 +869,7 @@ function DraftBox({ letter, application, onKeep }: DraftBoxProps) {><Text>{/* Reduced motion shows the whole draft at once. */}- {streaming && reducedMotion ? "" : shown}+ {streaming && reducedMotion ? "" : shown.text}{streaming ? <Text color="ink3">{reducedMotion ? t`Drafting…` : "▍"}</Text> : null}</Text></View>@@ -890,19 +901,19 @@ function DraftBox({ letter, application, onKeep }: DraftBoxProps) {<Button size="sm" variant="secondary" icon="stop" label={t`Stop`} onPress={stopLetterDraftKeepingText} />) : (<View style={{ flexDirection: "row", flexWrap: "wrap", gap: space.s2 }}>- <ReportAiContent source="letter" text={shown} />- <Button size="sm" label={t`Accept`} onPress={() => onKeep(shown)} />+ <ReportAiContent source="letter" text={shown.text} />+ <Button size="sm" label={t`Accept`} onPress={() => onKeep(shown.text, shown.aiOperationIds)} /><Buttonsize="sm"variant="secondary"label={t`Shorter`}- onPress={() => void startLetterDraft("shorter", shown)}+ onPress={() => void startLetterDraft("shorter", shown.text, shown.aiOperationIds)}/><Buttonsize="sm"variant="secondary"label={t`More personal`}- onPress={() => void startLetterDraft("personal", shown)}+ onPress={() => void startLetterDraft("personal", shown.text, shown.aiOperationIds)}/><Button size="sm" variant="dangerOutline" label={t`Reject`} onPress={discardLetterDraft} /></View>diff --git a/apps/web/src/features/letters/store.test.ts b/apps/web/src/features/letters/store.test.tsindex 76ee49fe9..424e04b35 100644--- a/apps/web/src/features/letters/store.test.ts+++ b/apps/web/src/features/letters/store.test.ts@@ -48,7 +48,7 @@ function deferred<T>() {return { promise, resolve, reject };}-function* chunks(...parts: string[]) {+function* chunks(...parts: (string | { aiOperationId: string })[]) {yield* parts;}@@ -167,6 +167,26 @@ describe("saving", () => {expect(mocks.update.mock.calls.map(([input]) => input.id)).toEqual(["letter", "B"]);});+ it("retains confirmed usage on save echoes and hides it only for a different pending source", async () => {+ const usage = {+ requests: 1,+ models: [{ providerId: "provider", label: "Original", provider: "openai", model: "original" }],+ };+ const saved = { ...letter, aiOperationIds: ["original-op"], aiUsage: usage, revision: 2 };+ const request = deferred<CoverLetter>();+ mocks.update.mockReturnValueOnce(request.promise);+ store().edit({ content: "<p>Draft</p>", aiOperationIds: ["original-op"] });+ const saving = store().flush();+ request.resolve(saved);+ await saving;+ expect(store().letter?.aiUsage).toEqual(usage);+ expect(mocks.update).toHaveBeenCalledWith(+ expect.objectContaining({ content: "<p>Draft</p>", aiOperationIds: ["original-op"] }),+ );+ store().edit({ content: "<p>Another draft</p>", aiOperationIds: ["new-op"] });+ expect(store().letter?.aiUsage).toBeNull();+ });+it("reports failed saves, retains the draft, and prevents a destructive change", async () => {mocks.update.mockRejectedValue(new Error("offline"));store().edit({ content: "<p>Unsaved</p>" });@@ -247,8 +267,16 @@ describe("drafts", () => {it("streams a draft beside the body, which only changes when the draft is kept", async () => {mocks.draft.mockResolvedValue(chunks("I'm applying", " for the role."));await startLetterDraft();- expect(mocks.draft).toHaveBeenCalledWith({ id: "letter", variant: "draft" }, expect.anything());- expect(store().draft).toEqual({ phase: "ready", text: "I'm applying for the role.", versions: [] });+ expect(mocks.draft).toHaveBeenCalledWith(+ { id: "letter", variant: "draft", includeProvenance: true },+ expect.anything(),+ );+ expect(store().draft).toEqual({+ phase: "ready",+ aiOperationIds: [],+ text: "I'm applying for the role.",+ versions: [],+ });expect(store().letter?.content).toBe("<p>Mine</p>");discardLetterDraft();@@ -256,18 +284,97 @@ describe("drafts", () => {expect(store().letter?.content).toBe("<p>Mine</p>");});+ it("keeps per-version sources through revisions, failed runs, Stop and reload without guessing old-server sources", async () => {+ const stored = new Map<string, string>();+ vi.stubGlobal("sessionStorage", {+ getItem: (key: string) => stored.get(key) ?? null,+ setItem: (key: string, value: string) => stored.set(key, value),+ removeItem: (key: string) => stored.delete(key),+ });+ mocks.draft.mockResolvedValueOnce(chunks({ aiOperationId: "original-op" }, "Original"));+ await startLetterDraft();+ mocks.draft.mockResolvedValueOnce(chunks({ aiOperationId: "revision-op" }, "Revised"));+ await startLetterDraft("shorter", "Original", ["original-op"]);+ expect(store().draft).toMatchObject({+ text: "Revised",+ aiOperationIds: ["original-op", "revision-op"],+ versions: [{ text: "Original", aiOperationIds: ["original-op"] }],+ });+ expect(JSON.parse(stored.get("letter-draft:account-a:letter") ?? "null").versions).toEqual(["Original"]);+ const held = deferred<void>();+ mocks.draft.mockResolvedValueOnce(+ (async function* () {+ yield { aiOperationId: "partial-op" };+ yield "Partial";+ await held.promise;+ })(),+ );+ const pending = startLetterDraft("personal", "Original", ["original-op"]);+ await vi.waitFor(() => expect(store().draft).toMatchObject({ text: "Partial" }));+ stopLetterDraft();+ expect(store().draft).toMatchObject({+ phase: "ready",+ text: "Partial",+ aiOperationIds: ["original-op", "partial-op"],+ stopped: true,+ });+ held.resolve();+ await pending;+ store().load(letter);+ expect(store().draft).toMatchObject({+ phase: "ready",+ text: "Partial",+ aiOperationIds: ["original-op", "partial-op"],+ versions: [+ { text: "Original", aiOperationIds: ["original-op"] },+ { text: "Revised", aiOperationIds: ["original-op", "revision-op"] },+ ],+ });+ mocks.draft.mockRejectedValueOnce(new Error("Provider down"));+ await startLetterDraft("shorter", "Partial", ["original-op", "partial-op"]);+ dismissLetterDraftFailure();+ expect(store().draft).toMatchObject({ text: "Partial", aiOperationIds: ["original-op", "partial-op"] });+ // String-only recovery from older clients is still readable, with unknown history.+ stored.set(+ "letter-draft:account-a:letter",+ JSON.stringify({ text: "Legacy", versions: ["Earlier legacy"], revision: letter.revision }),+ );+ store().load(letter);+ expect(store().draft).toMatchObject({+ text: "Legacy",+ aiOperationIds: [],+ versions: [{ text: "Earlier legacy", aiOperationIds: [] }],+ });+ });+it("keeps the earlier draft beside a Shorter one, and goes back to it when a later run fails (A3-15)", async () => {mocks.draft.mockResolvedValueOnce(chunks("The long draft."));await startLetterDraft();mocks.draft.mockResolvedValueOnce(chunks("Short."));await startLetterDraft("shorter", "The long draft.");- expect(store().draft).toEqual({ phase: "ready", text: "Short.", versions: ["The long draft."] });+ expect(store().draft).toEqual({+ phase: "ready",+ aiOperationIds: [],+ text: "Short.",+ versions: [{ text: "The long draft.", aiOperationIds: [] }],+ });mocks.draft.mockRejectedValueOnce(new Error("Provider down"));await startLetterDraft("personal", "Short.");- expect(store().draft).toMatchObject({ phase: "failed", versions: ["The long draft.", "Short."] });+ expect(store().draft).toMatchObject({+ phase: "failed",+ versions: [+ { text: "The long draft.", aiOperationIds: [] },+ { text: "Short.", aiOperationIds: [] },+ ],+ });dismissLetterDraftFailure();- expect(store().draft).toEqual({ phase: "ready", text: "Short.", versions: ["The long draft."] });+ expect(store().draft).toEqual({+ phase: "ready",+ aiOperationIds: [],+ text: "Short.",+ versions: [{ text: "The long draft.", aiOperationIds: [] }],+ });});it("keeps what streamed when drafting is stopped (A3-15)", async () => {@@ -280,7 +387,13 @@ describe("drafts", () => {void startLetterDraft();await vi.waitFor(() => expect(store().draft).toMatchObject({ phase: "streaming", text: "Dear team, I" }));stopLetterDraft();- expect(store().draft).toEqual({ phase: "ready", text: "Dear team, I", versions: [], stopped: true });+ expect(store().draft).toEqual({+ phase: "ready",+ aiOperationIds: [],+ text: "Dear team, I",+ versions: [],+ stopped: true,+ });});it("shows a ready, unkept draft again after a reload without asking the provider twice", async () => {@@ -297,7 +410,7 @@ describe("drafts", () => {// A reload: the store is empty, then the route loads the same letter.useLetterEditorStore.setState({ letter: null, draft: { phase: "idle" } });store().load(letter);- expect(store().draft).toEqual({ phase: "ready", text: "A draft I paid for.", versions: [] });+ expect(store().draft).toEqual({ phase: "ready", aiOperationIds: [], text: "A draft I paid for.", versions: [] });expect(mocks.draft).toHaveBeenCalledTimes(1);// The body is still untouched until Keep.expect(store().letter?.content).toBe("<p>Mine</p>");@@ -326,7 +439,12 @@ describe("drafts", () => {discardLetterDraft();setAccountScope("account-a");store().load(letter);- expect(store().draft).toEqual({ phase: "ready", text: "Private account A draft", versions: [] });+ expect(store().draft).toEqual({+ phase: "ready",+ aiOperationIds: [],+ text: "Private account A draft",+ versions: [],+ });expect(mocks.draft).toHaveBeenCalledTimes(1);});@@ -339,7 +457,7 @@ describe("drafts", () => {});store().edit({ recipientName: "Dana" });await startLetterDraft();- expect(store().draft).toEqual({ phase: "ready", text: "Saved revision draft", versions: [] });+ expect(store().draft).toEqual({ phase: "ready", aiOperationIds: [], text: "Saved revision draft", versions: [] });});it("does not start a paid request when saving fails or the account changes during the save", async () => {diff --git a/apps/web/src/features/letters/store.ts b/apps/web/src/features/letters/store.tsindex fce40059e..ced9a0374 100644--- a/apps/web/src/features/letters/store.ts+++ b/apps/web/src/features/letters/store.ts@@ -1,5 +1,5 @@import type { Proposal, ProposalApplications } from "@reactive-resume/resume/proposals";-import type { CoverLetter } from "@reactive-resume/schema/cover-letter/data";+import type { CoverLetterDraftVersion, CoverLetter } from "@reactive-resume/schema/cover-letter/data";import { t } from "@lingui/core/macro";import { ORPCError } from "@orpc/client";import { isEqual } from "es-toolkit";@@ -11,7 +11,11 @@ import {readProposalApplications,restoreProposalApplications,} from "@reactive-resume/resume/proposals";-import { coverLetterDocumentSchema, coverLetterSchema } from "@reactive-resume/schema/cover-letter/data";+import {+ coverLetterDocumentSchema,+ coverLetterDraftVersionSchema,+ coverLetterSchema,+} from "@reactive-resume/schema/cover-letter/data";import { generateId } from "@reactive-resume/utils/string";import { getAccountGeneration, getAccountId } from "@/libs/auth/account-scope";import { client, streamClient } from "@/libs/orpc/client";@@ -25,7 +29,15 @@ type LetterMetadata = CoverLetter["style"]["metadata"];export type LetterEdits = Partial<Pick<CoverLetter,- "name" | "recipient" | "content" | "greeting" | "signOff" | "recipientName" | "recipientCompany" | "letterDate"+ | "name"+ | "recipient"+ | "content"+ | "greeting"+ | "signOff"+ | "recipientName"+ | "recipientCompany"+ | "letterDate"+ | "aiOperationIds">> & {/** The letter's own sender details, all of them editable once the sender link is off. */@@ -45,6 +57,7 @@ const mergeEdits = (edits: LetterEdits, next: LetterEdits): LetterEdits => ({const applyEdits = (letter: CoverLetter, { metadata, sender, locale, ...fields }: LetterEdits): CoverLetter => ({...letter,...fields,+ ...(fields.aiOperationIds && !isEqual(fields.aiOperationIds, letter.aiOperationIds ?? []) ? { aiUsage: null } : {}),...(metadata ? { designLinked: false } : {}),style: {...letter.style,@@ -82,8 +95,14 @@ export type LetterDraft =* `versions` are the earlier finished drafts, oldest first, so Shorter or More personal never loses one.* `stopped` marks text Stop cut short.*/- | { phase: "streaming" | "ready"; text: string; versions: string[]; stopped?: true }- | { phase: "failed"; provider: string | null; error: unknown; versions: string[] };+ | {+ phase: "streaming" | "ready";+ text: string;+ aiOperationIds: string[];+ versions: CoverLetterDraftVersion[];+ stopped?: true;+ }+ | { phase: "failed"; provider: string | null; error: unknown; versions: CoverLetterDraftVersion[] };/** The most drafts kept side by side: the current one and up to four before it. */const MAX_DRAFT_VERSIONS = 5;@@ -135,7 +154,8 @@ const idleDraft: LetterDraft = { phase: "idle" };const draftKey = (id: string) => `letter-draft:${getAccountId() ?? "signed-out"}:${id}`;type StoredDraft = {text: string;- versions?: string[];+ versions?: CoverLetterDraftVersion[];+ aiOperationIds?: string[];variant: "draft" | "shorter" | "personal";revision: number;stopped?: true;@@ -144,12 +164,30 @@ type StoredDraft = {/** An unkept draft survives a same-tab reload with Keep/Discard, so it never costs a second paid request. */function readStoredDraft(id: string, revision: number): LetterDraft | null {try {- const value = JSON.parse(sessionStorage.getItem(draftKey(id)) ?? "null") as StoredDraft | null;+ const value = JSON.parse(sessionStorage.getItem(draftKey(id)) ?? "null") as+ | (Omit<StoredDraft, "versions"> & { versions?: unknown[]; versionAiOperationIds?: unknown[] })+ | null;if (!value || typeof value.text !== "string" || !value.text.trim() || value.revision !== revision) return null;const versions = Array.isArray(value.versions)- ? value.versions.filter((version): version is string => typeof version === "string").slice(-4)+ ? value.versions+ .flatMap((version, index) => {+ const parsed = coverLetterDraftVersionSchema.safeParse(+ typeof version === "string"+ ? { text: version, aiOperationIds: value.versionAiOperationIds?.[index] }+ : version,+ );+ return parsed.success ? [parsed.data] : [];+ })+ .slice(-4): [];- return { phase: "ready", text: value.text, versions, ...(value.stopped ? { stopped: true as const } : {}) };+ return {+ phase: "ready",+ text: value.text,+ aiOperationIds: coverLetterDraftVersionSchema.parse({ text: value.text, aiOperationIds: value.aiOperationIds })+ .aiOperationIds,+ versions,+ ...(value.stopped ? { stopped: true as const } : {}),+ };} catch {return null;}@@ -157,7 +195,15 @@ function readStoredDraft(id: string, revision: number): LetterDraft | null {function writeStoredDraft(id: string, draft: StoredDraft) {try {- sessionStorage.setItem(draftKey(id), JSON.stringify(draft));+ // Keep text-only versions readable by older app bundles.+ sessionStorage.setItem(+ draftKey(id),+ JSON.stringify({+ ...draft,+ versions: draft.versions?.map((version) => version.text),+ versionAiOperationIds: draft.versions?.map((version) => version.aiOperationIds),+ }),+ );} catch {// Blocked storage leaves the draft in this view; only a reload loses it.}@@ -180,6 +226,7 @@ const recoveryEditsSchema = coverLetterSchemaname: true,recipient: true,content: true,+ aiOperationIds: true,greeting: true,signOff: true,recipientName: true,@@ -520,6 +567,7 @@ export const useLetterEditorStore = create<LetterEditorStore>()((set, get) => ({recoveryCopy?.sessionId === sessionId && recoveryCopy.letter === letter ? recoveryCopy.copy : undefined;if (!copy) {copy = await client.coverLetters.import({+ ...(letter.aiOperationIds ? { aiOperationIds: letter.aiOperationIds } : {}),document: coverLetterDocumentSchema.parse({...letter,format: "reactive-resume-cover-letter",@@ -561,7 +609,11 @@ export const useLetterEditorStore = create<LetterEditorStore>()((set, get) => ({}));/** Streams a draft from the posting (or a Shorter / More personal revision of `previous`) into `draft`. */-export async function startLetterDraft(variant: "draft" | "shorter" | "personal" = "draft", previous?: string) {+export async function startLetterDraft(+ variant: "draft" | "shorter" | "personal" = "draft",+ previous?: string,+ previousAiOperationIds: string[] = [],+) {const { letter, sessionId } = useLetterEditorStore.getState();if (!letter) return;const account = getAccountGeneration();@@ -576,15 +628,27 @@ export async function startLetterDraft(variant: "draft" | "shorter" | "personal"// A revision keeps what came before it; the oldest drops off past the limit.const before = useLetterEditorStore.getState().draft;const versions = (- before.phase === "ready" ? [...before.versions, before.text] : before.phase === "idle" ? [] : before.versions+ before.phase === "ready"+ ? [...before.versions, { text: before.text, aiOperationIds: before.aiOperationIds }]+ : before.phase === "idle"+ ? []+ : before.versions).slice(-(MAX_DRAFT_VERSIONS - 1));const setDraft = (draft: LetterDraft) => {if (!current()) return;useLetterEditorStore.setState({ draft });- if (draft.phase === "ready") writeStoredDraft(letter.id, { text: draft.text, versions, variant, revision });+ if (draft.phase === "ready")+ writeStoredDraft(letter.id, {+ text: draft.text,+ aiOperationIds: draft.aiOperationIds,+ versions,+ variant,+ revision,+ });};clearStoredLetterDraft(letter.id);- setDraft({ phase: "streaming", text: "", versions });+ let aiOperationIds = variant === "draft" ? [] : previousAiOperationIds;+ setDraft({ phase: "streaming", text: "", aiOperationIds, versions });try {// Draft from the same saved links and revision the editor shows.@@ -595,16 +659,18 @@ export async function startLetterDraft(variant: "draft" | "shorter" | "personal"if (!savedLetter || savedLetter.id !== letter.id) return;revision = savedLetter.revision;const stream = await streamClient.coverLetters.draft(- { id: letter.id, variant, ...(previous ? { previous } : {}) },+ { id: letter.id, variant, includeProvenance: true, ...(previous ? { previous } : {}) },{ signal: controller.signal },);let text = "";for await (const chunk of stream) {- text += chunk;- setDraft({ phase: "streaming", text, versions });+ if (typeof chunk !== "string") {+ aiOperationIds = [...new Set([...aiOperationIds, chunk.aiOperationId])];+ } else text += chunk;+ setDraft({ phase: "streaming", text, aiOperationIds, versions });}if (!text.trim()) throw new Error("The draft came back empty.");- setDraft({ phase: "ready", text: text.trim(), versions });+ setDraft({ phase: "ready", text: text.trim(), aiOperationIds, versions });} catch (error) {if (controller.signal.aborted) return;const data = error instanceof ORPCError ? (error.data as { provider?: unknown } | undefined) : undefined;@@ -618,18 +684,24 @@ export async function startLetterDraft(variant: "draft" | "shorter" | "personal"}/** The draft's earlier version, or nothing: what's left when a run is stopped or its failure dismissed. */-function settleDraft(text: string, versions: string[], stopped: boolean): LetterDraft {+function settleDraft(+ text: string,+ versions: CoverLetterDraftVersion[],+ stopped: boolean,+ aiOperationIds: string[] = [],+): LetterDraft {const { letter } = useLetterEditorStore.getState();const last = versions.at(-1);const draft: LetterDraft = text.trim()- ? { phase: "ready", text: text.trim(), versions, ...(stopped ? { stopped: true as const } : {}) }+ ? { phase: "ready", text: text.trim(), aiOperationIds, versions, ...(stopped ? { stopped: true as const } : {}) }: last !== undefined- ? { phase: "ready", text: last, versions: versions.slice(0, -1) }+ ? { phase: "ready", ...last, versions: versions.slice(0, -1) }: idleDraft;if (letter) {if (draft.phase === "ready")writeStoredDraft(letter.id, {text: draft.text,+ aiOperationIds: draft.aiOperationIds,versions: draft.versions,variant: "draft",revision: letter.revision,@@ -646,7 +718,7 @@ export function stopLetterDraft() {drafting?.abort();drafting = null;if (draft.phase !== "streaming") return;- useLetterEditorStore.setState({ draft: settleDraft(draft.text, draft.versions, true) });+ useLetterEditorStore.setState({ draft: settleDraft(draft.text, draft.versions, true, draft.aiOperationIds) });}/** Closes a failed run, going back to the draft before it when there was one. */diff --git a/apps/web/src/routes/builder/letter/-components/letter-page.tsx b/apps/web/src/routes/builder/letter/-components/letter-page.tsxindex 8f5f2eed0..fa3566e8d 100644--- a/apps/web/src/routes/builder/letter/-components/letter-page.tsx+++ b/apps/web/src/routes/builder/letter/-components/letter-page.tsx@@ -12,6 +12,7 @@ import { applyProposals } from "@reactive-resume/resume/proposals";import { useBreakpoint } from "@reactive-resume/ui/hooks/use-breakpoint";import { cn } from "@reactive-resume/utils/style";import { templates } from "@/dialogs/resume/template/data";+import { AiResultUsage } from "@/features/ai/usage";import { letterPageData, useLetterWords } from "@/features/letters/compose";import { useLetterEditorStore } from "@/features/letters/store";import { useLetterMode } from "@/features/letters/use-letter-mode";@@ -120,6 +121,7 @@ export function LetterPage() {isPhone ? "px-4" : "px-10",)}>+ {viewing && <AiResultUsage usage={viewing.aiUsage} />}<ResumePreviewdata={data}includeCoverLetterHeaderdiff --git a/apps/web/src/routes/builder/letter/-components/write-panel.test.tsx b/apps/web/src/routes/builder/letter/-components/write-panel.test.tsxindex ffc441d19..703010f63 100644--- a/apps/web/src/routes/builder/letter/-components/write-panel.test.tsx+++ b/apps/web/src/routes/builder/letter/-components/write-panel.test.tsx@@ -1,7 +1,8 @@// @vitest-environment happy-dom+import type { LetterDraft } from "@/features/letters/store";import type { CoverLetter } from "@reactive-resume/schema/cover-letter/data";import type { ReactNode } from "react";-import { cleanup, render, screen } from "@testing-library/react";+import { cleanup, fireEvent, render, screen } from "@testing-library/react";import { afterEach, beforeEach, expect, it, vi } from "vite-plus/test";import { i18n } from "@lingui/core";import { I18nProvider } from "@lingui/react";@@ -11,11 +12,12 @@ import { defaultResumeData } from "@reactive-resume/schema/resume/default";const state = vi.hoisted(() => ({letter: null as CoverLetter | null,- draft: { phase: "idle" as const },+ draft: { phase: "idle" } as LetterDraft,status: "saved" as "saved" | "saving" | "error" | "conflict",changing: false,sessionId: "session",edit: vi.fn(),+ start: vi.fn(),}));vi.mock("@/features/letters/store", () => ({@@ -23,7 +25,7 @@ vi.mock("@/features/letters/store", () => ({getState: () => state,}),discardLetterDraft: vi.fn(),- startLetterDraft: vi.fn(),+ startLetterDraft: state.start,}));vi.mock("@/features/applications/queries", () => ({applicationsListQueryOptions: () => ({ queryKey: ["applications"], queryFn: async () => [] }),@@ -110,6 +112,7 @@ const letter: CoverLetter = {};beforeEach(() => {+ vi.clearAllMocks();i18n.loadAndActivate({ locale: "en", messages: {} });state.letter = letter;state.draft = { phase: "idle" };@@ -144,3 +147,39 @@ it("stops accepting typing while the letter changed elsewhere, without hiding thexpect(screen.queryByText(/This letter changed in another tab/)).toBeNull();expect((screen.getByLabelText("Full name") as HTMLInputElement).closest("fieldset")?.disabled).toBe(false);});++it("accepts or revises the displayed earlier draft with its own request sources", () => {+ state.draft = {+ phase: "ready",+ text: "Newest draft",+ aiOperationIds: ["new-operation"],+ versions: [{ text: "Earlier draft", aiOperationIds: ["original-operation"] }],+ };+ renderPanel();+ fireEvent.click(screen.getByLabelText("Previous version"));+ fireEvent.click(screen.getByText("Shorter", { selector: "button" }));+ expect(state.start).toHaveBeenCalledWith("shorter", "Earlier draft", ["original-operation"]);+ fireEvent.click(screen.getByText("Accept", { selector: "button" }));+ expect(state.edit).toHaveBeenCalledWith({ content: "<p>Earlier draft</p>", aiOperationIds: ["original-operation"] });+});++it("shows original requested provider and model beside a saved letter body", () => {+ state.letter = {+ ...letter,+ aiOperationIds: ["original-operation"],+ aiUsage: {+ requests: 2,+ models: [+ {+ providerId: "deleted-connection",+ label: "Original connection",+ provider: "openai-compatible",+ model: "original-model",+ },+ ],+ },+ };+ renderPanel();+ expect(screen.getByText("AI request attempts: 2")).toBeTruthy();+ expect(screen.getByText("Original connection · openai-compatible · original-model")).toBeTruthy();+});diff --git a/apps/web/src/routes/builder/letter/-components/write-panel.tsx b/apps/web/src/routes/builder/letter/-components/write-panel.tsxindex ba325ded0..d7883f754 100644--- a/apps/web/src/routes/builder/letter/-components/write-panel.tsx+++ b/apps/web/src/routes/builder/letter/-components/write-panel.tsx@@ -30,6 +30,7 @@ import { toast } from "@reactive-resume/ui/components/toast";import { cn } from "@reactive-resume/utils/style";import { LetterLanguageField } from "./design-panel";import { templates } from "@/dialogs/resume/template/data";+import { AiResultUsage } from "@/features/ai/usage";import { getDisplayLane, getLaneLabel } from "@/features/applications/lanes";import { applicationsListQueryOptions } from "@/features/applications/queries";import { useApplicationLanes } from "@/features/applications/use-application-lanes";@@ -533,7 +534,7 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {draft={draft}letter={letter}application={application}- onKeep={(text) => {+ onKeep={(text, aiOperationIds) => {const current = useLetterEditorStore.getState();if (getAccountGeneration() !== account ||@@ -545,7 +546,7 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {current.letter.isLocked)return;- edit({ content: coverLetterTextToHtml(text) });+ edit({ content: coverLetterTextToHtml(text), aiOperationIds });discardLetterDraft();setWriting(true);toast.add({ description: t`Draft kept. Edit anything you like.` });@@ -574,6 +575,8 @@ function BodySection({ letter, application, disabled }: LetterSectionProps) {/>)}+ {(letter.aiOperationIds?.length ?? 0) > 0 && <AiResultUsage usage={letter.aiUsage} />}+{structured && (<><LetterFramingField@@ -711,7 +714,7 @@ type DraftBoxProps = {draft: Exclude<LetterDraft, { phase: "idle" }>;letter: CoverLetter;application: ApplicationSummary | null;- onKeep: (text: string) => void;+ onKeep: (text: string, aiOperationIds: string[]) => void;};/** The draft on its green wash, then the dark chip: Keep, Shorter, More personal, Discard. */@@ -719,10 +722,14 @@ function DraftBox({ draft, letter, application, onKeep }: DraftBoxProps) {const reducedMotion = useReducedMotion();const [pick, setPick] = useState<{ draft: LetterDraft; index: number } | null>(null);// Retrying repeats the last request.- const last = useRef<{ variant: "draft" | "shorter" | "personal"; previous?: string }>({ variant: "draft" });- const run = (variant: "draft" | "shorter" | "personal", previous?: string) => {- last.current = previous ? { variant, previous } : { variant };- void startLetterDraft(variant, previous);+ const last = useRef<{+ variant: "draft" | "shorter" | "personal";+ previous?: string;+ previousAiOperationIds?: string[];+ }>({ variant: "draft" });+ const run = (variant: "draft" | "shorter" | "personal", previous?: string, previousAiOperationIds: string[] = []) => {+ last.current = previous ? { variant, previous, previousAiOperationIds } : { variant };+ void startLetterDraft(variant, previous, previousAiOperationIds);};if (draft.phase === "failed") {@@ -738,7 +745,11 @@ function DraftBox({ draft, letter, application, onKeep }: DraftBoxProps) {)}</span><div className="flex gap-1.5">- <Button size="sm" variant="secondary" onClick={() => run(last.current.variant, last.current.previous)}>+ <Button+ size="sm"+ variant="secondary"+ onClick={() => run(last.current.variant, last.current.previous, last.current.previousAiOperationIds)}+ ><Trans>Try again</Trans></Button><Button size="sm" variant="ghost" onClick={dismissLetterDraftFailure}>@@ -751,11 +762,12 @@ function DraftBox({ draft, letter, application, onKeep }: DraftBoxProps) {const streaming = draft.phase === "streaming";// Earlier versions stay side by side with the newest: "2 of 3", and Accept or a revision uses the one shown.- const all = streaming ? [draft.text] : [...draft.versions, draft.text];+ const currentVersion = { text: draft.text, aiOperationIds: draft.aiOperationIds ?? [] };+ const all = streaming ? [currentVersion] : [...draft.versions, currentVersion];const index = pick?.draft === draft ? Math.min(pick.index, all.length - 1) : all.length - 1;- const shown = all[index] ?? draft.text;+ const shown = all[index] ?? currentVersion;// Reduced motion shows the whole draft at once.- const text = streaming && reducedMotion ? "" : shown;+ const text = streaming && reducedMotion ? "" : shown.text;const sources =letter.sourceResumeId && application? t`Draft · uses only your resume and the posting`@@ -827,7 +839,7 @@ function DraftBox({ draft, letter, application, onKeep }: DraftBoxProps) {</span><buttontype="button"- onClick={() => onKeep(shown)}+ onClick={() => onKeep(shown.text, shown.aiOperationIds)}className="touch-target relative h-8 rounded-lg bg-accent px-3 text-[13px] font-semibold text-on-accent hover:bg-accent-hover"><Trans>Accept</Trans>@@ -841,7 +853,7 @@ function DraftBox({ draft, letter, application, onKeep }: DraftBoxProps) {<buttonkey={variant}type="button"- onClick={() => run(variant, shown)}+ onClick={() => run(variant, shown.text, shown.aiOperationIds)}className="touch-target relative h-8 rounded-lg px-2.5 text-[13px] hover:bg-[oklch(1_0_0/0.12)]">{label}diff --git a/docs/guides/exporting-your-data.mdx b/docs/guides/exporting-your-data.mdxindex d842b4026..31a27cbf3 100644--- a/docs/guides/exporting-your-data.mdx+++ b/docs/guides/exporting-your-data.mdx@@ -48,7 +48,7 @@ In `applications.json`, `appliedAt` is filled in even for a job you only saved:`career.json` contains your preferences, facts and their source/correction history, stories, reviewed reusable answers with scope, source and evidence revision references, workspace answers and checklist state, saved results, schedules, notifications, discovered roles, voice transcripts, and career conversations with attachment metadata. Referenced live attachment files are saved separately under `uploads/`. Raw voice recordings are not retained or exported.-It also includes `aiRequests` (recorded request attempts, action, connection label, provider type, requested model and timestamp) and `writingReviews` (saved wording reviews and their source references). Usage records contain no prompts, credentials, provider endpoint URLs, token counts or cost estimates. Deleting a saved connection preserves these historical records; deleting the account removes them.+It also includes `aiRequests` (recorded request attempts, action, connection label, provider type, requested model and timestamp) and `writingReviews` (saved wording reviews and their source references). Saved letters and their history include private operation references that link to these records; portable letter JSON omits them. Usage records contain no prompts, credentials, provider endpoint URLs, token counts or cost estimates. Deleting a saved connection preserves these historical records; deleting the account removes them.Each resume and letter file is named after the document plus a unique ID, so two documents with the same name don't overwrite each other.diff --git a/docs/guides/using-ai.mdx b/docs/guides/using-ai.mdxindex 5f7884da5..f8b92dd4f 100644--- a/docs/guides/using-ai.mdx+++ b/docs/guides/using-ai.mdx@@ -190,7 +190,7 @@ One request attempt means one call to the provider transport after the server'sFailed and cancelled transport attempts remain in history. These totals are not provider billing, token counts, costs or proof that the provider received a request. The server records an attempt before network I/O, so a server interruption can leave a recorded attempt unsent. Earlier requests are not reconstructed when recording first becomes available.-Saved workspace **Library** results and **Check → Writing** reviews show their recorded attempt count, connection label, provider type and requested model. Reused AI answer sources keep their recorded lineage; saving or reusing them does not make another provider request. Older results say **AI request history unavailable for this result.** instead of guessing a count.+Saved workspace **Library** results and **Check → Writing** reviews show their recorded attempt count, connection label, provider type and requested model. Accepted letter body drafts also show their sources in the letter editor and History. Earlier draft selection, revisions and recovery preserve the corresponding references. Reused AI answer sources keep their recorded lineage; saving or reusing them does not make another provider request. Older results say **AI request history unavailable for this result.** instead of guessing a count.Renaming, changing or deleting a connection does not rewrite its historical labels or models. Usage remains readable without an active AI provider. Account export includes usage history, and deleting the account removes it. An older server without reporting shows an update/retry notice.diff --git a/docs/guides/writing-a-cover-letter.mdx b/docs/guides/writing-a-cover-letter.mdxindex a2819e750..d5fc160fe 100644--- a/docs/guides/writing-a-cover-letter.mdx+++ b/docs/guides/writing-a-cover-letter.mdx@@ -156,6 +156,17 @@ If you've connected an AI provider, an empty body offers a first draft. See [Con</Step></Steps>+After accepting a body draft on an updated server, the body shows its recorded **AI request attempts**, original connection label, provider and requested model. Choosing an earlier version keeps that version's sources. A revision also keeps sources from the draft it revised. **Stop**, recovery, copying a letter and saving don't add provider requests. The weekly report still includes attempts for drafts you reject. Historical details stay after removing a connection.++<Frame caption="The accepted body keeps its original request history even after the connection is removed.">+ <img+ src="/images/guides/writing-a-cover-letter/letter-ai-provenance.png"+ alt="Fictional services letter body showing one recorded AI request attempt from Fictional Letter AI using letter-model"+ />+</Frame>++Letter History keeps source references with each saved body. Restoring a version restores its references too; an older version without references has unknown history. Export everything includes these private references and request records. A letter's portable JSON and employer-facing downloads contain its document content, not private request history.+To draft, a letter needs a linked resume or application. After you accept a draft, **Draft from the posting** is gonefrom the body; to start over, open the Assistant and choose **Redraft from the posting**, which proposes a new versionas edits to accept. In the body, **Improve** works on one paragraph and offers **Tie to the posting** (when the letterdiff --git a/docs/images/guides/writing-a-cover-letter/letter-ai-provenance.png b/docs/images/guides/writing-a-cover-letter/letter-ai-provenance.pngnew file mode 100644index 000000000..0f95ee0b1Binary files /dev/null and b/docs/images/guides/writing-a-cover-letter/letter-ai-provenance.png differdiff --git a/docs/spec.json b/docs/spec.jsonindex 8997b78f0..3045b00ca 100644--- a/docs/spec.json+++ b/docs/spec.json@@ -44514,6 +44514,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -63098,6 +63154,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -64002,6 +64114,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -64791,6 +64959,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -64975,6 +65199,15 @@}]},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },"template": {"enum": ["azurill",@@ -66117,6 +66350,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -66393,6 +66682,15 @@}]},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },"template": {"enum": ["azurill",@@ -67535,6 +67833,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -68350,6 +68704,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -69157,6 +69567,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -70691,6 +71157,15 @@"format","version"]+ },+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }}},"required": [@@ -71351,6 +71826,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -71844,9 +72375,65 @@"format": "date-time","x-native-type": "date"},+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"data": {"type": "object","properties": {+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },"name": {"type": "string"},@@ -73476,6 +74063,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -73599,7 +74242,7 @@"post": {"operationId": "draftCoverLetter","summary": "Draft a cover letter's body",- "description": "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft.",+ "description": "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft. With `includeProvenance`, an initial event supplies the AI operation ID before text; the default stream contains only strings.","deprecated": true,"tags": ["Cover Letters",@@ -73637,6 +74280,10 @@"type": "string","maxLength": 20000,"description": "The draft being revised."+ },+ "includeProvenance": {+ "type": "boolean",+ "description": "Emit an initial AI operation reference before text."}}}@@ -73657,7 +74304,23 @@"const": "message"},"data": {- "type": "string"+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "object",+ "properties": {+ "aiOperationId": {+ "type": "string",+ "minLength": 1+ }+ },+ "required": [+ "aiOperationId"+ ]+ }+ ]},"id": {"type": "string"@@ -154198,6 +154861,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -154993,6 +155712,15 @@"format","version"]+ },+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }}},"required": [@@ -155653,6 +156381,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -156467,6 +157251,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{@@ -156590,7 +157430,7 @@"post": {"operationId": "createCoverLetterDraft","summary": "Draft a cover letter's body",- "description": "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft.",+ "description": "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft. With `includeProvenance`, an initial event supplies the AI operation ID before text; the default stream contains only strings.","tags": ["Cover Letters","AI"@@ -156627,6 +157467,10 @@"type": "string","maxLength": 20000,"description": "The draft being revised."+ },+ "includeProvenance": {+ "type": "boolean",+ "description": "Emit an initial AI operation reference before text."}}}@@ -156647,7 +157491,23 @@"const": "message"},"data": {- "type": "string"+ "anyOf": [+ {+ "type": "string"+ },+ {+ "type": "object",+ "properties": {+ "aiOperationId": {+ "type": "string",+ "minLength": 1+ }+ },+ "required": [+ "aiOperationId"+ ]+ }+ ]},"id": {"type": "string"@@ -157449,6 +158309,62 @@"id": {"type": "string"},+ "aiOperationIds": {+ "type": "array",+ "maxItems": 1000,+ "items": {+ "type": "string",+ "minLength": 1,+ "maxLength": 64+ }+ },+ "aiUsage": {+ "anyOf": [+ {+ "type": "object",+ "properties": {+ "requests": {+ "type": "integer",+ "minimum": 0,+ "maximum": 9007199254740991+ },+ "models": {+ "type": "array",+ "items": {+ "type": "object",+ "properties": {+ "providerId": {+ "type": "string"+ },+ "label": {+ "type": "string"+ },+ "provider": {+ "type": "string"+ },+ "model": {+ "type": "string"+ }+ },+ "required": [+ "providerId",+ "label",+ "provider",+ "model"+ ]+ }+ }+ },+ "required": [+ "requests",+ "models"+ ]+ },+ {+ "type": "null"+ }+ ]+ },"sourceResumeId": {"anyOf": [{diff --git a/migrations/20261103112850_magenta_shadow_king/migration.sql b/migrations/20261103112850_magenta_shadow_king/migration.sqlnew file mode 100644index 000000000..8b934aa09--- /dev/null+++ b/migrations/20261103112850_magenta_shadow_king/migration.sql@@ -0,0 +1 @@+ALTER TABLE "cover_letter" ADD COLUMN "ai_operation_ids" text[] DEFAULT '{}'::text[] NOT NULL;\ No newline at end of filediff --git a/migrations/20261103112850_magenta_shadow_king/snapshot.json b/migrations/20261103112850_magenta_shadow_king/snapshot.jsonnew file mode 100644index 000000000..44691f72e--- /dev/null+++ b/migrations/20261103112850_magenta_shadow_king/snapshot.json@@ -0,0 +1,12527 @@+{+ "version": "8",+ "dialect": "postgres",+ "id": "c3022588-c594-46c4-a61a-45636fdaf86d",+ "prevIds": [+ "40b03c02-0821-4050-82c6-879906d6d42b"+ ],+ "ddl": [+ {+ "isRlsEnabled": false,+ "name": "agent_actions",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "agent_attachments",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "agent_messages",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "agent_threads",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "ai_providers",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "ai_request",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "application",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "application_lane",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "application_pipeline",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_answer",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_artifact",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_fact",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_job",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_notification",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_opportunity",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_profile",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_schedule",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_story",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_transcript",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "career_workspace",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "account",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "apikey",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "jwks",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_access_token",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_client",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_client_assertion",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_client_resource",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_consent",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_refresh_token",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "oauth_resource",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "passkey",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "released_username",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "session",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "two_factor",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "user",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "verification",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "cover_letter",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "cover_letter_version",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "custom_domain",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume_slug_redirect",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume_statistics",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume_statistics_daily",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume_version",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "resume_writing_review",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "storage_cleanup_job",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "web_access_credentials",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "ai_content_report",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "application_profile",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "create_request",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "feedback_comment",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "feedback_event",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "isRlsEnabled": false,+ "name": "feedback_link",+ "entityType": "tables",+ "schema": "public"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "thread_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "message_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "kind",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'applied'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "title",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "summary",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "operations",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "snapshot_data",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "base_updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "applied_updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reverted_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "revert_message",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "thread_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "message_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "storage_key",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "filename",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "media_type",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "size",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "thread_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "role",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'completed'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "sequence",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ui_message",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "error",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_provider_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "working_resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "cover_letter_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'document'",+ "generated": null,+ "identity": null,+ "name": "scope",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "title",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "edits_proposed",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "edits_accepted",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'active'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "review_patches",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "active_run_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "active_stream_id",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "active_run_started_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "last_message_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "archived_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "deleted_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "label",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "provider",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "model",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "fast_model",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "capable_model",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "base_url",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "encrypted_api_key",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "api_key_salt",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "api_key_hash",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "api_key_preview",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'untested'",+ "generated": null,+ "identity": null,+ "name": "test_status",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "test_error",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "test_error_kind",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "user_disabled",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_tested_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_used_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "enabled",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_default",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "operation_id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "action",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "provider_id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "label",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "provider",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "model",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "company",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "role",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "location",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "salary",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'saved'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "lane_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "closed_reason",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "cover_letter_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "sent_resume_version_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "smallint",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "sent_check_score",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "sent_cover_letter_version_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "tags",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_url",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "job_description",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "posting_source",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'[]'",+ "generated": null,+ "identity": null,+ "name": "requirements",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "match_score",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_metadata",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "notes",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_file_url",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_file_name",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "cover_letter_url",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "cover_letter_name",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "follow_up_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "follow_up_date_only",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "follow_up_note",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'[]'",+ "generated": null,+ "identity": null,+ "name": "contacts",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'[]'",+ "generated": null,+ "identity": null,+ "name": "activity",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "trashed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "applied_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "submitted_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "category",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "label",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "color",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "position",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "system_key",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "closed_reason",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "retired_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application_pipeline"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "revision",+ "entityType": "columns",+ "schema": "public",+ "table": "application_pipeline"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "question",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "answer",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "ai_operation_ids",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scope",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "employer",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "fact_ids",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "story_ids",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "evidence",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reviewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "1",+ "generated": null,+ "identity": null,+ "name": "revision",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "duplicate_key",+ "entityType": "columns",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "interview_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "title",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "evidence",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "job_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "input_version",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_operation_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "text",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "category",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_key",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'active'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'[]'",+ "generated": null,+ "identity": null,+ "name": "revisions",+ "entityType": "columns",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "schedule_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "due_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'queued'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "attempts",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "lease",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "lease_until",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "error",+ "entityType": "columns",+ "schema": "public",+ "table": "career_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "key",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "notice",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "url",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "read_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "emailed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "email_attempted_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "url",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "role",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "company",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "location",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "snippet",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "discovery_source",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "description",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "first_seen_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "last_seen_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "dismissed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "tracked_application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_profile"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "career_profile"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_profile"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "interview_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "kind",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "query",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "lead",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'en-US'",+ "generated": null,+ "identity": null,+ "name": "locale",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'UTC'",+ "generated": null,+ "identity": null,+ "name": "timezone",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "enabled",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "email",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "next_run_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_queued_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "interval_days",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_provider_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_provider_version",+ "entityType": "columns",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "career_story"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "original",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "edited",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "model",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_operation_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "submission_review",+ "entityType": "columns",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "account_id",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'credential'",+ "generated": null,+ "identity": null,+ "name": "provider_id",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "issuer",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scope",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id_token",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "password",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "access_token",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refresh_token",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "access_token_expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refresh_token_expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "account"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "start",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "prefix",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "key",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'default'",+ "generated": null,+ "identity": null,+ "name": "config_id",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reference_id",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refill_interval",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refill_amount",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_refill_at",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "true",+ "generated": null,+ "identity": null,+ "name": "enabled",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "rate_limit_enabled",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "86400000",+ "generated": null,+ "identity": null,+ "name": "rate_limit_time_window",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "10",+ "generated": null,+ "identity": null,+ "name": "rate_limit_max",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "request_count",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "remaining",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_request",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "permissions",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "metadata",+ "entityType": "columns",+ "schema": "public",+ "table": "apikey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "public_key",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "private_key",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "alg",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "crv",+ "entityType": "columns",+ "schema": "public",+ "table": "jwks"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "authorization_code_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resources",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "requested_user_info_claims",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "revoked",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "confirmation",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "token",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "session_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reference_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refresh_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_discovery_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "client_credentials_scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "backchannel_logout_uri",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "backchannel_logout_session_required",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_type",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "jwks",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "jwks_uri",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "dpop_bound_access_tokens",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_secret",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "disabled",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "skip_consent",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "enable_end_session",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "subject_type",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "uri",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "icon",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "contacts",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "tos",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "policy",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "software_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "software_version",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "software_statement",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "redirect_uris",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "post_logout_redirect_uris",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "token_endpoint_auth_method",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "grant_types",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "response_types",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "public",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "type",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "require_pkce",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reference_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "metadata",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_assertion"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_assertion"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resource_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "metadata",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resources",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "requested_user_info_claims",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reference_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "authorization_code_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resources",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "requested_user_info_claims",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "rotated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "rotation_replay_response",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "rotation_replay_expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "confirmation",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "token",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "client_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "session_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reference_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "revoked",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "auth_time",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "identifier",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "access_token_ttl",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "refresh_token_ttl",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "signing_algorithm",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "signing_key_id",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 1,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "allowed_scopes",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "custom_claims",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "dpop_bound_access_tokens_required",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "disabled",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "1",+ "generated": null,+ "identity": null,+ "name": "policy_version",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "metadata",+ "entityType": "columns",+ "schema": "public",+ "table": "oauth_resource"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "aaguid",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "public_key",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "credential_id",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "counter",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "device_type",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "backed_up",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "transports",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "passkey"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "username",+ "entityType": "columns",+ "schema": "public",+ "table": "released_username"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "released_username"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "released_at",+ "entityType": "columns",+ "schema": "public",+ "table": "released_username"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "token",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ip_address",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_agent",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "impersonated_by",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "session"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "secret",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "backup_codes",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "true",+ "generated": null,+ "identity": null,+ "name": "verified",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "failed_verification_count",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "locked_until",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "image",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "email",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "email_verified",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "username",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "display_username",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "two_factor_enabled",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'UTC'",+ "generated": null,+ "identity": null,+ "name": "timezone",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "locale",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_active_at",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "'user'",+ "generated": null,+ "identity": null,+ "name": "role",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "banned",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ban_reason",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "timestamp(6) with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ban_expires",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_anonymous",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "user"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "identifier",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "value",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "verification"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "recipient",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "content",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "ai_operation_ids",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "greeting",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "sign_off",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "style",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'freeform'",+ "generated": null,+ "identity": null,+ "name": "layout",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "recipient_name",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "''",+ "generated": null,+ "identity": null,+ "name": "recipient_company",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "letter_date",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "sender_linked",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "design_linked",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source_application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "tags",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_locked",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "trashed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "1",+ "generated": null,+ "identity": null,+ "name": "revision",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "edited_at",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "cover_letter_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'auto'",+ "generated": null,+ "identity": null,+ "name": "kind",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "session_id",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "hostname",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "verification_token",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "verified_at",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_checked_at",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "failing_since",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "slug",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "tags",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_public",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "true",+ "generated": null,+ "identity": null,+ "name": "show_download_buttons",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "allow_word_download",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "show_in_search_engines",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "hide_contact_details",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_primary",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "is_locked",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "password",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "trashed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "auto_name",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "false",+ "generated": null,+ "identity": null,+ "name": "auto_slug",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "edited_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "slug",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "views",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "downloads",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_viewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_downloaded_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "date",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "date",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "views",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "downloads",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'auto'",+ "generated": null,+ "identity": null,+ "name": "kind",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "name",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "session_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "1",+ "generated": null,+ "identity": null,+ "name": "request_generation",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "input_text",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "passages",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "review",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "ai_operation_id",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "requested_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reviewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "owner_id",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "storage_key",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "'pending'",+ "generated": null,+ "identity": null,+ "name": "status",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "integer",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "0",+ "generated": null,+ "identity": null,+ "name": "attempts",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "claim_token",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "next_attempt_at",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_error",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "updated_at",+ "entityType": "columns",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "provider",+ "entityType": "columns",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "encrypted_api_key",+ "entityType": "columns",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "test_result",+ "entityType": "columns",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_tested_at",+ "entityType": "columns",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "source",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reason",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "content",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "note",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reviewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "application_profile"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "data",+ "entityType": "columns",+ "schema": "public",+ "table": "application_profile"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "reviewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "application_profile"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "revision",+ "entityType": "columns",+ "schema": "public",+ "table": "application_profile"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "create_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "create_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "fingerprint",+ "entityType": "columns",+ "schema": "public",+ "table": "create_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "application_id",+ "entityType": "columns",+ "schema": "public",+ "table": "create_request"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "create_request"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "link_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "author_name",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "body",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resolved_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "link_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "type",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "user_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_id",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "label",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "jsonb",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "snapshot",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "resume_name",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "boolean",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "true",+ "generated": null,+ "identity": null,+ "name": "allow_comments",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "text",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 1,+ "default": "'{}'",+ "generated": null,+ "identity": null,+ "name": "application_ids",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "expires_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "revoked_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": false,+ "dimensions": 0,+ "default": null,+ "generated": null,+ "identity": null,+ "name": "last_viewed_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "type": "timestamp with time zone",+ "typeSchema": null,+ "notNull": true,+ "dimensions": 0,+ "default": "now()",+ "generated": null,+ "identity": null,+ "name": "created_at",+ "entityType": "columns",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "thread_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_actions_thread_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_actions_resume_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "message_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_actions_message_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "thread_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_attachments_thread_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "message_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_attachments_message_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_attachments_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "thread_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "sequence",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_messages_thread_id_sequence_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_messages_user_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "status",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "last_message_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_threads_user_id_status_last_message_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "working_resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_threads_working_resume_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "cover_letter_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_threads_cover_letter_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "ai_provider_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "agent_threads_ai_provider_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "enabled",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_providers_user_id_enabled_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "last_used_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_providers_user_id_last_used_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_providers_user_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": "\"is_default\"",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_providers_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_request_user_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "operation_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_request_user_id_operation_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "application_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "updated_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "application_user_id_updated_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "trashed_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "application_user_id_trashed_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "lane_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "application_user_id_lane_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "application_lane_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "duplicate_key",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_answer_user_id_duplicate_key_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "application_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_artifact_user_id_application_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "job_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_artifact_job_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "application_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "status",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_fact_user_id_application_id_status_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "source_key",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_fact_user_id_source_key_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "schedule_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "due_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_job_schedule_id_due_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "status",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "lease_until",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_job_status_lease_until_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "key",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_notification_user_id_key_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_notification_user_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "url",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_opportunity_user_id_url_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "enabled",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "next_run_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_schedule_enabled_next_run_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "application_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_story_user_id_application_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_story"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "application_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "career_transcript_user_id_application_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "account_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "account"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "provider_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "account_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "account_provider_id_account_id_unique",+ "entityType": "indexes",+ "schema": "public",+ "table": "account"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "reference_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "apikey_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "apikey"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "key",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "apikey_key_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "apikey"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "config_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "apikey_config_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "apikey"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "enabled",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "reference_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "apikey_enabled_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "apikey"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "token",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_access_token_token_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "client_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_client_client_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "client_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_client_resource_client_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resource_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_client_resource_resource_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "client_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "resource_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_client_resource_client_id_resource_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "client_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_consent_user_id_client_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "token",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "oauth_refresh_token_token_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "passkey_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "passkey"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "token",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "session_token_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "session"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "expires_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "session_expires_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "session"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "two_factor_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "secret",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "two_factor_secret_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "user_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "user"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "lower(\"email\")",+ "isExpression": true,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "user_email_lower_unique_idx",+ "entityType": "indexes",+ "schema": "public",+ "table": "user"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "identifier",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "verification_identifier_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "verification"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "updated_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "id",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "cover_letter_user_id_updated_at_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "trashed_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": "\"trashed_at\" is not null",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "cover_letter_trashed_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "cover_letter_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "cover_letter_version_cover_letter_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "cover_letter_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "session_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": "\"kind\" = 'auto'",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "cover_letter_version_session_unique",+ "entityType": "indexes",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "hostname",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": "\"verified_at\" is not null",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "custom_domain_verified_hostname",+ "entityType": "indexes",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "updated_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_user_id_updated_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "is_public",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "slug",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_is_public_slug_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": "\"is_primary\"",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_primary_unique",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "trashed_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": "\"trashed_at\" is not null",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_trashed_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_slug_redirect_resume_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "date",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_statistics_daily_resume_id_date_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_version_resume_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "session_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": true,+ "where": "\"kind\" = 'auto'",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "resume_version_session_unique",+ "entityType": "indexes",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "nameExplicit": true,+ "columns": [+ {+ "value": "status",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "next_attempt_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": "\"status\" = 'pending'",+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "storage_cleanup_job_due_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "reviewed_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "ai_content_report_reviewed_at_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "create_request_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "create_request"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "link_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "feedback_comment_link_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "feedback_comment_user_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "link_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "feedback_event_link_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "user_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ },+ {+ "value": "created_at",+ "isExpression": false,+ "asc": false,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "feedback_link_user_id_created_at_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "nameExplicit": false,+ "columns": [+ {+ "value": "resume_id",+ "isExpression": false,+ "asc": true,+ "nullsFirst": false,+ "opclass": null+ }+ ],+ "isUnique": false,+ "where": null,+ "with": "",+ "method": "btree",+ "concurrently": false,+ "name": "feedback_link_resume_id_index",+ "entityType": "indexes",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_actions_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ "thread_id"+ ],+ "schemaTo": "public",+ "tableTo": "agent_threads",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_actions_thread_id_agent_threads_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ "message_id"+ ],+ "schemaTo": "public",+ "tableTo": "agent_messages",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_actions_message_id_agent_messages_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_actions_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_actions"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_attachments_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ "thread_id"+ ],+ "schemaTo": "public",+ "tableTo": "agent_threads",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_attachments_thread_id_agent_threads_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ "message_id"+ ],+ "schemaTo": "public",+ "tableTo": "agent_messages",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_attachments_message_id_agent_messages_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_attachments"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_messages_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "nameExplicit": false,+ "columns": [+ "thread_id"+ ],+ "schemaTo": "public",+ "tableTo": "agent_threads",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_messages_thread_id_agent_threads_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_messages"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_threads_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "ai_provider_id"+ ],+ "schemaTo": "public",+ "tableTo": "ai_providers",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_threads_ai_provider_id_ai_providers_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "source_resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_threads_source_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "working_resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_threads_working_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "cover_letter_id"+ ],+ "schemaTo": "public",+ "tableTo": "cover_letter",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "agent_threads_cover_letter_id_cover_letter_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "agent_threads_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "agent_threads"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "ai_providers_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "ai_providers"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "ai_request_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "ai_request"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "application_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "application_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ "cover_letter_id"+ ],+ "schemaTo": "public",+ "tableTo": "cover_letter",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "application_cover_letter_id_cover_letter_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ "sent_resume_version_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume_version",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "application_sent_resume_version_id_resume_version_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ "sent_cover_letter_version_id"+ ],+ "schemaTo": "public",+ "tableTo": "cover_letter_version",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "application_QJaGmijrxJ0T_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": true,+ "columns": [+ "user_id",+ "lane_id"+ ],+ "schemaTo": "public",+ "tableTo": "application_lane",+ "columnsTo": [+ "user_id",+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "NO ACTION",+ "name": "application_lane_owner_fk",+ "entityType": "fks",+ "schema": "public",+ "table": "application"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "application_lane_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "application_pipeline_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application_pipeline"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_answer_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_answer_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "nameExplicit": false,+ "columns": [+ "source_application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "career_answer_source_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_answer"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_artifact_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_artifact_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "nameExplicit": false,+ "columns": [+ "job_id"+ ],+ "schemaTo": "public",+ "tableTo": "career_job",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "career_artifact_job_id_career_job_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_artifact"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_fact_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_fact_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_fact"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_job_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ "schedule_id"+ ],+ "schemaTo": "public",+ "tableTo": "career_schedule",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_job_schedule_id_career_schedule_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_notification_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_notification_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_notification"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_opportunity_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "nameExplicit": false,+ "columns": [+ "tracked_application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "career_opportunity_tracked_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_opportunity"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_profile_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_profile"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_schedule_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_schedule_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "nameExplicit": false,+ "columns": [+ "ai_provider_id"+ ],+ "schemaTo": "public",+ "tableTo": "ai_providers",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "career_schedule_ai_provider_id_ai_providers_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_schedule"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_story_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_story"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_story_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_story"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_transcript_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_transcript_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_transcript"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_workspace_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "career_workspace_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "career_workspace"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "account_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "account"+ },+ {+ "nameExplicit": false,+ "columns": [+ "reference_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "apikey_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "apikey"+ },+ {+ "nameExplicit": false,+ "columns": [+ "client_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_client",+ "columnsTo": [+ "client_id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_access_token_client_id_oauth_client_client_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "session_id"+ ],+ "schemaTo": "public",+ "tableTo": "session",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "oauth_access_token_session_id_session_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_access_token_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "refresh_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_refresh_token",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_access_token_refresh_id_oauth_refresh_token_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_access_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_client_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_client"+ },+ {+ "nameExplicit": false,+ "columns": [+ "client_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_client",+ "columnsTo": [+ "client_id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_client_resource_client_id_oauth_client_client_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resource_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_resource",+ "columnsTo": [+ "identifier"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_client_resource_dn2L1gs9Dolm_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_client_resource"+ },+ {+ "nameExplicit": false,+ "columns": [+ "client_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_client",+ "columnsTo": [+ "client_id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_consent_client_id_oauth_client_client_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_consent_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_consent"+ },+ {+ "nameExplicit": false,+ "columns": [+ "client_id"+ ],+ "schemaTo": "public",+ "tableTo": "oauth_client",+ "columnsTo": [+ "client_id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_refresh_token_client_id_oauth_client_client_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "session_id"+ ],+ "schemaTo": "public",+ "tableTo": "session",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "oauth_refresh_token_session_id_session_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "oauth_refresh_token_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "oauth_refresh_token"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "passkey_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "passkey"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "session_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "session"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "two_factor_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "two_factor"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "cover_letter_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "nameExplicit": false,+ "columns": [+ "source_resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "cover_letter_source_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "nameExplicit": false,+ "columns": [+ "source_application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "cover_letter_source_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "cover_letter"+ },+ {+ "nameExplicit": false,+ "columns": [+ "cover_letter_id"+ ],+ "schemaTo": "public",+ "tableTo": "cover_letter",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "cover_letter_version_cover_letter_id_cover_letter_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "cover_letter_version_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "cover_letter_version"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "custom_domain_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "custom_domain"+ },+ {+ "nameExplicit": false,+ "columns": [+ "application_id"+ ],+ "schemaTo": "public",+ "tableTo": "application",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "SET NULL",+ "name": "resume_application_id_application_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_slug_redirect_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_slug_redirect_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_statistics_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_statistics"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_statistics_daily_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_version_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_version_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_version"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_writing_review_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "resume_writing_review_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "resume_writing_review"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "web_access_credentials_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "web_access_credentials"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "ai_content_report_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "ai_content_report"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "application_profile_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "application_profile"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "create_request_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "create_request"+ },+ {+ "nameExplicit": false,+ "columns": [+ "link_id"+ ],+ "schemaTo": "public",+ "tableTo": "feedback_link",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_comment_link_id_feedback_link_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_comment_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_comment"+ },+ {+ "nameExplicit": false,+ "columns": [+ "link_id"+ ],+ "schemaTo": "public",+ "tableTo": "feedback_link",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_event_link_id_feedback_link_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_event_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_event"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id"+ ],+ "schemaTo": "public",+ "tableTo": "user",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_link_user_id_user_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "schemaTo": "public",+ "tableTo": "resume",+ "columnsTo": [+ "id"+ ],+ "onUpdate": "NO ACTION",+ "onDelete": "CASCADE",+ "name": "feedback_link_resume_id_resume_id_fkey",+ "entityType": "fks",+ "schema": "public",+ "table": "feedback_link"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "agent_actions_pkey",+ "schema": "public",+ "table": "agent_actions",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "agent_attachments_pkey",+ "schema": "public",+ "table": "agent_attachments",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "agent_messages_pkey",+ "schema": "public",+ "table": "agent_messages",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "agent_threads_pkey",+ "schema": "public",+ "table": "agent_threads",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "ai_providers_pkey",+ "schema": "public",+ "table": "ai_providers",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "ai_request_pkey",+ "schema": "public",+ "table": "ai_request",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "application_pkey",+ "schema": "public",+ "table": "application",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "application_lane_pkey",+ "schema": "public",+ "table": "application_lane",+ "entityType": "pks"+ },+ {+ "columns": [+ "user_id"+ ],+ "nameExplicit": false,+ "name": "application_pipeline_pkey",+ "schema": "public",+ "table": "application_pipeline",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_answer_pkey",+ "schema": "public",+ "table": "career_answer",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_artifact_pkey",+ "schema": "public",+ "table": "career_artifact",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_fact_pkey",+ "schema": "public",+ "table": "career_fact",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_job_pkey",+ "schema": "public",+ "table": "career_job",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_notification_pkey",+ "schema": "public",+ "table": "career_notification",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_opportunity_pkey",+ "schema": "public",+ "table": "career_opportunity",+ "entityType": "pks"+ },+ {+ "columns": [+ "user_id"+ ],+ "nameExplicit": false,+ "name": "career_profile_pkey",+ "schema": "public",+ "table": "career_profile",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_schedule_pkey",+ "schema": "public",+ "table": "career_schedule",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_story_pkey",+ "schema": "public",+ "table": "career_story",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "career_transcript_pkey",+ "schema": "public",+ "table": "career_transcript",+ "entityType": "pks"+ },+ {+ "columns": [+ "application_id"+ ],+ "nameExplicit": false,+ "name": "career_workspace_pkey",+ "schema": "public",+ "table": "career_workspace",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "account_pkey",+ "schema": "public",+ "table": "account",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "apikey_pkey",+ "schema": "public",+ "table": "apikey",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "jwks_pkey",+ "schema": "public",+ "table": "jwks",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_access_token_pkey",+ "schema": "public",+ "table": "oauth_access_token",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_client_pkey",+ "schema": "public",+ "table": "oauth_client",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_client_assertion_pkey",+ "schema": "public",+ "table": "oauth_client_assertion",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_client_resource_pkey",+ "schema": "public",+ "table": "oauth_client_resource",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_consent_pkey",+ "schema": "public",+ "table": "oauth_consent",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_refresh_token_pkey",+ "schema": "public",+ "table": "oauth_refresh_token",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "oauth_resource_pkey",+ "schema": "public",+ "table": "oauth_resource",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "passkey_pkey",+ "schema": "public",+ "table": "passkey",+ "entityType": "pks"+ },+ {+ "columns": [+ "username"+ ],+ "nameExplicit": false,+ "name": "released_username_pkey",+ "schema": "public",+ "table": "released_username",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "session_pkey",+ "schema": "public",+ "table": "session",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "two_factor_pkey",+ "schema": "public",+ "table": "two_factor",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "user_pkey",+ "schema": "public",+ "table": "user",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "verification_pkey",+ "schema": "public",+ "table": "verification",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "cover_letter_pkey",+ "schema": "public",+ "table": "cover_letter",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "cover_letter_version_pkey",+ "schema": "public",+ "table": "cover_letter_version",+ "entityType": "pks"+ },+ {+ "columns": [+ "user_id"+ ],+ "nameExplicit": false,+ "name": "custom_domain_pkey",+ "schema": "public",+ "table": "custom_domain",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "resume_pkey",+ "schema": "public",+ "table": "resume",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "resume_slug_redirect_pkey",+ "schema": "public",+ "table": "resume_slug_redirect",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "resume_statistics_pkey",+ "schema": "public",+ "table": "resume_statistics",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "resume_statistics_daily_pkey",+ "schema": "public",+ "table": "resume_statistics_daily",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "resume_version_pkey",+ "schema": "public",+ "table": "resume_version",+ "entityType": "pks"+ },+ {+ "columns": [+ "resume_id"+ ],+ "nameExplicit": false,+ "name": "resume_writing_review_pkey",+ "schema": "public",+ "table": "resume_writing_review",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "storage_cleanup_job_pkey",+ "schema": "public",+ "table": "storage_cleanup_job",+ "entityType": "pks"+ },+ {+ "columns": [+ "user_id"+ ],+ "nameExplicit": false,+ "name": "web_access_credentials_pkey",+ "schema": "public",+ "table": "web_access_credentials",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "ai_content_report_pkey",+ "schema": "public",+ "table": "ai_content_report",+ "entityType": "pks"+ },+ {+ "columns": [+ "user_id"+ ],+ "nameExplicit": false,+ "name": "application_profile_pkey",+ "schema": "public",+ "table": "application_profile",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "create_request_pkey",+ "schema": "public",+ "table": "create_request",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "feedback_comment_pkey",+ "schema": "public",+ "table": "feedback_comment",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "feedback_event_pkey",+ "schema": "public",+ "table": "feedback_event",+ "entityType": "pks"+ },+ {+ "columns": [+ "id"+ ],+ "nameExplicit": false,+ "name": "feedback_link_pkey",+ "schema": "public",+ "table": "feedback_link",+ "entityType": "pks"+ },+ {+ "nameExplicit": true,+ "columns": [+ "user_id",+ "id"+ ],+ "nullsNotDistinct": false,+ "name": "application_lane_owner_id_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "nameExplicit": true,+ "columns": [+ "user_id",+ "system_key"+ ],+ "nullsNotDistinct": false,+ "name": "application_lane_owner_system_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "application_lane"+ },+ {+ "nameExplicit": false,+ "columns": [+ "slug",+ "user_id"+ ],+ "nullsNotDistinct": false,+ "name": "resume_slug_user_id_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "resume"+ },+ {+ "nameExplicit": false,+ "columns": [+ "user_id",+ "slug"+ ],+ "nullsNotDistinct": false,+ "name": "resume_slug_redirect_user_id_slug_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "resume_slug_redirect"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id",+ "date"+ ],+ "nullsNotDistinct": false,+ "name": "resume_statistics_daily_resume_id_date_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "resume_statistics_daily"+ },+ {+ "nameExplicit": true,+ "columns": [+ "owner_id",+ "storage_key"+ ],+ "nullsNotDistinct": false,+ "name": "storage_cleanup_job_owner_key_unique",+ "entityType": "uniques",+ "schema": "public",+ "table": "storage_cleanup_job"+ },+ {+ "nameExplicit": false,+ "columns": [+ "token"+ ],+ "nullsNotDistinct": false,+ "name": "oauth_access_token_token_key",+ "schema": "public",+ "table": "oauth_access_token",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "client_id"+ ],+ "nullsNotDistinct": false,+ "name": "oauth_client_client_id_key",+ "schema": "public",+ "table": "oauth_client",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "identifier"+ ],+ "nullsNotDistinct": false,+ "name": "oauth_resource_identifier_key",+ "schema": "public",+ "table": "oauth_resource",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "token"+ ],+ "nullsNotDistinct": false,+ "name": "session_token_key",+ "schema": "public",+ "table": "session",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "email"+ ],+ "nullsNotDistinct": false,+ "name": "user_email_key",+ "schema": "public",+ "table": "user",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "username"+ ],+ "nullsNotDistinct": false,+ "name": "user_username_key",+ "schema": "public",+ "table": "user",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "display_username"+ ],+ "nullsNotDistinct": false,+ "name": "user_display_username_key",+ "schema": "public",+ "table": "user",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "identifier"+ ],+ "nullsNotDistinct": false,+ "name": "verification_identifier_key",+ "schema": "public",+ "table": "verification",+ "entityType": "uniques"+ },+ {+ "nameExplicit": false,+ "columns": [+ "resume_id"+ ],+ "nullsNotDistinct": false,+ "name": "resume_statistics_resume_id_key",+ "schema": "public",+ "table": "resume_statistics",+ "entityType": "uniques"+ }+ ],+ "renames": []+}\ No newline at end of filediff --git a/packages/api/src/dto/cover-letter.ts b/packages/api/src/dto/cover-letter.tsindex f6df6e34d..ac21acee6 100644--- a/packages/api/src/dto/cover-letter.ts+++ b/packages/api/src/dto/cover-letter.ts@@ -1,5 +1,6 @@import z from "zod";import { COVER_LETTER_VERSION_KINDS } from "@reactive-resume/db/schema";+import { aiOperationIdsSchema, aiUsageSummarySchema } from "@reactive-resume/schema/ai-usage";import {coverLetterContentSchema,coverLetterDocumentSchema,@@ -33,7 +34,9 @@ const letterVersionSummarySchema = z.object({});const letterVersionSchema = letterVersionSummarySchema.extend({+ aiUsage: aiUsageSummarySchema.nullable().optional(),data: z.object({+ aiOperationIds: aiOperationIdsSchema.optional(),name: z.string(),recipient: z.string(),content: z.string(),@@ -48,6 +51,7 @@ const letterVersionSchema = letterVersionSummarySchema.extend({});const versionRefSchema = idSchema.extend({ versionId: z.string().min(1) });const versionNameSchema = z.string().trim().min(1).max(100);+export const coverLetterDraftChunkSchema = z.union([z.string(), z.object({ aiOperationId: z.string().min(1) })]);export const coverLetterDto = {list: {@@ -88,6 +92,7 @@ export const coverLetterDto = {},update: {input: revisionSchema.extend(editableSchema.partial().shape).extend({+ aiOperationIds: aiOperationIdsSchema.optional(),template: templateSchema.optional().describe("Sets the letter's own template, which unlinks its design."),metadata: coverLetterStyleSchema.shape.metadata.pick({ typography: true, design: true, page: true })@@ -157,13 +162,17 @@ export const coverLetterDto = {.default("draft").describe("draft writes the body; shorter and personal revise `previous`."),previous: z.string().max(20_000).optional().describe("The draft being revised."),+ includeProvenance: z.boolean().optional().describe("Emit an initial AI operation reference before text."),}),},refreshStyle: { input: revisionSchema.extend({ resumeId: z.string().min(1) }), output: coverLetterSchema },duplicate: { input: idSchema.extend({ name: editableSchema.shape.name.optional() }), output: coverLetterSchema },delete: { input: revisionSchema, output: z.void() },export: { input: idSchema, output: coverLetterDocumentSchema },- import: { input: z.object({ document: coverLetterDocumentSchema }), output: coverLetterSchema },+ import: {+ input: z.object({ document: coverLetterDocumentSchema, aiOperationIds: aiOperationIdsSchema.optional() }),+ output: coverLetterSchema,+ },};export type CoverLetterListInput = z.infer<typeof coverLetterDto.list.input>;diff --git a/packages/api/src/features/ai/usage.integration.test.ts b/packages/api/src/features/ai/usage.integration.test.tsindex 71f963a48..0cd52787f 100644--- a/packages/api/src/features/ai/usage.integration.test.ts+++ b/packages/api/src/features/ai/usage.integration.test.ts@@ -16,6 +16,7 @@ import { aiProvidersService } from "../ai-providers/service";import { authRouter } from "../auth/router";import { authService } from "../auth/service";import { careerRouter } from "../career/router";+import { coverLettersRouter } from "../cover-letters/router";import { assertDocumentVersion } from "../documents/ownership";import { aiRouter } from "./router";import { getModel } from "./service";@@ -126,7 +127,7 @@ describe.skipIf(!databaseUrl)("AI request metering through installed SDK, protecconst run = (operation: () => Promise<void>) => withDatabasePool(pool, operation);const client = (permissions: ("read" | "write" | "delete")[] = ["read", "write", "delete"]) =>createRouterClient(- { ai: aiRouter, auth: authRouter, career: careerRouter },+ { ai: aiRouter, auth: authRouter, career: careerRouter, letters: coverLettersRouter },{context: {locale: "en-US",@@ -549,6 +550,122 @@ describe.skipIf(!databaseUrl)("AI request metering through installed SDK, protecexpect(requests).toHaveLength(1);}));+ it("keeps letter draft sources through owned saves, reuse, history, export and deletion without new dispatches", () =>+ run(async () => {+ const connection = await provider();+ const [resume] = await db+ .insert(tables.resume)+ .values({ userId: user.id, name: "Fictional resume", slug: "letter", data: sampleResumeData })+ .returning();+ if (!resume) throw new Error("Missing fixture resume");+ const api = client();+ const letter = await api.letters.create({ name: "Fictional letter", resumeId: resume.id });+ const created = (await api.letters.listVersions({ id: letter.id }))[0];+ if (!created) throw new Error("Missing created version");+ mode = "stream";+ const stream = await api.letters.draft({ id: letter.id, includeProvenance: true });+ const parts = await Array.fromAsync(stream);+ const source = parts.find((part) => typeof part !== "string");+ if (!source || typeof source === "string") throw new Error("Missing draft provenance");+ const text = parts.filter((part) => typeof part === "string").join("");+ expect(text).toBe("x".repeat(50));+ expect(requests).toHaveLength(1);+ const kept = await api.letters.update({+ id: letter.id,+ expectedRevision: letter.revision,+ content: `<p>${text}</p>`,+ aiOperationIds: [source.aiOperationId, source.aiOperationId],+ });+ const expected = {+ requests: 1,+ models: [+ { providerId: connection.id, label: connection.label, provider: connection.provider, model: "capable-model" },+ ],+ };+ expect(kept.aiOperationIds).toEqual([source.aiOperationId]);+ expect(kept.aiUsage).toEqual(expected);+ // An old app edits without the new field: source history is preserved.+ const edited = await api.letters.update({+ id: letter.id,+ expectedRevision: kept.revision,+ content: "<p>Edited draft</p>",+ });+ expect(edited.aiUsage).toEqual(expected);+ for (const [operationId, userId, action] of [+ ["foreign-letter", "usage-bob", "draft-letter"],+ ["wrong-letter", user.id, "provider-test"],+ ] as const) {+ await db.insert(tables.aiRequest).values({+ operationId,+ userId,+ action,+ providerId: connection.id,+ label: connection.label,+ provider: connection.provider,+ model: "foreign-model",+ });+ await expect(+ api.letters.update({+ id: letter.id,+ expectedRevision: edited.revision,+ content: "<p>Refused</p>",+ aiOperationIds: [operationId],+ }),+ ).rejects.toMatchObject({ code: "BAD_REQUEST" });+ }+ expect((await api.letters.getById({ id: letter.id })).content).toBe("<p>Edited draft</p>");+ await expect(+ client(["read"]).letters.update({ id: letter.id, expectedRevision: edited.revision, aiOperationIds: [] }),+ ).rejects.toMatchObject({ code: "FORBIDDEN" });+ const named = await api.letters.createVersion({ id: letter.id, name: "Kept draft" });+ expect((await client(["read"]).letters.getVersion({ id: letter.id, versionId: named.id })).aiUsage).toEqual(+ expected,+ );+ const reused = await api.letters.create({+ name: "New employer",+ sourceLetterId: letter.id,+ recipientCompany: "Fictional New Co",+ });+ expect(reused).toMatchObject({+ content: edited.content,+ recipientCompany: "Fictional New Co",+ aiOperationIds: [source.aiOperationId],+ aiUsage: expected,+ });+ expect((await api.letters.duplicate({ id: letter.id })).aiUsage).toEqual(expected);+ const portable = await api.letters.export({ id: letter.id });+ expect(portable).not.toHaveProperty("aiOperationIds");+ expect(portable).not.toHaveProperty("aiUsage");+ const imported = await api.letters.import({ document: portable });+ expect(imported.aiOperationIds).toEqual([]);+ const recovered = await api.letters.import({ document: portable, aiOperationIds: [source.aiOperationId] });+ expect(recovered.aiUsage).toEqual(expected);+ await expect(+ api.letters.import({ document: portable, aiOperationIds: ["foreign-letter"] }),+ ).rejects.toMatchObject({ code: "BAD_REQUEST" });+ await aiProvidersService.delete({ userId: user.id, id: connection.id });+ expect((await client(["read"]).letters.getById({ id: letter.id })).aiUsage).toEqual(expected);+ await pool.query("update cover_letter_version set data=data-'aiOperationIds' where id=$1", [created.id]);+ const restored = await api.letters.restoreVersion({ id: letter.id, versionId: created.id, proposalSafety: "v1" });+ expect(restored.aiOperationIds).toEqual([]);+ expect(restored.aiUsage).toBeNull();+ const history = await api.letters.listVersions({ id: letter.id });+ const before = history.find((version) => version.kind === "before-restore");+ if (!before) throw new Error("Missing before-restore version");+ expect((await api.letters.getVersion({ id: letter.id, versionId: before.id })).aiUsage).toEqual(expected);+ const exportData = await client(["read"]).auth.exportData({});+ expect(JSON.stringify(exportData.coverLetters)).toContain(source.aiOperationId);+ expect(+ exportData.documentVersions?.letters.find((version) => version.id === before.id)?.data.aiOperationIds,+ ).toEqual([source.aiOperationId]);+ expect(exportData.career.aiRequests?.some((row) => row.operationId === source.aiOperationId)).toBe(true);+ await authService.deleteAccount({ userId: user.id });+ expect((await pool.query("select * from cover_letter")).rows).toEqual([]);+ expect((await pool.query("select * from cover_letter_version")).rows).toEqual([]);+ expect((await pool.query("select * from ai_request where user_id=$1", [user.id])).rows).toEqual([]);+ expect(requests).toHaveLength(1);+ }));+it("retains saved-result provenance after connection edits/removal, exports it to old archive clients and deletes account usage", () =>run(async () => {const connection = await provider();diff --git a/packages/api/src/features/ai/usage.ts b/packages/api/src/features/ai/usage.tsindex bf99e2ce4..5d7bc7f9d 100644--- a/packages/api/src/features/ai/usage.ts+++ b/packages/api/src/features/ai/usage.ts@@ -120,8 +120,12 @@ export function combineAiUsage(summaries: Iterable<AiUsageSummary>): AiUsageSumm};}-export async function readAiUsage(userId: string, operationIds: readonly string[]): Promise<AiUsageSummary | null> {- return combineAiUsage((await readAiUsages(userId, operationIds)).values());+export async function readAiUsage(+ userId: string,+ operationIds: readonly string[],+ reader: DbOrTx = db,+): Promise<AiUsageSummary | null> {+ return combineAiUsage((await readAiUsages(userId, operationIds, reader)).values());}export async function readWeeklyAiUsage(userId: string, now = new Date()) {diff --git a/packages/api/src/features/cover-letters/draft.test.ts b/packages/api/src/features/cover-letters/draft.test.tsindex 1410a171e..0b195da01 100644--- a/packages/api/src/features/cover-letters/draft.test.ts+++ b/packages/api/src/features/cover-letters/draft.test.ts@@ -4,7 +4,7 @@ const service = vi.hoisted(() => ({getById: vi.fn(),getDefaultRunnable: vi.fn(),authorize: vi.fn(async () => undefined),- getModel: vi.fn(() => ({ modelId: "mock" })),+ getModel: vi.fn((_input: unknown) => ({ modelId: "mock" })),streamText: vi.fn(),}));@@ -53,6 +53,19 @@ beforeEach(() => {});describe("letter drafts", () => {+ it("keeps legacy text streams and emits an opted-in operation before any partial text", async () => {+ service.streamText.mockImplementation(() => ({+ stream: (async function* () {+ yield { type: "text-delta", text: "Partial draft" };+ })(),+ }));+ const old = await draftLetterBody({ id: "letter", userId: "user-1", variant: "draft" });+ expect(await Array.fromAsync(old)).toEqual(["Partial draft"]);+ const next = await draftLetterBody({ id: "letter", userId: "user-1", variant: "draft", includeProvenance: true });+ const usage = service.getModel.mock.calls.at(-1)?.[0] as unknown as { usage: { operationId: string } };+ expect((await next.next()).value).toEqual({ aiOperationId: usage.usage.operationId });+ expect((await next.next()).value).toBe("Partial draft");+ });it("uses the capable model while the main model stays the single-model default", async () => {const draft = await draftLetterBody({ id: "letter", userId: "user-1", variant: "draft" });await draft.next();diff --git a/packages/api/src/features/cover-letters/draft.ts b/packages/api/src/features/cover-letters/draft.tsindex fe02486f1..33ad1098d 100644--- a/packages/api/src/features/cover-letters/draft.ts+++ b/packages/api/src/features/cover-letters/draft.ts@@ -51,7 +51,7 @@ function buildLetterDraftPrompt(input: PromptInput): string {*/export async function draftLetterBody(input: CoverLetterDraftInput & { userId: string; signal?: AbortSignal | undefined },-): Promise<AsyncGenerator<string>> {+): Promise<AsyncGenerator<string | { aiOperationId: string }>> {const { userId } = input;const letter = await coverLetterService.getById({ id: input.id, userId });const [resume, application] = await Promise.all([@@ -72,12 +72,13 @@ export async function draftLetterBody(const posting =application?.jobDescription?.trim() ||(application?.requirements.length ? application.requirements.map((item) => `- ${item}`).join("\n") : undefined);+ const usage = createAiUsage(userId, "draft-letter", provider, async (tx) => {+ await assertDocumentVersion(tx, userId, { kind: "letter", ...letter });+ if (resume) await assertDocumentVersion(tx, userId, { kind: "resume", ...resume });+ if (application) await assertApplicationVersion(tx, userId, application);+ });const model = getModel({- usage: createAiUsage(userId, "draft-letter", provider, async (tx) => {- await assertDocumentVersion(tx, userId, { kind: "letter", ...letter });- if (resume) await assertDocumentVersion(tx, userId, { kind: "resume", ...resume });- if (application) await assertApplicationVersion(tx, userId, application);- }),+ usage,provider: provider.provider,model: aiModelForTask(provider, "capable"),apiKey: provider.apiKey,@@ -116,6 +117,7 @@ export async function draftLetterBody(// Resolve and authorize inside the request scope; oRPC iterates the result after that scope has ended.return (async function* () {try {+ if (input.includeProvenance) yield { aiOperationId: usage.operationId };for await (const part of result.stream) {if (part.type === "text-delta") yield part.text;else if (part.type === "error") throw unreachable(part.error);diff --git a/packages/api/src/features/cover-letters/router.ts b/packages/api/src/features/cover-letters/router.tsindex f1451b27c..886806f17 100644--- a/packages/api/src/features/cover-letters/router.ts+++ b/packages/api/src/features/cover-letters/router.ts@@ -1,7 +1,6 @@import { eventIterator } from "@orpc/server";-import z from "zod";import { protectedProcedure } from "../../context";-import { coverLetterDto } from "../../dto/cover-letter";+import { coverLetterDraftChunkSchema, coverLetterDto } from "../../dto/cover-letter";import { aiRequestRateLimit, resumeMutationRateLimit } from "../../middleware/rate-limit";import { paginate } from "../../pagination";import { draftLetterBody } from "./draft";@@ -243,11 +242,11 @@ export const coverLettersRouter = {operationId: "draftCoverLetter",summary: "Draft a cover letter's body",description:- "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft.",+ "Streams a draft of the letter's body, as text, from its linked resume and its application's posting, using only facts from them. Nothing is saved. `shorter` and `personal` revise a previous draft. With `includeProvenance`, an initial event supplies the AI operation ID before text; the default stream contains only strings.",successDescription: "The draft, streamed as text.",}).input(coverLetterDto.draft.input)- .output(eventIterator(z.string()))+ .output(eventIterator(coverLetterDraftChunkSchema)).use(aiRequestRateLimit).handler(({ context, input, signal }) => draftLetterBody({ ...input, userId: context.user.id, signal })),};diff --git a/packages/api/src/features/cover-letters/service.integration.test.ts b/packages/api/src/features/cover-letters/service.integration.test.tsindex 8bed150af..f86deaef1 100644--- a/packages/api/src/features/cover-letters/service.integration.test.ts+++ b/packages/api/src/features/cover-letters/service.integration.test.ts@@ -60,6 +60,7 @@ describe.skipIf(!process.env.COVER_LETTER_TEST_DATABASE_URL)("cover-letter owned"20261001042749_v6_release","20261009132123_left_proteus","20261101050044_rx114_content_edited_at",+ "20261103112850_magenta_shadow_king",]) {const migration = await readFile(new URL(`../../../../../migrations/${name}/migration.sql`, import.meta.url),diff --git a/packages/api/src/features/cover-letters/service.ts b/packages/api/src/features/cover-letters/service.tsindex 093638a6e..6ec52e3b4 100644--- a/packages/api/src/features/cover-letters/service.ts+++ b/packages/api/src/features/cover-letters/service.ts@@ -26,6 +26,7 @@ import {CurrentClientRequired,saveProposalApplications,} from "../agent/proposal-applications";+import { assertAiOperations, readAiUsage } from "../ai/usage";import { activeApplications } from "../applications/access";import { suggestDuplicateName } from "../documents/naming";import { lockUser } from "../documents/ownership";@@ -35,6 +36,7 @@ import { getLetterVersion, saveLetterSessionVersion, writeLetterVersion } from "type OwnedId = { userId: string; id: string };type RevisionInput = OwnedId & { expectedRevision: number };+const LETTER_AI_ACTIONS = ["draft-letter", "draft-message", "improve", "assistant", "career-chat"] as const;type CreateInput = {userId: string;name: string;@@ -72,7 +74,8 @@ async function getRow(input: OwnedId, reader: DbOrTx = db): Promise<CoverLetter>* A letter as it reads now: linked sender details and design come from its source resume as the resume is today.* If the resume is gone, the copies the letter keeps stand in.*/-async function resolveLinks(letter: CoverLetter, userId: string, reader: DbOrTx = db): Promise<CoverLetter> {+async function resolveLinks(stored: CoverLetter, userId: string, reader: DbOrTx = db): Promise<CoverLetter> {+ const letter = { ...stored, aiUsage: await readAiUsage(userId, stored.aiOperationIds ?? [], reader) };if (!(letter.senderLinked || letter.designLinked) || !letter.sourceResumeId) return letter;let linked: CoverLetterStyle;@@ -140,18 +143,18 @@ async function assertOwnedApplication(userId: string, id?: string) {}/**- * The body of an earlier letter to start from. The source stays untouched: only its text is read, and the new+ * The body of an earlier letter to start from. The source stays untouched: its text and request sources are read, and the new* letter's own "created" version records what was copied.*/-async function getOwnedLetterBody(userId: string, id: string) {- const [row] = await db- .select({ content: schema.coverLetter.content })+async function getOwnedLetterBody(userId: string, id: string, reader: DbOrTx) {+ const [row] = await reader+ .select({ content: schema.coverLetter.content, aiOperationIds: schema.coverLetter.aiOperationIds }).from(schema.coverLetter).where(and(eq(schema.coverLetter.id, id), eq(schema.coverLetter.userId, userId), isNull(schema.coverLetter.trashedAt)),);if (!row) throw new ORPCError("NOT_FOUND");- return row.content;+ return row;}type LinkLetterApplicationInput = {@@ -416,6 +419,7 @@ async function insert(tags?: string[];recipient: string;content: string;+ aiOperationIds?: string[] | undefined;greeting?: string | null | undefined;signOff?: string | null | undefined;style: CoverLetterStyle;@@ -436,6 +440,7 @@ async function insert(return insert(input, tx);});const content = coverLetterContentSchema.parse(input);+ await assertAiOperations(input.userId, input.aiOperationIds ?? [], LETTER_AI_ACTIONS, client);const [row] = await client.insert(schema.coverLetter).values({@@ -444,6 +449,7 @@ async function insert(userId: input.userId,recipient: sanitizeCoverLetterHtml(content.recipient),content: sanitizeCoverLetterHtml(content.content),+ aiOperationIds: input.aiOperationIds ?? [],sourceResumeId: input.sourceResumeId ?? null,sourceApplicationId: input.sourceApplicationId ?? null,senderLinked: input.senderLinked ?? false,@@ -550,7 +556,6 @@ export const coverLetterService = {*/create: async (input: CreateInput) => {const application = await getOwnedApplication(input.userId, input.applicationId);- const sourceBody = input.sourceLetterId ? await getOwnedLetterBody(input.userId, input.sourceLetterId) : null;const style = await getResumeStyle(input.userId, input.resumeId);if (input.template) style.metadata.template = input.template;// The letter is for an employer whose posting declared a language: start in it, so the body, greeting,@@ -567,6 +572,7 @@ export const coverLetterService = {const linked = Boolean(input.resumeId) && !input.template;const letter = await db.transaction(async (tx) => {await lockUser(tx, input.userId);+ const sourceBody = input.sourceLetterId ? await getOwnedLetterBody(input.userId, input.sourceLetterId, tx) : null;const letter = await insert({userId: input.userId,@@ -574,7 +580,8 @@ export const coverLetterService = {recipient: input.recipient ?? "",// The body is the reused part; recipient, date, resume and application come from this request so an// earlier job's company never leaks into the new letter.- content: sourceBody ?? input.content ?? "",+ content: sourceBody?.content ?? input.content ?? "",+ aiOperationIds: sourceBody?.aiOperationIds ?? [],greeting: input.greeting ?? null,signOff: input.signOff ?? null,style,@@ -680,6 +687,10 @@ export const coverLetterService = {if (input.letterDate !== undefined) changes.letterDate = input.letterDate;const persist = async (client: DbOrTx) => {+ if (input.aiOperationIds !== undefined) {+ await assertAiOperations(input.userId, input.aiOperationIds, LETTER_AI_ACTIONS, client);+ changes.aiOperationIds = [...new Set(input.aiOperationIds)];+ }const updated = await updateRevision(input, changes, client, { proposalSafety: input.proposalSafety });await saveProposalApplications(client, {userId: input.userId,@@ -708,7 +719,7 @@ export const coverLetterService = {};const updated = await resolveLinks(await (- input.applicationId === undefined && !input.proposalApplications+ input.applicationId === undefined && !input.proposalApplications && input.aiOperationIds === undefined? persist(db): db.transaction(async (tx) => {await lockUser(tx, input.userId);@@ -809,6 +820,7 @@ export const coverLetterService = {name: data.name,recipient: data.recipient,content: data.content,+ aiOperationIds: data.aiOperationIds ?? [],greeting: data.greeting ?? null,signOff: data.signOff ?? null,style: data.style,@@ -831,8 +843,11 @@ export const coverLetterService = {const letter = await getById(input);return writeLetterVersion(db, { letter, userId: input.userId, kind: "sent", name: input.company });},- import: (input: { userId: string; document: CoverLetterDocument }) => {+ import: async (input: { userId: string; document: CoverLetterDocument; aiOperationIds?: string[] | undefined }) => {const document = coverLetterDocumentSchema.parse(input.document);- return insert({ ...document, userId: input.userId });+ return resolveLinks(+ await insert({ ...document, userId: input.userId, aiOperationIds: input.aiOperationIds }),+ input.userId,+ );},};diff --git a/packages/api/src/features/cover-letters/versions.ts b/packages/api/src/features/cover-letters/versions.tsindex 930fa7d7c..0925298e1 100644--- a/packages/api/src/features/cover-letters/versions.ts+++ b/packages/api/src/features/cover-letters/versions.ts@@ -2,10 +2,12 @@ import type { DbOrTx } from "@reactive-resume/db/client";import type { CoverLetterVersionData, CoverLetterVersionKind } from "@reactive-resume/db/schema";import type { CoverLetter } from "@reactive-resume/schema/cover-letter/data";import * as schema from "@reactive-resume/db/schema";+import { readAiUsage } from "../ai/usage";import { createVersionHistory } from "../documents/version-history";/** The parts of a letter a version keeps. */const letterVersionData = (letter: CoverLetter): CoverLetterVersionData => ({+ aiOperationIds: letter.aiOperationIds ?? [],name: letter.name,recipient: letter.recipient,content: letter.content,@@ -61,7 +63,8 @@ export const listLetterVersions = (input: Owned) => history.list(ids(input));export const getLetterVersion = async (input: Owned & { versionId: string }) => {const version = await history.get({ ...ids(input), versionId: input.versionId });- return { ...version, data: version.data as CoverLetterVersionData };+ const data = version.data as CoverLetterVersionData;+ return { ...version, data, aiUsage: await readAiUsage(input.userId, data.aiOperationIds ?? []) };};export const renameLetterVersion = (input: Owned & { versionId: string; name: string }) =>diff --git a/packages/db/src/schema/cover-letter.ts b/packages/db/src/schema/cover-letter.tsindex 36ca21934..640f64513 100644--- a/packages/db/src/schema/cover-letter.ts+++ b/packages/db/src/schema/cover-letter.ts@@ -21,6 +21,7 @@ export const coverLetter = pg.pgTable(name: pg.text("name").notNull(),recipient: pg.text("recipient").notNull().default(""),content: pg.text("content").notNull().default(""),+ aiOperationIds: pg.text("ai_operation_ids").array().notNull().default([]),greeting: pg.text("greeting"),signOff: pg.text("sign_off"),style: pg.jsonb("style").$type<CoverLetterStyle>().notNull(),@@ -66,6 +67,7 @@ export type CoverLetterVersionKind = (typeof COVER_LETTER_VERSION_KINDS)[number]/** What a letter version keeps: everything that makes the letter read the way it did. */export type CoverLetterVersionData = {+ aiOperationIds?: string[];name: string;recipient: string;content: string;diff --git a/packages/schema/src/cover-letter/data.ts b/packages/schema/src/cover-letter/data.tsindex 1b29796a6..b65400e45 100644--- a/packages/schema/src/cover-letter/data.ts+++ b/packages/schema/src/cover-letter/data.ts@@ -1,4 +1,5 @@import z from "zod";+import { aiOperationIdsSchema, aiUsageSummarySchema } from "../ai-usage";import { basicsSchema, metadataSchema, pictureSchema } from "../resume/data";export const coverLetterStyleSchema = z.object({@@ -52,6 +53,8 @@ export const coverLetterContentSchema = z.object({export const coverLetterSchema = coverLetterContentSchema.extend({id: z.string(),+ aiOperationIds: aiOperationIdsSchema.optional(),+ aiUsage: aiUsageSummarySchema.nullable().optional(),sourceResumeId: z.string().nullable(),sourceApplicationId: z.string().nullable(),senderLinked: z@@ -64,6 +67,13 @@ export const coverLetterSchema = coverLetterContentSchema.extend({updatedAt: z.date(),});+/** Older saved drafts contain only text; their request history stays unknown. */+export const coverLetterDraftVersionSchema = z.union([+ z.string().transform((text) => ({ text, aiOperationIds: [] as string[] })),+ z.object({ text: z.string(), aiOperationIds: aiOperationIdsSchema.catch([]) }),+]);+export type CoverLetterDraftVersion = z.infer<typeof coverLetterDraftVersionSchema>;+export const coverLetterDocumentSchema = coverLetterContentSchema.extend({format: z.literal("reactive-resume-cover-letter"),version: z.literal(1),diff --git a/tests/e2e/fixtures/ai-stub.ts b/tests/e2e/fixtures/ai-stub.tsindex 42b5e0b46..71853da65 100644--- a/tests/e2e/fixtures/ai-stub.ts+++ b/tests/e2e/fixtures/ai-stub.ts@@ -133,6 +133,12 @@ function reply(request: ChatRequest, response: ServerResponse) {}response.writeHead(200, { "content-type": "text/event-stream", "cache-control": "no-cache" });+ if (!request.tools?.length && /^(write the body|shorter:|more personal:)/.test(said))+ return streamText(response, [+ said.startsWith("write")+ ? "I build reliable services and would welcome the chance to discuss your team."+ : "I build reliable services.",+ ]);// A realistic coaching answer for documentation captures; the people and companies are fictional.if (said.includes("follow up on this week"))diff --git a/tests/e2e/specs/ai-usage.spec.ts b/tests/e2e/specs/ai-usage.spec.tsindex 7e25a86b0..4025442af 100644--- a/tests/e2e/specs/ai-usage.spec.ts+++ b/tests/e2e/specs/ai-usage.spec.ts@@ -6,10 +6,74 @@ let stub: Awaited<ReturnType<typeof startAiStub>>;test.beforeAll(async () => {stub = await startAiStub();});+test.beforeEach(() => {+ stub.requests.length = 0;+});test.afterAll(async () => {await stub?.close();});+test("letter Accept saves the displayed version's original model and request source", async ({+ authPage: page,+}, testInfo) => {+ test.skip(process.env.FLAG_ALLOW_UNSAFE_AI_BASE_URL !== "true", "Needs isolated local AI stub permission");+ test.setTimeout(90_000);+ await page.setViewportSize({ width: 1440, height: 1000 });+ await approveLocalStubOperations(page);+ const before = stub.requests.length;+ const connection = await page.request.post("/api/openapi/ai-providers", {+ data: {+ label: "Fictional Letter AI",+ provider: "openai-compatible",+ model: "letter-model",+ baseURL: stub.baseURL,+ apiKey: "stub-key",+ },+ });+ await expect(connection).toBeOK();+ const { id: providerId } = await connection.json();+ await expect(await page.request.post(`/api/openapi/ai-providers/${providerId}/test`)).toBeOK();+ const resumeResponse = await page.request.post("/api/openapi/resumes", {+ data: { name: "Fictional services resume", tags: [], withSampleData: true },+ });+ await expect(resumeResponse).toBeOK();+ const resumeId = await resumeResponse.json();+ const created = await page.request.post("/api/openapi/cover-letters", {+ data: { name: "Fictional services letter", resumeId },+ });+ await expect(created).toBeOK();+ const { id } = await created.json();+ await page.goto(`/builder/letter/${id}`);+ await page.getByRole("button", { name: "Draft from your resume", exact: true }).click();+ const body = page.getByRole("region", { name: "Letter", exact: true });+ await expect(+ body.getByText("I build reliable services and would welcome the chance to discuss your team.", { exact: true }),+ ).toBeVisible();+ await body.getByRole("button", { name: "Shorter", exact: true }).click();+ await expect(body.getByText("I build reliable services.", { exact: true })).toBeVisible();+ await body.getByRole("button", { name: "Previous version", exact: true }).click();+ await expect(+ body.getByText("I build reliable services and would welcome the chance to discuss your team.", { exact: true }),+ ).toBeVisible();+ await body.getByRole("button", { name: "Accept", exact: true }).click();+ await expect(body.getByText("AI request attempts: 1", { exact: true })).toBeVisible();+ const saved = await (await page.request.get(`/api/openapi/cover-letters/${id}`)).json();+ expect(saved.content).toBe("<p>I build reliable services and would welcome the chance to discuss your team.</p>");+ expect(saved.aiOperationIds).toHaveLength(1);+ await expect(await page.request.delete(`/api/openapi/ai-providers/${providerId}`)).toBeOK();+ await page.reload();+ await expect(body.getByText("AI request attempts: 1", { exact: true })).toBeVisible();+ await expect(body.getByText("Fictional Letter AI · openai-compatible · letter-model", { exact: true })).toBeVisible();+ expect(stub.requests.length - before).toBe(3);+ const report = await (await page.request.get("/api/openapi/ai/usage")).json();+ expect(report.requests).toBe(3);+ expect(report.groups).toEqual(+ expect.arrayContaining([expect.objectContaining({ action: "draft-letter", requests: 2, model: "letter-model" })]),+ );+ await body.scrollIntoViewIfNeeded();+ await body.screenshot({ path: testInfo.outputPath("letter-ai-provenance.png"), animations: "disabled" });+});+test("real AI attempts reach weekly usage and saved provenance after connection rename and deletion", async ({authPage: page,}, testInfo) => {