@cellarnode/ui 0.195.2 → 0.197.0

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 (177) hide show
  1. package/dist/agent/activity-ledger.d.ts +28 -0
  2. package/dist/agent/activity-ledger.d.ts.map +1 -0
  3. package/dist/agent/activity-ledger.js +50 -0
  4. package/dist/agent/activity-ledger.js.map +1 -0
  5. package/dist/agent/approval-ledger.d.ts +27 -0
  6. package/dist/agent/approval-ledger.d.ts.map +1 -0
  7. package/dist/agent/approval-ledger.js +39 -0
  8. package/dist/agent/approval-ledger.js.map +1 -0
  9. package/dist/agent/composer.d.ts +27 -0
  10. package/dist/agent/composer.d.ts.map +1 -0
  11. package/dist/agent/composer.js +50 -0
  12. package/dist/agent/composer.js.map +1 -0
  13. package/dist/agent/confirm-card.d.ts +58 -0
  14. package/dist/agent/confirm-card.d.ts.map +1 -0
  15. package/dist/agent/confirm-card.js +127 -0
  16. package/dist/agent/confirm-card.js.map +1 -0
  17. package/dist/agent/confirm-guards.d.ts +36 -0
  18. package/dist/agent/confirm-guards.d.ts.map +1 -0
  19. package/dist/agent/confirm-guards.js +44 -0
  20. package/dist/agent/confirm-guards.js.map +1 -0
  21. package/dist/agent/conversation.d.ts +41 -0
  22. package/dist/agent/conversation.d.ts.map +1 -0
  23. package/dist/agent/conversation.js +77 -0
  24. package/dist/agent/conversation.js.map +1 -0
  25. package/dist/agent/copy.d.ts +5 -0
  26. package/dist/agent/copy.d.ts.map +1 -0
  27. package/dist/agent/copy.js +10 -0
  28. package/dist/agent/copy.js.map +1 -0
  29. package/dist/agent/fixtures.d.ts +20 -0
  30. package/dist/agent/fixtures.d.ts.map +1 -0
  31. package/dist/agent/fixtures.js +197 -0
  32. package/dist/agent/fixtures.js.map +1 -0
  33. package/dist/agent/index.d.ts +24 -0
  34. package/dist/agent/index.d.ts.map +1 -0
  35. package/dist/agent/index.js +24 -0
  36. package/dist/agent/index.js.map +1 -0
  37. package/dist/agent/masked-value.d.ts +20 -0
  38. package/dist/agent/masked-value.d.ts.map +1 -0
  39. package/dist/agent/masked-value.js +19 -0
  40. package/dist/agent/masked-value.js.map +1 -0
  41. package/dist/agent/message.d.ts +32 -0
  42. package/dist/agent/message.d.ts.map +1 -0
  43. package/dist/agent/message.js +47 -0
  44. package/dist/agent/message.js.map +1 -0
  45. package/dist/agent/panel-frame.d.ts +23 -0
  46. package/dist/agent/panel-frame.d.ts.map +1 -0
  47. package/dist/agent/panel-frame.js +17 -0
  48. package/dist/agent/panel-frame.js.map +1 -0
  49. package/dist/agent/readiness-checklist.d.ts +49 -0
  50. package/dist/agent/readiness-checklist.d.ts.map +1 -0
  51. package/dist/agent/readiness-checklist.js +104 -0
  52. package/dist/agent/readiness-checklist.js.map +1 -0
  53. package/dist/agent/schema.d.ts +418 -0
  54. package/dist/agent/schema.d.ts.map +1 -0
  55. package/dist/agent/schema.js +137 -0
  56. package/dist/agent/schema.js.map +1 -0
  57. package/dist/agent/states.d.ts +44 -0
  58. package/dist/agent/states.d.ts.map +1 -0
  59. package/dist/agent/states.js +70 -0
  60. package/dist/agent/states.js.map +1 -0
  61. package/dist/agent/thinking.d.ts +14 -0
  62. package/dist/agent/thinking.d.ts.map +1 -0
  63. package/dist/agent/thinking.js +12 -0
  64. package/dist/agent/thinking.js.map +1 -0
  65. package/dist/agent/thread-list.d.ts +25 -0
  66. package/dist/agent/thread-list.d.ts.map +1 -0
  67. package/dist/agent/thread-list.js +39 -0
  68. package/dist/agent/thread-list.js.map +1 -0
  69. package/dist/agent/tool-call-card.d.ts +24 -0
  70. package/dist/agent/tool-call-card.d.ts.map +1 -0
  71. package/dist/agent/tool-call-card.js +36 -0
  72. package/dist/agent/tool-call-card.js.map +1 -0
  73. package/dist/agent/ui.d.ts +13 -0
  74. package/dist/agent/ui.d.ts.map +1 -0
  75. package/dist/agent/ui.js +22 -0
  76. package/dist/agent/ui.js.map +1 -0
  77. package/dist/brand/brand-generation-context-form.js +1 -1
  78. package/dist/brand/brand-generation-context-form.js.map +1 -1
  79. package/dist/brand/brand-profile-form-lists.js +1 -1
  80. package/dist/brand/brand-profile-form-lists.js.map +1 -1
  81. package/dist/brand/brand-profile-form-people.js +1 -1
  82. package/dist/brand/brand-profile-form-people.js.map +1 -1
  83. package/dist/brand/brand-profile-form.js +1 -1
  84. package/dist/brand/brand-profile-form.js.map +1 -1
  85. package/dist/components/animated-combobox.js +5 -5
  86. package/dist/components/animated-combobox.js.map +1 -1
  87. package/dist/components/animated-select.js +1 -1
  88. package/dist/components/animated-shadcn-select.js +1 -1
  89. package/dist/components/animated-shadcn-select.js.map +1 -1
  90. package/dist/components/checkbox.js +2 -2
  91. package/dist/components/checkbox.js.map +1 -1
  92. package/dist/components/colour-picker-field.js +1 -1
  93. package/dist/components/colour-picker-field.js.map +1 -1
  94. package/dist/components/combobox.js +6 -6
  95. package/dist/components/combobox.js.map +1 -1
  96. package/dist/components/composition-editor.js +1 -1
  97. package/dist/components/composition-editor.js.map +1 -1
  98. package/dist/components/contact-person-select.js +1 -1
  99. package/dist/components/contact-person-select.js.map +1 -1
  100. package/dist/components/flagged-field-editor.js +1 -1
  101. package/dist/components/flagged-field-editor.js.map +1 -1
  102. package/dist/components/importer-picker-modal.js +1 -1
  103. package/dist/components/importer-picker-modal.js.map +1 -1
  104. package/dist/components/input.js +6 -6
  105. package/dist/components/input.js.map +1 -1
  106. package/dist/components/listbox.d.ts.map +1 -1
  107. package/dist/components/listbox.js +6 -6
  108. package/dist/components/listbox.js.map +1 -1
  109. package/dist/components/radio.js +2 -2
  110. package/dist/components/radio.js.map +1 -1
  111. package/dist/components/select.js +5 -5
  112. package/dist/components/select.js.map +1 -1
  113. package/dist/components/shadcn-button.d.ts.map +1 -1
  114. package/dist/components/shadcn-button.js +4 -1
  115. package/dist/components/shadcn-button.js.map +1 -1
  116. package/dist/components/shadcn-input.js +1 -1
  117. package/dist/components/shadcn-input.js.map +1 -1
  118. package/dist/components/shadcn-select.js +1 -1
  119. package/dist/components/shadcn-select.js.map +1 -1
  120. package/dist/components/shadcn-textarea.js +1 -1
  121. package/dist/components/shadcn-textarea.js.map +1 -1
  122. package/dist/components/textarea.js +6 -6
  123. package/dist/components/textarea.js.map +1 -1
  124. package/dist/components/variant-picker-dialog.js +2 -2
  125. package/dist/components/variant-picker-dialog.js.map +1 -1
  126. package/dist/components/year-picker.js +1 -1
  127. package/dist/components/year-picker.js.map +1 -1
  128. package/dist/fic-label/ingredient-input.js +1 -1
  129. package/dist/fic-label/ingredient-input.js.map +1 -1
  130. package/dist/markets/market-opportunities-table.js +1 -1
  131. package/dist/markets/market-opportunities-table.js.map +1 -1
  132. package/dist/mcp-connect/brand-marks.d.ts +18 -0
  133. package/dist/mcp-connect/brand-marks.d.ts.map +1 -0
  134. package/dist/mcp-connect/brand-marks.js +15 -0
  135. package/dist/mcp-connect/brand-marks.js.map +1 -0
  136. package/dist/mcp-connect/clients.d.ts +18 -0
  137. package/dist/mcp-connect/clients.d.ts.map +1 -0
  138. package/dist/mcp-connect/clients.js +15 -0
  139. package/dist/mcp-connect/clients.js.map +1 -0
  140. package/dist/mcp-connect/index.d.ts +7 -0
  141. package/dist/mcp-connect/index.d.ts.map +1 -0
  142. package/dist/mcp-connect/index.js +4 -0
  143. package/dist/mcp-connect/index.js.map +1 -0
  144. package/dist/mcp-connect/mcp-connect-panel.d.ts +87 -0
  145. package/dist/mcp-connect/mcp-connect-panel.d.ts.map +1 -0
  146. package/dist/mcp-connect/mcp-connect-panel.js +145 -0
  147. package/dist/mcp-connect/mcp-connect-panel.js.map +1 -0
  148. package/dist/offer/offer-branch-switcher.js +1 -1
  149. package/dist/offer/offer-branch-switcher.js.map +1 -1
  150. package/dist/opportunities/opportunity-filter-bar-drawer.js +2 -2
  151. package/dist/opportunities/opportunity-filter-bar-drawer.js.map +1 -1
  152. package/dist/opportunities/opportunity-filter-bar.js +2 -2
  153. package/dist/opportunities/opportunity-filter-bar.js.map +1 -1
  154. package/dist/opportunities/wizard/step-opportunities.js +4 -4
  155. package/dist/opportunities/wizard/step-opportunities.js.map +1 -1
  156. package/dist/opportunities/wizard/step-pricing-timeline.js +2 -2
  157. package/dist/opportunities/wizard/step-pricing-timeline.js.map +1 -1
  158. package/dist/opportunities/wizard/step-tender-basics.js +2 -2
  159. package/dist/opportunities/wizard/step-tender-basics.js.map +1 -1
  160. package/dist/opportunities/wizard/use-wizard-draft.d.ts +36 -0
  161. package/dist/opportunities/wizard/use-wizard-draft.d.ts.map +1 -1
  162. package/dist/opportunities/wizard/use-wizard-draft.js +220 -12
  163. package/dist/opportunities/wizard/use-wizard-draft.js.map +1 -1
  164. package/dist/org/postal-address-fields.js +1 -1
  165. package/dist/org/postal-address-fields.js.map +1 -1
  166. package/dist/portfolio-import/session/import-job.d.ts.map +1 -1
  167. package/dist/portfolio-import/session/import-job.js +2 -1
  168. package/dist/portfolio-import/session/import-job.js.map +1 -1
  169. package/dist/portfolio-import/session/list-all-confirmations.d.ts +8 -0
  170. package/dist/portfolio-import/session/list-all-confirmations.d.ts.map +1 -0
  171. package/dist/portfolio-import/session/list-all-confirmations.js +30 -0
  172. package/dist/portfolio-import/session/list-all-confirmations.js.map +1 -0
  173. package/dist/product-editor/tabs/resources/certifications-panel.js +1 -1
  174. package/dist/product-editor/tabs/resources/certifications-panel.js.map +1 -1
  175. package/dist/realtime/job-status/schemas.d.ts +2 -2
  176. package/package.json +9 -1
  177. package/src/theme/tokens.css +21 -2
@@ -0,0 +1,41 @@
1
+ import { type ReactNode } from "react";
2
+ import { type AgentComposerProps } from "./composer.js";
3
+ import { type AgentMessageProps } from "./message.js";
4
+ import type { AgentConversationStatus, AgentMessageData } from "./schema.js";
5
+ export interface AgentConversationCopy {
6
+ log: string;
7
+ newMessages: string;
8
+ announceWorking: string;
9
+ announceApproval: string;
10
+ announceDone: string;
11
+ jumpToApproval: string;
12
+ }
13
+ export interface AgentConversationProps {
14
+ messages: readonly AgentMessageData[];
15
+ status: AgentConversationStatus;
16
+ /** One-line summary while streaming. */
17
+ workingLabel?: string;
18
+ onSend: (text: string) => void;
19
+ onStop?: () => void;
20
+ onRetry?: (messageId: string) => void;
21
+ onApproval?: AgentMessageProps["onApproval"];
22
+ onRetryTool?: AgentMessageProps["onRetryTool"];
23
+ /** Action for the error banner of the current status (retry, refetch, sign in). */
24
+ onErrorAction?: () => void;
25
+ renderCard?: AgentMessageProps["renderCard"];
26
+ /** Clock override (ms since epoch) for approval expiry; stories and tests pin it. */
27
+ nowMs?: number;
28
+ emptyState?: ReactNode;
29
+ header?: ReactNode;
30
+ suggestions?: AgentComposerProps["suggestions"];
31
+ copy?: Partial<AgentConversationCopy>;
32
+ className?: string;
33
+ }
34
+ /**
35
+ * @internal The conversation surface: a `role="log"` message list that sticks to
36
+ * the bottom, one polite live region (phase-level announcements, never tokens),
37
+ * the status/error line and the composer. At most one approval is live: older
38
+ * pending ones render superseded.
39
+ */
40
+ export declare function AgentConversation(props: AgentConversationProps): import("react/jsx-runtime").JSX.Element;
41
+ //# sourceMappingURL=conversation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../src/agent/conversation.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQxD,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAGjE,OAAO,KAAK,EAAE,uBAAuB,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI1E,MAAM,WAAW,qBAAqB;IACpC,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;CACxB;AAUD,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,SAAS,gBAAgB,EAAE,CAAC;IACtC,MAAM,EAAE,uBAAuB,CAAC;IAChC,wCAAwC;IACxC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,IAAI,CAAC;IACtC,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,WAAW,CAAC,EAAE,iBAAiB,CAAC,aAAa,CAAC,CAAC;IAC/C,mFAAmF;IACnF,aAAa,CAAC,EAAE,MAAM,IAAI,CAAC;IAC3B,UAAU,CAAC,EAAE,iBAAiB,CAAC,YAAY,CAAC,CAAC;IAC7C,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,UAAU,CAAC,EAAE,SAAS,CAAC;IACvB,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,WAAW,CAAC,EAAE,kBAAkB,CAAC,aAAa,CAAC,CAAC;IAChD,IAAI,CAAC,EAAE,OAAO,CAAC,qBAAqB,CAAC,CAAC;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAUD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,2CA8H9D"}
@@ -0,0 +1,77 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo, useRef } from "react";
3
+ import { ArrowDown } from "lucide-react";
4
+ import { LiveRegion } from "../components/live-region/index.js";
5
+ import { useAnnounce } from "../components/live-region/index.js";
6
+ import { useStickToBottom } from "../chat/use-stick-to-bottom.js";
7
+ import { cn } from "../lib/utils.js";
8
+ import { supersedeStale } from "./confirm-guards.js";
9
+ import { useCopy } from "./copy.js";
10
+ import { AgentComposer } from "./composer.js";
11
+ import { AgentMessage } from "./message.js";
12
+ import { AgentError } from "./states.js";
13
+ import { AgentThinking } from "./thinking.js";
14
+ import { agentButton } from "./ui.js";
15
+ import { useEffect } from "react";
16
+ const DEFAULT_COPY = {
17
+ log: "Conversation",
18
+ newMessages: "New messages",
19
+ announceWorking: "Agent is working",
20
+ announceApproval: "Approval needed: {intent}",
21
+ announceDone: "Agent finished",
22
+ jumpToApproval: "Jump to approval",
23
+ };
24
+ const STATUS_ERROR = {
25
+ error: "generic",
26
+ interrupted: "interrupted",
27
+ authExpired: "authExpired",
28
+ capReached: "capReached",
29
+ unavailable: "unavailable",
30
+ };
31
+ /**
32
+ * @internal The conversation surface: a `role="log"` message list that sticks to
33
+ * the bottom, one polite live region (phase-level announcements, never tokens),
34
+ * the status/error line and the composer. At most one approval is live: older
35
+ * pending ones render superseded.
36
+ */
37
+ export function AgentConversation(props) {
38
+ const { messages, status, workingLabel, onSend, onStop, onRetry, onApproval, onRetryTool, onErrorAction, renderCard, nowMs, emptyState, header, suggestions, className, } = props;
39
+ const c = useCopy(DEFAULT_COPY, props.copy);
40
+ const scrollerRef = useRef(null);
41
+ const contentRef = useRef(null);
42
+ const ids = useMemo(() => messages.map((m) => m.id), [messages]);
43
+ const last = messages[messages.length - 1];
44
+ const stick = useStickToBottom({
45
+ scrollerRef,
46
+ contentRef,
47
+ ids,
48
+ lastIsOwn: last?.role === "user",
49
+ hasMessages: messages.length > 0,
50
+ });
51
+ const approvals = useMemo(() => messages.flatMap((m) => m.parts.flatMap((p) => (p.type === "approval" ? [p.approval] : []))), [messages]);
52
+ const effective = useMemo(() => supersedeStale(approvals), [approvals]);
53
+ const live = approvals.find((a) => effective.get(a.approvalId) === "pending");
54
+ const { message: announcement, seq, announce } = useAnnounce();
55
+ const prevStatusRef = useRef("idle");
56
+ useEffect(() => {
57
+ if (prevStatusRef.current === status)
58
+ return;
59
+ if (status === "streaming")
60
+ announce(c.announceWorking);
61
+ else if (status === "awaitingApproval" && live)
62
+ announce(c.announceApproval.replace("{intent}", live.intent));
63
+ else if (prevStatusRef.current === "streaming" && status === "idle")
64
+ announce(c.announceDone);
65
+ prevStatusRef.current = status;
66
+ }, [status, live, announce, c]);
67
+ const errorKind = STATUS_ERROR[status];
68
+ const running = status === "streaming";
69
+ return (_jsxs("div", { className: cn("flex min-h-0 flex-1 flex-col", className), children: [header, _jsx(LiveRegion, { message: announcement, seq: seq }), _jsxs("div", { className: "relative min-h-0 flex-1", children: [_jsx("div", { ref: scrollerRef, role: "log", "aria-label": c.log, "aria-busy": running, tabIndex: 0, className: "h-full overflow-y-auto overscroll-contain px-4 py-3 [overflow-anchor:none]", children: _jsxs("div", { ref: contentRef, className: "flex flex-col gap-4", children: [messages.length === 0
70
+ ? emptyState
71
+ : messages.map((m) => (_jsx(AgentMessage, { message: m, approvalStatus: effective, onApproval: onApproval, onRetry: onRetry, onRetryTool: onRetryTool, renderCard: renderCard, nowMs: nowMs }, m.id))), running && _jsx(AgentThinking, { label: workingLabel }), errorKind && _jsx(AgentError, { kind: errorKind, onAction: onErrorAction })] }) }), stick.hasNewBelow && (_jsxs("button", { type: "button", onClick: stick.scrollToBottom, className: cn(agentButton.quiet, "absolute right-4 bottom-3 shadow-[var(--shadow-medium)]"), children: [_jsx(ArrowDown, { "aria-hidden": true, className: "size-3.5" }), c.newMessages] }))] }), status === "awaitingApproval" && live && (_jsx("div", { className: "px-3 pt-2", children: _jsx("button", { type: "button", className: agentButton.quiet, onClick: () => {
72
+ const el = document.getElementById(`agent-approval-${live.approvalId}`);
73
+ el?.scrollIntoView({ block: "nearest" });
74
+ el?.focus();
75
+ }, children: c.jumpToApproval }) })), _jsx("div", { className: "border-t border-border/60 p-3", children: _jsx(AgentComposer, { onSubmit: onSend, onStop: onStop, running: running, approvalPending: status === "awaitingApproval", disabled: status === "authExpired" || status === "unavailable", suggestions: suggestions }) })] }));
76
+ }
77
+ //# sourceMappingURL=conversation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conversation.js","sourceRoot":"","sources":["../../src/agent/conversation.ts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oBACd,CAAC,YAEA,CAAC,CAAC,cAAc,GACV,GACL,CACP,EACD,cAAK,SAAS,EAAC,+BAA+B,YAC5C,KAAC,aAAa,IACZ,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,EAChB,eAAe,EAAE,MAAM,KAAK,kBAAkB,EAC9C,QAAQ,EAAE,MAAM,KAAK,aAAa,IAAI,MAAM,KAAK,aAAa,EAC9D,WAAW,EAAE,WAAW,GACxB,GACE,IACF,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,5 @@
1
+ /** @internal Merge a partial `copy` prop over the English defaults (every visible string is overridable for i18n). */
2
+ export declare function useCopy<T extends object>(defaults: T, override?: Partial<T>): T;
3
+ /** @internal Replace `{name}` tokens in a copy string. */
4
+ export declare function fmt(template: string, vars: Record<string, string | number>): string;
5
+ //# sourceMappingURL=copy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../src/agent/copy.ts"],"names":[],"mappings":"AAEA,sHAAsH;AACtH,wBAAgB,OAAO,CAAC,CAAC,SAAS,MAAM,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAE/E;AAED,0DAA0D;AAC1D,wBAAgB,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,GAAG,MAAM,CAEnF"}
@@ -0,0 +1,10 @@
1
+ import { useMemo } from "react";
2
+ /** @internal Merge a partial `copy` prop over the English defaults (every visible string is overridable for i18n). */
3
+ export function useCopy(defaults, override) {
4
+ return useMemo(() => ({ ...defaults, ...override }), [defaults, override]);
5
+ }
6
+ /** @internal Replace `{name}` tokens in a copy string. */
7
+ export function fmt(template, vars) {
8
+ return template.replace(/\{(\w+)\}/g, (_, k) => String(vars[k] ?? ""));
9
+ }
10
+ //# sourceMappingURL=copy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copy.js","sourceRoot":"","sources":["../../src/agent/copy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,sHAAsH;AACtH,MAAM,UAAU,OAAO,CAAmB,QAAW,EAAE,QAAqB;IAC1E,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,GAAG,QAAQ,EAAE,GAAG,QAAQ,EAAE,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,0DAA0D;AAC1D,MAAM,UAAU,GAAG,CAAC,QAAgB,EAAE,IAAqC;IACzE,OAAO,QAAQ,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC,CAAC,EAAE,CAAS,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AACjF,CAAC"}
@@ -0,0 +1,20 @@
1
+ import type { AgentApproval, AgentMessageData, AgentReadiness, AgentStep, AgentThread, AgentToolCall } from "./schema.js";
2
+ /**
3
+ * @internal Hand-written fixtures typed against the colocated schemas, shaped
4
+ * like what a reducer over AG-UI events produces. Replace with recorded A-04
5
+ * fixtures when they land; the stories do not change.
6
+ */
7
+ export declare const FIXTURE_NOW: number;
8
+ export declare const approvalRevoke: AgentApproval;
9
+ export declare const approvalPaid: AgentApproval;
10
+ export declare const approvalReversible: AgentApproval;
11
+ export declare const toolCalls: Record<AgentToolCall["status"], AgentToolCall>;
12
+ export declare const stepsRunning: AgentStep[];
13
+ export declare const stepsDone: AgentStep[];
14
+ export declare const stepsPartial: AgentStep[];
15
+ export declare const threads: AgentThread[];
16
+ export declare const messagesStreaming: AgentMessageData[];
17
+ export declare const messagesApproval: AgentMessageData[];
18
+ export declare const readinessMixed: AgentReadiness;
19
+ export declare const readinessReady: AgentReadiness;
20
+ //# sourceMappingURL=fixtures.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../src/agent/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,gBAAgB,EAChB,cAAc,EACd,SAAS,EACT,WAAW,EACX,aAAa,EACd,MAAM,UAAU,CAAC;AAElB;;;;GAIG;AACH,eAAO,MAAM,WAAW,QAAqC,CAAC;AAI9D,eAAO,MAAM,cAAc,EAAE,aAe5B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,aAc1B,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAWhC,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,MAAM,CAAC,aAAa,CAAC,QAAQ,CAAC,EAAE,aAAa,CAwBpE,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,SAAS,EAUnC,CAAC;AACF,eAAO,MAAM,SAAS,EAAE,SAAS,EAAiE,CAAC;AACnG,eAAO,MAAM,YAAY,EAAE,SAAS,EAUnC,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,WAAW,EAIhC,CAAC;AAEF,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAgB/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,EAW9C,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,cAyD5B,CAAC;AACF,eAAO,MAAM,cAAc,EAAE,cAK5B,CAAC"}
@@ -0,0 +1,197 @@
1
+ /**
2
+ * @internal Hand-written fixtures typed against the colocated schemas, shaped
3
+ * like what a reducer over AG-UI events produces. Replace with recorded A-04
4
+ * fixtures when they land; the stories do not change.
5
+ */
6
+ export const FIXTURE_NOW = Date.parse("2026-10-09T10:00:00Z");
7
+ const iso = (minutesFromNow) => new Date(FIXTURE_NOW + minutesFromNow * 60000).toISOString();
8
+ export const approvalRevoke = {
9
+ approvalId: "ap_1",
10
+ tool: "revoke_api_key",
11
+ method: "DELETE",
12
+ routeTemplate: "/admin/api-keys/{id}",
13
+ intent: "Revoke the API key cn_live_8f2a for Domaine Leroy",
14
+ changes: [
15
+ { label: "Key", before: "cn_live_8f2a", after: "revoked" },
16
+ { label: "Owner email", before: { masked: true, display: "d***@leroy.example" } },
17
+ ],
18
+ risk: "destructive",
19
+ createdAt: iso(0),
20
+ expiresAt: iso(10),
21
+ confirmPhrase: "Domaine Leroy",
22
+ status: "pending",
23
+ };
24
+ export const approvalPaid = {
25
+ approvalId: "ap_2",
26
+ tool: "start_brand_generation",
27
+ method: "POST",
28
+ routeTemplate: "/admin/orgs/{id}/brand-generation",
29
+ intent: "Generate a brand profile for tuscany-imports.example",
30
+ body: { orgId: "org_77", homepageUrl: "https://tuscany-imports.example" },
31
+ risk: "costly",
32
+ cost: { label: "Uses 1 paid crawl", capRemaining: "7 of 10 today" },
33
+ taint: { sources: ["tuscany-imports.example (web page)"] },
34
+ createdAt: iso(0),
35
+ expiresAt: iso(8),
36
+ confirmPhrase: "RUN",
37
+ status: "pending",
38
+ };
39
+ export const approvalReversible = {
40
+ approvalId: "ap_3",
41
+ tool: "update_org",
42
+ method: "PUT",
43
+ routeTemplate: "/admin/orgs/{id}",
44
+ intent: "Rename Tuscany Imports SRL to Tuscany Imports",
45
+ changes: [{ label: "Name", before: "Tuscany Imports SRL", after: "Tuscany Imports" }],
46
+ risk: "reversible",
47
+ createdAt: iso(0),
48
+ expiresAt: iso(9),
49
+ status: "pending",
50
+ };
51
+ export const toolCalls = {
52
+ pending: { id: "t1", name: "list_orgs", status: "pending", args: { search: "leroy" } },
53
+ running: { id: "t2", name: "list_orgs", status: "running", args: { search: "leroy" } },
54
+ succeeded: {
55
+ id: "t3",
56
+ name: "get_org",
57
+ status: "succeeded",
58
+ durationMs: 820,
59
+ args: { orgId: "org_77", contactEmail: { masked: true, display: "d***@leroy.example" } },
60
+ resultSummary: "1 organisation, 4 members",
61
+ },
62
+ failed: {
63
+ id: "t4",
64
+ name: "list_extraction_jobs",
65
+ status: "failed",
66
+ durationMs: 4100,
67
+ error: "The upstream API timed out.",
68
+ },
69
+ retrying: {
70
+ id: "t5",
71
+ name: "list_extraction_jobs",
72
+ status: "retrying",
73
+ args: { status: "failed" },
74
+ },
75
+ };
76
+ export const stepsRunning = [
77
+ { id: "s1", kind: "candidates", status: "done", title: "Found 3 organisations named Leroy" },
78
+ {
79
+ id: "s2",
80
+ kind: "decision",
81
+ status: "done",
82
+ title: "Picked Domaine Leroy",
83
+ detail: "Only one with an active API key",
84
+ },
85
+ { id: "s3", kind: "toolCall", status: "running", title: "Reading API keys" },
86
+ ];
87
+ export const stepsDone = stepsRunning.map((s) => ({ ...s, status: "done" }));
88
+ export const stepsPartial = [
89
+ stepsDone[0],
90
+ {
91
+ id: "s4",
92
+ kind: "toolCall",
93
+ status: "failed",
94
+ title: "Reading extraction jobs",
95
+ detail: "Timed out",
96
+ },
97
+ { id: "s5", kind: "note", status: "done", title: "Continued without job data" },
98
+ ];
99
+ export const threads = [
100
+ { id: "th1", title: "Leroy API key", updatedAt: "Today, 09:41", preview: "Revoke the API key" },
101
+ { id: "th2", title: "Stuck extraction jobs", updatedAt: "Yesterday", preview: "3 jobs failed" },
102
+ { id: "th3", title: "Tuscany Imports rename", updatedAt: "Mon", preview: "Renamed" },
103
+ ];
104
+ export const messagesStreaming = [
105
+ {
106
+ id: "m1",
107
+ role: "user",
108
+ parts: [{ type: "text", text: "Which API keys does Domaine Leroy have?" }],
109
+ },
110
+ {
111
+ id: "m2",
112
+ role: "assistant",
113
+ streaming: true,
114
+ parts: [
115
+ { type: "thinking", summary: "Looking up the organisation and its keys" },
116
+ { type: "toolCall", call: toolCalls.running },
117
+ { type: "text", text: "I found the organisation and am reading its keys" },
118
+ ],
119
+ },
120
+ ];
121
+ export const messagesApproval = [
122
+ { id: "m1", role: "user", parts: [{ type: "text", text: "Revoke Domaine Leroy's key." }] },
123
+ {
124
+ id: "m2",
125
+ role: "assistant",
126
+ parts: [
127
+ { type: "toolCall", call: toolCalls.succeeded },
128
+ { type: "text", text: "This will revoke the key. Please confirm below." },
129
+ { type: "approval", approval: approvalRevoke },
130
+ ],
131
+ },
132
+ ];
133
+ export const readinessMixed = {
134
+ variantId: "v_1",
135
+ productName: "Chianti Classico 2021",
136
+ ready: false,
137
+ completionPercent: 62,
138
+ sections: [
139
+ {
140
+ id: "basics",
141
+ label: "Basics",
142
+ gaps: [
143
+ {
144
+ path: "abv",
145
+ label: "Alcohol by volume",
146
+ reason: "Needed for matching",
147
+ severity: "blocker",
148
+ expected: { type: "number", unit: "%" },
149
+ suggestedValue: { value: "13.5", source: "label PDF", confidence: "medium" },
150
+ },
151
+ {
152
+ path: "vintage",
153
+ label: "Vintage",
154
+ reason: "Add the harvest year",
155
+ severity: "blocker",
156
+ expected: { type: "year" },
157
+ },
158
+ {
159
+ path: "closure",
160
+ label: "Closure",
161
+ reason: "Pick how it is sealed",
162
+ severity: "blocker",
163
+ allowedValues: [
164
+ { value: "cork", label: "Cork" },
165
+ { value: "screwcap", label: "Screw cap" },
166
+ ],
167
+ },
168
+ ],
169
+ },
170
+ {
171
+ id: "commercial",
172
+ label: "Commercial",
173
+ gaps: [
174
+ {
175
+ path: "price",
176
+ label: "List price",
177
+ reason: "Read as 12.00 with low confidence",
178
+ severity: "acknowledgement",
179
+ currentValue: "12.00",
180
+ },
181
+ {
182
+ path: "volume",
183
+ label: "Production volume",
184
+ reason: "Helps rank your offers",
185
+ severity: "recommendation",
186
+ },
187
+ ],
188
+ },
189
+ ],
190
+ };
191
+ export const readinessReady = {
192
+ ...readinessMixed,
193
+ ready: true,
194
+ completionPercent: 100,
195
+ sections: [],
196
+ };
197
+ //# sourceMappingURL=fixtures.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fixtures.js","sourceRoot":"","sources":["../../src/agent/fixtures.ts"],"names":[],"mappings":"AASA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC9D,MAAM,GAAG,GAAG,CAAC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GAAG,cAAc;IACjB,KAAK,EAAE,IAAI;IACX,iBAAiB,EAAE,GAAG;IACtB,QAAQ,EAAE,EAAE;CACb,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@cellarnode/ui/agent`: INTERNAL, experimental (CEL-2333).
3
+ *
4
+ * @internal Primitives for the admin agent chat and the readiness checklist.
5
+ * Consumed by admin-dashboard-v2 alone until the agent's behaviour is approved;
6
+ * not wired into any other dashboard. Pure props in, events out: components take
7
+ * already-reduced state and never fetch or write.
8
+ */
9
+ export * from "./schema.js";
10
+ export { evaluateConfirmGuards, supersedeStale, type ConfirmGuardInput, type ConfirmGuardResult, } from "./confirm-guards.js";
11
+ export { MaskedValue, type MaskedValueProps, type MaskedValueCopy } from "./masked-value.js";
12
+ export { AgentThinking, type AgentThinkingProps, type AgentThinkingCopy } from "./thinking.js";
13
+ export { AgentEmptyState, AgentError, type AgentEmptyStateProps, type AgentEmptyStateCopy, type AgentErrorProps, type AgentErrorCopy, type AgentErrorKind, } from "./states.js";
14
+ export { AgentConfirmCard, DEFAULT_CONFIRM_CARD_COPY, type AgentConfirmCardProps, type AgentConfirmCardCopy, } from "./confirm-card.js";
15
+ export { AgentApprovalLedger, type AgentApprovalLedgerProps, type AgentApprovalLedgerCopy, } from "./approval-ledger.js";
16
+ export { AgentToolCallCard, type AgentToolCallCardProps, type AgentToolCallCopy, } from "./tool-call-card.js";
17
+ export { AgentActivityLedger, type AgentActivityLedgerProps, type AgentActivityLedgerCopy, } from "./activity-ledger.js";
18
+ export { AgentComposer, type AgentComposerProps, type AgentComposerCopy } from "./composer.js";
19
+ export { AgentMessage, type AgentMessageProps, type AgentMessageCopy } from "./message.js";
20
+ export { AgentConversation, type AgentConversationProps, type AgentConversationCopy, } from "./conversation.js";
21
+ export { AgentPanelFrame, type AgentPanelFrameProps, type AgentPanelFrameCopy, } from "./panel-frame.js";
22
+ export { AgentThreadList, type AgentThreadListProps, type AgentThreadListCopy, } from "./thread-list.js";
23
+ export { AgentReadinessChecklist, type AgentReadinessChecklistProps, type AgentReadinessCopy, type ReadinessChange, type ReadinessPhase, } from "./readiness-checklist.js";
24
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,kBAAkB,GACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EACL,eAAe,EACf,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,cAAc,GACpB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,gBAAgB,EAChB,yBAAyB,EACzB,KAAK,qBAAqB,EAC1B,KAAK,oBAAoB,GAC1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,iBAAiB,GACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,KAAK,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,KAAK,gBAAgB,EAAE,MAAM,WAAW,CAAC;AACxF,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,GAC3B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,EACf,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,GACzB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,EACvB,KAAK,4BAA4B,EACjC,KAAK,kBAAkB,EACvB,KAAK,eAAe,EACpB,KAAK,cAAc,GACpB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ /**
2
+ * `@cellarnode/ui/agent`: INTERNAL, experimental (CEL-2333).
3
+ *
4
+ * @internal Primitives for the admin agent chat and the readiness checklist.
5
+ * Consumed by admin-dashboard-v2 alone until the agent's behaviour is approved;
6
+ * not wired into any other dashboard. Pure props in, events out: components take
7
+ * already-reduced state and never fetch or write.
8
+ */
9
+ export * from "./schema.js";
10
+ export { evaluateConfirmGuards, supersedeStale, } from "./confirm-guards.js";
11
+ export { MaskedValue } from "./masked-value.js";
12
+ export { AgentThinking } from "./thinking.js";
13
+ export { AgentEmptyState, AgentError, } from "./states.js";
14
+ export { AgentConfirmCard, DEFAULT_CONFIRM_CARD_COPY, } from "./confirm-card.js";
15
+ export { AgentApprovalLedger, } from "./approval-ledger.js";
16
+ export { AgentToolCallCard, } from "./tool-call-card.js";
17
+ export { AgentActivityLedger, } from "./activity-ledger.js";
18
+ export { AgentComposer } from "./composer.js";
19
+ export { AgentMessage } from "./message.js";
20
+ export { AgentConversation, } from "./conversation.js";
21
+ export { AgentPanelFrame, } from "./panel-frame.js";
22
+ export { AgentThreadList, } from "./thread-list.js";
23
+ export { AgentReadinessChecklist, } from "./readiness-checklist.js";
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,cAAc,UAAU,CAAC;AACzB,OAAO,EACL,qBAAqB,EACrB,cAAc,GAGf,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,WAAW,EAA+C,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAmD,MAAM,YAAY,CAAC;AAC5F,OAAO,EACL,eAAe,EACf,UAAU,GAMX,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,gBAAgB,EAChB,yBAAyB,GAG1B,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,mBAAmB,GAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,iBAAiB,GAGlB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,mBAAmB,GAGpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,aAAa,EAAmD,MAAM,YAAY,CAAC;AAC5F,OAAO,EAAE,YAAY,EAAiD,MAAM,WAAW,CAAC;AACxF,OAAO,EACL,iBAAiB,GAGlB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,eAAe,GAGhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,eAAe,GAGhB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,uBAAuB,GAKxB,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { type CellValue } from "./schema.js";
2
+ export interface MaskedValueCopy {
3
+ ariaLabel: string;
4
+ tooltip: string;
5
+ }
6
+ export interface MaskedValueProps {
7
+ /** `{ masked: true, display }` from the BFF. Raw text is never treated as a mask. */
8
+ value: CellValue;
9
+ copy?: Partial<MaskedValueCopy>;
10
+ /** Text for an empty string / null value. Defaults to a dash. */
11
+ empty?: string;
12
+ className?: string;
13
+ }
14
+ /**
15
+ * @internal Renders a BFF-masked value so an admin can never mistake a mask for
16
+ * data: dashed outline, mask icon, accessible name and a title tooltip. A plain
17
+ * (unmasked) value renders as ordinary text.
18
+ */
19
+ export declare function MaskedValue({ value, copy, empty, className }: MaskedValueProps): import("react/jsx-runtime").JSX.Element;
20
+ //# sourceMappingURL=masked-value.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masked-value.d.ts","sourceRoot":"","sources":["../../src/agent/masked-value.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,UAAU,CAAC;AAEpD,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,KAAK,EAAE,SAAS,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,CAAC;IAChC,iEAAiE;IACjE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,gBAAgB,2CA4B9E"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { EyeOff } from "lucide-react";
3
+ import { cn } from "../lib/utils.js";
4
+ import { useCopy } from "./copy.js";
5
+ import { isMasked } from "./schema.js";
6
+ const DEFAULT_COPY = { ariaLabel: "masked value", tooltip: "Hidden for privacy" };
7
+ /**
8
+ * @internal Renders a BFF-masked value so an admin can never mistake a mask for
9
+ * data: dashed outline, mask icon, accessible name and a title tooltip. A plain
10
+ * (unmasked) value renders as ordinary text.
11
+ */
12
+ export function MaskedValue({ value, copy, empty, className }) {
13
+ const c = useCopy(DEFAULT_COPY, copy);
14
+ if (!isMasked(value)) {
15
+ return (_jsx("span", { className: className, children: value === null || value === "" ? (_jsx("i", { className: "text-muted-foreground", children: empty ?? "-" })) : (String(value)) }));
16
+ }
17
+ return (_jsxs("span", { role: "img", "aria-label": `${c.ariaLabel}: ${value.display}`, title: c.tooltip, "data-masked": "true", className: cn("inline-flex items-center gap-1 rounded-md border border-dashed border-border bg-muted px-1.5 py-0.5 font-mono text-xs/4 text-muted-foreground", className), children: [_jsx(EyeOff, { "aria-hidden": true, className: "size-3 shrink-0" }), _jsx("span", { "aria-hidden": true, children: value.display })] }));
18
+ }
19
+ //# sourceMappingURL=masked-value.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"masked-value.js","sourceRoot":"","sources":["../../src/agent/masked-value.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,QAAQ,EAAkB,MAAM,UAAU,CAAC;AAMpD,MAAM,YAAY,GAAoB,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC;AAWnG;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAoB;IAC7E,MAAM,CAAC,GAAG,OAAO,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;IACtC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACrB,OAAO,CACL,eAAM,SAAS,EAAE,SAAS,YACvB,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC,CAAC,CAAC,CAChC,YAAG,SAAS,EAAC,uBAAuB,YAAE,KAAK,IAAI,GAAG,GAAK,CACxD,CAAC,CAAC,CAAC,CACF,MAAM,CAAC,KAAK,CAAC,CACd,GACI,CACR,CAAC;IACJ,CAAC;IACD,OAAO,CACL,gBACE,IAAI,EAAC,KAAK,gBACE,GAAG,CAAC,CAAC,SAAS,KAAK,KAAK,CAAC,OAAO,EAAE,EAC9C,KAAK,EAAE,CAAC,CAAC,OAAO,iBACJ,MAAM,EAClB,SAAS,EAAE,EAAE,CACX,+IAA+I,EAC/I,SAAS,CACV,aAED,KAAC,MAAM,yBAAa,SAAS,EAAC,iBAAiB,GAAG,EAClD,8CAAmB,KAAK,CAAC,OAAO,GAAQ,IACnC,CACR,CAAC;AACJ,CAAC"}
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from "react";
2
+ import type { AgentApproval, AgentMessageData } from "./schema.js";
3
+ export interface AgentMessageCopy {
4
+ userLabel: string;
5
+ assistantLabel: string;
6
+ stopped: string;
7
+ failed: string;
8
+ retry: string;
9
+ copy: string;
10
+ copied: string;
11
+ thinking: string;
12
+ }
13
+ export interface AgentMessageProps {
14
+ message: AgentMessageData;
15
+ /** Effective status per approval (the conversation supersedes stale pending ones). */
16
+ approvalStatus?: ReadonlyMap<string, AgentApproval["status"]>;
17
+ onApproval?: (approvalId: string, decision: "approve" | "reject", typed?: string) => void;
18
+ onRetry?: (messageId: string) => void;
19
+ onRetryTool?: (callId: string) => void;
20
+ /** Renders `card` parts (host-owned domain cards). */
21
+ renderCard?: (cardType: string, data: unknown) => ReactNode;
22
+ /** Clock override (ms since epoch) for approval expiry; stories and tests pin it. */
23
+ nowMs?: number;
24
+ copy?: Partial<AgentMessageCopy>;
25
+ className?: string;
26
+ }
27
+ /**
28
+ * @internal One message. Assistant messages are append-only (text keeps a stable
29
+ * DOM so assistive tech does not re-read), user messages are a right-aligned bubble.
30
+ */
31
+ export declare function AgentMessage({ message, approvalStatus, onApproval, onRetry, onRetryTool, renderCard, nowMs, copy, className, }: AgentMessageProps): import("react/jsx-runtime").JSX.Element;
32
+ //# sourceMappingURL=message.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../src/agent/message.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,KAAK,EAAE,aAAa,EAAE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import { RotateCw } from "lucide-react";
3
+ import { CopyButton } from "../components/copy-button.js";
4
+ import { cn } from "../lib/utils.js";
5
+ import { useCopy } from "./copy.js";
6
+ import { AgentConfirmCard } from "./confirm-card.js";
7
+ import { AgentToolCallCard } from "./tool-call-card.js";
8
+ import { agentButton } from "./ui.js";
9
+ const DEFAULT_COPY = {
10
+ userLabel: "You",
11
+ assistantLabel: "Agent",
12
+ stopped: "Stopped",
13
+ failed: "This reply failed",
14
+ retry: "Retry",
15
+ copy: "Copy reply",
16
+ copied: "Copied",
17
+ thinking: "Summary",
18
+ };
19
+ const partKey = (part, i) => `${part.type}:${i}`;
20
+ /**
21
+ * @internal One message. Assistant messages are append-only (text keeps a stable
22
+ * DOM so assistive tech does not re-read), user messages are a right-aligned bubble.
23
+ */
24
+ export function AgentMessage({ message, approvalStatus, onApproval, onRetry, onRetryTool, renderCard, nowMs, copy, className, }) {
25
+ const c = useCopy(DEFAULT_COPY, copy);
26
+ const user = message.role === "user";
27
+ const text = message.parts.flatMap((p) => (p.type === "text" ? [p.text] : [])).join("\n\n");
28
+ return (_jsxs("article", { "aria-label": user ? c.userLabel : c.assistantLabel, "data-role": message.role, className: cn("flex flex-col gap-2", user ? "items-end" : "items-stretch", className), children: [message.parts.map((part, i) => {
29
+ const key = partKey(part, i);
30
+ switch (part.type) {
31
+ case "text":
32
+ return (_jsx("p", { className: cn("whitespace-pre-wrap text-sm/6 text-foreground", user &&
33
+ "max-w-5/6 rounded-2xl rounded-br-sm bg-primary px-3.5 py-2 text-primary-foreground"), children: part.text }, key));
34
+ case "thinking":
35
+ return (_jsxs("p", { className: "text-xs/5 text-muted-foreground", children: [_jsxs("span", { className: "sr-only", children: [c.thinking, ": "] }), part.summary] }, key));
36
+ case "toolCall":
37
+ return _jsx(AgentToolCallCard, { call: part.call, onRetry: onRetryTool }, part.call.id);
38
+ case "approval": {
39
+ const status = approvalStatus?.get(part.approval.approvalId) ?? part.approval.status;
40
+ return (_jsx(AgentConfirmCard, { approval: { ...part.approval, status }, nowMs: nowMs, onDecision: (d, typed) => onApproval?.(part.approval.approvalId, d, typed) }, part.approval.approvalId));
41
+ }
42
+ case "card":
43
+ return _jsx("div", { children: renderCard?.(part.cardType, part.data) }, key);
44
+ }
45
+ }), !user && message.stopped && _jsx("p", { className: "text-xs/4 text-muted-foreground", children: c.stopped }), !user && message.failed && (_jsxs("div", { className: "flex items-center gap-2 text-xs/5 text-[var(--tone-danger-fg)]", children: [_jsx("span", { children: c.failed }), onRetry && (_jsxs("button", { type: "button", className: agentButton.ghost, onClick: () => onRetry(message.id), children: [_jsx(RotateCw, { "aria-hidden": true, className: "size-3.5" }), c.retry] }))] })), !user && !message.streaming && text && (_jsx("div", { className: "self-start", children: _jsx(CopyButton, { value: text, label: c.copy, copiedLabel: c.copied }) }))] }));
46
+ }
47
+ //# sourceMappingURL=message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"message.js","sourceRoot":"","sources":["../../src/agent/message.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAC;AAYnC,MAAM,YAAY,GAAqB;IACrC,SAAS,EAAE,KAAK;IAChB,cAAc,EAAE,OAAO;IACvB,OAAO,EAAE,SAAS;IAClB,MAAM,EAAE,mBAAmB;IAC3B,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,YAAY;IAClB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,SAAS;CACpB,CAAC;AAiBF,MAAM,OAAO,GAAG,CAAC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