@tangle-network/agent-app 0.55.3 → 0.55.5
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/dist/assistant/index.js +3 -3
- package/dist/{chunk-PFOJRQ3Q.js → chunk-2HEFK764.js} +2 -2
- package/dist/{chunk-QMTZUDDN.js → chunk-NDI6XDRZ.js} +3 -8
- package/dist/chunk-NDI6XDRZ.js.map +1 -0
- package/dist/{chunk-47UDWWUN.js → chunk-Y6PRDUFJ.js} +12 -3
- package/dist/chunk-Y6PRDUFJ.js.map +1 -0
- package/dist/web-react/index.js +9 -5
- package/dist/web-react/work-product.d.ts +10 -0
- package/dist/web-react/workspace-switcher.d.ts +4 -3
- package/dist/work-product-react/index.js +18 -18
- package/dist/work-product-react/index.js.map +1 -1
- package/dist/workspace-react/index.js +2 -2
- package/dist/workspace-react/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-47UDWWUN.js.map +0 -1
- package/dist/chunk-QMTZUDDN.js.map +0 -1
- /package/dist/{chunk-PFOJRQ3Q.js.map → chunk-2HEFK764.js.map} +0 -0
package/dist/assistant/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chatToolCallPart
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-2HEFK764.js";
|
|
4
4
|
import "../chunk-X374TCDT.js";
|
|
5
5
|
import "../chunk-3HUFJ5LO.js";
|
|
6
6
|
import "../chunk-E4AY62T2.js";
|
|
7
7
|
import "../chunk-FBVLEGEG.js";
|
|
8
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-Y6PRDUFJ.js";
|
|
9
9
|
import "../chunk-GEYACSFW.js";
|
|
10
10
|
import {
|
|
11
11
|
ChatComposer
|
|
12
12
|
} from "../chunk-7NEO73ZY.js";
|
|
13
13
|
import "../chunk-L7MB2LLM.js";
|
|
14
|
-
import "../chunk-
|
|
14
|
+
import "../chunk-NDI6XDRZ.js";
|
|
15
15
|
import "../chunk-2WELYICW.js";
|
|
16
16
|
import "../chunk-AUA75YFF.js";
|
|
17
17
|
import {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
import {
|
|
11
11
|
WorkProductCard,
|
|
12
12
|
workProductPartsFromMessageParts
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Y6PRDUFJ.js";
|
|
14
14
|
import {
|
|
15
15
|
joinClasses
|
|
16
16
|
} from "./chunk-L7MB2LLM.js";
|
|
@@ -7491,4 +7491,4 @@ export {
|
|
|
7491
7491
|
useThinkingSeconds,
|
|
7492
7492
|
ChatMessages
|
|
7493
7493
|
};
|
|
7494
|
-
//# sourceMappingURL=chunk-
|
|
7494
|
+
//# sourceMappingURL=chunk-2HEFK764.js.map
|
|
@@ -9,6 +9,7 @@ import {
|
|
|
9
9
|
|
|
10
10
|
// src/web-react/workspace-switcher.tsx
|
|
11
11
|
import { useCallback, useState } from "react";
|
|
12
|
+
import { IconTile } from "@tangle-network/ui/primitives";
|
|
12
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
function WorkspaceSwitcher({
|
|
14
15
|
items,
|
|
@@ -108,17 +109,11 @@ function WorkspaceSwitcher({
|
|
|
108
109
|
] });
|
|
109
110
|
}
|
|
110
111
|
function WorkspaceInitial({ name, size = "sm" }) {
|
|
111
|
-
|
|
112
|
-
const box = size === "lg" ? "h-10 w-10 rounded-lg text-base" : "h-6 w-6 rounded-md text-xs";
|
|
113
|
-
return (
|
|
114
|
-
// The letter is foreground on an accent tint, not accent on accent: a dim
|
|
115
|
-
// dark-theme primary (physim's aubergine) left a primary letter unreadable.
|
|
116
|
-
/* @__PURE__ */ jsx("span", { "aria-hidden": true, className: `flex shrink-0 items-center justify-center bg-primary/15 font-semibold text-foreground ring-1 ring-inset ring-primary/20 ${box}`, children: letter })
|
|
117
|
-
);
|
|
112
|
+
return /* @__PURE__ */ jsx(IconTile, { name: name.trim() || "?", size });
|
|
118
113
|
}
|
|
119
114
|
|
|
120
115
|
export {
|
|
121
116
|
WorkspaceSwitcher,
|
|
122
117
|
WorkspaceInitial
|
|
123
118
|
};
|
|
124
|
-
//# sourceMappingURL=chunk-
|
|
119
|
+
//# sourceMappingURL=chunk-NDI6XDRZ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-react/workspace-switcher.tsx"],"sourcesContent":["import { useCallback, useState, type ReactNode } from 'react'\nimport { IconTile } from '@tangle-network/ui/primitives'\nimport { CheckGlyph, OVERLAY_SHADOW, PopoverSurface } from './controls'\nimport { usePopoverDialog } from './popover-dialog'\n\nexport interface WorkspaceSwitcherItem {\n id: string\n name: string\n /** Host-provided presentation; never used to resolve identity. */\n icon?: ReactNode\n}\nexport interface WorkspaceSwitcherProps {\n items: readonly WorkspaceSwitcherItem[]\n value: string | null | undefined\n onChange: (id: string) => void\n label?: string\n placeholder?: string\n searchLabel?: string\n emptyLabel?: string\n collapsed?: boolean\n variant?: 'inline' | 'block'\n /** Product-owned creation/navigation actions. No new data or route owner. */\n footer?: ReactNode\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\n/** Searchable workspace/client/project selection, shared across all workspace shells. */\nexport function WorkspaceSwitcher({\n items, value, onChange, label = 'Switch workspace', placeholder = 'Select workspace',\n searchLabel = 'Search workspaces', emptyLabel = 'No workspaces available',\n collapsed = false, variant = 'block', footer, open: controlledOpen, onOpenChange,\n}: WorkspaceSwitcherProps) {\n const [localOpen, setLocalOpen] = useState(false)\n const [query, setQuery] = useState('')\n const open = controlledOpen ?? localOpen\n const changeOpen = useCallback((next: boolean) => {\n setLocalOpen(next)\n if (!next) setQuery('')\n onOpenChange?.(next)\n }, [onOpenChange])\n const { containerRef, triggerRef, panelRef, triggerProps, id } = usePopoverDialog(open, changeOpen)\n const current = items.find((item) => item.id === value)\n const search = query.trim().toLocaleLowerCase()\n const visible = search ? items.filter((item) => item.name.toLocaleLowerCase().includes(search)) : items\n const mark = (item?: WorkspaceSwitcherItem) => item?.icon ?? <WorkspaceInitial name={item?.name ?? ''} />\n return (\n <div ref={containerRef} className={`min-w-0 ${variant === 'block' ? 'w-full' : 'inline-flex'}`}>\n <button type=\"button\" {...triggerProps} onClick={() => changeOpen(!open)}\n aria-label={`${label}: ${current?.name ?? placeholder}`} title={current?.name ?? placeholder}\n className={`flex min-h-10 min-w-0 items-center gap-2 rounded-lg text-left text-sm text-foreground transition-colors hover:bg-muted ${collapsed ? 'w-10 justify-center' : variant === 'block' ? 'w-full border border-border px-2 py-1.5' : 'max-w-[16rem] px-2.5 py-1.5'}`}>\n {mark(current)}\n {!collapsed && <><span className=\"min-w-0 flex-1 truncate font-medium\">{current?.name ?? placeholder}</span><svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\"><path d=\"m8 9 4-4 4 4m-8 6 4 4 4-4\" /></svg></>}\n </button>\n <PopoverSurface open={open} id={id} role=\"dialog\" aria-label={label} triggerRef={triggerRef} panelRef={panelRef}\n contentKey={`${query}:${items.length}`} className={`w-80 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-card-edge bg-popover p-2 text-foreground ${OVERLAY_SHADOW}`}>\n <input data-autofocus aria-label={searchLabel} placeholder={searchLabel} value={query} onChange={(event) => setQuery(event.target.value)}\n className=\"mb-2 h-10 w-full rounded-lg border border-border bg-background px-3 text-sm text-foreground\" />\n <div className=\"max-h-64 overflow-y-auto\">\n {visible.map((item) => (\n <button key={item.id} type=\"button\" aria-current={item.id === value ? 'true' : undefined}\n className=\"flex min-h-10 w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm hover:bg-muted\"\n onClick={() => { onChange(item.id); changeOpen(false); triggerRef.current?.focus() }}>\n {mark(item)}<span className=\"min-w-0 flex-1 break-words\">{item.name}</span>\n {item.id === value && <CheckGlyph className=\"h-4 w-4 shrink-0 text-primary\" />}\n </button>\n ))}\n {visible.length === 0 && <p className=\"p-3 text-sm text-muted-foreground\" role=\"status\">{items.length === 0 ? emptyLabel : 'No matches. Try another search.'}</p>}\n </div>\n {footer != null && <div className=\"mt-2 border-t border-border pt-2\">{footer}</div>}\n </PopoverSurface>\n </div>\n )\n}\n\n/**\n * The one workspace avatar: ui's IconTile with the workspace's initials on a\n * categorical tone derived from its name. The switchers and the listing all\n * use it, so a client gets the same mark and colour wherever it appears, and\n * two clients side by side are told apart by more than their first letter.\n */\nexport function WorkspaceInitial({ name, size = 'sm' }: { name: string; size?: 'sm' | 'lg' }) {\n return <IconTile name={name.trim() || '?'} size={size} />\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,aAAa,gBAAgC;AACtD,SAAS,gBAAgB;AA4CsC,SAOxC,UAPwC,KAOxC,YAPwC;AAjBxD,SAAS,kBAAkB;AAAA,EAChC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAU,QAAQ;AAAA,EAAoB,cAAc;AAAA,EAClE,cAAc;AAAA,EAAqB,aAAa;AAAA,EAChD,YAAY;AAAA,EAAO,UAAU;AAAA,EAAS;AAAA,EAAQ,MAAM;AAAA,EAAgB;AACtE,GAA2B;AACzB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,OAAO,kBAAkB;AAC/B,QAAM,aAAa,YAAY,CAAC,SAAkB;AAChD,iBAAa,IAAI;AACjB,QAAI,CAAC,KAAM,UAAS,EAAE;AACtB,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,YAAY,CAAC;AACjB,QAAM,EAAE,cAAc,YAAY,UAAU,cAAc,GAAG,IAAI,iBAAiB,MAAM,UAAU;AAClG,QAAM,UAAU,MAAM,KAAK,CAAC,SAAS,KAAK,OAAO,KAAK;AACtD,QAAM,SAAS,MAAM,KAAK,EAAE,kBAAkB;AAC9C,QAAM,UAAU,SAAS,MAAM,OAAO,CAAC,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,SACZ;AAAA,cAAC;AAAA;AAAA,gBAAqB,MAAK;AAAA,gBAAS,gBAAc,KAAK,OAAO,QAAQ,SAAS;AAAA,gBAC7E,WAAU;AAAA,gBACV,SAAS,MAAM;AAAE,2BAAS,KAAK,EAAE;AAAG,6BAAW,KAAK;AAAG,6BAAW,SAAS,MAAM;AAAA,gBAAE;AAAA,gBAClF;AAAA,uBAAK,IAAI;AAAA,kBAAE,oBAAC,UAAK,WAAU,8BAA8B,eAAK,MAAK;AAAA,kBACnE,KAAK,OAAO,SAAS,oBAAC,cAAW,WAAU,iCAAgC;AAAA;AAAA;AAAA,cAJjE,KAAK;AAAA,YAKlB,CACD;AAAA,YACA,QAAQ,WAAW,KAAK,oBAAC,OAAE,WAAU,qCAAoC,MAAK,UAAU,gBAAM,WAAW,IAAI,aAAa,mCAAkC;AAAA,aAC/J;AAAA,UACC,UAAU,QAAQ,oBAAC,SAAI,WAAU,oCAAoC,kBAAO;AAAA;AAAA;AAAA,IAC/E;AAAA,KACF;AAEJ;AAQO,SAAS,iBAAiB,EAAE,MAAM,OAAO,KAAK,GAAyC;AAC5F,SAAO,oBAAC,YAAS,MAAM,KAAK,KAAK,KAAK,KAAK,MAAY;AACzD;","names":[]}
|
|
@@ -49,8 +49,15 @@ function workProductStatusLabel(status) {
|
|
|
49
49
|
function StatePill({ state }) {
|
|
50
50
|
return /* @__PURE__ */ jsx(StatusPill, { tone: STATE_TONES[state], children: STATE_LABELS[state] });
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
52
|
+
function workProductStatusTone(status) {
|
|
53
|
+
return STATUS_TONES[status];
|
|
54
|
+
}
|
|
55
|
+
function WorkProductStatusPill({
|
|
56
|
+
status,
|
|
57
|
+
size,
|
|
58
|
+
className
|
|
59
|
+
}) {
|
|
60
|
+
return /* @__PURE__ */ jsx(StatusPill, { tone: STATUS_TONES[status], size, className, children: STATUS_LABELS[status] });
|
|
54
61
|
}
|
|
55
62
|
function workProductPartsFromMessageParts(parts) {
|
|
56
63
|
if (!parts) return [];
|
|
@@ -333,6 +340,8 @@ function ProvenanceStamp({ provenance, backtest, className }) {
|
|
|
333
340
|
|
|
334
341
|
export {
|
|
335
342
|
workProductStatusLabel,
|
|
343
|
+
workProductStatusTone,
|
|
344
|
+
WorkProductStatusPill,
|
|
336
345
|
workProductPartsFromMessageParts,
|
|
337
346
|
WorkProductCard,
|
|
338
347
|
mergeReviewQueuePages,
|
|
@@ -342,4 +351,4 @@ export {
|
|
|
342
351
|
QualityCheckList,
|
|
343
352
|
ProvenanceStamp
|
|
344
353
|
};
|
|
345
|
-
//# sourceMappingURL=chunk-
|
|
354
|
+
//# sourceMappingURL=chunk-Y6PRDUFJ.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/web-react/work-product.tsx"],"sourcesContent":["/**\n * Work-product review surfaces — the sandbox-ui-FREE half of the vertical:\n *\n * - {@link ReviewQueuePanel}: the practice/matters/campaign review queue over\n * a `fetchQueue(cursor)` data port (the `AgentActivityPanel` shape).\n * - {@link WorkProductCard}: the persisted `type:'work_product'` transcript\n * anchor rendered inside `ChatMessages` — chat stays the driver surface.\n * - {@link EvidenceLineageTable}: target → claim → source rows with\n * click-through via an injected `resolveSourceUrl` (the\n * `MessageAttachments.resolveFileUrl` pattern).\n * - {@link ExceptionList} / {@link QualityCheckList}: severity-badged\n * exception rows and pass/fail check rows.\n * - {@link ProvenanceStamp}: profileHash prefix + runId + serving-model\n * chips + the optional backtest slot (\"182 cases · composite 0.81 ·\n * trust PASS\" — or \"quality: unverified\" when the trust gate failed).\n *\n * Anything hosting sandbox-ui (DiffView, CodeView, PillTabs) lives in\n * `./work-product-react` instead — this module must stay importable without\n * the optional sandbox-ui peer.\n */\n\nimport { useCallback, useEffect, useState } from 'react'\nimport { StatusPill, type StatusTone } from '@tangle-network/ui/primitives'\n\nimport {\n parseReviewQueueItem,\n type ReviewQueueItem,\n type ReviewQueueState,\n} from '../work-product/queue'\nimport type {\n EvidenceEntry,\n ExceptionEntry,\n ProfileBacktestSummary,\n QualityCheck,\n WorkProductPersistedPart,\n WorkProductProvenance,\n WorkProductStatus,\n} from '../work-product/types'\nimport { persistedPartToWorkProduct } from '../work-product/types'\n\nexport { parseReviewQueueItem }\nexport type { ReviewQueueItem, ReviewQueueState }\n\n// ── shared presentation vocabulary ────────────────────────────────────────\n\nconst STATE_LABELS: Record<ReviewQueueState, string> = {\n intake: 'Intake',\n missing_info: 'Missing info',\n working: 'Working',\n ready_for_review: 'Ready for review',\n changes_requested: 'Changes requested',\n approved: 'Approved',\n blocked: 'Blocked',\n}\n\n// Tones are ui's StatusPill vocabulary, so a queue state carries the same glyph\n// and colour as every other status in the product. Warning is \"needs a person\";\n// working is still moving (an open ring).\nconst STATE_TONES: Record<ReviewQueueState, StatusTone> = {\n intake: 'neutral',\n missing_info: 'warning',\n working: 'running',\n ready_for_review: 'success',\n changes_requested: 'warning',\n approved: 'success',\n blocked: 'danger',\n}\n\nconst STATUS_LABELS: Record<WorkProductStatus, string> = {\n draft: 'Draft',\n blocked: 'Blocked',\n ready: 'Ready for review',\n changes_requested: 'Changes requested',\n approved: 'Approved',\n superseded: 'Superseded',\n}\n\n// A draft is not yet a state anyone acts on, so it is neutral rather than the\n// brand accent it used to borrow.\nconst STATUS_TONES: Record<WorkProductStatus, StatusTone> = {\n draft: 'neutral',\n blocked: 'danger',\n ready: 'success',\n changes_requested: 'warning',\n approved: 'success',\n superseded: 'neutral',\n}\n\n/** Human label for a work-product status. */\nexport function workProductStatusLabel(status: WorkProductStatus): string {\n return STATUS_LABELS[status]\n}\n\nfunction StatePill({ state }: { state: ReviewQueueState }) {\n return <StatusPill tone={STATE_TONES[state]}>{STATE_LABELS[state]}</StatusPill>\n}\n\n/** StatusPill tone for a work-product status. */\nexport function workProductStatusTone(status: WorkProductStatus): StatusTone {\n return STATUS_TONES[status]\n}\n\n/** A work-product status as a StatusPill: the one rendering of this state, so\n * a product's review page and the transcript card never disagree on it. */\nexport function WorkProductStatusPill({\n status,\n size,\n className,\n}: {\n status: WorkProductStatus\n size?: 'sm' | 'md'\n className?: string\n}) {\n return (\n <StatusPill tone={STATUS_TONES[status]} size={size} className={className}>\n {STATUS_LABELS[status]}\n </StatusPill>\n )\n}\n\n// ── transcript anchor helpers + card ──────────────────────────────────────\n\n/** Every persisted work-product anchor on one message, re-validated. */\nexport function workProductPartsFromMessageParts(\n parts: ReadonlyArray<Record<string, unknown>> | null | undefined,\n): WorkProductPersistedPart[] {\n if (!parts) return []\n const out: WorkProductPersistedPart[] = []\n for (const part of parts) {\n const typed = persistedPartToWorkProduct(part)\n if (typed) out.push(typed)\n }\n return out\n}\n\n/** Properties for the transcript anchor card rendered in chat */\nexport interface WorkProductCardProps {\n part: WorkProductPersistedPart\n /** Open the work product (queue detail / pane) — the card's only action. */\n onOpen?: (part: WorkProductPersistedPart) => void\n className?: string\n}\n\n/** The chat transcript anchor card for one work-product version — a compact,\n * system-authored pointer, not a parallel review surface. */\nexport function WorkProductCard({ part, onOpen, className }: WorkProductCardProps) {\n return (\n <div\n className={`flex items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 ${className ?? ''}`}\n data-work-product-id={part.ref.id}\n >\n <span className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14 2 14 8 20 8\" />\n <path d=\"m9 15 2 2 4-4\" />\n </svg>\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-semibold text-foreground\">{part.title}</p>\n <p className=\"text-xs text-muted-foreground\">\n {part.kind && <span className=\"font-mono\">{part.kind}</span>}\n {part.kind && ' · '}v{part.ref.version}\n </p>\n </div>\n <WorkProductStatusPill status={part.status} />\n {onOpen && (\n <button\n type=\"button\"\n onClick={() => onOpen(part)}\n className=\"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground transition hover:bg-accent\"\n >\n Review\n </button>\n )}\n </div>\n )\n}\n\n// ── review queue panel ────────────────────────────────────────────────────\n\n/** One fetched page of queue items with an optional continuation cursor */\nexport interface ReviewQueuePage {\n items: ReviewQueueItem[]\n /** Opaque continuation token; absent ⇒ no further pages. */\n nextCursor?: string\n}\n\n/** Properties for the review queue panel over a fetch data port */\nexport interface ReviewQueuePanelProps {\n /** Data port — fetch one page of queue items (the projection's output,\n * re-validated here at the JSON boundary). */\n fetchQueue: (cursor?: string) => Promise<ReviewQueuePage>\n /** Open one queue item (navigate to its thread / detail pane). */\n onSelect?: (item: ReviewQueueItem) => void\n title?: string\n emptyLabel?: string\n className?: string\n}\n\n/** Merge a fetched page into held rows: dedupe by scopeKey, incoming wins,\n * newest updatedAt first. Exported for tests. */\nexport function mergeReviewQueuePages(existing: ReviewQueueItem[], incoming: ReviewQueueItem[]): ReviewQueueItem[] {\n const byScope = new Map<string, ReviewQueueItem>()\n for (const item of existing) byScope.set(item.scopeKey, item)\n for (const item of incoming) byScope.set(item.scopeKey, item)\n return [...byScope.values()].sort((a, b) => b.updatedAt - a.updatedAt)\n}\n\n/** The workspace review queue — cursor-paged, refreshable, selection via\n * callback. States, counts, and provenance render from the projection; the\n * panel holds no domain logic. */\nexport function ReviewQueuePanel({\n fetchQueue,\n onSelect,\n title = 'Review queue',\n emptyLabel = 'Nothing awaiting review.',\n className,\n}: ReviewQueuePanelProps) {\n const [items, setItems] = useState<ReviewQueueItem[]>([])\n const [cursor, setCursor] = useState<string | undefined>(undefined)\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const load = useCallback(\n async (from?: string) => {\n setLoading(true)\n setError(null)\n try {\n const page = await fetchQueue(from)\n const validated = page.items\n .map((item) => parseReviewQueueItem(item))\n .filter((item): item is ReviewQueueItem => item !== null)\n setItems((prev) => mergeReviewQueuePages(from === undefined ? [] : prev, validated))\n setCursor(page.nextCursor)\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n } finally {\n setLoading(false)\n }\n },\n [fetchQueue],\n )\n\n useEffect(() => {\n void load()\n }, [load])\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n <div className=\"flex items-center gap-2\">\n <h2 className=\"flex-1 text-sm font-semibold\">{title}</h2>\n <button\n type=\"button\"\n onClick={() => void load()}\n disabled={loading}\n aria-label=\"Refresh\"\n className=\"rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground disabled:opacity-50\"\n >\n <svg viewBox=\"0 0 24 24\" className={`h-3.5 w-3.5 ${loading ? 'animate-spin' : ''}`} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M21 12a9 9 0 1 1-2.64-6.36\" />\n <polyline points=\"21 3 21 9 15 9\" />\n </svg>\n </button>\n </div>\n {error && <p className=\"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive\">{error}</p>}\n {!error && items.length === 0 && !loading && (\n <p className=\"rounded-md border border-dashed border-border px-3 py-4 text-center text-xs text-muted-foreground\">{emptyLabel}</p>\n )}\n {/* The queue renders neither rows nor the empty copy while `loading`, so\n the announcement is the only thing a screen reader has during the wait.\n Kept mounted with changing text: an inserted live region that already\n carries its message is not reliably announced. */}\n <span role=\"status\" aria-live=\"polite\" aria-busy={loading} className=\"sr-only\">\n {loading ? 'Loading review queue…' : ''}\n </span>\n <ul className=\"space-y-1.5\" aria-busy={loading}>\n {items.map((item) => (\n <li key={item.scopeKey}>\n <button\n type=\"button\"\n onClick={() => onSelect?.(item)}\n className=\"flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition hover:border-primary/40 hover:bg-accent\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">\n {item.workProduct?.title ?? item.scopeKey}\n {item.workProduct && <span className=\"ml-1.5 text-xs text-muted-foreground\">v{item.workProduct.version}</span>}\n </p>\n <p className=\"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground\">\n {item.workProduct?.kind && <span className=\"font-mono\">{item.workProduct.kind}</span>}\n {item.pendingAsk && <span>asks: {item.pendingAsk.title}</span>}\n {item.blockingExceptions > 0 && (\n <span className=\"text-destructive\">{item.blockingExceptions} blocking</span>\n )}\n {item.failedChecks > 0 && <span className=\"text-warning\">{item.failedChecks} failed checks</span>}\n {item.provenance && item.provenance.profileHash && (\n <span className=\"font-mono\">{item.provenance.profileHash.slice(0, 8)}</span>\n )}\n </p>\n </div>\n <StatePill state={item.state} />\n </button>\n </li>\n ))}\n </ul>\n {cursor && (\n <button\n type=\"button\"\n onClick={() => void load(cursor)}\n disabled={loading}\n className=\"w-full rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition hover:bg-accent disabled:opacity-50\"\n >\n Load more\n </button>\n )}\n </div>\n )\n}\n\n// ── evidence lineage table ────────────────────────────────────────────────\n\n/** Properties for the evidence lineage table with source click-through */\nexport interface EvidenceLineageTableProps {\n evidence: readonly EvidenceEntry[]\n /** Resolve one entry's source document to an openable URL (signed\n * object-store/vault download) — the `resolveFileUrl` pattern. Absent →\n * sources render as plain refs without links. */\n resolveSourceUrl?: (entry: EvidenceEntry) => string\n className?: string\n}\n\nfunction locatorLabel(entry: EvidenceEntry): string | null {\n const parts: string[] = []\n if (entry.locator.page !== undefined) parts.push(`p.${entry.locator.page}`)\n if (entry.locator.range) parts.push(entry.locator.range)\n return parts.length ? parts.join(' · ') : null\n}\n\n/** Target → claim → source lineage rows: the \"every material value traceable\n * to source evidence\" surface. Each row names the artifact target, the\n * claim, and the source document location supporting it. */\nexport function EvidenceLineageTable({ evidence, resolveSourceUrl, className }: EvidenceLineageTableProps) {\n if (evidence.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No evidence recorded.</p>\n }\n return (\n <div className={`overflow-x-auto ${className ?? ''}`}>\n <table className=\"w-full border-collapse text-left text-sm\">\n <thead>\n <tr className=\"border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground\">\n <th className=\"py-1.5 pr-3 font-medium\">Target</th>\n <th className=\"py-1.5 pr-3 font-medium\">Claim</th>\n <th className=\"py-1.5 font-medium\">Source</th>\n </tr>\n </thead>\n <tbody>\n {evidence.map((entry) => {\n const url = resolveSourceUrl?.(entry)\n const locator = locatorLabel(entry)\n return (\n <tr key={entry.id} className=\"border-b border-border align-top\">\n <td className=\"py-2 pr-3 font-mono text-xs text-foreground\">{entry.target}</td>\n <td className=\"py-2 pr-3 text-sm leading-snug text-foreground\">\n {entry.claim}\n {entry.locator.quote && (\n // The basis is what a reviewer weighs, so it has to be\n // visible per row, not only in the aggregate check detail.\n // A platform-sliced quote came out of the document's own\n // bytes; a model-typed one was proved to occur but was\n // transcribed. Same text, different strength of evidence.\n <span\n className={`mt-0.5 block border-l-2 pl-2 text-xs italic ${\n entry.locator.quoteBasis === 'span'\n ? 'border-primary/60 text-foreground'\n : 'border-border text-muted-foreground'\n }`}\n title={\n entry.locator.quoteBasis === 'span'\n ? 'Sliced from the source document by the platform'\n : entry.locator.quoteBasis === 'model'\n ? 'Quoted by the agent, verified to occur in the source'\n : 'Unverified quote'\n }\n >\n “{entry.locator.quote}”\n {entry.locator.quoteBasis && (\n <span className=\"ml-1.5 align-middle text-xs not-italic uppercase tracking-[0.05em] text-muted-foreground\">\n {entry.locator.quoteBasis === 'span' ? 'from source' : 'verified'}\n </span>\n )}\n </span>\n )}\n </td>\n <td className=\"py-2 text-xs\">\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-mono text-primary underline-offset-2 hover:underline\"\n >\n {entry.sourceRef}\n </a>\n ) : (\n <span className=\"font-mono text-muted-foreground\">{entry.sourceRef}</span>\n )}\n {locator && <span className=\"ml-1.5 text-muted-foreground\">{locator}</span>}\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )\n}\n\n// ── exceptions + checks ───────────────────────────────────────────────────\n\nconst SEVERITY_TONES: Record<ExceptionEntry['severity'], string> = {\n blocking: 'bg-destructive/10 text-destructive',\n material: 'bg-warning/10 text-warning',\n advisory: 'bg-secondary text-muted-foreground',\n}\n\n/** Properties for the severity-badged exception list */\nexport interface ExceptionListProps {\n exceptions: readonly ExceptionEntry[]\n className?: string\n}\n\n/** Severity-badged exception rows with resolution state. */\nexport function ExceptionList({ exceptions, className }: ExceptionListProps) {\n if (exceptions.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No exceptions flagged.</p>\n }\n return (\n <ul className={`space-y-1.5 ${className ?? ''}`}>\n {exceptions.map((entry) => (\n <li key={entry.id} className=\"flex items-start gap-2.5 rounded-lg border border-border bg-card px-3 py-2\">\n <span className={`mt-0.5 inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-semibold uppercase tracking-[0.05em] ${SEVERITY_TONES[entry.severity]}`}>\n {entry.severity}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className={`text-sm leading-snug ${entry.resolved ? 'text-muted-foreground line-through' : 'text-foreground'}`}>\n {entry.message}\n </p>\n <p className=\"mt-0.5 flex flex-wrap gap-x-2 text-xs text-muted-foreground\">\n <span className=\"font-mono\">{entry.kind}</span>\n {entry.targets && entry.targets.length > 0 && <span className=\"font-mono\">{entry.targets.join(', ')}</span>}\n {entry.resolved && <span>resolved{entry.resolvedBy ? ` by ${entry.resolvedBy}` : ''}</span>}\n {entry.resolutionNote && <span>{entry.resolutionNote}</span>}\n </p>\n </div>\n </li>\n ))}\n </ul>\n )\n}\n\n/** Properties for the pass/fail quality check list */\nexport interface QualityCheckListProps {\n checks: readonly QualityCheck[]\n className?: string\n}\n\n/** Pass/fail quality-check rows tagged with their source (agent self-report,\n * platform gate, judge ensemble). */\nexport function QualityCheckList({ checks, className }: QualityCheckListProps) {\n if (checks.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No checks recorded.</p>\n }\n return (\n <ul className={`space-y-1 ${className ?? ''}`}>\n {checks.map((check) => (\n <li key={check.id} className=\"flex items-start gap-2 rounded-md px-1 py-1\">\n {check.passed ? (\n <svg viewBox=\"0 0 24 24\" className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-success\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 24 24\" className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm text-foreground\">\n {check.name}\n <span className=\"ml-1.5 text-xs uppercase tracking-[0.05em] text-muted-foreground\">{check.source}</span>\n </p>\n {check.detail && <p className=\"text-xs leading-snug text-muted-foreground\">{check.detail}</p>}\n </div>\n </li>\n ))}\n </ul>\n )\n}\n\n// ── provenance stamp ──────────────────────────────────────────────────────\n\n/** Properties for the provenance stamp with the optional backtest slot */\nexport interface ProvenanceStampProps {\n provenance: Pick<WorkProductProvenance, 'profileHash' | 'runId' | 'servingModels'> &\n Partial<Pick<WorkProductProvenance, 'costUsd' | 'producedAt'>>\n /** The product-resolved backtest summary for this profile hash. When its\n * trust gate failed, the composite renders as \"quality: unverified\" —\n * never a naked number. */\n backtest?: ProfileBacktestSummary\n className?: string\n}\n\n/** Truncated id with an ellipsis marker, so a sliced hash never passes as complete. */\nfunction truncateId(id: string, length: number): string {\n return id.length > length ? `${id.slice(0, length)}…` : id\n}\n\n/** The audit line a reviewer approves against: which configuration produced\n * this document, what served it, and how that configuration measured on its\n * backtest. */\nexport function ProvenanceStamp({ provenance, backtest, className }: ProvenanceStampProps) {\n return (\n <div className={`flex flex-wrap items-center gap-x-2.5 gap-y-1 text-xs text-muted-foreground ${className ?? ''}`}>\n <span className=\"font-mono\" title={provenance.profileHash}>\n profile {provenance.profileHash ? truncateId(provenance.profileHash, 10) : '—'}\n </span>\n <span className=\"font-mono\" title={provenance.runId}>\n run {provenance.runId ? truncateId(provenance.runId, 10) : '—'}\n </span>\n {provenance.servingModels.length > 0 ? (\n provenance.servingModels.map((model) => (\n <span key={model} className=\"rounded-full bg-secondary px-2 py-0.5 font-mono\">\n {model}\n </span>\n ))\n ) : (\n <span className=\"italic\">serving model pending</span>\n )}\n {typeof provenance.costUsd === 'number' && <span>${provenance.costUsd.toFixed(provenance.costUsd < 0.01 ? 4 : 2)}</span>}\n {backtest &&\n (backtest.trust === 'pass' ? (\n <span className=\"text-success\">\n {backtest.cases} backtest cases · composite {backtest.composite.toFixed(2)} · trust PASS\n </span>\n ) : (\n <span className=\"text-warning\" title={backtest.trustReasons.join('; ')}>\n quality: unverified\n </span>\n ))}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAqBA,SAAS,aAAa,WAAW,gBAAgB;AACjD,SAAS,kBAAmC;AAwEnC,cA0DD,YA1DC;AAjDT,IAAM,eAAiD;AAAA,EACrD,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,SAAS;AACX;AAKA,IAAM,cAAoD;AAAA,EACxD,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,SAAS;AACX;AAEA,IAAM,gBAAmD;AAAA,EACvD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;A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,qBAAC,SAAI,WAAW,+EAA+E,aAAa,EAAE,IAC5G;AAAA,yBAAC,UAAK,WAAU,aAAY,OAAO,WAAW,aAAa;AAAA;AAAA,MAChD,WAAW,cAAc,WAAW,WAAW,aAAa,EAAE,IAAI;AAAA,OAC7E;AAAA,IACA,qBAAC,UAAK,WAAU,aAAY,OAAO,WAAW,OAAO;AAAA;AAAA,MAC9C,WAAW,QAAQ,WAAW,WAAW,OAAO,EAAE,IAAI;AAAA,OAC7D;AAAA,IACC,WAAW,cAAc,SAAS,IACjC,WAAW,cAAc,IAAI,CAAC,UAC5B,oBAAC,UAAiB,WAAU,mDACzB,mBADQ,KAEX,CACD,IAED,oBAAC,UAAK,WAAU,UAAS,mCAAqB;AAAA,IAE/C,OAAO,WAAW,YAAY,YAAY,qBAAC,UAAK;AAAA;AAAA,MAAE,WAAW,QAAQ,QAAQ,WAAW,UAAU,OAAO,IAAI,CAAC;AAAA,OAAE;AAAA,IAChH,aACE,SAAS,UAAU,SAClB,qBAAC,UAAK,WAAU,gBACb;AAAA,eAAS;AAAA,MAAM;AAAA,MAA6B,SAAS,UAAU,QAAQ,CAAC;AAAA,MAAE;AAAA,OAC7E,IAEA,oBAAC,UAAK,WAAU,gBAAe,OAAO,SAAS,aAAa,KAAK,IAAI,GAAG,iCAExE;AAAA,KAEN;AAEJ;","names":[]}
|
package/dist/web-react/index.js
CHANGED
|
@@ -134,7 +134,7 @@ import {
|
|
|
134
134
|
withoutRecordGridCreated,
|
|
135
135
|
withoutRecordGridRemoved,
|
|
136
136
|
withoutRecordGridUpdate
|
|
137
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-2HEFK764.js";
|
|
138
138
|
import {
|
|
139
139
|
SessionHistoryPanel,
|
|
140
140
|
formatSessionTimestamp,
|
|
@@ -157,10 +157,12 @@ import {
|
|
|
157
157
|
QualityCheckList,
|
|
158
158
|
ReviewQueuePanel,
|
|
159
159
|
WorkProductCard,
|
|
160
|
+
WorkProductStatusPill,
|
|
160
161
|
mergeReviewQueuePages,
|
|
161
162
|
workProductPartsFromMessageParts,
|
|
162
|
-
workProductStatusLabel
|
|
163
|
-
|
|
163
|
+
workProductStatusLabel,
|
|
164
|
+
workProductStatusTone
|
|
165
|
+
} from "../chunk-Y6PRDUFJ.js";
|
|
164
166
|
import {
|
|
165
167
|
parseReviewQueueItem
|
|
166
168
|
} from "../chunk-GEYACSFW.js";
|
|
@@ -186,7 +188,7 @@ import "../chunk-L7MB2LLM.js";
|
|
|
186
188
|
import {
|
|
187
189
|
WorkspaceInitial,
|
|
188
190
|
WorkspaceSwitcher
|
|
189
|
-
} from "../chunk-
|
|
191
|
+
} from "../chunk-NDI6XDRZ.js";
|
|
190
192
|
import "../chunk-2WELYICW.js";
|
|
191
193
|
import "../chunk-AUA75YFF.js";
|
|
192
194
|
import {
|
|
@@ -343,6 +345,7 @@ export {
|
|
|
343
345
|
SessionHistoryPanel,
|
|
344
346
|
Sparkline,
|
|
345
347
|
WorkProductCard,
|
|
348
|
+
WorkProductStatusPill,
|
|
346
349
|
WorkspaceInitial,
|
|
347
350
|
WorkspaceSwitcher,
|
|
348
351
|
__resetAttachmentFileCacheForTests,
|
|
@@ -494,6 +497,7 @@ export {
|
|
|
494
497
|
withoutRecordGridRemoved,
|
|
495
498
|
withoutRecordGridUpdate,
|
|
496
499
|
workProductPartsFromMessageParts,
|
|
497
|
-
workProductStatusLabel
|
|
500
|
+
workProductStatusLabel,
|
|
501
|
+
workProductStatusTone
|
|
498
502
|
};
|
|
499
503
|
//# sourceMappingURL=index.js.map
|
|
@@ -18,12 +18,22 @@
|
|
|
18
18
|
* `./work-product-react` instead — this module must stay importable without
|
|
19
19
|
* the optional sandbox-ui peer.
|
|
20
20
|
*/
|
|
21
|
+
import { type StatusTone } from '@tangle-network/ui/primitives';
|
|
21
22
|
import { parseReviewQueueItem, type ReviewQueueItem, type ReviewQueueState } from '../work-product/queue';
|
|
22
23
|
import type { EvidenceEntry, ExceptionEntry, ProfileBacktestSummary, QualityCheck, WorkProductPersistedPart, WorkProductProvenance, WorkProductStatus } from '../work-product/types';
|
|
23
24
|
export { parseReviewQueueItem };
|
|
24
25
|
export type { ReviewQueueItem, ReviewQueueState };
|
|
25
26
|
/** Human label for a work-product status. */
|
|
26
27
|
export declare function workProductStatusLabel(status: WorkProductStatus): string;
|
|
28
|
+
/** StatusPill tone for a work-product status. */
|
|
29
|
+
export declare function workProductStatusTone(status: WorkProductStatus): StatusTone;
|
|
30
|
+
/** A work-product status as a StatusPill: the one rendering of this state, so
|
|
31
|
+
* a product's review page and the transcript card never disagree on it. */
|
|
32
|
+
export declare function WorkProductStatusPill({ status, size, className, }: {
|
|
33
|
+
status: WorkProductStatus;
|
|
34
|
+
size?: 'sm' | 'md';
|
|
35
|
+
className?: string;
|
|
36
|
+
}): import("react").JSX.Element;
|
|
27
37
|
/** Every persisted work-product anchor on one message, re-validated. */
|
|
28
38
|
export declare function workProductPartsFromMessageParts(parts: ReadonlyArray<Record<string, unknown>> | null | undefined): WorkProductPersistedPart[];
|
|
29
39
|
/** Properties for the transcript anchor card rendered in chat */
|
|
@@ -23,9 +23,10 @@ export interface WorkspaceSwitcherProps {
|
|
|
23
23
|
/** Searchable workspace/client/project selection, shared across all workspace shells. */
|
|
24
24
|
export declare function WorkspaceSwitcher({ items, value, onChange, label, placeholder, searchLabel, emptyLabel, collapsed, variant, footer, open: controlledOpen, onOpenChange, }: WorkspaceSwitcherProps): import("react").JSX.Element;
|
|
25
25
|
/**
|
|
26
|
-
* The one workspace avatar:
|
|
27
|
-
*
|
|
28
|
-
* client
|
|
26
|
+
* The one workspace avatar: ui's IconTile with the workspace's initials on a
|
|
27
|
+
* categorical tone derived from its name. The switchers and the listing all
|
|
28
|
+
* use it, so a client gets the same mark and colour wherever it appears, and
|
|
29
|
+
* two clients side by side are told apart by more than their first letter.
|
|
29
30
|
*/
|
|
30
31
|
export declare function WorkspaceInitial({ name, size }: {
|
|
31
32
|
name: string;
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
ExceptionList,
|
|
4
4
|
ProvenanceStamp,
|
|
5
5
|
QualityCheckList,
|
|
6
|
-
|
|
7
|
-
} from "../chunk-
|
|
6
|
+
WorkProductStatusPill
|
|
7
|
+
} from "../chunk-Y6PRDUFJ.js";
|
|
8
8
|
import "../chunk-GEYACSFW.js";
|
|
9
9
|
import {
|
|
10
10
|
unresolvedBlockingExceptions
|
|
@@ -74,25 +74,25 @@ function WorkProductPane({
|
|
|
74
74
|
},
|
|
75
75
|
[loadVersionBody]
|
|
76
76
|
);
|
|
77
|
+
const blockingCount = unresolvedBlockingExceptions(workProduct.exceptions).length;
|
|
77
78
|
return /* @__PURE__ */ jsxs("div", { className: `flex min-h-0 flex-col gap-3 ${className ?? ""}`, children: [
|
|
78
79
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-3", children: [
|
|
79
80
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
80
|
-
/* @__PURE__ */ jsxs("
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
/* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
88
|
-
artifact?.kind && /* @__PURE__ */ jsxs("span", { className: "font-mono", children: [
|
|
89
|
-
artifact.kind,
|
|
90
|
-
" \xB7 "
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
82
|
+
/* @__PURE__ */ jsxs("p", { className: "min-w-0 truncate text-sm font-semibold text-foreground", children: [
|
|
83
|
+
artifact?.title ?? workProduct.scopeKey,
|
|
84
|
+
/* @__PURE__ */ jsxs("span", { className: "ml-1.5 text-xs font-normal text-muted-foreground", children: [
|
|
85
|
+
"v",
|
|
86
|
+
workProduct.version
|
|
87
|
+
] })
|
|
91
88
|
] }),
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
/* @__PURE__ */ jsx(WorkProductStatusPill, { status: workProduct.status, size: "sm", className: "shrink-0" })
|
|
90
|
+
] }),
|
|
91
|
+
(artifact?.kind || blockingCount > 0) && /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
|
|
92
|
+
artifact?.kind && /* @__PURE__ */ jsx("span", { className: "font-mono", children: artifact.kind }),
|
|
93
|
+
artifact?.kind && blockingCount > 0 && " \xB7 ",
|
|
94
|
+
blockingCount > 0 && /* @__PURE__ */ jsxs("span", { className: "text-destructive", children: [
|
|
95
|
+
blockingCount,
|
|
96
96
|
" blocking"
|
|
97
97
|
] })
|
|
98
98
|
] })
|
|
@@ -118,7 +118,7 @@ function WorkProductPane({
|
|
|
118
118
|
"v",
|
|
119
119
|
entry.version
|
|
120
120
|
] }),
|
|
121
|
-
/* @__PURE__ */ jsx(
|
|
121
|
+
/* @__PURE__ */ jsx(WorkProductStatusPill, { status: entry.status, size: "sm" }),
|
|
122
122
|
entry.reviewedBy && /* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
123
123
|
"by ",
|
|
124
124
|
entry.reviewedBy
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/work-product-react/index.tsx"],"sourcesContent":["/**\n * `./work-product-react` — the sandbox-ui-composed review pane. It follows the\n * optional-peer rule: this is the ONLY work-product surface\n * that imports `@tangle-network/sandbox-ui` (its `workbench` primitives:\n * `PillTabs`, `CodeSurface`, `DiffView`, `FileBreadcrumb`).\n * `/web-react`'s queue/card/lineage components stay\n * sandbox-ui-free; importing THIS subpath requires the otherwise optional\n * sandbox-ui peer.\n *\n * The pane never fetches: bodies arrive as resolved strings\n * (`currentContent`/`baselineContent`) and history compares load through the\n * injected `loadVersionBody(ref)` seam. The default tab is a PROP — tax\n * passes `'lineage'` (lineage before diff for tax), legal passes `'diff'`\n * (the redline IS the artifact), gtm passes `'artifact'`.\n */\n\nimport { useCallback, useMemo, useState } from 'react'\nimport {\n CodeSurface,\n DiffView,\n FileBreadcrumb,\n PillTabs,\n type PillTabItem,\n} from '@tangle-network/sandbox-ui/workbench'\n\nimport {\n EvidenceLineageTable,\n ExceptionList,\n ProvenanceStamp,\n QualityCheckList,\n workProductStatusLabel,\n} from '../web-react/work-product'\nimport type {\n EvidenceEntry,\n ProfileBacktestSummary,\n WorkProductRecord,\n WorkProductVersionEntry,\n} from '../work-product/types'\nimport { unresolvedBlockingExceptions } from '../work-product/types'\n\nexport type WorkProductPaneTab = 'artifact' | 'diff' | 'lineage' | 'exceptions' | 'checks' | 'history'\n\n/** Properties for the tabbed work-product review pane */\nexport interface WorkProductPaneProps {\n workProduct: WorkProductRecord\n /** Which tab opens first — a product choice, not a heuristic: tax passes\n * 'lineage', legal 'diff', gtm 'artifact'. Default 'artifact'. */\n defaultTab?: WorkProductPaneTab\n /** Resolved artifact body when it lives at `artifact.path` rather than\n * inline. Falls back to `artifact.content`. */\n currentContent?: string\n /** Resolved baseline body for diff-first products. Falls back to\n * `artifact.baseline.content`. */\n baselineContent?: string\n /** Load a frozen version body by its `history[].artifactPath` ref for the\n * vN-1 → vN compare. Omit to hide history compares. */\n loadVersionBody?: (ref: string) => Promise<string | null>\n /** Resolve one evidence entry's source to an openable URL (lineage\n * click-through). */\n resolveSourceUrl?: (entry: EvidenceEntry) => string\n /** Backtest summary for the record's profile hash, rendered on the\n * provenance stamp. */\n backtest?: ProfileBacktestSummary\n className?: string\n}\n\ninterface VersionCompare {\n fromVersion: number\n toVersion: number\n baseline: string\n current: string\n}\n\n/** Trailing path segment for a diff header. */\nfunction filenameOf(path: string | undefined, fallback: string): string {\n if (!path) return fallback\n const segments = path.split('/')\n return segments[segments.length - 1] || fallback\n}\n\n/**\n * The tabbed review pane over one work product: Artifact | Diff | Lineage |\n * Exceptions | Checks | History. Diff renders baseline→current for redline\n * artifacts and vN-1→vN for history compares; lineage is the\n * every-value-traceable table; provenance is stamped across the header.\n */\nexport function WorkProductPane({\n workProduct,\n defaultTab = 'artifact',\n currentContent,\n baselineContent,\n loadVersionBody,\n resolveSourceUrl,\n backtest,\n className,\n}: WorkProductPaneProps) {\n const artifact = workProduct.artifact\n const body = currentContent ?? artifact?.content ?? ''\n const baseline = baselineContent ?? artifact?.baseline?.content\n const hasDiff = baseline !== undefined\n\n const tabs = useMemo(() => {\n const items: PillTabItem<WorkProductPaneTab>[] = [{ value: 'artifact', label: 'Artifact' }]\n if (hasDiff) items.push({ value: 'diff', label: 'Diff' })\n items.push(\n { value: 'lineage', label: `Lineage (${workProduct.evidence.length})` },\n { value: 'exceptions', label: `Exceptions (${workProduct.exceptions.length})` },\n { value: 'checks', label: `Checks (${workProduct.checks.length})` },\n { value: 'history', label: `History (${workProduct.history.length})` },\n )\n return items\n }, [hasDiff, workProduct.evidence.length, workProduct.exceptions.length, workProduct.checks.length, workProduct.history.length])\n\n const initialTab = tabs.some((tab) => tab.value === defaultTab) ? defaultTab : 'artifact'\n const [tab, setTab] = useState<WorkProductPaneTab>(initialTab)\n const [compare, setCompare] = useState<VersionCompare | null>(null)\n const [compareError, setCompareError] = useState<string | null>(null)\n\n const diffFilename = filenameOf(artifact?.path, artifact?.title ?? workProduct.scopeKey)\n\n const loadCompare = useCallback(\n async (from: WorkProductVersionEntry, to: WorkProductVersionEntry) => {\n if (!loadVersionBody || !from.artifactPath || !to.artifactPath) return\n setCompareError(null)\n try {\n const [fromBody, toBody] = await Promise.all([\n loadVersionBody(from.artifactPath),\n loadVersionBody(to.artifactPath),\n ])\n if (fromBody === null || toBody === null) {\n setCompareError('A version snapshot could not be loaded.')\n return\n }\n setCompare({ fromVersion: from.version, toVersion: to.version, baseline: fromBody, current: toBody })\n } catch (error) {\n setCompareError(error instanceof Error ? error.message : String(error))\n }\n },\n [loadVersionBody],\n )\n\n return (\n <div className={`flex min-h-0 flex-col gap-3 ${className ?? ''}`}>\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-semibold text-foreground\">\n {artifact?.title ?? workProduct.scopeKey}\n <span className=\"ml-1.5 text-xs font-normal text-muted-foreground\">v{workProduct.version}</span>\n </p>\n <p className=\"text-xs text-muted-foreground\">\n {artifact?.kind && <span className=\"font-mono\">{artifact.kind} · </span>}\n {workProductStatusLabel(workProduct.status)}\n {unresolvedBlockingExceptions(workProduct.exceptions).length > 0 && (\n <span className=\"text-destructive\"> · {unresolvedBlockingExceptions(workProduct.exceptions).length} blocking</span>\n )}\n </p>\n </div>\n <ProvenanceStamp provenance={workProduct.provenance} backtest={backtest} />\n </div>\n\n <PillTabs items={tabs} value={tab} onChange={setTab} aria-label=\"Work product views\" />\n\n {tab === 'artifact' && (\n <div className=\"min-h-0 flex-1 overflow-auto rounded-lg border border-border\">\n {artifact?.path && <FileBreadcrumb path={artifact.path} className=\"border-b border-border px-3 py-2\" />}\n {body ? (\n <CodeSurface code={body} filename={diffFilename} />\n ) : artifact?.fields ? (\n <CodeSurface code={JSON.stringify(artifact.fields, null, 2)} filename={`${diffFilename}.json`} language=\"json\" />\n ) : (\n <p className=\"px-4 py-6 text-center text-xs text-muted-foreground\">No artifact body yet.</p>\n )}\n </div>\n )}\n\n {tab === 'diff' && hasDiff && (\n <div className=\"min-h-0 flex-1 overflow-auto rounded-lg border border-border\">\n {/* DiffView's own file header already carries the +/− counts. */}\n <DiffView filename={diffFilename} baseline={baseline ?? ''} current={body} />\n </div>\n )}\n\n {tab === 'lineage' && (\n <EvidenceLineageTable evidence={workProduct.evidence} resolveSourceUrl={resolveSourceUrl} />\n )}\n\n {tab === 'exceptions' && <ExceptionList exceptions={workProduct.exceptions} />}\n\n {tab === 'checks' && <QualityCheckList checks={workProduct.checks} />}\n\n {tab === 'history' && (\n <div className=\"space-y-2\">\n {workProduct.history.length === 0 && <p className=\"text-xs text-muted-foreground\">No versions yet.</p>}\n {workProduct.history.map((entry, index) => {\n const prior = workProduct.history\n .slice(0, index)\n .reverse()\n .find((candidate) => candidate.version < entry.version && candidate.artifactPath)\n return (\n <div key={`${entry.version}:${entry.status}:${entry.at}`} className=\"rounded-lg border border-border bg-card px-3 py-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">v{entry.version}</span>\n <span className=\"text-xs text-muted-foreground\">{workProductStatusLabel(entry.status)}</span>\n {entry.reviewedBy && <span className=\"text-xs text-muted-foreground\">by {entry.reviewedBy}</span>}\n <span className=\"flex-1\" />\n {loadVersionBody && prior?.artifactPath && entry.artifactPath && (\n <button\n type=\"button\"\n onClick={() => void loadCompare(prior, entry)}\n className=\"rounded-md border border-border px-2 py-0.5 text-xs font-medium text-foreground transition hover:bg-accent\"\n >\n Compare v{prior.version} → v{entry.version}\n </button>\n )}\n </div>\n {entry.reviewNote && <p className=\"mt-1 text-sm leading-snug text-foreground\">{entry.reviewNote}</p>}\n <ProvenanceStamp provenance={entry.provenance} className=\"mt-1\" />\n </div>\n )\n })}\n {compareError && <p className=\"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive\">{compareError}</p>}\n {compare && (\n <div className=\"overflow-auto rounded-lg border border-border\">\n <p className=\"border-b border-border px-3 py-2 text-xs text-muted-foreground\">\n v{compare.fromVersion} → v{compare.toVersion}\n </p>\n <DiffView filename={diffFilename} baseline={compare.baseline} current={compare.current} />\n </div>\n )}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAS,aAAa,SAAS,gBAAgB;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA4HK,SAUJ,KAVI;AAzEZ,SAAS,WAAW,MAA0B,UAA0B;AACtE,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,SAAO,SAAS,SAAS,SAAS,CAAC,KAAK;AAC1C;AAQO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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AA,gBACL,SAAS,MAAM,KAAK,YAAY,OAAO,KAAK;AAAA,gBAC5C,WAAU;AAAA,gBACX;AAAA;AAAA,kBACW,MAAM;AAAA,kBAAQ;AAAA,kBAAK,MAAM;AAAA;AAAA;AAAA,YACrC;AAAA,aAEJ;AAAA,UACC,MAAM,cAAc,oBAAC,OAAE,WAAU,6CAA6C,gBAAM,YAAW;AAAA,UAChG,oBAAC,mBAAgB,YAAY,MAAM,YAAY,WAAU,QAAO;AAAA,aAjBxD,GAAG,MAAM,OAAO,IAAI,MAAM,MAAM,IAAI,MAAM,EAAE,EAkBtD;AAAA,MAEJ,CAAC;AAAA,MACA,gBAAgB,oBAAC,OAAE,WAAU,mEAAmE,wBAAa;AAAA,MAC7G,WACC,qBAAC,SAAI,WAAU,iDACb;AAAA,6BAAC,OAAE,WAAU,kEAAiE;AAAA;AAAA,UAC1E,QAAQ;AAAA,UAAY;AAAA,UAAK,QAAQ;AAAA,WACrC;AAAA,QACA,oBAAC,YAAS,UAAU,cAAc,UAAU,QAAQ,UAAU,SAAS,QAAQ,SAAS;AAAA,SAC1F;AAAA,OAEJ;AAAA,KAEJ;AAEJ;","names":["tab"]}
|
|
1
|
+
{"version":3,"sources":["../../src/work-product-react/index.tsx"],"sourcesContent":["/**\n * `./work-product-react` — the sandbox-ui-composed review pane. It follows the\n * optional-peer rule: this is the ONLY work-product surface\n * that imports `@tangle-network/sandbox-ui` (its `workbench` primitives:\n * `PillTabs`, `CodeSurface`, `DiffView`, `FileBreadcrumb`).\n * `/web-react`'s queue/card/lineage components stay\n * sandbox-ui-free; importing THIS subpath requires the otherwise optional\n * sandbox-ui peer.\n *\n * The pane never fetches: bodies arrive as resolved strings\n * (`currentContent`/`baselineContent`) and history compares load through the\n * injected `loadVersionBody(ref)` seam. The default tab is a PROP — tax\n * passes `'lineage'` (lineage before diff for tax), legal passes `'diff'`\n * (the redline IS the artifact), gtm passes `'artifact'`.\n */\n\nimport { useCallback, useMemo, useState } from 'react'\nimport {\n CodeSurface,\n DiffView,\n FileBreadcrumb,\n PillTabs,\n type PillTabItem,\n} from '@tangle-network/sandbox-ui/workbench'\n\nimport {\n EvidenceLineageTable,\n ExceptionList,\n ProvenanceStamp,\n QualityCheckList,\n WorkProductStatusPill,\n} from '../web-react/work-product'\nimport type {\n EvidenceEntry,\n ProfileBacktestSummary,\n WorkProductRecord,\n WorkProductVersionEntry,\n} from '../work-product/types'\nimport { unresolvedBlockingExceptions } from '../work-product/types'\n\nexport type WorkProductPaneTab = 'artifact' | 'diff' | 'lineage' | 'exceptions' | 'checks' | 'history'\n\n/** Properties for the tabbed work-product review pane */\nexport interface WorkProductPaneProps {\n workProduct: WorkProductRecord\n /** Which tab opens first — a product choice, not a heuristic: tax passes\n * 'lineage', legal 'diff', gtm 'artifact'. Default 'artifact'. */\n defaultTab?: WorkProductPaneTab\n /** Resolved artifact body when it lives at `artifact.path` rather than\n * inline. Falls back to `artifact.content`. */\n currentContent?: string\n /** Resolved baseline body for diff-first products. Falls back to\n * `artifact.baseline.content`. */\n baselineContent?: string\n /** Load a frozen version body by its `history[].artifactPath` ref for the\n * vN-1 → vN compare. Omit to hide history compares. */\n loadVersionBody?: (ref: string) => Promise<string | null>\n /** Resolve one evidence entry's source to an openable URL (lineage\n * click-through). */\n resolveSourceUrl?: (entry: EvidenceEntry) => string\n /** Backtest summary for the record's profile hash, rendered on the\n * provenance stamp. */\n backtest?: ProfileBacktestSummary\n className?: string\n}\n\ninterface VersionCompare {\n fromVersion: number\n toVersion: number\n baseline: string\n current: string\n}\n\n/** Trailing path segment for a diff header. */\nfunction filenameOf(path: string | undefined, fallback: string): string {\n if (!path) return fallback\n const segments = path.split('/')\n return segments[segments.length - 1] || fallback\n}\n\n/**\n * The tabbed review pane over one work product: Artifact | Diff | Lineage |\n * Exceptions | Checks | History. Diff renders baseline→current for redline\n * artifacts and vN-1→vN for history compares; lineage is the\n * every-value-traceable table; provenance is stamped across the header.\n */\nexport function WorkProductPane({\n workProduct,\n defaultTab = 'artifact',\n currentContent,\n baselineContent,\n loadVersionBody,\n resolveSourceUrl,\n backtest,\n className,\n}: WorkProductPaneProps) {\n const artifact = workProduct.artifact\n const body = currentContent ?? artifact?.content ?? ''\n const baseline = baselineContent ?? artifact?.baseline?.content\n const hasDiff = baseline !== undefined\n\n const tabs = useMemo(() => {\n const items: PillTabItem<WorkProductPaneTab>[] = [{ value: 'artifact', label: 'Artifact' }]\n if (hasDiff) items.push({ value: 'diff', label: 'Diff' })\n items.push(\n { value: 'lineage', label: `Lineage (${workProduct.evidence.length})` },\n { value: 'exceptions', label: `Exceptions (${workProduct.exceptions.length})` },\n { value: 'checks', label: `Checks (${workProduct.checks.length})` },\n { value: 'history', label: `History (${workProduct.history.length})` },\n )\n return items\n }, [hasDiff, workProduct.evidence.length, workProduct.exceptions.length, workProduct.checks.length, workProduct.history.length])\n\n const initialTab = tabs.some((tab) => tab.value === defaultTab) ? defaultTab : 'artifact'\n const [tab, setTab] = useState<WorkProductPaneTab>(initialTab)\n const [compare, setCompare] = useState<VersionCompare | null>(null)\n const [compareError, setCompareError] = useState<string | null>(null)\n\n const diffFilename = filenameOf(artifact?.path, artifact?.title ?? workProduct.scopeKey)\n\n const loadCompare = useCallback(\n async (from: WorkProductVersionEntry, to: WorkProductVersionEntry) => {\n if (!loadVersionBody || !from.artifactPath || !to.artifactPath) return\n setCompareError(null)\n try {\n const [fromBody, toBody] = await Promise.all([\n loadVersionBody(from.artifactPath),\n loadVersionBody(to.artifactPath),\n ])\n if (fromBody === null || toBody === null) {\n setCompareError('A version snapshot could not be loaded.')\n return\n }\n setCompare({ fromVersion: from.version, toVersion: to.version, baseline: fromBody, current: toBody })\n } catch (error) {\n setCompareError(error instanceof Error ? error.message : String(error))\n }\n },\n [loadVersionBody],\n )\n\n const blockingCount = unresolvedBlockingExceptions(workProduct.exceptions).length\n\n return (\n <div className={`flex min-h-0 flex-col gap-3 ${className ?? ''}`}>\n <div className=\"flex flex-wrap items-center gap-3\">\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <p className=\"min-w-0 truncate text-sm font-semibold text-foreground\">\n {artifact?.title ?? workProduct.scopeKey}\n <span className=\"ml-1.5 text-xs font-normal text-muted-foreground\">v{workProduct.version}</span>\n </p>\n <WorkProductStatusPill status={workProduct.status} size=\"sm\" className=\"shrink-0\" />\n </div>\n {(artifact?.kind || blockingCount > 0) && (\n <p className=\"text-xs text-muted-foreground\">\n {artifact?.kind && <span className=\"font-mono\">{artifact.kind}</span>}\n {artifact?.kind && blockingCount > 0 && ' · '}\n {blockingCount > 0 && <span className=\"text-destructive\">{blockingCount} blocking</span>}\n </p>\n )}\n </div>\n <ProvenanceStamp provenance={workProduct.provenance} backtest={backtest} />\n </div>\n\n <PillTabs items={tabs} value={tab} onChange={setTab} aria-label=\"Work product views\" />\n\n {tab === 'artifact' && (\n <div className=\"min-h-0 flex-1 overflow-auto rounded-lg border border-border\">\n {artifact?.path && <FileBreadcrumb path={artifact.path} className=\"border-b border-border px-3 py-2\" />}\n {body ? (\n <CodeSurface code={body} filename={diffFilename} />\n ) : artifact?.fields ? (\n <CodeSurface code={JSON.stringify(artifact.fields, null, 2)} filename={`${diffFilename}.json`} language=\"json\" />\n ) : (\n <p className=\"px-4 py-6 text-center text-xs text-muted-foreground\">No artifact body yet.</p>\n )}\n </div>\n )}\n\n {tab === 'diff' && hasDiff && (\n <div className=\"min-h-0 flex-1 overflow-auto rounded-lg border border-border\">\n {/* DiffView's own file header already carries the +/− counts. */}\n <DiffView filename={diffFilename} baseline={baseline ?? ''} current={body} />\n </div>\n )}\n\n {tab === 'lineage' && (\n <EvidenceLineageTable evidence={workProduct.evidence} resolveSourceUrl={resolveSourceUrl} />\n )}\n\n {tab === 'exceptions' && <ExceptionList exceptions={workProduct.exceptions} />}\n\n {tab === 'checks' && <QualityCheckList checks={workProduct.checks} />}\n\n {tab === 'history' && (\n <div className=\"space-y-2\">\n {workProduct.history.length === 0 && <p className=\"text-xs text-muted-foreground\">No versions yet.</p>}\n {workProduct.history.map((entry, index) => {\n const prior = workProduct.history\n .slice(0, index)\n .reverse()\n .find((candidate) => candidate.version < entry.version && candidate.artifactPath)\n return (\n <div key={`${entry.version}:${entry.status}:${entry.at}`} className=\"rounded-lg border border-border bg-card px-3 py-2\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <span className=\"text-sm font-medium text-foreground\">v{entry.version}</span>\n <WorkProductStatusPill status={entry.status} size=\"sm\" />\n {entry.reviewedBy && <span className=\"text-xs text-muted-foreground\">by {entry.reviewedBy}</span>}\n <span className=\"flex-1\" />\n {loadVersionBody && prior?.artifactPath && entry.artifactPath && (\n <button\n type=\"button\"\n onClick={() => void loadCompare(prior, entry)}\n className=\"rounded-md border border-border px-2 py-0.5 text-xs font-medium text-foreground transition hover:bg-accent\"\n >\n Compare v{prior.version} → v{entry.version}\n </button>\n )}\n </div>\n {entry.reviewNote && <p className=\"mt-1 text-sm leading-snug text-foreground\">{entry.reviewNote}</p>}\n <ProvenanceStamp provenance={entry.provenance} className=\"mt-1\" />\n </div>\n )\n })}\n {compareError && <p className=\"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive\">{compareError}</p>}\n {compare && (\n <div className=\"overflow-auto rounded-lg border border-border\">\n <p className=\"border-b border-border px-3 py-2 text-xs text-muted-foreground\">\n v{compare.fromVersion} → v{compare.toVersion}\n </p>\n <DiffView filename={diffFilename} baseline={compare.baseline} current={compare.current} />\n </div>\n )}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;AAgBA,SAAS,aAAa,SAAS,gBAAgB;AAC/C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AA+HO,SAEF,KAFE;AA5Ed,SAAS,WAAW,MAA0B,UAA0B;AACtE,MAAI,CAAC,KAAM,QAAO;AAClB,QAAM,WAAW,KAAK,MAAM,GAAG;AAC/B,SAAO,SAAS,SAAS,SAAS,CAAC,KAAK;AAC1C;AAQO,SAAS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D,MAAM,cAAc,qBAAC,UAAK,WAAU,iCAAgC;AAAA;AAAA,cAAI,MAAM;AAAA,eAAW;AAAA,YAC1F,oBAAC,UAAK,WAAU,UAAS;AAAA,YACxB,mBAAmB,OAAO,gBAAgB,MAAM,gBAC/C;AAAA,cAAC;AAAA;AAAA,gBACC,MAAK;AAAA,gBACL,SAAS,MAAM,KAAK,YAAY,OAAO,KAAK;AAAA,gBAC5C,WAAU;AAAA,gBACX;AAAA;AAAA,kBACW,MAAM;AAAA,kBAAQ;AAAA,kBAAK,MAAM;AAAA;AAAA;AAAA,YACrC;AAAA,aAEJ;AAAA,UACC,MAAM,cAAc,oBAAC,OAAE,WAAU,6CAA6C,gBAAM,YAAW;AAAA,UAChG,oBAAC,mBAAgB,YAAY,MAAM,YAAY,WAAU,QAAO;AAAA,aAjBxD,GAAG,MAAM,OAAO,IAAI,MAAM,MAAM,IAAI,MAAM,EAAE,EAkBtD;AAAA,MAEJ,CAAC;AAAA,MACA,gBAAgB,oBAAC,OAAE,WAAU,mEAAmE,wBAAa;AAAA,MAC7G,WACC,qBAAC,SAAI,WAAU,iDACb;AAAA,6BAAC,OAAE,WAAU,kEAAiE;AAAA;AAAA,UAC1E,QAAQ;AAAA,UAAY;AAAA,UAAK,QAAQ;AAAA,WACrC;AAAA,QACA,oBAAC,YAAS,UAAU,cAAc,UAAU,QAAQ,UAAU,SAAS,QAAQ,SAAS;AAAA,SAC1F;AAAA,OAEJ;AAAA,KAEJ;AAEJ;","names":["tab"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
WorkspaceInitial,
|
|
3
3
|
WorkspaceSwitcher
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-NDI6XDRZ.js";
|
|
5
5
|
import {
|
|
6
6
|
ActionDialog,
|
|
7
7
|
ActionDialogButton
|
|
@@ -305,7 +305,7 @@ var AgentWorkspaceCompanion = forwardRef(function AgentWorkspaceCompanion2({
|
|
|
305
305
|
className: "h-full min-h-0 min-w-0 flex-1",
|
|
306
306
|
collapsedControlsPlacement: "edge",
|
|
307
307
|
keepRightMounted: true,
|
|
308
|
-
center: children,
|
|
308
|
+
center: /* @__PURE__ */ jsx2("div", { "data-companion-center": true, className: "grid h-full min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(0,1fr)]", children }),
|
|
309
309
|
left: navigation?.content,
|
|
310
310
|
leftContentClassName: "py-0",
|
|
311
311
|
leftHeader: navigation && (navigation.header !== void 0 ? navigation.header : /* @__PURE__ */ jsx2("span", { className: "text-sm font-medium", children: navigation.label ?? "Chats" })),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/workspace-react/index.tsx","../../src/workspace-react/rail-identity.tsx","../../src/workspace-react/companion.tsx","../../src/workspace-react/workspace-list.tsx"],"sourcesContent":["import { SidebarLayout, type SidebarLayoutNavItem, type SidebarLayoutProps } from '@tangle-network/sandbox-ui/dashboard'\nimport type { ReactNode } from 'react'\n\nimport type { WorkspaceAppRecord } from '../workspace-apps'\nimport { AgentRailIdentity, type AgentProductIdentity, type AgentWorkspaceIdentity } from './rail-identity'\n\nimport {\n buildSessionNavItem,\n composeSidebarSessions,\n resolveActiveNavId,\n type NavRouteDef,\n type RailPrefetch,\n type SessionRowActions,\n type SessionSummary,\n} from '../session-shell'\n\ntype WorkspaceIcon = SidebarLayoutNavItem['icon']\n\nfunction routePathFromHref(href: string, base: string): string | null {\n const path = href.split(/[?#]/, 1)[0] ?? ''\n const root = base.replace(/\\/+$/, '')\n if (path === root) return '/'\n if (!path.startsWith(`${root}/`)) return null\n return path.slice(root.length)\n}\n\n/** The session data and product-owned URLs needed by the default workspace. */\nexport interface AgentWorkspaceSessionConfig {\n /** Icon shown beside the expandable History row. */\n icon: WorkspaceIcon\n /** Id for the session row; defaults to `history`. */\n id?: string\n /** Product copy for the session row; defaults to `History`. */\n label?: string\n /** Full-history route used by the row and overflow item. */\n href: string\n /** Product-owned URL for an individual session. */\n hrefForSession: (sessionId: string) => string\n /** Server-loaded rows, ordered by the product's query. */\n sessions: SessionSummary[]\n /** Sessions created by another tab before the loader revalidates. */\n optimisticSessions?: SessionSummary[]\n /** Number of rows shown in the rail before the full-history link. */\n limit?: number\n /** Total persisted session count, used to decide whether overflow exists. */\n totalCount?: number\n /** Session currently open in the route. */\n activeSessionId?: string | null\n /** Sessions with a live turn. */\n respondingSessionIds?: ReadonlySet<string>\n /** Live unread ids from the product's event channel. */\n liveUnreadIds?: ReadonlySet<string>\n /** Ids this tab has opened since the loader ran. */\n locallyReadIds?: ReadonlySet<string>\n /** Optional product-owned rename/delete/pin actions. */\n actions?: SessionRowActions<WorkspaceIcon>\n /** Label for the overflow row. Defaults to `View all chats`. */\n overflowLabel?: string\n /** Empty state for the expanded rail row. Defaults to `No chats yet`. */\n emptyLabel?: string\n /** Fallback title for untitled sessions. */\n untitledLabel?: string\n /** Router prefetch behavior for session links. */\n prefetch?: RailPrefetch\n /** Whether History starts expanded. Defaults to `true`. */\n defaultOpen?: boolean\n}\n\n/**\n * Registered apps shown under one expandable workspace destination.\n * Products supply authorized rows and their real route; preview URLs never\n * become navigation hrefs.\n */\nexport interface AgentWorkspaceAppsConfig {\n icon: WorkspaceIcon\n items: readonly Pick<WorkspaceAppRecord, 'id' | 'name'>[]\n hrefForApp: (appId: string) => string\n prefetch?: RailPrefetch\n}\n\n/** Route data for the shared active-nav resolver. */\nexport interface AgentWorkspaceActiveRoute {\n /** Current browser pathname, including the product's workspace base. */\n pathname: string\n /** Product route root, for example `/app/ws_123`. */\n base: string\n /** Product-owned rail routes, relative to `base`. */\n routes: NavRouteDef[]\n /** Extra route prefixes that should highlight an existing row. */\n aliases?: Record<string, string>\n /** Route prefixes that intentionally highlight no row. */\n claimsNothing?: string[]\n}\n\nexport interface AgentWorkspaceLayoutProps\n extends Omit<SidebarLayoutProps, 'activeId' | 'children' | 'navItems' | 'hideBelow' | 'railLabels'> {\n children: ReactNode\n /**\n * The product's name, mark, and home. With it the shell draws the canonical\n * rail top — mark, then the open workspace and product name — so products\n * stop hand-building `logo` and `railHeaderContent`.\n */\n product?: AgentProductIdentity\n /** The open workspace and where else this person can go. Omit on the listing. */\n workspace?: AgentWorkspaceIdentity | null\n /** Product-owned destinations. Shared Apps and History rows follow them. */\n navItems: SidebarLayoutNavItem[]\n /** Omit for a workflow-only shell with no conversational session rail. */\n sessions?: AgentWorkspaceSessionConfig\n /** Authorized app destinations, in the product's persisted order. */\n apps?: AgentWorkspaceAppsConfig\n /** When supplied, active navigation is resolved by the shared route rules. */\n activeRoute?: AgentWorkspaceActiveRoute\n /** Escape hatch for routers that already resolved the active item. */\n activeId?: string\n /** Hide the fixed desktop rail below this breakpoint. Defaults to `lg`. */\n hideBelow?: SidebarLayoutProps['hideBelow']\n /** Show labels beside rail icons. Defaults to `true`. */\n railLabels?: SidebarLayoutProps['railLabels']\n}\n\n/**\n * The default agent workspace composition.\n *\n * Products own their navigation taxonomy, routes, and session storage. This\n * component owns the repeated assembly: the standard visual layout, the\n * expandable Apps and History rows, capped session composition, unread state,\n * and active route resolution. The full History route and the empty-state composer stay\n * separate because their data and domain copy belong to the product; pair this\n * with `SessionHistoryPanel` and `EntryComposer` for the complete chat-first\n * structure.\n */\nexport function AgentWorkspaceLayout({\n children,\n navItems,\n sessions,\n apps,\n activeRoute,\n activeId,\n product,\n workspace,\n ...sidebarProps\n}: AgentWorkspaceLayoutProps) {\n const sessionNav = sessions\n ? (() => {\n const composed = composeSidebarSessions({\n loaderSessions: sessions.sessions,\n optimisticSessions: sessions.optimisticSessions,\n limit: sessions.limit ?? 20,\n totalCount: sessions.totalCount,\n liveUnreadIds: sessions.liveUnreadIds,\n locallyReadIds: sessions.locallyReadIds,\n currentSessionId: sessions.activeSessionId,\n })\n\n return buildSessionNavItem<WorkspaceIcon>({\n id: sessions.id,\n label: sessions.label,\n icon: sessions.icon,\n href: sessions.href,\n sessions: composed.sessions,\n hrefForSession: sessions.hrefForSession,\n activeSessionId: sessions.activeSessionId,\n respondingSessionIds: sessions.respondingSessionIds,\n actions: sessions.actions,\n overflow: composed.hasMore\n ? { href: sessions.href, label: sessions.overflowLabel }\n : undefined,\n emptyLabel: sessions.emptyLabel,\n untitledLabel: sessions.untitledLabel,\n prefetch: sessions.prefetch,\n defaultOpen: sessions.defaultOpen,\n })\n })()\n : undefined\n\n const appNavItems: SidebarLayoutNavItem[] = (apps?.items ?? []).map((app) => {\n const href = apps!.hrefForApp(app.id)\n if (!href.startsWith('/') || href.startsWith('//') || /[?#\\\\]/.test(href)) {\n throw new Error('Workspace app href must be a local route path')\n }\n return {\n id: 'workspace-app:' + app.id,\n label: app.name,\n icon: apps!.icon,\n href,\n prefetch: apps!.prefetch,\n }\n })\n const appRoutes: NavRouteDef[] = activeRoute\n ? appNavItems.map((item) => {\n const path = routePathFromHref(item.href!, activeRoute.base)\n if (!path) throw new Error('Workspace app href must be under the active workspace')\n return { id: item.id, path }\n })\n : []\n\n const historyRoutePath = sessions && activeRoute\n ? routePathFromHref(sessions.href, activeRoute.base)\n : null\n\n const resolvedActiveId = activeRoute\n ? resolveActiveNavId({\n ...activeRoute,\n routes: [\n ...activeRoute.routes,\n ...appRoutes,\n ...(sessionNav && historyRoutePath\n ? [{ id: sessions?.id ?? 'history', path: historyRoutePath }]\n : []),\n ],\n })\n : activeId\n\n const activeAppId = appNavItems.some((item) => item.id === resolvedActiveId)\n ? resolvedActiveId\n : undefined\n const appGroup: SidebarLayoutNavItem | undefined = apps && appNavItems.length > 0\n ? {\n id: 'workspace-apps',\n label: 'Apps',\n icon: apps.icon,\n expandable: true,\n defaultOpen: activeAppId !== undefined,\n subItems: appNavItems.map(({ id, label, icon, href, prefetch }) => ({\n id,\n label,\n icon,\n href: href!,\n prefetch,\n })),\n subActiveIds: activeAppId ? [activeAppId] : undefined,\n }\n : undefined\n const workspaceNavItems: SidebarLayoutNavItem[] = [\n ...navItems,\n ...(appGroup ? [appGroup] : []),\n ...(sessionNav ? [sessionNav] : []),\n ]\n\n const hideBelow = sidebarProps.hideBelow ?? 'lg'\n const identityProps = product\n ? {\n logo: product.mark,\n logoHref: product.href,\n railHeaderContent: (\n <AgentRailIdentity\n product={product}\n workspace={workspace}\n hideBelow={hideBelow}\n LinkComponent={sidebarProps.LinkComponent}\n />\n ),\n }\n : {}\n const layoutProps = {\n hideBelow,\n railLabels: true,\n ...identityProps,\n ...sidebarProps,\n }\n\n return (\n <SidebarLayout\n {...layoutProps}\n navItems={workspaceNavItems}\n activeId={activeAppId ? appGroup?.id : resolvedActiveId}\n >\n {children}\n </SidebarLayout>\n )\n}\n\nexport { AgentWorkspaceCompanion, createAgentWorkspaceCompanionTabs, type AgentWorkspaceCompanionHandle, type AgentWorkspaceCompanionProps, type AgentWorkspaceCompanionTab, type AgentWorkspaceCompanionTool, type AgentWorkspaceCompanionTools, type AgentWorkspaceCompanionNavigation } from './companion'\n\nexport { WorkspaceSwitcher, type WorkspaceSwitcherItem, type WorkspaceSwitcherProps } from '../web-react/workspace-switcher'\n\nexport { WorkspaceInitial } from '../web-react/workspace-switcher'\nexport {\n AgentRailIdentity,\n DEFAULT_WORKSPACE_NOUN,\n type AgentProductIdentity,\n type AgentRailIdentityProps,\n type AgentWorkspaceIdentity,\n type AgentWorkspaceNoun,\n} from './rail-identity'\n\nexport {\n WorkspaceList,\n type WorkspaceListAction,\n type WorkspaceListField,\n type WorkspaceListItem,\n type WorkspaceListProps,\n} from './workspace-list'\n","import { useCallback, useState, type ComponentType, type ReactNode } from 'react'\n\nimport { CheckGlyph, OVERLAY_SHADOW, PopoverSurface } from '../web-react/controls'\nimport { usePopoverDialog } from '../web-react/popover-dialog'\nimport { WorkspaceInitial } from '../web-react/workspace-switcher'\n\n/** What a product is called and how it is marked. The same three values for every product. */\nexport interface AgentProductIdentity {\n /** Short product name, for example `Legal` or `GTM`. */\n name: string\n /** Square brand mark, sized by the product for a 20px slot. */\n mark: ReactNode\n /** Where the mark leads: the workspace listing, or home when there is none. */\n href: string\n}\n\n/** The words a product uses for one workspace and for several. */\nexport interface AgentWorkspaceNoun {\n singular: string\n plural: string\n}\n\nexport const DEFAULT_WORKSPACE_NOUN: AgentWorkspaceNoun = { singular: 'workspace', plural: 'workspaces' }\n\n/** The workspace that is open, and where else this person can go. */\nexport interface AgentWorkspaceIdentity {\n id: string\n name: string\n /** Defaults to workspace / workspaces. */\n noun?: AgentWorkspaceNoun\n /** Every workspace this person can open, including the open one, in the product's order. */\n options?: readonly { id: string; name: string }[]\n /** Required with `options`: the route that opens a workspace. */\n hrefForWorkspace?: (workspaceId: string) => string\n /** The listing route. Adds an \"All …\" entry. */\n listHref?: string\n /** The creation route. Adds a \"New …\" entry. */\n createHref?: string\n}\n\n/** The number of workspaces past which the switcher offers a search field. */\nconst SEARCH_THRESHOLD = 7\n\nconst HIDE_ON_RAIL: Record<'md' | 'lg', string> = { md: 'md:hidden', lg: 'lg:hidden' }\n\nfunction capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\nexport interface AgentRailIdentityProps {\n product: AgentProductIdentity\n workspace?: AgentWorkspaceIdentity | null\n /**\n * The breakpoint below which the fixed rail is hidden. The rail draws the\n * mark itself; below this width the same content heads the mobile bar and\n * drawer, which have no mark of their own.\n */\n hideBelow?: 'md' | 'lg'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- matches SidebarLayout's router-agnostic link slot\n LinkComponent?: ComponentType<any>\n}\n\nfunction DefaultLink({ href, to, ...props }: { href?: string; to?: string; [key: string]: unknown }) {\n return <a href={href ?? to} {...props} />\n}\n\n/**\n * The top of every product's rail: which product, and which workspace.\n *\n * One line when no workspace is open (the listing), two when one is: the\n * workspace name, then the product beneath it. Both truncate inside the rail\n * and carry the full text as a tooltip, so a long name can never push into\n * the collapse button or the page beside the rail. It is a switcher only when\n * there is somewhere to switch to; a menu that lists one item is not offered.\n */\nexport function AgentRailIdentity({ product, workspace, hideBelow = 'lg', LinkComponent }: AgentRailIdentityProps) {\n const Link = LinkComponent ?? DefaultLink\n const mobileMark = (\n <span aria-hidden className={`flex h-7 w-7 shrink-0 items-center justify-center ${HIDE_ON_RAIL[hideBelow]}`}>\n {product.mark}\n </span>\n )\n\n if (!workspace) {\n return (\n <Link\n href={product.href}\n to={product.href}\n title={product.name}\n className=\"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 transition-colors hover:bg-accent\"\n >\n {mobileMark}\n <span className=\"min-w-0 flex-1 truncate text-sm font-semibold text-foreground\">{product.name}</span>\n </Link>\n )\n }\n\n const stack = (\n <span className=\"min-w-0 flex-1 text-left\">\n <span className=\"block truncate text-sm font-semibold leading-5 text-foreground\">{workspace.name}</span>\n <span className=\"block truncate text-xs leading-4 text-muted-foreground\">{product.name}</span>\n </span>\n )\n const others = (workspace.options ?? []).filter((option) => option.id !== workspace.id)\n const switchable = (others.length > 0 && workspace.hrefForWorkspace !== undefined) || Boolean(workspace.listHref) || Boolean(workspace.createHref)\n\n if (!switchable) {\n return (\n <div title={`${workspace.name} · ${product.name}`} className=\"flex w-full min-w-0 items-center gap-2 px-1.5 py-1\">\n {mobileMark}\n {stack}\n </div>\n )\n }\n\n return <WorkspaceMenu product={product} workspace={workspace} mobileMark={mobileMark} stack={stack} Link={Link} />\n}\n\nfunction WorkspaceMenu({\n product,\n workspace,\n mobileMark,\n stack,\n Link,\n}: {\n product: AgentProductIdentity\n workspace: AgentWorkspaceIdentity\n mobileMark: ReactNode\n stack: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n}) {\n const [open, setOpen] = useState(false)\n const [query, setQuery] = useState('')\n const changeOpen = useCallback((next: boolean) => {\n setOpen(next)\n if (!next) setQuery('')\n }, [])\n // A non-modal dialog, like WorkspaceSwitcher: opening focuses the first\n // control, and Tab past the last one returns beside the trigger.\n const { containerRef, triggerRef, panelRef, triggerProps, id: panelId } = usePopoverDialog(open, changeOpen)\n const noun = workspace.noun ?? DEFAULT_WORKSPACE_NOUN\n const options = workspace.hrefForWorkspace ? workspace.options ?? [] : []\n const search = query.trim().toLocaleLowerCase()\n const visible = search ? options.filter((option) => option.name.toLocaleLowerCase().includes(search)) : options\n const close = () => changeOpen(false)\n const rowClass = 'flex min-h-9 w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent'\n\n return (\n <div ref={containerRef} className=\"w-full min-w-0\">\n <button\n type=\"button\"\n {...triggerProps}\n aria-label={`${capitalize(noun.singular)}: ${workspace.name}. Switch ${noun.singular}`}\n title={`${workspace.name} · ${product.name}`}\n onClick={() => changeOpen(!open)}\n className=\"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 transition-colors hover:bg-accent aria-expanded:bg-accent\"\n >\n {mobileMark}\n {stack}\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <path d=\"m8 9 4-4 4 4m-8 6 4 4 4-4\" />\n </svg>\n </button>\n <PopoverSurface\n open={open}\n id={panelId}\n role=\"dialog\"\n aria-label={`Switch ${noun.singular}`}\n side=\"below\"\n triggerRef={triggerRef}\n panelRef={panelRef}\n contentKey={`${query}:${options.length}`}\n className={`w-72 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-lg border border-card-edge bg-popover p-1.5 text-foreground ${OVERLAY_SHADOW}`}\n >\n {options.length > SEARCH_THRESHOLD && (\n <input\n data-autofocus\n aria-label={`Search ${noun.plural}`}\n placeholder={`Search ${noun.plural}`}\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"mb-1.5 h-9 w-full rounded-md border border-border bg-background px-2.5 text-sm text-foreground\"\n />\n )}\n {options.length > 0 && (\n <div className=\"max-h-72 overflow-y-auto\">\n {visible.map((option) => (\n <Link\n key={option.id}\n href={workspace.hrefForWorkspace!(option.id)}\n to={workspace.hrefForWorkspace!(option.id)}\n aria-current={option.id === workspace.id ? 'page' : undefined}\n title={option.name}\n onClick={close}\n className={rowClass}\n >\n <WorkspaceInitial name={option.name} />\n <span className=\"min-w-0 flex-1 truncate\">{option.name}</span>\n {option.id === workspace.id && <CheckGlyph className=\"h-4 w-4 shrink-0 text-primary\" />}\n </Link>\n ))}\n {visible.length === 0 && (\n <p role=\"status\" className=\"px-2 py-2 text-sm text-muted-foreground\">\n No {noun.plural} match “{query.trim()}”.\n </p>\n )}\n </div>\n )}\n {(workspace.listHref || workspace.createHref) && (\n <div className={options.length > 0 ? 'mt-1.5 border-t border-border pt-1.5' : undefined}>\n {workspace.listHref && (\n <Link href={workspace.listHref} to={workspace.listHref} onClick={close} className={rowClass}>\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <rect x=\"4\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"4\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" />\n </svg>\n <span className=\"min-w-0 flex-1 truncate\">All {noun.plural}</span>\n </Link>\n )}\n {workspace.createHref && (\n <Link href={workspace.createHref} to={workspace.createHref} onClick={close} className={rowClass}>\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n <span className=\"min-w-0 flex-1 truncate\">New {noun.singular}</span>\n </Link>\n )}\n </div>\n )}\n </PopoverSurface>\n </div>\n )\n}\n","import { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, type ReactNode } from 'react'\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@tangle-network/sandbox-ui/primitives'\nimport { WorkspaceLayout } from '@tangle-network/sandbox-ui/workspace'\nimport { FlaskConical, FolderOpen, GitCompare, Monitor, Terminal } from 'lucide-react'\n\nexport interface AgentWorkspaceCompanionTab {\n id: string\n label: string\n icon?: ReactNode\n /** Retain a visited tab through tab switches, pane closure, and viewport changes. */\n keepMounted?: boolean\n renderContent: (state: { active: boolean }) => ReactNode\n}\n\nexport type AgentWorkspaceCompanionTool = 'files' | 'agent' | 'terminal' | 'changes' | 'preview'\n\n/** Supply only tools the product can actually serve. Content remains product-owned. */\nexport type AgentWorkspaceCompanionTools = Partial<Record<AgentWorkspaceCompanionTool, AgentWorkspaceCompanionTab['renderContent']>>\n\nconst companionTools = [\n { id: 'files', label: 'Files', Icon: FolderOpen },\n { id: 'agent', label: 'Agent', Icon: FlaskConical },\n { id: 'terminal', label: 'Terminal', Icon: Terminal },\n { id: 'changes', label: 'Changes', Icon: GitCompare },\n { id: 'preview', label: 'Preview', Icon: Monitor },\n] as const\n\n/** Canonical order, labels, icons and lazy retention for companion tools. */\nexport function createAgentWorkspaceCompanionTabs(tools: AgentWorkspaceCompanionTools): AgentWorkspaceCompanionTab[] {\n return companionTools.flatMap(({ id, label, Icon }) => {\n const renderContent = tools[id]\n return renderContent ? [{ id, label, icon: <Icon className=\"h-3.5 w-3.5\" aria-hidden />, keepMounted: true, renderContent }] : []\n })\n}\n\nexport interface AgentWorkspaceCompanionNavigation {\n content: ReactNode\n header?: ReactNode\n open?: boolean\n onOpenChange?: (open: boolean) => void\n label?: string\n defaultWidth?: number\n minWidth?: number\n maxWidth?: number\n collapsedControl?: ReactNode\n}\n\nexport interface AgentWorkspaceCompanionHandle {\n openTab: (tabId: string) => boolean\n}\n\nexport interface AgentWorkspaceCompanionProps {\n children: ReactNode\n /** Use tools for shared defaults; tabs overrides them for product-specific navigation. */\n tabs?: readonly AgentWorkspaceCompanionTab[]\n tools?: AgentWorkspaceCompanionTools\n /** Optional session navigation, composed in the same responsive layout. */\n navigation?: AgentWorkspaceCompanionNavigation\n keyboardShortcuts?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n defaultOpen?: boolean\n activeTabId?: string\n onActiveTabChange?: (tabId: string) => void\n defaultActiveTabId?: string\n /** Namespace for remembered tab selection and underlying pane dimensions. */\n persistenceKey?: string\n label?: string\n defaultWidth?: number\n className?: string\n}\n\n/** Product-owned tools beside a conversation; omitted tools have no tabs or effects. */\nexport const AgentWorkspaceCompanion = forwardRef<AgentWorkspaceCompanionHandle, AgentWorkspaceCompanionProps>(function AgentWorkspaceCompanion({\n children,\n tabs: customTabs,\n tools,\n navigation,\n keyboardShortcuts,\n open: controlledOpen,\n onOpenChange,\n defaultOpen = false,\n activeTabId,\n onActiveTabChange,\n defaultActiveTabId,\n persistenceKey,\n label = 'Workspace tools',\n defaultWidth = 420,\n className,\n}, ref) {\n const tabs = customTabs ?? createAgentWorkspaceCompanionTabs(tools ?? {})\n const [uncontrolledOpen, setOpen] = useState(defaultOpen)\n const open = controlledOpen ?? uncontrolledOpen\n const [selection, setSelection] = useState({ key: persistenceKey, id: defaultActiveTabId })\n const [visits, setVisits] = useState<{ key: string | undefined; ids: ReadonlySet<string> }>(() => ({ key: persistenceKey, ids: new Set() }))\n const requested = activeTabId ?? (selection.key === persistenceKey ? selection.id : defaultActiveTabId)\n const active = tabs.find((tab) => tab.id === requested)?.id ?? tabs[0]?.id\n const visited = visits.key === persistenceKey ? visits.ids : new Set<string>()\n const storageKey = persistenceKey ? `${persistenceKey}:companion-tab` : undefined\n\n const pendingRestoration = useRef<{ key: string | undefined; id: string | undefined } | undefined>(undefined)\n const reconciledSelection = useRef<string | undefined>(undefined)\n const restoredKey = useRef<string | undefined>(undefined)\n useEffect(() => {\n const key = JSON.stringify([persistenceKey, defaultActiveTabId])\n if (restoredKey.current === key || tabs.length === 0) return\n let id = activeTabId ?? defaultActiveTabId\n if (storageKey) {\n try { id = window.localStorage.getItem(storageKey) ?? id } catch { /* Browser storage is optional. */ }\n }\n const resolved = tabs.find((tab) => tab.id === id)?.id ?? tabs[0]?.id\n restoredKey.current = key\n pendingRestoration.current = { key: persistenceKey, id: resolved }\n setSelection({ key: persistenceKey, id: resolved })\n if (resolved && resolved !== activeTabId) {\n reconciledSelection.current = JSON.stringify([persistenceKey, requested, resolved])\n onActiveTabChange?.(resolved)\n }\n }, [storageKey, persistenceKey, defaultActiveTabId, activeTabId, requested, tabs, onActiveTabChange])\n\n useEffect(() => {\n // Let restored selection reach the controlled parent before reconciling stale props.\n const pending = pendingRestoration.current\n if (pending) {\n const acknowledged = activeTabId === undefined\n ? selection.key === pending.key && selection.id === pending.id\n : activeTabId === pending.id\n if (!acknowledged) return\n pendingRestoration.current = undefined\n }\n if (!active || tabs.some((tab) => tab.id === requested)) {\n reconciledSelection.current = undefined\n return\n }\n const key = JSON.stringify([persistenceKey, requested, active])\n if (reconciledSelection.current === key) return\n reconciledSelection.current = key\n setSelection({ key: persistenceKey, id: active })\n onActiveTabChange?.(active)\n }, [active, activeTabId, requested, selection, persistenceKey, tabs, onActiveTabChange])\n\n useEffect(() => {\n if (!open || !active) return\n setVisits((previous) => {\n const ids = previous.key === persistenceKey ? previous.ids : new Set<string>()\n return ids.has(active) ? previous : { key: persistenceKey, ids: new Set([...ids, active]) }\n })\n }, [open, active, persistenceKey])\n\n const selectTab = useCallback((id: string) => {\n if (!tabs.some((tab) => tab.id === id)) return false\n setSelection({ key: persistenceKey, id })\n onActiveTabChange?.(id)\n if (storageKey) {\n try { window.localStorage.setItem(storageKey, id) } catch { /* Selection still works without storage. */ }\n }\n return true\n }, [tabs, persistenceKey, storageKey, onActiveTabChange])\n const changeOpen = useCallback((next: boolean) => {\n setOpen(next)\n onOpenChange?.(next)\n }, [onOpenChange])\n\n useImperativeHandle(ref, () => ({\n openTab(id) {\n if (!selectTab(id)) return false\n changeOpen(true)\n return true\n },\n }), [selectTab, changeOpen])\n\n if (tabs.length === 0 && !navigation) return <>{children}</>\n\n return (\n <Tabs key={persistenceKey} value={active} onValueChange={selectTab} className={`flex h-full min-h-0 min-w-0 flex-1 flex-col ${className ?? ''}`}>\n <WorkspaceLayout\n className=\"h-full min-h-0 min-w-0 flex-1\"\n // The expander takes its own column at the conversation's edge. Floated\n // over the conversation it covered the top-right of a right-aligned\n // user message on a phone, hiding part of its text.\n collapsedControlsPlacement=\"edge\"\n keepRightMounted\n center={children}\n left={navigation?.content}\n leftContentClassName=\"py-0\"\n leftHeader={navigation && (navigation.header !== undefined ? navigation.header : <span className=\"text-sm font-medium\">{navigation.label ?? 'Chats'}</span>)}\n leftOpen={navigation?.open}\n onLeftOpenChange={navigation?.onOpenChange}\n leftLabel={navigation?.label ?? 'Chats'}\n defaultLeftWidth={navigation?.defaultWidth ?? 260}\n minLeftWidth={navigation?.minWidth ?? 200}\n maxLeftWidth={navigation?.maxWidth ?? 400}\n leftCollapsedControl={navigation?.collapsedControl}\n keyboardShortcuts={keyboardShortcuts}\n rightOpen={open}\n onRightOpenChange={changeOpen}\n rightLabel={label}\n defaultRightWidth={defaultWidth}\n persistenceKey={persistenceKey}\n minRightWidth={280}\n rightContentClassName=\"flex flex-col overflow-hidden\"\n rightHeader={tabs.length > 0 ? <CompanionTabList tabs={tabs} active={active} label={label} /> : undefined}\n right={tabs.length > 0 ? tabs.map((tab) => {\n const isActive = tab.id === active\n const retained = tab.keepMounted && visited.has(tab.id)\n if (!(open && isActive) && !retained) return null\n return (\n <TabsContent\n key={tab.id}\n value={tab.id}\n forceMount={retained ? true : undefined}\n hidden={!open || !isActive}\n className=\"m-0 h-full min-h-0 min-w-0 flex-1 data-[state=inactive]:hidden\"\n >\n {tab.renderContent({ active: open && isActive })}\n </TabsContent>\n )\n }) : undefined}\n />\n </Tabs>\n )\n})\n\n/**\n * The companion's tab row. When every labelled tab does not fit the pane (a\n * phone drawer, a narrow resized pane), inactive tabs that have an icon drop to\n * icon-only and the active tab keeps its label, so no tab hides behind the\n * close button. Labels stay in the accessibility tree either way. The row\n * returns to full labels once the pane is wide enough for them again.\n */\nfunction CompanionTabList({ tabs, active, label }: { tabs: readonly AgentWorkspaceCompanionTab[]; active: string | undefined; label: string }) {\n const frameRef = useRef<HTMLDivElement>(null)\n const fullWidth = useRef(0)\n const [compact, setCompact] = useState(false)\n const signature = tabs.map((tab) => `${tab.id}\\u0000${tab.label}\\u0000${tab.icon ? 1 : 0}`).join('\\u0001')\n\n useLayoutEffect(() => {\n fullWidth.current = 0\n setCompact(false)\n }, [signature])\n\n useLayoutEffect(() => {\n const frame = frameRef.current\n const list = frame?.firstElementChild\n if (!frame || !(list instanceof HTMLElement)) return\n const fit = () => {\n const available = frame.clientWidth\n if (!compact) {\n fullWidth.current = list.scrollWidth\n if (list.scrollWidth > available + 1) setCompact(true)\n } else if (fullWidth.current > 0 && available >= fullWidth.current) {\n setCompact(false)\n }\n }\n fit()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(fit)\n observer.observe(frame)\n return () => observer.disconnect()\n }, [compact, signature])\n\n useEffect(() => {\n const trigger = frameRef.current?.querySelector<HTMLElement>('[role=\"tab\"][data-state=\"active\"]')\n trigger?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' })\n }, [active, compact])\n\n return (\n <div ref={frameRef} className=\"min-w-0\" data-compact={compact ? '' : undefined}>\n <TabsList aria-label={label} className=\"h-9 max-w-full justify-start overflow-x-auto bg-transparent p-0\">\n {tabs.map((tab) => {\n const iconOnly = compact && tab.icon && tab.id !== active\n return (\n <TabsTrigger\n key={tab.id}\n value={tab.id}\n title={iconOnly ? tab.label : undefined}\n className={iconOnly ? 'gap-1.5 px-2 text-sm' : 'gap-1.5 px-2.5 text-sm'}\n >\n {tab.icon}<span className={iconOnly ? 'sr-only' : undefined}>{tab.label}</span>\n </TabsTrigger>\n )\n })}\n </TabsList>\n </div>\n )\n}\n","import { useId, useMemo, useState, type ComponentType, type ReactNode } from 'react'\n\nimport { ActionDialog, ActionDialogButton } from '../web-react/action-dialog'\nimport { OVERLAY_SHADOW, PopoverSurface, usePopover } from '../web-react/controls'\nimport { WorkspaceInitial } from '../web-react/workspace-switcher'\nimport { DEFAULT_WORKSPACE_NOUN, type AgentWorkspaceNoun } from './rail-identity'\n\n/** One workspace as the listing shows it. */\nexport interface WorkspaceListItem {\n id: string\n name: string\n /** The route that opens it. */\n href: string\n /** One line under the name. Not shown when it only repeats the name. */\n description?: string | null\n /** Last activity. Shown as a short date. */\n updatedAt?: string | number | Date | null\n /** Values for the product's `fields`, keyed by field id. */\n values?: Readonly<Record<string, ReactNode>>\n /** Replaces the initial avatar, for example with a logo the product already has. */\n avatar?: ReactNode\n}\n\n/** A product column: a value the user compares across workspaces (tax year, status, owner). */\nexport interface WorkspaceListField {\n id: string\n label: string\n}\n\n/** A non-destructive product action in an item's overflow menu. */\nexport interface WorkspaceListAction {\n id: string\n label: string\n onSelect: (item: WorkspaceListItem) => void\n}\n\nexport interface WorkspaceListProps {\n items: readonly WorkspaceListItem[]\n /** The product's words for one workspace and several. Defaults to workspace / workspaces. */\n noun?: AgentWorkspaceNoun\n /** Page title. Defaults to the capitalized plural noun. */\n title?: string\n /** One sentence under the title, when the page needs one. */\n description?: ReactNode\n /** `list` rows for records people compare; `grid` cards for a handful of rich projects. */\n layout?: 'list' | 'grid'\n /** Product values, shown as columns (list) or under the description (grid). */\n fields?: readonly WorkspaceListField[]\n /**\n * The one primary action, labelled \"New {singular}\" unless `label` says otherwise.\n * `href` navigates; `onSelect` opens the product's own creation flow; `onCreate`\n * asks for a name in the shared dialog and hands it over — reject with an Error\n * to show its message, and navigate to the new workspace from inside it.\n */\n create?: {\n label?: string\n href?: string\n onSelect?: () => void\n onCreate?: (name: string) => Promise<void>\n /** Placeholder for the name field. Defaults to \"{Singular} name\". */\n namePlaceholder?: string\n }\n /** First-use copy. The create action is offered beneath it. */\n empty?: { title?: string; description?: string }\n /** Persist a new name. Reject with an Error to show its message in the dialog. */\n rename?: (item: WorkspaceListItem, name: string) => Promise<void>\n /** Delete for good. Offered in the overflow menu, behind a confirmation. */\n remove?: (item: WorkspaceListItem) => Promise<void>\n /** What deleting loses, for the confirmation. */\n removeConsequence?: (item: WorkspaceListItem) => string\n /** Extra overflow-menu actions. */\n actions?: (item: WorkspaceListItem) => readonly WorkspaceListAction[]\n /** Product content between the header and the items, such as a home summary. */\n children?: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot, same as SidebarLayout\n LinkComponent?: ComponentType<any>\n /** Formats `updatedAt`. Defaults to a short month and day, with the year when it is not this year. */\n formatDate?: (value: Date) => string\n}\n\n/** The number of items past which the listing offers a search field. */\nconst SEARCH_THRESHOLD = 8\n\n// Fixed widths keep every row's columns on the same x, whatever a date or value renders as.\nconst FIELD_CELL = 'hidden w-32 min-w-0 shrink-0 md:block'\nconst DATE_CELL = 'w-20 shrink-0 text-right sm:w-24'\n\nfunction DefaultLink({ href, to, ...props }: { href?: string; to?: string; [key: string]: unknown }) {\n return <a href={href ?? to} {...props} />\n}\n\nfunction capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\nfunction defaultFormatDate(value: Date): string {\n const sameYear = value.getFullYear() === new Date().getFullYear()\n return value.toLocaleDateString(undefined, sameYear ? { month: 'short', day: 'numeric' } : { month: 'short', day: 'numeric', year: 'numeric' })\n}\n\nfunction present(value: ReactNode): boolean {\n return value !== null && value !== undefined && value !== false && value !== ''\n}\n\nfunction toDate(value: WorkspaceListItem['updatedAt']): Date | null {\n if (value === null || value === undefined || value === '') return null\n const date = value instanceof Date ? value : new Date(value)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\n/** A description is noise when it says the name again (\"GTM Agent / GTM Agent\"). */\nfunction usefulDescription(item: WorkspaceListItem): string | null {\n const text = item.description?.trim()\n if (!text) return null\n return text.toLocaleLowerCase() === item.name.trim().toLocaleLowerCase() ? null : text\n}\n\n/**\n * The listing every product opens on: one title, one primary action, the\n * workspaces, and nothing that counts them. Destructive actions live in each\n * item's overflow menu behind a confirmation, never as an icon on every row.\n * The product supplies its noun, its columns, and its create route; render it\n * inside `AgentWorkspaceLayout` (with no `workspace`) so the listing wears the\n * same shell as the workspace it opens.\n */\nexport function WorkspaceList({\n items,\n noun = DEFAULT_WORKSPACE_NOUN,\n title,\n description,\n layout = 'list',\n fields = [],\n create,\n empty,\n rename,\n remove,\n removeConsequence,\n actions,\n children,\n LinkComponent,\n formatDate = defaultFormatDate,\n}: WorkspaceListProps) {\n const Link = LinkComponent ?? DefaultLink\n const headingId = useId()\n const [query, setQuery] = useState('')\n const [renaming, setRenaming] = useState<WorkspaceListItem | null>(null)\n const [renameValue, setRenameValue] = useState('')\n const [removing, setRemoving] = useState<WorkspaceListItem | null>(null)\n const [creating, setCreating] = useState(false)\n const [createValue, setCreateValue] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const search = query.trim().toLocaleLowerCase()\n const visible = useMemo(\n () => (search ? items.filter((item) => item.name.toLocaleLowerCase().includes(search)) : items),\n [items, search],\n )\n const createLabel = create?.label ?? `New ${noun.singular}`\n const openCreate = () => {\n setError(null)\n setCreateValue('')\n setCreating(true)\n }\n const createControl = create\n ? <CreateButton create={create.onCreate && !create.href ? { ...create, onSelect: openCreate } : create} label={createLabel} Link={Link} />\n : null\n const submitCreate = () => {\n const name = createValue.trim()\n if (!name || !create?.onCreate) return\n void run(() => create.onCreate!(name), () => setCreating(false))\n }\n\n const hasDates = items.some((item) => toDate(item.updatedAt) !== null)\n const hasMenu = Boolean(rename) || Boolean(remove) || Boolean(actions)\n const menuFor = (item: WorkspaceListItem): MenuEntry[] => [\n ...(rename ? [{ id: 'rename', label: 'Rename', onSelect: () => { setError(null); setRenaming(item); setRenameValue(item.name) } }] : []),\n ...(actions?.(item) ?? []).map((action) => ({ id: action.id, label: action.label, onSelect: () => action.onSelect(item) })),\n ...(remove ? [{ id: 'delete', label: 'Delete', destructive: true, onSelect: () => { setError(null); setRemoving(item) } }] : []),\n ]\n\n const run = async (work: () => Promise<void>, done: () => void) => {\n setBusy(true)\n setError(null)\n try {\n await work()\n done()\n } catch (cause) {\n setError(cause instanceof Error && cause.message ? cause.message : 'That did not save. Try again.')\n } finally {\n setBusy(false)\n }\n }\n\n const submitRename = () => {\n if (!renaming || !rename) return\n const name = renameValue.trim()\n if (!name || name === renaming.name) {\n setRenaming(null)\n return\n }\n void run(() => rename(renaming, name), () => setRenaming(null))\n }\n\n return (\n <section aria-labelledby={headingId} className=\"mx-auto w-full max-w-5xl px-4 py-6 sm:px-6 sm:py-8 lg:px-8\">\n <header className=\"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\">\n <div className=\"min-w-0 flex-1 [overflow-wrap:anywhere]\">\n <h1 id={headingId} className=\"text-xl font-semibold tracking-tight text-foreground\">\n {title ?? capitalize(noun.plural)}\n </h1>\n {description != null && <div className=\"mt-1 max-w-prose text-sm text-muted-foreground\">{description}</div>}\n </div>\n {items.length > 0 && createControl}\n </header>\n\n {children != null && <div className=\"mt-6\">{children}</div>}\n\n {items.length === 0 ? (\n <div className=\"mt-6 flex flex-col items-center rounded-xl border border-dashed border-border px-6 py-14 text-center\">\n <span aria-hidden className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary\">\n <svg className=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <rect x=\"4\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"4\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><path d=\"M16.75 13.5v6.5M13.5 16.75H20\" />\n </svg>\n </span>\n <h2 className=\"mt-4 text-base font-semibold text-foreground\">{empty?.title ?? `No ${noun.plural} yet`}</h2>\n {empty?.description && <p className=\"mt-1.5 max-w-sm text-sm text-muted-foreground\">{empty.description}</p>}\n {createControl && <div className=\"mt-5\">{createControl}</div>}\n </div>\n ) : (\n <>\n {items.length > SEARCH_THRESHOLD && (\n <div className=\"mt-6\">\n <input\n type=\"search\"\n aria-label={`Search ${noun.plural}`}\n placeholder={`Search ${noun.plural}`}\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"h-9 w-full max-w-sm rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n </div>\n )}\n {visible.length === 0 ? (\n <p role=\"status\" className=\"mt-6 rounded-xl border border-border px-4 py-8 text-center text-sm text-muted-foreground\">\n No {noun.plural} match “{query.trim()}”.{' '}\n <button type=\"button\" onClick={() => setQuery('')} className=\"font-medium text-foreground underline underline-offset-2\">\n Clear search\n </button>\n </p>\n ) : layout === 'grid' ? (\n <ul className={`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 ${items.length > SEARCH_THRESHOLD ? 'mt-3' : 'mt-6'}`}>\n {visible.map((item) => (\n <GridCard key={item.id} item={item} fields={fields} menu={menuFor(item)} Link={Link} formatDate={formatDate} />\n ))}\n </ul>\n ) : (\n <div className={`overflow-hidden rounded-xl border border-border bg-card ${items.length > SEARCH_THRESHOLD ? 'mt-3' : 'mt-6'}`}>\n {fields.length > 0 && (\n <div aria-hidden className=\"hidden items-center gap-3 border-b border-border px-4 py-2 text-xs font-medium text-muted-foreground md:flex\">\n <span className=\"w-10 shrink-0\" />\n <span className=\"min-w-0 flex-1\">Name</span>\n {fields.map((field) => (\n <span key={field.id} className={`${FIELD_CELL} truncate`}>{field.label}</span>\n ))}\n <span className={DATE_CELL}>{hasDates ? 'Updated' : ''}</span>\n {hasMenu && <span className=\"w-8 shrink-0 [@media(pointer:coarse)]:w-11\" />}\n </div>\n )}\n <ul className=\"divide-y divide-border\">\n {visible.map((item) => (\n <ListRow key={item.id} item={item} fields={fields} menu={menuFor(item)} reserveMenu={hasMenu} Link={Link} formatDate={formatDate} />\n ))}\n </ul>\n </div>\n )}\n </>\n )}\n\n {renaming && (\n <ActionDialog\n title={`Rename ${noun.singular}`}\n onClose={() => setRenaming(null)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setRenaming(null)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton onClick={submitRename} disabled={busy || !renameValue.trim()}>Save</ActionDialogButton>\n </>\n }\n >\n <label htmlFor={`${headingId}-rename`} className=\"text-xs text-muted-foreground\">Name</label>\n <input\n id={`${headingId}-rename`}\n value={renameValue}\n autoFocus\n onChange={(event) => setRenameValue(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !busy) {\n event.preventDefault()\n submitRename()\n }\n }}\n className=\"mt-1.5 h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground\"\n />\n </ActionDialog>\n )}\n\n {creating && create?.onCreate && (\n <ActionDialog\n title={createLabel}\n onClose={() => setCreating(false)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setCreating(false)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton onClick={submitCreate} disabled={busy || !createValue.trim()}>Create</ActionDialogButton>\n </>\n }\n >\n <label htmlFor={`${headingId}-create`} className=\"text-xs text-muted-foreground\">Name</label>\n <input\n id={`${headingId}-create`}\n value={createValue}\n autoFocus\n placeholder={create.namePlaceholder ?? `${capitalize(noun.singular)} name`}\n onChange={(event) => setCreateValue(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !busy) {\n event.preventDefault()\n submitCreate()\n }\n }}\n className=\"mt-1.5 h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n </ActionDialog>\n )}\n\n {removing && remove && (\n <ActionDialog\n title={`Delete ${noun.singular}?`}\n onClose={() => setRemoving(null)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setRemoving(null)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton variant=\"destructive\" onClick={() => void run(() => remove(removing), () => setRemoving(null))} disabled={busy}>\n Delete\n </ActionDialogButton>\n </>\n }\n >\n <p className=\"break-words text-sm text-muted-foreground\">\n {removeConsequence?.(removing) ?? `“${removing.name}” and everything in it will be deleted. This cannot be undone.`}\n </p>\n </ActionDialog>\n )}\n </section>\n )\n}\n\ninterface MenuEntry {\n id: string\n label: string\n destructive?: boolean\n onSelect: () => void\n}\n\ninterface ItemProps {\n reserveMenu?: boolean\n item: WorkspaceListItem\n fields: readonly WorkspaceListField[]\n menu: MenuEntry[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n formatDate: (value: Date) => string\n}\n\nfunction UpdatedAt({ value, formatDate, className = 'shrink-0' }: { value: WorkspaceListItem['updatedAt']; formatDate: (value: Date) => string; className?: string }) {\n const date = toDate(value)\n if (!date) return <span className={className} />\n return (\n // Server and browser can format a date differently (zone, locale); the\n // browser's reading is the one the user should see.\n <time dateTime={date.toISOString()} suppressHydrationWarning className={`${className} text-xs tabular-nums text-muted-foreground`}>\n {formatDate(date)}\n </time>\n )\n}\n\n/**\n * The name is the row's link, stretched over the whole row with an `after:`\n * overlay, so the overflow menu can sit on top as a real sibling button\n * instead of a button nested inside a link.\n */\nfunction ListRow({ item, fields, menu, reserveMenu, Link, formatDate }: ItemProps) {\n const detail = usefulDescription(item)\n const mobileFields = fields.filter((field) => present(item.values?.[field.id]))\n return (\n <li className=\"group relative isolate flex min-h-16 items-center gap-3 px-4 py-3 transition-colors hover:bg-accent/60\">\n {item.avatar ?? <WorkspaceInitial name={item.name} size=\"lg\" />}\n <div className=\"min-w-0 flex-1\">\n <Link\n href={item.href}\n to={item.href}\n title={item.name}\n className=\"block truncate text-sm font-medium text-foreground after:absolute after:inset-0 after:content-[''] focus-visible:outline-none focus-visible:after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring\"\n >\n {item.name}\n </Link>\n {detail && <p className=\"truncate text-xs text-muted-foreground\" title={detail}>{detail}</p>}\n {/* Below md the columns are hidden, so their values ride under the name instead. */}\n {mobileFields.length > 0 && (\n <p className=\"truncate text-xs text-muted-foreground md:hidden\">\n {mobileFields.map((field, index) => (\n <span key={field.id}>\n {index > 0 && ' · '}\n <span className=\"sr-only\">{field.label}: </span>\n {item.values![field.id]}\n </span>\n ))}\n </p>\n )}\n </div>\n {fields.map((field) => (\n <div key={field.id} className={`${FIELD_CELL} truncate text-sm text-muted-foreground`}>\n <span className=\"sr-only\">{field.label}: </span>\n {present(item.values?.[field.id]) ? item.values![field.id] : '—'}\n </div>\n ))}\n <UpdatedAt value={item.updatedAt} formatDate={formatDate} className={DATE_CELL} />\n {menu.length > 0 ? <ItemMenu item={item} entries={menu} /> : reserveMenu ? <span className=\"w-8 shrink-0 [@media(pointer:coarse)]:w-11\" /> : null}\n </li>\n )\n}\n\nfunction GridCard({ item, fields, menu, Link, formatDate }: ItemProps) {\n const detail = usefulDescription(item)\n const shownFields = fields.filter((field) => present(item.values?.[field.id]))\n return (\n <li className=\"group relative isolate flex min-h-36 flex-col overflow-hidden rounded-xl border border-border bg-card p-4 transition-[border-color,box-shadow] hover:border-primary/40 hover:shadow-sm\">\n <span aria-hidden className=\"pointer-events-none absolute inset-x-0 top-0 -z-10 h-16 bg-gradient-to-b from-primary/[0.07] to-transparent\" />\n <div className=\"flex items-start gap-3\">\n {item.avatar ?? <WorkspaceInitial name={item.name} size=\"lg\" />}\n <div className=\"min-w-0 flex-1 pt-0.5\">\n <Link\n href={item.href}\n to={item.href}\n title={item.name}\n className=\"line-clamp-2 break-words text-sm font-semibold text-foreground after:absolute after:inset-0 after:content-[''] focus-visible:outline-none focus-visible:after:rounded-xl focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring\"\n >\n {item.name}\n </Link>\n {detail && <p className=\"mt-0.5 truncate text-xs text-muted-foreground\" title={detail}>{detail}</p>}\n </div>\n {menu.length > 0 && <ItemMenu item={item} entries={menu} />}\n </div>\n <div className=\"mt-auto flex items-end justify-between gap-3 pt-4\">\n {shownFields.length > 0 ? (\n <dl className=\"flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs\">\n {shownFields.map((field) => (\n <div key={field.id} className=\"flex min-w-0 gap-1\">\n <dt className=\"text-muted-foreground\">{field.label}</dt>\n <dd className=\"truncate font-medium text-foreground\">{item.values?.[field.id]}</dd>\n </div>\n ))}\n </dl>\n ) : <span />}\n <UpdatedAt value={item.updatedAt} formatDate={formatDate} />\n </div>\n </li>\n )\n}\n\nfunction ItemMenu({ item, entries }: { item: WorkspaceListItem; entries: MenuEntry[] }) {\n const [open, setOpen] = useState(false)\n const panelId = useId()\n const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen)\n return (\n <div ref={containerRef} className=\"relative z-10 shrink-0\">\n <button\n type=\"button\"\n {...triggerProps}\n aria-label={`Actions for ${item.name}`}\n aria-controls={open ? panelId : undefined}\n onClick={() => setOpen(!open)}\n // Hidden until hover only where hover exists; a touch screen of any width shows it.\n className=\"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:w-11 transition hover:bg-muted hover:text-foreground focus-visible:opacity-100 aria-expanded:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100\"\n >\n <svg aria-hidden className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <circle cx=\"5\" cy=\"12\" r=\"1.6\" /><circle cx=\"12\" cy=\"12\" r=\"1.6\" /><circle cx=\"19\" cy=\"12\" r=\"1.6\" />\n </svg>\n </button>\n <PopoverSurface\n open={open}\n id={panelId}\n role=\"menu\"\n aria-label={`Actions for ${item.name}`}\n side=\"below\"\n align=\"end\"\n triggerRef={triggerRef}\n panelRef={panelRef}\n className={`w-44 overflow-hidden rounded-md border border-card-edge bg-popover py-1 ${OVERLAY_SHADOW}`}\n >\n {entries.map((entry, index) => (\n <button\n key={entry.id}\n type=\"button\"\n role=\"menuitem\"\n onClick={() => {\n setOpen(false)\n // The dialog this opens returns focus to whatever had it — the trigger, not <body>.\n triggerRef.current?.focus()\n entry.onSelect()\n }}\n className={`block w-full px-3 py-1.5 text-left text-sm transition ${\n entry.destructive ? 'text-destructive hover:bg-destructive/10' : 'text-foreground hover:bg-accent'\n } ${entry.destructive && index > 0 ? 'mt-1 border-t border-border pt-2' : ''}`}\n >\n {entry.label}\n </button>\n ))}\n </PopoverSurface>\n </div>\n )\n}\n\nfunction CreateButton({\n create,\n label,\n Link,\n}: {\n create: NonNullable<WorkspaceListProps['create']>\n label: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n}) {\n const className = 'inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md bg-primary px-3.5 text-sm font-medium text-primary-foreground transition hover:opacity-90 active:scale-[0.98]'\n const icon = (\n <svg aria-hidden className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n )\n if (create.href) {\n return (\n <Link href={create.href} to={create.href} className={className}>\n {icon}\n {label}\n </Link>\n )\n }\n return (\n <button type=\"button\" onClick={create.onSelect} className={className}>\n {icon}\n {label}\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAyE;;;ACAlF,SAAS,aAAa,gBAAoD;AA+DjE,cAsBH,YAtBG;AAzCF,IAAM,yBAA6C,EAAE,UAAU,aAAa,QAAQ,aAAa;AAmBxG,IAAM,mBAAmB;AAEzB,IAAM,eAA4C,EAAE,IAAI,aAAa,IAAI,YAAY;AAErF,SAAS,WAAW,MAAsB;AACxC,SAAO,KAAK,OAAO,CAAC,EAAE,kBAAkB,IAAI,KAAK,MAAM,CAAC;AAC1D;AAeA,SAAS,YAAY,EAAE,MAAM,IAAI,GAAG,MAAM,GAA2D;AACnG,SAAO,oBAAC,OAAE,M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AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF,EAAE;AAAA,IACF,cAAc,cAAc,CAAC,WAAW,IAAI;AAAA,EAC9C,IACA;AACJ,QAAM,oBAA4C;AAAA,IAChD,GAAG;AAAA,IACH,GAAI,WAAW,CAAC,QAAQ,IAAI,CAAC;AAAA,IAC7B,GAAI,aAAa,CAAC,UAAU,IAAI,CAAC;AAAA,EACnC;AAEA,QAAM,YAAY,aAAa,aAAa;AAC5C,QAAM,gBAAgB,UAClB;AAAA,IACE,MAAM,QAAQ;AAAA,IACd,UAAU,QAAQ;AAAA,IAClB,mBACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,aAAa;AAAA;AAAA,IAC9B;AAAA,EAEJ,IACA,CAAC;AACL,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,UAAU,cAAc,UAAU,KAAK;AAAA,MAEtC;AAAA;AAAA,EACH;AAEJ;","names":["useCallback","useState","jsx","jsxs","AgentWorkspaceCompanion","useState","Fragment","jsx","jsxs","SEARCH_THRESHOLD","DefaultLink","capitalize","useState","jsx"]}
|
|
1
|
+
{"version":3,"sources":["../../src/workspace-react/index.tsx","../../src/workspace-react/rail-identity.tsx","../../src/workspace-react/companion.tsx","../../src/workspace-react/workspace-list.tsx"],"sourcesContent":["import { SidebarLayout, type SidebarLayoutNavItem, type SidebarLayoutProps } from '@tangle-network/sandbox-ui/dashboard'\nimport type { ReactNode } from 'react'\n\nimport type { WorkspaceAppRecord } from '../workspace-apps'\nimport { AgentRailIdentity, type AgentProductIdentity, type AgentWorkspaceIdentity } from './rail-identity'\n\nimport {\n buildSessionNavItem,\n composeSidebarSessions,\n resolveActiveNavId,\n type NavRouteDef,\n type RailPrefetch,\n type SessionRowActions,\n type SessionSummary,\n} from '../session-shell'\n\ntype WorkspaceIcon = SidebarLayoutNavItem['icon']\n\nfunction routePathFromHref(href: string, base: string): string | null {\n const path = href.split(/[?#]/, 1)[0] ?? ''\n const root = base.replace(/\\/+$/, '')\n if (path === root) return '/'\n if (!path.startsWith(`${root}/`)) return null\n return path.slice(root.length)\n}\n\n/** The session data and product-owned URLs needed by the default workspace. */\nexport interface AgentWorkspaceSessionConfig {\n /** Icon shown beside the expandable History row. */\n icon: WorkspaceIcon\n /** Id for the session row; defaults to `history`. */\n id?: string\n /** Product copy for the session row; defaults to `History`. */\n label?: string\n /** Full-history route used by the row and overflow item. */\n href: string\n /** Product-owned URL for an individual session. */\n hrefForSession: (sessionId: string) => string\n /** Server-loaded rows, ordered by the product's query. */\n sessions: SessionSummary[]\n /** Sessions created by another tab before the loader revalidates. */\n optimisticSessions?: SessionSummary[]\n /** Number of rows shown in the rail before the full-history link. */\n limit?: number\n /** Total persisted session count, used to decide whether overflow exists. */\n totalCount?: number\n /** Session currently open in the route. */\n activeSessionId?: string | null\n /** Sessions with a live turn. */\n respondingSessionIds?: ReadonlySet<string>\n /** Live unread ids from the product's event channel. */\n liveUnreadIds?: ReadonlySet<string>\n /** Ids this tab has opened since the loader ran. */\n locallyReadIds?: ReadonlySet<string>\n /** Optional product-owned rename/delete/pin actions. */\n actions?: SessionRowActions<WorkspaceIcon>\n /** Label for the overflow row. Defaults to `View all chats`. */\n overflowLabel?: string\n /** Empty state for the expanded rail row. Defaults to `No chats yet`. */\n emptyLabel?: string\n /** Fallback title for untitled sessions. */\n untitledLabel?: string\n /** Router prefetch behavior for session links. */\n prefetch?: RailPrefetch\n /** Whether History starts expanded. Defaults to `true`. */\n defaultOpen?: boolean\n}\n\n/**\n * Registered apps shown under one expandable workspace destination.\n * Products supply authorized rows and their real route; preview URLs never\n * become navigation hrefs.\n */\nexport interface AgentWorkspaceAppsConfig {\n icon: WorkspaceIcon\n items: readonly Pick<WorkspaceAppRecord, 'id' | 'name'>[]\n hrefForApp: (appId: string) => string\n prefetch?: RailPrefetch\n}\n\n/** Route data for the shared active-nav resolver. */\nexport interface AgentWorkspaceActiveRoute {\n /** Current browser pathname, including the product's workspace base. */\n pathname: string\n /** Product route root, for example `/app/ws_123`. */\n base: string\n /** Product-owned rail routes, relative to `base`. */\n routes: NavRouteDef[]\n /** Extra route prefixes that should highlight an existing row. */\n aliases?: Record<string, string>\n /** Route prefixes that intentionally highlight no row. */\n claimsNothing?: string[]\n}\n\nexport interface AgentWorkspaceLayoutProps\n extends Omit<SidebarLayoutProps, 'activeId' | 'children' | 'navItems' | 'hideBelow' | 'railLabels'> {\n children: ReactNode\n /**\n * The product's name, mark, and home. With it the shell draws the canonical\n * rail top — mark, then the open workspace and product name — so products\n * stop hand-building `logo` and `railHeaderContent`.\n */\n product?: AgentProductIdentity\n /** The open workspace and where else this person can go. Omit on the listing. */\n workspace?: AgentWorkspaceIdentity | null\n /** Product-owned destinations. Shared Apps and History rows follow them. */\n navItems: SidebarLayoutNavItem[]\n /** Omit for a workflow-only shell with no conversational session rail. */\n sessions?: AgentWorkspaceSessionConfig\n /** Authorized app destinations, in the product's persisted order. */\n apps?: AgentWorkspaceAppsConfig\n /** When supplied, active navigation is resolved by the shared route rules. */\n activeRoute?: AgentWorkspaceActiveRoute\n /** Escape hatch for routers that already resolved the active item. */\n activeId?: string\n /** Hide the fixed desktop rail below this breakpoint. Defaults to `lg`. */\n hideBelow?: SidebarLayoutProps['hideBelow']\n /** Show labels beside rail icons. Defaults to `true`. */\n railLabels?: SidebarLayoutProps['railLabels']\n}\n\n/**\n * The default agent workspace composition.\n *\n * Products own their navigation taxonomy, routes, and session storage. This\n * component owns the repeated assembly: the standard visual layout, the\n * expandable Apps and History rows, capped session composition, unread state,\n * and active route resolution. The full History route and the empty-state composer stay\n * separate because their data and domain copy belong to the product; pair this\n * with `SessionHistoryPanel` and `EntryComposer` for the complete chat-first\n * structure.\n */\nexport function AgentWorkspaceLayout({\n children,\n navItems,\n sessions,\n apps,\n activeRoute,\n activeId,\n product,\n workspace,\n ...sidebarProps\n}: AgentWorkspaceLayoutProps) {\n const sessionNav = sessions\n ? (() => {\n const composed = composeSidebarSessions({\n loaderSessions: sessions.sessions,\n optimisticSessions: sessions.optimisticSessions,\n limit: sessions.limit ?? 20,\n totalCount: sessions.totalCount,\n liveUnreadIds: sessions.liveUnreadIds,\n locallyReadIds: sessions.locallyReadIds,\n currentSessionId: sessions.activeSessionId,\n })\n\n return buildSessionNavItem<WorkspaceIcon>({\n id: sessions.id,\n label: sessions.label,\n icon: sessions.icon,\n href: sessions.href,\n sessions: composed.sessions,\n hrefForSession: sessions.hrefForSession,\n activeSessionId: sessions.activeSessionId,\n respondingSessionIds: sessions.respondingSessionIds,\n actions: sessions.actions,\n overflow: composed.hasMore\n ? { href: sessions.href, label: sessions.overflowLabel }\n : undefined,\n emptyLabel: sessions.emptyLabel,\n untitledLabel: sessions.untitledLabel,\n prefetch: sessions.prefetch,\n defaultOpen: sessions.defaultOpen,\n })\n })()\n : undefined\n\n const appNavItems: SidebarLayoutNavItem[] = (apps?.items ?? []).map((app) => {\n const href = apps!.hrefForApp(app.id)\n if (!href.startsWith('/') || href.startsWith('//') || /[?#\\\\]/.test(href)) {\n throw new Error('Workspace app href must be a local route path')\n }\n return {\n id: 'workspace-app:' + app.id,\n label: app.name,\n icon: apps!.icon,\n href,\n prefetch: apps!.prefetch,\n }\n })\n const appRoutes: NavRouteDef[] = activeRoute\n ? appNavItems.map((item) => {\n const path = routePathFromHref(item.href!, activeRoute.base)\n if (!path) throw new Error('Workspace app href must be under the active workspace')\n return { id: item.id, path }\n })\n : []\n\n const historyRoutePath = sessions && activeRoute\n ? routePathFromHref(sessions.href, activeRoute.base)\n : null\n\n const resolvedActiveId = activeRoute\n ? resolveActiveNavId({\n ...activeRoute,\n routes: [\n ...activeRoute.routes,\n ...appRoutes,\n ...(sessionNav && historyRoutePath\n ? [{ id: sessions?.id ?? 'history', path: historyRoutePath }]\n : []),\n ],\n })\n : activeId\n\n const activeAppId = appNavItems.some((item) => item.id === resolvedActiveId)\n ? resolvedActiveId\n : undefined\n const appGroup: SidebarLayoutNavItem | undefined = apps && appNavItems.length > 0\n ? {\n id: 'workspace-apps',\n label: 'Apps',\n icon: apps.icon,\n expandable: true,\n defaultOpen: activeAppId !== undefined,\n subItems: appNavItems.map(({ id, label, icon, href, prefetch }) => ({\n id,\n label,\n icon,\n href: href!,\n prefetch,\n })),\n subActiveIds: activeAppId ? [activeAppId] : undefined,\n }\n : undefined\n const workspaceNavItems: SidebarLayoutNavItem[] = [\n ...navItems,\n ...(appGroup ? [appGroup] : []),\n ...(sessionNav ? [sessionNav] : []),\n ]\n\n const hideBelow = sidebarProps.hideBelow ?? 'lg'\n const identityProps = product\n ? {\n logo: product.mark,\n logoHref: product.href,\n railHeaderContent: (\n <AgentRailIdentity\n product={product}\n workspace={workspace}\n hideBelow={hideBelow}\n LinkComponent={sidebarProps.LinkComponent}\n />\n ),\n }\n : {}\n const layoutProps = {\n hideBelow,\n railLabels: true,\n ...identityProps,\n ...sidebarProps,\n }\n\n return (\n <SidebarLayout\n {...layoutProps}\n navItems={workspaceNavItems}\n activeId={activeAppId ? appGroup?.id : resolvedActiveId}\n >\n {children}\n </SidebarLayout>\n )\n}\n\nexport { AgentWorkspaceCompanion, createAgentWorkspaceCompanionTabs, type AgentWorkspaceCompanionHandle, type AgentWorkspaceCompanionProps, type AgentWorkspaceCompanionTab, type AgentWorkspaceCompanionTool, type AgentWorkspaceCompanionTools, type AgentWorkspaceCompanionNavigation } from './companion'\n\nexport { WorkspaceSwitcher, type WorkspaceSwitcherItem, type WorkspaceSwitcherProps } from '../web-react/workspace-switcher'\n\nexport { WorkspaceInitial } from '../web-react/workspace-switcher'\nexport {\n AgentRailIdentity,\n DEFAULT_WORKSPACE_NOUN,\n type AgentProductIdentity,\n type AgentRailIdentityProps,\n type AgentWorkspaceIdentity,\n type AgentWorkspaceNoun,\n} from './rail-identity'\n\nexport {\n WorkspaceList,\n type WorkspaceListAction,\n type WorkspaceListField,\n type WorkspaceListItem,\n type WorkspaceListProps,\n} from './workspace-list'\n","import { useCallback, useState, type ComponentType, type ReactNode } from 'react'\n\nimport { CheckGlyph, OVERLAY_SHADOW, PopoverSurface } from '../web-react/controls'\nimport { usePopoverDialog } from '../web-react/popover-dialog'\nimport { WorkspaceInitial } from '../web-react/workspace-switcher'\n\n/** What a product is called and how it is marked. The same three values for every product. */\nexport interface AgentProductIdentity {\n /** Short product name, for example `Legal` or `GTM`. */\n name: string\n /** Square brand mark, sized by the product for a 20px slot. */\n mark: ReactNode\n /** Where the mark leads: the workspace listing, or home when there is none. */\n href: string\n}\n\n/** The words a product uses for one workspace and for several. */\nexport interface AgentWorkspaceNoun {\n singular: string\n plural: string\n}\n\nexport const DEFAULT_WORKSPACE_NOUN: AgentWorkspaceNoun = { singular: 'workspace', plural: 'workspaces' }\n\n/** The workspace that is open, and where else this person can go. */\nexport interface AgentWorkspaceIdentity {\n id: string\n name: string\n /** Defaults to workspace / workspaces. */\n noun?: AgentWorkspaceNoun\n /** Every workspace this person can open, including the open one, in the product's order. */\n options?: readonly { id: string; name: string }[]\n /** Required with `options`: the route that opens a workspace. */\n hrefForWorkspace?: (workspaceId: string) => string\n /** The listing route. Adds an \"All …\" entry. */\n listHref?: string\n /** The creation route. Adds a \"New …\" entry. */\n createHref?: string\n}\n\n/** The number of workspaces past which the switcher offers a search field. */\nconst SEARCH_THRESHOLD = 7\n\nconst HIDE_ON_RAIL: Record<'md' | 'lg', string> = { md: 'md:hidden', lg: 'lg:hidden' }\n\nfunction capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\nexport interface AgentRailIdentityProps {\n product: AgentProductIdentity\n workspace?: AgentWorkspaceIdentity | null\n /**\n * The breakpoint below which the fixed rail is hidden. The rail draws the\n * mark itself; below this width the same content heads the mobile bar and\n * drawer, which have no mark of their own.\n */\n hideBelow?: 'md' | 'lg'\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- matches SidebarLayout's router-agnostic link slot\n LinkComponent?: ComponentType<any>\n}\n\nfunction DefaultLink({ href, to, ...props }: { href?: string; to?: string; [key: string]: unknown }) {\n return <a href={href ?? to} {...props} />\n}\n\n/**\n * The top of every product's rail: which product, and which workspace.\n *\n * One line when no workspace is open (the listing), two when one is: the\n * workspace name, then the product beneath it. Both truncate inside the rail\n * and carry the full text as a tooltip, so a long name can never push into\n * the collapse button or the page beside the rail. It is a switcher only when\n * there is somewhere to switch to; a menu that lists one item is not offered.\n */\nexport function AgentRailIdentity({ product, workspace, hideBelow = 'lg', LinkComponent }: AgentRailIdentityProps) {\n const Link = LinkComponent ?? DefaultLink\n const mobileMark = (\n <span aria-hidden className={`flex h-7 w-7 shrink-0 items-center justify-center ${HIDE_ON_RAIL[hideBelow]}`}>\n {product.mark}\n </span>\n )\n\n if (!workspace) {\n return (\n <Link\n href={product.href}\n to={product.href}\n title={product.name}\n className=\"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 transition-colors hover:bg-accent\"\n >\n {mobileMark}\n <span className=\"min-w-0 flex-1 truncate text-sm font-semibold text-foreground\">{product.name}</span>\n </Link>\n )\n }\n\n const stack = (\n <span className=\"min-w-0 flex-1 text-left\">\n <span className=\"block truncate text-sm font-semibold leading-5 text-foreground\">{workspace.name}</span>\n <span className=\"block truncate text-xs leading-4 text-muted-foreground\">{product.name}</span>\n </span>\n )\n const others = (workspace.options ?? []).filter((option) => option.id !== workspace.id)\n const switchable = (others.length > 0 && workspace.hrefForWorkspace !== undefined) || Boolean(workspace.listHref) || Boolean(workspace.createHref)\n\n if (!switchable) {\n return (\n <div title={`${workspace.name} · ${product.name}`} className=\"flex w-full min-w-0 items-center gap-2 px-1.5 py-1\">\n {mobileMark}\n {stack}\n </div>\n )\n }\n\n return <WorkspaceMenu product={product} workspace={workspace} mobileMark={mobileMark} stack={stack} Link={Link} />\n}\n\nfunction WorkspaceMenu({\n product,\n workspace,\n mobileMark,\n stack,\n Link,\n}: {\n product: AgentProductIdentity\n workspace: AgentWorkspaceIdentity\n mobileMark: ReactNode\n stack: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n}) {\n const [open, setOpen] = useState(false)\n const [query, setQuery] = useState('')\n const changeOpen = useCallback((next: boolean) => {\n setOpen(next)\n if (!next) setQuery('')\n }, [])\n // A non-modal dialog, like WorkspaceSwitcher: opening focuses the first\n // control, and Tab past the last one returns beside the trigger.\n const { containerRef, triggerRef, panelRef, triggerProps, id: panelId } = usePopoverDialog(open, changeOpen)\n const noun = workspace.noun ?? DEFAULT_WORKSPACE_NOUN\n const options = workspace.hrefForWorkspace ? workspace.options ?? [] : []\n const search = query.trim().toLocaleLowerCase()\n const visible = search ? options.filter((option) => option.name.toLocaleLowerCase().includes(search)) : options\n const close = () => changeOpen(false)\n const rowClass = 'flex min-h-9 w-full min-w-0 items-center gap-2 rounded-md px-2 py-1.5 text-left text-sm text-foreground transition-colors hover:bg-accent'\n\n return (\n <div ref={containerRef} className=\"w-full min-w-0\">\n <button\n type=\"button\"\n {...triggerProps}\n aria-label={`${capitalize(noun.singular)}: ${workspace.name}. Switch ${noun.singular}`}\n title={`${workspace.name} · ${product.name}`}\n onClick={() => changeOpen(!open)}\n className=\"flex w-full min-w-0 items-center gap-2 rounded-md px-1.5 py-1 transition-colors hover:bg-accent aria-expanded:bg-accent\"\n >\n {mobileMark}\n {stack}\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <path d=\"m8 9 4-4 4 4m-8 6 4 4 4-4\" />\n </svg>\n </button>\n <PopoverSurface\n open={open}\n id={panelId}\n role=\"dialog\"\n aria-label={`Switch ${noun.singular}`}\n side=\"below\"\n triggerRef={triggerRef}\n panelRef={panelRef}\n contentKey={`${query}:${options.length}`}\n className={`w-72 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-lg border border-card-edge bg-popover p-1.5 text-foreground ${OVERLAY_SHADOW}`}\n >\n {options.length > SEARCH_THRESHOLD && (\n <input\n data-autofocus\n aria-label={`Search ${noun.plural}`}\n placeholder={`Search ${noun.plural}`}\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"mb-1.5 h-9 w-full rounded-md border border-border bg-background px-2.5 text-sm text-foreground\"\n />\n )}\n {options.length > 0 && (\n <div className=\"max-h-72 overflow-y-auto\">\n {visible.map((option) => (\n <Link\n key={option.id}\n href={workspace.hrefForWorkspace!(option.id)}\n to={workspace.hrefForWorkspace!(option.id)}\n aria-current={option.id === workspace.id ? 'page' : undefined}\n title={option.name}\n onClick={close}\n className={rowClass}\n >\n <WorkspaceInitial name={option.name} />\n <span className=\"min-w-0 flex-1 truncate\">{option.name}</span>\n {option.id === workspace.id && <CheckGlyph className=\"h-4 w-4 shrink-0 text-primary\" />}\n </Link>\n ))}\n {visible.length === 0 && (\n <p role=\"status\" className=\"px-2 py-2 text-sm text-muted-foreground\">\n No {noun.plural} match “{query.trim()}”.\n </p>\n )}\n </div>\n )}\n {(workspace.listHref || workspace.createHref) && (\n <div className={options.length > 0 ? 'mt-1.5 border-t border-border pt-1.5' : undefined}>\n {workspace.listHref && (\n <Link href={workspace.listHref} to={workspace.listHref} onClick={close} className={rowClass}>\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <rect x=\"4\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"4\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" />\n </svg>\n <span className=\"min-w-0 flex-1 truncate\">All {noun.plural}</span>\n </Link>\n )}\n {workspace.createHref && (\n <Link href={workspace.createHref} to={workspace.createHref} onClick={close} className={rowClass}>\n <svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n <span className=\"min-w-0 flex-1 truncate\">New {noun.singular}</span>\n </Link>\n )}\n </div>\n )}\n </PopoverSurface>\n </div>\n )\n}\n","import { forwardRef, useCallback, useEffect, useImperativeHandle, useLayoutEffect, useRef, useState, type ReactNode } from 'react'\nimport { Tabs, TabsContent, TabsList, TabsTrigger } from '@tangle-network/sandbox-ui/primitives'\nimport { WorkspaceLayout } from '@tangle-network/sandbox-ui/workspace'\nimport { FlaskConical, FolderOpen, GitCompare, Monitor, Terminal } from 'lucide-react'\n\nexport interface AgentWorkspaceCompanionTab {\n id: string\n label: string\n icon?: ReactNode\n /** Retain a visited tab through tab switches, pane closure, and viewport changes. */\n keepMounted?: boolean\n renderContent: (state: { active: boolean }) => ReactNode\n}\n\nexport type AgentWorkspaceCompanionTool = 'files' | 'agent' | 'terminal' | 'changes' | 'preview'\n\n/** Supply only tools the product can actually serve. Content remains product-owned. */\nexport type AgentWorkspaceCompanionTools = Partial<Record<AgentWorkspaceCompanionTool, AgentWorkspaceCompanionTab['renderContent']>>\n\nconst companionTools = [\n { id: 'files', label: 'Files', Icon: FolderOpen },\n { id: 'agent', label: 'Agent', Icon: FlaskConical },\n { id: 'terminal', label: 'Terminal', Icon: Terminal },\n { id: 'changes', label: 'Changes', Icon: GitCompare },\n { id: 'preview', label: 'Preview', Icon: Monitor },\n] as const\n\n/** Canonical order, labels, icons and lazy retention for companion tools. */\nexport function createAgentWorkspaceCompanionTabs(tools: AgentWorkspaceCompanionTools): AgentWorkspaceCompanionTab[] {\n return companionTools.flatMap(({ id, label, Icon }) => {\n const renderContent = tools[id]\n return renderContent ? [{ id, label, icon: <Icon className=\"h-3.5 w-3.5\" aria-hidden />, keepMounted: true, renderContent }] : []\n })\n}\n\nexport interface AgentWorkspaceCompanionNavigation {\n content: ReactNode\n header?: ReactNode\n open?: boolean\n onOpenChange?: (open: boolean) => void\n label?: string\n defaultWidth?: number\n minWidth?: number\n maxWidth?: number\n collapsedControl?: ReactNode\n}\n\nexport interface AgentWorkspaceCompanionHandle {\n openTab: (tabId: string) => boolean\n}\n\nexport interface AgentWorkspaceCompanionProps {\n children: ReactNode\n /** Use tools for shared defaults; tabs overrides them for product-specific navigation. */\n tabs?: readonly AgentWorkspaceCompanionTab[]\n tools?: AgentWorkspaceCompanionTools\n /** Optional session navigation, composed in the same responsive layout. */\n navigation?: AgentWorkspaceCompanionNavigation\n keyboardShortcuts?: boolean\n open?: boolean\n onOpenChange?: (open: boolean) => void\n defaultOpen?: boolean\n activeTabId?: string\n onActiveTabChange?: (tabId: string) => void\n defaultActiveTabId?: string\n /** Namespace for remembered tab selection and underlying pane dimensions. */\n persistenceKey?: string\n label?: string\n defaultWidth?: number\n className?: string\n}\n\n/** Product-owned tools beside a conversation; omitted tools have no tabs or effects. */\nexport const AgentWorkspaceCompanion = forwardRef<AgentWorkspaceCompanionHandle, AgentWorkspaceCompanionProps>(function AgentWorkspaceCompanion({\n children,\n tabs: customTabs,\n tools,\n navigation,\n keyboardShortcuts,\n open: controlledOpen,\n onOpenChange,\n defaultOpen = false,\n activeTabId,\n onActiveTabChange,\n defaultActiveTabId,\n persistenceKey,\n label = 'Workspace tools',\n defaultWidth = 420,\n className,\n}, ref) {\n const tabs = customTabs ?? createAgentWorkspaceCompanionTabs(tools ?? {})\n const [uncontrolledOpen, setOpen] = useState(defaultOpen)\n const open = controlledOpen ?? uncontrolledOpen\n const [selection, setSelection] = useState({ key: persistenceKey, id: defaultActiveTabId })\n const [visits, setVisits] = useState<{ key: string | undefined; ids: ReadonlySet<string> }>(() => ({ key: persistenceKey, ids: new Set() }))\n const requested = activeTabId ?? (selection.key === persistenceKey ? selection.id : defaultActiveTabId)\n const active = tabs.find((tab) => tab.id === requested)?.id ?? tabs[0]?.id\n const visited = visits.key === persistenceKey ? visits.ids : new Set<string>()\n const storageKey = persistenceKey ? `${persistenceKey}:companion-tab` : undefined\n\n const pendingRestoration = useRef<{ key: string | undefined; id: string | undefined } | undefined>(undefined)\n const reconciledSelection = useRef<string | undefined>(undefined)\n const restoredKey = useRef<string | undefined>(undefined)\n useEffect(() => {\n const key = JSON.stringify([persistenceKey, defaultActiveTabId])\n if (restoredKey.current === key || tabs.length === 0) return\n let id = activeTabId ?? defaultActiveTabId\n if (storageKey) {\n try { id = window.localStorage.getItem(storageKey) ?? id } catch { /* Browser storage is optional. */ }\n }\n const resolved = tabs.find((tab) => tab.id === id)?.id ?? tabs[0]?.id\n restoredKey.current = key\n pendingRestoration.current = { key: persistenceKey, id: resolved }\n setSelection({ key: persistenceKey, id: resolved })\n if (resolved && resolved !== activeTabId) {\n reconciledSelection.current = JSON.stringify([persistenceKey, requested, resolved])\n onActiveTabChange?.(resolved)\n }\n }, [storageKey, persistenceKey, defaultActiveTabId, activeTabId, requested, tabs, onActiveTabChange])\n\n useEffect(() => {\n // Let restored selection reach the controlled parent before reconciling stale props.\n const pending = pendingRestoration.current\n if (pending) {\n const acknowledged = activeTabId === undefined\n ? selection.key === pending.key && selection.id === pending.id\n : activeTabId === pending.id\n if (!acknowledged) return\n pendingRestoration.current = undefined\n }\n if (!active || tabs.some((tab) => tab.id === requested)) {\n reconciledSelection.current = undefined\n return\n }\n const key = JSON.stringify([persistenceKey, requested, active])\n if (reconciledSelection.current === key) return\n reconciledSelection.current = key\n setSelection({ key: persistenceKey, id: active })\n onActiveTabChange?.(active)\n }, [active, activeTabId, requested, selection, persistenceKey, tabs, onActiveTabChange])\n\n useEffect(() => {\n if (!open || !active) return\n setVisits((previous) => {\n const ids = previous.key === persistenceKey ? previous.ids : new Set<string>()\n return ids.has(active) ? previous : { key: persistenceKey, ids: new Set([...ids, active]) }\n })\n }, [open, active, persistenceKey])\n\n const selectTab = useCallback((id: string) => {\n if (!tabs.some((tab) => tab.id === id)) return false\n setSelection({ key: persistenceKey, id })\n onActiveTabChange?.(id)\n if (storageKey) {\n try { window.localStorage.setItem(storageKey, id) } catch { /* Selection still works without storage. */ }\n }\n return true\n }, [tabs, persistenceKey, storageKey, onActiveTabChange])\n const changeOpen = useCallback((next: boolean) => {\n setOpen(next)\n onOpenChange?.(next)\n }, [onOpenChange])\n\n useImperativeHandle(ref, () => ({\n openTab(id) {\n if (!selectTab(id)) return false\n changeOpen(true)\n return true\n },\n }), [selectTab, changeOpen])\n\n if (tabs.length === 0 && !navigation) return <>{children}</>\n\n return (\n <Tabs key={persistenceKey} value={active} onValueChange={selectTab} className={`flex h-full min-h-0 min-w-0 flex-1 flex-col ${className ?? ''}`}>\n <WorkspaceLayout\n className=\"h-full min-h-0 min-w-0 flex-1\"\n // The expander takes its own column at the conversation's edge. Floated\n // over the conversation it covered the top-right of a right-aligned\n // user message on a phone, hiding part of its text.\n collapsedControlsPlacement=\"edge\"\n keepRightMounted\n // The layout's center is a block scroller, so a conversation written as\n // `flex flex-1 flex-col` (message list `flex-1 overflow-y-auto`, then a\n // shrink-0 composer) got no height bound: the whole conversation grew\n // with its content and a tall composer was pushed below the fold. A\n // one-cell grid whose row is `minmax(0, 1fr)` gives the conversation\n // exactly the pane's height: a grid item spanning a track with a zero\n // minimum has no content-based minimum, which a flex column would still\n // impose on a child without `min-h-0`. The message list then scrolls on\n // its own and the composer stays on screen.\n center={<div data-companion-center className=\"grid h-full min-h-0 min-w-0 grid-cols-[minmax(0,1fr)] grid-rows-[minmax(0,1fr)]\">{children}</div>}\n left={navigation?.content}\n leftContentClassName=\"py-0\"\n leftHeader={navigation && (navigation.header !== undefined ? navigation.header : <span className=\"text-sm font-medium\">{navigation.label ?? 'Chats'}</span>)}\n leftOpen={navigation?.open}\n onLeftOpenChange={navigation?.onOpenChange}\n leftLabel={navigation?.label ?? 'Chats'}\n defaultLeftWidth={navigation?.defaultWidth ?? 260}\n minLeftWidth={navigation?.minWidth ?? 200}\n maxLeftWidth={navigation?.maxWidth ?? 400}\n leftCollapsedControl={navigation?.collapsedControl}\n keyboardShortcuts={keyboardShortcuts}\n rightOpen={open}\n onRightOpenChange={changeOpen}\n rightLabel={label}\n defaultRightWidth={defaultWidth}\n persistenceKey={persistenceKey}\n minRightWidth={280}\n rightContentClassName=\"flex flex-col overflow-hidden\"\n rightHeader={tabs.length > 0 ? <CompanionTabList tabs={tabs} active={active} label={label} /> : undefined}\n right={tabs.length > 0 ? tabs.map((tab) => {\n const isActive = tab.id === active\n const retained = tab.keepMounted && visited.has(tab.id)\n if (!(open && isActive) && !retained) return null\n return (\n <TabsContent\n key={tab.id}\n value={tab.id}\n forceMount={retained ? true : undefined}\n hidden={!open || !isActive}\n className=\"m-0 h-full min-h-0 min-w-0 flex-1 data-[state=inactive]:hidden\"\n >\n {tab.renderContent({ active: open && isActive })}\n </TabsContent>\n )\n }) : undefined}\n />\n </Tabs>\n )\n})\n\n/**\n * The companion's tab row. When every labelled tab does not fit the pane (a\n * phone drawer, a narrow resized pane), inactive tabs that have an icon drop to\n * icon-only and the active tab keeps its label, so no tab hides behind the\n * close button. Labels stay in the accessibility tree either way. The row\n * returns to full labels once the pane is wide enough for them again.\n */\nfunction CompanionTabList({ tabs, active, label }: { tabs: readonly AgentWorkspaceCompanionTab[]; active: string | undefined; label: string }) {\n const frameRef = useRef<HTMLDivElement>(null)\n const fullWidth = useRef(0)\n const [compact, setCompact] = useState(false)\n const signature = tabs.map((tab) => `${tab.id}\\u0000${tab.label}\\u0000${tab.icon ? 1 : 0}`).join('\\u0001')\n\n useLayoutEffect(() => {\n fullWidth.current = 0\n setCompact(false)\n }, [signature])\n\n useLayoutEffect(() => {\n const frame = frameRef.current\n const list = frame?.firstElementChild\n if (!frame || !(list instanceof HTMLElement)) return\n const fit = () => {\n const available = frame.clientWidth\n if (!compact) {\n fullWidth.current = list.scrollWidth\n if (list.scrollWidth > available + 1) setCompact(true)\n } else if (fullWidth.current > 0 && available >= fullWidth.current) {\n setCompact(false)\n }\n }\n fit()\n if (typeof ResizeObserver === 'undefined') return\n const observer = new ResizeObserver(fit)\n observer.observe(frame)\n return () => observer.disconnect()\n }, [compact, signature])\n\n useEffect(() => {\n const trigger = frameRef.current?.querySelector<HTMLElement>('[role=\"tab\"][data-state=\"active\"]')\n trigger?.scrollIntoView?.({ block: 'nearest', inline: 'nearest' })\n }, [active, compact])\n\n return (\n <div ref={frameRef} className=\"min-w-0\" data-compact={compact ? '' : undefined}>\n <TabsList aria-label={label} className=\"h-9 max-w-full justify-start overflow-x-auto bg-transparent p-0\">\n {tabs.map((tab) => {\n const iconOnly = compact && tab.icon && tab.id !== active\n return (\n <TabsTrigger\n key={tab.id}\n value={tab.id}\n title={iconOnly ? tab.label : undefined}\n className={iconOnly ? 'gap-1.5 px-2 text-sm' : 'gap-1.5 px-2.5 text-sm'}\n >\n {tab.icon}<span className={iconOnly ? 'sr-only' : undefined}>{tab.label}</span>\n </TabsTrigger>\n )\n })}\n </TabsList>\n </div>\n )\n}\n","import { useId, useMemo, useState, type ComponentType, type ReactNode } from 'react'\n\nimport { ActionDialog, ActionDialogButton } from '../web-react/action-dialog'\nimport { OVERLAY_SHADOW, PopoverSurface, usePopover } from '../web-react/controls'\nimport { WorkspaceInitial } from '../web-react/workspace-switcher'\nimport { DEFAULT_WORKSPACE_NOUN, type AgentWorkspaceNoun } from './rail-identity'\n\n/** One workspace as the listing shows it. */\nexport interface WorkspaceListItem {\n id: string\n name: string\n /** The route that opens it. */\n href: string\n /** One line under the name. Not shown when it only repeats the name. */\n description?: string | null\n /** Last activity. Shown as a short date. */\n updatedAt?: string | number | Date | null\n /** Values for the product's `fields`, keyed by field id. */\n values?: Readonly<Record<string, ReactNode>>\n /** Replaces the initial avatar, for example with a logo the product already has. */\n avatar?: ReactNode\n}\n\n/** A product column: a value the user compares across workspaces (tax year, status, owner). */\nexport interface WorkspaceListField {\n id: string\n label: string\n}\n\n/** A non-destructive product action in an item's overflow menu. */\nexport interface WorkspaceListAction {\n id: string\n label: string\n onSelect: (item: WorkspaceListItem) => void\n}\n\nexport interface WorkspaceListProps {\n items: readonly WorkspaceListItem[]\n /** The product's words for one workspace and several. Defaults to workspace / workspaces. */\n noun?: AgentWorkspaceNoun\n /** Page title. Defaults to the capitalized plural noun. */\n title?: string\n /** One sentence under the title, when the page needs one. */\n description?: ReactNode\n /** `list` rows for records people compare; `grid` cards for a handful of rich projects. */\n layout?: 'list' | 'grid'\n /** Product values, shown as columns (list) or under the description (grid). */\n fields?: readonly WorkspaceListField[]\n /**\n * The one primary action, labelled \"New {singular}\" unless `label` says otherwise.\n * `href` navigates; `onSelect` opens the product's own creation flow; `onCreate`\n * asks for a name in the shared dialog and hands it over — reject with an Error\n * to show its message, and navigate to the new workspace from inside it.\n */\n create?: {\n label?: string\n href?: string\n onSelect?: () => void\n onCreate?: (name: string) => Promise<void>\n /** Placeholder for the name field. Defaults to \"{Singular} name\". */\n namePlaceholder?: string\n }\n /** First-use copy. The create action is offered beneath it. */\n empty?: { title?: string; description?: string }\n /** Persist a new name. Reject with an Error to show its message in the dialog. */\n rename?: (item: WorkspaceListItem, name: string) => Promise<void>\n /** Delete for good. Offered in the overflow menu, behind a confirmation. */\n remove?: (item: WorkspaceListItem) => Promise<void>\n /** What deleting loses, for the confirmation. */\n removeConsequence?: (item: WorkspaceListItem) => string\n /** Extra overflow-menu actions. */\n actions?: (item: WorkspaceListItem) => readonly WorkspaceListAction[]\n /** Product content between the header and the items, such as a home summary. */\n children?: ReactNode\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot, same as SidebarLayout\n LinkComponent?: ComponentType<any>\n /** Formats `updatedAt`. Defaults to a short month and day, with the year when it is not this year. */\n formatDate?: (value: Date) => string\n}\n\n/** The number of items past which the listing offers a search field. */\nconst SEARCH_THRESHOLD = 8\n\n// Fixed widths keep every row's columns on the same x, whatever a date or value renders as.\nconst FIELD_CELL = 'hidden w-32 min-w-0 shrink-0 md:block'\nconst DATE_CELL = 'w-20 shrink-0 text-right sm:w-24'\n\nfunction DefaultLink({ href, to, ...props }: { href?: string; to?: string; [key: string]: unknown }) {\n return <a href={href ?? to} {...props} />\n}\n\nfunction capitalize(text: string): string {\n return text.charAt(0).toLocaleUpperCase() + text.slice(1)\n}\n\nfunction defaultFormatDate(value: Date): string {\n const sameYear = value.getFullYear() === new Date().getFullYear()\n return value.toLocaleDateString(undefined, sameYear ? { month: 'short', day: 'numeric' } : { month: 'short', day: 'numeric', year: 'numeric' })\n}\n\nfunction present(value: ReactNode): boolean {\n return value !== null && value !== undefined && value !== false && value !== ''\n}\n\nfunction toDate(value: WorkspaceListItem['updatedAt']): Date | null {\n if (value === null || value === undefined || value === '') return null\n const date = value instanceof Date ? value : new Date(value)\n return Number.isNaN(date.getTime()) ? null : date\n}\n\n/** A description is noise when it says the name again (\"GTM Agent / GTM Agent\"). */\nfunction usefulDescription(item: WorkspaceListItem): string | null {\n const text = item.description?.trim()\n if (!text) return null\n return text.toLocaleLowerCase() === item.name.trim().toLocaleLowerCase() ? null : text\n}\n\n/**\n * The listing every product opens on: one title, one primary action, the\n * workspaces, and nothing that counts them. Destructive actions live in each\n * item's overflow menu behind a confirmation, never as an icon on every row.\n * The product supplies its noun, its columns, and its create route; render it\n * inside `AgentWorkspaceLayout` (with no `workspace`) so the listing wears the\n * same shell as the workspace it opens.\n */\nexport function WorkspaceList({\n items,\n noun = DEFAULT_WORKSPACE_NOUN,\n title,\n description,\n layout = 'list',\n fields = [],\n create,\n empty,\n rename,\n remove,\n removeConsequence,\n actions,\n children,\n LinkComponent,\n formatDate = defaultFormatDate,\n}: WorkspaceListProps) {\n const Link = LinkComponent ?? DefaultLink\n const headingId = useId()\n const [query, setQuery] = useState('')\n const [renaming, setRenaming] = useState<WorkspaceListItem | null>(null)\n const [renameValue, setRenameValue] = useState('')\n const [removing, setRemoving] = useState<WorkspaceListItem | null>(null)\n const [creating, setCreating] = useState(false)\n const [createValue, setCreateValue] = useState('')\n const [busy, setBusy] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const search = query.trim().toLocaleLowerCase()\n const visible = useMemo(\n () => (search ? items.filter((item) => item.name.toLocaleLowerCase().includes(search)) : items),\n [items, search],\n )\n const createLabel = create?.label ?? `New ${noun.singular}`\n const openCreate = () => {\n setError(null)\n setCreateValue('')\n setCreating(true)\n }\n const createControl = create\n ? <CreateButton create={create.onCreate && !create.href ? { ...create, onSelect: openCreate } : create} label={createLabel} Link={Link} />\n : null\n const submitCreate = () => {\n const name = createValue.trim()\n if (!name || !create?.onCreate) return\n void run(() => create.onCreate!(name), () => setCreating(false))\n }\n\n const hasDates = items.some((item) => toDate(item.updatedAt) !== null)\n const hasMenu = Boolean(rename) || Boolean(remove) || Boolean(actions)\n const menuFor = (item: WorkspaceListItem): MenuEntry[] => [\n ...(rename ? [{ id: 'rename', label: 'Rename', onSelect: () => { setError(null); setRenaming(item); setRenameValue(item.name) } }] : []),\n ...(actions?.(item) ?? []).map((action) => ({ id: action.id, label: action.label, onSelect: () => action.onSelect(item) })),\n ...(remove ? [{ id: 'delete', label: 'Delete', destructive: true, onSelect: () => { setError(null); setRemoving(item) } }] : []),\n ]\n\n const run = async (work: () => Promise<void>, done: () => void) => {\n setBusy(true)\n setError(null)\n try {\n await work()\n done()\n } catch (cause) {\n setError(cause instanceof Error && cause.message ? cause.message : 'That did not save. Try again.')\n } finally {\n setBusy(false)\n }\n }\n\n const submitRename = () => {\n if (!renaming || !rename) return\n const name = renameValue.trim()\n if (!name || name === renaming.name) {\n setRenaming(null)\n return\n }\n void run(() => rename(renaming, name), () => setRenaming(null))\n }\n\n return (\n <section aria-labelledby={headingId} className=\"mx-auto w-full max-w-5xl px-4 py-6 sm:px-6 sm:py-8 lg:px-8\">\n <header className=\"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\">\n <div className=\"min-w-0 flex-1 [overflow-wrap:anywhere]\">\n <h1 id={headingId} className=\"text-xl font-semibold tracking-tight text-foreground\">\n {title ?? capitalize(noun.plural)}\n </h1>\n {description != null && <div className=\"mt-1 max-w-prose text-sm text-muted-foreground\">{description}</div>}\n </div>\n {items.length > 0 && createControl}\n </header>\n\n {children != null && <div className=\"mt-6\">{children}</div>}\n\n {items.length === 0 ? (\n <div className=\"mt-6 flex flex-col items-center rounded-xl border border-dashed border-border px-6 py-14 text-center\">\n <span aria-hidden className=\"flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10 text-primary\">\n <svg className=\"h-5 w-5\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\">\n <rect x=\"4\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"13.5\" y=\"4\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><rect x=\"4\" y=\"13.5\" width=\"6.5\" height=\"6.5\" rx=\"1.5\" /><path d=\"M16.75 13.5v6.5M13.5 16.75H20\" />\n </svg>\n </span>\n <h2 className=\"mt-4 text-base font-semibold text-foreground\">{empty?.title ?? `No ${noun.plural} yet`}</h2>\n {empty?.description && <p className=\"mt-1.5 max-w-sm text-sm text-muted-foreground\">{empty.description}</p>}\n {createControl && <div className=\"mt-5\">{createControl}</div>}\n </div>\n ) : (\n <>\n {items.length > SEARCH_THRESHOLD && (\n <div className=\"mt-6\">\n <input\n type=\"search\"\n aria-label={`Search ${noun.plural}`}\n placeholder={`Search ${noun.plural}`}\n value={query}\n onChange={(event) => setQuery(event.target.value)}\n className=\"h-9 w-full max-w-sm rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n </div>\n )}\n {visible.length === 0 ? (\n <p role=\"status\" className=\"mt-6 rounded-xl border border-border px-4 py-8 text-center text-sm text-muted-foreground\">\n No {noun.plural} match “{query.trim()}”.{' '}\n <button type=\"button\" onClick={() => setQuery('')} className=\"font-medium text-foreground underline underline-offset-2\">\n Clear search\n </button>\n </p>\n ) : layout === 'grid' ? (\n <ul className={`grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3 ${items.length > SEARCH_THRESHOLD ? 'mt-3' : 'mt-6'}`}>\n {visible.map((item) => (\n <GridCard key={item.id} item={item} fields={fields} menu={menuFor(item)} Link={Link} formatDate={formatDate} />\n ))}\n </ul>\n ) : (\n <div className={`overflow-hidden rounded-xl border border-border bg-card ${items.length > SEARCH_THRESHOLD ? 'mt-3' : 'mt-6'}`}>\n {fields.length > 0 && (\n <div aria-hidden className=\"hidden items-center gap-3 border-b border-border px-4 py-2 text-xs font-medium text-muted-foreground md:flex\">\n <span className=\"w-10 shrink-0\" />\n <span className=\"min-w-0 flex-1\">Name</span>\n {fields.map((field) => (\n <span key={field.id} className={`${FIELD_CELL} truncate`}>{field.label}</span>\n ))}\n <span className={DATE_CELL}>{hasDates ? 'Updated' : ''}</span>\n {hasMenu && <span className=\"w-8 shrink-0 [@media(pointer:coarse)]:w-11\" />}\n </div>\n )}\n <ul className=\"divide-y divide-border\">\n {visible.map((item) => (\n <ListRow key={item.id} item={item} fields={fields} menu={menuFor(item)} reserveMenu={hasMenu} Link={Link} formatDate={formatDate} />\n ))}\n </ul>\n </div>\n )}\n </>\n )}\n\n {renaming && (\n <ActionDialog\n title={`Rename ${noun.singular}`}\n onClose={() => setRenaming(null)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setRenaming(null)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton onClick={submitRename} disabled={busy || !renameValue.trim()}>Save</ActionDialogButton>\n </>\n }\n >\n <label htmlFor={`${headingId}-rename`} className=\"text-xs text-muted-foreground\">Name</label>\n <input\n id={`${headingId}-rename`}\n value={renameValue}\n autoFocus\n onChange={(event) => setRenameValue(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !busy) {\n event.preventDefault()\n submitRename()\n }\n }}\n className=\"mt-1.5 h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground\"\n />\n </ActionDialog>\n )}\n\n {creating && create?.onCreate && (\n <ActionDialog\n title={createLabel}\n onClose={() => setCreating(false)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setCreating(false)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton onClick={submitCreate} disabled={busy || !createValue.trim()}>Create</ActionDialogButton>\n </>\n }\n >\n <label htmlFor={`${headingId}-create`} className=\"text-xs text-muted-foreground\">Name</label>\n <input\n id={`${headingId}-create`}\n value={createValue}\n autoFocus\n placeholder={create.namePlaceholder ?? `${capitalize(noun.singular)} name`}\n onChange={(event) => setCreateValue(event.target.value)}\n onKeyDown={(event) => {\n if (event.key === 'Enter' && !busy) {\n event.preventDefault()\n submitCreate()\n }\n }}\n className=\"mt-1.5 h-9 w-full rounded-md border border-border bg-background px-3 text-sm text-foreground placeholder:text-muted-foreground\"\n />\n </ActionDialog>\n )}\n\n {removing && remove && (\n <ActionDialog\n title={`Delete ${noun.singular}?`}\n onClose={() => setRemoving(null)}\n busy={busy}\n error={error}\n footer={\n <>\n <ActionDialogButton variant=\"ghost\" onClick={() => setRemoving(null)} disabled={busy}>Cancel</ActionDialogButton>\n <ActionDialogButton variant=\"destructive\" onClick={() => void run(() => remove(removing), () => setRemoving(null))} disabled={busy}>\n Delete\n </ActionDialogButton>\n </>\n }\n >\n <p className=\"break-words text-sm text-muted-foreground\">\n {removeConsequence?.(removing) ?? `“${removing.name}” and everything in it will be deleted. This cannot be undone.`}\n </p>\n </ActionDialog>\n )}\n </section>\n )\n}\n\ninterface MenuEntry {\n id: string\n label: string\n destructive?: boolean\n onSelect: () => void\n}\n\ninterface ItemProps {\n reserveMenu?: boolean\n item: WorkspaceListItem\n fields: readonly WorkspaceListField[]\n menu: MenuEntry[]\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n formatDate: (value: Date) => string\n}\n\nfunction UpdatedAt({ value, formatDate, className = 'shrink-0' }: { value: WorkspaceListItem['updatedAt']; formatDate: (value: Date) => string; className?: string }) {\n const date = toDate(value)\n if (!date) return <span className={className} />\n return (\n // Server and browser can format a date differently (zone, locale); the\n // browser's reading is the one the user should see.\n <time dateTime={date.toISOString()} suppressHydrationWarning className={`${className} text-xs tabular-nums text-muted-foreground`}>\n {formatDate(date)}\n </time>\n )\n}\n\n/**\n * The name is the row's link, stretched over the whole row with an `after:`\n * overlay, so the overflow menu can sit on top as a real sibling button\n * instead of a button nested inside a link.\n */\nfunction ListRow({ item, fields, menu, reserveMenu, Link, formatDate }: ItemProps) {\n const detail = usefulDescription(item)\n const mobileFields = fields.filter((field) => present(item.values?.[field.id]))\n return (\n <li className=\"group relative isolate flex min-h-16 items-center gap-3 px-4 py-3 transition-colors hover:bg-accent/60\">\n {item.avatar ?? <WorkspaceInitial name={item.name} size=\"lg\" />}\n <div className=\"min-w-0 flex-1\">\n <Link\n href={item.href}\n to={item.href}\n title={item.name}\n className=\"block truncate text-sm font-medium text-foreground after:absolute after:inset-0 after:content-[''] focus-visible:outline-none focus-visible:after:rounded-[inherit] focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring\"\n >\n {item.name}\n </Link>\n {detail && <p className=\"truncate text-xs text-muted-foreground\" title={detail}>{detail}</p>}\n {/* Below md the columns are hidden, so their values ride under the name instead. */}\n {mobileFields.length > 0 && (\n <p className=\"truncate text-xs text-muted-foreground md:hidden\">\n {mobileFields.map((field, index) => (\n <span key={field.id}>\n {index > 0 && ' · '}\n <span className=\"sr-only\">{field.label}: </span>\n {item.values![field.id]}\n </span>\n ))}\n </p>\n )}\n </div>\n {fields.map((field) => (\n <div key={field.id} className={`${FIELD_CELL} truncate text-sm text-muted-foreground`}>\n <span className=\"sr-only\">{field.label}: </span>\n {present(item.values?.[field.id]) ? item.values![field.id] : '—'}\n </div>\n ))}\n <UpdatedAt value={item.updatedAt} formatDate={formatDate} className={DATE_CELL} />\n {menu.length > 0 ? <ItemMenu item={item} entries={menu} /> : reserveMenu ? <span className=\"w-8 shrink-0 [@media(pointer:coarse)]:w-11\" /> : null}\n </li>\n )\n}\n\nfunction GridCard({ item, fields, menu, Link, formatDate }: ItemProps) {\n const detail = usefulDescription(item)\n const shownFields = fields.filter((field) => present(item.values?.[field.id]))\n return (\n <li className=\"group relative isolate flex min-h-36 flex-col overflow-hidden rounded-xl border border-border bg-card p-4 transition-[border-color,box-shadow] hover:border-primary/40 hover:shadow-sm\">\n <span aria-hidden className=\"pointer-events-none absolute inset-x-0 top-0 -z-10 h-16 bg-gradient-to-b from-primary/[0.07] to-transparent\" />\n <div className=\"flex items-start gap-3\">\n {item.avatar ?? <WorkspaceInitial name={item.name} size=\"lg\" />}\n <div className=\"min-w-0 flex-1 pt-0.5\">\n <Link\n href={item.href}\n to={item.href}\n title={item.name}\n className=\"line-clamp-2 break-words text-sm font-semibold text-foreground after:absolute after:inset-0 after:content-[''] focus-visible:outline-none focus-visible:after:rounded-xl focus-visible:after:ring-2 focus-visible:after:ring-inset focus-visible:after:ring-ring\"\n >\n {item.name}\n </Link>\n {detail && <p className=\"mt-0.5 truncate text-xs text-muted-foreground\" title={detail}>{detail}</p>}\n </div>\n {menu.length > 0 && <ItemMenu item={item} entries={menu} />}\n </div>\n <div className=\"mt-auto flex items-end justify-between gap-3 pt-4\">\n {shownFields.length > 0 ? (\n <dl className=\"flex min-w-0 flex-wrap gap-x-4 gap-y-1 text-xs\">\n {shownFields.map((field) => (\n <div key={field.id} className=\"flex min-w-0 gap-1\">\n <dt className=\"text-muted-foreground\">{field.label}</dt>\n <dd className=\"truncate font-medium text-foreground\">{item.values?.[field.id]}</dd>\n </div>\n ))}\n </dl>\n ) : <span />}\n <UpdatedAt value={item.updatedAt} formatDate={formatDate} />\n </div>\n </li>\n )\n}\n\nfunction ItemMenu({ item, entries }: { item: WorkspaceListItem; entries: MenuEntry[] }) {\n const [open, setOpen] = useState(false)\n const panelId = useId()\n const { containerRef, triggerRef, panelRef, triggerProps } = usePopover(open, setOpen)\n return (\n <div ref={containerRef} className=\"relative z-10 shrink-0\">\n <button\n type=\"button\"\n {...triggerProps}\n aria-label={`Actions for ${item.name}`}\n aria-controls={open ? panelId : undefined}\n onClick={() => setOpen(!open)}\n // Hidden until hover only where hover exists; a touch screen of any width shows it.\n className=\"flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground [@media(pointer:coarse)]:h-11 [@media(pointer:coarse)]:w-11 transition hover:bg-muted hover:text-foreground focus-visible:opacity-100 aria-expanded:opacity-100 [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover:opacity-100\"\n >\n <svg aria-hidden className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"currentColor\">\n <circle cx=\"5\" cy=\"12\" r=\"1.6\" /><circle cx=\"12\" cy=\"12\" r=\"1.6\" /><circle cx=\"19\" cy=\"12\" r=\"1.6\" />\n </svg>\n </button>\n <PopoverSurface\n open={open}\n id={panelId}\n role=\"menu\"\n aria-label={`Actions for ${item.name}`}\n side=\"below\"\n align=\"end\"\n triggerRef={triggerRef}\n panelRef={panelRef}\n className={`w-44 overflow-hidden rounded-md border border-card-edge bg-popover py-1 ${OVERLAY_SHADOW}`}\n >\n {entries.map((entry, index) => (\n <button\n key={entry.id}\n type=\"button\"\n role=\"menuitem\"\n onClick={() => {\n setOpen(false)\n // The dialog this opens returns focus to whatever had it — the trigger, not <body>.\n triggerRef.current?.focus()\n entry.onSelect()\n }}\n className={`block w-full px-3 py-1.5 text-left text-sm transition ${\n entry.destructive ? 'text-destructive hover:bg-destructive/10' : 'text-foreground hover:bg-accent'\n } ${entry.destructive && index > 0 ? 'mt-1 border-t border-border pt-2' : ''}`}\n >\n {entry.label}\n </button>\n ))}\n </PopoverSurface>\n </div>\n )\n}\n\nfunction CreateButton({\n create,\n label,\n Link,\n}: {\n create: NonNullable<WorkspaceListProps['create']>\n label: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any -- router-agnostic link slot\n Link: ComponentType<any>\n}) {\n const className = 'inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md bg-primary px-3.5 text-sm font-medium text-primary-foreground transition hover:opacity-90 active:scale-[0.98]'\n const icon = (\n <svg aria-hidden className=\"h-4 w-4\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\">\n <path d=\"M12 5v14M5 12h14\" />\n </svg>\n )\n if (create.href) {\n return (\n <Link href={create.href} to={create.href} className={className}>\n {icon}\n {label}\n </Link>\n )\n }\n return (\n <button type=\"button\" onClick={create.onSelect} className={className}>\n {icon}\n {label}\n </button>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAyE;;;ACAlF,SAAS,aAAa,gBAAoD;AA+DjE,cAsBH,YAtBG;AAzCF,IAAM,yBAA6C,EAAE,UAAU,aAAa,QAAQ,aAAa;AAmBxG,IAAM,mBAAmB;AAEzB,IAAM,eAA4C,EAAE,IAAI,aAAa,IAAI,YAAY;AAErF,SAAS,WAAW,MAAsB;AACxC,SAAO,KAAK,OAAO,CAAC,EAAE,kBAAkB,IAAI,KAAK,MAAM,CAAC;AAC1D;AAeA,SAAS,YAAY,EAAE,MAAM,IAAI,GAAG,MAAM,GAA2D;AACnG,SAAO,oBAAC,OAAE,MAAM,QAAQ,IAAK,GAAG,OAAO;AACzC;AAWO,SAAS,kBAAkB,EAAE,SAAS,WAAW,YAAY,MAAM,cAAc,GAA2B;AACjH,QAAM,OAAO,iBAAiB;AAC9B,QAAM,aACJ,oBAAC,UAAK,eAAW,MAAC,WAAW,qDAAqD,aAAa,SAAS,CAAC,IACtG,kBAAQ,MACX;AAGF,MAAI,CAAC,WAAW;AACd,WACE;AAAA,MAAC;AAAA;AAAA,QACC,MAAM,QAAQ;AAAA,QACd,IAAI,QAAQ;AAAA,QACZ,OAAO,QAAQ;AAAA,QACf,WAAU;AAAA,QAET;AAAA;AAAA,UACD,oBAAC,UAAK,WAAU,iEAAiE,kBAAQ,MA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mBACE,gBAAAA;AAAA,MAAC;AAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA;AAAA,QACA,eAAe,aAAa;AAAA;AAAA,IAC9B;AAAA,EAEJ,IACA,CAAC;AACL,QAAM,cAAc;AAAA,IAClB;AAAA,IACA,YAAY;AAAA,IACZ,GAAG;AAAA,IACH,GAAG;AAAA,EACL;AAEA,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACJ,UAAU;AAAA,MACV,UAAU,cAAc,UAAU,KAAK;AAAA,MAEtC;AAAA;AAAA,EACH;AAEJ;","names":["useCallback","useState","jsx","jsxs","AgentWorkspaceCompanion","useState","Fragment","jsx","jsxs","SEARCH_THRESHOLD","DefaultLink","capitalize","useState","jsx"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tangle-network/agent-app",
|
|
3
|
-
"version": "0.55.
|
|
3
|
+
"version": "0.55.5",
|
|
4
4
|
"packageManager": "pnpm@11.24.0",
|
|
5
5
|
"description": "Build agent applications with typed chat, tools, sandboxes, integrations, billing, and evaluation.",
|
|
6
6
|
"keywords": [
|
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
"@tangle-network/hub-sdk": ">=0.19.3 <0.21.0 || >=0.21.0 <0.22.0 || >=0.22.1 <0.25.0",
|
|
658
658
|
"@tangle-network/sandbox": ">=0.45.0 <0.48.0 || ^0.49.0 || ^0.50.0 || ^0.51.0 || ^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || >=0.58.1 <0.60.0 || >=0.60.3 <0.61.0",
|
|
659
659
|
"@tangle-network/sandbox-ui": ">=0.117.0 <0.118.0 || >=0.119.0 <0.128.0",
|
|
660
|
-
"@tangle-network/ui": ">=11.
|
|
660
|
+
"@tangle-network/ui": ">=11.17.0 <12.0.0",
|
|
661
661
|
"@tiptap/core": ">=3.28.0 <4.0.0",
|
|
662
662
|
"@tiptap/extension-mention": ">=3.28.0 <4.0.0",
|
|
663
663
|
"@tiptap/pm": ">=3.28.0 <4.0.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/web-react/work-product.tsx"],"sourcesContent":["/**\n * Work-product review surfaces — the sandbox-ui-FREE half of the vertical:\n *\n * - {@link ReviewQueuePanel}: the practice/matters/campaign review queue over\n * a `fetchQueue(cursor)` data port (the `AgentActivityPanel` shape).\n * - {@link WorkProductCard}: the persisted `type:'work_product'` transcript\n * anchor rendered inside `ChatMessages` — chat stays the driver surface.\n * - {@link EvidenceLineageTable}: target → claim → source rows with\n * click-through via an injected `resolveSourceUrl` (the\n * `MessageAttachments.resolveFileUrl` pattern).\n * - {@link ExceptionList} / {@link QualityCheckList}: severity-badged\n * exception rows and pass/fail check rows.\n * - {@link ProvenanceStamp}: profileHash prefix + runId + serving-model\n * chips + the optional backtest slot (\"182 cases · composite 0.81 ·\n * trust PASS\" — or \"quality: unverified\" when the trust gate failed).\n *\n * Anything hosting sandbox-ui (DiffView, CodeView, PillTabs) lives in\n * `./work-product-react` instead — this module must stay importable without\n * the optional sandbox-ui peer.\n */\n\nimport { useCallback, useEffect, useState } from 'react'\nimport { StatusPill, type StatusTone } from '@tangle-network/ui/primitives'\n\nimport {\n parseReviewQueueItem,\n type ReviewQueueItem,\n type ReviewQueueState,\n} from '../work-product/queue'\nimport type {\n EvidenceEntry,\n ExceptionEntry,\n ProfileBacktestSummary,\n QualityCheck,\n WorkProductPersistedPart,\n WorkProductProvenance,\n WorkProductStatus,\n} from '../work-product/types'\nimport { persistedPartToWorkProduct } from '../work-product/types'\n\nexport { parseReviewQueueItem }\nexport type { ReviewQueueItem, ReviewQueueState }\n\n// ── shared presentation vocabulary ────────────────────────────────────────\n\nconst STATE_LABELS: Record<ReviewQueueState, string> = {\n intake: 'Intake',\n missing_info: 'Missing info',\n working: 'Working',\n ready_for_review: 'Ready for review',\n changes_requested: 'Changes requested',\n approved: 'Approved',\n blocked: 'Blocked',\n}\n\n// Tones are ui's StatusPill vocabulary, so a queue state carries the same glyph\n// and colour as every other status in the product. Warning is \"needs a person\";\n// working is still moving (an open ring).\nconst STATE_TONES: Record<ReviewQueueState, StatusTone> = {\n intake: 'neutral',\n missing_info: 'warning',\n working: 'running',\n ready_for_review: 'success',\n changes_requested: 'warning',\n approved: 'success',\n blocked: 'danger',\n}\n\nconst STATUS_LABELS: Record<WorkProductStatus, string> = {\n draft: 'Draft',\n blocked: 'Blocked',\n ready: 'Ready for review',\n changes_requested: 'Changes requested',\n approved: 'Approved',\n superseded: 'Superseded',\n}\n\n// A draft is not yet a state anyone acts on, so it is neutral rather than the\n// brand accent it used to borrow.\nconst STATUS_TONES: Record<WorkProductStatus, StatusTone> = {\n draft: 'neutral',\n blocked: 'danger',\n ready: 'success',\n changes_requested: 'warning',\n approved: 'success',\n superseded: 'neutral',\n}\n\n/** Human label for a work-product status. */\nexport function workProductStatusLabel(status: WorkProductStatus): string {\n return STATUS_LABELS[status]\n}\n\nfunction StatePill({ state }: { state: ReviewQueueState }) {\n return <StatusPill tone={STATE_TONES[state]}>{STATE_LABELS[state]}</StatusPill>\n}\n\nfunction WorkProductStatusPill({ status }: { status: WorkProductStatus }) {\n return <StatusPill tone={STATUS_TONES[status]}>{STATUS_LABELS[status]}</StatusPill>\n}\n\n// ── transcript anchor helpers + card ──────────────────────────────────────\n\n/** Every persisted work-product anchor on one message, re-validated. */\nexport function workProductPartsFromMessageParts(\n parts: ReadonlyArray<Record<string, unknown>> | null | undefined,\n): WorkProductPersistedPart[] {\n if (!parts) return []\n const out: WorkProductPersistedPart[] = []\n for (const part of parts) {\n const typed = persistedPartToWorkProduct(part)\n if (typed) out.push(typed)\n }\n return out\n}\n\n/** Properties for the transcript anchor card rendered in chat */\nexport interface WorkProductCardProps {\n part: WorkProductPersistedPart\n /** Open the work product (queue detail / pane) — the card's only action. */\n onOpen?: (part: WorkProductPersistedPart) => void\n className?: string\n}\n\n/** The chat transcript anchor card for one work-product version — a compact,\n * system-authored pointer, not a parallel review surface. */\nexport function WorkProductCard({ part, onOpen, className }: WorkProductCardProps) {\n return (\n <div\n className={`flex items-center gap-3 rounded-xl border border-border bg-card px-4 py-3 ${className ?? ''}`}\n data-work-product-id={part.ref.id}\n >\n <span className=\"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-primary/10 text-primary\">\n <svg viewBox=\"0 0 24 24\" className=\"h-4 w-4\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z\" />\n <polyline points=\"14 2 14 8 20 8\" />\n <path d=\"m9 15 2 2 4-4\" />\n </svg>\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-semibold text-foreground\">{part.title}</p>\n <p className=\"text-xs text-muted-foreground\">\n {part.kind && <span className=\"font-mono\">{part.kind}</span>}\n {part.kind && ' · '}v{part.ref.version}\n </p>\n </div>\n <WorkProductStatusPill status={part.status} />\n {onOpen && (\n <button\n type=\"button\"\n onClick={() => onOpen(part)}\n className=\"rounded-md border border-border px-2.5 py-1 text-xs font-medium text-foreground transition hover:bg-accent\"\n >\n Review\n </button>\n )}\n </div>\n )\n}\n\n// ── review queue panel ────────────────────────────────────────────────────\n\n/** One fetched page of queue items with an optional continuation cursor */\nexport interface ReviewQueuePage {\n items: ReviewQueueItem[]\n /** Opaque continuation token; absent ⇒ no further pages. */\n nextCursor?: string\n}\n\n/** Properties for the review queue panel over a fetch data port */\nexport interface ReviewQueuePanelProps {\n /** Data port — fetch one page of queue items (the projection's output,\n * re-validated here at the JSON boundary). */\n fetchQueue: (cursor?: string) => Promise<ReviewQueuePage>\n /** Open one queue item (navigate to its thread / detail pane). */\n onSelect?: (item: ReviewQueueItem) => void\n title?: string\n emptyLabel?: string\n className?: string\n}\n\n/** Merge a fetched page into held rows: dedupe by scopeKey, incoming wins,\n * newest updatedAt first. Exported for tests. */\nexport function mergeReviewQueuePages(existing: ReviewQueueItem[], incoming: ReviewQueueItem[]): ReviewQueueItem[] {\n const byScope = new Map<string, ReviewQueueItem>()\n for (const item of existing) byScope.set(item.scopeKey, item)\n for (const item of incoming) byScope.set(item.scopeKey, item)\n return [...byScope.values()].sort((a, b) => b.updatedAt - a.updatedAt)\n}\n\n/** The workspace review queue — cursor-paged, refreshable, selection via\n * callback. States, counts, and provenance render from the projection; the\n * panel holds no domain logic. */\nexport function ReviewQueuePanel({\n fetchQueue,\n onSelect,\n title = 'Review queue',\n emptyLabel = 'Nothing awaiting review.',\n className,\n}: ReviewQueuePanelProps) {\n const [items, setItems] = useState<ReviewQueueItem[]>([])\n const [cursor, setCursor] = useState<string | undefined>(undefined)\n const [loading, setLoading] = useState(false)\n const [error, setError] = useState<string | null>(null)\n\n const load = useCallback(\n async (from?: string) => {\n setLoading(true)\n setError(null)\n try {\n const page = await fetchQueue(from)\n const validated = page.items\n .map((item) => parseReviewQueueItem(item))\n .filter((item): item is ReviewQueueItem => item !== null)\n setItems((prev) => mergeReviewQueuePages(from === undefined ? [] : prev, validated))\n setCursor(page.nextCursor)\n } catch (e) {\n setError(e instanceof Error ? e.message : String(e))\n } finally {\n setLoading(false)\n }\n },\n [fetchQueue],\n )\n\n useEffect(() => {\n void load()\n }, [load])\n\n return (\n <div className={`space-y-2 ${className ?? ''}`}>\n <div className=\"flex items-center gap-2\">\n <h2 className=\"flex-1 text-sm font-semibold\">{title}</h2>\n <button\n type=\"button\"\n onClick={() => void load()}\n disabled={loading}\n aria-label=\"Refresh\"\n className=\"rounded-md p-1.5 text-muted-foreground transition hover:bg-accent hover:text-foreground disabled:opacity-50\"\n >\n <svg viewBox=\"0 0 24 24\" className={`h-3.5 w-3.5 ${loading ? 'animate-spin' : ''}`} fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <path d=\"M21 12a9 9 0 1 1-2.64-6.36\" />\n <polyline points=\"21 3 21 9 15 9\" />\n </svg>\n </button>\n </div>\n {error && <p className=\"rounded-md bg-destructive/10 px-3 py-2 text-xs text-destructive\">{error}</p>}\n {!error && items.length === 0 && !loading && (\n <p className=\"rounded-md border border-dashed border-border px-3 py-4 text-center text-xs text-muted-foreground\">{emptyLabel}</p>\n )}\n {/* The queue renders neither rows nor the empty copy while `loading`, so\n the announcement is the only thing a screen reader has during the wait.\n Kept mounted with changing text: an inserted live region that already\n carries its message is not reliably announced. */}\n <span role=\"status\" aria-live=\"polite\" aria-busy={loading} className=\"sr-only\">\n {loading ? 'Loading review queue…' : ''}\n </span>\n <ul className=\"space-y-1.5\" aria-busy={loading}>\n {items.map((item) => (\n <li key={item.scopeKey}>\n <button\n type=\"button\"\n onClick={() => onSelect?.(item)}\n className=\"flex w-full items-center gap-3 rounded-lg border border-border bg-card px-3 py-2.5 text-left transition hover:border-primary/40 hover:bg-accent\"\n >\n <div className=\"min-w-0 flex-1\">\n <p className=\"truncate text-sm font-medium text-foreground\">\n {item.workProduct?.title ?? item.scopeKey}\n {item.workProduct && <span className=\"ml-1.5 text-xs text-muted-foreground\">v{item.workProduct.version}</span>}\n </p>\n <p className=\"mt-0.5 flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground\">\n {item.workProduct?.kind && <span className=\"font-mono\">{item.workProduct.kind}</span>}\n {item.pendingAsk && <span>asks: {item.pendingAsk.title}</span>}\n {item.blockingExceptions > 0 && (\n <span className=\"text-destructive\">{item.blockingExceptions} blocking</span>\n )}\n {item.failedChecks > 0 && <span className=\"text-warning\">{item.failedChecks} failed checks</span>}\n {item.provenance && item.provenance.profileHash && (\n <span className=\"font-mono\">{item.provenance.profileHash.slice(0, 8)}</span>\n )}\n </p>\n </div>\n <StatePill state={item.state} />\n </button>\n </li>\n ))}\n </ul>\n {cursor && (\n <button\n type=\"button\"\n onClick={() => void load(cursor)}\n disabled={loading}\n className=\"w-full rounded-md border border-border px-3 py-1.5 text-xs font-medium text-muted-foreground transition hover:bg-accent disabled:opacity-50\"\n >\n Load more\n </button>\n )}\n </div>\n )\n}\n\n// ── evidence lineage table ────────────────────────────────────────────────\n\n/** Properties for the evidence lineage table with source click-through */\nexport interface EvidenceLineageTableProps {\n evidence: readonly EvidenceEntry[]\n /** Resolve one entry's source document to an openable URL (signed\n * object-store/vault download) — the `resolveFileUrl` pattern. Absent →\n * sources render as plain refs without links. */\n resolveSourceUrl?: (entry: EvidenceEntry) => string\n className?: string\n}\n\nfunction locatorLabel(entry: EvidenceEntry): string | null {\n const parts: string[] = []\n if (entry.locator.page !== undefined) parts.push(`p.${entry.locator.page}`)\n if (entry.locator.range) parts.push(entry.locator.range)\n return parts.length ? parts.join(' · ') : null\n}\n\n/** Target → claim → source lineage rows: the \"every material value traceable\n * to source evidence\" surface. Each row names the artifact target, the\n * claim, and the source document location supporting it. */\nexport function EvidenceLineageTable({ evidence, resolveSourceUrl, className }: EvidenceLineageTableProps) {\n if (evidence.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No evidence recorded.</p>\n }\n return (\n <div className={`overflow-x-auto ${className ?? ''}`}>\n <table className=\"w-full border-collapse text-left text-sm\">\n <thead>\n <tr className=\"border-b border-border text-xs uppercase tracking-[0.05em] text-muted-foreground\">\n <th className=\"py-1.5 pr-3 font-medium\">Target</th>\n <th className=\"py-1.5 pr-3 font-medium\">Claim</th>\n <th className=\"py-1.5 font-medium\">Source</th>\n </tr>\n </thead>\n <tbody>\n {evidence.map((entry) => {\n const url = resolveSourceUrl?.(entry)\n const locator = locatorLabel(entry)\n return (\n <tr key={entry.id} className=\"border-b border-border align-top\">\n <td className=\"py-2 pr-3 font-mono text-xs text-foreground\">{entry.target}</td>\n <td className=\"py-2 pr-3 text-sm leading-snug text-foreground\">\n {entry.claim}\n {entry.locator.quote && (\n // The basis is what a reviewer weighs, so it has to be\n // visible per row, not only in the aggregate check detail.\n // A platform-sliced quote came out of the document's own\n // bytes; a model-typed one was proved to occur but was\n // transcribed. Same text, different strength of evidence.\n <span\n className={`mt-0.5 block border-l-2 pl-2 text-xs italic ${\n entry.locator.quoteBasis === 'span'\n ? 'border-primary/60 text-foreground'\n : 'border-border text-muted-foreground'\n }`}\n title={\n entry.locator.quoteBasis === 'span'\n ? 'Sliced from the source document by the platform'\n : entry.locator.quoteBasis === 'model'\n ? 'Quoted by the agent, verified to occur in the source'\n : 'Unverified quote'\n }\n >\n “{entry.locator.quote}”\n {entry.locator.quoteBasis && (\n <span className=\"ml-1.5 align-middle text-xs not-italic uppercase tracking-[0.05em] text-muted-foreground\">\n {entry.locator.quoteBasis === 'span' ? 'from source' : 'verified'}\n </span>\n )}\n </span>\n )}\n </td>\n <td className=\"py-2 text-xs\">\n {url ? (\n <a\n href={url}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"font-mono text-primary underline-offset-2 hover:underline\"\n >\n {entry.sourceRef}\n </a>\n ) : (\n <span className=\"font-mono text-muted-foreground\">{entry.sourceRef}</span>\n )}\n {locator && <span className=\"ml-1.5 text-muted-foreground\">{locator}</span>}\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )\n}\n\n// ── exceptions + checks ───────────────────────────────────────────────────\n\nconst SEVERITY_TONES: Record<ExceptionEntry['severity'], string> = {\n blocking: 'bg-destructive/10 text-destructive',\n material: 'bg-warning/10 text-warning',\n advisory: 'bg-secondary text-muted-foreground',\n}\n\n/** Properties for the severity-badged exception list */\nexport interface ExceptionListProps {\n exceptions: readonly ExceptionEntry[]\n className?: string\n}\n\n/** Severity-badged exception rows with resolution state. */\nexport function ExceptionList({ exceptions, className }: ExceptionListProps) {\n if (exceptions.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No exceptions flagged.</p>\n }\n return (\n <ul className={`space-y-1.5 ${className ?? ''}`}>\n {exceptions.map((entry) => (\n <li key={entry.id} className=\"flex items-start gap-2.5 rounded-lg border border-border bg-card px-3 py-2\">\n <span className={`mt-0.5 inline-flex shrink-0 items-center rounded-full px-2 py-0.5 text-xs font-semibold uppercase tracking-[0.05em] ${SEVERITY_TONES[entry.severity]}`}>\n {entry.severity}\n </span>\n <div className=\"min-w-0 flex-1\">\n <p className={`text-sm leading-snug ${entry.resolved ? 'text-muted-foreground line-through' : 'text-foreground'}`}>\n {entry.message}\n </p>\n <p className=\"mt-0.5 flex flex-wrap gap-x-2 text-xs text-muted-foreground\">\n <span className=\"font-mono\">{entry.kind}</span>\n {entry.targets && entry.targets.length > 0 && <span className=\"font-mono\">{entry.targets.join(', ')}</span>}\n {entry.resolved && <span>resolved{entry.resolvedBy ? ` by ${entry.resolvedBy}` : ''}</span>}\n {entry.resolutionNote && <span>{entry.resolutionNote}</span>}\n </p>\n </div>\n </li>\n ))}\n </ul>\n )\n}\n\n/** Properties for the pass/fail quality check list */\nexport interface QualityCheckListProps {\n checks: readonly QualityCheck[]\n className?: string\n}\n\n/** Pass/fail quality-check rows tagged with their source (agent self-report,\n * platform gate, judge ensemble). */\nexport function QualityCheckList({ checks, className }: QualityCheckListProps) {\n if (checks.length === 0) {\n return <p className={`text-xs text-muted-foreground ${className ?? ''}`}>No checks recorded.</p>\n }\n return (\n <ul className={`space-y-1 ${className ?? ''}`}>\n {checks.map((check) => (\n <li key={check.id} className=\"flex items-start gap-2 rounded-md px-1 py-1\">\n {check.passed ? (\n <svg viewBox=\"0 0 24 24\" className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-success\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <polyline points=\"20 6 9 17 4 12\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 24 24\" className=\"mt-0.5 h-3.5 w-3.5 shrink-0 text-destructive\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"2.5\" strokeLinecap=\"round\" strokeLinejoin=\"round\" aria-hidden>\n <line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\" />\n <line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\" />\n </svg>\n )}\n <div className=\"min-w-0 flex-1\">\n <p className=\"text-sm text-foreground\">\n {check.name}\n <span className=\"ml-1.5 text-xs uppercase tracking-[0.05em] text-muted-foreground\">{check.source}</span>\n </p>\n {check.detail && <p className=\"text-xs leading-snug text-muted-foreground\">{check.detail}</p>}\n </div>\n </li>\n ))}\n </ul>\n )\n}\n\n// ── provenance stamp ──────────────────────────────────────────────────────\n\n/** Properties for the provenance stamp with the optional backtest slot */\nexport interface ProvenanceStampProps {\n provenance: Pick<WorkProductProvenance, 'profileHash' | 'runId' | 'servingModels'> &\n Partial<Pick<WorkProductProvenance, 'costUsd' | 'producedAt'>>\n /** The product-resolved backtest summary for this profile hash. When its\n * trust gate failed, the composite renders as \"quality: unverified\" —\n * never a naked number. */\n backtest?: ProfileBacktestSummary\n className?: string\n}\n\n/** Truncated id with an ellipsis marker, so a sliced hash never passes as complete. */\nfunction truncateId(id: string, length: number): string {\n return id.length > length ? `${id.slice(0, length)}…` : id\n}\n\n/** The audit line a reviewer approves against: which configuration produced\n * this document, what served it, and how that configuration measured on its\n * backtest. */\nexport function ProvenanceStamp({ provenance, backtest, className }: ProvenanceStampProps) {\n return (\n <div className={`flex flex-wrap items-center gap-x-2.5 gap-y-1 text-xs text-muted-foreground ${className ?? ''}`}>\n <span className=\"font-mono\" title={provenance.profileHash}>\n profile {provenance.profileHash ? truncateId(provenance.profileHash, 10) : '—'}\n </span>\n <span className=\"font-mono\" title={provenance.runId}>\n run {provenance.runId ? truncateId(provenance.runId, 10) : '—'}\n </span>\n {provenance.servingModels.length > 0 ? (\n provenance.servingModels.map((model) => (\n <span key={model} className=\"rounded-full bg-secondary px-2 py-0.5 font-mono\">\n {model}\n </span>\n ))\n ) : (\n <span className=\"italic\">serving model pending</span>\n )}\n {typeof provenance.costUsd === 'number' && <span>${provenance.costUsd.toFixed(provenance.costUsd < 0.01 ? 4 : 2)}</span>}\n {backtest &&\n (backtest.trust === 'pass' ? (\n <span className=\"text-success\">\n {backtest.cases} backtest cases · composite {backtest.composite.toFixed(2)} · trust PASS\n </span>\n ) : (\n <span className=\"text-warning\" title={backtest.trustReasons.join('; ')}>\n quality: unverified\n </span>\n ))}\n </div>\n )\n}\n"],"mappings":";;;;;;;;AAqBA,SAAS,aAAa,WAAW,gBAAgB;AACjD,SAAS,kBAAmC;AAwEnC,cAuCD,YAvCC;AAjDT,IAAM,eAAiD;AAAA,EACrD,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,SAAS;AACX;AAKA,IAAM,cAAoD;AAAA,EACxD,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,SAAS;AACX;AAEA,IAAM,gBAAmD;AAAA,EACvD,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,YAAY;AACd;AAIA,IAAM,eAAsD;AAAA,EAC1D,OAAO;AAAA,EACP,SAAS;AAAA,EACT,OAAO;AAAA,EACP,mBAAmB;AAAA,EACnB,UAAU;AAAA,EACV,YAAY;AACd;AAGO,SAAS,uBAAuB,QAAmC;AACxE,SAAO,cAAc,MAAM;AAC7B;AAEA,SAAS,UAAU,EAAE,MAAM,GAAgC;AACzD,SAAO,oBAAC,cAAW,MAAM,YAAY,KAAK,GAAI,uBAAa,KAAK,GAAE;AACpE;AAEA,SAAS,sBAAsB,EAAE,OAAO,GAAkC;AACxE,SAAO,oBAAC,cAAW,MAAM,aAAa,MAAM,GAAI,wBAAc,MAAM,GAAE;AACxE;AAKO,SAAS,iCACd,OAC4B;AAC5B,MAAI,CAAC,MAAO,QAAO,CAAC;AACpB,QAAM,MAAkC,CAAC;AACzC,aAAW,QAAQ,OAAO;AACxB,UAA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AAQ,CAAC;AAAA,MAAE;AAAA,OAC7E,IAEA,oBAAC,UAAK,WAAU,gBAAe,OAAO,SAAS,aAAa,KAAK,IAAI,GAAG,iCAExE;AAAA,KAEN;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/web-react/workspace-switcher.tsx"],"sourcesContent":["import { useCallback, useState, type ReactNode } from 'react'\nimport { CheckGlyph, OVERLAY_SHADOW, PopoverSurface } from './controls'\nimport { usePopoverDialog } from './popover-dialog'\n\nexport interface WorkspaceSwitcherItem {\n id: string\n name: string\n /** Host-provided presentation; never used to resolve identity. */\n icon?: ReactNode\n}\nexport interface WorkspaceSwitcherProps {\n items: readonly WorkspaceSwitcherItem[]\n value: string | null | undefined\n onChange: (id: string) => void\n label?: string\n placeholder?: string\n searchLabel?: string\n emptyLabel?: string\n collapsed?: boolean\n variant?: 'inline' | 'block'\n /** Product-owned creation/navigation actions. No new data or route owner. */\n footer?: ReactNode\n open?: boolean\n onOpenChange?: (open: boolean) => void\n}\n\n/** Searchable workspace/client/project selection, shared across all workspace shells. */\nexport function WorkspaceSwitcher({\n items, value, onChange, label = 'Switch workspace', placeholder = 'Select workspace',\n searchLabel = 'Search workspaces', emptyLabel = 'No workspaces available',\n collapsed = false, variant = 'block', footer, open: controlledOpen, onOpenChange,\n}: WorkspaceSwitcherProps) {\n const [localOpen, setLocalOpen] = useState(false)\n const [query, setQuery] = useState('')\n const open = controlledOpen ?? localOpen\n const changeOpen = useCallback((next: boolean) => {\n setLocalOpen(next)\n if (!next) setQuery('')\n onOpenChange?.(next)\n }, [onOpenChange])\n const { containerRef, triggerRef, panelRef, triggerProps, id } = usePopoverDialog(open, changeOpen)\n const current = items.find((item) => item.id === value)\n const search = query.trim().toLocaleLowerCase()\n const visible = search ? items.filter((item) => item.name.toLocaleLowerCase().includes(search)) : items\n const mark = (item?: WorkspaceSwitcherItem) => item?.icon ?? <WorkspaceInitial name={item?.name ?? ''} />\n return (\n <div ref={containerRef} className={`min-w-0 ${variant === 'block' ? 'w-full' : 'inline-flex'}`}>\n <button type=\"button\" {...triggerProps} onClick={() => changeOpen(!open)}\n aria-label={`${label}: ${current?.name ?? placeholder}`} title={current?.name ?? placeholder}\n className={`flex min-h-10 min-w-0 items-center gap-2 rounded-lg text-left text-sm text-foreground transition-colors hover:bg-muted ${collapsed ? 'w-10 justify-center' : variant === 'block' ? 'w-full border border-border px-2 py-1.5' : 'max-w-[16rem] px-2.5 py-1.5'}`}>\n {mark(current)}\n {!collapsed && <><span className=\"min-w-0 flex-1 truncate font-medium\">{current?.name ?? placeholder}</span><svg aria-hidden className=\"h-4 w-4 shrink-0 text-muted-foreground\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.75\"><path d=\"m8 9 4-4 4 4m-8 6 4 4 4-4\" /></svg></>}\n </button>\n <PopoverSurface open={open} id={id} role=\"dialog\" aria-label={label} triggerRef={triggerRef} panelRef={panelRef}\n contentKey={`${query}:${items.length}`} className={`w-80 max-w-[calc(100vw-2rem)] overflow-y-auto rounded-xl border border-card-edge bg-popover p-2 text-foreground ${OVERLAY_SHADOW}`}>\n <input data-autofocus aria-label={searchLabel} placeholder={searchLabel} value={query} onChange={(event) => setQuery(event.target.value)}\n className=\"mb-2 h-10 w-full rounded-lg border border-border bg-background px-3 text-sm text-foreground\" />\n <div className=\"max-h-64 overflow-y-auto\">\n {visible.map((item) => (\n <button key={item.id} type=\"button\" aria-current={item.id === value ? 'true' : undefined}\n className=\"flex min-h-10 w-full items-center gap-2 rounded-lg px-2 py-2 text-left text-sm hover:bg-muted\"\n onClick={() => { onChange(item.id); changeOpen(false); triggerRef.current?.focus() }}>\n {mark(item)}<span className=\"min-w-0 flex-1 break-words\">{item.name}</span>\n {item.id === value && <CheckGlyph className=\"h-4 w-4 shrink-0 text-primary\" />}\n </button>\n ))}\n {visible.length === 0 && <p className=\"p-3 text-sm text-muted-foreground\" role=\"status\">{items.length === 0 ? emptyLabel : 'No matches. Try another search.'}</p>}\n </div>\n {footer != null && <div className=\"mt-2 border-t border-border pt-2\">{footer}</div>}\n </PopoverSurface>\n </div>\n )\n}\n\n/**\n * The one workspace avatar: a rounded square with the first letter, tinted\n * with the product accent. The switchers and the listing all use it, so a\n * client looks the same wherever it appears.\n */\nexport function WorkspaceInitial({ name, size = 'sm' }: { name: string; size?: 'sm' | 'lg' }) {\n const letter = Array.from(name.trim())[0]?.toLocaleUpperCase() ?? '?'\n const box = size === 'lg' ? 'h-10 w-10 rounded-lg text-base' : 'h-6 w-6 rounded-md text-xs'\n return (\n // The letter is foreground on an accent tint, not accent on accent: a dim\n // dark-theme primary (physim's aubergine) left a primary letter unreadable.\n <span aria-hidden className={`flex shrink-0 items-center justify-center bg-primary/15 font-semibold text-foreground ring-1 ring-inset ring-primary/20 ${box}`}>\n {letter}\n </span>\n )\n}\n"],"mappings":";;;;;;;;;;AAAA,SAAS,aAAa,gBAAgC;AA4CS,SAOxC,UAPwC,KAOxC,YAPwC;AAjBxD,SAAS,kBAAkB;AAAA,EAChC;AAAA,EAAO;AAAA,EAAO;AAAA,EAAU,QAAQ;AAAA,EAAoB,cAAc;AAAA,EAClE,cAAc;AAAA,EAAqB,aAAa;AAAA,EAChD,YAAY;AAAA,EAAO,UAAU;AAAA,EAAS;AAAA,EAAQ,MAAM;AAAA,EAAgB;AACtE,GAA2B;AACzB,QAAM,CAAC,WAAW,YAAY,IAAI,SAAS,KAAK;AAChD,QAAM,CAAC,OAAO,QAAQ,IAAI,SAAS,EAAE;AACrC,QAAM,OAAO,kBAAkB;AAC/B,QAAM,aAAa,YAAY,CAAC,SAAkB;AAChD,iBAAa,IAAI;AACjB,QAAI,CAAC,KAAM,UAAS,EAAE;AACtB,mBAAe,IAAI;AAAA,EACrB,GAAG,CAAC,YAAY,CAAC;AACjB,QAAM,EAAE,cAAc,YAAY,UAAU,cAAc,GAAG,IAAI,iBAAiB,MAAM,UAAU;AAClG,QAAM,UAAU,MAAM,KAA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