@arbidocs/blocks 0.5.192 → 0.5.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/dist/{FilesViewerDialog-4JWDTDO7.cjs → FilesViewerDialog-W2HPT3JS.cjs} +5 -5
  2. package/dist/{FilesViewerDialog-4JWDTDO7.cjs.map → FilesViewerDialog-W2HPT3JS.cjs.map} +1 -1
  3. package/dist/{chunk-Z6M2CI63.cjs → chunk-GWWX3FZ7.cjs} +3 -3
  4. package/dist/{chunk-Z6M2CI63.cjs.map → chunk-GWWX3FZ7.cjs.map} +1 -1
  5. package/dist/{chunk-33236Q7Y.cjs → chunk-JSP3WTFF.cjs} +3 -2
  6. package/dist/chunk-JSP3WTFF.cjs.map +1 -0
  7. package/dist/{chunk-AWQEN6WW.cjs → chunk-WDPHYI7S.cjs} +4 -3
  8. package/dist/chunk-WDPHYI7S.cjs.map +1 -0
  9. package/dist/connect/index.cjs +142 -129
  10. package/dist/connect/index.cjs.map +1 -1
  11. package/dist/connect/viewer.cjs +3 -3
  12. package/dist/connection/config/useDeveloperConfig.d.ts +1 -0
  13. package/dist/connection/config/useModelPicker.d.ts +4 -0
  14. package/dist/connection/conversation/AgentSteps.js +1 -0
  15. package/dist/connection/conversation/AgentSteps.js.map +2 -2
  16. package/dist/connection/facts/useFactFilters.d.ts +3 -0
  17. package/dist/connection/settings-page/ConnectedPremiumModels.js +14 -1
  18. package/dist/connection/settings-page/ConnectedPremiumModels.js.map +2 -2
  19. package/dist/connection/tags/ConnectedTagTable.d.ts +1 -0
  20. package/dist/connection/workspace-list/useConnectedWorkspaceList.d.ts +1 -1
  21. package/dist/embed/index.cjs +8 -8
  22. package/dist/index.cjs +58 -58
  23. package/dist/tags/TagColumnsEditor.js +2 -1
  24. package/dist/tags/TagColumnsEditor.js.map +2 -2
  25. package/node_modules/@arbidocs/coedit/package.json +1 -1
  26. package/package.json +5 -5
  27. package/dist/chunk-33236Q7Y.cjs.map +0 -1
  28. package/dist/chunk-AWQEN6WW.cjs.map +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunkZ6M2CI63_cjs = require('../chunk-Z6M2CI63.cjs');
4
+ var chunkGWWX3FZ7_cjs = require('../chunk-GWWX3FZ7.cjs');
5
5
  require('../chunk-NDRE7LD2.cjs');
6
6
  require('../chunk-WVZLAAIZ.cjs');
7
7
  require('../chunk-X7ALF4MP.cjs');
@@ -51,9 +51,9 @@ require('../chunk-XJEXFEWG.cjs');
51
51
  require('../chunk-E23H6FJR.cjs');
52
52
  require('../chunk-YZSQ7F5K.cjs');
53
53
  require('../chunk-KQF7POTG.cjs');
54
- require('../chunk-HME72RFP.cjs');
55
54
  require('../chunk-MNIQDXM6.cjs');
56
55
  require('../chunk-VJNJ4G6Y.cjs');
56
+ require('../chunk-HME72RFP.cjs');
57
57
  require('../chunk-HQ6SK34T.cjs');
58
58
  require('../chunk-75BNMCUX.cjs');
59
59
  require('../chunk-OEJQFPWO.cjs');
@@ -101,7 +101,7 @@ require('../chunk-PLIF5CUV.cjs');
101
101
 
102
102
  Object.defineProperty(exports, "ConnectedDocumentViewer", {
103
103
  enumerable: true,
104
- get: function () { return chunkZ6M2CI63_cjs.ConnectedDocumentViewer; }
104
+ get: function () { return chunkGWWX3FZ7_cjs.ConnectedDocumentViewer; }
105
105
  });
106
106
  Object.defineProperty(exports, "ConnectedDocumentToolsProvider", {
107
107
  enumerable: true,
@@ -35,6 +35,7 @@ export declare function useDeveloperConfig(): {
35
35
  input_cost_per_token?: number | null | undefined;
36
36
  output_cost_per_token?: number | null | undefined;
37
37
  provider?: string | null | undefined;
38
+ current_version?: string | null | undefined;
38
39
  mode?: string | null | undefined;
39
40
  supports_vision?: boolean | null | undefined;
40
41
  supports_reasoning?: boolean | null | undefined;
@@ -30,6 +30,7 @@ export declare function useModelPicker({ value: controlledValue, onValueChange:
30
30
  input_cost_per_token?: number | null | undefined;
31
31
  output_cost_per_token?: number | null | undefined;
32
32
  provider?: string | null | undefined;
33
+ current_version?: string | null | undefined;
33
34
  mode?: string | null | undefined;
34
35
  supports_vision?: boolean | null | undefined;
35
36
  supports_reasoning?: boolean | null | undefined;
@@ -50,6 +51,7 @@ export declare function useModelPicker({ value: controlledValue, onValueChange:
50
51
  input_cost_per_token?: number | null | undefined;
51
52
  output_cost_per_token?: number | null | undefined;
52
53
  provider?: string | null | undefined;
54
+ current_version?: string | null | undefined;
53
55
  mode?: string | null | undefined;
54
56
  supports_vision?: boolean | null | undefined;
55
57
  supports_reasoning?: boolean | null | undefined;
@@ -70,6 +72,7 @@ export declare function useModelPicker({ value: controlledValue, onValueChange:
70
72
  input_cost_per_token?: number | null | undefined;
71
73
  output_cost_per_token?: number | null | undefined;
72
74
  provider?: string | null | undefined;
75
+ current_version?: string | null | undefined;
73
76
  mode?: string | null | undefined;
74
77
  supports_vision?: boolean | null | undefined;
75
78
  supports_reasoning?: boolean | null | undefined;
@@ -89,6 +92,7 @@ export declare function useModelPicker({ value: controlledValue, onValueChange:
89
92
  input_cost_per_token?: number | null | undefined;
90
93
  output_cost_per_token?: number | null | undefined;
91
94
  provider?: string | null | undefined;
95
+ current_version?: string | null | undefined;
92
96
  mode?: string | null | undefined;
93
97
  supports_vision?: boolean | null | undefined;
94
98
  supports_reasoning?: boolean | null | undefined;
@@ -327,6 +327,7 @@ const AgentStepsComponent = ({
327
327
  `${displayRows.length} step${displayRows.length !== 1 ? "s" : ""}`,
328
328
  `${runStats.toolCalls} tool call${runStats.toolCalls !== 1 ? "s" : ""}`
329
329
  ];
330
+ if (contextUsage.served_model) leftParts.unshift(contextUsage.served_model);
330
331
  if (totalElapsedTime != null) leftParts.push(`${totalElapsedTime.toFixed(1)}s`);
331
332
  leftParts.push(`${formatTokens(totalInputTokens)} in`);
332
333
  if (totalOutputTokens > 0) leftParts.push(`${formatTokens(totalOutputTokens)} out`);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/connection/conversation/AgentSteps.tsx"],
4
- "sourcesContent": ["/**\n * A turn's agent steps, bound to the session: the step trace (`StepTrace` and its rows) filled\n * from the step stream, with the workspace's document names, the model tiers, the developer\n * details and the live duration of the running step.\n */\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n getDocumentTitle,\n ProviderIcon,\n} from '@arbidocs/react/ui'\nimport {\n formatGbp,\n useAvailableModels,\n useDocuments,\n useInvalidateWorkflows,\n useInvalidateAssistant,\n useUserSettings,\n} from '@arbidocs/react'\nimport React, { useEffect, useMemo } from 'react'\nimport {\n GoalCriteria,\n StepDetail,\n StepNarration,\n StepOutcome,\n StepParams,\n StepRow,\n StepSummary,\n StepTrace,\n StepTraceSummary,\n SubAgentLane,\n SubStepGroup,\n type GoalCriterionView,\n} from '../../agents/runs/AgentSteps'\nimport {\n getAgentStepPresentation,\n getModelIcon,\n MODEL_TIER_ICON_MAP,\n MODEL_TIER_LABELS,\n stepAccent,\n} from '../../agents/runs/step-presentation'\nimport { MessageLiveSeconds, type MessageTimerSubscription } from './MessageLiveSeconds'\nimport { ConnectedMarkdown } from './ConnectedMarkdown'\nimport {\n computeRunStats,\n extractSubagentLanes,\n formatTokens,\n getAgentStepLabel,\n getCurrentStep,\n getStepDisplay,\n getStepTool,\n isNearAiUsageBudget,\n mergeAgentSteps,\n subagentJobLabel,\n type AgentStepEvent,\n type ContextUsage,\n type DocInfoMap,\n} from '@arbidocs/sdk/browser'\n\n/** A workspace document, as the step trace names it. */\ntype StepDocument = { external_id: string; file_name?: string | null; n_pages?: number | null }\n\n/** Fields injected by the backend for display \u2014 excluded from param rendering */\nconst DISPLAY_FIELDS = new Set(['tool', 'label', 'icon', 'summary'])\n\n/**\n * Extract tool parameters from a detail entry, excluding display fields.\n * Returns key-value pairs for inline rendering.\n */\nfunction getToolParams(detail: Record<string, unknown>): Array<{ key: string; value: string }> {\n const params: Array<{ key: string; value: string }> = []\n for (const [key, value] of Object.entries(detail)) {\n if (DISPLAY_FIELDS.has(key) || value == null) continue\n const strValue = typeof value === 'string' ? value : JSON.stringify(value)\n params.push({ key, value: strValue })\n }\n return params\n}\n\nfunction StepModelIcon({ modelName, tag }: { modelName?: string | null; tag: string | null }) {\n // Premium \u2192 brand mark; Fast/Wise \u2192 their name icon; otherwise the tag icon.\n const cfg = tag === 'Premium' ? null : getModelIcon(modelName, tag)\n if (tag !== 'Premium' && !cfg) return null\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex-shrink-0\">\n {tag === 'Premium' ? (\n <ProviderIcon modelName={modelName ?? undefined} size={11} />\n ) : (\n cfg && <cfg.icon className={cfg.className} style={{ width: 11, height: 11 }} />\n )}\n </span>\n </TooltipTrigger>\n <TooltipContent>{modelName}</TooltipContent>\n </Tooltip>\n )\n}\n\ninterface AgentStepsProps {\n steps: AgentStepEvent[]\n isStreaming: boolean\n className?: string\n /**\n * Total elapsed seconds for the message \u2014 used as a static fallback for the\n * last step's duration when `liveTimer` is not provided (e.g. messages\n * loaded from history). When `liveTimer` is provided this prop is forwarded\n * to the leaf as the post-generation fallback.\n */\n totalElapsedTime?: number\n /**\n * Optional live-timer subscription. When provided, the last step's duration\n * is rendered by a leaf component so the parent does not re-render at the\n * 100 ms timer cadence.\n */\n liveTimer?: MessageTimerSubscription\n /**\n * When true (the live bar's expander), hide what the bar already shows live \u2014\n * the agent's current step and any still-running sub-agents \u2014 so the expander\n * is purely \"what came before\", never a duplicate of the footer. Finished\n * sub-agents stay (they're history). No effect once settled.\n */\n hideLive?: boolean\n /**\n * This turn's settled context/AI usage (\u00A3) (`message.finalContextUsage`).\n * \u00A3 spent belongs here, on the turn that spent them \u2014 not on the\n * composer's forward-looking context bar, which is about future messages.\n */\n contextUsage?: ContextUsage | null\n}\n\nconst AgentStepsComponent: React.FC<AgentStepsProps> = ({\n steps,\n isStreaming,\n className,\n totalElapsedTime,\n liveTimer,\n hideLive = false,\n contextUsage,\n}) => {\n const { data: userSettings } = useUserSettings()\n const isDeveloper = userSettings?.developer === true\n\n // The agent saved a workflow (create_workflow): refresh the workflow list once the turn ends, so it\n // shows without a reload.\n const invalidateWorkflows = useInvalidateWorkflows()\n const createdWorkflow = steps.some((step) => getStepTool(step) === 'create_workflow')\n useEffect(() => {\n if (createdWorkflow && !isStreaming) void invalidateWorkflows()\n // invalidateWorkflows is a new function each render; the effect runs on the turn's state only.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [createdWorkflow, isStreaming])\n\n // The person changed the Assistant's instructions (set_assistant_brief): an Assistant page open beside\n // the chat shows the new brief once the turn ends.\n const invalidateAssistant = useInvalidateAssistant()\n const setBrief = steps.some((step) => getStepTool(step) === 'set_assistant_brief')\n useEffect(() => {\n if (setBrief && !isStreaming) void invalidateAssistant()\n // invalidateAssistant is a new function each render; the effect runs on the turn's state only.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [setBrief, isStreaming])\n\n // Build doc_ext_id \u2192 {name, pages} map from workspace documents (cached by React Query)\n const { data: documents = [] } = useDocuments()\n const docInfo = useMemo(() => {\n const map: DocInfoMap = {}\n const docArray = Array.isArray(documents) ? documents : []\n for (const doc of docArray) {\n if (doc && 'external_id' in doc) {\n const d = doc as StepDocument\n // Use the canonical document entity label (doc_metadata.title ?? file\n // name), not the raw file name, so references resolve to the same name\n // the rest of the app shows.\n map[d.external_id] = {\n name: getDocumentTitle(d, d.file_name ?? d.external_id),\n pages: d.n_pages ?? null,\n }\n }\n }\n return map\n }, [documents])\n\n // Resolve model name \u2192 tag for looking up tier icons\n const { data: availableModels } = useAvailableModels()\n const getModelTag = useMemo(() => {\n return (modelName?: string | null): string | null => {\n if (!modelName || !availableModels?.models) return null\n return availableModels.models.find((m) => m.model_name === modelName)?.tags?.[0] || null\n }\n }, [availableModels])\n\n // Raw SSE events \u2192 the logical steps a reader sees. Shared with the `Step N`\n // counter so the count always matches the rows rendered below.\n //\n // When `hideLive` (the live bar's expander), the current step STAYS \u2014 the\n // drawer is a complete, correctly-numbered list with the active step\n // highlighted as the last row, matching the \"Step N\" position on the bar.\n // (Dropping it made the drawer show N-1 rows while the bar said N, and marked\n // the *previous* step active.) Still-running sub-agents are the one thing\n // dropped: they have their own live lanes in the roster beneath the bar, so\n // showing them here too would double-render them.\n const mergedSteps = useMemo(() => {\n const merged = mergeAgentSteps(steps)\n if (!hideLive) return merged\n const runningHandles = new Set(\n extractSubagentLanes(merged)\n .filter((l) => l.status === 'running')\n .map((l) => l.handle)\n )\n return merged.filter((s) => !(s.subagent && runningHandles.has(s.subagent)))\n }, [steps, hideLive])\n\n // Compute step durations: duration = next_step.t - current_step.t\n // For the last step, use totalElapsedTime (frontend timer) if available\n const stepDurations = useMemo(() => {\n const durations: (number | null)[] = []\n for (let i = 0; i < mergedSteps.length; i++) {\n const currentT = mergedSteps[i].t\n if (currentT == null) {\n durations.push(null)\n continue\n }\n if (i + 1 < mergedSteps.length) {\n const nextT = mergedSteps[i + 1].t\n durations.push(nextT != null ? nextT - currentT : null)\n } else {\n // Last step: close it with the turn's total elapsed time.\n //\n // This is the one place two clocks meet \u2014 `totalElapsedTime` is the\n // client's wall-clock for a live turn, while `t` is the backend's\n // seconds-since-stream-start. They agree when the client watched the\n // whole stream, but a client that started late (a reconnect, or a\n // background conversation opened mid-run) measures less than the\n // backend, and the subtraction goes negative: the trace rendered\n // \"Answered \u221221.9s\". Show nothing rather than a duration we know is\n // wrong \u2014 a settled turn re-read from history uses the backend's own\n // completed `t`, so it stays consistent there.\n const remaining = totalElapsedTime != null ? totalElapsedTime - currentT : null\n durations.push(remaining != null && remaining >= 0 ? remaining : null)\n }\n }\n return durations\n }, [mergedSteps, totalElapsedTime])\n\n // Display step_tokens (per-step cost) directly from the backend.\n const stepTokens = useMemo(() => {\n return mergedSteps.map((step) => step.step_tokens ?? null)\n }, [mergedSteps])\n\n // Per-step \u00A3 cost \u2014 an estimate (cached model pricing, not the\n // authoritative LiteLLM cost), but useful to see which step is expensive\n // while the turn is still streaming. User-facing (unlike step_tokens,\n // which is raw and developer-gated) since \u00A3 is the budget unit the\n // user actually spends against.\n const stepGbp = useMemo(() => {\n return mergedSteps.map((step) => step.step_gbp ?? null)\n }, [mergedSteps])\n\n // Following the run is the HOST's job, not this list's: AgentBarShell pins\n // its drawer to the bottom while the user hasn't scrolled away. A\n // scrollIntoView here looked like it nudged \"the nearest scroll container\",\n // but it scrolls EVERY ancestor short of the viewport \u2014 each streamed tick\n // yanked the whole conversation back to this list while the user was\n // reading elsewhere on the page.\n const currentStepIndex = isStreaming ? getCurrentStep(mergedSteps)?.index : undefined\n\n if (mergedSteps.length === 0) return null\n\n // Two groupings run in one pass:\n // \u2022 Concurrent sub-agent LANES \u2014 steps carrying a `subagent` handle are pulled\n // into their own live lane (spawn marker \u2192 intermediate steps \u2192 done marker),\n // rendered as a card at the position of the lane's spawn. Multiple children\n // running at once each get their own lane, so fan-out reads as parallel work.\n // \u2022 Legacy parent_index NESTING \u2014 a handle-less sub-step (older single-child\n // relays) still indents under the parent tool step that spawned it.\n const posByIndex = new Map(mergedSteps.map((s, idx) => [s.index, idx]))\n const childrenByParent = new Map<number, AgentStepEvent[]>()\n const topLevelSteps: AgentStepEvent[] = []\n const laneStepsByHandle = new Map<string, AgentStepEvent[]>()\n const laneSpawnIndex = new Map<string, number>()\n for (const step of mergedSteps) {\n const handle = step.subagent\n if (handle) {\n const arr = laneStepsByHandle.get(handle)\n if (arr) arr.push(step)\n else {\n laneStepsByHandle.set(handle, [step])\n laneSpawnIndex.set(handle, step.index)\n }\n continue\n }\n const parent = step.parent_index\n if (parent != null && parent !== step.index && posByIndex.has(parent)) {\n const siblings = childrenByParent.get(parent) ?? []\n siblings.push(step)\n childrenByParent.set(parent, siblings)\n } else {\n topLevelSteps.push(step)\n }\n }\n\n // Interleave top-level steps and lanes by index, so a lane appears exactly where\n // its child was spawned in the parent's timeline.\n type DisplayRow = { index: number; step?: AgentStepEvent; lane?: string }\n const displayRows: DisplayRow[] = [\n ...topLevelSteps.map((s) => ({ index: s.index, step: s })),\n ...[...laneStepsByHandle.keys()].map((h) => ({ index: laneSpawnIndex.get(h) ?? 0, lane: h })),\n ].sort((a, b) => a.index - b.index)\n\n // Display numbers: top-level rows read 1..N (lanes count as a row); a fold's\n // inner rows read \"<parent>.<n>\".\n const displayNumber = new Map<number, string>()\n displayRows.forEach((r, i) => {\n if (r.lane) {\n // Lane inner steps read \"<lane>.<n>\".\n laneStepsByHandle\n .get(r.lane)\n ?.filter((s) => !s.subagent_status)\n .forEach((c, ci) => displayNumber.set(c.index, `${i + 1}.${ci + 1}`))\n return\n }\n displayNumber.set(r.step!.index, String(i + 1))\n childrenByParent\n .get(r.step!.index)\n ?.forEach((c, ci) => displayNumber.set(c.index, `${i + 1}.${ci + 1}`))\n })\n\n const lastStepIndex = mergedSteps[mergedSteps.length - 1].index\n\n const renderRow = (step: AgentStepEvent, depth: number, isLastInList: boolean) => {\n const i = posByIndex.get(step.index)!\n const presentation = getAgentStepPresentation(step, docInfo)\n const { tool, Icon } = presentation\n const { label, summary, isMultiLine, details } = getStepDisplay(step, docInfo)\n const accent = stepAccent(step, tool)\n const duration = stepDurations[i]\n const isLastStep = step.index === lastStepIndex\n const isActive = step.index === currentStepIndex\n\n // Goal-step model tier icon (auto mode) \u2014 the tier the router picked. It\n // stands in for the goal step's raw outcome (\"fast, all 0 docs\"), so it\n // carries a tooltip: an unlabelled glyph would just be cryptic noise.\n const tier = step.step === 'goal' ? step.model_recommendation : null\n const TierIcon = tier ? MODEL_TIER_ICON_MAP[tier] : null\n\n // The last step during streaming renders its duration through a leaf that\n // subscribes to the message timer directly, keeping the 10 Hz tick\n // contained so AgentSteps and its parent stay stable across timer updates.\n const useLiveDuration = isLastStep && liveTimer != null && step.t != null\n const durationNode: React.ReactNode = useLiveDuration ? (\n <MessageLiveSeconds\n {...liveTimer!}\n offsetSeconds={step.t!}\n fallbackSeconds={totalElapsedTime ?? null}\n minDisplaySeconds={0.05}\n />\n ) : duration != null ? (\n `${duration.toFixed(1)}s`\n ) : null\n\n // The goal step's outcome is internal routing (\"fast, all 0 docs\") \u2014 cryptic\n // to a reader and redundant with the model-tier icon beside the label. Tool\n // outcomes (\"15 passages retrieved\") are real feedback, so those stay.\n const showOutcome = step.outcome && step.step !== 'goal'\n // A green tick on \"exit 1\" claims the step succeeded when it didn't \u2014 the\n // code agent's first attempt failing then retrying is exactly the story the\n // trace should tell honestly.\n const outcomeFailed = !!step.outcome && isFailureOutcome(step.outcome)\n\n // Raw tool params are a developer affordance, and only when the backend\n // gave us no summary to show instead.\n const hasSummary = step.detail?.some((d) => (d as { summary?: string }).summary)\n const toolParams =\n isDeveloper && step.detail && !step.step && !hasSummary\n ? step.detail.flatMap((d) => getToolParams(d as Record<string, unknown>))\n : []\n\n const criteria =\n step.step === 'goal_progress' && step.detail && step.detail.length > 0\n ? (step.detail as Array<{\n criterion?: string\n text?: string\n status?: string\n note?: string\n }>)\n : null\n\n const criteriaView: GoalCriterionView[] | null = criteria\n ? criteria.map((c, idx) => ({\n key: c.criterion ?? String(idx),\n text: c.text || c.criterion || '',\n note: c.note,\n met: isCriterionMet(c.status),\n }))\n : null\n const folded = childrenByParent.get(step.index)\n\n return (\n <StepRow\n key={step.index}\n index={step.index}\n number={displayNumber.get(step.index) ?? String(i + 1)}\n depth={depth}\n isLast={isLastInList}\n isActive={isActive}\n accent={accent}\n icon={<Icon size={12} strokeWidth={2.25} />}\n kind={step.narration ? 'narration' : (step.step ?? 'tool')}\n title={isActive ? presentation.description : label}\n titleTestId={isActive ? 'agent-expanded-current-step-description' : undefined}\n badge={\n TierIcon ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex shrink-0 items-center self-center\">\n <TierIcon size={12} className={accent.fg} aria-hidden />\n </span>\n </TooltipTrigger>\n <TooltipContent side=\"top\">{MODEL_TIER_LABELS[tier!] ?? tier}</TooltipContent>\n </Tooltip>\n ) : undefined\n }\n meta={\n <>\n {isDeveloper && (\n <StepModelIcon modelName={step.usage?.model} tag={getModelTag(step.usage?.model)} />\n )}\n {isDeveloper && stepTokens[i] != null && (\n <span>{formatTokens(stepTokens[i]!)} tok</span>\n )}\n {/* Not on the active row: this step's cost is a frozen snapshot of the ONE LLM call\n that produced it; next to a spinner it would read as \"still counting\". */}\n {!isActive && stepGbp[i] != null && <span>{formatGbp(stepGbp[i]!)}</span>}\n {durationNode != null && <span>{durationNode}</span>}\n </>\n }\n >\n {summary &&\n !isActive &&\n (step.narration ? (\n /* Narration is PROSE (headings, bold, lists): render markdown, not raw asterisks.\n Tool summaries stay plain text: one-line headlines where a clamp matters. */\n <StepNarration index={step.index}>\n <ConnectedMarkdown isStreaming={false}>{summary}</ConnectedMarkdown>\n </StepNarration>\n ) : (\n <StepSummary index={step.index} multiLine={isMultiLine}>\n {summary}\n </StepSummary>\n ))}\n\n {/* What the narrative displaced: the tool's target or a plan's checklist. Dimmer than\n the summary: it answers \"on what?\", not \"doing what?\". */}\n {details.map((d, di) => (\n <StepDetail key={di} index={step.index}>\n {d}\n </StepDetail>\n ))}\n\n {showOutcome && (\n <StepOutcome index={step.index} failed={outcomeFailed}>\n {step.outcome}\n </StepOutcome>\n )}\n\n {toolParams.length > 0 && (\n <StepParams>{toolParams.map((p) => `${p.key}=${p.value}`).join(' ')}</StepParams>\n )}\n\n {step.routing && (\n <details className=\"mt-1 text-xs text-muted-foreground\" data-testid=\"routing-details\">\n <summary className=\"cursor-pointer\">Routing details</summary>\n <dl className=\"mt-2 space-y-2\">\n <div>\n <dt className=\"font-medium\">Answer model</dt>\n <dd>\n {step.routing.selected_model}\n {step.routing.model_recommendation\n ? ` (${step.routing.model_recommendation})`\n : ''}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Default document search</dt>\n <dd>\n {step.routing.selected_doc_ext_ids.length\n ? step.routing.selected_doc_ext_ids\n .map((id) => docInfo[id]?.name ?? step.routing!.document_titles[id] ?? id)\n .join(', ')\n : 'No documents selected'}\n </dd>\n <dd>The complete document catalogue remains available for direct reading.</dd>\n </div>\n <div>\n <dt className=\"font-medium\">Always available tools</dt>\n <dd>\n {step.routing.always_available_tool_names\n .map((name) => name.replaceAll('_', ' '))\n .join(', ') || 'None'}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Additional tools</dt>\n <dd>\n {step.routing.selected_tool_names == null\n ? 'All enabled tools retained'\n : step.routing.selected_tool_names\n .filter((name) => !step.routing!.always_available_tool_names.includes(name))\n .map((name) => name.replaceAll('_', ' '))\n .join(', ') || 'None'}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">History</dt>\n <dd>\n {step.routing.retained_message_ext_ids.length} messages retained\n {step.routing.history_retained_by_policy\n ? '; full history preserved by policy'\n : ''}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Router</dt>\n <dd>\n {step.routing.router_model} \u00B7 {step.routing.elapsed_seconds.toFixed(3)}s\n {step.routing.input_tokens != null\n ? ` \u00B7 ${step.routing.input_tokens.toLocaleString()} input tokens`\n : ''}\n </dd>\n </div>\n {step.routing.status === 'fallback' && (\n <div>\n <dt className=\"font-medium\">Fallback</dt>\n <dd>\n Context and authorized tools retained (\n {step.routing.fallback_reason ?? 'router unavailable'}).\n </dd>\n </div>\n )}\n </dl>\n </details>\n )}\n\n {criteriaView && <GoalCriteria criteria={criteriaView} />}\n\n {/* Sub-agent steps nest under the tool step that spawned them, COLLAPSED: a\n deep_research run emits a dozen inner rows that buried the parent trace. The parent\n keeps the count so the work is never hidden, just folded. */}\n {folded && folded.length > 0 && (\n <SubStepGroup\n parentIndex={step.index}\n summary={summariseSubSteps(folded)}\n openClassName={accent.fg}\n renderSteps={() =>\n folded.map((c, ci, arr) => renderRow(c, depth + 1, ci === arr.length - 1))\n }\n />\n )}\n </StepRow>\n )\n }\n\n let summaryNode: React.ReactNode = null\n if (contextUsage?.spent_gbp != null) {\n const runStats = computeRunStats(steps)\n // Prefer the run's true cumulative totals (summed across every LLM call this turn made) over\n // total_input/total_output, which mirror only the last call's context.\n const totalInputTokens = contextUsage.all_llm_calls?.input_tokens ?? contextUsage.total_input\n const totalOutputTokens = contextUsage.all_llm_calls?.output_tokens ?? contextUsage.total_output\n const leftParts = [\n `${displayRows.length} step${displayRows.length !== 1 ? 's' : ''}`,\n `${runStats.toolCalls} tool call${runStats.toolCalls !== 1 ? 's' : ''}`,\n ]\n if (totalElapsedTime != null) leftParts.push(`${totalElapsedTime.toFixed(1)}s`)\n leftParts.push(`${formatTokens(totalInputTokens)} in`)\n if (totalOutputTokens > 0) leftParts.push(`${formatTokens(totalOutputTokens)} out`)\n summaryNode = (\n <StepTraceSummary\n left={leftParts.join(' \u00B7 ')}\n isNearBudget={isNearAiUsageBudget(contextUsage)}\n total={`Total: ${formatGbp(contextUsage.spent_gbp)}`}\n />\n )\n }\n\n return (\n <StepTrace className={className} summary={summaryNode}>\n {displayRows.map((row, i) => {\n if (row.lane) {\n return (\n <LaneBinding\n key={`lane-${row.lane}`}\n handle={row.lane}\n steps={laneStepsByHandle.get(row.lane)!}\n number={i + 1}\n renderRow={renderRow}\n isStreaming={isStreaming}\n />\n )\n }\n const parent = row.step!\n return renderRow(\n parent,\n 0,\n i === displayRows.length - 1 && !childrenByParent.has(parent.index)\n )\n })}\n </StepTrace>\n )\n}\n\n/** Binds a sub-agent's lifecycle steps to the `SubAgentLane` block. */\nfunction LaneBinding({\n handle,\n steps,\n number,\n renderRow,\n isStreaming,\n}: {\n handle: string\n steps: AgentStepEvent[]\n number: number\n renderRow: (step: AgentStepEvent, depth: number, isLastInList: boolean) => React.ReactNode\n isStreaming: boolean\n}) {\n // The spawn marker (`subagent_status: \"running\"`) carries the child's task; a `done`/`failed`\n // marker closes it; in between are the child's own steps.\n const spawn = steps.find((s) => s.subagent_status === 'running')\n const closed = steps.find((s) => s.subagent_status === 'done' || s.subagent_status === 'failed')\n const failed = steps.some((s) => s.subagent_status === 'failed')\n const inner = steps.filter((s) => !s.subagent_status)\n const task = (spawn?.content || spawn?.focus || '').trim()\n const running = !closed && isStreaming\n // What the child is doing RIGHT NOW: its latest step's focus/label.\n const latest = inner[inner.length - 1]\n return (\n <SubAgentLane\n handle={handle}\n number={number}\n // Name the lane by its JOB, never \"sub-1\": the handle is only a stable key.\n job={subagentJobLabel(task) || `Sub-agent ${handle}`}\n task={task}\n status={running ? 'running' : failed ? 'failed' : 'done'}\n innerCount={inner.length}\n liveFocus={latest ? latest.focus?.trim() || getAgentStepLabel(latest) : ''}\n renderSteps={() => inner.map((s, i) => renderRow(s, 1, i === inner.length - 1))}\n />\n )\n}\n\n/** Summarise folded sub-steps by what they did, e.g. \"3 searches, 2 reads\". */\nfunction summariseSubSteps(steps: AgentStepEvent[]): string {\n const counts = new Map<string, number>()\n for (const s of steps) {\n const noun = subStepNoun(getStepTool(s))\n counts.set(noun, (counts.get(noun) ?? 0) + 1)\n }\n return [...counts.entries()]\n .map(([noun, n]) => `${n} ${n === 1 ? noun : pluralise(noun)}`)\n .join(', ')\n}\n\n/** `met` (and `absent_from_corpus`, which the gate accepts) tick; anything else stays open. */\nfunction isCriterionMet(status?: string): boolean {\n return status === 'met' || status === 'absent_from_corpus'\n}\n\n/**\n * Does this outcome describe a failure?\n *\n * Outcomes are free text from the backend (\"exit 0 \u00B7 1.2s\", \"15 passages\n * retrieved\", \"timed out \u00B7 30.0s\"), so this reads the few shapes that carry a\n * verdict and defaults to \"not a failure\" for the rest \u2014 a false alarm on a\n * successful step is worse than a neutral chip.\n */\nfunction isFailureOutcome(outcome: string): boolean {\n const o = outcome.toLowerCase()\n if (/\\bexit\\s+0\\b/.test(o)) return false\n return /\\bexit\\s+[1-9]/.test(o) || /timed out|timeout|failed|error\\b/.test(o)\n}\n\n/** What one inner step *is*, for the collapsed summary line. */\nfunction subStepNoun(tool: string | undefined): string {\n switch (tool) {\n case 'search_inside_documents':\n case 'search_conversations':\n case 'web_search':\n return 'search'\n case 'read_document':\n case 'read_url':\n case 'view_document_pages':\n case 'get_table_of_contents':\n return 'read'\n case 'execute_code':\n case 'spawn_coding_agent':\n return 'run'\n case 'create_plan':\n return 'plan'\n default:\n return 'step'\n }\n}\n\nfunction pluralise(noun: string): string {\n return noun.endsWith('h') ? `${noun}es` : `${noun}s`\n}\n\nexport const AgentSteps = React.memo(AgentStepsComponent, (prev, next) => {\n return (\n prev.isStreaming === next.isStreaming &&\n prev.className === next.className &&\n prev.totalElapsedTime === next.totalElapsedTime &&\n prev.steps === next.steps &&\n prev.liveTimer === next.liveTimer &&\n prev.hideLive === next.hideLive\n )\n})\n"],
5
- "mappings": ";AAsFI,SAoVM,UAhVE,KAJR;AAhFJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,OAAO,SAAS,WAAW,eAAe;AAC1C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,0BAAyD;AAClE,SAAS,yBAAyB;AAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OAIK;AAMP,MAAM,iBAAiB,oBAAI,IAAI,CAAC,QAAQ,SAAS,QAAQ,SAAS,CAAC;AAMnE,SAAS,cAAc,QAAwE;AAC7F,QAAM,SAAgD,CAAC;AACvD,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,QAAI,eAAe,IAAI,GAAG,KAAK,SAAS,KAAM;AAC9C,UAAM,WAAW,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,KAAK;AACzE,WAAO,KAAK,EAAE,KAAK,OAAO,SAAS,CAAC;AA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AAe,KAAK,CAAC,EAAG,QAAO;AACnC,SAAO,iBAAiB,KAAK,CAAC,KAAK,mCAAmC,KAAK,CAAC;AAC9E;AAGA,SAAS,YAAY,MAAkC;AACrD,UAAQ,MAAM;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EACX;AACF;AAEA,SAAS,UAAU,MAAsB;AACvC,SAAO,KAAK,SAAS,GAAG,IAAI,GAAG,IAAI,OAAO,GAAG,IAAI;AACnD;AAEO,MAAM,aAAa,MAAM,KAAK,qBAAqB,CAAC,MAAM,SAAS;AACxE,SACE,KAAK,gBAAgB,KAAK,eAC1B,KAAK,cAAc,KAAK,aACxB,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,UAAU,KAAK,SACpB,KAAK,cAAc,KAAK,aACxB,KAAK,aAAa,KAAK;AAE3B,CAAC;",
4
+ "sourcesContent": ["/**\n * A turn's agent steps, bound to the session: the step trace (`StepTrace` and its rows) filled\n * from the step stream, with the workspace's document names, the model tiers, the developer\n * details and the live duration of the running step.\n */\n\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n getDocumentTitle,\n ProviderIcon,\n} from '@arbidocs/react/ui'\nimport {\n formatGbp,\n useAvailableModels,\n useDocuments,\n useInvalidateWorkflows,\n useInvalidateAssistant,\n useUserSettings,\n} from '@arbidocs/react'\nimport React, { useEffect, useMemo } from 'react'\nimport {\n GoalCriteria,\n StepDetail,\n StepNarration,\n StepOutcome,\n StepParams,\n StepRow,\n StepSummary,\n StepTrace,\n StepTraceSummary,\n SubAgentLane,\n SubStepGroup,\n type GoalCriterionView,\n} from '../../agents/runs/AgentSteps'\nimport {\n getAgentStepPresentation,\n getModelIcon,\n MODEL_TIER_ICON_MAP,\n MODEL_TIER_LABELS,\n stepAccent,\n} from '../../agents/runs/step-presentation'\nimport { MessageLiveSeconds, type MessageTimerSubscription } from './MessageLiveSeconds'\nimport { ConnectedMarkdown } from './ConnectedMarkdown'\nimport {\n computeRunStats,\n extractSubagentLanes,\n formatTokens,\n getAgentStepLabel,\n getCurrentStep,\n getStepDisplay,\n getStepTool,\n isNearAiUsageBudget,\n mergeAgentSteps,\n subagentJobLabel,\n type AgentStepEvent,\n type ContextUsage,\n type DocInfoMap,\n} from '@arbidocs/sdk/browser'\n\n/** A workspace document, as the step trace names it. */\ntype StepDocument = { external_id: string; file_name?: string | null; n_pages?: number | null }\n\n/** Fields injected by the backend for display \u2014 excluded from param rendering */\nconst DISPLAY_FIELDS = new Set(['tool', 'label', 'icon', 'summary'])\n\n/**\n * Extract tool parameters from a detail entry, excluding display fields.\n * Returns key-value pairs for inline rendering.\n */\nfunction getToolParams(detail: Record<string, unknown>): Array<{ key: string; value: string }> {\n const params: Array<{ key: string; value: string }> = []\n for (const [key, value] of Object.entries(detail)) {\n if (DISPLAY_FIELDS.has(key) || value == null) continue\n const strValue = typeof value === 'string' ? value : JSON.stringify(value)\n params.push({ key, value: strValue })\n }\n return params\n}\n\nfunction StepModelIcon({ modelName, tag }: { modelName?: string | null; tag: string | null }) {\n // Premium \u2192 brand mark; Fast/Wise \u2192 their name icon; otherwise the tag icon.\n const cfg = tag === 'Premium' ? null : getModelIcon(modelName, tag)\n if (tag !== 'Premium' && !cfg) return null\n return (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex-shrink-0\">\n {tag === 'Premium' ? (\n <ProviderIcon modelName={modelName ?? undefined} size={11} />\n ) : (\n cfg && <cfg.icon className={cfg.className} style={{ width: 11, height: 11 }} />\n )}\n </span>\n </TooltipTrigger>\n <TooltipContent>{modelName}</TooltipContent>\n </Tooltip>\n )\n}\n\ninterface AgentStepsProps {\n steps: AgentStepEvent[]\n isStreaming: boolean\n className?: string\n /**\n * Total elapsed seconds for the message \u2014 used as a static fallback for the\n * last step's duration when `liveTimer` is not provided (e.g. messages\n * loaded from history). When `liveTimer` is provided this prop is forwarded\n * to the leaf as the post-generation fallback.\n */\n totalElapsedTime?: number\n /**\n * Optional live-timer subscription. When provided, the last step's duration\n * is rendered by a leaf component so the parent does not re-render at the\n * 100 ms timer cadence.\n */\n liveTimer?: MessageTimerSubscription\n /**\n * When true (the live bar's expander), hide what the bar already shows live \u2014\n * the agent's current step and any still-running sub-agents \u2014 so the expander\n * is purely \"what came before\", never a duplicate of the footer. Finished\n * sub-agents stay (they're history). No effect once settled.\n */\n hideLive?: boolean\n /**\n * This turn's settled context/AI usage (\u00A3) (`message.finalContextUsage`).\n * \u00A3 spent belongs here, on the turn that spent them \u2014 not on the\n * composer's forward-looking context bar, which is about future messages.\n */\n contextUsage?: ContextUsage | null\n}\n\nconst AgentStepsComponent: React.FC<AgentStepsProps> = ({\n steps,\n isStreaming,\n className,\n totalElapsedTime,\n liveTimer,\n hideLive = false,\n contextUsage,\n}) => {\n const { data: userSettings } = useUserSettings()\n const isDeveloper = userSettings?.developer === true\n\n // The agent saved a workflow (create_workflow): refresh the workflow list once the turn ends, so it\n // shows without a reload.\n const invalidateWorkflows = useInvalidateWorkflows()\n const createdWorkflow = steps.some((step) => getStepTool(step) === 'create_workflow')\n useEffect(() => {\n if (createdWorkflow && !isStreaming) void invalidateWorkflows()\n // invalidateWorkflows is a new function each render; the effect runs on the turn's state only.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [createdWorkflow, isStreaming])\n\n // The person changed the Assistant's instructions (set_assistant_brief): an Assistant page open beside\n // the chat shows the new brief once the turn ends.\n const invalidateAssistant = useInvalidateAssistant()\n const setBrief = steps.some((step) => getStepTool(step) === 'set_assistant_brief')\n useEffect(() => {\n if (setBrief && !isStreaming) void invalidateAssistant()\n // invalidateAssistant is a new function each render; the effect runs on the turn's state only.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [setBrief, isStreaming])\n\n // Build doc_ext_id \u2192 {name, pages} map from workspace documents (cached by React Query)\n const { data: documents = [] } = useDocuments()\n const docInfo = useMemo(() => {\n const map: DocInfoMap = {}\n const docArray = Array.isArray(documents) ? documents : []\n for (const doc of docArray) {\n if (doc && 'external_id' in doc) {\n const d = doc as StepDocument\n // Use the canonical document entity label (doc_metadata.title ?? file\n // name), not the raw file name, so references resolve to the same name\n // the rest of the app shows.\n map[d.external_id] = {\n name: getDocumentTitle(d, d.file_name ?? d.external_id),\n pages: d.n_pages ?? null,\n }\n }\n }\n return map\n }, [documents])\n\n // Resolve model name \u2192 tag for looking up tier icons\n const { data: availableModels } = useAvailableModels()\n const getModelTag = useMemo(() => {\n return (modelName?: string | null): string | null => {\n if (!modelName || !availableModels?.models) return null\n return availableModels.models.find((m) => m.model_name === modelName)?.tags?.[0] || null\n }\n }, [availableModels])\n\n // Raw SSE events \u2192 the logical steps a reader sees. Shared with the `Step N`\n // counter so the count always matches the rows rendered below.\n //\n // When `hideLive` (the live bar's expander), the current step STAYS \u2014 the\n // drawer is a complete, correctly-numbered list with the active step\n // highlighted as the last row, matching the \"Step N\" position on the bar.\n // (Dropping it made the drawer show N-1 rows while the bar said N, and marked\n // the *previous* step active.) Still-running sub-agents are the one thing\n // dropped: they have their own live lanes in the roster beneath the bar, so\n // showing them here too would double-render them.\n const mergedSteps = useMemo(() => {\n const merged = mergeAgentSteps(steps)\n if (!hideLive) return merged\n const runningHandles = new Set(\n extractSubagentLanes(merged)\n .filter((l) => l.status === 'running')\n .map((l) => l.handle)\n )\n return merged.filter((s) => !(s.subagent && runningHandles.has(s.subagent)))\n }, [steps, hideLive])\n\n // Compute step durations: duration = next_step.t - current_step.t\n // For the last step, use totalElapsedTime (frontend timer) if available\n const stepDurations = useMemo(() => {\n const durations: (number | null)[] = []\n for (let i = 0; i < mergedSteps.length; i++) {\n const currentT = mergedSteps[i].t\n if (currentT == null) {\n durations.push(null)\n continue\n }\n if (i + 1 < mergedSteps.length) {\n const nextT = mergedSteps[i + 1].t\n durations.push(nextT != null ? nextT - currentT : null)\n } else {\n // Last step: close it with the turn's total elapsed time.\n //\n // This is the one place two clocks meet \u2014 `totalElapsedTime` is the\n // client's wall-clock for a live turn, while `t` is the backend's\n // seconds-since-stream-start. They agree when the client watched the\n // whole stream, but a client that started late (a reconnect, or a\n // background conversation opened mid-run) measures less than the\n // backend, and the subtraction goes negative: the trace rendered\n // \"Answered \u221221.9s\". Show nothing rather than a duration we know is\n // wrong \u2014 a settled turn re-read from history uses the backend's own\n // completed `t`, so it stays consistent there.\n const remaining = totalElapsedTime != null ? totalElapsedTime - currentT : null\n durations.push(remaining != null && remaining >= 0 ? remaining : null)\n }\n }\n return durations\n }, [mergedSteps, totalElapsedTime])\n\n // Display step_tokens (per-step cost) directly from the backend.\n const stepTokens = useMemo(() => {\n return mergedSteps.map((step) => step.step_tokens ?? null)\n }, [mergedSteps])\n\n // Per-step \u00A3 cost \u2014 an estimate (cached model pricing, not the\n // authoritative LiteLLM cost), but useful to see which step is expensive\n // while the turn is still streaming. User-facing (unlike step_tokens,\n // which is raw and developer-gated) since \u00A3 is the budget unit the\n // user actually spends against.\n const stepGbp = useMemo(() => {\n return mergedSteps.map((step) => step.step_gbp ?? null)\n }, [mergedSteps])\n\n // Following the run is the HOST's job, not this list's: AgentBarShell pins\n // its drawer to the bottom while the user hasn't scrolled away. A\n // scrollIntoView here looked like it nudged \"the nearest scroll container\",\n // but it scrolls EVERY ancestor short of the viewport \u2014 each streamed tick\n // yanked the whole conversation back to this list while the user was\n // reading elsewhere on the page.\n const currentStepIndex = isStreaming ? getCurrentStep(mergedSteps)?.index : undefined\n\n if (mergedSteps.length === 0) return null\n\n // Two groupings run in one pass:\n // \u2022 Concurrent sub-agent LANES \u2014 steps carrying a `subagent` handle are pulled\n // into their own live lane (spawn marker \u2192 intermediate steps \u2192 done marker),\n // rendered as a card at the position of the lane's spawn. Multiple children\n // running at once each get their own lane, so fan-out reads as parallel work.\n // \u2022 Legacy parent_index NESTING \u2014 a handle-less sub-step (older single-child\n // relays) still indents under the parent tool step that spawned it.\n const posByIndex = new Map(mergedSteps.map((s, idx) => [s.index, idx]))\n const childrenByParent = new Map<number, AgentStepEvent[]>()\n const topLevelSteps: AgentStepEvent[] = []\n const laneStepsByHandle = new Map<string, AgentStepEvent[]>()\n const laneSpawnIndex = new Map<string, number>()\n for (const step of mergedSteps) {\n const handle = step.subagent\n if (handle) {\n const arr = laneStepsByHandle.get(handle)\n if (arr) arr.push(step)\n else {\n laneStepsByHandle.set(handle, [step])\n laneSpawnIndex.set(handle, step.index)\n }\n continue\n }\n const parent = step.parent_index\n if (parent != null && parent !== step.index && posByIndex.has(parent)) {\n const siblings = childrenByParent.get(parent) ?? []\n siblings.push(step)\n childrenByParent.set(parent, siblings)\n } else {\n topLevelSteps.push(step)\n }\n }\n\n // Interleave top-level steps and lanes by index, so a lane appears exactly where\n // its child was spawned in the parent's timeline.\n type DisplayRow = { index: number; step?: AgentStepEvent; lane?: string }\n const displayRows: DisplayRow[] = [\n ...topLevelSteps.map((s) => ({ index: s.index, step: s })),\n ...[...laneStepsByHandle.keys()].map((h) => ({ index: laneSpawnIndex.get(h) ?? 0, lane: h })),\n ].sort((a, b) => a.index - b.index)\n\n // Display numbers: top-level rows read 1..N (lanes count as a row); a fold's\n // inner rows read \"<parent>.<n>\".\n const displayNumber = new Map<number, string>()\n displayRows.forEach((r, i) => {\n if (r.lane) {\n // Lane inner steps read \"<lane>.<n>\".\n laneStepsByHandle\n .get(r.lane)\n ?.filter((s) => !s.subagent_status)\n .forEach((c, ci) => displayNumber.set(c.index, `${i + 1}.${ci + 1}`))\n return\n }\n displayNumber.set(r.step!.index, String(i + 1))\n childrenByParent\n .get(r.step!.index)\n ?.forEach((c, ci) => displayNumber.set(c.index, `${i + 1}.${ci + 1}`))\n })\n\n const lastStepIndex = mergedSteps[mergedSteps.length - 1].index\n\n const renderRow = (step: AgentStepEvent, depth: number, isLastInList: boolean) => {\n const i = posByIndex.get(step.index)!\n const presentation = getAgentStepPresentation(step, docInfo)\n const { tool, Icon } = presentation\n const { label, summary, isMultiLine, details } = getStepDisplay(step, docInfo)\n const accent = stepAccent(step, tool)\n const duration = stepDurations[i]\n const isLastStep = step.index === lastStepIndex\n const isActive = step.index === currentStepIndex\n\n // Goal-step model tier icon (auto mode) \u2014 the tier the router picked. It\n // stands in for the goal step's raw outcome (\"fast, all 0 docs\"), so it\n // carries a tooltip: an unlabelled glyph would just be cryptic noise.\n const tier = step.step === 'goal' ? step.model_recommendation : null\n const TierIcon = tier ? MODEL_TIER_ICON_MAP[tier] : null\n\n // The last step during streaming renders its duration through a leaf that\n // subscribes to the message timer directly, keeping the 10 Hz tick\n // contained so AgentSteps and its parent stay stable across timer updates.\n const useLiveDuration = isLastStep && liveTimer != null && step.t != null\n const durationNode: React.ReactNode = useLiveDuration ? (\n <MessageLiveSeconds\n {...liveTimer!}\n offsetSeconds={step.t!}\n fallbackSeconds={totalElapsedTime ?? null}\n minDisplaySeconds={0.05}\n />\n ) : duration != null ? (\n `${duration.toFixed(1)}s`\n ) : null\n\n // The goal step's outcome is internal routing (\"fast, all 0 docs\") \u2014 cryptic\n // to a reader and redundant with the model-tier icon beside the label. Tool\n // outcomes (\"15 passages retrieved\") are real feedback, so those stay.\n const showOutcome = step.outcome && step.step !== 'goal'\n // A green tick on \"exit 1\" claims the step succeeded when it didn't \u2014 the\n // code agent's first attempt failing then retrying is exactly the story the\n // trace should tell honestly.\n const outcomeFailed = !!step.outcome && isFailureOutcome(step.outcome)\n\n // Raw tool params are a developer affordance, and only when the backend\n // gave us no summary to show instead.\n const hasSummary = step.detail?.some((d) => (d as { summary?: string }).summary)\n const toolParams =\n isDeveloper && step.detail && !step.step && !hasSummary\n ? step.detail.flatMap((d) => getToolParams(d as Record<string, unknown>))\n : []\n\n const criteria =\n step.step === 'goal_progress' && step.detail && step.detail.length > 0\n ? (step.detail as Array<{\n criterion?: string\n text?: string\n status?: string\n note?: string\n }>)\n : null\n\n const criteriaView: GoalCriterionView[] | null = criteria\n ? criteria.map((c, idx) => ({\n key: c.criterion ?? String(idx),\n text: c.text || c.criterion || '',\n note: c.note,\n met: isCriterionMet(c.status),\n }))\n : null\n const folded = childrenByParent.get(step.index)\n\n return (\n <StepRow\n key={step.index}\n index={step.index}\n number={displayNumber.get(step.index) ?? String(i + 1)}\n depth={depth}\n isLast={isLastInList}\n isActive={isActive}\n accent={accent}\n icon={<Icon size={12} strokeWidth={2.25} />}\n kind={step.narration ? 'narration' : (step.step ?? 'tool')}\n title={isActive ? presentation.description : label}\n titleTestId={isActive ? 'agent-expanded-current-step-description' : undefined}\n badge={\n TierIcon ? (\n <Tooltip>\n <TooltipTrigger asChild>\n <span className=\"flex shrink-0 items-center self-center\">\n <TierIcon size={12} className={accent.fg} aria-hidden />\n </span>\n </TooltipTrigger>\n <TooltipContent side=\"top\">{MODEL_TIER_LABELS[tier!] ?? tier}</TooltipContent>\n </Tooltip>\n ) : undefined\n }\n meta={\n <>\n {isDeveloper && (\n <StepModelIcon modelName={step.usage?.model} tag={getModelTag(step.usage?.model)} />\n )}\n {isDeveloper && stepTokens[i] != null && (\n <span>{formatTokens(stepTokens[i]!)} tok</span>\n )}\n {/* Not on the active row: this step's cost is a frozen snapshot of the ONE LLM call\n that produced it; next to a spinner it would read as \"still counting\". */}\n {!isActive && stepGbp[i] != null && <span>{formatGbp(stepGbp[i]!)}</span>}\n {durationNode != null && <span>{durationNode}</span>}\n </>\n }\n >\n {summary &&\n !isActive &&\n (step.narration ? (\n /* Narration is PROSE (headings, bold, lists): render markdown, not raw asterisks.\n Tool summaries stay plain text: one-line headlines where a clamp matters. */\n <StepNarration index={step.index}>\n <ConnectedMarkdown isStreaming={false}>{summary}</ConnectedMarkdown>\n </StepNarration>\n ) : (\n <StepSummary index={step.index} multiLine={isMultiLine}>\n {summary}\n </StepSummary>\n ))}\n\n {/* What the narrative displaced: the tool's target or a plan's checklist. Dimmer than\n the summary: it answers \"on what?\", not \"doing what?\". */}\n {details.map((d, di) => (\n <StepDetail key={di} index={step.index}>\n {d}\n </StepDetail>\n ))}\n\n {showOutcome && (\n <StepOutcome index={step.index} failed={outcomeFailed}>\n {step.outcome}\n </StepOutcome>\n )}\n\n {toolParams.length > 0 && (\n <StepParams>{toolParams.map((p) => `${p.key}=${p.value}`).join(' ')}</StepParams>\n )}\n\n {step.routing && (\n <details className=\"mt-1 text-xs text-muted-foreground\" data-testid=\"routing-details\">\n <summary className=\"cursor-pointer\">Routing details</summary>\n <dl className=\"mt-2 space-y-2\">\n <div>\n <dt className=\"font-medium\">Answer model</dt>\n <dd>\n {step.routing.selected_model}\n {step.routing.model_recommendation\n ? ` (${step.routing.model_recommendation})`\n : ''}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Default document search</dt>\n <dd>\n {step.routing.selected_doc_ext_ids.length\n ? step.routing.selected_doc_ext_ids\n .map((id) => docInfo[id]?.name ?? step.routing!.document_titles[id] ?? id)\n .join(', ')\n : 'No documents selected'}\n </dd>\n <dd>The complete document catalogue remains available for direct reading.</dd>\n </div>\n <div>\n <dt className=\"font-medium\">Always available tools</dt>\n <dd>\n {step.routing.always_available_tool_names\n .map((name) => name.replaceAll('_', ' '))\n .join(', ') || 'None'}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Additional tools</dt>\n <dd>\n {step.routing.selected_tool_names == null\n ? 'All enabled tools retained'\n : step.routing.selected_tool_names\n .filter((name) => !step.routing!.always_available_tool_names.includes(name))\n .map((name) => name.replaceAll('_', ' '))\n .join(', ') || 'None'}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">History</dt>\n <dd>\n {step.routing.retained_message_ext_ids.length} messages retained\n {step.routing.history_retained_by_policy\n ? '; full history preserved by policy'\n : ''}\n </dd>\n </div>\n <div>\n <dt className=\"font-medium\">Router</dt>\n <dd>\n {step.routing.router_model} \u00B7 {step.routing.elapsed_seconds.toFixed(3)}s\n {step.routing.input_tokens != null\n ? ` \u00B7 ${step.routing.input_tokens.toLocaleString()} input tokens`\n : ''}\n </dd>\n </div>\n {step.routing.status === 'fallback' && (\n <div>\n <dt className=\"font-medium\">Fallback</dt>\n <dd>\n Context and authorized tools retained (\n {step.routing.fallback_reason ?? 'router unavailable'}).\n </dd>\n </div>\n )}\n </dl>\n </details>\n )}\n\n {criteriaView && <GoalCriteria criteria={criteriaView} />}\n\n {/* Sub-agent steps nest under the tool step that spawned them, COLLAPSED: a\n deep_research run emits a dozen inner rows that buried the parent trace. The parent\n keeps the count so the work is never hidden, just folded. */}\n {folded && folded.length > 0 && (\n <SubStepGroup\n parentIndex={step.index}\n summary={summariseSubSteps(folded)}\n openClassName={accent.fg}\n renderSteps={() =>\n folded.map((c, ci, arr) => renderRow(c, depth + 1, ci === arr.length - 1))\n }\n />\n )}\n </StepRow>\n )\n }\n\n let summaryNode: React.ReactNode = null\n if (contextUsage?.spent_gbp != null) {\n const runStats = computeRunStats(steps)\n // Prefer the run's true cumulative totals (summed across every LLM call this turn made) over\n // total_input/total_output, which mirror only the last call's context.\n const totalInputTokens = contextUsage.all_llm_calls?.input_tokens ?? contextUsage.total_input\n const totalOutputTokens = contextUsage.all_llm_calls?.output_tokens ?? contextUsage.total_output\n const leftParts = [\n `${displayRows.length} step${displayRows.length !== 1 ? 's' : ''}`,\n `${runStats.toolCalls} tool call${runStats.toolCalls !== 1 ? 's' : ''}`,\n ]\n // The upstream model that answered: the version behind the picked family, or a fallback.\n if (contextUsage.served_model) leftParts.unshift(contextUsage.served_model)\n if (totalElapsedTime != null) leftParts.push(`${totalElapsedTime.toFixed(1)}s`)\n leftParts.push(`${formatTokens(totalInputTokens)} in`)\n if (totalOutputTokens > 0) leftParts.push(`${formatTokens(totalOutputTokens)} out`)\n summaryNode = (\n <StepTraceSummary\n left={leftParts.join(' \u00B7 ')}\n isNearBudget={isNearAiUsageBudget(contextUsage)}\n total={`Total: ${formatGbp(contextUsage.spent_gbp)}`}\n />\n )\n }\n\n return (\n <StepTrace className={className} summary={summaryNode}>\n {displayRows.map((row, i) => {\n if (row.lane) {\n return (\n <LaneBinding\n key={`lane-${row.lane}`}\n handle={row.lane}\n steps={laneStepsByHandle.get(row.lane)!}\n number={i + 1}\n renderRow={renderRow}\n isStreaming={isStreaming}\n />\n )\n }\n const parent = row.step!\n return renderRow(\n parent,\n 0,\n i === displayRows.length - 1 && !childrenByParent.has(parent.index)\n )\n })}\n </StepTrace>\n )\n}\n\n/** Binds a sub-agent's lifecycle steps to the `SubAgentLane` block. */\nfunction LaneBinding({\n handle,\n steps,\n number,\n renderRow,\n isStreaming,\n}: {\n handle: string\n steps: AgentStepEvent[]\n number: number\n renderRow: (step: AgentStepEvent, depth: number, isLastInList: boolean) => React.ReactNode\n isStreaming: boolean\n}) {\n // The spawn marker (`subagent_status: \"running\"`) carries the child's task; a `done`/`failed`\n // marker closes it; in between are the child's own steps.\n const spawn = steps.find((s) => s.subagent_status === 'running')\n const closed = steps.find((s) => s.subagent_status === 'done' || s.subagent_status === 'failed')\n const failed = steps.some((s) => s.subagent_status === 'failed')\n const inner = steps.filter((s) => !s.subagent_status)\n const task = (spawn?.content || spawn?.focus || '').trim()\n const running = !closed && isStreaming\n // What the child is doing RIGHT NOW: its latest step's focus/label.\n const latest = inner[inner.length - 1]\n return (\n <SubAgentLane\n handle={handle}\n number={number}\n // Name the lane by its JOB, never \"sub-1\": the handle is only a stable key.\n job={subagentJobLabel(task) || `Sub-agent ${handle}`}\n task={task}\n status={running ? 'running' : failed ? 'failed' : 'done'}\n innerCount={inner.length}\n liveFocus={latest ? latest.focus?.trim() || getAgentStepLabel(latest) : ''}\n renderSteps={() => inner.map((s, i) => renderRow(s, 1, i === inner.length - 1))}\n />\n )\n}\n\n/** Summarise folded sub-steps by what they did, e.g. \"3 searches, 2 reads\". */\nfunction summariseSubSteps(steps: AgentStepEvent[]): string {\n const counts = new Map<string, number>()\n for (const s of steps) {\n const noun = subStepNoun(getStepTool(s))\n counts.set(noun, (counts.get(noun) ?? 0) + 1)\n }\n return [...counts.entries()]\n .map(([noun, n]) => `${n} ${n === 1 ? noun : pluralise(noun)}`)\n .join(', ')\n}\n\n/** `met` (and `absent_from_corpus`, which the gate accepts) tick; anything else stays open. */\nfunction isCriterionMet(status?: string): boolean {\n return status === 'met' || status === 'absent_from_corpus'\n}\n\n/**\n * Does this outcome describe a failure?\n *\n * Outcomes are free text from the backend (\"exit 0 \u00B7 1.2s\", \"15 passages\n * retrieved\", \"timed out \u00B7 30.0s\"), so this reads the few shapes that carry a\n * verdict and defaults to \"not a failure\" for the rest \u2014 a false alarm on a\n * successful step is worse than a neutral chip.\n */\nfunction isFailureOutcome(outcome: string): boolean {\n const o = outcome.toLowerCase()\n if (/\\bexit\\s+0\\b/.test(o)) return false\n return /\\bexit\\s+[1-9]/.test(o) || /timed out|timeout|failed|error\\b/.test(o)\n}\n\n/** What one inner step *is*, for the collapsed summary line. */\nfunction subStepNoun(tool: string | undefined): string {\n switch (tool) {\n case 'search_inside_documents':\n case 'search_conversations':\n case 'web_search':\n return 'search'\n case 'read_document':\n case 'read_url':\n case 'view_document_pages':\n case 'get_table_of_contents':\n return 'read'\n case 'execute_code':\n case 'spawn_coding_agent':\n return 'run'\n case 'create_plan':\n return 'plan'\n default:\n return 'step'\n }\n}\n\nfunction pluralise(noun: string): string {\n return noun.endsWith('h') ? `${noun}es` : `${noun}s`\n}\n\nexport const AgentSteps = React.memo(AgentStepsComponent, (prev, next) => {\n return (\n prev.isStreaming === next.isStreaming &&\n prev.className === next.className &&\n prev.totalElapsedTime === next.totalElapsedTime &&\n prev.steps === next.steps &&\n prev.liveTimer === next.liveTimer &&\n prev.hideLive === next.hideLive\n )\n})\n"],
5
+ "mappings": ";AAsFI,SAoVM,UAhVE,KAJR;AAhFJ;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,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AAS,GAAG,IAAI,GAAG,IAAI,OAAO,GAAG,IAAI;AACnD;AAEO,MAAM,aAAa,MAAM,KAAK,qBAAqB,CAAC,MAAM,SAAS;AACxE,SACE,KAAK,gBAAgB,KAAK,eAC1B,KAAK,cAAc,KAAK,aACxB,KAAK,qBAAqB,KAAK,oBAC/B,KAAK,UAAU,KAAK,SACpB,KAAK,cAAc,KAAK,aACxB,KAAK,aAAa,KAAK;AAE3B,CAAC;",
6
6
  "names": []
7
7
  }
@@ -16,6 +16,7 @@ export declare function useFactFilters(notes: Fact[], view: FactsPageView, chat:
16
16
  doctag_count: number;
17
17
  facttag_count: number;
18
18
  convotag_count: number;
19
+ dbrow_count: number;
19
20
  field_values?: {
20
21
  [x: string]: unknown;
21
22
  } | undefined;
@@ -62,6 +63,7 @@ export declare function useFactFilters(notes: Fact[], view: FactsPageView, chat:
62
63
  doctag_count: number;
63
64
  facttag_count: number;
64
65
  convotag_count: number;
66
+ dbrow_count: number;
65
67
  field_values?: {
66
68
  [x: string]: unknown;
67
69
  } | undefined;
@@ -106,6 +108,7 @@ export declare function useFactFilters(notes: Fact[], view: FactsPageView, chat:
106
108
  doctag_count: number;
107
109
  facttag_count: number;
108
110
  convotag_count: number;
111
+ dbrow_count: number;
109
112
  field_values?: {
110
113
  [key: string]: unknown;
111
114
  };
@@ -43,6 +43,17 @@ const COLUMNS = [
43
43
  minWidth: 130,
44
44
  tooltipField: "model_name"
45
45
  },
46
+ {
47
+ // The version currently behind the model name. Names are stable families that are upgraded in
48
+ // place, so this is where the version shows.
49
+ colId: "current_version",
50
+ headerName: "Version",
51
+ field: "current_version",
52
+ flex: 1,
53
+ minWidth: 120,
54
+ tooltipField: "current_version",
55
+ valueFormatter: (params) => params.value ?? "\u2014"
56
+ },
46
57
  {
47
58
  colId: "provider",
48
59
  headerName: "Provider",
@@ -98,7 +109,9 @@ function ConnectedPremiumModels() {
98
109
  if (standards.length === 0) return premiumModels;
99
110
  const reference = {
100
111
  ...standards[0],
101
- model_name: `Standard (${standards.map((m) => m.model_name).join(", ")})`
112
+ model_name: `Standard (${standards.map((m) => m.model_name).join(", ")})`,
113
+ // One row for several models: the first one's version would be wrong for the rest.
114
+ current_version: null
102
115
  };
103
116
  return [reference, ...premiumModels];
104
117
  }, [available, premiumModels]);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/connection/settings-page/ConnectedPremiumModels.tsx"],
4
- "sourcesContent": ["/**\n * Premium models over the user settings: a switch and a radio-style table of the deployment's\n * premium (third-party) models, with the ARBI-hosted Standard models as one greyed reference row.\n * Renders nothing when the deployment offers no premium model.\n *\n * `premium_model` is `''` when Premium is off and a model name when it is on. Unset is ON with\n * the deployment's default premium model (as the server reads it), so the table shows that row.\n * Turning Premium on picks the cheapest model by output cost; a click on the selected row does\n * not deselect it (only the switch turns Premium off).\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport type { ColDef } from 'ag-grid-community'\nimport type { components } from '@arbidocs/client'\nimport {\n formatGbpPerMillionTokens,\n useAvailableModels,\n useUpdateUserSettings,\n useUserSettings,\n} from '@arbidocs/react'\nimport { ArbiIcon, ProviderIcon } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { GridView } from '../../files/GridView'\nimport { SettingsCard, SettingsPanel, SettingsSection } from '../../settings/SettingsPanel'\nimport { ModelProviderLabel, PremiumModelsFrame } from '../../settings/PremiumModelsFrame'\n\ntype ModelInfo = components['schemas']['ModelInfo']\n\nconst PROVIDER_NAMES: Record<string, string> = {\n openai: 'OpenAI',\n fireworks_ai: 'Fireworks AI',\n 'vertex_ai-language-models': 'Google',\n vertex_ai: 'Google',\n gemini: 'Google',\n anthropic: 'Anthropic',\n}\n\nconst isStandard = (model: Pick<ModelInfo, 'tags'> | undefined) =>\n !!model?.tags?.includes('Standard')\n\n/** The merged cost column's header, \"\u00A3/MT in-out\" (AG Grid keeps its sort arrow around it). */\nfunction PremiumCostHeader() {\n return <span className=\"flex items-center gap-0.5\">\u00A3/MT in-out</span>\n}\n\n/** The cheapest model by output-token cost (unknown costs last). */\nfunction cheapest(models: readonly ModelInfo[]): ModelInfo | undefined {\n return [...models].sort((a, b) => {\n const ao = a.output_cost_per_token\n const bo = b.output_cost_per_token\n if (ao == null && bo == null) return 0\n if (ao == null) return 1\n if (bo == null) return -1\n return ao - bo\n })[0]\n}\n\nconst COLUMNS: ColDef<ModelInfo>[] = [\n {\n colId: 'model_name',\n headerName: 'Model',\n field: 'model_name',\n flex: 2,\n minWidth: 130,\n tooltipField: 'model_name',\n },\n {\n colId: 'provider',\n headerName: 'Provider',\n field: 'provider',\n flex: 1,\n minWidth: 120,\n cellRenderer: (params: { value?: string; data?: ModelInfo }) =>\n isStandard(params.data) ? (\n <ModelProviderLabel\n logo={<ArbiIcon size={14} aria-label=\"ARBI\" className=\"flex-shrink-0 rounded-sm\" />}\n >\n ARBI CITY\n </ModelProviderLabel>\n ) : (\n <ModelProviderLabel\n logo={\n <ProviderIcon modelName={params.data?.model_name} provider={params.value} size={14} />\n }\n >\n {PROVIDER_NAMES[params.value ?? ''] || params.value || '\u2014'}\n </ModelProviderLabel>\n ),\n },\n {\n // Input and output cost in one column so the table fits the panel; sorted by output cost.\n colId: 'cost',\n headerName: 'Cost / MTok',\n headerComponentParams: { innerHeaderComponent: PremiumCostHeader },\n headerTooltip: '\u00A3 per million tokens \u2014 input then output',\n field: 'output_cost_per_token',\n flex: 1,\n minWidth: 120,\n type: 'rightAligned',\n cellRenderer: (params: { data?: ModelInfo }) => (\n <span className=\"tabular-nums\">\n {formatGbpPerMillionTokens(params.data?.input_cost_per_token) ?? '\u00A30'}-\n {formatGbpPerMillionTokens(params.data?.output_cost_per_token) ?? '\u00A30'}\n </span>\n ),\n },\n]\n\nexport function ConnectedPremiumModels() {\n const { notify } = useBlocksEnvironment()\n const { data: settings } = useUserSettings()\n const update = useUpdateUserSettings()\n const { data: available } = useAvailableModels()\n const isDeveloper = settings?.developer === true\n\n const premiumModel = settings?.premium_model\n const premiumModels = useMemo(\n () =>\n (available?.models ?? []).filter(\n (m) => m.tags?.includes('Premium') && (isDeveloper || !m.model_name.includes('@'))\n ),\n [available, isDeveloper]\n )\n // The Standard models share one rate: one reference row, never selectable.\n const rows = useMemo(() => {\n const standards = (available?.models ?? []).filter(isStandard)\n if (standards.length === 0) return premiumModels\n const reference = {\n ...standards[0],\n model_name: `Standard (${standards.map((m) => m.model_name).join(', ')})`,\n }\n return [reference, ...premiumModels]\n }, [available, premiumModels])\n const current = premiumModel ?? available?.premium_default ?? ''\n\n const save = useCallback(\n (model: string) =>\n update.mutate(\n { premium_model: model },\n {\n onError: (err) => notify(`Failed to update Premium setting: ${String(err)}`, 'error'),\n }\n ),\n [update, notify]\n )\n\n // A stable selection: recomputed when the selected name changes, not on every refetch.\n const currentRef = useRef(current)\n currentRef.current = current\n const [selected, setSelected] = useState<ModelInfo[]>([])\n useEffect(() => {\n const match = premiumModels.filter((m) => m.model_name === current)\n setSelected((prev) =>\n prev.length === match.length && prev[0]?.model_name === match[0]?.model_name ? prev : match\n )\n }, [current, premiumModels])\n\n const onSelectionChange = useCallback(\n (items: ModelInfo[]) => {\n const picked = items.filter((m) => !isStandard(m))\n const next = picked[0]?.model_name\n if (!next || next === currentRef.current) return\n setSelected(picked)\n save(next)\n },\n [save]\n )\n\n if (premiumModels.length === 0) return null\n\n return (\n <SettingsPanel className=\"max-w-2xl space-y-4\">\n <SettingsSection title=\"Premium models\">\n <SettingsCard className=\"space-y-0\">\n <PremiumModelsFrame\n enabled={premiumModel !== ''}\n onEnabledChange={(enabled) => {\n const target = enabled ? cheapest(premiumModels)?.model_name : ''\n if (target !== undefined) save(target)\n }}\n >\n <GridView\n items={rows}\n columnDefs={COLUMNS}\n getItemId={(m) => m.model_name}\n selection={{ mode: 'single', selected, onSelectionChange }}\n gridOptions={{\n rowClassRules: { 'opacity-60 italic': (p) => isStandard(p.data) },\n }}\n height={Math.min(rows.length * 40 + 48, 320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AAA,IAAC;AAAA;AAAA,MACC,SAAS,iBAAiB;AAAA,MAC1B,iBAAiB,CAAC,YAAY;AAC5B,cAAM,SAAS,UAAU,SAAS,aAAa,GAAG,aAAa;AAC/D,YAAI,WAAW,OAAW,MAAK,MAAM;AAAA,MACvC;AAAA,MAEA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,UACP,YAAY;AAAA,UACZ,WAAW,CAAC,MAAM,EAAE;AAAA,UACpB,WAAW,EAAE,MAAM,UAAU,UAAU,kBAAkB;AAAA,UACzD,aAAa;AAAA,YACX,eAAe,EAAE,qBAAqB,CAAC,MAAM,WAAW,EAAE,IAAI,EAAE;AAAA,UAClE;AAAA,UACA,QAAQ,KAAK,IAAI,KAAK,SAAS,KAAK,IAAI,GAAG;AAAA,UAC3C,QAAO;AAAA;AAAA,MACT;AAAA;AAAA,EACF,GACF,GACF,GACF;AAEJ;",
4
+ "sourcesContent": ["/**\n * Premium models over the user settings: a switch and a radio-style table of the deployment's\n * premium (third-party) models, with the ARBI-hosted Standard models as one greyed reference row.\n * Renders nothing when the deployment offers no premium model.\n *\n * `premium_model` is `''` when Premium is off and a model name when it is on. Unset is ON with\n * the deployment's default premium model (as the server reads it), so the table shows that row.\n * Turning Premium on picks the cheapest model by output cost; a click on the selected row does\n * not deselect it (only the switch turns Premium off).\n */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport type { ColDef } from 'ag-grid-community'\nimport type { components } from '@arbidocs/client'\nimport {\n formatGbpPerMillionTokens,\n useAvailableModels,\n useUpdateUserSettings,\n useUserSettings,\n} from '@arbidocs/react'\nimport { ArbiIcon, ProviderIcon } from '@arbidocs/react/ui'\nimport { useBlocksEnvironment } from '../../provider/environment'\nimport { GridView } from '../../files/GridView'\nimport { SettingsCard, SettingsPanel, SettingsSection } from '../../settings/SettingsPanel'\nimport { ModelProviderLabel, PremiumModelsFrame } from '../../settings/PremiumModelsFrame'\n\ntype ModelInfo = components['schemas']['ModelInfo']\n\nconst PROVIDER_NAMES: Record<string, string> = {\n openai: 'OpenAI',\n fireworks_ai: 'Fireworks AI',\n 'vertex_ai-language-models': 'Google',\n vertex_ai: 'Google',\n gemini: 'Google',\n anthropic: 'Anthropic',\n}\n\nconst isStandard = (model: Pick<ModelInfo, 'tags'> | undefined) =>\n !!model?.tags?.includes('Standard')\n\n/** The merged cost column's header, \"\u00A3/MT in-out\" (AG Grid keeps its sort arrow around it). */\nfunction PremiumCostHeader() {\n return <span className=\"flex items-center gap-0.5\">\u00A3/MT in-out</span>\n}\n\n/** The cheapest model by output-token cost (unknown costs last). */\nfunction cheapest(models: readonly ModelInfo[]): ModelInfo | undefined {\n return [...models].sort((a, b) => {\n const ao = a.output_cost_per_token\n const bo = b.output_cost_per_token\n if (ao == null && bo == null) return 0\n if (ao == null) return 1\n if (bo == null) return -1\n return ao - bo\n })[0]\n}\n\nconst COLUMNS: ColDef<ModelInfo>[] = [\n {\n colId: 'model_name',\n headerName: 'Model',\n field: 'model_name',\n flex: 2,\n minWidth: 130,\n tooltipField: 'model_name',\n },\n {\n // The version currently behind the model name. Names are stable families that are upgraded in\n // place, so this is where the version shows.\n colId: 'current_version',\n headerName: 'Version',\n field: 'current_version',\n flex: 1,\n minWidth: 120,\n tooltipField: 'current_version',\n valueFormatter: (params) => params.value ?? '\u2014',\n },\n {\n colId: 'provider',\n headerName: 'Provider',\n field: 'provider',\n flex: 1,\n minWidth: 120,\n cellRenderer: (params: { value?: string; data?: ModelInfo }) =>\n isStandard(params.data) ? (\n <ModelProviderLabel\n logo={<ArbiIcon size={14} aria-label=\"ARBI\" className=\"flex-shrink-0 rounded-sm\" />}\n >\n ARBI CITY\n </ModelProviderLabel>\n ) : (\n <ModelProviderLabel\n logo={\n <ProviderIcon modelName={params.data?.model_name} provider={params.value} size={14} />\n }\n >\n {PROVIDER_NAMES[params.value ?? ''] || params.value || '\u2014'}\n </ModelProviderLabel>\n ),\n },\n {\n // Input and output cost in one column so the table fits the panel; sorted by output cost.\n colId: 'cost',\n headerName: 'Cost / MTok',\n headerComponentParams: { innerHeaderComponent: PremiumCostHeader },\n headerTooltip: '\u00A3 per million tokens \u2014 input then output',\n field: 'output_cost_per_token',\n flex: 1,\n minWidth: 120,\n type: 'rightAligned',\n cellRenderer: (params: { data?: ModelInfo }) => (\n <span className=\"tabular-nums\">\n {formatGbpPerMillionTokens(params.data?.input_cost_per_token) ?? '\u00A30'}-\n {formatGbpPerMillionTokens(params.data?.output_cost_per_token) ?? '\u00A30'}\n </span>\n ),\n },\n]\n\nexport function ConnectedPremiumModels() {\n const { notify } = useBlocksEnvironment()\n const { data: settings } = useUserSettings()\n const update = useUpdateUserSettings()\n const { data: available } = useAvailableModels()\n const isDeveloper = settings?.developer === true\n\n const premiumModel = settings?.premium_model\n const premiumModels = useMemo(\n () =>\n (available?.models ?? []).filter(\n (m) => m.tags?.includes('Premium') && (isDeveloper || !m.model_name.includes('@'))\n ),\n [available, isDeveloper]\n )\n // The Standard models share one rate: one reference row, never selectable.\n const rows = useMemo(() => {\n const standards = (available?.models ?? []).filter(isStandard)\n if (standards.length === 0) return premiumModels\n const reference = {\n ...standards[0],\n model_name: `Standard (${standards.map((m) => m.model_name).join(', ')})`,\n // One row for several models: the first one's version would be wrong for the rest.\n current_version: null,\n }\n return [reference, ...premiumModels]\n }, [available, premiumModels])\n const current = premiumModel ?? available?.premium_default ?? ''\n\n const save = useCallback(\n (model: string) =>\n update.mutate(\n { premium_model: model },\n {\n onError: (err) => notify(`Failed to update Premium setting: ${String(err)}`, 'error'),\n }\n ),\n [update, notify]\n )\n\n // A stable selection: recomputed when the selected name changes, not on every refetch.\n const currentRef = useRef(current)\n currentRef.current = current\n const [selected, setSelected] = useState<ModelInfo[]>([])\n useEffect(() => {\n const match = premiumModels.filter((m) => m.model_name === current)\n setSelected((prev) =>\n prev.length === match.length && prev[0]?.model_name === match[0]?.model_name ? prev : match\n )\n }, [current, premiumModels])\n\n const onSelectionChange = useCallback(\n (items: ModelInfo[]) => {\n const picked = items.filter((m) => !isStandard(m))\n const next = picked[0]?.model_name\n if (!next || next === currentRef.current) return\n setSelected(picked)\n save(next)\n },\n [save]\n )\n\n if (premiumModels.length === 0) return null\n\n return (\n <SettingsPanel className=\"max-w-2xl space-y-4\">\n <SettingsSection title=\"Premium models\">\n <SettingsCard className=\"space-y-0\">\n <PremiumModelsFrame\n enabled={premiumModel !== ''}\n onEnabledChange={(enabled) => {\n const target = enabled ? cheapest(premiumModels)?.model_name : ''\n if (target !== undefined) save(target)\n }}\n >\n <GridView\n items={rows}\n columnDefs={COLUMNS}\n getItemId={(m) => m.model_name}\n selection={{ mode: 'single', selected, onSelectionChange }}\n gridOptions={{\n rowClassRules: { 'opacity-60 italic': (p) => isStandard(p.data) },\n }}\n height={Math.min(rows.length * 40 + 48, 320)}\n testId=\"premium-model-grid\"\n />\n </PremiumModelsFrame>\n </SettingsCard>\n </SettingsSection>\n </SettingsPanel>\n )\n}\n"],
5
+ "mappings": ";AAyCS,cAqEH,YArEG;AA/BT,SAAS,aAAa,WAAW,SAAS,QAAQ,gBAAgB;AAGlE;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,UAAU,oBAAoB;AACvC,SAAS,4BAA4B;AACrC,SAAS,gBAAgB;AACzB,SAAS,cAAc,eAAe,uBAAuB;AAC7D,SAAS,oBAAoB,0BAA0B;AAIvD,MAAM,iBAAyC;AAAA,EAC7C,QAAQ;AAAA,EACR,cAAc;AAAA,EACd,6BAA6B;AAAA,EAC7B,WAAW;AAAA,EACX,QAAQ;AAAA,EACR,WAAW;AACb;AAEA,MAAM,aAAa,CAAC,UAClB,CAAC,CAAC,OAAO,MAAM,SAAS,UAAU;AAGpC,SAAS,oBAAoB;AAC3B,SAAO,oBAAC,UAAK,WAAU,6BAA4B,4BAAW;AAChE;AAGA,SAAS,SAAS,QAAqD;AACrE,SAAO,CAAC,GAAG,MAAM,EAAE,KAAK,CAAC,GAAG,MAAM;AAChC,UAAM,KA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ACF,GACF,GACF,GACF;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -42,6 +42,7 @@ export declare function useTagValueOptions(): {
42
42
  doctag_count: number;
43
43
  facttag_count: number;
44
44
  convotag_count: number;
45
+ dbrow_count: number;
45
46
  field_values?: {
46
47
  [x: string]: unknown;
47
48
  } | undefined;
@@ -103,7 +103,7 @@ export declare function useConnectedWorkspaceList({ seed, filters: controlledFil
103
103
  field_schema?: {
104
104
  key: string;
105
105
  label?: string | null | undefined;
106
- type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag";
106
+ type: "text" | "number" | "date" | "checkbox" | "select" | "person" | "document" | "relation" | "lookup" | "rollup" | "tag" | "source";
107
107
  options?: string[] | null | undefined;
108
108
  }[] | null | undefined;
109
109
  plan_interval?: ("month" | "year") | null | undefined;
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  'use strict';
3
3
 
4
- var chunk33236Q7Y_cjs = require('../chunk-33236Q7Y.cjs');
4
+ var chunkJSP3WTFF_cjs = require('../chunk-JSP3WTFF.cjs');
5
5
  require('../chunk-7GVKG3G4.cjs');
6
6
  require('../chunk-OHWYQI3B.cjs');
7
7
  require('../chunk-65NQW4RR.cjs');
@@ -39,8 +39,8 @@ require('../chunk-SK6HQ46Q.cjs');
39
39
  require('../chunk-E23H6FJR.cjs');
40
40
  require('../chunk-YZSQ7F5K.cjs');
41
41
  require('../chunk-KQF7POTG.cjs');
42
- require('../chunk-HME72RFP.cjs');
43
42
  require('../chunk-VJNJ4G6Y.cjs');
43
+ require('../chunk-HME72RFP.cjs');
44
44
  require('../chunk-75BNMCUX.cjs');
45
45
  require('../chunk-OEJQFPWO.cjs');
46
46
  require('../chunk-2K5DLB7B.cjs');
@@ -93,27 +93,27 @@ require('../chunk-PLIF5CUV.cjs');
93
93
 
94
94
  Object.defineProperty(exports, "ArbiChat", {
95
95
  enumerable: true,
96
- get: function () { return chunk33236Q7Y_cjs.ArbiChat; }
96
+ get: function () { return chunkJSP3WTFF_cjs.ArbiChat; }
97
97
  });
98
98
  Object.defineProperty(exports, "ConnectedCompactLogin", {
99
99
  enumerable: true,
100
- get: function () { return chunk33236Q7Y_cjs.ConnectedCompactLogin; }
100
+ get: function () { return chunkJSP3WTFF_cjs.ConnectedCompactLogin; }
101
101
  });
102
102
  Object.defineProperty(exports, "ConnectedEmbeddedChat", {
103
103
  enumerable: true,
104
- get: function () { return chunk33236Q7Y_cjs.ConnectedEmbeddedChat; }
104
+ get: function () { return chunkJSP3WTFF_cjs.ConnectedEmbeddedChat; }
105
105
  });
106
106
  Object.defineProperty(exports, "ConnectedLoginPage", {
107
107
  enumerable: true,
108
- get: function () { return chunk33236Q7Y_cjs.ConnectedLoginPage; }
108
+ get: function () { return chunkJSP3WTFF_cjs.ConnectedLoginPage; }
109
109
  });
110
110
  Object.defineProperty(exports, "EmbeddedChatPanel", {
111
111
  enumerable: true,
112
- get: function () { return chunk33236Q7Y_cjs.EmbeddedChatPanel; }
112
+ get: function () { return chunkJSP3WTFF_cjs.EmbeddedChatPanel; }
113
113
  });
114
114
  Object.defineProperty(exports, "defaultHost", {
115
115
  enumerable: true,
116
- get: function () { return chunk33236Q7Y_cjs.defaultHost; }
116
+ get: function () { return chunkJSP3WTFF_cjs.defaultHost; }
117
117
  });
118
118
  Object.defineProperty(exports, "useConnection", {
119
119
  enumerable: true,