@tangle-network/agent-app 0.55.4 → 0.55.6
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/{DesignCanvasEditor-VJ3R7RM2.js → DesignCanvasEditor-JSEDIQWF.js} +3 -3
- package/dist/assistant/index.js +3 -3
- package/dist/chat-routes/index.js +4 -4
- package/dist/{chunk-KLQWU6K5.js → chunk-2BD7VZKN.js} +2 -2
- package/dist/{chunk-PFOJRQ3Q.js → chunk-2HEFK764.js} +2 -2
- package/dist/{chunk-2TARCQA2.js → chunk-7YLSF33A.js} +4 -4
- package/dist/{chunk-TMKSWEVQ.js → chunk-GDB3YCNS.js} +3 -3
- package/dist/chunk-GDB3YCNS.js.map +1 -0
- package/dist/{chunk-2N7PDPLC.js → chunk-GPRTXOBI.js} +2 -2
- package/dist/{chunk-YHR2P7FY.js → chunk-HNVWTWU5.js} +2 -2
- package/dist/{chunk-W6LBJNCQ.js → chunk-J5EBGZTD.js} +2 -2
- package/dist/{chunk-CHYGAU4E.js → chunk-M63EUBSH.js} +5 -5
- package/dist/{chunk-CHYGAU4E.js.map → chunk-M63EUBSH.js.map} +1 -1
- 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/design-canvas-react/index.js +3 -3
- package/dist/design-canvas-react/lazy.js +1 -1
- package/dist/preset-cloudflare/index.js +2 -2
- package/dist/sandbox/index.js +4 -4
- package/dist/theme/brand.generated.d.ts +3 -3
- package/dist/theme/index.js +1 -1
- package/dist/theme/tokens.css +31 -13
- package/dist/tools/index.js +4 -4
- 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/index.js +2 -2
- 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 +1 -1
- package/package.json +3 -3
- package/dist/chunk-47UDWWUN.js.map +0 -1
- package/dist/chunk-QMTZUDDN.js.map +0 -1
- package/dist/chunk-TMKSWEVQ.js.map +0 -1
- /package/dist/{DesignCanvasEditor-VJ3R7RM2.js.map → DesignCanvasEditor-JSEDIQWF.js.map} +0 -0
- /package/dist/{chunk-KLQWU6K5.js.map → chunk-2BD7VZKN.js.map} +0 -0
- /package/dist/{chunk-PFOJRQ3Q.js.map → chunk-2HEFK764.js.map} +0 -0
- /package/dist/{chunk-2TARCQA2.js.map → chunk-7YLSF33A.js.map} +0 -0
- /package/dist/{chunk-2N7PDPLC.js.map → chunk-GPRTXOBI.js.map} +0 -0
- /package/dist/{chunk-YHR2P7FY.js.map → chunk-HNVWTWU5.js.map} +0 -0
- /package/dist/{chunk-W6LBJNCQ.js.map → chunk-J5EBGZTD.js.map} +0 -0
|
@@ -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,EACA;AACF,GAAyB;AACvB,QAAM,WAAW,YAAY;AAC7B,QAAM,OAAO,kBAAkB,UAAU,WAAW;AACpD,QAAM,WAAW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AM;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,gBAAgB;AAAA,EAC9B;AAAA,EACA,aAAa;AAAA,EACb;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA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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"]}
|
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.6",
|
|
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": [
|
|
@@ -582,7 +582,7 @@
|
|
|
582
582
|
"@tangle-network/agent-knowledge": "19.0.1",
|
|
583
583
|
"@tangle-network/agent-profile-materialize": "0.20.1",
|
|
584
584
|
"@tangle-network/agent-runtime": "0.293.0",
|
|
585
|
-
"@tangle-network/brand": "1.
|
|
585
|
+
"@tangle-network/brand": "1.15.7",
|
|
586
586
|
"@tangle-network/hub-sdk": "0.24.0",
|
|
587
587
|
"@tangle-network/sandbox": "0.60.10",
|
|
588
588
|
"@tangle-network/sandbox-ui": "0.127.1",
|
|
@@ -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;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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":[]}
|
|
@@ -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 )\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ACA,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;AAOO,SAAS,iBAAiB,EAAE,MAAM,OAAO,KAAK,GAAyC;AAC5F,QAAM,SAAS,MAAM,KAAK,KAAK,KAAK,CAAC,EAAE,CAAC,GAAG,kBAAkB,KAAK;AAClE,QAAM,MAAM,SAAS,OAAO,mCAAmC;AAC/D;AAAA;AAAA;AAAA,IAGE,oBAAC,UAAK,eAAW,MAAC,WAAW,2HAA2H,GAAG,IACxJ,kBACH;AAAA;AAEJ;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/brand.generated.ts","../src/theme/theme.ts"],"sourcesContent":["/** GENERATED from @tangle-network/brand/styles/legacy-light.css\n * SHA-256: f4d47f5d42d88810ae850c83e6d0e0a1f7be481d4e07b66ab3e29c796d02950f\n * Run node src/theme/build.mjs --write; do not edit colors or ratios here. */\nexport const brandThemes = {\n \"light\": {\n \"background\": \"0 0% 91.7647%\",\n \"foreground\": \"0 0% 17.6471%\",\n \"card\": \"0 0% 100%\",\n \"cardForeground\": \"0 0% 17.6471%\",\n \"popover\": \"0 0% 100%\",\n \"popoverForeground\": \"0 0% 17.6471%\",\n \"primary\": \"243.2927 80.3922% 60%\",\n \"primaryForeground\": \"0 0% 100%\",\n \"secondary\": \"0 0% 94.902%\",\n \"secondaryForeground\": \"0 0% 17.6471%\",\n \"muted\": \"0 0% 94.902%\",\n \"mutedForeground\": \"0 0% 29.8039%\",\n \"accent\": \"0 0% 94.902%\",\n \"accentForeground\": \"0 0% 17.6471%\",\n \"destructive\": \"0 73.7089% 41.7647%\",\n \"destructiveForeground\": \"0 0% 100%\",\n \"border\": \"0 0% 81.5686%\",\n \"input\": \"0 0% 29.8039%\",\n \"ring\": \"246 54% 51%\",\n \"success\": \"162.931 93.5484% 24.3137%\",\n \"warning\": \"41 96% 50%\",\n \"successForeground\": \"0 0% 100%\",\n \"warningForeground\": \"0 0% 0%\",\n \"warningStrong\": \"25.9259 90% 35.2941%\",\n \"inputFill\": \"hsl(0 0% 96.0784%)\",\n \"canvasBackdrop\": \"#dadada\",\n \"borderSoft\": \"rgba(0, 0, 0, 0.10)\",\n \"cardEdge\": \"rgba(0, 0, 0, 0.14)\",\n \"canvasRender\": {\n \"grid\": \"#d0d0d0\",\n \"snapGrid\": \"#787878\",\n \"snapGuide\": \"#0369a1\",\n \"snapPage\": \"#ab4f09\",\n \"snapElement\": \"#b91c1c\",\n \"selectionStroke\": \"#5047eb\",\n \"selectionAnchorFill\": \"#ffffff\",\n \"placeholderFill\": \"#f7f7f7\",\n \"placeholderStroke\": \"#d0d0d0\",\n \"brokenFill\": \"#f2f2f2\",\n \"brokenStroke\": \"#787878\"\n }\n },\n \"dark\": {\n \"background\": \"0 0% 8.6275%\",\n \"foreground\": \"0 0% 90.1961%\",\n \"card\": \"0 0% 18.8235%\",\n \"cardForeground\": \"0 0% 90.1961%\",\n \"popover\": \"0 0% 20.7843%\",\n \"popoverForeground\": \"0 0% 90.1961%\",\n \"primary\": \"229.6552 93.5484% 81.7647%\",\n \"primaryForeground\": \"0 0% 0%\",\n \"secondary\": \"0 0% 20.7843%\",\n \"secondaryForeground\": \"0 0% 90.1961%\",\n \"muted\": \"0 0% 20.7843%\",\n \"mutedForeground\": \"0 0% 70.9804%\",\n \"accent\": \"0 0% 20.7843%\",\n \"accentForeground\": \"0 0% 90.1961%\",\n \"destructive\": \"2.7907 100% 83.1373%\",\n \"destructiveForeground\": \"0 0% 0%\",\n \"border\": \"0 0% 29.8039%\",\n \"input\": \"0 0% 70.9804%\",\n \"ring\": \"233 100% 87%\",\n \"success\": \"154.7107 60.199% 60.5882%\",\n \"warning\": \"40 94% 56%\",\n \"successForeground\": \"0 0% 0%\",\n \"warningForeground\": \"0 0% 0%\",\n \"warningStrong\": \"41.4545 88.2353% 63.3333%\",\n \"inputFill\": \"hsl(0 0% 12.1569%)\",\n \"canvasBackdrop\": \"#101010\",\n \"borderSoft\": \"rgba(255, 255, 255, 0.10)\",\n \"cardEdge\": \"rgba(255, 255, 255, 0.16)\",\n \"canvasRender\": {\n \"grid\": \"#4c4c4c\",\n \"snapGrid\": \"#8e8e8e\",\n \"snapGuide\": \"#67cdff\",\n \"snapPage\": \"#f4c14f\",\n \"snapElement\": \"#ffada9\",\n \"selectionStroke\": \"#a5b4fc\",\n \"selectionAnchorFill\": \"#3b3b3b\",\n \"placeholderFill\": \"#242424\",\n \"placeholderStroke\": \"#4c4c4c\",\n \"brokenFill\": \"#353535\",\n \"brokenStroke\": \"#8e8e8e\"\n }\n }\n} as const\n","/** Brand-derived HSL compatibility and bitmap snapshots. Regenerate with src/theme/build.mjs; never author a second palette here. */\nimport { brandThemes } from './brand.generated'\n\nexport interface AgentAppTheme {\n background: string\n foreground: string\n card: string\n cardForeground: string\n popover: string\n popoverForeground: string\n primary: string\n primaryForeground: string\n secondary: string\n secondaryForeground: string\n muted: string\n mutedForeground: string\n accent: string\n accentForeground: string\n destructive: string\n destructiveForeground: string\n border: string\n input: string\n /** Full field fill, distinct from the input border. Optional for existing custom themes. */\n inputFill?: string\n ring: string\n success: string\n successForeground: string\n warning: string\n warningForeground: string\n /**\n * Warning as TEXT on a warning-TINTED surface, as a channel triple. Optional\n * so a consumer's existing `AgentAppTheme` literal still type-checks;\n * {@link themeToCssVars} falls back to `warningForeground`, which is what the\n * surface used before this token existed.\n */\n warningStrong?: string\n /** Full CSS color (not a triple) — the canvas/scene backdrop. */\n canvasBackdrop: string\n /**\n * Border tiers as FULL CSS colors (they are `color-mix()` results, not\n * triples). Optional so a consumer's existing `AgentAppTheme` literal still\n * type-checks; {@link themeToCssVars} falls back to full-strength\n * `hsl(var(--border))`, which can never erase an edge.\n */\n borderSoft?: string\n /** @see borderSoft */\n cardEdge?: string\n /** Konva render palette — full hex colors the bitmap canvas paints with\n * (it cannot resolve `var(--…)`). NOT emitted by themeToCssVars. */\n canvasRender: CanvasRenderPalette\n}\n\n/**\n * Colors the Konva design-canvas paints directly. Konva renders to a bitmap\n * and cannot read CSS custom properties, so these are full hex strings sourced\n * from the active theme and threaded through the canvas components.\n */\nexport interface CanvasRenderPalette {\n /** Grid line color (GridLayer). */\n grid: string\n /** Grid-snap guide line (SnapGuidesOverlay, kind 'grid'). */\n snapGrid: string\n /** Saved ruler-guide snap line (kind 'guide'). */\n snapGuide: string\n /** Page edge/center snap line (kinds 'page-edge'/'page-center'). */\n snapPage: string\n /** Element edge/center snap line (kinds 'element-edge'/'element-center'). */\n snapElement: string\n /** Transformer border + anchor stroke (SelectionLayer). */\n selectionStroke: string\n /** Transformer anchor fill (SelectionLayer). */\n selectionAnchorFill: string\n /** Video placeholder fill (ElementNode VideoNode). */\n placeholderFill: string\n /** Video placeholder stroke (ElementNode VideoNode). */\n placeholderStroke: string\n /** Broken/loading image placeholder fill (ElementNode ImageNode). */\n brokenFill: string\n /** Broken/loading image placeholder stroke (ElementNode ImageNode). */\n brokenStroke: string\n}\n\n/** Define a light color theme with specific background, foreground, and accent color values */\nexport const lightTheme: AgentAppTheme = brandThemes.light\n\n/** Canonical Brand dark values projected for legacy JS and bitmap callers. */\nexport const darkTheme: AgentAppTheme = brandThemes.dark\n\n/**\n * Wrap a channel triple in `hsl()`; pass through values already in a color form.\n * `oklch(…)` / `oklab(…)` / `color-mix(…)` are recognised because the ramp is\n * authored in oklch and the border tiers are colour mixes — wrapping either in\n * `hsl()` yields an invalid colour that paints as nothing.\n */\nexport function themeColor(value: string): string {\n return /^(hsl|rgb|oklch|oklab|lch|lab|color|color-mix|#)/.test(value) ? value : `hsl(${value})`\n}\n\n/**\n * Map a theme to the full CSS-variable set (shadcn triples + canvas/sequences\n * aliases + canvas surface). Apply at runtime to scope a theme without loading\n * tokens.css: `Object.assign(el.style, themeToCssVars(darkTheme))`.\n */\nexport function themeToCssVars(theme: AgentAppTheme): Record<string, string> {\n return {\n '--background': theme.background,\n '--foreground': theme.foreground,\n '--card': theme.card,\n '--card-foreground': theme.cardForeground,\n '--popover': theme.popover,\n '--popover-foreground': theme.popoverForeground,\n '--primary': theme.primary,\n '--primary-foreground': theme.primaryForeground,\n '--secondary': theme.secondary,\n '--secondary-foreground': theme.secondaryForeground,\n '--muted': theme.muted,\n '--muted-foreground': theme.mutedForeground,\n '--accent': theme.accent,\n '--accent-foreground': theme.accentForeground,\n '--destructive': theme.destructive,\n '--destructive-foreground': theme.destructiveForeground,\n '--border': theme.border,\n '--input': theme.input,\n '--ring': theme.ring,\n '--success': theme.success,\n '--success-foreground': theme.successForeground,\n '--warning': theme.warning,\n '--warning-foreground': theme.warningForeground,\n // Falls back to the pairing the tinted surfaces used before this token\n // existed, so an unset value restores the previous look rather than an\n // unthemed one.\n '--warning-strong': theme.warningStrong ?? theme.warningForeground,\n '--bg-input': theme.inputFill ?? `hsl(${theme.card})`,\n '--text-primary': `hsl(${theme.foreground})`,\n '--text-secondary': `hsl(${theme.secondaryForeground})`,\n '--text-muted': `hsl(${theme.mutedForeground})`,\n '--text-danger': `hsl(${theme.destructive})`,\n '--text-warning': `hsl(${theme.warningStrong ?? theme.warningForeground})`,\n '--border-default': `hsl(${theme.border})`,\n '--brand-primary': `hsl(${theme.primary})`,\n '--editor-selection-background': `hsl(${theme.primary})`,\n '--editor-selection-foreground': `hsl(${theme.primaryForeground})`,\n '--canvas-backdrop': theme.canvasBackdrop,\n // Full strength is the safe default: an unset tier can under-draw an edge,\n // never erase one.\n '--border-soft': theme.borderSoft ?? `hsl(${theme.border})`,\n '--card-edge': theme.cardEdge ?? `hsl(${theme.border})`,\n }\n}\n"],"mappings":";AAGO,IAAM,cAAc;AAAA,EACzB,SAAS;AAAA,IACP,cAAc;AAAA,IACd,cAAc;AAAA,IACd,QAAQ;AAAA,IACR,kBAAkB;AAAA,IAClB,WAA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AA,IAC5C,iBAAiB,OAAO,MAAM,WAAW;AAAA,IACzC,kBAAkB,OAAO,MAAM,iBAAiB,MAAM,iBAAiB;AAAA,IACvE,oBAAoB,OAAO,MAAM,MAAM;AAAA,IACvC,mBAAmB,OAAO,MAAM,OAAO;AAAA,IACvC,iCAAiC,OAAO,MAAM,OAAO;AAAA,IACrD,iCAAiC,OAAO,MAAM,iBAAiB;AAAA,IAC/D,qBAAqB,MAAM;AAAA;AAAA;AAAA,IAG3B,iBAAiB,MAAM,cAAc,OAAO,MAAM,MAAM;AAAA,IACxD,eAAe,MAAM,YAAY,OAAO,MAAM,MAAM;AAAA,EACtD;AACF;","names":[]}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|