@cellarnode/ui 0.203.0 → 0.206.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.
- package/README.md +25 -9
- package/dist/agent/activity-ledger.d.ts.map +1 -1
- package/dist/agent/activity-ledger.js +1 -1
- package/dist/agent/activity-ledger.js.map +1 -1
- package/dist/agent/composer.d.ts +64 -2
- package/dist/agent/composer.d.ts.map +1 -1
- package/dist/agent/composer.js +247 -9
- package/dist/agent/composer.js.map +1 -1
- package/dist/agent/confirm-card.d.ts.map +1 -1
- package/dist/agent/confirm-card.js +1 -1
- package/dist/agent/confirm-card.js.map +1 -1
- package/dist/agent/context.d.ts +94 -0
- package/dist/agent/context.d.ts.map +1 -0
- package/dist/agent/context.js +92 -0
- package/dist/agent/context.js.map +1 -0
- package/dist/agent/conversation.d.ts +41 -1
- package/dist/agent/conversation.d.ts.map +1 -1
- package/dist/agent/conversation.js +88 -5
- package/dist/agent/conversation.js.map +1 -1
- package/dist/agent/dropzone.d.ts +155 -0
- package/dist/agent/dropzone.d.ts.map +1 -0
- package/dist/agent/dropzone.js +404 -0
- package/dist/agent/dropzone.js.map +1 -0
- package/dist/agent/index.d.ts +11 -0
- package/dist/agent/index.d.ts.map +1 -1
- package/dist/agent/index.js +9 -0
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/mentions.d.ts +75 -0
- package/dist/agent/mentions.d.ts.map +1 -0
- package/dist/agent/mentions.js +184 -0
- package/dist/agent/mentions.js.map +1 -0
- package/dist/agent/message.d.ts +16 -1
- package/dist/agent/message.d.ts.map +1 -1
- package/dist/agent/message.js +26 -6
- package/dist/agent/message.js.map +1 -1
- package/dist/agent/quote-reply.d.ts +40 -0
- package/dist/agent/quote-reply.d.ts.map +1 -0
- package/dist/agent/quote-reply.js +97 -0
- package/dist/agent/quote-reply.js.map +1 -0
- package/dist/agent/role-cards/brand-profile-card.d.ts +60 -0
- package/dist/agent/role-cards/brand-profile-card.d.ts.map +1 -0
- package/dist/agent/role-cards/brand-profile-card.js +113 -0
- package/dist/agent/role-cards/brand-profile-card.js.map +1 -0
- package/dist/agent/role-cards/card-text.d.ts +10 -0
- package/dist/agent/role-cards/card-text.d.ts.map +1 -0
- package/dist/agent/role-cards/card-text.js +38 -0
- package/dist/agent/role-cards/card-text.js.map +1 -0
- package/dist/agent/role-cards/fixtures.d.ts +29 -1
- package/dist/agent/role-cards/fixtures.d.ts.map +1 -1
- package/dist/agent/role-cards/fixtures.js +210 -1
- package/dist/agent/role-cards/fixtures.js.map +1 -1
- package/dist/agent/role-cards/host-contract.d.ts +34 -4
- package/dist/agent/role-cards/host-contract.d.ts.map +1 -1
- package/dist/agent/role-cards/host-contract.js +87 -1
- package/dist/agent/role-cards/host-contract.js.map +1 -1
- package/dist/agent/role-cards/inspector-view.d.ts.map +1 -1
- package/dist/agent/role-cards/inspector-view.js +12 -0
- package/dist/agent/role-cards/inspector-view.js.map +1 -1
- package/dist/agent/role-cards/lab-report-card.d.ts +40 -0
- package/dist/agent/role-cards/lab-report-card.d.ts.map +1 -0
- package/dist/agent/role-cards/lab-report-card.js +58 -0
- package/dist/agent/role-cards/lab-report-card.js.map +1 -0
- package/dist/agent/role-cards/label-card.d.ts +42 -0
- package/dist/agent/role-cards/label-card.d.ts.map +1 -0
- package/dist/agent/role-cards/label-card.js +65 -0
- package/dist/agent/role-cards/label-card.js.map +1 -0
- package/dist/agent/role-cards/org-card.d.ts +20 -0
- package/dist/agent/role-cards/org-card.d.ts.map +1 -0
- package/dist/agent/role-cards/org-card.js +37 -0
- package/dist/agent/role-cards/org-card.js.map +1 -0
- package/dist/agent/role-cards/registry.d.ts +13 -1
- package/dist/agent/role-cards/registry.d.ts.map +1 -1
- package/dist/agent/role-cards/registry.js +33 -0
- package/dist/agent/role-cards/registry.js.map +1 -1
- package/dist/agent/role-cards/schedule-card.d.ts +30 -0
- package/dist/agent/role-cards/schedule-card.d.ts.map +1 -0
- package/dist/agent/role-cards/schedule-card.js +58 -0
- package/dist/agent/role-cards/schedule-card.js.map +1 -0
- package/dist/agent/role-cards/stats-card.d.ts +30 -0
- package/dist/agent/role-cards/stats-card.d.ts.map +1 -0
- package/dist/agent/role-cards/stats-card.js +31 -0
- package/dist/agent/role-cards/stats-card.js.map +1 -0
- package/dist/agent/schema.d.ts +18 -0
- package/dist/agent/schema.d.ts.map +1 -1
- package/dist/agent/schema.js +17 -1
- package/dist/agent/schema.js.map +1 -1
- package/dist/agent/suggestions.d.ts +66 -0
- package/dist/agent/suggestions.d.ts.map +1 -0
- package/dist/agent/suggestions.js +186 -0
- package/dist/agent/suggestions.js.map +1 -0
- package/dist/agent/text-clean.d.ts +12 -0
- package/dist/agent/text-clean.d.ts.map +1 -0
- package/dist/agent/text-clean.js +55 -0
- package/dist/agent/text-clean.js.map +1 -0
- package/dist/agent/tool-activity-model.d.ts +4 -0
- package/dist/agent/tool-activity-model.d.ts.map +1 -1
- package/dist/agent/tool-activity-model.js +7 -0
- package/dist/agent/tool-activity-model.js.map +1 -1
- package/dist/agent/tool-activity.d.ts.map +1 -1
- package/dist/agent/tool-activity.js +4 -2
- package/dist/agent/tool-activity.js.map +1 -1
- package/dist/agent/tool-call-card.d.ts.map +1 -1
- package/dist/agent/tool-call-card.js +2 -1
- package/dist/agent/tool-call-card.js.map +1 -1
- package/dist/agent/ui.d.ts +7 -0
- package/dist/agent/ui.d.ts.map +1 -1
- package/dist/agent/ui.js +7 -0
- package/dist/agent/ui.js.map +1 -1
- package/dist/animated-icons/download-icon.d.ts.map +1 -1
- package/dist/animated-icons/download-icon.js +6 -1
- package/dist/animated-icons/download-icon.js.map +1 -1
- package/dist/animated-icons/filter-icon.d.ts.map +1 -1
- package/dist/animated-icons/filter-icon.js +6 -1
- package/dist/animated-icons/filter-icon.js.map +1 -1
- package/dist/animated-icons/upload-icon.d.ts.map +1 -1
- package/dist/animated-icons/upload-icon.js +6 -1
- package/dist/animated-icons/upload-icon.js.map +1 -1
- package/dist/brand/brand-image-source-picker.d.ts.map +1 -1
- package/dist/brand/brand-image-source-picker.js +9 -6
- package/dist/brand/brand-image-source-picker.js.map +1 -1
- package/dist/brand/brand-profile-form-values.d.ts +2 -2
- package/dist/chat/chat-surface.d.ts +16 -1
- package/dist/chat/chat-surface.d.ts.map +1 -1
- package/dist/chat/chat-surface.js +18 -16
- package/dist/chat/chat-surface.js.map +1 -1
- package/dist/chat/chat-toggle-button.d.ts.map +1 -1
- package/dist/chat/chat-toggle-button.js +11 -5
- package/dist/chat/chat-toggle-button.js.map +1 -1
- package/dist/chat/index.d.ts +1 -1
- package/dist/chat/index.d.ts.map +1 -1
- package/dist/chat/index.js.map +1 -1
- package/dist/components/bottle-extract-dialog.js +1 -1
- package/dist/components/bottle-extract-dialog.js.map +1 -1
- package/dist/components/branch-overview-panel.d.ts.map +1 -1
- package/dist/components/branch-overview-panel.js +8 -4
- package/dist/components/branch-overview-panel.js.map +1 -1
- package/dist/components/branch-resolution-modal.js +1 -1
- package/dist/components/branch-resolution-modal.js.map +1 -1
- package/dist/components/card-stack.d.ts.map +1 -1
- package/dist/components/card-stack.js +9 -1
- package/dist/components/card-stack.js.map +1 -1
- package/dist/components/copy-button.d.ts.map +1 -1
- package/dist/components/copy-button.js +15 -4
- package/dist/components/copy-button.js.map +1 -1
- package/dist/components/listbox.d.ts.map +1 -1
- package/dist/components/listbox.js +5 -1
- package/dist/components/listbox.js.map +1 -1
- package/dist/components/metric-card.d.ts +1 -1
- package/dist/components/metric-card.d.ts.map +1 -1
- package/dist/components/metric-card.js +2 -2
- package/dist/components/metric-card.js.map +1 -1
- package/dist/components/shadcn-button.d.ts +1 -1
- package/dist/components/sidebar/sidebar-menu.d.ts +1 -1
- package/dist/components/toast.d.ts.map +1 -1
- package/dist/components/toast.js +1 -1
- package/dist/components/toast.js.map +1 -1
- package/dist/discovery/command-palette-trigger.d.ts.map +1 -1
- package/dist/discovery/command-palette-trigger.js +2 -2
- package/dist/discovery/command-palette-trigger.js.map +1 -1
- package/dist/globe/globe-scene-camera.d.ts.map +1 -1
- package/dist/globe/globe-scene-camera.js +5 -2
- package/dist/globe/globe-scene-camera.js.map +1 -1
- package/dist/lab-reports/upload-lab-report-dialog.d.ts.map +1 -1
- package/dist/lab-reports/upload-lab-report-dialog.js +3 -3
- package/dist/lab-reports/upload-lab-report-dialog.js.map +1 -1
- package/dist/mcp-connect/clients.d.ts +4 -2
- package/dist/mcp-connect/clients.d.ts.map +1 -1
- package/dist/mcp-connect/clients.js +5 -3
- package/dist/mcp-connect/clients.js.map +1 -1
- package/dist/mcp-connect/mcp-connect-panel.js +1 -1
- package/dist/mcp-connect/mcp-connect-panel.js.map +1 -1
- package/dist/nav/app-sidebar.d.ts +5 -0
- package/dist/nav/app-sidebar.d.ts.map +1 -1
- package/dist/nav/app-sidebar.js +5 -3
- package/dist/nav/app-sidebar.js.map +1 -1
- package/dist/nav/sidebar-footer.d.ts +3 -1
- package/dist/nav/sidebar-footer.d.ts.map +1 -1
- package/dist/nav/sidebar-footer.js +5 -3
- package/dist/nav/sidebar-footer.js.map +1 -1
- package/dist/notifications/index.d.ts +1 -1
- package/dist/notifications/index.d.ts.map +1 -1
- package/dist/notifications/index.js +1 -1
- package/dist/notifications/index.js.map +1 -1
- package/dist/notifications/notification-badge.d.ts +2 -0
- package/dist/notifications/notification-badge.d.ts.map +1 -1
- package/dist/notifications/notification-badge.js +9 -2
- package/dist/notifications/notification-badge.js.map +1 -1
- package/dist/notifications/notification-tray.d.ts.map +1 -1
- package/dist/notifications/notification-tray.js +12 -2
- package/dist/notifications/notification-tray.js.map +1 -1
- package/dist/offer/negotiation-labels.d.ts +5 -1
- package/dist/offer/negotiation-labels.d.ts.map +1 -1
- package/dist/offer/negotiation-labels.js +1 -1
- package/dist/offer/negotiation-labels.js.map +1 -1
- package/dist/offer/new-activity-pill.js +1 -1
- package/dist/offer/new-activity-pill.js.map +1 -1
- package/dist/opportunities/index.d.ts +1 -1
- package/dist/opportunities/index.d.ts.map +1 -1
- package/dist/opportunities/index.js.map +1 -1
- package/dist/opportunities/opportunity-add-to-journey-button.d.ts.map +1 -1
- package/dist/opportunities/opportunity-add-to-journey-button.js +17 -3
- package/dist/opportunities/opportunity-add-to-journey-button.js.map +1 -1
- package/dist/opportunities/opportunity-filter-bar.d.ts.map +1 -1
- package/dist/opportunities/opportunity-filter-bar.js +7 -1
- package/dist/opportunities/opportunity-filter-bar.js.map +1 -1
- package/dist/opportunities/wizard/wizard-stepper.d.ts +15 -0
- package/dist/opportunities/wizard/wizard-stepper.d.ts.map +1 -1
- package/dist/opportunities/wizard/wizard-stepper.js +17 -8
- package/dist/opportunities/wizard/wizard-stepper.js.map +1 -1
- package/dist/org/invite-member-dialog.d.ts.map +1 -1
- package/dist/org/invite-member-dialog.js +12 -1
- package/dist/org/invite-member-dialog.js.map +1 -1
- package/dist/portfolio/version-rail.d.ts.map +1 -1
- package/dist/portfolio/version-rail.js +1 -1
- package/dist/portfolio/version-rail.js.map +1 -1
- package/dist/portfolio-import/import-job-detail-view.d.ts.map +1 -1
- package/dist/portfolio-import/import-job-detail-view.js +12 -1
- package/dist/portfolio-import/import-job-detail-view.js.map +1 -1
- package/dist/portfolio-import/import-job-panels.d.ts.map +1 -1
- package/dist/portfolio-import/import-job-panels.js +13 -2
- package/dist/portfolio-import/import-job-panels.js.map +1 -1
- package/dist/portfolio-import/import-products-dialog.d.ts.map +1 -1
- package/dist/portfolio-import/import-products-dialog.js +5 -2
- package/dist/portfolio-import/import-products-dialog.js.map +1 -1
- package/dist/profile/api-keys/backend-as-metadata.fixture.d.ts +9 -0
- package/dist/profile/api-keys/backend-as-metadata.fixture.d.ts.map +1 -0
- package/dist/profile/api-keys/backend-as-metadata.fixture.js +42 -0
- package/dist/profile/api-keys/backend-as-metadata.fixture.js.map +1 -0
- package/dist/profile/api-keys/connected-apps-card.d.ts +2 -2
- package/dist/profile/api-keys/connected-apps-card.d.ts.map +1 -1
- package/dist/profile/api-keys/connected-apps-card.js +7 -3
- package/dist/profile/api-keys/connected-apps-card.js.map +1 -1
- package/dist/profile/api-keys/create-api-key-dialog.js +2 -2
- package/dist/profile/api-keys/create-api-key-dialog.js.map +1 -1
- package/dist/profile/api-keys/index.d.ts +2 -1
- package/dist/profile/api-keys/index.d.ts.map +1 -1
- package/dist/profile/api-keys/index.js +2 -1
- package/dist/profile/api-keys/index.js.map +1 -1
- package/dist/profile/api-keys/oauth-scopes.d.ts +8 -0
- package/dist/profile/api-keys/oauth-scopes.d.ts.map +1 -0
- package/dist/profile/api-keys/oauth-scopes.js +41 -0
- package/dist/profile/api-keys/oauth-scopes.js.map +1 -0
- package/dist/profile/api-keys/profile-keys-section.d.ts +6 -1
- package/dist/profile/api-keys/profile-keys-section.d.ts.map +1 -1
- package/dist/profile/api-keys/profile-keys-section.js +17 -2
- package/dist/profile/api-keys/profile-keys-section.js.map +1 -1
- package/dist/profile/api-keys/scope-list.d.ts +6 -1
- package/dist/profile/api-keys/scope-list.d.ts.map +1 -1
- package/dist/profile/api-keys/scope-list.js +10 -3
- package/dist/profile/api-keys/scope-list.js.map +1 -1
- package/dist/profile/api-keys/types.d.ts +14 -0
- package/dist/profile/api-keys/types.d.ts.map +1 -1
- package/dist/profile/api-keys/types.js +21 -0
- package/dist/profile/api-keys/types.js.map +1 -1
- package/dist/realtime/organisation-events/schemas.d.ts +2 -2
- package/package.json +7 -2
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useLayoutEffect, useRef, useState } from "react";
|
|
3
|
+
import { Reply } from "lucide-react";
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { useCopy } from "./copy.js";
|
|
6
|
+
import { cleanQuote } from "./context.js";
|
|
7
|
+
import { agentChipSolid, focusRing } from "./ui.js";
|
|
8
|
+
export const DEFAULT_QUOTE_REPLY_COPY = { reply: "Reply" };
|
|
9
|
+
/**
|
|
10
|
+
* The part of an assistant answer a quote may come from: the markdown TEXT of ONE message (`data-quotable`). Confirm cards, tool
|
|
11
|
+
* activity, host and role cards and the Copy control are not quotable, so a quote can never carry their text.
|
|
12
|
+
*/
|
|
13
|
+
function quotableOf(node, frame) {
|
|
14
|
+
const el = node instanceof Element ? node : (node?.parentElement ?? null);
|
|
15
|
+
const part = el?.closest("[data-quotable]") ?? null;
|
|
16
|
+
const article = part?.closest('[data-role="assistant"][data-message-id]') ?? null;
|
|
17
|
+
return part && article && frame.contains(article) ? part : null;
|
|
18
|
+
}
|
|
19
|
+
/** The selected text when the whole selection sits inside ONE quotable part (of the given article, when one is named). */
|
|
20
|
+
export function selectedQuote(frame, within) {
|
|
21
|
+
const s = typeof window === "undefined" ? null : window.getSelection();
|
|
22
|
+
// One range only: Firefox can hold several, and `toString()` would join text from places the person did not see together.
|
|
23
|
+
if (!s || s.rangeCount !== 1 || s.isCollapsed)
|
|
24
|
+
return null;
|
|
25
|
+
const range = s.getRangeAt(0);
|
|
26
|
+
const from = quotableOf(range.startContainer, frame);
|
|
27
|
+
const to = quotableOf(range.endContainer, frame);
|
|
28
|
+
if (!from || from !== to || (within && !within.contains(from)))
|
|
29
|
+
return null;
|
|
30
|
+
const text = cleanQuote(range.toString());
|
|
31
|
+
const id = from.closest("[data-message-id]")?.dataset.messageId;
|
|
32
|
+
return text && id ? { quote: { messageId: id, text }, range } : null;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* @internal Watches the document selection and reports the passage selected inside one answer's text, with where to draw the
|
|
36
|
+
* "Reply" chip. The passage is cleaned and cut here ({@link cleanQuote}); nothing is read from the DOM but plain selected text.
|
|
37
|
+
* Only listens while `enabled`.
|
|
38
|
+
*/
|
|
39
|
+
export function useQuoteSelection(frameRef, enabled) {
|
|
40
|
+
const [sel, setSel] = useState(null);
|
|
41
|
+
const raf = useRef(0);
|
|
42
|
+
const read = useCallback(() => {
|
|
43
|
+
const frame = frameRef.current;
|
|
44
|
+
const found = frame ? selectedQuote(frame) : null;
|
|
45
|
+
if (!frame || !found)
|
|
46
|
+
return setSel(null);
|
|
47
|
+
// (jsdom has no layout: a missing method is a zero rect)
|
|
48
|
+
const r = found.range.getBoundingClientRect?.() ?? new DOMRect();
|
|
49
|
+
const f = frame.getBoundingClientRect();
|
|
50
|
+
const rtl = getComputedStyle(frame).direction === "rtl";
|
|
51
|
+
const top = Math.max(4, r.top - f.top - 40);
|
|
52
|
+
// Anchored to the START of the selection in the writing direction; the button clamps itself to the frame once it knows its width.
|
|
53
|
+
const x = Math.max(4, rtl ? f.right - r.right : r.left - f.left);
|
|
54
|
+
setSel((prev) => prev &&
|
|
55
|
+
prev.quote.text === found.quote.text &&
|
|
56
|
+
prev.quote.messageId === found.quote.messageId &&
|
|
57
|
+
prev.top === top &&
|
|
58
|
+
prev.x === x &&
|
|
59
|
+
prev.rtl === rtl &&
|
|
60
|
+
prev.frameWidth === f.width
|
|
61
|
+
? prev
|
|
62
|
+
: { quote: found.quote, top, x, rtl, frameWidth: f.width });
|
|
63
|
+
}, [frameRef]);
|
|
64
|
+
useEffect(() => {
|
|
65
|
+
if (!enabled) {
|
|
66
|
+
setSel(null);
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
const schedule = () => {
|
|
70
|
+
cancelAnimationFrame(raf.current);
|
|
71
|
+
raf.current = requestAnimationFrame(read);
|
|
72
|
+
};
|
|
73
|
+
document.addEventListener("selectionchange", schedule);
|
|
74
|
+
window.addEventListener("resize", schedule);
|
|
75
|
+
// The chip follows the text when the log scrolls.
|
|
76
|
+
document.addEventListener("scroll", schedule, true);
|
|
77
|
+
return () => {
|
|
78
|
+
cancelAnimationFrame(raf.current);
|
|
79
|
+
document.removeEventListener("selectionchange", schedule);
|
|
80
|
+
window.removeEventListener("resize", schedule);
|
|
81
|
+
document.removeEventListener("scroll", schedule, true);
|
|
82
|
+
};
|
|
83
|
+
}, [enabled, read]);
|
|
84
|
+
return { selection: enabled ? sel : null, clear: () => setSel(null) };
|
|
85
|
+
}
|
|
86
|
+
export function AgentQuoteReplyButton({ top, x, rtl, frameWidth, onClick, copy, }) {
|
|
87
|
+
const c = useCopy(DEFAULT_QUOTE_REPLY_COPY, copy);
|
|
88
|
+
const ref = useRef(null);
|
|
89
|
+
const [width, setWidth] = useState(0);
|
|
90
|
+
// The chip's real width (it depends on the translated word), so it can be kept inside the frame at either edge.
|
|
91
|
+
useLayoutEffect(() => setWidth(ref.current?.offsetWidth ?? 0), [c.reply]);
|
|
92
|
+
const offset = Math.max(4, Math.min(x, frameWidth - width - 4));
|
|
93
|
+
return (_jsxs("button", { ref: ref, type: "button",
|
|
94
|
+
// Pressing the chip must not clear the selection it is about to quote.
|
|
95
|
+
onMouseDown: (e) => e.preventDefault(), onClick: onClick, style: { top, ...(rtl ? { right: offset } : { left: offset }) }, className: cn("agent-fade-in absolute z-10", agentChipSolid, focusRing), children: [_jsx(Reply, { "aria-hidden": true, className: "size-3.5 rtl:-scale-x-100" }), c.reply] }));
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=quote-reply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quote-reply.js","sourceRoot":"","sources":["../../src/agent/quote-reply.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAClG,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,UAAU,EAAmB,MAAM,WAAW,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAMjD,MAAM,CAAC,MAAM,wBAAwB,GAAwB,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAWhF;;;GAGG;AACH,SAAS,UAAU,CAAC,IAAiB,EAAE,KAAkB;I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AO,EAAE,OAAO,EAChB,KAAK,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,EAAE,EAC/D,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,cAAc,EAAE,SAAS,CAAC,aAEvE,KAAC,KAAK,yBAAa,SAAS,EAAC,2BAA2B,GAAG,EAC1D,CAAC,CAAC,KAAK,IACD,CACV,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { BrandProfileCardData } from "@cellarnode/agent-cards/zod4";
|
|
2
|
+
import { type AgentRoleCardHostProps } from "./card-kit.js";
|
|
3
|
+
export interface AgentBrandProfileCardCopy {
|
|
4
|
+
title: string;
|
|
5
|
+
generationTitle: string;
|
|
6
|
+
draft: string;
|
|
7
|
+
approved: string;
|
|
8
|
+
generating: string;
|
|
9
|
+
abandoned: string;
|
|
10
|
+
revision: string;
|
|
11
|
+
tone: string;
|
|
12
|
+
country: string;
|
|
13
|
+
fields: string;
|
|
14
|
+
confidence: string;
|
|
15
|
+
publicContact: string;
|
|
16
|
+
publicKeyPeople: string;
|
|
17
|
+
shown: string;
|
|
18
|
+
hidden: string;
|
|
19
|
+
images: string;
|
|
20
|
+
logo: string;
|
|
21
|
+
favicon: string;
|
|
22
|
+
banner: string;
|
|
23
|
+
ogImage: string;
|
|
24
|
+
present: string;
|
|
25
|
+
missing: string;
|
|
26
|
+
approvedOn: string;
|
|
27
|
+
scrapedNote: string;
|
|
28
|
+
/** `{done}` pages read of `{total}`. */
|
|
29
|
+
progress: string;
|
|
30
|
+
progressLabel: string;
|
|
31
|
+
phase: string;
|
|
32
|
+
outcome: string;
|
|
33
|
+
canStart: string;
|
|
34
|
+
cannotStart: string;
|
|
35
|
+
/** Why a new generation cannot start. */
|
|
36
|
+
reason: string;
|
|
37
|
+
cooldown: string;
|
|
38
|
+
activeAttempt: string;
|
|
39
|
+
retryLimit: string;
|
|
40
|
+
nextEligible: string;
|
|
41
|
+
retriesLeft: string;
|
|
42
|
+
/** The generation run's status, by the backend's code. */
|
|
43
|
+
runStatus: Record<string, string>;
|
|
44
|
+
/** The crawl step, by the backend's code. */
|
|
45
|
+
phases: Record<string, string>;
|
|
46
|
+
/** How useful the draft is, by the backend's code. */
|
|
47
|
+
outcomes: Record<string, string>;
|
|
48
|
+
}
|
|
49
|
+
export interface AgentBrandProfileCardProps extends AgentRoleCardHostProps {
|
|
50
|
+
data: BrandProfileCardData;
|
|
51
|
+
copy?: Partial<AgentBrandProfileCardCopy>;
|
|
52
|
+
/** A BCP 47 tag for the numbers. */
|
|
53
|
+
locale?: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @internal Read card for the brand profile and/or its generation run (CEL-2560). The tagline was scraped from a website, so it is
|
|
57
|
+
* quoted and marked as read-from-the-site; image URLs and the source URL are never carried, only whether each image exists.
|
|
58
|
+
*/
|
|
59
|
+
export declare function AgentBrandProfileCard({ data, copy, locale, ...host }: AgentBrandProfileCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
60
|
+
//# sourceMappingURL=brand-profile-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-profile-card.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/brand-profile-card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAQL,KAAK,sBAAsB,EAC5B,MAAM,YAAY,CAAC;AAKpB,MAAM,WAAW,yBAAyB;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAA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,IAAI,CAAC,EAAE,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAC1C,oCAAoC;IACpC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAQD;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,EAAE,0BAA0B,kDA+KhG"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { fmt, quoteText, useCopy } from "../copy.js";
|
|
3
|
+
import { AgentCardExtras, AgentCardFrame, AgentCardLink, AgentChip, AgentField, AgentFieldGrid, subjectOf, } from "./card-kit.js";
|
|
4
|
+
import { codeLabel, shortDate } from "./card-text.js";
|
|
5
|
+
import { detailAgrees } from "./host-contract.js";
|
|
6
|
+
import { cleanInline } from "./text-safety.js";
|
|
7
|
+
const DEFAULT_COPY = {
|
|
8
|
+
title: "Brand profile",
|
|
9
|
+
generationTitle: "Brand generation",
|
|
10
|
+
draft: "Draft",
|
|
11
|
+
approved: "Live",
|
|
12
|
+
generating: "Generating",
|
|
13
|
+
abandoned: "Abandoned",
|
|
14
|
+
revision: "Revision",
|
|
15
|
+
tone: "Tone",
|
|
16
|
+
country: "Country",
|
|
17
|
+
fields: "Fields read",
|
|
18
|
+
confidence: "Confidence",
|
|
19
|
+
publicContact: "Contact details",
|
|
20
|
+
publicKeyPeople: "Key people",
|
|
21
|
+
shown: "Shown publicly",
|
|
22
|
+
hidden: "Hidden",
|
|
23
|
+
images: "Images",
|
|
24
|
+
logo: "Logo",
|
|
25
|
+
favicon: "Favicon",
|
|
26
|
+
banner: "Banner",
|
|
27
|
+
ogImage: "Share image",
|
|
28
|
+
present: "{label}: added",
|
|
29
|
+
missing: "{label}: missing",
|
|
30
|
+
approvedOn: "Approved",
|
|
31
|
+
scrapedNote: "Read from the website, so it may be wrong.",
|
|
32
|
+
progress: "{done} of {total} pages",
|
|
33
|
+
progressLabel: "Pages read",
|
|
34
|
+
phase: "Step",
|
|
35
|
+
outcome: "Result",
|
|
36
|
+
canStart: "A new generation can start",
|
|
37
|
+
cannotStart: "A new generation cannot start yet",
|
|
38
|
+
reason: "Why not",
|
|
39
|
+
cooldown: "a recent useful draft",
|
|
40
|
+
activeAttempt: "one is already running",
|
|
41
|
+
retryLimit: "too many retries today",
|
|
42
|
+
nextEligible: "Next possible",
|
|
43
|
+
retriesLeft: "Retries left today",
|
|
44
|
+
runStatus: {
|
|
45
|
+
none: "No generation yet",
|
|
46
|
+
pending: "Waiting to start",
|
|
47
|
+
running: "Running",
|
|
48
|
+
completed: "Finished",
|
|
49
|
+
failed: "Failed",
|
|
50
|
+
cancelled: "Cancelled",
|
|
51
|
+
},
|
|
52
|
+
phases: {
|
|
53
|
+
mapping: "Mapping the site",
|
|
54
|
+
selecting: "Choosing pages",
|
|
55
|
+
crawling: "Reading pages",
|
|
56
|
+
consolidating: "Combining what was found",
|
|
57
|
+
finalizing: "Finishing",
|
|
58
|
+
},
|
|
59
|
+
outcomes: {
|
|
60
|
+
useful_draft: "A useful draft",
|
|
61
|
+
partial_draft: "A partial draft",
|
|
62
|
+
no_result: "Nothing usable",
|
|
63
|
+
},
|
|
64
|
+
};
|
|
65
|
+
const REASONS = {
|
|
66
|
+
cooldown: "cooldown",
|
|
67
|
+
active_attempt: "activeAttempt",
|
|
68
|
+
retry_limit: "retryLimit",
|
|
69
|
+
};
|
|
70
|
+
/**
|
|
71
|
+
* @internal Read card for the brand profile and/or its generation run (CEL-2560). The tagline was scraped from a website, so it is
|
|
72
|
+
* quoted and marked as read-from-the-site; image URLs and the source URL are never carried, only whether each image exists.
|
|
73
|
+
*/
|
|
74
|
+
export function AgentBrandProfileCard({ data, copy, locale, ...host }) {
|
|
75
|
+
const { allowLink, renderLink, maskedCopy } = host;
|
|
76
|
+
const c = useCopy(DEFAULT_COPY, copy);
|
|
77
|
+
if (!detailAgrees("BrandProfileCard", data))
|
|
78
|
+
return null;
|
|
79
|
+
const hasProfile = data.profileId !== undefined;
|
|
80
|
+
const g = data.generation;
|
|
81
|
+
const name = cleanInline(data.name, 120);
|
|
82
|
+
const status = data.status === "approved" || data.status === "live"
|
|
83
|
+
? c.approved
|
|
84
|
+
: data.status === "draft"
|
|
85
|
+
? c.draft
|
|
86
|
+
: data.status === "generating"
|
|
87
|
+
? c.generating
|
|
88
|
+
: data.status === "abandoned"
|
|
89
|
+
? c.abandoned
|
|
90
|
+
: cleanInline(data.status, 40);
|
|
91
|
+
const pct = data.confidence === undefined
|
|
92
|
+
? undefined
|
|
93
|
+
: new Intl.NumberFormat(locale, { style: "percent" }).format(data.confidence);
|
|
94
|
+
const images = data.images
|
|
95
|
+
? [
|
|
96
|
+
["logo", c.logo, data.images.logo],
|
|
97
|
+
["favicon", c.favicon, data.images.favicon],
|
|
98
|
+
["banner", c.banner, data.images.banner],
|
|
99
|
+
["ogImage", c.ogImage, data.images.ogImage],
|
|
100
|
+
]
|
|
101
|
+
: [];
|
|
102
|
+
const reasonKey = g?.reason ? REASONS[g.reason] : undefined;
|
|
103
|
+
return (_jsxs(AgentCardFrame, { title: _jsx(AgentCardLink, { path: data.link, allowLink: allowLink, renderLink: renderLink, children: hasProfile ? (name ? quoteText(name) : c.title) : c.generationTitle }), eyebrow: hasProfile ? c.title : undefined, badge: hasProfile && status ? (_jsx(AgentChip, { tone: data.status === "approved" || data.status === "live" ? "success" : "neutral", children: status })) : undefined, children: [hasProfile && (_jsxs(_Fragment, { children: [data.tagline && (_jsxs("p", { className: "text-sm/5 text-pretty", dir: "auto", children: [quoteText(cleanInline(data.tagline, 200, true)), _jsx("span", { className: "block text-xs/4 text-muted-foreground", children: c.scrapedNote })] })), _jsxs(AgentFieldGrid, { children: [_jsx(AgentField, { label: c.tone, value: cleanInline(data.tone, 40), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.country, value: cleanInline(data.country, 100), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.fields, value: data.fieldCount, maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.confidence, value: pct, maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.publicContact, value: data.publicContact === undefined
|
|
104
|
+
? undefined
|
|
105
|
+
: data.publicContact
|
|
106
|
+
? c.shown
|
|
107
|
+
: c.hidden, maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.publicKeyPeople, value: data.publicKeyPeople === undefined
|
|
108
|
+
? undefined
|
|
109
|
+
: data.publicKeyPeople
|
|
110
|
+
? c.shown
|
|
111
|
+
: c.hidden, maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.approvedOn, value: shortDate(data.approvedAt), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.revision, value: data.revision, maskedCopy: maskedCopy })] }), images.length > 0 && (_jsx("ul", { className: "flex flex-wrap gap-2", "aria-label": c.images, children: images.map(([key, label, ok]) => (_jsx("li", { children: _jsx(AgentChip, { tone: ok ? "success" : "neutral", children: fmt(ok ? c.present : c.missing, { label }) }) }, key))) }))] })), g && (_jsxs("div", { className: "flex flex-col gap-2 border-t border-border/60 pt-3 first:border-t-0 first:pt-0", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx(AgentChip, { tone: g.status === "completed" ? "success" : g.status === "failed" ? "danger" : "info", children: codeLabel(c.runStatus, g.status) }), g.canStart !== undefined && (_jsx(AgentChip, { tone: g.canStart ? "success" : "warning", children: g.canStart ? c.canStart : c.cannotStart }))] }), g.pagesTotal !== undefined && g.pagesTotal > 0 && g.pagesDone !== undefined && (_jsxs("div", { className: "flex flex-col gap-1", children: [_jsx("span", { className: "text-xs/4 text-muted-foreground", children: fmt(c.progress, { done: g.pagesDone, total: g.pagesTotal }) }), _jsx("div", { role: "progressbar", "aria-valuemin": 0, "aria-valuemax": g.pagesTotal, "aria-valuenow": Math.min(g.pagesDone, g.pagesTotal), "aria-label": c.progressLabel, className: "h-1.5 overflow-hidden rounded-full bg-muted", children: _jsx("div", { className: "h-full rounded-full bg-primary", style: { width: `${Math.min((g.pagesDone / g.pagesTotal) * 100, 100)}%` } }) })] })), _jsxs(AgentFieldGrid, { children: [_jsx(AgentField, { label: c.phase, value: codeLabel(c.phases, g.phase), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.outcome, value: codeLabel(c.outcomes, g.outcome), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.reason, value: reasonKey ? c[reasonKey] : cleanInline(g.reason, 40), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.nextEligible, value: shortDate(g.nextEligibleAt), maskedCopy: maskedCopy }), _jsx(AgentField, { label: c.retriesLeft, value: g.retriesRemainingToday, maskedCopy: maskedCopy })] })] })), _jsx(AgentCardExtras, { data: data, subject: subjectOf(data.detail), host: host })] }));
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=brand-profile-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"brand-profile-card.js","sourceRoot":"","sources":["../../../src/agent/role-cards/brand-profile-card.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,GAAG,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EACL,eAAe,EACf,cAAc,EACd,aAAa,EACb,SAAS,EACT,UAAU,EACV,cAAc,EACd,SAAS,GAEV,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAgD5C,MAAM,YAAY,GAA8B;IAC9C,KAAK,EAAE,eAAe;IACtB,eAAe,EAAE,kBAAkB;IACnC,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,YAAY;IACxB,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,IAAI,EAAE,MAAM;IACZ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,EAAE,UAAU,GACtB,EACF,KAAC,UAAU,IACT,KAAK,EAAE,CAAC,CAAC,MAAM,EACf,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,EAC3D,UAAU,EAAE,UAAU,GACtB,EACF,KAAC,UAAU,IACT,KAAK,EAAE,CAAC,CAAC,YAAY,EACrB,KAAK,EAAE,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,EAClC,UAAU,EAAE,UAAU,GACtB,EACF,KAAC,UAAU,IACT,KAAK,EAAE,CAAC,CAAC,WAAW,EACpB,KAAK,EAAE,CAAC,CAAC,qBAAqB,EAC9B,UAAU,EAAE,UAAU,GACtB,IACa,IACb,CACP,EACD,KAAC,eAAe,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,GAAI,IAC7D,CAClB,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** @internal Small text helpers the role cards share. Everything here is pure and bounded. */
|
|
2
|
+
/** A timestamp as its date ("2026-10-01T09:00:00Z" -> "2026-10-01"); anything else is cleaned and shown as it is. */
|
|
3
|
+
export declare function shortDate(raw: string | undefined): string | undefined;
|
|
4
|
+
/** A hash, shortened for reading ("sha256:0123456789ab..."): the first 12 characters. */
|
|
5
|
+
export declare function shortHash(raw: string | undefined): string | undefined;
|
|
6
|
+
/** Bytes as a short size ("118 kB", "2.4 MB"), through `Intl.NumberFormat` unit style so the unit words follow the locale. */
|
|
7
|
+
export declare function sizeText(bytes: number | undefined, locale?: string): string | undefined;
|
|
8
|
+
/** A label from a copy map for a backend code (`running`, `useful_draft`), or the cleaned code itself when the map does not know it. */
|
|
9
|
+
export declare function codeLabel(map: Readonly<Record<string, string>>, code: string | undefined, max?: number): string | undefined;
|
|
10
|
+
//# sourceMappingURL=card-text.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-text.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/card-text.ts"],"names":[],"mappings":"AAEA,8FAA8F;AAE9F,qHAAqH;AACrH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAIrE;AAED,yFAAyF;AACzF,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAGrE;AAED,8HAA8H;AAC9H,wBAAgB,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAYvF;AAED,wIAAwI;AACxI,wBAAgB,SAAS,CACvB,GAAG,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EACrC,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,GAAG,SAAK,GACP,MAAM,GAAG,SAAS,CAGpB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { cleanInline } from "./text-safety.js";
|
|
2
|
+
/** @internal Small text helpers the role cards share. Everything here is pure and bounded. */
|
|
3
|
+
/** A timestamp as its date ("2026-10-01T09:00:00Z" -> "2026-10-01"); anything else is cleaned and shown as it is. */
|
|
4
|
+
export function shortDate(raw) {
|
|
5
|
+
if (raw === undefined)
|
|
6
|
+
return undefined;
|
|
7
|
+
const m = /^(\d{4}-\d{2}-\d{2})T/.exec(raw);
|
|
8
|
+
return m ? m[1] : cleanInline(raw, 60);
|
|
9
|
+
}
|
|
10
|
+
/** A hash, shortened for reading ("sha256:0123456789ab..."): the first 12 characters. */
|
|
11
|
+
export function shortHash(raw) {
|
|
12
|
+
if (raw === undefined)
|
|
13
|
+
return undefined;
|
|
14
|
+
return raw.length > 14 ? `${raw.slice(0, 12)}...` : raw;
|
|
15
|
+
}
|
|
16
|
+
/** Bytes as a short size ("118 kB", "2.4 MB"), through `Intl.NumberFormat` unit style so the unit words follow the locale. */
|
|
17
|
+
export function sizeText(bytes, locale) {
|
|
18
|
+
if (bytes === undefined)
|
|
19
|
+
return undefined;
|
|
20
|
+
const unit = (u, n, digits) => new Intl.NumberFormat(locale, {
|
|
21
|
+
style: "unit",
|
|
22
|
+
unit: u,
|
|
23
|
+
unitDisplay: "short",
|
|
24
|
+
maximumFractionDigits: digits,
|
|
25
|
+
}).format(n);
|
|
26
|
+
if (bytes < 1024)
|
|
27
|
+
return unit("byte", bytes, 0);
|
|
28
|
+
if (bytes < 1024 * 1024)
|
|
29
|
+
return unit("kilobyte", Math.ceil(bytes / 1024), 0);
|
|
30
|
+
return unit("megabyte", bytes / (1024 * 1024), 1);
|
|
31
|
+
}
|
|
32
|
+
/** A label from a copy map for a backend code (`running`, `useful_draft`), or the cleaned code itself when the map does not know it. */
|
|
33
|
+
export function codeLabel(map, code, max = 40) {
|
|
34
|
+
if (code === undefined)
|
|
35
|
+
return undefined;
|
|
36
|
+
return Object.hasOwn(map, code) ? map[code] : cleanInline(code, max);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=card-text.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card-text.js","sourceRoot":"","sources":["../../../src/agent/role-cards/card-text.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,8FAA8F;AAE9F,qHAAqH;AACrH,MAAM,UAAU,SAAS,CAAC,GAAuB;IAC/C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACxC,MAAM,CAAC,GAAG,uBAAuB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAC5C,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,EAAE,EAAE,CAAC,CAA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AC,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;AACvE,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { DataTableData, MatchCardData, OfferCardData, OpportunityCardData, ProductCardData } from "@cellarnode/agent-cards/zod4";
|
|
2
|
+
import type { BrandProfileCardData, DataTableData, LabelCardData, LabReportCardData, MatchCardData, OfferCardData, OpportunityCardData, ScheduleCardData, OrgCardData, ProductCardData, StatsCardData } from "@cellarnode/agent-cards/zod4";
|
|
3
3
|
export declare const offerFull: OfferCardData;
|
|
4
4
|
export declare const offerMinimal: OfferCardData;
|
|
5
5
|
export declare const offerMasked: OfferCardData;
|
|
@@ -20,6 +20,34 @@ export declare const matchMid: MatchCardData;
|
|
|
20
20
|
export declare const matchDeclined: MatchCardData;
|
|
21
21
|
export declare const matchMasked: MatchCardData;
|
|
22
22
|
export declare const matchMinimal: MatchCardData;
|
|
23
|
+
export declare const scheduleActive: ScheduleCardData;
|
|
24
|
+
export declare const scheduleDrift: ScheduleCardData;
|
|
25
|
+
export declare const schedulePaused: ScheduleCardData;
|
|
26
|
+
/** The list row whose live describe failed: no drift verdict at all, the card says drift was not checked. */
|
|
27
|
+
export declare const scheduleNotDescribed: ScheduleCardData;
|
|
28
|
+
/** Paused AND drifted: both verdicts show next to the title. */
|
|
29
|
+
export declare const schedulePausedDrift: ScheduleCardData;
|
|
30
|
+
/** Drifted with no summary of which fields (the schedule's stored definition differs but the agent named none). */
|
|
31
|
+
export declare const scheduleDriftNoSummary: ScheduleCardData;
|
|
32
|
+
/** A very long id with a long drift summary: must wrap at 320 px without overflowing. */
|
|
33
|
+
export declare const scheduleLongId: ScheduleCardData;
|
|
34
|
+
export declare const scheduleMinimal: ScheduleCardData;
|
|
35
|
+
export declare const labelStale: LabelCardData;
|
|
36
|
+
export declare const labelUnchecked: LabelCardData;
|
|
37
|
+
export declare const labelFresh: LabelCardData;
|
|
38
|
+
export declare const labelUnpublished: LabelCardData;
|
|
39
|
+
export declare const labelPreview: LabelCardData;
|
|
40
|
+
export declare const labelQr: LabelCardData;
|
|
41
|
+
export declare const statsDashboard: StatsCardData;
|
|
42
|
+
export declare const statsPeriod: StatsCardData;
|
|
43
|
+
export declare const brandDraft: BrandProfileCardData;
|
|
44
|
+
export declare const brandGenerating: BrandProfileCardData;
|
|
45
|
+
export declare const brandBoth: BrandProfileCardData;
|
|
46
|
+
export declare const labReportParsed: LabReportCardData;
|
|
47
|
+
export declare const labReportLinked: LabReportCardData;
|
|
48
|
+
export declare const labReportFailed: LabReportCardData;
|
|
49
|
+
export declare const orgRole: OrgCardData;
|
|
50
|
+
export declare const orgMinimal: OrgCardData;
|
|
23
51
|
/** `get_offer_file_link`: the offer page, where the file opens. The file came from the other side of the offer. */
|
|
24
52
|
export declare const tableOfferFile: DataTableData;
|
|
25
53
|
/** `get_org_document_link`, as the producer's agent draws it. The caller's own document. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,
|
|
1
|
+
{"version":3,"file":"fixtures.d.ts","sourceRoot":"","sources":["../../../src/agent/role-cards/fixtures.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,aAAa,EACb,iBAAiB,EACjB,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,aAAa,EACd,MAAM,8BAA8B,CAAC;AAKtC,eAAO,MAAM,SAAS,EAAE,aAqCvB,CAAC;A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AW,EAAE,aAczB,CAAC;AAEF,6CAA6C;AAC7C,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OACyB,CAAC;AAW1E,4GAA4G;AAC5G,eAAO,MAAM,cAAc;;;;;;;;;;;;4CAYI;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;4CAc9C;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,OAAO,CAAA;SAAE,EAAE,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCnE,CAAC;AAEX,oFAAoF;AACpF,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAMlD,CAAC;AACF,eAAO,MAAM,kBAAkB,GAAU,MAAM,MAAM,EAAE,IAAI,MAAM,KAAG,OAAO,CAAC,OAAO,CAC1C,CAAC"}
|
|
@@ -217,6 +217,215 @@ export const matchMasked = {
|
|
|
217
217
|
actions: undefined,
|
|
218
218
|
};
|
|
219
219
|
export const matchMinimal = { matchId: "m-3", score: 0 };
|
|
220
|
+
export const scheduleActive = {
|
|
221
|
+
scheduleId: "schedules/run-due",
|
|
222
|
+
ownership: "canonical",
|
|
223
|
+
paused: false,
|
|
224
|
+
cron: "*/5 * * * *",
|
|
225
|
+
nextRun: "2026-10-14T12:05:00Z",
|
|
226
|
+
described: true,
|
|
227
|
+
drift: false,
|
|
228
|
+
link: "/temporal/schedules/schedules%252Frun-due",
|
|
229
|
+
};
|
|
230
|
+
export const scheduleDrift = {
|
|
231
|
+
...scheduleActive,
|
|
232
|
+
ownership: "operator",
|
|
233
|
+
drift: true,
|
|
234
|
+
driftSummary: "cron, paused",
|
|
235
|
+
};
|
|
236
|
+
export const schedulePaused = {
|
|
237
|
+
...scheduleActive,
|
|
238
|
+
paused: true,
|
|
239
|
+
nextRun: undefined,
|
|
240
|
+
};
|
|
241
|
+
/** The list row whose live describe failed: no drift verdict at all, the card says drift was not checked. */
|
|
242
|
+
export const scheduleNotDescribed = {
|
|
243
|
+
scheduleId: "schedules/matching-scan",
|
|
244
|
+
ownership: "canonical",
|
|
245
|
+
paused: false,
|
|
246
|
+
described: false,
|
|
247
|
+
link: "/temporal/schedules/schedules%252Fmatching-scan",
|
|
248
|
+
};
|
|
249
|
+
/** Paused AND drifted: both verdicts show next to the title. */
|
|
250
|
+
export const schedulePausedDrift = {
|
|
251
|
+
...scheduleDrift,
|
|
252
|
+
paused: true,
|
|
253
|
+
nextRun: undefined,
|
|
254
|
+
};
|
|
255
|
+
/** Drifted with no summary of which fields (the schedule's stored definition differs but the agent named none). */
|
|
256
|
+
export const scheduleDriftNoSummary = {
|
|
257
|
+
...scheduleDrift,
|
|
258
|
+
driftSummary: undefined,
|
|
259
|
+
};
|
|
260
|
+
/** A very long id with a long drift summary: must wrap at 320 px without overflowing. */
|
|
261
|
+
export const scheduleLongId = {
|
|
262
|
+
...scheduleDrift,
|
|
263
|
+
scheduleId: "schedules/organisation-wide-nightly-reconciliation-of-subscription-entitlements-and-seats-for-all-regions",
|
|
264
|
+
driftSummary: "cron, timezone, paused, catch-up window, overlap policy, task queue, workflow type",
|
|
265
|
+
link: undefined,
|
|
266
|
+
};
|
|
267
|
+
export const scheduleMinimal = {
|
|
268
|
+
scheduleId: "schedules/a",
|
|
269
|
+
paused: false,
|
|
270
|
+
described: true,
|
|
271
|
+
};
|
|
272
|
+
// ---- CEL-2560: label, stats, brand profile, lab report and organisation cards ----
|
|
273
|
+
export const labelStale = {
|
|
274
|
+
configId: "cfg-1",
|
|
275
|
+
variantId: "var-1",
|
|
276
|
+
status: "published",
|
|
277
|
+
anchor: "variant",
|
|
278
|
+
stale: "stale",
|
|
279
|
+
labelLanguage: "sv",
|
|
280
|
+
gtin: "07350053850019",
|
|
281
|
+
publishedAt: "2026-10-01T09:00:00Z",
|
|
282
|
+
version: 3,
|
|
283
|
+
hasLabReport: true,
|
|
284
|
+
hasBrandProfile: false,
|
|
285
|
+
detail: { kind: "label", id: "cfg-1" },
|
|
286
|
+
};
|
|
287
|
+
export const labelUnchecked = {
|
|
288
|
+
configId: "cfg-2",
|
|
289
|
+
status: "draft",
|
|
290
|
+
anchor: "variant",
|
|
291
|
+
stale: "unchecked",
|
|
292
|
+
labelLanguage: "en",
|
|
293
|
+
detail: { kind: "label", id: "cfg-2" },
|
|
294
|
+
};
|
|
295
|
+
export const labelFresh = {
|
|
296
|
+
configId: "cfg-3",
|
|
297
|
+
status: "published",
|
|
298
|
+
stale: "fresh",
|
|
299
|
+
publishedAt: "2026-10-12T09:00:00Z",
|
|
300
|
+
version: 5,
|
|
301
|
+
hasLabReport: true,
|
|
302
|
+
hasBrandProfile: true,
|
|
303
|
+
};
|
|
304
|
+
export const labelUnpublished = {
|
|
305
|
+
configId: "cfg-4",
|
|
306
|
+
variantId: "var-1",
|
|
307
|
+
status: "unpublished",
|
|
308
|
+
anchor: "variant",
|
|
309
|
+
stale: "fresh",
|
|
310
|
+
labelLanguage: "en",
|
|
311
|
+
detail: { kind: "label", id: "cfg-4" },
|
|
312
|
+
};
|
|
313
|
+
export const labelPreview = {
|
|
314
|
+
variantId: "var-1",
|
|
315
|
+
status: "preview",
|
|
316
|
+
preview: true,
|
|
317
|
+
version: 0,
|
|
318
|
+
contentHash: "sha256:0123456789abcdef0123",
|
|
319
|
+
};
|
|
320
|
+
export const labelQr = {
|
|
321
|
+
configId: "cfg-1",
|
|
322
|
+
qr: { format: "svg", sizeBytes: 2048 },
|
|
323
|
+
detail: { kind: "label", id: "cfg-1" },
|
|
324
|
+
};
|
|
325
|
+
export const statsDashboard = {
|
|
326
|
+
title: "Dashboard",
|
|
327
|
+
role: "producer",
|
|
328
|
+
stats: [
|
|
329
|
+
{ id: "offers-sent", label: "Offers sent", value: 12, change: "up 3 since last week" },
|
|
330
|
+
{ id: "negotiations", label: "Active negotiations", value: 4 },
|
|
331
|
+
{ id: "unread", label: "Unread notifications", value: 0 },
|
|
332
|
+
{ id: "accepted", label: "Recently accepted", value: 2 },
|
|
333
|
+
],
|
|
334
|
+
};
|
|
335
|
+
export const statsPeriod = {
|
|
336
|
+
title: "Dashboard stats",
|
|
337
|
+
period: "30d",
|
|
338
|
+
stats: [
|
|
339
|
+
{ id: "views", label: "Profile views", value: 1240, previous: 980 },
|
|
340
|
+
{ id: "offers", label: "Offers", value: 3, previous: 3 },
|
|
341
|
+
{ id: "matches", label: "Matches", value: 18, previous: 25 },
|
|
342
|
+
{ id: "first", label: "New this period", value: 7, previous: null },
|
|
343
|
+
],
|
|
344
|
+
};
|
|
345
|
+
export const brandDraft = {
|
|
346
|
+
profileId: "bp-1",
|
|
347
|
+
name: "Weingut Sonnenhang",
|
|
348
|
+
status: "draft",
|
|
349
|
+
revision: 4,
|
|
350
|
+
tagline: "Wines from the steepest slopes of the Mosel",
|
|
351
|
+
tone: "elegant",
|
|
352
|
+
country: "Germany",
|
|
353
|
+
fieldCount: 42,
|
|
354
|
+
confidence: 0.82,
|
|
355
|
+
publicContact: false,
|
|
356
|
+
publicKeyPeople: true,
|
|
357
|
+
images: { logo: true, favicon: false, banner: true, ogImage: false },
|
|
358
|
+
detail: { kind: "brand_profile", id: "bp-1" },
|
|
359
|
+
};
|
|
360
|
+
export const brandGenerating = {
|
|
361
|
+
generation: {
|
|
362
|
+
jobId: "job-1",
|
|
363
|
+
status: "running",
|
|
364
|
+
phase: "crawling",
|
|
365
|
+
pagesDone: 3,
|
|
366
|
+
pagesTotal: 8,
|
|
367
|
+
canStart: false,
|
|
368
|
+
reason: "active_attempt",
|
|
369
|
+
},
|
|
370
|
+
};
|
|
371
|
+
export const brandBoth = {
|
|
372
|
+
...brandDraft,
|
|
373
|
+
generation: {
|
|
374
|
+
jobId: "job-0",
|
|
375
|
+
status: "completed",
|
|
376
|
+
phase: "finalizing",
|
|
377
|
+
pagesDone: 8,
|
|
378
|
+
pagesTotal: 8,
|
|
379
|
+
outcome: "useful_draft",
|
|
380
|
+
canStart: false,
|
|
381
|
+
reason: "cooldown",
|
|
382
|
+
nextEligibleAt: "2026-10-22T00:00:00Z",
|
|
383
|
+
retriesRemainingToday: 5,
|
|
384
|
+
},
|
|
385
|
+
};
|
|
386
|
+
export const labReportParsed = {
|
|
387
|
+
reportId: "lr-1",
|
|
388
|
+
fileName: "analysis-riesling-2022.pdf",
|
|
389
|
+
status: "parsed",
|
|
390
|
+
mimeType: "application/pdf",
|
|
391
|
+
sizeBytes: 120345,
|
|
392
|
+
linked: false,
|
|
393
|
+
reviewed: false,
|
|
394
|
+
analyteCount: 14,
|
|
395
|
+
truncated: false,
|
|
396
|
+
parseJobStatus: "completed",
|
|
397
|
+
createdAt: "2026-10-01T09:00:00Z",
|
|
398
|
+
updatedAt: "2026-10-02T09:00:00Z",
|
|
399
|
+
detail: { kind: "lab_report", id: "lr-1" },
|
|
400
|
+
};
|
|
401
|
+
export const labReportLinked = {
|
|
402
|
+
...labReportParsed,
|
|
403
|
+
reportId: "lr-2",
|
|
404
|
+
status: "linked",
|
|
405
|
+
linked: true,
|
|
406
|
+
reviewed: true,
|
|
407
|
+
truncated: true,
|
|
408
|
+
analyteCount: 60,
|
|
409
|
+
detail: { kind: "lab_report", id: "lr-2" },
|
|
410
|
+
};
|
|
411
|
+
export const labReportFailed = {
|
|
412
|
+
reportId: "lr-3",
|
|
413
|
+
fileName: "scan.png",
|
|
414
|
+
status: "failed",
|
|
415
|
+
linked: false,
|
|
416
|
+
reviewed: false,
|
|
417
|
+
};
|
|
418
|
+
export const orgRole = {
|
|
419
|
+
name: "Weingut Sonnenhang",
|
|
420
|
+
type: "producer",
|
|
421
|
+
verified: true,
|
|
422
|
+
tier: "standard",
|
|
423
|
+
country: "Germany",
|
|
424
|
+
location: "Trier, Mosel",
|
|
425
|
+
description: "Family estate on the Mosel since 1890, farming organically on steep slate slopes.",
|
|
426
|
+
detail: { kind: "org", id: "org-1" },
|
|
427
|
+
};
|
|
428
|
+
export const orgMinimal = { name: "Boreal Imports" };
|
|
220
429
|
/**
|
|
221
430
|
* The tables the cellarnode-mcp agents emit for the link tools (`agents/src/role-result-cards.ts`, CEL-2447), as they shape them:
|
|
222
431
|
* a `link` that is the surface's own internal path, null for a field the tool did not have, a last row that says a list was cut
|
|
@@ -325,7 +534,7 @@ export const tableMasked = {
|
|
|
325
534
|
],
|
|
326
535
|
};
|
|
327
536
|
/** Paths the story and test hosts accept. */
|
|
328
|
-
export const allowFixtureLink = (path) => /^\/(offers|portfolio|opportunities|matches)(\/|$)/.test(path);
|
|
537
|
+
export const allowFixtureLink = (path) => /^\/(offers|portfolio|opportunities|matches|temporal)(\/|$)/.test(path);
|
|
329
538
|
const argsByLastSegment = (changes, id, idArg) => ({
|
|
330
539
|
[idArg]: id,
|
|
331
540
|
...Object.fromEntries(changes.map((c) => [c.path.split(".").pop(), c.after])),
|