@burdenoff/microfe-theculturepost 2026.1110.1 → 2026.1110.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/stories/AiContextPanel.stories.d.ts +11 -0
  2. package/dist/stories/AiContextPanel.stories.d.ts.map +1 -0
  3. package/dist/theculturepost/components/AiContextPanel.d.ts +36 -0
  4. package/dist/theculturepost/components/AiContextPanel.d.ts.map +1 -0
  5. package/dist/theculturepost/components/AiContextPanel.js +324 -0
  6. package/dist/theculturepost/components/AiContextPanel.js.map +1 -0
  7. package/dist/theculturepost/components/index.d.ts +2 -0
  8. package/dist/theculturepost/components/index.d.ts.map +1 -1
  9. package/dist/theculturepost/components/index.js +2 -1
  10. package/dist/theculturepost/hooks/index.js +7 -7
  11. package/dist/theculturepost/hooks/useTcpApi.d.ts +21 -1
  12. package/dist/theculturepost/hooks/useTcpApi.d.ts.map +1 -1
  13. package/dist/theculturepost/hooks/useTcpApi.js +47 -10
  14. package/dist/theculturepost/hooks/useTcpApi.js.map +1 -1
  15. package/dist/theculturepost/pages/archive/ArchivePage.d.ts.map +1 -1
  16. package/dist/theculturepost/pages/archive/ArchivePage.js +128 -110
  17. package/dist/theculturepost/pages/archive/ArchivePage.js.map +1 -1
  18. package/dist/theculturepost/pages/archive/CollectionDetailPage.d.ts.map +1 -1
  19. package/dist/theculturepost/pages/archive/CollectionDetailPage.js +88 -82
  20. package/dist/theculturepost/pages/archive/CollectionDetailPage.js.map +1 -1
  21. package/dist/theculturepost/pages/stories/StoriesPage.d.ts.map +1 -1
  22. package/dist/theculturepost/pages/stories/StoriesPage.js +61 -59
  23. package/dist/theculturepost/pages/stories/StoriesPage.js.map +1 -1
  24. package/dist/theculturepost/pages/stories/StoryDetailPage.d.ts.map +1 -1
  25. package/dist/theculturepost/pages/stories/StoryDetailPage.js +345 -337
  26. package/dist/theculturepost/pages/stories/StoryDetailPage.js.map +1 -1
  27. package/dist/theculturepost/types/index.d.ts +54 -0
  28. package/dist/theculturepost/types/index.d.ts.map +1 -1
  29. package/package.json +1 -1
@@ -0,0 +1,11 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { AiRunCard } from '../theculturepost/components/AiContextPanel';
3
+
4
+ declare const meta: Meta<typeof AiRunCard>;
5
+ export default meta;
6
+ type Story = StoryObj<typeof meta>;
7
+ export declare const PendingReview: Story;
8
+ export declare const Approved: Story;
9
+ export declare const Rejected: Story;
10
+ export declare const Failed: Story;
11
+ //# sourceMappingURL=AiContextPanel.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiContextPanel.stories.d.ts","sourceRoot":"","sources":["../../src/stories/AiContextPanel.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAGxE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAMhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAmCnC,eAAO,MAAM,aAAa,EAAE,KAE3B,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAetB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAWpB,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { TcpAgentRun, TcpAiUseCase } from '../types';
2
+
3
+ export declare const AI_USE_CASE_LABELS: Record<TcpAiUseCase, string>;
4
+ export interface GenerateAiContextDialogProps {
5
+ open: boolean;
6
+ onOpenChange: (open: boolean) => void;
7
+ /** Preselected use case. Locked to this single action. */
8
+ useCase: TcpAiUseCase;
9
+ /** Exactly one grounding scope, matching the svc input contract. */
10
+ storyId?: string;
11
+ collectionId?: string;
12
+ oralHistoryId?: string;
13
+ onGenerated?: (run: TcpAgentRun) => void;
14
+ }
15
+ export declare function GenerateAiContextDialog({ open, onOpenChange, useCase, storyId, collectionId, oralHistoryId, onGenerated, }: GenerateAiContextDialogProps): import("react/jsx-runtime").JSX.Element;
16
+ export declare function AiRunCard({ run }: {
17
+ run: TcpAgentRun;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ export interface AiContextSectionProps {
20
+ /** Story-scoped use cases (SUMMARIZE_EVIDENCE, DRAFT_FRAMING_PROMPT). */
21
+ storyId?: string;
22
+ /** Collection-scoped use cases (SUGGEST_RELATED_TRADITIONS). */
23
+ collectionId?: string;
24
+ /** Oral-history use case (TRANSCRIBE_ORAL_HISTORY) — action only, no run list
25
+ * filter exists for oral histories server-side. */
26
+ oralHistoryId?: string;
27
+ useCases: TcpAiUseCase[];
28
+ title?: string;
29
+ description?: string;
30
+ className?: string;
31
+ }
32
+ export declare function AiContextSection({ storyId, collectionId, oralHistoryId, useCases, title, description, className, }: AiContextSectionProps): import("react/jsx-runtime").JSX.Element;
33
+ export declare function AiReviewQueue({ className }: {
34
+ className?: string;
35
+ }): import("react/jsx-runtime").JSX.Element | null;
36
+ //# sourceMappingURL=AiContextPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiContextPanel.d.ts","sourceRoot":"","sources":["../../../src/theculturepost/components/AiContextPanel.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAsBH,OAAO,KAAK,EACV,WAAW,EAEX,YAAY,EAEb,MAAM,UAAU,CAAC;AAMlB,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAK3D,CAAC;AAyBF,MAAM,WAAW,4BAA4B;IAC3C,IAAI,EAAE,OAAO,CAAC;IACd,YAAY,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,0DAA0D;IAC1D,OAAO,EAAE,YAAY,CAAC;IACtB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,GAAG,EAAE,WAAW,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,YAAY,EACZ,OAAO,EACP,OAAO,EACP,YAAY,EACZ,aAAa,EACb,WAAW,GACZ,EAAE,4BAA4B,2CAmF9B;AAYD,wBAAgB,SAAS,CAAC,EAAE,GAAG,EAAE,EAAE;IAAE,GAAG,EAAE,WAAW,CAAA;CAAE,2CAkItD;AAMD,MAAM,WAAW,qBAAqB;IACpC,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;uDACmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,YAAY,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,OAAO,EACP,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,KAAsB,EACtB,WAA6H,EAC7H,SAAS,GACV,EAAE,qBAAqB,2CAuEvB;AAMD,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,kDAyClE"}
@@ -0,0 +1,324 @@
1
+ import { StatusBadge as e } from "./StatusBadge.js";
2
+ import { EmptyState as t } from "./EmptyState.js";
3
+ import { ErrorView as n, LoadingView as r } from "./StateViews.js";
4
+ import { useTcpAiContextRuns as i, useTcpGenerateAiContext as a, useTcpReviewAiContext as o } from "../hooks/useTcpApi.js";
5
+ import "../hooks/index.js";
6
+ import { describeError as s, notify as c } from "../lib/toast.js";
7
+ import { formatEnumLabel as l, formatRelativeTime as u } from "../utils/formatters.js";
8
+ import { useState as d } from "react";
9
+ import { Check as f, Sparkles as p, X as m } from "lucide-react";
10
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
11
+ import { Button as v, GlassCard as y, Label as b, ResponsiveDialog as x, ResponsiveDialogContent as S, ResponsiveDialogDescription as C, ResponsiveDialogFooter as w, ResponsiveDialogHeader as T, ResponsiveDialogTitle as E, Textarea as D } from "@burdenoff/fe-libs/ui";
12
+ // src/theculturepost/components/AiContextPanel.tsx
13
+ var O = {
14
+ SUMMARIZE_EVIDENCE: "Summarise evidence",
15
+ DRAFT_FRAMING_PROMPT: "Draft framing",
16
+ SUGGEST_RELATED_TRADITIONS: "Find related traditions",
17
+ TRANSCRIBE_ORAL_HISTORY: "Clean up transcript"
18
+ }, k = {
19
+ SUMMARIZE_EVIDENCE: "What do the cited sources say about this story’s central claims?",
20
+ DRAFT_FRAMING_PROMPT: "Draft a short framing question that an editor could put to the cited sources.",
21
+ SUGGEST_RELATED_TRADITIONS: "Which traditions or practices in this collection relate to each other, and why?",
22
+ TRANSCRIBE_ORAL_HISTORY: "Clean up and format this transcript: fix punctuation and paragraph breaks, and mark speaker turns — do not add any content that is not in the original."
23
+ }, A = {
24
+ CITATION: "Citation",
25
+ ARCHIVE_ITEM: "Artifact",
26
+ ORAL_HISTORY: "Oral history"
27
+ }, j = (e) => e.reviewStatus === "PENDING";
28
+ function M({ open: e, onOpenChange: t, useCase: n, storyId: r, collectionId: i, oralHistoryId: o, onGenerated: l }) {
29
+ let u = a(), [f, m] = d(() => k[n]), [y, A] = d(null), j = (e) => {
30
+ e || (m(k[n]), A(null), u.reset()), t(e);
31
+ };
32
+ return /* @__PURE__ */ g(x, {
33
+ open: e,
34
+ onOpenChange: j,
35
+ children: /* @__PURE__ */ _(S, {
36
+ className: "sm:max-w-xl",
37
+ children: [
38
+ /* @__PURE__ */ _(T, { children: [/* @__PURE__ */ g(E, { children: O[n] }), /* @__PURE__ */ g(C, { children: "Runs on this product’s AI answer only from sources you can read (PUBLIC/COMMUNITY). Every run starts as pending editorial review — nothing is adopted automatically." })] }),
39
+ y ? /* @__PURE__ */ _("div", {
40
+ className: "flex flex-col gap-4",
41
+ children: [/* @__PURE__ */ g("p", {
42
+ className: "text-sm text-text-secondary",
43
+ children: "Run created — it is awaiting editorial review."
44
+ }), /* @__PURE__ */ g(P, { run: y })]
45
+ }) : /* @__PURE__ */ _("div", {
46
+ className: "flex flex-col gap-2",
47
+ children: [
48
+ /* @__PURE__ */ g(b, {
49
+ htmlFor: "ai-context-prompt",
50
+ children: "Your question or instruction"
51
+ }),
52
+ /* @__PURE__ */ g(D, {
53
+ id: "ai-context-prompt",
54
+ value: f,
55
+ onChange: (e) => m(e.target.value),
56
+ rows: 4,
57
+ disabled: u.isPending
58
+ }),
59
+ /* @__PURE__ */ g("p", {
60
+ className: "text-xs text-text-tertiary",
61
+ children: "Combined server-side with the grounded sources — never sent to the model alone."
62
+ })
63
+ ]
64
+ }),
65
+ /* @__PURE__ */ g(w, { children: y ? /* @__PURE__ */ g(v, {
66
+ onClick: () => j(!1),
67
+ children: "Done"
68
+ }) : /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(v, {
69
+ variant: "outline",
70
+ onClick: () => j(!1),
71
+ disabled: u.isPending,
72
+ children: "Cancel"
73
+ }), /* @__PURE__ */ _(v, {
74
+ onClick: async () => {
75
+ let e = {
76
+ useCase: n,
77
+ prompt: f.trim(),
78
+ storyId: r ?? null,
79
+ collectionId: i ?? null,
80
+ oralHistoryId: o ?? null
81
+ };
82
+ try {
83
+ let t = await u.mutateAsync(e);
84
+ A(t), l?.(t);
85
+ } catch (e) {
86
+ c.error("Generation failed", s(e));
87
+ }
88
+ },
89
+ disabled: u.isPending || !f.trim(),
90
+ children: [/* @__PURE__ */ g(p, {
91
+ className: "mr-1.5 h-4 w-4",
92
+ "aria-hidden": "true"
93
+ }), u.isPending ? "Generating…" : "Generate"]
94
+ })] }) })
95
+ ]
96
+ })
97
+ });
98
+ }
99
+ var N = {
100
+ LOW: "success",
101
+ MEDIUM: "warning",
102
+ HIGH: "destructive"
103
+ };
104
+ function P({ run: t }) {
105
+ let n = o(), [r, i] = d(""), [a, p] = d(!1), h = async (e) => {
106
+ try {
107
+ await n.mutateAsync({
108
+ id: t.id,
109
+ approved: e,
110
+ reviewNotes: r.trim() || void 0
111
+ }), c.success(e ? "AI answer approved" : "AI answer rejected", e ? "It is now marked as reviewed." : "The run stays on record as rejected.");
112
+ } catch (e) {
113
+ c.error("Review failed", s(e));
114
+ }
115
+ };
116
+ return /* @__PURE__ */ _(y, {
117
+ treatment: "plain",
118
+ className: "flex flex-col gap-3 p-4",
119
+ children: [
120
+ /* @__PURE__ */ _("div", {
121
+ className: "flex flex-wrap items-center gap-1.5",
122
+ children: [
123
+ /* @__PURE__ */ g(e, { status: t.useCase }),
124
+ /* @__PURE__ */ g(e, { status: t.reviewStatus }),
125
+ t.status === "FAILED" && /* @__PURE__ */ g(e, { status: "FAILED" }),
126
+ t.uncertainty && /* @__PURE__ */ _("span", {
127
+ className: `inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${N[t.uncertainty] === "success" ? "bg-status-success-bg-subtle text-status-success-text" : N[t.uncertainty] === "destructive" ? "bg-status-error-bg-subtle text-status-error-text" : "bg-status-warning-bg-subtle text-status-warning-text"}`,
128
+ children: ["Uncertainty: ", l(t.uncertainty)]
129
+ }),
130
+ /* @__PURE__ */ g("span", {
131
+ className: "ml-auto text-xs text-text-tertiary",
132
+ children: u(t.createdAt)
133
+ })
134
+ ]
135
+ }),
136
+ /* @__PURE__ */ _("p", {
137
+ className: "text-sm text-text-secondary",
138
+ children: [/* @__PURE__ */ g("span", {
139
+ className: "font-medium text-text-primary",
140
+ children: "Prompt: "
141
+ }), t.promptSummary]
142
+ }),
143
+ t.error && /* @__PURE__ */ g("p", {
144
+ className: "rounded-lg bg-status-error-bg-subtle p-2 text-xs text-status-error-text",
145
+ children: t.error
146
+ }),
147
+ t.content && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("button", {
148
+ type: "button",
149
+ onClick: () => p((e) => !e),
150
+ className: "text-xs font-medium text-text-secondary underline-offset-2 hover:underline",
151
+ children: a ? "Hide answer" : "Show answer"
152
+ }), a && /* @__PURE__ */ g("p", {
153
+ className: "mt-2 whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 text-sm text-text-primary",
154
+ children: t.content
155
+ })] }),
156
+ t.groundingRefs.length > 0 && /* @__PURE__ */ _("div", {
157
+ className: "flex flex-col gap-1.5",
158
+ children: [/* @__PURE__ */ _("p", {
159
+ className: "text-xs font-medium text-text-tertiary",
160
+ children: [
161
+ "Grounded in (",
162
+ t.groundingRefs.length,
163
+ " sources)"
164
+ ]
165
+ }), /* @__PURE__ */ g("ul", {
166
+ className: "flex flex-wrap gap-1.5",
167
+ children: t.groundingRefs.map((e) => /* @__PURE__ */ _("li", {
168
+ className: "inline-flex max-w-full items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary",
169
+ title: e.title,
170
+ children: [/* @__PURE__ */ g("span", {
171
+ className: "shrink-0 font-medium",
172
+ children: A[e.kind] ?? l(e.kind)
173
+ }), /* @__PURE__ */ g("span", {
174
+ className: "truncate",
175
+ children: e.title
176
+ })]
177
+ }, `${e.kind}-${e.refId}`))
178
+ })]
179
+ }),
180
+ t.reviewStatus !== "PENDING" && (t.reviewNotes || t.reviewedAt) && /* @__PURE__ */ _("p", {
181
+ className: "text-xs text-text-tertiary",
182
+ children: [t.reviewStatus === "APPROVED" ? "Approved" : "Rejected", t.reviewNotes ? ` — ${t.reviewNotes}` : ""]
183
+ }),
184
+ j(t) && /* @__PURE__ */ _("div", {
185
+ className: "flex flex-col gap-2 border-t border-border-seam pt-3",
186
+ children: [/* @__PURE__ */ g(D, {
187
+ value: r,
188
+ onChange: (e) => i(e.target.value),
189
+ rows: 2,
190
+ placeholder: "Review notes (optional)",
191
+ disabled: n.isPending
192
+ }), /* @__PURE__ */ _("div", {
193
+ className: "flex gap-2",
194
+ children: [/* @__PURE__ */ _(v, {
195
+ size: "sm",
196
+ onClick: () => h(!0),
197
+ disabled: n.isPending,
198
+ "aria-label": "Approve AI answer",
199
+ children: [/* @__PURE__ */ g(f, {
200
+ className: "mr-1.5 h-4 w-4",
201
+ "aria-hidden": "true"
202
+ }), " Approve"]
203
+ }), /* @__PURE__ */ _(v, {
204
+ size: "sm",
205
+ variant: "outline",
206
+ onClick: () => h(!1),
207
+ disabled: n.isPending,
208
+ "aria-label": "Reject AI answer",
209
+ children: [/* @__PURE__ */ g(m, {
210
+ className: "mr-1.5 h-4 w-4",
211
+ "aria-hidden": "true"
212
+ }), " Reject"]
213
+ })]
214
+ })]
215
+ })
216
+ ]
217
+ });
218
+ }
219
+ function F({ storyId: e, collectionId: a, oralHistoryId: o, useCases: s, title: c = "AI assistant", description: l = "Citation-grounded answers from sources you can read. Every answer waits for editorial review before adoption.", className: u }) {
220
+ let [f, m] = d(null), h = !!(e || a), b = i({
221
+ storyId: e,
222
+ collectionId: a,
223
+ pagination: { limit: 10 },
224
+ enabled: h
225
+ }), x = h ? b.data?.items ?? [] : [], S = x.filter(j).length;
226
+ return /* @__PURE__ */ _(y, {
227
+ treatment: "plain",
228
+ className: `flex flex-col gap-4 p-5 sm:p-6 ${u ?? ""}`,
229
+ children: [
230
+ /* @__PURE__ */ _("div", {
231
+ className: "flex flex-wrap items-start justify-between gap-3",
232
+ children: [/* @__PURE__ */ _("div", { children: [/* @__PURE__ */ _("h2", {
233
+ className: "flex items-center gap-2 font-display text-xl font-semibold text-text-primary",
234
+ children: [
235
+ /* @__PURE__ */ g(p, {
236
+ className: "h-5 w-5 text-accent",
237
+ "aria-hidden": "true"
238
+ }),
239
+ " ",
240
+ c,
241
+ S > 0 && /* @__PURE__ */ _("span", {
242
+ className: "rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text",
243
+ children: [S, " pending"]
244
+ })
245
+ ]
246
+ }), /* @__PURE__ */ g("p", {
247
+ className: "mt-1 text-sm text-text-secondary",
248
+ children: l
249
+ })] }), /* @__PURE__ */ g("div", {
250
+ className: "flex flex-wrap gap-2",
251
+ children: s.map((e) => /* @__PURE__ */ _(v, {
252
+ variant: "outline",
253
+ onClick: () => m(e),
254
+ children: [/* @__PURE__ */ g(p, {
255
+ className: "mr-1.5 h-4 w-4",
256
+ "aria-hidden": "true"
257
+ }), O[e]]
258
+ }, e))
259
+ })]
260
+ }),
261
+ h && (b.isLoading ? /* @__PURE__ */ g(r, { label: "Loading AI runs…" }) : b.isError ? /* @__PURE__ */ g(n, {
262
+ title: "Could not load AI runs",
263
+ onRetry: () => b.refetch()
264
+ }) : x.length === 0 ? /* @__PURE__ */ g(t, {
265
+ icon: /* @__PURE__ */ g(p, { className: "h-9 w-9" }),
266
+ title: "No AI runs yet",
267
+ description: "Run one of the actions above to draft a citation-grounded answer."
268
+ }) : /* @__PURE__ */ g("div", {
269
+ className: "flex flex-col gap-3",
270
+ children: x.map((e) => /* @__PURE__ */ g(P, { run: e }, e.id))
271
+ })),
272
+ f && /* @__PURE__ */ g(M, {
273
+ open: !0,
274
+ onOpenChange: (e) => {
275
+ e || m(null);
276
+ },
277
+ useCase: f,
278
+ storyId: e,
279
+ collectionId: a,
280
+ oralHistoryId: o
281
+ })
282
+ ]
283
+ });
284
+ }
285
+ function I({ className: e }) {
286
+ let t = i({ pagination: { limit: 50 } }), a = (t.data?.items ?? []).filter(j);
287
+ return t.isLoading ? /* @__PURE__ */ g(r, { label: "Loading AI review queue…" }) : t.isError ? /* @__PURE__ */ g(n, {
288
+ title: "Could not load the AI review queue",
289
+ onRetry: () => t.refetch()
290
+ }) : a.length === 0 ? null : /* @__PURE__ */ _(y, {
291
+ treatment: "plain",
292
+ className: `flex flex-col gap-3 p-5 sm:p-6 ${e ?? ""}`,
293
+ children: [
294
+ /* @__PURE__ */ _("h2", {
295
+ className: "flex items-center gap-2 font-display text-xl font-semibold text-text-primary",
296
+ children: [
297
+ /* @__PURE__ */ g(p, {
298
+ className: "h-5 w-5 text-accent",
299
+ "aria-hidden": "true"
300
+ }),
301
+ " AI review queue",
302
+ /* @__PURE__ */ _("span", {
303
+ className: "rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text",
304
+ children: [a.length, " pending"]
305
+ })
306
+ ]
307
+ }),
308
+ /* @__PURE__ */ g("p", {
309
+ className: "text-sm text-text-secondary",
310
+ children: "Generated answers awaiting an editorial decision, newest first. Approve or reject them here, or in place on the story or collection they belong to."
311
+ }),
312
+ /* @__PURE__ */ _("div", {
313
+ className: "flex flex-col gap-3",
314
+ children: [a.slice(0, 5).map((e) => /* @__PURE__ */ g(P, { run: e }, e.id)), a.length > 5 && /* @__PURE__ */ _("p", {
315
+ className: "text-xs text-text-tertiary",
316
+ children: [a.length - 5, " more pending — open the story or collection they belong to review them in place."]
317
+ })]
318
+ })
319
+ ]
320
+ });
321
+ }
322
+ export { O as AI_USE_CASE_LABELS, F as AiContextSection, I as AiReviewQueue, P as AiRunCard, M as GenerateAiContextDialog };
323
+
324
+ //# sourceMappingURL=AiContextPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AiContextPanel.js","names":["_Fragment","Fragment$1","AI_USE_CASE_LABELS","DEFAULT_PROMPTS","GROUNDING_KIND_LABELS","isPending","run","GenerateAiContextDialog","generate","useTcpGenerateAiContext","prompt","setPrompt","useState","useCase","setRun","reset","nextOpen","onOpenChange","ResponsiveDialog","ResponsiveDialogContent","ResponsiveDialogHeader","ResponsiveDialogTitle","ResponsiveDialogDescription","AiRunCard","Label","Textarea","event","ResponsiveDialogFooter","Button","input","storyId","collectionId","oralHistoryId","created","onGenerated","error","describeError","Sparkles","UNCERTAINTY_BADGE","review","useTcpReviewAiContext","notes","setNotes","expanded","setExpanded","decide","notify","approved","GlassCard","StatusBadge","formatEnumLabel","formatRelativeTime","value","ref","Check","X","AiContextSection","activeUseCase","setActiveUseCase","listable","runsQuery","useTcpAiContextRuns","runs","pendingCount","className","title","description","useCases","LoadingView","ErrorView","EmptyState","open","AiReviewQueue","items"],"sources":["../../../src/theculturepost/components/AiContextPanel.tsx"],"sourcesContent":["/**\n * AiContextPanel — in-app UI for the citation-grounded AI context layer.\n * @module theculturepost/components\n *\n * Surfaces the `tcpGenerateAiContext` / `tcpReviewAiContext` / `tcpAiContextRuns`\n * operations (BOFF-4127) so editors can generate, review and adopt\n * citation-grounded answers without leaving the story, collection or oral\n * history screen (BOFF-5805).\n *\n * Floors stay server-side: generation is feature-flagged, grounding only ever\n * reads PUBLIC/COMMUNITY sources, and every run lands PENDING until a human\n * approves or rejects it. This UI only calls those operations and renders\n * their results — RBAC and access-tier denials surface as errors.\n */\n\nimport { useState } from 'react';\nimport { Check, Sparkles, X } from 'lucide-react';\nimport {\n Button,\n GlassCard,\n Label,\n ResponsiveDialog,\n ResponsiveDialogContent,\n ResponsiveDialogDescription,\n ResponsiveDialogFooter,\n ResponsiveDialogHeader,\n ResponsiveDialogTitle,\n Textarea,\n} from '@burdenoff/fe-libs/ui';\nimport { StatusBadge } from './StatusBadge';\nimport { EmptyState } from './EmptyState';\nimport { LoadingView, ErrorView } from './StateViews';\nimport { useTcpAiContextRuns, useTcpGenerateAiContext, useTcpReviewAiContext } from '../hooks';\nimport { notify, describeError } from '../lib/toast';\nimport { formatEnumLabel, formatRelativeTime } from '../utils/formatters';\nimport type {\n TcpAgentRun,\n TcpAiGroundingKind,\n TcpAiUseCase,\n TcpGenerateAiContextInput,\n} from '../types';\n\n// ============================================================================\n// Per-use-case presentation metadata (labels + default prompts)\n// ============================================================================\n\nexport const AI_USE_CASE_LABELS: Record<TcpAiUseCase, string> = {\n SUMMARIZE_EVIDENCE: 'Summarise evidence',\n DRAFT_FRAMING_PROMPT: 'Draft framing',\n SUGGEST_RELATED_TRADITIONS: 'Find related traditions',\n TRANSCRIBE_ORAL_HISTORY: 'Clean up transcript',\n};\n\nconst DEFAULT_PROMPTS: Record<TcpAiUseCase, string> = {\n SUMMARIZE_EVIDENCE: 'What do the cited sources say about this story’s central claims?',\n DRAFT_FRAMING_PROMPT:\n 'Draft a short framing question that an editor could put to the cited sources.',\n SUGGEST_RELATED_TRADITIONS:\n 'Which traditions or practices in this collection relate to each other, and why?',\n TRANSCRIBE_ORAL_HISTORY:\n 'Clean up and format this transcript: fix punctuation and paragraph breaks, and mark speaker turns — do not add any content that is not in the original.',\n};\n\nconst GROUNDING_KIND_LABELS: Record<TcpAiGroundingKind, string> = {\n CITATION: 'Citation',\n ARCHIVE_ITEM: 'Artifact',\n ORAL_HISTORY: 'Oral history',\n};\n\n/** A run is reviewable only while PENDING — the svc rejects re-reviews. */\nconst isPending = (run: TcpAgentRun): boolean => run.reviewStatus === 'PENDING';\n\n// ============================================================================\n// Generate dialog\n// ============================================================================\n\nexport interface GenerateAiContextDialogProps {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n /** Preselected use case. Locked to this single action. */\n useCase: TcpAiUseCase;\n /** Exactly one grounding scope, matching the svc input contract. */\n storyId?: string;\n collectionId?: string;\n oralHistoryId?: string;\n onGenerated?: (run: TcpAgentRun) => void;\n}\n\nexport function GenerateAiContextDialog({\n open,\n onOpenChange,\n useCase,\n storyId,\n collectionId,\n oralHistoryId,\n onGenerated,\n}: GenerateAiContextDialogProps) {\n const generate = useTcpGenerateAiContext();\n const [prompt, setPrompt] = useState(() => DEFAULT_PROMPTS[useCase]);\n const [run, setRun] = useState<TcpAgentRun | null>(null);\n\n const reset = (nextOpen: boolean) => {\n if (!nextOpen) {\n setPrompt(DEFAULT_PROMPTS[useCase]);\n setRun(null);\n generate.reset();\n }\n onOpenChange(nextOpen);\n };\n\n const submit = async () => {\n const input: TcpGenerateAiContextInput = {\n useCase,\n prompt: prompt.trim(),\n storyId: storyId ?? null,\n collectionId: collectionId ?? null,\n oralHistoryId: oralHistoryId ?? null,\n };\n try {\n const created = await generate.mutateAsync(input);\n setRun(created);\n onGenerated?.(created);\n } catch (error) {\n notify.error('Generation failed', describeError(error));\n }\n };\n\n return (\n <ResponsiveDialog open={open} onOpenChange={reset}>\n <ResponsiveDialogContent className=\"sm:max-w-xl\">\n <ResponsiveDialogHeader>\n <ResponsiveDialogTitle>{AI_USE_CASE_LABELS[useCase]}</ResponsiveDialogTitle>\n <ResponsiveDialogDescription>\n Runs on this product’s AI answer only from sources you can read (PUBLIC/COMMUNITY).\n Every run starts as pending editorial review — nothing is adopted automatically.\n </ResponsiveDialogDescription>\n </ResponsiveDialogHeader>\n\n {run ? (\n <div className=\"flex flex-col gap-4\">\n <p className=\"text-sm text-text-secondary\">\n Run created — it is awaiting editorial review.\n </p>\n <AiRunCard run={run} />\n </div>\n ) : (\n <div className=\"flex flex-col gap-2\">\n <Label htmlFor=\"ai-context-prompt\">Your question or instruction</Label>\n <Textarea\n id=\"ai-context-prompt\"\n value={prompt}\n onChange={(event) => setPrompt(event.target.value)}\n rows={4}\n disabled={generate.isPending}\n />\n <p className=\"text-xs text-text-tertiary\">\n Combined server-side with the grounded sources — never sent to the model alone.\n </p>\n </div>\n )}\n\n <ResponsiveDialogFooter>\n {run ? (\n <Button onClick={() => reset(false)}>Done</Button>\n ) : (\n <>\n <Button variant=\"outline\" onClick={() => reset(false)} disabled={generate.isPending}>\n Cancel\n </Button>\n <Button onClick={submit} disabled={generate.isPending || !prompt.trim()}>\n <Sparkles className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" />\n {generate.isPending ? 'Generating…' : 'Generate'}\n </Button>\n </>\n )}\n </ResponsiveDialogFooter>\n </ResponsiveDialogContent>\n </ResponsiveDialog>\n );\n}\n\n// ============================================================================\n// Run card (list item + inline review)\n// ============================================================================\n\nconst UNCERTAINTY_BADGE: Record<string, 'success' | 'warning' | 'destructive'> = {\n LOW: 'success',\n MEDIUM: 'warning',\n HIGH: 'destructive',\n};\n\nexport function AiRunCard({ run }: { run: TcpAgentRun }) {\n const review = useTcpReviewAiContext();\n const [notes, setNotes] = useState('');\n const [expanded, setExpanded] = useState(false);\n\n const decide = async (approved: boolean) => {\n try {\n await review.mutateAsync({ id: run.id, approved, reviewNotes: notes.trim() || undefined });\n notify.success(\n approved ? 'AI answer approved' : 'AI answer rejected',\n approved ? 'It is now marked as reviewed.' : 'The run stays on record as rejected.'\n );\n } catch (error) {\n notify.error('Review failed', describeError(error));\n }\n };\n\n return (\n <GlassCard treatment=\"plain\" className=\"flex flex-col gap-3 p-4\">\n <div className=\"flex flex-wrap items-center gap-1.5\">\n <StatusBadge status={run.useCase} />\n <StatusBadge status={run.reviewStatus} />\n {run.status === 'FAILED' && <StatusBadge status=\"FAILED\" />}\n {run.uncertainty && (\n <span\n className={`inline-flex items-center rounded-full px-2.5 py-0.5 text-xs font-medium ${\n UNCERTAINTY_BADGE[run.uncertainty] === 'success'\n ? 'bg-status-success-bg-subtle text-status-success-text'\n : UNCERTAINTY_BADGE[run.uncertainty] === 'destructive'\n ? 'bg-status-error-bg-subtle text-status-error-text'\n : 'bg-status-warning-bg-subtle text-status-warning-text'\n }`}\n >\n Uncertainty: {formatEnumLabel(run.uncertainty)}\n </span>\n )}\n <span className=\"ml-auto text-xs text-text-tertiary\">\n {formatRelativeTime(run.createdAt)}\n </span>\n </div>\n\n <p className=\"text-sm text-text-secondary\">\n <span className=\"font-medium text-text-primary\">Prompt: </span>\n {run.promptSummary}\n </p>\n\n {run.error && (\n <p className=\"rounded-lg bg-status-error-bg-subtle p-2 text-xs text-status-error-text\">\n {run.error}\n </p>\n )}\n\n {run.content && (\n <div>\n <button\n type=\"button\"\n onClick={() => setExpanded((value) => !value)}\n className=\"text-xs font-medium text-text-secondary underline-offset-2 hover:underline\"\n >\n {expanded ? 'Hide answer' : 'Show answer'}\n </button>\n {expanded && (\n <p className=\"mt-2 whitespace-pre-wrap rounded-lg bg-bg-sunken p-3 text-sm text-text-primary\">\n {run.content}\n </p>\n )}\n </div>\n )}\n\n {run.groundingRefs.length > 0 && (\n <div className=\"flex flex-col gap-1.5\">\n <p className=\"text-xs font-medium text-text-tertiary\">\n Grounded in ({run.groundingRefs.length} sources)\n </p>\n <ul className=\"flex flex-wrap gap-1.5\">\n {run.groundingRefs.map((ref) => (\n <li\n key={`${ref.kind}-${ref.refId}`}\n className=\"inline-flex max-w-full items-center gap-1 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs text-text-secondary\"\n title={ref.title}\n >\n <span className=\"shrink-0 font-medium\">\n {GROUNDING_KIND_LABELS[ref.kind] ?? formatEnumLabel(ref.kind)}\n </span>\n <span className=\"truncate\">{ref.title}</span>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {run.reviewStatus !== 'PENDING' && (run.reviewNotes || run.reviewedAt) && (\n <p className=\"text-xs text-text-tertiary\">\n {run.reviewStatus === 'APPROVED' ? 'Approved' : 'Rejected'}\n {run.reviewNotes ? ` — ${run.reviewNotes}` : ''}\n </p>\n )}\n\n {isPending(run) && (\n <div className=\"flex flex-col gap-2 border-t border-border-seam pt-3\">\n <Textarea\n value={notes}\n onChange={(event) => setNotes(event.target.value)}\n rows={2}\n placeholder=\"Review notes (optional)\"\n disabled={review.isPending}\n />\n <div className=\"flex gap-2\">\n <Button\n size=\"sm\"\n onClick={() => decide(true)}\n disabled={review.isPending}\n aria-label=\"Approve AI answer\"\n >\n <Check className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Approve\n </Button>\n <Button\n size=\"sm\"\n variant=\"outline\"\n onClick={() => decide(false)}\n disabled={review.isPending}\n aria-label=\"Reject AI answer\"\n >\n <X className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" /> Reject\n </Button>\n </div>\n </div>\n )}\n </GlassCard>\n );\n}\n\n// ============================================================================\n// Section: action buttons + run list for one grounding scope\n// ============================================================================\n\nexport interface AiContextSectionProps {\n /** Story-scoped use cases (SUMMARIZE_EVIDENCE, DRAFT_FRAMING_PROMPT). */\n storyId?: string;\n /** Collection-scoped use cases (SUGGEST_RELATED_TRADITIONS). */\n collectionId?: string;\n /** Oral-history use case (TRANSCRIBE_ORAL_HISTORY) — action only, no run list\n * filter exists for oral histories server-side. */\n oralHistoryId?: string;\n useCases: TcpAiUseCase[];\n title?: string;\n description?: string;\n className?: string;\n}\n\nexport function AiContextSection({\n storyId,\n collectionId,\n oralHistoryId,\n useCases,\n title = 'AI assistant',\n description = 'Citation-grounded answers from sources you can read. Every answer waits for editorial review before adoption.',\n className,\n}: AiContextSectionProps) {\n const [activeUseCase, setActiveUseCase] = useState<TcpAiUseCase | null>(null);\n // Runs are listable per story or collection; the svc has no oralHistoryId filter.\n const listable = Boolean(storyId || collectionId);\n const runsQuery = useTcpAiContextRuns({\n storyId,\n collectionId,\n pagination: { limit: 10 },\n enabled: listable,\n });\n\n const runs = listable ? (runsQuery.data?.items ?? []) : [];\n const pendingCount = runs.filter(isPending).length;\n\n return (\n <GlassCard treatment=\"plain\" className={`flex flex-col gap-4 p-5 sm:p-6 ${className ?? ''}`}>\n <div className=\"flex flex-wrap items-start justify-between gap-3\">\n <div>\n <h2 className=\"flex items-center gap-2 font-display text-xl font-semibold text-text-primary\">\n <Sparkles className=\"h-5 w-5 text-accent\" aria-hidden=\"true\" /> {title}\n {pendingCount > 0 && (\n <span className=\"rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text\">\n {pendingCount} pending\n </span>\n )}\n </h2>\n <p className=\"mt-1 text-sm text-text-secondary\">{description}</p>\n </div>\n <div className=\"flex flex-wrap gap-2\">\n {useCases.map((useCase) => (\n <Button key={useCase} variant=\"outline\" onClick={() => setActiveUseCase(useCase)}>\n <Sparkles className=\"mr-1.5 h-4 w-4\" aria-hidden=\"true\" />\n {AI_USE_CASE_LABELS[useCase]}\n </Button>\n ))}\n </div>\n </div>\n\n {listable &&\n (runsQuery.isLoading ? (\n <LoadingView label=\"Loading AI runs…\" />\n ) : runsQuery.isError ? (\n <ErrorView title=\"Could not load AI runs\" onRetry={() => runsQuery.refetch()} />\n ) : runs.length === 0 ? (\n <EmptyState\n icon={<Sparkles className=\"h-9 w-9\" />}\n title=\"No AI runs yet\"\n description=\"Run one of the actions above to draft a citation-grounded answer.\"\n />\n ) : (\n <div className=\"flex flex-col gap-3\">\n {runs.map((run) => (\n <AiRunCard key={run.id} run={run} />\n ))}\n </div>\n ))}\n\n {activeUseCase && (\n <GenerateAiContextDialog\n open\n onOpenChange={(open) => {\n if (!open) setActiveUseCase(null);\n }}\n useCase={activeUseCase}\n storyId={storyId}\n collectionId={collectionId}\n oralHistoryId={oralHistoryId}\n />\n )}\n </GlassCard>\n );\n}\n\n// ============================================================================\n// Editorial review queue (workspace-wide, StoriesPage overview)\n// ============================================================================\n\nexport function AiReviewQueue({ className }: { className?: string }) {\n const runsQuery = useTcpAiContextRuns({ pagination: { limit: 50 } });\n const items = (runsQuery.data?.items ?? []).filter(isPending);\n\n if (runsQuery.isLoading) {\n return <LoadingView label=\"Loading AI review queue…\" />;\n }\n if (runsQuery.isError) {\n return (\n <ErrorView title=\"Could not load the AI review queue\" onRetry={() => runsQuery.refetch()} />\n );\n }\n if (items.length === 0) {\n return null;\n }\n\n return (\n <GlassCard treatment=\"plain\" className={`flex flex-col gap-3 p-5 sm:p-6 ${className ?? ''}`}>\n <h2 className=\"flex items-center gap-2 font-display text-xl font-semibold text-text-primary\">\n <Sparkles className=\"h-5 w-5 text-accent\" aria-hidden=\"true\" /> AI review queue\n <span className=\"rounded-full bg-status-warning-bg-subtle px-2 py-0.5 text-xs font-medium text-status-warning-text\">\n {items.length} pending\n </span>\n </h2>\n <p className=\"text-sm text-text-secondary\">\n Generated answers awaiting an editorial decision, newest first. Approve or reject them here,\n or in place on the story or collection they belong to.\n </p>\n <div className=\"flex flex-col gap-3\">\n {items.slice(0, 5).map((run) => (\n <AiRunCard key={run.id} run={run} />\n ))}\n {items.length > 5 && (\n <p className=\"text-xs text-text-tertiary\">\n {items.length - 5} more pending — open the story or collection they belong to review\n them in place.\n </p>\n )}\n </div>\n </GlassCard>\n );\n}\n"],"mappings":";;;;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A,EAAM,SAAS,GAAE,mFAEjB;IAEF,CAAA,CAAA;;EACI;;AAEf"}
@@ -41,4 +41,6 @@ export { CreateCollectionDialog } from './CreateCollectionDialog';
41
41
  export { CreateArchiveItemDialog } from './CreateArchiveItemDialog';
42
42
  export { RecordOralHistoryDialog } from './RecordOralHistoryDialog';
43
43
  export { AddCitationDialog } from './AddCitationDialog';
44
+ export { AiContextSection, AiReviewQueue, AiRunCard, GenerateAiContextDialog, AI_USE_CASE_LABELS, } from './AiContextPanel';
45
+ export type { AiContextSectionProps, GenerateAiContextDialogProps } from './AiContextPanel';
44
46
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/theculturepost/components/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC/D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,EAAE,IAAI,EAAE,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC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BAAqB,CAAC;AAGxD,OAAO,EACL,gBAAgB,EAChB,aAAa,EACb,SAAS,EACT,uBAAuB,EACvB,kBAAkB,GACnB,MAAM,kBAAkB,CAAC;AAC1B,YAAY,EAAE,qBAAqB,EAAE,4BAA4B,EAAE,MAAM,kBAAkB,CAAC"}
@@ -29,10 +29,10 @@ import "./ArchiveItemCard.js";
29
29
  import "./OralHistoryCard.js";
30
30
  import "./CitationList.js";
31
31
  import "./SourceScanLink.js";
32
+ import "./ReplyThread.js";
32
33
  import { StatTile as p } from "./viz/StatTile.js";
33
34
  import { BarChart as m } from "./viz/BarChart.js";
34
35
  import { Donut as h } from "./viz/Donut.js";
35
- import "./ReplyThread.js";
36
36
  import { CreateStoryDialog as g } from "./CreateStoryDialog.js";
37
37
  import { CreateTopicDialog as _ } from "./CreateTopicDialog.js";
38
38
  import "./OpenDiscussionDialog.js";
@@ -40,4 +40,5 @@ import "./CreateCollectionDialog.js";
40
40
  import "./CreateArchiveItemDialog.js";
41
41
  import "./RecordOralHistoryDialog.js";
42
42
  import "./AddCitationDialog.js";
43
+ import "./AiContextPanel.js";
43
44
  export { m as BarChart, g as CreateStoryDialog, _ as CreateTopicDialog, h as Donut, n as EmptyState, r as ErrorView, o as FilterTabs, c as HistoryTimeline, u as KIND_ICON, i as LoadingView, e as PageHero, s as Pagination, a as Section, p as StatTile, t as StatusBadge, d as StoryCard, f as TopicCard, l as categoryIcon };
@@ -1,7 +1,7 @@
1
- import { useTcpAddCitation as e, useTcpAddStoryClaim as t, useTcpArchiveItem as n, useTcpArchiveItems as r, useTcpArchiveTopic as i, useTcpCitations as a, useTcpCollection as o, useTcpCollections as s, useTcpCreateArchiveItem as c, useTcpCreateCollection as l, useTcpCreateStory as u, useTcpCreateTopic as d, useTcpDiscussion as f, useTcpDiscussions as p, useTcpLinkCitationToClaim as m, useTcpLockDiscussion as h, useTcpModerateReply as g, useTcpMySavedStories as _, useTcpOpenDiscussion as v, useTcpOralHistories as y, useTcpPostReply as b, useTcpRecordOralHistory as x, useTcpRemoveStoryClaim as S, useTcpReplies as C, useTcpStories as w, useTcpStory as T, useTcpStoryClaims as E, useTcpToggleStoryBookmark as D, useTcpTopic as O, useTcpTopics as k, useTcpTransitionStory as A, useTcpUpdateStory as j, useTcpUpdateStoryClaim as M, useTcpUpdateTopic as N, useTcpVerifyCitation as P } from "./useTcpApi.js";
2
- import { useCursorPager as F } from "./useCursorPager.js";
3
- import { FILE_FOLDERS as I, uploadImageToFiles as L, useFileUrl as R } from "./useFiles.js";
4
- import { stripBasePath as z, usePageAnalytics as B } from "./usePageAnalytics.js";
5
- import { useTr as V } from "./useTr.js";
6
- import { usePendingOralHistorySync as H } from "./usePendingOralHistorySync.js";
7
- export { I as FILE_FOLDERS, z as stripBasePath, L as uploadImageToFiles, F as useCursorPager, R as useFileUrl, B as usePageAnalytics, H as usePendingOralHistorySync, e as useTcpAddCitation, t as useTcpAddStoryClaim, n as useTcpArchiveItem, r as useTcpArchiveItems, i as useTcpArchiveTopic, a as useTcpCitations, o as useTcpCollection, s as useTcpCollections, c as useTcpCreateArchiveItem, l as useTcpCreateCollection, u as useTcpCreateStory, d as useTcpCreateTopic, f as useTcpDiscussion, p as useTcpDiscussions, m as useTcpLinkCitationToClaim, h as useTcpLockDiscussion, g as useTcpModerateReply, _ as useTcpMySavedStories, v as useTcpOpenDiscussion, y as useTcpOralHistories, b as useTcpPostReply, x as useTcpRecordOralHistory, S as useTcpRemoveStoryClaim, C as useTcpReplies, w as useTcpStories, T as useTcpStory, E as useTcpStoryClaims, D as useTcpToggleStoryBookmark, O as useTcpTopic, k as useTcpTopics, A as useTcpTransitionStory, j as useTcpUpdateStory, M as useTcpUpdateStoryClaim, N as useTcpUpdateTopic, P as useTcpVerifyCitation, V as useTr };
1
+ import { useTcpAddCitation as e, useTcpAddStoryClaim as t, useTcpAiContextRuns as n, useTcpArchiveItem as r, useTcpArchiveItems as i, useTcpArchiveTopic as a, useTcpCitations as o, useTcpCollection as s, useTcpCollections as c, useTcpCreateArchiveItem as l, useTcpCreateCollection as u, useTcpCreateStory as d, useTcpCreateTopic as f, useTcpDiscussion as p, useTcpDiscussions as m, useTcpGenerateAiContext as h, useTcpLinkCitationToClaim as g, useTcpLockDiscussion as _, useTcpModerateReply as v, useTcpMySavedStories as y, useTcpOpenDiscussion as b, useTcpOralHistories as x, useTcpPostReply as S, useTcpRecordOralHistory as C, useTcpRemoveStoryClaim as w, useTcpReplies as T, useTcpReviewAiContext as E, useTcpStories as D, useTcpStory as O, useTcpStoryClaims as k, useTcpToggleStoryBookmark as A, useTcpTopic as j, useTcpTopics as M, useTcpTransitionStory as N, useTcpUpdateStory as P, useTcpUpdateStoryClaim as F, useTcpUpdateTopic as I, useTcpVerifyCitation as L } from "./useTcpApi.js";
2
+ import { useCursorPager as R } from "./useCursorPager.js";
3
+ import { FILE_FOLDERS as z, uploadImageToFiles as B, useFileUrl as V } from "./useFiles.js";
4
+ import { stripBasePath as H, usePageAnalytics as U } from "./usePageAnalytics.js";
5
+ import { useTr as W } from "./useTr.js";
6
+ import { usePendingOralHistorySync as G } from "./usePendingOralHistorySync.js";
7
+ export { z as FILE_FOLDERS, H as stripBasePath, B as uploadImageToFiles, R as useCursorPager, V as useFileUrl, U as usePageAnalytics, G as usePendingOralHistorySync, e as useTcpAddCitation, t as useTcpAddStoryClaim, n as useTcpAiContextRuns, r as useTcpArchiveItem, i as useTcpArchiveItems, a as useTcpArchiveTopic, o as useTcpCitations, s as useTcpCollection, c as useTcpCollections, l as useTcpCreateArchiveItem, u as useTcpCreateCollection, d as useTcpCreateStory, f as useTcpCreateTopic, p as useTcpDiscussion, m as useTcpDiscussions, h as useTcpGenerateAiContext, g as useTcpLinkCitationToClaim, _ as useTcpLockDiscussion, v as useTcpModerateReply, y as useTcpMySavedStories, b as useTcpOpenDiscussion, x as useTcpOralHistories, S as useTcpPostReply, C as useTcpRecordOralHistory, w as useTcpRemoveStoryClaim, T as useTcpReplies, E as useTcpReviewAiContext, D as useTcpStories, O as useTcpStory, k as useTcpStoryClaims, A as useTcpToggleStoryBookmark, j as useTcpTopic, M as useTcpTopics, N as useTcpTransitionStory, P as useTcpUpdateStory, F as useTcpUpdateStoryClaim, I as useTcpUpdateTopic, L as useTcpVerifyCitation, W as useTr };
@@ -1,4 +1,4 @@
1
- import { TcpConnection, TcpStory, TcpStoryStatus, TcpTopic, TcpTopicCategory, TcpCitation, TcpVerificationStatus, TcpDiscussion, TcpReply, TcpModerationStatus, TcpCollection, TcpArchiveItem, TcpArchiveItemKind, TcpAccessLevel, TcpOralHistory, TcpCreateStoryInput, TcpUpdateStoryInput, TcpCreateTopicInput, TcpUpdateTopicInput, TcpCreateCitationInput, TcpStoryClaim, TcpCreateStoryClaimInput, TcpUpdateStoryClaimInput, TcpCreateDiscussionInput, TcpCreateReplyInput, TcpCreateCollectionInput, TcpCreateArchiveItemInput, TcpUpdateArchiveItemInput, TcpCreateOralHistoryInput, PaginationInput } from '../types';
1
+ import { TcpConnection, TcpStory, TcpStoryStatus, TcpTopic, TcpTopicCategory, TcpCitation, TcpVerificationStatus, TcpDiscussion, TcpReply, TcpModerationStatus, TcpCollection, TcpArchiveItem, TcpArchiveItemKind, TcpAccessLevel, TcpOralHistory, TcpCreateStoryInput, TcpUpdateStoryInput, TcpCreateTopicInput, TcpUpdateTopicInput, TcpCreateCitationInput, TcpStoryClaim, TcpCreateStoryClaimInput, TcpUpdateStoryClaimInput, TcpCreateDiscussionInput, TcpCreateReplyInput, TcpCreateCollectionInput, TcpCreateArchiveItemInput, TcpUpdateArchiveItemInput, TcpCreateOralHistoryInput, TcpAgentRun, TcpGenerateAiContextInput, PaginationInput } from '../types';
2
2
 
3
3
  export interface StoryFilters {
4
4
  status?: TcpStoryStatus;
@@ -131,4 +131,24 @@ export declare const useTcpArchiveArchiveItem: () => import('@tanstack/react-que
131
131
  }, unknown>;
132
132
  export declare const useTcpOralHistories: (collectionId?: string) => import('@tanstack/react-query').UseQueryResult<TcpOralHistory[], Error>;
133
133
  export declare const useTcpRecordOralHistory: () => import('@tanstack/react-query').UseMutationResult<TcpOralHistory, Error, TcpCreateOralHistoryInput, unknown>;
134
+ export interface AiContextRunFilters {
135
+ storyId?: string;
136
+ collectionId?: string;
137
+ pagination?: PaginationInput;
138
+ /** Set false to keep the query dormant (e.g. oral-history-only scopes). */
139
+ enabled?: boolean;
140
+ }
141
+ /**
142
+ * Workspace-scoped AI context run log (most recent first). When neither
143
+ * storyId nor collectionId is given, returns the whole workspace log — the
144
+ * editorial review queue. Note the svc has no oralHistoryId filter: oral
145
+ * history runs surface under their collection.
146
+ */
147
+ export declare const useTcpAiContextRuns: (filters?: AiContextRunFilters) => import('@tanstack/react-query').UseQueryResult<TcpConnection<TcpAgentRun>, Error>;
148
+ export declare const useTcpGenerateAiContext: () => import('@tanstack/react-query').UseMutationResult<TcpAgentRun, Error, TcpGenerateAiContextInput, unknown>;
149
+ export declare const useTcpReviewAiContext: () => import('@tanstack/react-query').UseMutationResult<TcpAgentRun, Error, {
150
+ id: string;
151
+ approved: boolean;
152
+ reviewNotes?: string;
153
+ }, unknown>;
134
154
  //# sourceMappingURL=useTcpApi.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useTcpApi.d.ts","sourceRoot":"","sources":["../../../src/theculturepost/hooks/useTcpApi.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EACV,aAAa,EACb,QAAQ,EACR,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,WAAW,EACX,qBAAqB,EACrB,aAAa,EACb,QAAQ,EACR,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,wBAAwB,EACxB,yBAAyB,EACzB,yBAAyB,EACzB,yB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