diff --git a/CHANGELOG.md b/CHANGELOG.md index ff757a903d..4b1266c1c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,6 +18,7 @@ - Anthropic: Agent bridge now maps native bash tool to standard `bash()` tool. - Google: Update to `google-genai` v1.62.0 to fix issue with error handling in proxy configurations. - Hooks: Add eval context id fields to `ModelUsageData` hook. +- Inspect View: Add middle-click support to open tasks and samples in a new browser tab. ## 0.3.196 (16 March 2026) diff --git a/src/inspect_ai/_view/www/dist/assets/index.js b/src/inspect_ai/_view/www/dist/assets/index.js index 5861ad72c8..c1c91fa60c 100644 --- a/src/inspect_ai/_view/www/dist/assets/index.js +++ b/src/inspect_ai/_view/www/dist/assets/index.js @@ -16932,11 +16932,22 @@ function resolvePath(to2, fromPathname = "/") { } = typeof to2 === "string" ? parsePath$1(to2) : to2; let pathname; if (toPathname) { - toPathname = toPathname.replace(/\/\/+/g, "/"); - if (toPathname.startsWith("/")) { - pathname = resolvePathname(toPathname.substring(1), "/"); + if (isAbsoluteUrl(toPathname)) { + pathname = toPathname; } else { - pathname = resolvePathname(toPathname, fromPathname); + if (toPathname.includes("//")) { + let oldPathname = toPathname; + toPathname = toPathname.replace(/\/\/+/g, "/"); + warning( + false, + `Pathnames cannot have embedded double slashes - normalizing ${oldPathname} -> ${toPathname}` + ); + } + if (toPathname.startsWith("/")) { + pathname = resolvePathname(toPathname.substring(1), "/"); + } else { + pathname = resolvePathname(toPathname, fromPathname); + } } } else { pathname = fromPathname; @@ -22309,15 +22320,7 @@ function PrefetchPageLinksImpl({ return /* @__PURE__ */ reactExports.createElement(reactExports.Fragment, null, dataHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "prefetch", as: "fetch", href, ...linkProps })), moduleHrefs.map((href) => /* @__PURE__ */ reactExports.createElement("link", { key: href, rel: "modulepreload", href, ...linkProps })), keyedPrefetchLinks.map(({ key: key2, link: link2 }) => ( // these don't spread `linkProps` because they are full link descriptors // already with their own props - /* @__PURE__ */ reactExports.createElement( - "link", - { - key: key2, - nonce: linkProps.nonce, - ...link2, - crossOrigin: link2.crossOrigin ?? linkProps.crossOrigin - } - ) + /* @__PURE__ */ reactExports.createElement("link", { key: key2, nonce: linkProps.nonce, ...link2 }) ))); } function mergeRefs(...refs) { @@ -22335,7 +22338,7 @@ var isBrowser2 = typeof window !== "undefined" && typeof window.document !== "un try { if (isBrowser2) { window.__reactRouterVersion = // @ts-expect-error - "7.13.0"; + "7.12.0"; } } catch (e) { } @@ -27798,6 +27801,13 @@ const kScoreTypeOther = "other"; const kScoreTypeObject = "object"; const kScoreTypeBoolean = "boolean"; const kScoreTypeList = "list"; +const kSampleAscVal = "sample-asc"; +const kSampleDescVal = "sample-desc"; +const kEpochAscVal = "epoch-asc"; +const kEpochDescVal = "epoch-desc"; +const kScoreAscVal = "score-asc"; +const kScoreDescVal = "score-desc"; +const kDefaultSort = kSampleAscVal; const clearDocumentSelection = () => { const sel = window.getSelection(); if (sel) { @@ -28307,16 +28317,8 @@ function createLogPolling(get2, set3) { await refreshLog(logFileName, false); return true; } else if (pendingSamples.status === "NotFound") { - const currentStatus = get2().log.selectedLogDetails?.status; - if (currentStatus === "started") { - log$a.debug( - `NotFound but eval still running, continuing to poll: ${logFileName}` - ); - await refreshLog(logFileName, false); - return true; - } log$a.debug(`Stop polling running samples: ${logFileName}`); - if (loadedPendingSamples) { + if (loadedPendingSamples || state.log.selectedLogDetails?.status === "started") { log$a.debug(`Refresh log: ${logFileName}`); await refreshLog(logFileName, true); } @@ -28367,7 +28369,7 @@ function createLogPolling(get2, set3) { const log$9 = createLogger("logSlice"); const initialState$2 = { // Log state - selectedSampleId: void 0, + șselectedSampleId: void 0, selectedSampleEpoch: void 0, selectedLogDetails: void 0, pendingSampleSummaries: void 0, @@ -28375,6 +28377,8 @@ const initialState$2 = { // Filter state filter: "", filterError: void 0, + epoch: "all", + sort: kDefaultSort, selectedScores: void 0, scores: void 0 }; @@ -28438,6 +28442,12 @@ const createLogSlice = (set3, get2, _store) => { state.log.filterError = void 0; }); }, + setEpoch: (epoch) => set3((state) => { + state.log.epoch = epoch; + }), + setSort: (sort2) => set3((state) => { + state.log.sort = sort2; + }), setSelectedScores: (scores2) => set3((state) => { state.log.selectedScores = scores2; }), @@ -28447,6 +28457,8 @@ const createLogSlice = (set3, get2, _store) => { resetFiltering: () => set3((state) => { state.log.filter = ""; state.log.filterError = void 0; + state.log.epoch = "all"; + state.log.sort = kDefaultSort; state.log.selectedScores = state.log.scores?.slice(0, 1); }), syncLog: async (logFileName) => { @@ -28812,7 +28824,7 @@ const createLogsSlice = (set3, get2, _store) => { if (!isInFileList) { if (state.replicationService?.isReplicating() && !state.app.singleFileMode) { await state.logsActions.syncLogs(); - const logHandle = get2().logs.logs.find( + const logHandle = state.logs.logs.find( (val) => val.name.endsWith(logFile) ); if (!logHandle) { @@ -28981,54 +28993,12 @@ const resolveAttachments = (value2, attachments, onFailedResolve) => { } return value2; }; -const expandRefs = (refs, pool) => refs.flatMap(([start2, end_exclusive]) => pool.slice(start2, end_exclusive)); -const resolveEventRefs = (events, msgPool, callPool) => { - return events.map((event) => { - if (event.event !== "model") return event; - const resolved = Array.isArray(event.input_refs) ? { - ...event, - input: expandRefs( - event.input_refs, - msgPool - ), - input_refs: null - } : event; - if (!resolved.call || !Array.isArray(resolved.call.call_refs)) - return resolved; - return { - ...resolved, - call: { - ...resolved.call, - request: { - ...resolved.call.request, - [resolved.call.call_key || "messages"]: expandRefs( - resolved.call.call_refs, - callPool - ) - }, - call_refs: null, - call_key: null - } - }; - }); -}; -const resolvePools = (sample2) => { - const { message_pool, call_pool } = sample2; - if (!message_pool?.length && !call_pool?.length) return sample2; - return { - ...sample2, - events: resolveEventRefs(sample2.events, message_pool, call_pool), - message_pool: [], - call_pool: [] - }; -}; const resolveSample$1 = (sample2) => { sample2 = { ...sample2 }; if (sample2.transcript) { sample2.events = sample2.transcript.events; sample2.attachments = sample2.transcript.content; } - sample2 = resolvePools(sample2); sample2.attachments = sample2.attachments || {}; sample2.input = resolveAttachments(sample2.input, sample2.attachments); sample2.messages = resolveAttachments(sample2.messages, sample2.attachments); @@ -29412,6 +29382,7 @@ const initialState = { sampleInState: false, sampleStatus: "ok", sampleError: void 0, + downloadProgress: void 0, eventsCleared: false, visiblePopover: void 0, // signals that the sample needs to be reloaded @@ -29420,6 +29391,7 @@ const initialState = { runningEvents: [], collapsedEvents: null, collapsedMode: null, + flatView: false, eventFilter: { filteredTypes: [...kDefaultExcludeEvents] }, @@ -29467,6 +29439,7 @@ const createSampleSlice = (set3, get2, _store) => { state.sample.sampleInState = false; state.sample.runningEvents = []; state.sample.sampleStatus = "ok"; + state.sample.downloadProgress = void 0; state.log.selectedSampleHandle = void 0; }); }, @@ -29488,6 +29461,9 @@ const createSampleSlice = (set3, get2, _store) => { setSampleError: (error2) => set3((state) => { state.sample.sampleError = error2; }), + setDownloadProgress: (progress2) => set3((state) => { + state.sample.downloadProgress = progress2; + }), setCollapsedEvents: (scope, collapsed2) => { set3((state) => { if (state.sample.collapsedEvents === null) { @@ -29546,6 +29522,11 @@ const createSampleSlice = (set3, get2, _store) => { state.sample.collapsedMode = mode; }); }, + setFlatView: (value2) => { + set3((state) => { + state.sample.flatView = value2; + }); + }, setFilteredEventTypes: (types2) => { set3((state) => { state.sample.eventFilter.filteredTypes = types2; @@ -30324,8 +30305,7 @@ const ApplicationIcons = { operator: "bi bi-person-workspace", tokens: "bi bi-list", time: "bi bi-clock", - execution: "bi bi-stopwatch", - cost: "bi bi-currency-dollar" + execution: "bi bi-stopwatch" }, link: "bi bi-link-45deg", loading: "bi bi-arrow-clockwise", @@ -30427,13 +30407,13 @@ function clsx() { for (var e, t2, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t2 = r(e)) && (n && (n += " "), n += t2); return n; } -const container$n = "_container_1n7pm_1"; -const label$9 = "_label_1n7pm_7"; +const container$o = "_container_1n7pm_1"; +const label$b = "_label_1n7pm_7"; const outer = "_outer_1n7pm_11"; const inner = "_inner_1n7pm_20"; -const styles$1L = { - container: container$n, - label: label$9, +const styles$1P = { + container: container$o, + label: label$b, outer, inner }; @@ -30444,15 +30424,15 @@ const ProgressBar = ({ label: label2, width = "100px" }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1L.container), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1L.outer), style: { width }, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1P.container), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1P.outer), style: { width }, children: /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$1L.inner), + className: clsx(styles$1P.inner), style: { width: `${(value2 - min2) / (max2 - min2) * 100}%` } } ) }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1L.label, "text-size-smallest"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1P.label, "text-size-smallest"), children: [ value2, " / ", max2, @@ -30544,15 +30524,6 @@ class ClientEventsService { } } const clientEventsService = new ClientEventsService(); -const errorType = (message2) => { - if (!message2) { - return "Error"; - } - if (message2.includes("(")) { - return message2.split("(")[0]; - } - return "Error"; -}; const arrayToString = (val) => { val = Array.isArray(val) ? val : [val]; return val.join(", "); @@ -30662,10 +30633,19 @@ function formatDuration(start2, end2) { const durationSec = durationMs / 1e3; return formatTime$1(durationSec); } +const errorType = (message2) => { + if (!message2) { + return "Error"; + } + if (message2.includes("(")) { + return message2.split("(")[0]; + } + return "Error"; +}; const circle$1 = "_circle_qymy9_1"; const green$1 = "_green_qymy9_12"; const red$1 = "_red_qymy9_18"; -const styles$1K = { +const styles$1O = { circle: circle$1, green: green$1, red: red$1 @@ -30681,9 +30661,9 @@ const booleanScoreDescriptor = () => { "span", { className: clsx( - styles$1K.circle, + styles$1O.circle, "text-size-small", - score2 ? styles$1K.green : styles$1K.red + score2 ? styles$1O.green : styles$1O.red ), children: String(score2) } @@ -30782,11 +30762,11 @@ const numericScoreDescriptor = (values) => { } }; }; -const container$m = "_container_1ramc_1"; +const container$n = "_container_1ramc_1"; const key$1 = "_key_1ramc_12"; const value$2 = "_value_1ramc_16"; -const styles$1J = { - container: container$m, +const styles$1N = { + container: container$n, key: key$1, value: value$2 }; @@ -30829,12 +30809,12 @@ const objectScoreDescriptor = (values) => { ) : String(value2); scores2.push( /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1J.key, "text-size-smaller"), children: key2 }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1J.value, "text-size-base"), children: formattedValue }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1N.key, "text-size-smaller"), children: key2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1N.value, "text-size-base"), children: formattedValue }) ] }) ); }); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1J.container), children: scores2 }, `score-value`); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1N.container), children: scores2 }, `score-value`); } }; }; @@ -32128,7 +32108,7 @@ function requireAnsiOutput() { var ansiOutputExports = requireAnsiOutput(); const toolButton$1 = "_toolButton_nu8dt_1"; const latched = "_latched_nu8dt_13"; -const styles$1I = { +const styles$1M = { toolButton: toolButton$1, latched }; @@ -32142,10 +32122,10 @@ const ToolButton = reactExports.forwardRef( className: clsx( "btn", "btn-tools", - styles$1I.toolButton, + styles$1M.toolButton, classes, className2, - latched2 ? styles$1I.latched : void 0 + latched2 ? styles$1M.latched : void 0 ), ...rest, children: [ @@ -32161,7 +32141,7 @@ const ansiDisplayContainer = "_ansiDisplayContainer_sawhg_1"; const ansiDisplay = "_ansiDisplay_sawhg_1"; const ansiDisplayRaw = "_ansiDisplayRaw_sawhg_28"; const ansiDisplayToggle = "_ansiDisplayToggle_sawhg_33"; -const styles$1H = { +const styles$1L = { ansiDisplayContainer, ansiDisplay, ansiDisplayRaw, @@ -32217,13 +32197,13 @@ const ANSIDisplay = ({ return /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$1H.ansiDisplayContainer, className2), + className: clsx(styles$1L.ansiDisplayContainer, className2), style: { ...style2 }, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ToolButton, { - className: clsx(styles$1H.ansiDisplayToggle, "text-size-smallest"), + className: clsx(styles$1L.ansiDisplayToggle, "text-size-smallest"), icon: "bi bi-code-slash", label: "", latched: showRaw, @@ -32231,9 +32211,9 @@ const ANSIDisplay = ({ title: showRaw ? "Show rendered output" : "Show raw output" } ), - showRaw ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1H.ansiDisplay, styles$1H.ansiDisplayRaw), children: output2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1H.ansiDisplay), style: backgroundStyle, children: ansiOutput2.outputLines.map((line2, index) => { + showRaw ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1L.ansiDisplay, styles$1L.ansiDisplayRaw), children: output2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1L.ansiDisplay), style: backgroundStyle, children: ansiOutput2.outputLines.map((line2, index) => { firstOutput = firstOutput || !!line2.outputRuns.length; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1H.ansiDisplayLine), children: !line2.outputRuns.length ? firstOutput ? /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}) : null : line2.outputRuns.map((outputRun) => /* @__PURE__ */ jsxRuntimeExports.jsx(OutputRun, { run: outputRun }, outputRun.id)) }, index); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1L.ansiDisplayLine), children: !line2.outputRuns.length ? firstOutput ? /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}) : null : line2.outputRuns.map((outputRun) => /* @__PURE__ */ jsxRuntimeExports.jsx(OutputRun, { run: outputRun }, outputRun.id)) }, index); }) }) ] } @@ -32460,7 +32440,7 @@ const visible = "_visible_tm52u_1"; const hidden$1 = "_hidden_tm52u_5"; const pills = "_pills_tm52u_9"; const pill = "_pill_tm52u_9"; -const styles$1G = { +const styles$1K = { visible, hidden: hidden$1, pills, @@ -32490,7 +32470,7 @@ const NavPills = ({ id, children: children2 }) => { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: child["props"]?.title === activeItem ? styles$1G.visible : styles$1G.hidden, + className: child["props"]?.title === activeItem ? styles$1K.visible : styles$1K.hidden, children: child }, `nav-pill-container-${idx}` @@ -32500,7 +32480,7 @@ const NavPills = ({ id, children: children2 }) => { /* @__PURE__ */ jsxRuntimeExports.jsx( "ul", { - className: clsx("nav", "nav-pills", styles$1G.pills), + className: clsx("nav", "nav-pills", styles$1K.pills), role: "tablist", "aria-orientation": "horizontal", children: navPills @@ -32536,7 +32516,7 @@ const NavPill = ({ "nav-link", "text-style-label", active ? "active " : "", - styles$1G.pill + styles$1K.pill ), "data-target": title2, onClick: handleClick, @@ -32552,7 +32532,7 @@ const Buckets = { final: 1e3 }; const copyButton = "_copyButton_1goi8_1"; -const styles$1F = { +const styles$1J = { copyButton }; const CopyButton = ({ @@ -32582,7 +32562,7 @@ const CopyButton = ({ "button", { type: "button", - className: clsx("copy-button", styles$1F.copyButton, className2), + className: clsx("copy-button", styles$1J.copyButton, className2), onClick: handleClick, "aria-label": ariaLabel, disabled: isCopied, @@ -32660,7 +32640,7 @@ const moreToggleButton = "_moreToggleButton_1cl3h_36"; const separator$6 = "_separator_1cl3h_42"; const inlineRight = "_inlineRight_1cl3h_48"; const blockLeft = "_blockLeft_1cl3h_54"; -const styles$1E = { +const styles$1I = { expandablePanel, expandableBordered, expandableCollapsed, @@ -32713,10 +32693,10 @@ const ExpandablePanel = reactExports.memo( ref: contentRef, "data-expandable-panel": "true", className: clsx( - styles$1E.expandablePanel, - collapsed2 ? styles$1E.expandableCollapsed : void 0, - border ? styles$1E.expandableBordered : void 0, - showToggle ? styles$1E.padBottom : void 0, + styles$1I.expandablePanel, + collapsed2 ? styles$1I.expandableCollapsed : void 0, + border ? styles$1I.expandableBordered : void 0, + showToggle ? styles$1I.padBottom : void 0, className2 ), children: [ @@ -32742,7 +32722,7 @@ const ExpandablePanel = reactExports.memo( position: "block-left" } ) }), - showToggle && layout == "inline-right" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1E.separator) }) + showToggle && layout == "inline-right" && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1I.separator) }) ] }); } ); @@ -32761,15 +32741,15 @@ const MoreToggle = ({ "div", { className: clsx( - styles$1E.moreToggle, - border ? styles$1E.bordered : void 0, - position === "inline-right" ? styles$1E.inlineRight : styles$1E.blockLeft + styles$1I.moreToggle, + border ? styles$1I.bordered : void 0, + position === "inline-right" ? styles$1I.inlineRight : styles$1I.blockLeft ), style: style2, children: /* @__PURE__ */ jsxRuntimeExports.jsxs( "button", { - className: clsx("btn", styles$1E.moreToggleButton, "text-size-smallest"), + className: clsx("btn", styles$1I.moreToggleButton, "text-size-smallest"), onClick: handleClick, children: [ text2, @@ -36303,7 +36283,7 @@ const keyPairBordered = "_keyPairBordered_qjlxf_9"; const key = "_key_qjlxf_1"; const pre$1 = "_pre_qjlxf_19"; const treeIcon = "_treeIcon_qjlxf_23"; -const styles$1D = { +const styles$1H = { keyPairContainer, keyPairBordered, key, @@ -36489,8 +36469,8 @@ const RecordTree = ({ "div", { className: clsx( - styles$1D.keyPairContainer, - index < items.length - 1 && useBorders ? styles$1D.keyPairBordered : void 0, + styles$1H.keyPairContainer, + index < items.length - 1 && useBorders ? styles$1H.keyPairBordered : void 0, "text-size-small" ), style: { @@ -36503,7 +36483,7 @@ const RecordTree = ({ "data-index": index, className: clsx( kRecordTreeKey, - styles$1D.key, + styles$1H.key, "font-monospace", "text-style-secondary" ), @@ -36513,16 +36493,16 @@ const RecordTree = ({ setCollapsed(item2.id, !collapsedIds?.[item2.id]); }, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item2.hasChildren ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1D.pre), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: item2.hasChildren ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1H.pre), children: /* @__PURE__ */ jsxRuntimeExports.jsx( "i", { className: clsx( collapsedIds && collapsedIds[item2.id] ? ApplicationIcons.tree.closed : ApplicationIcons.tree.open, - styles$1D.treeIcon + styles$1H.treeIcon ) } ) }) : void 0 }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: clsx(styles$1D.pre), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("pre", { className: clsx(styles$1H.pre), children: [ item2.key, ":" ] }) @@ -37007,7 +36987,7 @@ const indented = "_indented_1k527_37"; const copyLink$1 = "_copyLink_1k527_41"; const metadataLabel = "_metadataLabel_1k527_52"; const hover$1 = "_hover_1k527_56"; -const styles$1C = { +const styles$1G = { message: message$3, systemRole, timestamp, @@ -37021,14 +37001,14 @@ const styles$1C = { }; const panel$8 = "_panel_1pa96_1"; const code$5 = "_code_1pa96_7"; -const styles$1B = { +const styles$1F = { panel: panel$8, code: code$5 }; const CodePanel = ({ code: code2, language: language2 = "json" }) => { const codeContainerRef = reactExports.useRef(null); usePrismHighlight(codeContainerRef, code2.length); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: codeContainerRef, className: clsx(styles$1B.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1B.code), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx(`language-${language2}`), children: code2 }) }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: codeContainerRef, className: clsx(styles$1F.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1F.code), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx(`language-${language2}`), children: code2 }) }) }); }; class JsonWorkerPool { encoder = new TextEncoder(); @@ -37096,6 +37076,23 @@ class JsonWorkerPool { ); }); } + async parseBytes(data) { + this.ensureWorkers(); + const requestId = this.nextRequestId++; + const ownedData = data.byteOffset === 0 && data.byteLength === data.buffer.byteLength ? data : data.slice(); + return new Promise((resolve, reject) => { + this.pendingRequests.set(requestId, { resolve, reject }); + const worker = this.workers[requestId % this.workers.length]; + worker?.postMessage( + { + type: "parse", + requestId, + encodedText: ownedData + }, + [ownedData.buffer] + ); + }); + } terminate() { this.workers.forEach((w) => w.terminate()); this.workers = []; @@ -37120,6 +37117,14 @@ const asyncJsonParse = async (text2) => { return workerPool.parse(text2); } }; +const asyncJsonParseBytes = async (data) => { + if (data.length < 5e4) { + const text2 = new TextDecoder("utf-8").decode(data); + return jsonParse(text2); + } else { + return workerPool.parseBytes(data); + } +}; const jsonParse = (text2) => { try { return JSON.parse(text2); @@ -40577,13 +40582,7 @@ function linkify(state, silent) { if (!link2) return false; let url = link2.url; if (url.length <= proto.length) return false; - let urlEnd = url.length; - while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) { - urlEnd--; - } - if (urlEnd !== url.length) { - url = url.slice(0, urlEnd); - } + url = url.replace(/\*+$/, ""); const fullUrl = state.md.normalizeLink(url); if (!state.md.validateLink(fullUrl)) return false; if (!silent) { @@ -107847,7 +107846,7 @@ function unescapeCodeHtmlEntities(str2) { ); } const content$3 = "_content_13ihw_1"; -const styles$1A = { +const styles$1E = { content: content$3 }; const Preformatted = reactExports.forwardRef( @@ -107856,7 +107855,7 @@ const Preformatted = reactExports.forwardRef( "pre", { ref, - className: clsx(styles$1A.content, "text-size-smaller", className2), + className: clsx(styles$1E.content, "text-size-smaller", className2), style: style2, children: text2 } @@ -107891,22 +107890,22 @@ const RenderedText = reactExports.forwardRef(({ markdown, style: style2, classNa }); const webSearch = "_webSearch_1376z_1"; const query$1 = "_query_1376z_8"; -const styles$1z = { +const styles$1D = { webSearch, query: query$1 }; const WebSearch = ({ query: query2 }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1z.webSearch, "text-size-smaller"), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1D.webSearch, "text-size-smaller"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-style-label", "text-style-secondary"), children: "Web Search:" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1z.query, "text-size-smallest"), children: query2 }) + /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1D.query, "text-size-smallest"), children: query2 }) ] }); }; const contentData = "_contentData_1lrx1_1"; -const styles$1y = { +const styles$1C = { contentData }; const result$1 = "_result_1mixg_12"; -const styles$1x = { +const styles$1B = { result: result$1 }; const WebSearchResults = ({ @@ -107917,7 +107916,7 @@ const WebSearchResults = ({ "div", { className: clsx( - styles$1x.label, + styles$1B.label, "text-style-label", "text-style-secondary", "text-size-smaller" @@ -107925,10 +107924,10 @@ const WebSearchResults = ({ children: "Results" } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx(styles$1x.results, "text-size-smaller"), children: results.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx(styles$1B.results, "text-size-smaller"), children: results.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx( "li", { - className: clsx(styles$1x.result, "text-style-secondary"), + className: clsx(styles$1B.result, "text-style-secondary"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { @@ -107947,16 +107946,16 @@ const WebSearchResults = ({ }; const title$3 = "_title_1gjvf_1"; const content$2 = "_content_1gjvf_11"; -const grid$9 = "_grid_1gjvf_16"; -const styles$1w = { +const grid$a = "_grid_1gjvf_16"; +const styles$1A = { title: title$3, content: content$2, - grid: grid$9 + grid: grid$a }; -const grid$8 = "_grid_14885_1"; +const grid$9 = "_grid_14885_1"; const cell$2 = "_cell_14885_8"; -const styles$1v = { - grid: grid$8, +const styles$1z = { + grid: grid$9, cell: cell$2 }; const MetaDataGrid = ({ @@ -107986,7 +107985,7 @@ const MetaDataGrid = ({ { className: clsx( `${baseId}-key`, - styles$1v.cell, + styles$1z.cell, "text-style-label", "text-style-secondary", fontStyle @@ -107994,7 +107993,7 @@ const MetaDataGrid = ({ children: entry?.name } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1v.value, `${baseId}-value`, fontStyle), children: entry && /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1z.value, `${baseId}-value`, fontStyle), children: entry && /* @__PURE__ */ jsxRuntimeExports.jsx( RenderedContent, { id: id2, @@ -108004,7 +108003,7 @@ const MetaDataGrid = ({ MetaDataGrid, { id: id2, - className: clsx(styles$1v.nested), + className: clsx(styles$1z.nested), entries: obj, size, plain @@ -108015,7 +108014,7 @@ const MetaDataGrid = ({ ) }) ] }, `${baseId}-record-${index}`); }); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id, className: clsx(className2, styles$1v.grid), style: style2, children: entryEls }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id, className: clsx(className2, styles$1z.grid), style: style2, children: entryEls }); }; const entryRecords = (entries) => { if (!entries) { @@ -108040,19 +108039,19 @@ const CompactionData = ({ id, data }) => { MetaDataGrid, { id: `${id}-compacted-content-metadata`, - className: styles$1w.grid, + className: styles$1A.grid, entries: compactionMetadata } ); } - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1w.content, "text-size-small"), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1A.content, "text-size-small"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( "text-style-label", "text-style-secondary", - styles$1w.title + styles$1A.title ), children: "Compacted Content" } @@ -108067,17 +108066,17 @@ const ContentDataView = ({ id, contentData: contentData2 }) => { ); if (!renderer) { const { encrypted_content, ...record } = renderableData; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1y.contentData), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1C.contentData), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RecordTree, { id: `${id}-tree`, record, - className: clsx(styles$1y.data), + className: clsx(styles$1C.data), defaultExpandLevel: 0 } ) }); } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1y.contentData), children: renderer.render(id, renderableData) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1C.contentData), children: renderer.render(id, renderableData) }); }; const compactionDataRenderer = { name: "Compaction", @@ -108128,7 +108127,7 @@ const serverToolRenderer = { { id: `${id}-server-tool`, record: data, - className: clsx(styles$1y.data) + className: clsx(styles$1C.data) } ) ] }); @@ -108247,6 +108246,13 @@ function clearLargeEventsArray(data) { result2.set(after, offset2); return result2; } +const fetchRange = async (url, start2, end2) => { + const response = await fetch(url, { + headers: { Range: `bytes=${start2}-${end2}` } + }); + const arrayBuffer = await response.arrayBuffer(); + return new Uint8Array(arrayBuffer); +}; class AsyncQueue { constructor(concurrentLimit = 6) { this.concurrentLimit = concurrentLimit; @@ -109651,6 +109657,48 @@ class FileSizeLimitError extends Error { Object.setPrototypeOf(this, FileSizeLimitError.prototype); } } +const PARALLEL_CHUNK_THRESHOLD = 8 * 1024 * 1024; +const PARALLEL_CHUNK_SIZE = 8 * 1024 * 1024; +const MAX_PARALLEL_CHUNKS = 10; +const fetchBytesParallel = async (fetchFn, url, start2, end2, onProgress) => { + const totalSize = end2 - start2 + 1; + if (totalSize <= PARALLEL_CHUNK_THRESHOLD) { + return fetchFn(url, start2, end2); + } + const chunks = []; + let offset2 = start2; + while (offset2 <= end2) { + const chunkEnd = Math.min(offset2 + PARALLEL_CHUNK_SIZE - 1, end2); + chunks.push({ start: offset2, end: chunkEnd, index: chunks.length }); + offset2 = chunkEnd + 1; + } + const concurrency = Math.min(chunks.length, MAX_PARALLEL_CHUNKS); + const results = new Array(chunks.length); + let nextChunk = 0; + let bytesLoaded = 0; + if (onProgress) { + onProgress(0, totalSize); + } + const worker = async () => { + while (nextChunk < chunks.length) { + const idx = nextChunk++; + const chunk = chunks[idx]; + results[idx] = await fetchFn(url, chunk.start, chunk.end); + if (onProgress) { + bytesLoaded += results[idx].length; + onProgress(bytesLoaded, totalSize); + } + } + }; + await Promise.all(Array.from({ length: concurrency }, () => worker())); + const combined = new Uint8Array(totalSize); + let pos2 = 0; + for (const chunk of results) { + combined.set(chunk, pos2); + pos2 += chunk.length; + } + return combined; +}; const openRemoteZipFile = async (url, fetchContentLength = fetchSize, fetchBytes = fetchRange) => { const contentLength = await fetchContentLength(url); const eocdrBuffer = await fetchBytes( @@ -109694,7 +109742,8 @@ const openRemoteZipFile = async (url, fetchContentLength = fetchSize, fetchBytes centralDirSize = Number(zip64EOCDView.getBigUint64(40, true)); centralDirOffset = Number(zip64EOCDView.getBigUint64(48, true)); } - const centralDirBuffer = await fetchBytes( + const centralDirBuffer = await fetchBytesParallel( + fetchBytes, url, centralDirOffset, centralDirOffset + centralDirSize - 1 @@ -109702,28 +109751,40 @@ const openRemoteZipFile = async (url, fetchContentLength = fetchSize, fetchBytes const centralDirectory = parseCentralDirectory(centralDirBuffer); return { centralDirectory, - readFile: async (file, maxBytes) => { + readFile: async (file, maxBytes, onProgress) => { const entry = centralDirectory.get(file); if (!entry) { throw new Error(`File not found: ${file}`); } const headerSize = 30; - const headerData = await fetchBytes( - url, - entry.fileOffset, - entry.fileOffset + headerSize - 1 - ); - const filenameLength = headerData[26] + (headerData[27] << 8); - const extraFieldLength = headerData[28] + (headerData[29] << 8); - const totalSizeToFetch = headerSize + filenameLength + extraFieldLength + entry.compressedSize; - if (maxBytes && totalSizeToFetch > maxBytes) { + const extraFieldPadding = 256; + const estimatedSize = headerSize + entry.filenameLength + extraFieldPadding + entry.compressedSize; + if (maxBytes && headerSize + entry.filenameLength + entry.compressedSize > maxBytes) { throw new FileSizeLimitError(file, maxBytes); } - const fileData = await fetchBytes( + let fileData = await fetchBytesParallel( + fetchBytes, url, entry.fileOffset, - entry.fileOffset + totalSizeToFetch - 1 + entry.fileOffset + estimatedSize - 1, + onProgress ); + if (fileData.length < headerSize) { + throw new Error(`File entry header is truncated for ${file}`); + } + const actualExtraFieldLength = fileData[28] + (fileData[29] << 8); + const actualTotal = headerSize + entry.filenameLength + actualExtraFieldLength + entry.compressedSize; + if (maxBytes && actualTotal > maxBytes) { + throw new FileSizeLimitError(file, maxBytes); + } + if (actualTotal > estimatedSize) { + fileData = await fetchBytesParallel( + fetchBytes, + url, + entry.fileOffset, + entry.fileOffset + actualTotal - 1 + ); + } const zipFileEntry = await parseZipFileEntry(file, fileData); return decompressData( zipFileEntry.data, @@ -109758,13 +109819,6 @@ const fetchSize = async (url) => { } throw new Error(`Could not determine content length for ${url}`); }; -const fetchRange = async (url, start2, end2) => { - const response = await fetch(`${url}`, { - headers: { Range: `bytes=${start2}-${end2}` } - }); - const arrayBuffer = await response.arrayBuffer(); - return new Uint8Array(arrayBuffer); -}; const parseZipFileEntry = async (file, rawData) => { const view = new DataView(rawData.buffer); let offset2 = 0; @@ -109876,7 +109930,8 @@ const parseCentralDirectory = (buffer2) => { compressionMethod: view.getUint16(offset2 + 10, true), compressedSize, uncompressedSize, - fileOffset + fileOffset, + filenameLength }; entries.set(filename2, entry); offset2 += kFileHeaderSize + filenameLength + extraFieldLength + fileCommentLength; @@ -109884,7 +109939,6 @@ const parseCentralDirectory = (buffer2) => { return entries; }; const OPEN_RETRY_LIMIT = 5; -const MAX_SAMPLE_SIZE_BYTES = 2048 * 1024 * 1024; class SampleNotFoundError extends Error { constructor(message2) { super(message2 || "Sample not found"); @@ -109894,14 +109948,27 @@ class SampleNotFoundError extends Error { } const openRemoteLogFile = async (api2, url, concurrency) => { const queue = new AsyncQueue(concurrency); + const logInfo = await api2.get_log_info(url); + const fetchContentLength = async (_url) => logInfo.size; + const directUrl = logInfo.direct_url; + const fetchBytes = async (_url, start2, end2) => { + if (directUrl) { + try { + return await fetchRange(directUrl, start2, end2); + } catch (e) { + console.warn("Direct URL fetch failed, falling back to proxy", e); + } + } + return api2.get_log_bytes(url, start2, end2); + }; let remoteZipFile = void 0; let retryCount = 0; while (!remoteZipFile && retryCount < OPEN_RETRY_LIMIT) { try { remoteZipFile = await openRemoteZipFile( url, - api2.get_log_size, - api2.get_log_bytes + fetchContentLength, + fetchBytes ); } catch { retryCount++; @@ -109918,20 +109985,13 @@ const openRemoteLogFile = async (api2, url, concurrency) => { `Failed to open remote log file at ${url} after ${OPEN_RETRY_LIMIT} attempts.` ); } - const readJSONFile = async (file, maxBytes, preprocessor2) => { + const readJSONFile = async (file, maxBytes, preprocessor2, onProgress) => { try { - let data = await remoteZipFile.readFile(file, maxBytes); + let data = await remoteZipFile.readFile(file, maxBytes, onProgress); if (preprocessor2) { data = preprocessor2.preprocess(data); } - const textDecoder = new TextDecoder("utf-8"); - const jsonString = textDecoder.decode(data); - if (data.length > 0 && jsonString.length === 0) { - throw new Error( - `Failed to decode ${file} (${(data.length / 1024 / 1024).toFixed(0)}MB). The file may be corrupted or contain invalid UTF-8 sequences.` - ); - } - return asyncJsonParse(jsonString); + return asyncJsonParseBytes(data); } catch (error2) { if (error2 instanceof FileSizeLimitError) { throw error2; @@ -109957,24 +110017,21 @@ const openRemoteLogFile = async (api2, url, concurrency) => { }; }); }; - const readSample = async (sampleId, epoch) => { + const readSample = async (sampleId, epoch, onProgress) => { const sampleFile = `samples/${sampleId}_epoch_${epoch}.json`; if (!remoteZipFile.centralDirectory.has(sampleFile)) { throw new SampleNotFoundError( `Unable to read sample file ${sampleFile} - it is not present in the manifest.` ); } - const entry = remoteZipFile.centralDirectory.get(sampleFile); - if (entry.uncompressedSize > MAX_SAMPLE_SIZE_BYTES) { - throw new FileSizeLimitError(sampleFile, MAX_SAMPLE_SIZE_BYTES); - } const eventsPreprocessor = { preprocess: clearLargeEventsArray }; return await readJSONFile( sampleFile, void 0, - eventsPreprocessor + eventsPreprocessor, + onProgress ); }; const readHeader = async () => { @@ -110044,9 +110101,6 @@ const openRemoteLogFile = async (api2, url, concurrency) => { results: header2.results, stats: header2.stats, error: header2.error, - tags: header2.tags, - metadata: header2.metadata, - log_updates: header2.log_updates, sampleSummaries }; return result2; @@ -110143,7 +110197,7 @@ const clientApi = (api2, log_file, debug2 = false) => { let pending_log_promise = null; const get_log_details = async (log_file2) => { if (isEvalFile(log_file2)) { - const remoteLogFile = await remoteEvalFile(log_file2); + const remoteLogFile = await remoteEvalFile(log_file2, true); if (remoteLogFile) { return await remoteLogFile.readLogSummary(); } else { @@ -110171,14 +110225,11 @@ const clientApi = (api2, log_file, debug2 = false) => { results: parsed.results, stats: parsed.stats, error: parsed.error, - tags: parsed.tags, - metadata: parsed.metadata, - log_updates: parsed.log_updates, sampleSummaries }; } }; - const get_log_sample = async (log_file2, id, epoch) => { + const get_log_sample = async (log_file2, id, epoch, onProgress) => { if (isEvalFile(log_file2)) { let handleError2 = function(error2) { if (error2 instanceof FileSizeLimitError) { @@ -110191,7 +110242,7 @@ const clientApi = (api2, log_file, debug2 = false) => { if (!remoteLogFile) { throw new Error(`Unable to read remote eval file ${log_file2}`); } - return await remoteLogFile.readSample(String(id), epoch); + return await remoteLogFile.readSample(String(id), epoch, onProgress); } try { return await fetchSample(true); @@ -110473,14 +110524,24 @@ const fetchLogFile = async (file) => { }); }; const fetchManifest = async (log_dir) => { - const parseListing = async (text2) => { - const parsed = await asyncJsonParse(text2); - return { raw: text2, parsed }; - }; - return await fetchFile( + const logs = await fetchFile( log_dir + "/listing.json", - parseListing + async (text2) => { + const parsed = await asyncJsonParse(text2); + return { + raw: text2, + parsed + }; + }, + (response) => { + if (response.status === 404) { + return true; + } else { + return false; + } + } ); + return logs; }; const fetchJsonFile = async (file, handleError2) => { return fetchFile( @@ -110596,8 +110657,9 @@ function staticHttpApiForLog(logInfo) { throw new Error(`"Unable to load eval log ${log_file}`); } }, - get_log_size: async (log_file) => { - return await fetchSize(log_file); + get_log_info: async (log_file) => { + const size = await fetchSize(log_file); + return { size }; }, get_log_bytes: async (log_file, start2, end2) => { return await fetchRange(log_file, start2, end2); @@ -110869,10 +110931,10 @@ function viewServerApi(options2 = {}) { ); return result2; }; - const get_log_size2 = async (file) => { + const get_log_info2 = async (file) => { const result2 = await requestApi.fetchString( "GET", - `/log-size/${encodeURIComponent(file)}` + `/log-info/${encodeURIComponent(file)}` ); return result2.parsed; }; @@ -111027,7 +111089,7 @@ function viewServerApi(options2 = {}) { get_eval_set: get_eval_set2, get_flow: get_flow2, get_log_contents: get_log_contents2, - get_log_size: get_log_size2, + get_log_info: get_log_info2, get_log_bytes: get_log_bytes2, get_log_summaries: get_log_summaries2, log_message: log_message2, @@ -111043,12 +111105,13 @@ const kMethodEvalLogDir = "eval_log_dir"; const kMethodEvalLogs = "eval_logs"; const kMethodEvalLogFiles = "eval_log_files"; const kMethodEvalLog = "eval_log"; -const kMethodEvalLogSize = "eval_log_size"; +const kMethodEvalLogInfo = "eval_log_info"; const kMethodEvalLogBytes = "eval_log_bytes"; const kMethodEvalLogHeaders = "eval_log_headers"; const kMethodPendingSamples = "eval_log_pending_samples"; const kMethodSampleData = "eval_log_sample_data"; const kMethodLogMessage = "log_message"; +const kJsonRpcMethodNotFound = -32601; const kJsonRpcVersion = "2.0"; function webViewJsonRpcClient(vscode2) { const target2 = { @@ -111181,8 +111244,16 @@ async function get_log_contents(log_file, headerOnly, capabilities2) { throw new Error(`Unable to load eval log ${log_file}.`); } } -async function get_log_size(log_file) { - return await vscodeClient(kMethodEvalLogSize, [log_file]); +async function get_log_info(log_file) { + try { + return await vscodeClient(kMethodEvalLogInfo, [log_file]); + } catch (e) { + if (e?.code === kJsonRpcMethodNotFound) { + const size = await vscodeClient("eval_log_size", [log_file]); + return { size }; + } + throw e; + } } async function get_log_bytes(log_file, start2, end2) { return await vscodeClient(kMethodEvalLogBytes, [log_file, start2, end2]); @@ -111265,7 +111336,7 @@ const api$1 = { get_eval_set, get_flow, get_log_contents, - get_log_size, + get_log_info, get_log_bytes, get_log_summaries, log_message, @@ -111319,7 +111390,7 @@ const documentFrame = "_documentFrame_1576h_1"; const documentFrameTitle = "_documentFrameTitle_1576h_9"; const downloadLink = "_downloadLink_1576h_16"; const imageDocument = "_imageDocument_1576h_21"; -const styles$1u = { +const styles$1y = { documentFrame, documentFrameTitle, downloadLink, @@ -111336,7 +111407,7 @@ const ContentDocumentView = ({ return /* @__PURE__ */ jsxRuntimeExports.jsx(ContentDocumentFrame, { document: document2, downloadable: canDownloadFiles, children: /* @__PURE__ */ jsxRuntimeExports.jsx( "img", { - className: clsx(styles$1u.imageDocument), + className: clsx(styles$1y.imageDocument), src: document2.document, alt: document2.filename, id @@ -111361,17 +111432,17 @@ const ContentDocumentFrame = ({ "div", { className: clsx( - styles$1u.documentFrame, + styles$1y.documentFrame, "text-size-small", "text-style-secondary" ), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1u.documentFrameTitle), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1y.documentFrameTitle), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(iconForMimeType(document2.mime_type)) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: downloadable ? /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { - className: clsx(styles$1u.downloadLink), + className: clsx(styles$1y.downloadLink), onClick: () => { api.download_file(document2.filename, document2.document); }, @@ -111385,7 +111456,7 @@ const ContentDocumentFrame = ({ ); }; const jsonMessage = "_jsonMessage_oxf8d_1"; -const styles$1t = { +const styles$1x = { jsonMessage }; const JsonMessageContent = ({ @@ -111398,7 +111469,7 @@ const JsonMessageContent = ({ { id, record: json, - className: clsx(styles$1t.jsonMessage, className2), + className: clsx(styles$1x.jsonMessage, className2), useBorders: false } ); @@ -111413,7 +111484,7 @@ const decodeHtmlEntities = (text2) => { }; const citations = "_citations_1ggvf_1"; const citationLink = "_citationLink_1ggvf_9"; -const styles$1s = { +const styles$1w = { citations, citationLink }; @@ -111421,7 +111492,7 @@ const MessageCitations = ({ citations: citations2 }) => { if (citations2.length === 0) { return void 0; } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1s.citations, "text-size-smallest"), children: citations2.map((citation, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1w.citations, "text-size-smallest"), children: citations2.map((citation, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: index + 1 }), /* @__PURE__ */ jsxRuntimeExports.jsx(MessageCitation, { citation }) ] }, index)) }); @@ -111441,7 +111512,7 @@ const UrlCitation = ({ href: citation.url, target: "_blank", rel: "noopener noreferrer", - className: clsx(styles$1s.citationLink), + className: clsx(styles$1w.citationLink), title: citation.cited_text ? `${citation.cited_text} ${citation.url}` : citation.url, children: children2 @@ -111450,7 +111521,7 @@ ${citation.url}` : citation.url, const OtherCitation = ({ children: children2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: children2 }); const contentImage = "_contentImage_srbm0_1"; const reasoning = "_reasoning_srbm0_6"; -const styles$1r = { +const styles$1v = { contentImage, reasoning }; @@ -111461,7 +111532,7 @@ const args = "_args_1792k_22"; const argLabel = "_argLabel_1792k_31"; const error$4 = "_error_1792k_35"; const toolPanel = "_toolPanel_1792k_40"; -const styles$1q = { +const styles$1u = { mcpToolUse, title: title$2, titleText, @@ -111482,23 +111553,23 @@ const McpToolUse = ({ id, content: content2, className: className2 }) => { const titleStr = content2.context ? `${content2.context} — ${content2.name}()` : `${content2.name}()`; const listToolsResult = maybeListTools(content2); const webSearchResult = maybeWebSearchResult(content2); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id, className: clsx(styles$1q.mcpToolUse, className2), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { id, className: clsx(styles$1u.mcpToolUse, className2), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { className: clsx( - styles$1q.title, + styles$1u.title, "text-size-small", "text-style-secondary" ), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.role.tool }), - /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1q.titleText, children: titleStr }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1q.type, children: content2.type }) + /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1u.titleText, children: titleStr }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1u.type, children: content2.type }) ] } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1q.args, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1u.args, children: [ Object.keys(args2).map((key2, index) => { const value2 = args2[key2]; let valueRecord = void 0; @@ -111517,7 +111588,7 @@ const McpToolUse = ({ id, content: content2, className: className2 }) => { }), webSearchResult ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(LabelDiv, { label: "results" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDiv, { children: webSearchResult.result.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1q.result, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx(ValueDiv, { children: webSearchResult.result.map((result2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1u.result, children: /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { href: result2.url, @@ -111532,7 +111603,7 @@ const McpToolUse = ({ id, content: content2, className: className2 }) => { { id: `${id}-output`, collapse: true, - className: clsx(styles$1q.toolPanel), + className: clsx(styles$1u.toolPanel), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(LabelDiv, { label: tool2.name }), /* @__PURE__ */ jsxRuntimeExports.jsxs(ValueDiv, { children: [ @@ -111550,7 +111621,7 @@ const McpToolUse = ({ id, content: content2, className: className2 }) => { } ) })) : void 0 ] }), - content2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1q.error, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ + content2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1u.error, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ "Error: ", content2.error ] }) }) : !listToolsResult && !webSearchResult ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small"), children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandablePanel, { id: `${id}-output`, collapse: true, children: /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -111607,7 +111678,7 @@ const LabelDiv = ({ label: label2 }) => { "div", { className: clsx( - styles$1q.argLabel, + styles$1u.argLabel, "text-style-secondary", "text-size-smaller" ), @@ -111629,7 +111700,7 @@ const toolImage = "_toolImage_h7uyp_1"; const output = "_output_h7uyp_6"; const textOutput = "_textOutput_h7uyp_10"; const textCode = "_textCode_h7uyp_19"; -const styles$1p = { +const styles$1t = { toolImage, output, textOutput, @@ -111645,15 +111716,13 @@ const ToolOutput = ({ output: output2, className: className2 }) => { const key2 = `tool-output-${idx}`; if (out.type === "text") { outputs.push(/* @__PURE__ */ jsxRuntimeExports.jsx(ToolTextOutput, { text: out.text }, key2)); - } else if (out.type === "document") { - outputs.push(/* @__PURE__ */ jsxRuntimeExports.jsx(ContentDocumentView, { id: key2, document: out }, key2)); } else { if (out.image.startsWith("data:")) { outputs.push( /* @__PURE__ */ jsxRuntimeExports.jsx( "img", { - className: clsx(styles$1p.toolImage), + className: clsx(styles$1t.toolImage), src: out.image }, key2 @@ -111669,7 +111738,7 @@ const ToolOutput = ({ output: output2, className: className2 }) => { /* @__PURE__ */ jsxRuntimeExports.jsx(ToolTextOutput, { text: String(output2) }, "tool-output-single") ); } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1p.output, className2), children: outputs }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1t.output, className2), children: outputs }); }; const ToolTextOutput = ({ text: text2 }) => { if (isJson(text2)) { @@ -111680,13 +111749,13 @@ const ToolTextOutput = ({ text: text2 }) => { return /* @__PURE__ */ jsxRuntimeExports.jsx( ANSIDisplay, { - className: styles$1p.ansiOutput, + className: styles$1t.ansiOutput, output: text2, style: { fontSize: "clamp(0.4rem, 1.15vw, 0.9rem)" } } ); } - return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1p.textOutput, "tool-output"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("sourceCode", styles$1p.textCode), children: text2.trim() }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1t.textOutput, "tool-output"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("sourceCode", styles$1t.textCode), children: text2.trim() }) }); }; const isMessageContent = (content2) => { return typeof content2 === "object" && content2 !== null && "type" in content2 && typeof content2.type === "string"; @@ -111745,14 +111814,15 @@ const MessageContent = ({ }; const messageRenderers = { text: { - render: (key2, content2, isLast, _context) => { + render: (key2, content2, isLast, context) => { const c2 = content2; const cites = c2.citations ?? []; if (!c2.text && !cites.length) { return void 0; } const purgeInternalContainers = (text2) => { - const internalTags = ["internal", "content-internal"]; + const isAssistantMessage = context.role === "assistant"; + const internalTags = !isAssistantMessage ? ["internal", "content-internal"] : ["internal", "content-internal", "think"]; internalTags.forEach((tag) => { const regex2 = new RegExp(`<${tag}[^>]*>[\\s\\S]*?<\\/${tag}>`, "gm"); text2 = text2.replace(regex2, ""); @@ -111794,7 +111864,7 @@ const messageRenderers = { } const renderReasoningCode = isOpenRouterReasoning(text2); const codeFormatted = renderReasoningCode ? JSON.stringify(jsonParse(text2), null, 2) : text2; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1r.reasoning, "text-size-small"), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1v.reasoning, "text-size-small"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { @@ -111817,7 +111887,7 @@ const messageRenderers = { render: (key2, content2, _isLast, _context) => { const c2 = content2; if (c2.image.startsWith("data:")) { - return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: c2.image, className: styles$1r.contentImage }, key2); + return /* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: c2.image, className: styles$1v.contentImage }, key2); } else { return /* @__PURE__ */ jsxRuntimeExports.jsx("code", { children: c2.image }, key2); } @@ -111944,17 +112014,6 @@ const isCitationWithRange = (citation) => Array.isArray(citation.cited_text); const isOpenRouterReasoning = (text2) => { return text2.startsWith("[{'format'"); }; -const substituteToolCallContent = (content2, args2) => { - const replace2 = (text2) => text2.replace( - /\{\{(\w+)\}\}/g, - (match2, key2) => Object.hasOwn(args2, key2) ? String(args2[key2]) : match2 - ); - return { - ...content2, - title: content2.title ? replace2(content2.title) : content2.title, - content: replace2(content2.content) - }; -}; const kToolTodoContentType = "agent/todo-list"; const resolveToolInput = (fn3, toolArgs) => { const toolName = fn3; @@ -112067,20 +112126,20 @@ const extractInput = (args2, inputDescriptor) => { } }; const toolCallView = "_toolCallView_l6wae_1"; -const styles$1o = { +const styles$1s = { toolCallView }; const outputPre = "_outputPre_1jznn_1"; const toolView = "_toolView_1jznn_7"; const outputCode = "_outputCode_1jznn_15"; -const styles$1n = { +const styles$1r = { outputPre, toolView, outputCode }; const todoList = "_todoList_1t8rx_1"; const inProgress = "_inProgress_1t8rx_9"; -const styles$1m = { +const styles$1q = { todoList, inProgress }; @@ -112100,7 +112159,7 @@ const toToolTodos = (obj) => { }; const TodoWriteInput = ({ contents: contents2, parentRef }) => { const todoItems = toToolTodos(contents2); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: parentRef, className: clsx(styles$1m.todoList), children: todoItems.map((todo) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: parentRef, className: clsx(styles$1q.todoList), children: todoItems.map((todo) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "i", @@ -112115,9 +112174,9 @@ const TodoWriteInput = ({ contents: contents2, parentRef }) => { "span", { className: clsx( - styles$1m.todoItem, + styles$1q.todoItem, "text-size-smallest", - todo.status === "in_progress" ? styles$1m.inProgress : void 0 + todo.status === "in_progress" ? styles$1q.inProgress : void 0 ), children: todo.content } @@ -112140,7 +112199,7 @@ const ToolInput = (props) => { { markdown: toolCallView2.content, ref: sourceCodeRef, - className: clsx("tool-output", styles$1n.toolView, className2) + className: clsx("tool-output", styles$1r.toolView, className2) } ); } else { @@ -112170,8 +112229,8 @@ const RenderTool = ({ { className: clsx( "tool-output", - styles$1n.outputPre, - styles$1n.bottomMargin, + styles$1r.outputPre, + styles$1r.bottomMargin, className2 ), children: /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -112181,7 +112240,7 @@ const RenderTool = ({ "source-code", "sourceCode", contentType ? `language-${contentType}` : void 0, - styles$1n.outputCode + styles$1r.outputCode ), children: formattedContent } @@ -112198,16 +112257,16 @@ const isValidView = (view) => { const image = "_image_1vcac_1"; const toolTitle = "_toolTitle_1vcac_6"; const description = "_description_1vcac_10"; -const styles$1l = { +const styles$1p = { image, toolTitle, description }; const ToolTitle = ({ title: title2, description: description2 }) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi", "bi-tools", styles$1l.image) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-small", styles$1l.toolTitle), children: title2 }), - description2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx(styles$1l.description, "text-size-smallest"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi", "bi-tools", styles$1p.image) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-small", styles$1p.toolTitle), children: title2 }), + description2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx(styles$1p.description, "text-size-smallest"), children: [ "- ", description2 ] }) : void 0 @@ -112256,7 +112315,7 @@ const ToolCallView = ({ }); const contents2 = mode !== "compact" ? input2 : input2 || functionCall; const context = defaultContext("tool"); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1o.toolCallView), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1s.toolCallView), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ mode !== "compact" && (!view || view.title) ? /* @__PURE__ */ jsxRuntimeExports.jsx( ToolTitle, @@ -112309,7 +112368,7 @@ const normalizeContent$1 = (output2) => { }; const content$1 = "_content_1b2jp_1"; const codeCompact = "_codeCompact_1b2jp_5"; -const styles$1k = { +const styles$1o = { content: content$1, codeCompact }; @@ -112340,7 +112399,7 @@ const MessageContents = ({ } const resolvedToolOutput = resolveToolMessage(toolMessage); if (toolCallStyle === "compact") { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { className: clsx(styles$1k.codeCompact), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("code", { className: clsx(styles$1o.codeCompact), children: [ "tool: ", functionCall ] }) }, `tool-call-${idx}`); @@ -112357,17 +112416,14 @@ const MessageContents = ({ contentType, output: resolvedToolOutput, collapsible: false, - view: tool_call.view ? substituteToolCallContent( - tool_call.view, - tool_call.arguments - ) : void 0 + view: tool_call.view ? tool_call.view : void 0 }, `tool-call-${idx}` ); } }); return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - message2.content && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1k.content, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: message2.content, context }) }), + message2.content && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1o.content, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MessageContent, { contents: message2.content, context }) }), toolCalls ] }); } else { @@ -112409,7 +112465,12 @@ const resolveToolMessage = (toolMessage) => { } ] }; - } else if (["text", "image", "document"].includes(con.type)) { + } else if (con.type === "text") { + return { + content: [con], + type: "tool" + }; + } else if (con.type === "image") { return { content: [con], type: "tool" @@ -112446,10 +112507,10 @@ const ChatMessage = reactExports.memo( className: clsx( message2.role, "text-size-base", - styles$1C.message, - message2.role === "system" ? styles$1C.systemRole : void 0, - message2.role === "user" ? styles$1C.userRole : void 0, - mouseOver ? styles$1C.hover : void 0 + styles$1G.message, + message2.role === "system" ? styles$1G.systemRole : void 0, + message2.role === "user" ? styles$1G.userRole : void 0, + mouseOver ? styles$1G.hover : void 0 ), onMouseEnter: () => setMouseOver(true), onMouseLeave: () => setMouseOver(false), @@ -112458,8 +112519,8 @@ const ChatMessage = reactExports.memo( "div", { className: clsx( - styles$1C.messageGrid, - message2.role === "tool" ? styles$1C.toolMessageGrid : void 0, + styles$1G.messageGrid, + message2.role === "tool" ? styles$1G.toolMessageGrid : void 0, "text-style-label" ), children: [ @@ -112471,11 +112532,11 @@ const ChatMessage = reactExports.memo( { icon: ApplicationIcons.link, value: toFullUrl(messageUrl), - className: clsx(styles$1C.copyLink) + className: clsx(styles$1G.copyLink) } ) : "" ] }), - message2.timestamp && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1C.timestamp, title: message2.timestamp, children: formatDateTime(new Date(message2.timestamp)) }) + message2.timestamp && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1G.timestamp, title: message2.timestamp, children: formatDateTime(new Date(message2.timestamp)) }) ] } ), @@ -112483,8 +112544,8 @@ const ChatMessage = reactExports.memo( "div", { className: clsx( - styles$1C.messageContents, - indented2 ? styles$1C.indented : void 0 + styles$1G.messageContents, + indented2 ? styles$1G.indented : void 0 ), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -112509,7 +112570,7 @@ const ChatMessage = reactExports.memo( LabeledValue, { label: "Metadata", - className: clsx(styles$1C.metadataLabel, "text-size-smaller"), + className: clsx(styles$1G.metadataLabel, "text-size-smaller"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RecordTree, { @@ -112528,18 +112589,18 @@ const ChatMessage = reactExports.memo( ); } ); -const grid$7 = "_grid_3x3ql_1"; +const grid$8 = "_grid_3x3ql_1"; const number$1 = "_number_3x3ql_10"; const user = "_user_3x3ql_14"; -const container$l = "_container_3x3ql_19"; -const styles$1j = { - grid: grid$7, +const container$m = "_container_3x3ql_19"; +const styles$1n = { + grid: grid$8, number: number$1, user, - container: container$l + container: container$m }; const ChatMessageRow = ({ - id, + parentName, number: number2, resolvedMessage, toolCallStyle, @@ -112553,9 +112614,9 @@ const ChatMessageRow = ({ "div", { className: clsx( - styles$1j.grid, - styles$1j.container, - highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1j.user : void 0 + styles$1n.grid, + styles$1n.container, + highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1n.user : void 0 ), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -112564,7 +112625,7 @@ const ChatMessageRow = ({ className: clsx( "text-size-smaller", "text-style-secondary", - styles$1j.number + styles$1n.number ), children: number2 } @@ -112572,7 +112633,7 @@ const ChatMessageRow = ({ /* @__PURE__ */ jsxRuntimeExports.jsx( ChatMessage, { - id: `${id}-chat-messages`, + id: `${parentName}-chat-messages`, message: resolvedMessage.message, toolMessages: resolvedMessage.toolMessages, indented: indented2, @@ -112589,15 +112650,15 @@ const ChatMessageRow = ({ "div", { className: clsx( - styles$1j.container, - styles$1j.simple, - highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1j.user : void 0 + styles$1n.container, + styles$1n.simple, + highlightUserMessage && resolvedMessage.message.role === "user" ? styles$1n.user : void 0 ), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ChatMessage, { - id: `${id}-chat-messages`, + id: `${parentName}-chat-messages`, message: resolvedMessage.message, toolMessages: resolvedMessage.toolMessages, indented: indented2, @@ -112708,11 +112769,10 @@ const ChatView = ({ }); const result2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(className2), children: collapsedMessages.map((msg, index) => { const number2 = collapsedMessages.length > 1 && numbered ? index + 1 : void 0; - const rowId = (id || "chat-view") + `-msg-${index}`; return /* @__PURE__ */ jsxRuntimeExports.jsx( ChatMessageRow, { - id: rowId, + parentName: id || "chat-view", number: number2, resolvedMessage: msg, indented: indented2, @@ -112763,7 +112823,7 @@ const query = "_query_seqs2_1"; const summary$3 = "_summary_seqs2_6"; const preWrap = "_preWrap_seqs2_10"; const preCompact = "_preCompact_seqs2_15"; -const styles$1i = { +const styles$1m = { query, summary: summary$3, preWrap, @@ -112881,7 +112941,7 @@ const contentRenderers = (renderObject) => { }; } else { return { - rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1i.preWrap, styles$1i.preCompact), children: rendered }) + rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$1m.preWrap, styles$1m.preCompact), children: rendered }) }; } } @@ -112930,7 +112990,7 @@ const contentRenderers = (renderObject) => { render: (_id, entry, _options) => { const results = []; results.push( - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1i.query, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1m.query, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.search }), " ", entry.value.query @@ -112942,7 +113002,7 @@ const contentRenderers = (renderObject) => { /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: result2.url, children: result2.url }) }) ); results.push( - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller", styles$1i.summary), children: result2.summary }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller", styles$1m.summary), children: result2.summary }) ); } ); @@ -112958,7 +113018,7 @@ const contentRenderers = (renderObject) => { }, render: (_id, entry, _options) => { return { - rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1i.preWrap, children: entry.value }) + rendered: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$1m.preWrap, children: entry.value }) }; } }, @@ -113050,7 +113110,7 @@ const circle = "_circle_1iagp_1"; const green = "_green_1iagp_12"; const red = "_red_1iagp_18"; const orange = "_orange_1iagp_24"; -const styles$1h = { +const styles$1l = { circle, green, red, @@ -113091,22 +113151,22 @@ const passFailScoreDescriptor = (values) => { return /* @__PURE__ */ jsxRuntimeExports.jsx( "span", { - className: clsx("text-size-small", styles$1h.circle, styles$1h.green), + className: clsx("text-size-small", styles$1l.circle, styles$1l.green), children: "C" } ); } else if (score2 === "I") { - return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1h.circle, styles$1h.red), children: "I" }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1l.circle, styles$1l.red), children: "I" }); } else if (score2 === "P") { return /* @__PURE__ */ jsxRuntimeExports.jsx( "span", { - className: clsx("text-size-small", styles$1h.circle, styles$1h.orange), + className: clsx("text-size-small", styles$1l.circle, styles$1l.orange), children: "P" } ); } else if (score2 === "N") { - return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1h.circle, styles$1h.red), children: "N" }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-small", styles$1l.circle, styles$1l.red), children: "N" }); } else { return String(score2); } @@ -113376,59 +113436,92 @@ const createEvalDescriptor = (scores2, samples) => { }; }; const createSamplesDescriptor = (samples, evalDescriptor, selectedScores) => { - const messageShape = samples.reduce( - (shape, sample2) => { - shape.inputSize = Math.min( - Math.max(shape.inputSize, inputString(sample2.input).join(" ").length), - 300 - ); - shape.targetSize = Math.min( - Math.max(shape.targetSize, arrayToString(sample2.target).length), - 300 - ); + const sizes = samples.reduce( + (previous, current2) => { + const text2 = inputString(current2.input).join(" "); + let answerLength = 0; if (selectedScores.length > 0) { - shape.answerSize = Math.min( - Math.max( - shape.answerSize, - evalDescriptor.scoreAnswer(sample2, selectedScores[0])?.length ?? 0 - ), - 300 - ); + selectedScores.forEach((scoreLabel, index) => { + const score2 = evalDescriptor.score(current2, scoreLabel); + const scoreValue = score2?.value; + const scoreText = scoreValue ? String(scoreValue) : current2.error ? errorType(current2.error) : ""; + const currentSize = Math.max( + scoreText.length, + scoreLabel.name.length + ); + previous.scores[index] = Math.max( + previous.scores[index] || 0, + currentSize + ); + }); + answerLength = evalDescriptor.scoreAnswer(current2, selectedScores[0])?.length || 0; + } else { + previous.scores = []; } - shape.idSize = Math.min( - 10, - Math.max(shape.idSize, String(sample2.id).length) + previous.input = Math.min(Math.max(previous.input, text2.length), 200); + previous.target = Math.min( + Math.max(previous.target, arrayToString(current2.target).length), + 300 ); - shape.limitSize = Math.min( - 10, - Math.max(shape.limitSize, sample2.limit ? sample2.limit.length : 0) + previous.answer = Math.min(Math.max(previous.answer, answerLength), 300); + previous.limit = Math.min( + Math.max(previous.limit, current2.limit ? current2.limit.length : 0), + 50 ); - shape.retriesSize = Math.min( - 10, + previous.retries = Math.min( Math.max( - shape.retriesSize, - sample2.retries ? String(sample2.retries).length : 0 - ) + previous.retries, + current2.retries ? String(current2.retries).length : 0 + ), + 50 ); - shape.errorSize = Math.min( - 10, - Math.max( - shape.errorSize, - sample2.error ? errorType(sample2.error).length : 0 - ) + previous.id = Math.min( + Math.max(previous.id, String(current2.id).length), + 10 ); - return shape; + return previous; }, { - idSize: 2, - inputSize: 0, - targetSize: 0, - answerSize: 0, - limitSize: 0, - retriesSize: 0, - errorSize: 0 + input: 0, + target: 0, + answer: 0, + limit: 0, + retries: 0, + id: 0, + scores: [] } ); + const totalScoreSizes = sizes.scores.reduce((sum2, size) => sum2 + size, 0); + const normalizedScoreSizes = totalScoreSizes > 0 ? sizes.scores.map((size) => Math.round(size / totalScoreSizes * 30)) : []; + const maxSizes = { + input: Math.min(sizes.input, 300), + target: Math.min(sizes.target, 300), + answer: Math.min(sizes.answer, 300), + limit: Math.min(sizes.limit, 50), + retries: Math.min(sizes.retries, 50), + id: Math.min(sizes.id, 10), + score: normalizedScoreSizes + }; + const base2 = maxSizes.input + maxSizes.target + maxSizes.answer + maxSizes.limit + maxSizes.retries + maxSizes.id + maxSizes.score.reduce((sum2, size) => { + return sum2 + size; + }, 0) || 1; + const inputNormalized = maxSizes.input / base2; + const targetNormalized = maxSizes.target / base2 > 0 ? Math.max(maxSizes.target / base2, inputNormalized / 10) : 0; + const answerNormalized = maxSizes.answer / base2 > 0 ? Math.max(maxSizes.answer / base2, inputNormalized / 10) : 0; + const messageShape = { + raw: sizes, + normalized: { + input: inputNormalized, + target: targetNormalized, + answer: answerNormalized, + limit: maxSizes.limit / base2, + retries: maxSizes.retries / base2, + id: maxSizes.id / base2, + scores: maxSizes.score.map((val) => { + return val / base2; + }) + } + }; const firstSelectedScore = selectedScores?.[0]; return { evalDescriptor, @@ -115864,7 +115957,6 @@ const MATH_FUNCTIONS = [ ["log10", "Base 10 logarithm"] ]; const SAMPLE_VARIABLES = [ - ["epoch", "The epoch (run) number of the sample"], ["has_error", "Checks if the sample has an error"], ["has_retries", "Checks if the sample has been retried"], [kSampleIdVariable, "The unique identifier of the sample"], @@ -115940,7 +116032,6 @@ const getNestedPropertyValue = (obj, path) => { }; const sampleVariables = (sample2) => { return { - epoch: sample2.epoch, has_error: !!sample2.error, has_retries: sample2.retries !== void 0 && sample2.retries > 0, id: sample2.id, @@ -116123,6 +116214,149 @@ const filterSamples = (evalDescriptor, samples, filterValue) => { }); return { result: result2, error: error2, allErrors: errorCount === samples.length }; }; +const flex = "_flex_1kye9_1"; +const label$a = "_label_1kye9_5"; +const styles$1k = { + flex, + label: label$a +}; +const SortFilter = ({ sort: sort2, setSort, epochs }) => { + const options2 = [ + { label: "sample asc", val: kSampleAscVal }, + { label: "sample desc", val: kSampleDescVal } + ]; + if (epochs > 1) { + options2.push({ + label: "epoch asc", + val: kEpochAscVal + }); + options2.push({ + label: "epoch desc", + val: kEpochDescVal + }); + } + options2.push({ + label: "score asc", + val: kScoreAscVal + }); + options2.push({ + label: "score desc", + val: kScoreDescVal + }); + const handleChange = reactExports.useCallback( + (e) => { + const sel = e.target; + setSort(sel.value); + }, + [setSort] + ); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1k.flex, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "span", + { + className: clsx( + "sort-filter-label", + "text-size-smaller", + "text-style-label", + "text-style-secondary", + styles$1k.label + ), + children: "Sort:" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "select", + { + className: clsx("form-select", "form-select-sm", "text-size-smaller"), + "aria-label": ".sort-filter-label", + value: sort2, + onChange: handleChange, + children: options2.map((option) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option.val, children: option.label }, option.val); + }) + } + ) + ] }); +}; +const byEpoch = (sort2) => { + return sort2 === kEpochAscVal || sort2 === kEpochDescVal; +}; +const bySample = (sort2) => { + return sort2 === kSampleAscVal || sort2 === kSampleDescVal; +}; +const sortId = (a, b) => { + if (isNumeric$1(a.id) && isNumeric$1(b.id)) { + return Number(a.id) - Number(b.id); + } else { + return String(a.id).localeCompare(String(b.id)); + } +}; +const sortSamples = (sort2, samples, samplesDescriptor, scores2) => { + const scoreDescriptors = scores2.map((score2) => samplesDescriptor.evalDescriptor.scoreDescriptor(score2)).filter((scoreDescriptor) => scoreDescriptor !== void 0); + const sortedSamples = samples.sort((a, b) => { + const aScores = scores2.map((score2) => samplesDescriptor.evalDescriptor.score(a, score2)).filter((score2) => score2 !== void 0); + const bScores = scores2.map((score2) => samplesDescriptor.evalDescriptor.score(b, score2)).filter((score2) => score2 !== void 0); + switch (sort2) { + case kSampleAscVal: { + const result2 = sortId(a, b); + if (result2 !== 0) { + return result2; + } else { + return a.epoch - b.epoch; + } + } + case kSampleDescVal: { + const result2 = sortId(b, a); + if (result2 !== 0) { + return result2; + } else { + return a.epoch - b.epoch; + } + } + case kEpochAscVal: { + const result2 = a.epoch - b.epoch; + if (result2 !== 0) { + return result2; + } else { + return sortId(a, b); + } + } + case kEpochDescVal: { + const result2 = b.epoch - a.epoch; + if (result2 !== 0) { + return result2; + } else { + return sortId(b, a); + } + } + case kScoreAscVal: { + if (aScores.length === 0 || bScores.length === 0 || scoreDescriptors.length === 0) { + return 0; + } + return aScores.reduce((cmp2, score2, index) => { + if (cmp2 !== 0) { + return cmp2; + } + return scoreDescriptors[index]?.compare(score2, bScores[index]); + }, 0); + } + case kScoreDescVal: { + if (aScores.length === 0 || bScores.length === 0 || scoreDescriptors.length === 0) { + return 0; + } + return bScores.reduce((cmp2, score2, index) => { + if (cmp2 !== 0) { + return cmp2; + } + return scoreDescriptors[index]?.compare(score2, aScores[index]); + }, 0); + } + default: + return 0; + } + }); + return sortedSamples; +}; const getScorersFromSamples = (samples) => { const scoreLabelsMap = /* @__PURE__ */ new Map(); for (const sample2 of samples) { @@ -116271,6 +116505,10 @@ const useFilteredSamples = () => { const clearFilterError = useStore( (state) => state.logActions.clearFilterError ); + const epoch = useStore((state) => state.log.epoch); + const sort2 = useStore((state) => state.log.sort); + const samplesDescriptor = useSampleDescriptor(); + const selectedScores = useSelectedScores(); return reactExports.useMemo(() => { const { result: result2, error: error2, allErrors } = evalDescriptor && filter ? filterSamples(evalDescriptor, sampleSummaries, filter) : { result: sampleSummaries, error: void 0, allErrors: false }; if (error2 && allErrors) { @@ -116278,26 +116516,44 @@ const useFilteredSamples = () => { } else { clearFilterError(); } - const filtered = error2 === void 0 || !allErrors ? result2 : sampleSummaries; - const sorted = [...filtered].sort((a, b) => { - let idCompare; - if (typeof a.id === "number" && typeof b.id === "number") { - idCompare = a.id - b.id; - } else { - idCompare = String(a.id).localeCompare(String(b.id)); - } - if (idCompare !== 0) return idCompare; - return a.epoch - b.epoch; - }); - return sorted; + const prefiltered = error2 === void 0 || !allErrors ? result2 : sampleSummaries; + const filtered = epoch && epoch !== "all" ? prefiltered.filter((sample2) => epoch === String(sample2.epoch)) : prefiltered; + const sorted = samplesDescriptor ? sortSamples(sort2, filtered, samplesDescriptor, selectedScores) : filtered; + return [...sorted]; }, [ evalDescriptor, sampleSummaries, filter, setFilterError, - clearFilterError + clearFilterError, + epoch, + sort2, + samplesDescriptor, + selectedScores ]); }; +const useGroupBy = () => { + const selectedLogDetails = useStore((state) => state.log.selectedLogDetails); + const sort2 = useStore((state) => state.log.sort); + const epoch = useStore((state) => state.log.epoch); + return reactExports.useMemo(() => { + const epochs = selectedLogDetails?.eval?.config?.epochs || 1; + if (epochs > 1) { + if (byEpoch(sort2) || epoch !== "all") { + return "epoch"; + } else if (bySample(sort2)) { + return "sample"; + } + } + return "none"; + }, [selectedLogDetails, sort2, epoch]); +}; +const useGroupByOrder = () => { + const sort2 = useStore((state) => state.log.sort); + return reactExports.useMemo(() => { + return sort2 === kSampleAscVal || sort2 === kEpochAscVal || sort2 === kScoreAscVal ? "asc" : "desc"; + }, [sort2]); +}; const useSelectedSampleSummary = () => { const sampleSummaries = useSampleSummaries(); const selectedSampleHandle = useStore( @@ -116311,7 +116567,7 @@ const useSelectedSampleSummary = () => { }, [selectedSampleHandle, sampleSummaries]); }; const useSampleData = () => { - const sampleStatus2 = useStore((state) => state.sample.sampleStatus); + const sampleStatus = useStore((state) => state.sample.sampleStatus); const sampleError = useStore((state) => state.sample.sampleError); const getSelectedSample = useStore( (state) => state.sampleActions.getSelectedSample @@ -116324,24 +116580,27 @@ const useSampleData = () => { const runningEvents = useStore( (state) => state.sample.runningEvents ); + const downloadProgress = useStore((state) => state.sample.downloadProgress); return reactExports.useMemo(() => { return { selectedSampleIdentifier, - status: sampleStatus2, + status: sampleStatus, sampleNeedsReload, error: sampleError, getSelectedSample, eventsCleared, - running: runningEvents + running: runningEvents, + downloadProgress }; }, [ - sampleStatus2, + sampleStatus, sampleError, getSelectedSample, selectedSampleIdentifier, sampleNeedsReload, eventsCleared, - runningEvents + runningEvents, + downloadProgress ]); }; const useSampleInvalidation = () => { @@ -116725,7 +116984,7 @@ function useClientEvents() { } const button$3 = "_button_1bbut_1"; const viewerOptions$1 = "_viewerOptions_1bbut_7"; -const styles$1g = { +const styles$1j = { button: button$3, viewerOptions: viewerOptions$1 }; @@ -116745,14 +117004,14 @@ const FlowButton = reactExports.forwardRef( { ref, type: "button", - className: clsx(styles$1g.button), + className: clsx(styles$1j.button), onClick: navigate, title: "View Flow configuration for this directory", children: /* @__PURE__ */ jsxRuntimeExports.jsx( "i", { ref, - className: clsx(ApplicationIcons.flow, styles$1g.viewerOptions) + className: clsx(ApplicationIcons.flow, styles$1j.viewerOptions) } ) } @@ -116773,31 +117032,39 @@ const useFlowServerData = (dir) => { } }, [dir, flowDir, api2, updateFlowData]); }; -const wrapper$3 = "_wrapper_1tajk_1"; -const container$k = "_container_1tajk_12"; -const animate = "_animate_1tajk_21"; -const styles$1f = { - wrapper: wrapper$3, - container: container$k, - animate +const wrapper$4 = "_wrapper_44dmw_1"; +const container$l = "_container_44dmw_12"; +const animate = "_animate_44dmw_21"; +const determinate = "_determinate_44dmw_31"; +const styles$1i = { + wrapper: wrapper$4, + container: container$l, + animate, + determinate }; -const ActivityBar = ({ animating }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1f.wrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx( +const ActivityBar = ({ animating, progress: progress2 }) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1i.wrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$1f.container), + className: clsx(styles$1i.container), role: "progressbar", "aria-label": "Progress bar", - "aria-valuenow": 25, + "aria-valuenow": progress2 !== void 0 ? Math.round(progress2 * 100) : void 0, "aria-valuemin": 0, "aria-valuemax": 100, - children: animating && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1f.animate }) + children: animating && (progress2 !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx( + "div", + { + className: styles$1i.determinate, + style: { width: `${progress2 * 100}%` } + } + ) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1i.animate })) } ) }); }; const button$2 = "_button_1bbut_1"; const viewerOptions = "_viewerOptions_1bbut_7"; -const styles$1e = { +const styles$1h = { button: button$2, viewerOptions }; @@ -116810,14 +117077,14 @@ const ViewerOptionsButton = reactExports.forwardRef(({ showing, setShowing }, re { ref, type: "button", - className: clsx(styles$1e.button), + className: clsx(styles$1h.button), onClick: toggleShowing, title: "Viewer information and options", children: /* @__PURE__ */ jsxRuntimeExports.jsx( "i", { ref, - className: clsx(ApplicationIcons.info, styles$1e.viewerOptions) + className: clsx(ApplicationIcons.info, styles$1h.viewerOptions) } ) } @@ -118695,7 +118962,7 @@ const PopOver = ({ } return popperContent; }; -const container$j = "_container_e3s30_1"; +const container$k = "_container_e3s30_1"; const fullWidth$2 = "_fullWidth_e3s30_9"; const fullWidthPadded = "_fullWidthPadded_e3s30_13"; const spacer$1 = "_spacer_e3s30_18"; @@ -118704,8 +118971,8 @@ const clearButton = "_clearButton_e3s30_52"; const message$2 = "_message_e3s30_56"; const messageSuccess = "_messageSuccess_e3s30_64"; const messageError = "_messageError_e3s30_69"; -const styles$1d = { - container: container$j, +const styles$1g = { + container: container$k, fullWidth: fullWidth$2, fullWidthPadded, spacer: spacer$1, @@ -118756,32 +119023,32 @@ const ViewerOptionsPopover = ({ hoverDelay: -1, offset: [-10, 5], showArrow: false, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1d.container, "text-size-smaller"), children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1g.container, "text-size-smaller"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( "text-style-label", "text-style-secondary", - styles$1d.fullWidth + styles$1g.fullWidth ), children: "Log Directory" } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.fullWidth, styles$1d.fullWidthPadded), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1d.logDir, children: logDir2 }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1g.fullWidth, styles$1g.fullWidthPadded), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1g.logDir, children: logDir2 }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1g.spacer) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Version" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.199-0-gffdb82c59" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: "0.3.188b2-7-gdbe60681" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Schema" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: DB_VERSION }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1g.spacer) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Logs" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.logCount || 0 }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Log Previews" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.previewCount || 0 }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Log Details" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(), children: dbStats?.detailsCount || 0 }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.spacer) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1g.spacer) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Tools" }), /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(), children: [ " ", @@ -118794,7 +119061,7 @@ const ViewerOptionsPopover = ({ "btn", "btn-tools", "text-size-smallest", - styles$1d.clearButton + styles$1g.clearButton ), children: isClearing ? "Clearing..." : "Clear Local Database" } @@ -118804,9 +119071,9 @@ const ViewerOptionsPopover = ({ "div", { className: clsx( - styles$1d.fullWidth, - styles$1d.message, - clearMessage.includes("success") ? styles$1d.messageSuccess : styles$1d.messageError + styles$1g.fullWidth, + styles$1g.message, + clearMessage.includes("success") ? styles$1g.messageSuccess : styles$1g.messageError ), children: clearMessage } @@ -118815,7 +119082,7 @@ const ViewerOptionsPopover = ({ } ); }; -const header$1 = "_header_1u3sd_1"; +const header$2 = "_header_1u3sd_1"; const bordered = "_bordered_1u3sd_11"; const breadcrumbs = "_breadcrumbs_1u3sd_15"; const ellipsis = "_ellipsis_1u3sd_26"; @@ -118823,8 +119090,8 @@ const left$1 = "_left_1u3sd_31"; const right$1 = "_right_1u3sd_41"; const toolbarButton = "_toolbarButton_1u3sd_50"; const pathContainer = "_pathContainer_1u3sd_58"; -const styles$1c = { - header: header$1, +const styles$1f = { + header: header$2, bordered, breadcrumbs, ellipsis, @@ -118924,14 +119191,8 @@ const Navbar = ({ breadcrumbsEnabled }) => { const logDir2 = useStore((state) => state.logs.logDir); - const displayDir = logDir2 === "." ? basename( - window.location.pathname.substring( - 0, - window.location.pathname.lastIndexOf("/") - ) - ) : logDir2 || ""; - const baseLogDir = dirname(displayDir); - const baseLogName = basename(displayDir); + const baseLogDir = dirname(logDir2 || ""); + const baseLogName = basename(logDir2 || ""); const pathContainerRef = reactExports.useRef(null); const backUrl = fnNavigationUrl( ensureTrailingSlash(dirname(currentPath || "")), @@ -118965,30 +119226,30 @@ const Navbar = ({ className: clsx( "text-size-smaller", "header-nav", - styles$1c.header, - bordered2 === false ? null : styles$1c.bordered + styles$1f.header, + bordered2 === false ? null : styles$1f.bordered ), "aria-label": "breadcrumb", "data-unsearchable": true, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1c.left), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: backUrl, className: clsx(styles$1c.toolbarButton), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.navbar.back) }) }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1f.left), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: backUrl, className: clsx(styles$1f.toolbarButton), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.navbar.back) }) }), /* @__PURE__ */ jsxRuntimeExports.jsx( Link, { to: fnNavigationUrl("", logDir2), - className: clsx(styles$1c.toolbarButton), + className: clsx(styles$1f.toolbarButton), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.navbar.home) }) } ), - breadcrumbsEnabled !== false && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1c.pathContainer), ref: pathContainerRef, children: logDir2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx("breadcrumb", styles$1c.breadcrumbs), children: visibleSegments?.map((segment2, index) => { + breadcrumbsEnabled !== false && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1f.pathContainer), ref: pathContainerRef, children: logDir2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("ol", { className: clsx("breadcrumb", styles$1f.breadcrumbs), children: visibleSegments?.map((segment2, index) => { const isLast = index === visibleSegments.length - 1; const shouldShowEllipsis = showEllipsis && index === 1 && visibleSegments.length >= 2; return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ shouldShowEllipsis && /* @__PURE__ */ jsxRuntimeExports.jsx( "li", { - className: clsx("breadcrumb-item", styles$1c.ellipsis), + className: clsx("breadcrumb-item", styles$1f.ellipsis), children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "..." }) } ), @@ -118996,17 +119257,17 @@ const Navbar = ({ "li", { className: clsx( - styles$1c.pathLink, + styles$1f.pathLink, "breadcrumb-item", isLast ? "active" : void 0 ), - children: segment2.url && !isLast ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: segment2.url, children: segment2.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1c.pathSegment), children: segment2.text }) + children: segment2.url && !isLast ? /* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: segment2.url, children: segment2.text }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$1f.pathSegment), children: segment2.text }) } ) ] }, index); }) }) : "" }) ] }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1c.right), children: children2 }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1f.right), children: children2 }) ] } ); @@ -119016,27 +119277,34 @@ const ApplicationNavbar = ({ fnNavigationUrl, bordered: bordered2, children: children2, - showActivity = "log", + showActivity = "all", breadcrumbsEnabled }) => { const optionsRef = reactExports.useRef(null); const loading = useStore((state) => state.app.status.loading); - const sampleStatus2 = useStore((state) => state.sample.sampleStatus); + const sampleStatus = useStore((state) => state.sample.sampleStatus); + const downloadProgress = useStore((state) => state.sample.downloadProgress); const isShowing = useStore((state) => state.app.dialogs.options); const setShowing = useStore( (state) => state.appActions.setShowingOptionsDialog ); const hasActivity = reactExports.useMemo(() => { if (showActivity === "all") { - return !!loading || sampleStatus2 === "loading"; + return !!loading || sampleStatus === "loading"; } else if (showActivity === "log") { - return !!loading; + return !!loading || sampleStatus === "loading"; } else if (showActivity === "sample") { - return sampleStatus2 === "loading"; + return sampleStatus === "loading"; } else { return false; } - }, [showActivity, loading, sampleStatus2]); + }, [showActivity, loading, sampleStatus]); + const sampleProgress = reactExports.useMemo(() => { + if (sampleStatus === "loading" && downloadProgress && downloadProgress.bytesTotal > 0) { + return downloadProgress.bytesLoaded / downloadProgress.bytesTotal; + } + return void 0; + }, [sampleStatus, downloadProgress]); return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( Navbar, @@ -119066,11 +119334,11 @@ const ApplicationNavbar = ({ ] } ), - /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: hasActivity }) + /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: hasActivity, progress: sampleProgress }) ] }); }; const navbarButton = "_navbarButton_1gksz_1"; -const styles$1b = { +const styles$1e = { navbarButton }; const NavbarButton = reactExports.forwardRef( @@ -119080,7 +119348,7 @@ const NavbarButton = reactExports.forwardRef( { ref, label: label2, - className: clsx(className2, styles$1b.navbarButton), + className: clsx(className2, styles$1e.navbarButton), icon: icon2, latched: latched2, ...rest @@ -119091,11 +119359,11 @@ const NavbarButton = reactExports.forwardRef( NavbarButton.displayName = "NavbarButton"; const rootControl = "_rootControl_mhb7y_1"; const segment = "_segment_mhb7y_9"; -const selected$3 = "_selected_mhb7y_9"; -const styles$1a = { +const selected$4 = "_selected_mhb7y_9"; +const styles$1d = { rootControl, segment, - selected: selected$3 + selected: selected$4 }; const SegmentedControl = ({ segments: segments2, @@ -119111,13 +119379,13 @@ const SegmentedControl = ({ if (selectedId === void 0) { selectedId = segments2[0]?.id; } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1a.rootControl), children: segments2.map((segment2, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$1d.rootControl), children: segments2.map((segment2, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs( "button", { className: clsx( - styles$1a.segment, + styles$1d.segment, { - [styles$1a.selected]: selectedId === segment2.id + [styles$1d.selected]: selectedId === segment2.id }, "text-size-smallest", "text-style-secondary" @@ -119162,7 +119430,7 @@ const ViewSegmentedControl = ({ ); }; const checkboxWrapper = "_checkboxWrapper_vtlwq_1"; -const label$8 = "_label_vtlwq_5"; +const label$9 = "_label_vtlwq_5"; const checkbox = "_checkbox_vtlwq_1"; const filterIcon = "_filterIcon_vtlwq_16"; const scrollableContainer = "_scrollableContainer_vtlwq_21"; @@ -119171,9 +119439,9 @@ const headerRow = "_headerRow_vtlwq_30"; const buttonContainer = "_buttonContainer_vtlwq_39"; const button$1 = "_button_vtlwq_39"; const columnsLayout = "_columnsLayout_vtlwq_54"; -const styles$19 = { +const styles$1c = { checkboxWrapper, - label: label$8, + label: label$9, checkbox, filterIcon, scrollableContainer, @@ -119256,20 +119524,20 @@ const ColumnSelectorPopover = ({ return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: styles$19.checkboxWrapper, + className: styles$1c.checkboxWrapper, title: hasFilter ? "Unselecting will remove an active filter on this column" : void 0, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$19.label, children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: styles$1c.label, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "input", { type: "checkbox", checked: currentVisibility[field], onChange: () => handleToggle(field), - className: styles$19.checkbox + className: styles$1c.checkbox } ), /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: col.headerName || field }), - hasFilter && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${ApplicationIcons.filter} ${styles$19.filterIcon}` }) + hasFilter && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${ApplicationIcons.filter} ${styles$1c.filterIcon}` }) ] }) }, field @@ -119285,16 +119553,16 @@ const ColumnSelectorPopover = ({ placement: "bottom-start", showArrow: false, hoverDelay: -1, - className: styles$19.popover, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$19.scrollableContainer, "text-size-small"), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$19.section), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$19.headerRow, children: [ + className: styles$1c.popover, + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1c.scrollableContainer, "text-size-small"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1c.section), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1c.headerRow, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Base" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$19.buttonContainer, "text-size-small"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1c.buttonContainer, "text-size-small"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { - className: clsx(styles$19.button, "text-size-small"), + className: clsx(styles$1c.button, "text-size-small"), onClick: handleSelectAllBase, children: "All" } @@ -119303,23 +119571,23 @@ const ColumnSelectorPopover = ({ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { - className: clsx(styles$19.button), + className: clsx(styles$1c.button), onClick: handleDeselectAllBase, children: "None" } ) ] }) ] }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$19.columnsLayout, children: columnGroups.base.map((col) => renderColumnCheckbox(col)) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.columnsLayout, children: columnGroups.base.map((col) => renderColumnCheckbox(col)) }) ] }), columnGroups.scores.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$19.headerRow, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1c.headerRow, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("b", { children: "Scorers" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$19.buttonContainer, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1c.buttonContainer, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { - className: clsx(styles$19.button), + className: clsx(styles$1c.button), onClick: handleSelectAllScores, children: "All" } @@ -119328,14 +119596,14 @@ const ColumnSelectorPopover = ({ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { - className: clsx(styles$19.button), + className: clsx(styles$1c.button), onClick: handleDeselectAllScores, children: "None" } ) ] }) ] }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$19.columnsLayout, children: columnGroups.scores.map((col) => renderColumnCheckbox(col)) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1c.columnsLayout, children: columnGroups.scores.map((col) => renderColumnCheckbox(col)) }) ] }) ] }) } @@ -119382,43 +119650,43 @@ const comparators = { return timeA - timeB; } }; -const gridWrapper = "_gridWrapper_anqm2_5"; -const gridContainer = "_gridContainer_anqm2_11"; -const iconCell = "_iconCell_anqm2_19"; -const numberCell = "_numberCell_anqm2_33"; -const taskText = "_taskText_anqm2_43"; -const folder = "_folder_anqm2_50"; -const fullWidthHeight = "_fullWidthHeight_anqm2_56"; -const styles$18 = { +const gridWrapper = "_gridWrapper_oveew_5"; +const gridContainer = "_gridContainer_oveew_11"; +const iconCell = "_iconCell_oveew_19"; +const numberCell = "_numberCell_oveew_32"; +const taskText = "_taskText_oveew_42"; +const folder = "_folder_oveew_49"; +const styles$1b = { gridWrapper, gridContainer, iconCell, numberCell, taskText, - folder, - fullWidthHeight -}; -const nameCell = "_nameCell_1jtud_1"; -const modelCell = "_modelCell_1jtud_8"; -const scoreCell = "_scoreCell_1jtud_15"; -const error$3 = "_error_1jtud_22"; -const started = "_started_1jtud_26"; -const success$1 = "_success_1jtud_30"; -const cancelled$1 = "_cancelled_1jtud_34"; -const statusCell$1 = "_statusCell_1jtud_38"; -const dateCell = "_dateCell_1jtud_45"; + folder +}; +const nameCell = "_nameCell_eaf0a_1"; +const modelCell = "_modelCell_eaf0a_8"; +const scoreCell = "_scoreCell_eaf0a_15"; +const error$3 = "_error_eaf0a_22"; +const started = "_started_eaf0a_26"; +const success = "_success_eaf0a_30"; +const cancelled = "_cancelled_eaf0a_34"; +const statusCell = "_statusCell_eaf0a_38"; +const dateCell = "_dateCell_eaf0a_44"; +const fastButton = "_fastButton_eaf0a_51"; const localStyles = { nameCell, modelCell, scoreCell, error: error$3, started, - success: success$1, - cancelled: cancelled$1, - statusCell: statusCell$1, - dateCell + success, + cancelled, + statusCell, + dateCell, + fastButton }; -const styles$17 = { ...styles$18, ...localStyles }; +const styles$1a = { ...styles$1b, ...localStyles }; const EmptyCell = () => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "-" }); const useLogListColumns = () => { const columnVisibility = useStore( @@ -119427,6 +119695,7 @@ const useLogListColumns = () => { const setColumnVisibility = useStore( (state) => state.logsActions.setLogsColumnVisibility ); + const navigate = useNavigate(); const logDetails = useStore((state) => state.logs.logDetails); const scorerMap = reactExports.useMemo(() => { const scoreTypes = {}; @@ -119478,7 +119747,7 @@ const useLogListColumns = () => { cellRenderer: (params) => { const type = params.data?.type; const icon2 = type === "file" || type === "pending-task" ? ApplicationIcons.inspectFile : ApplicationIcons.folder; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.iconCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2) }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.iconCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2) }) }); } }, { @@ -119504,7 +119773,7 @@ const useLogListColumns = () => { if (item2.type === "file") { value2 = item2.task || parseLogFileName(item2.name).name; } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.nameCell, children: item2.type === "folder" && item2.url ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$17.folder, children: value2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$17.taskText, children: value2 }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.nameCell, children: item2.type === "folder" && item2.url ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1a.folder, children: value2 }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$1a.taskText, children: value2 }) }); } }, { @@ -119520,7 +119789,7 @@ const useLogListColumns = () => { const item2 = params.data; if (!item2) return null; if (item2.model) { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.modelCell, children: item2.model }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.modelCell, children: item2.model }); } return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } @@ -119543,7 +119812,7 @@ const useLogListColumns = () => { if (!item2 || item2.score === void 0) { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.scoreCell, children: formatPrettyDecimal(item2.score) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.scoreCell, children: formatPrettyDecimal(item2.score) }); } }, { @@ -119563,8 +119832,8 @@ const useLogListColumns = () => { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } const icon2 = item2.type === "pending-task" ? ApplicationIcons.pendingTask : status2 === "error" ? ApplicationIcons.error : status2 === "started" ? ApplicationIcons.running : status2 === "cancelled" ? ApplicationIcons.cancelled : ApplicationIcons.success; - const clz = item2.type === "pending-task" ? styles$17.started : status2 === "error" ? styles$17.error : status2 === "started" ? styles$17.started : status2 === "cancelled" ? styles$17.cancelled : styles$17.success; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.statusCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, clz) }) }); + const clz = item2.type === "pending-task" ? styles$1a.started : status2 === "error" ? styles$1a.error : status2 === "started" ? styles$1a.started : status2 === "cancelled" ? styles$1a.cancelled : styles$1a.success; + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.statusCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, clz) }) }); } }, { @@ -119593,7 +119862,7 @@ const useLogListColumns = () => { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } const timeStr = formatDateTime(new Date(completed)); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.dateCell, children: timeStr }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.dateCell, children: timeStr }); }, comparator: createFolderFirstComparator(comparators.date) }, @@ -119616,7 +119885,25 @@ const useLogListColumns = () => { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } const value2 = basename(item2.name); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.nameCell, children: value2 }); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$1a.nameCell, children: [ + value2, + item2.fastUrl && /* @__PURE__ */ jsxRuntimeExports.jsx( + "button", + { + className: styles$1a.fastButton, + onClick: (e) => { + e.stopPropagation(); + const openInNewWindow = e.metaKey || e.ctrlKey || e.shiftKey; + if (openInNewWindow) { + window.open(`#${item2.fastUrl}`, "_blank"); + } else { + navigate(item2.fastUrl); + } + }, + children: "fast" + } + ) + ] }); } } ]; @@ -119646,7 +119933,7 @@ const useLogListColumns = () => { if (value2 === void 0 || value2 === null || value2 === "") { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyCell, {}); } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.scoreCell, children: formatPrettyDecimal(value2) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1a.scoreCell, children: formatPrettyDecimal(value2) }); }, comparator: createFolderFirstComparator((valA, valB) => { if (typeof valA === "number" && typeof valB === "number") { @@ -119658,7 +119945,7 @@ const useLogListColumns = () => { } ); return [...baseColumns, ...scorerColumns]; - }, [scorerMap]); + }, [scorerMap, navigate]); const columns = reactExports.useMemo(() => { const columnsWithVisibility = allColumns.map((col) => { const field = getFieldKey(col); @@ -122594,7 +122881,7 @@ function createColumn(beans, primaryColumns, colDef, existingColsCopy, columnKey beans.dataTypeSvc?.addColumnListeners(column2); return column2; } -function updateSomeColumnState(beans, column2, hide2, sort2, sortIndex, pinned, flex, source2) { +function updateSomeColumnState(beans, column2, hide2, sort2, sortIndex, pinned, flex2, source2) { const { sortSvc, pinnedCols, colFlex } = beans; if (hide2 !== void 0) { column2.setVisible(!hide2, source2); @@ -122608,8 +122895,8 @@ function updateSomeColumnState(beans, column2, hide2, sort2, sortIndex, pinned, if (pinned !== void 0) { pinnedCols?.setColPinned(column2, pinned); } - if (flex !== void 0) { - colFlex?.setColFlex(column2, flex); + if (flex2 !== void 0) { + colFlex?.setColFlex(column2, flex2); } } function _updateColumnState(beans, column2, colDef, source2) { @@ -122879,7 +123166,7 @@ function _applyColumnState(beans, params, source2) { return; } const getValue = getValueFactory(stateItem, params.defaultState); - const flex = getValue("flex").value1; + const flex2 = getValue("flex").value1; updateSomeColumnState( beans, column2, @@ -122887,10 +123174,10 @@ function _applyColumnState(beans, params, source2) { getValue("sort").value1, getValue("sortIndex").value1, getValue("pinned").value1, - flex, + flex2, source2 ); - if (flex == null) { + if (flex2 == null) { const width = getValue("width").value1; if (width != null) { const minColWidth = column2.getColDef().minWidth ?? environment.getDefaultColumnMinWidth(); @@ -123151,7 +123438,7 @@ function getColumnStateFromColDef(column2) { const hide2 = getValueOrNull(colDef.hide, colDef.initialHide); const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned); const width = getValueOrNull(colDef.width, colDef.initialWidth); - const flex = getValueOrNull(colDef.flex, colDef.initialFlex); + const flex2 = getValueOrNull(colDef.flex, colDef.initialFlex); let rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex); let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup); if (rowGroupIndex == null && !rowGroup) { @@ -123172,7 +123459,7 @@ function getColumnStateFromColDef(column2) { hide: hide2, pinned, width, - flex, + flex: flex2, rowGroup, rowGroupIndex, pivot, @@ -140794,20 +141081,20 @@ var ColumnMoveService = class extends BeanStub { this.beanName = "colMoves"; } moveColumnByIndex(fromIndex, toIndex, source2) { - const gridColumns = this.beans.colModel.getCols(); - if (!gridColumns) { + const gridColumns2 = this.beans.colModel.getCols(); + if (!gridColumns2) { return; } - const column2 = gridColumns[fromIndex]; + const column2 = gridColumns2[fromIndex]; this.moveColumns([column2], toIndex, source2); } moveColumns(columnsToMoveKeys, toIndex, source2, finished = true) { const { colModel, colAnimation, visibleCols, eventSvc } = this.beans; - const gridColumns = colModel.getCols(); - if (!gridColumns) { + const gridColumns2 = colModel.getCols(); + if (!gridColumns2) { return; } - if (toIndex > gridColumns.length - columnsToMoveKeys.length) { + if (toIndex > gridColumns2.length - columnsToMoveKeys.length) { _warn(30, { toIndex }); return; } @@ -140865,8 +141152,8 @@ var ColumnMoveService = class extends BeanStub { return true; } getProposedColumnOrder(columnsToMove, toIndex) { - const gridColumns = this.beans.colModel.getCols(); - const proposedColumnOrder = gridColumns.slice(); + const gridColumns2 = this.beans.colModel.getCols(); + const proposedColumnOrder = gridColumns2.slice(); _moveInArray(proposedColumnOrder, columnsToMove, toIndex); return proposedColumnOrder; } @@ -142993,13 +143280,13 @@ var ColumnFlexService = class extends BeanStub { } let hasFlexItems = false; const items = visibleCenterCols.map((col, i) => { - const flex = col.getFlex(); - const isFlex = flex != null && flex > 0 && i > flexAfterDisplayIndex; + const flex2 = col.getFlex(); + const isFlex = flex2 != null && flex2 > 0 && i > flexAfterDisplayIndex; hasFlexItems || (hasFlexItems = isFlex); return { col, isFlex, - flex: Math.max(0, flex ?? 0), + flex: Math.max(0, flex2 ?? 0), initialSize: col.getActualWidth(), min: col.getMinWidth(), max: col.getMaxWidth(), @@ -143093,17 +143380,17 @@ var ColumnFlexService = class extends BeanStub { } } initCol(column2) { - const { flex, initialFlex } = column2.colDef; - if (flex !== void 0) { - column2.flex = flex; + const { flex: flex2, initialFlex } = column2.colDef; + if (flex2 !== void 0) { + column2.flex = flex2; } else if (initialFlex !== void 0) { column2.flex = initialFlex; } } // this method should only be used by the colModel to // change flex when required by the applyColumnState method. - setColFlex(column2, flex) { - column2.flex = flex ?? null; + setColFlex(column2, flex2) { + column2.flex = flex2 ?? null; column2.dispatchStateUpdatedEvent("flex"); } }; @@ -157198,7 +157485,7 @@ function convertColumnState(columnState, enablePivotMode = false) { pinned, hide: hide2, width, - flex + flex: flex2 } = columnState[i]; columns.push(colId); if (sort2) { @@ -157219,8 +157506,8 @@ function convertColumnState(columnState, enablePivotMode = false) { if (hide2) { hiddenColIds.push(colId); } - if (flex != null || width) { - columnSizes.push({ colId, flex: flex ?? void 0, width }); + if (flex2 != null || width) { + columnSizes.push({ colId, flex: flex2 ?? void 0, width }); } } return { @@ -159681,8 +159968,8 @@ var ColumnFilterService = class extends BeanStub { return !isSameComponentClass; } hasFloatingFilters() { - const gridColumns = this.beans.colModel.getCols(); - return gridColumns.some((col) => col.getColDef().floatingFilter); + const gridColumns2 = this.beans.colModel.getCols(); + return gridColumns2.some((col) => col.getColDef().floatingFilter); } getFilterInstance(key2) { const column2 = this.beans.colModel.getColDefCol(key2); @@ -170506,9 +170793,9 @@ var StateService = class extends BeanStub { } const shouldSetColumnSizingState = shouldSetState("columnSizing", columnSizingState); if (shouldSetColumnSizingState) { - for (const { colId, flex, width } of columnSizingState?.columnSizingModel ?? []) { + for (const { colId, flex: flex2, width } of columnSizingState?.columnSizingModel ?? []) { const columnState = getColumnState2(colId); - columnState.flex = flex ?? null; + columnState.flex = flex2 ?? null; columnState.width = width; } } @@ -176722,7 +177009,8 @@ const LogListGrid = ({ status: preview?.status, completedAt: preview?.completed_at, itemCount: item2.type === "folder" ? item2.itemCount : void 0, - log: item2.type === "file" ? item2.log : void 0 + log: item2.type === "file" ? item2.log : void 0, + fastUrl: item2.type === "file" ? item2.fastUrl : void 0 }; if (details?.results?.scores) { for (const evalScore of details.results.scores) { @@ -176742,6 +177030,10 @@ const LogListGrid = ({ const handleRowClick = reactExports.useCallback( (e) => { if (e.data && e.node && gridRef.current?.api) { + const target2 = e.event?.target; + if (target2?.closest("button")) { + return; + } gridRef.current.api.deselectAll(); e.node.setSelected(true); const mouseEvent = e.event; @@ -176912,7 +177204,7 @@ const LogListGrid = ({ setCurrentMatchIndex(0); } }, [findTerm, performSearch]); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$18.gridWrapper), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$1b.gridWrapper), children: [ showFind && /* @__PURE__ */ jsxRuntimeExports.jsx( FindBandUI, { @@ -176929,7 +177221,7 @@ const LogListGrid = ({ matchIndex: findTerm ? currentMatchIndex : void 0 } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$18.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$1b.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx( AgGridReact, { ref: gridRef, @@ -176976,18 +177268,18 @@ const LogListGrid = ({ const footer$1 = "_footer_14uod_1"; const spinnerContainer$1 = "_spinnerContainer_14uod_11"; const spinner$2 = "_spinner_14uod_11"; -const label$7 = "_label_14uod_25"; +const label$8 = "_label_14uod_25"; const right = "_right_14uod_30"; const left = "_left_14uod_39"; -const center = "_center_14uod_48"; -const styles$16 = { +const center$1 = "_center_14uod_48"; +const styles$19 = { footer: footer$1, spinnerContainer: spinnerContainer$1, spinner: spinner$2, - label: label$7, + label: label$8, right, left, - center + center: center$1 }; const LogListFooter = ({ itemCount, @@ -176997,12 +177289,12 @@ const LogListFooter = ({ progressBar }) => { const effectiveItemCount = filteredCount ?? itemCount; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$16.footer), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$16.left), children: progressText ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$16.spinnerContainer), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$19.footer), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$19.left), children: progressText ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$19.spinnerContainer), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx("spinner-border", styles$16.spinner), + className: clsx("spinner-border", styles$19.spinner), role: "status", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: clsx("visually-hidden"), children: [ progressText, @@ -177010,18 +177302,18 @@ const LogListFooter = ({ ] }) } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-style-secondary", styles$16.label), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-style-secondary", styles$19.label), children: [ progressText, "..." ] }) ] }) : null }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$16.center) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$16.right), children: progressBar ? progressBar : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: effectiveItemCount === 0 ? "" : filteredCount !== void 0 && filteredCount !== itemCount ? `${effectiveItemCount} / ${itemCount} ${itemCountLabel || "items"}` : `${effectiveItemCount} ${itemCountLabel || "items"}` }) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$19.center) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$19.right), children: progressBar ? progressBar : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: effectiveItemCount === 0 ? "" : filteredCount !== void 0 && filteredCount !== itemCount ? `${effectiveItemCount} / ${itemCount} ${itemCountLabel || "items"}` : `${effectiveItemCount} ${itemCountLabel || "items"}` }) }) ] }); }; const panel$7 = "_panel_16dj8_1"; const list$1 = "_list_16dj8_8"; -const styles$15 = { +const styles$18 = { panel: panel$7, list: list$1 }; @@ -177125,7 +177417,27 @@ const LogsPanel = ({ maybeShowSingleLog }) => { } } } - const orderedItems = [...folderItems, ...fileItems]; + const fastEvalSuffix = ".fast.eval"; + const fastItemsByBase = /* @__PURE__ */ new Map(); + const normalItems = []; + for (const item2 of fileItems) { + if (item2.type === "file" && item2.name.endsWith(fastEvalSuffix)) { + const baseName = item2.name.slice(0, -fastEvalSuffix.length) + ".eval"; + fastItemsByBase.set(baseName, item2); + } else { + normalItems.push(item2); + } + } + for (const item2 of normalItems) { + if (item2.type === "file") { + const fastItem = fastItemsByBase.get(item2.name); + if (fastItem) { + item2.fastUrl = fastItem.url; + fastItemsByBase.delete(item2.name); + } + } + } + const orderedItems = [...folderItems, ...normalItems]; const _logFiles = appendPendingItems( evalSet, existingLogTaskIds, @@ -177190,7 +177502,7 @@ const LogsPanel = ({ maybeShowSingleLog }) => { } } }, [logItems, maybeShowSingleLog, navigate]); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$15.panel), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$18.panel), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( ApplicationNavbar, { @@ -177247,7 +177559,7 @@ const LogsPanel = ({ maybeShowSingleLog }) => { } ), /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$15.list, "text-size-smaller"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$18.list, "text-size-smaller"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( LogListGrid, { items: logItems, @@ -177332,7 +177644,17 @@ function useLoadSample() { if (completed !== false) { log$1.debug(`LOADING COMPLETED SAMPLE: ${id}-${epoch}`); getSamplePolling().stopPolling(); - const sample2 = await api2?.get_log_sample(logFile, id, epoch); + sampleActions.setDownloadProgress(void 0); + const onProgress = (bytesLoaded, bytesTotal) => { + sampleActions.setDownloadProgress({ bytesLoaded, bytesTotal }); + }; + const sample2 = await api2?.get_log_sample( + logFile, + id, + epoch, + onProgress + ); + sampleActions.setDownloadProgress(void 0); log$1.debug(`LOADED COMPLETED SAMPLE: ${id}-${epoch}`); if (thisGeneration !== loadGeneration) { log$1.debug(`Discarding stale sample response: ${id}-${epoch}`); @@ -177358,6 +177680,7 @@ function useLoadSample() { getSamplePolling().stopPolling(); } } catch (e) { + sampleActions.setDownloadProgress(void 0); sampleActions.setSampleError(e); sampleActions.setSampleStatus("error"); } @@ -178258,7 +178581,7 @@ const chevron = "_chevron_h3ljc_10"; const backdrop$1 = "_backdrop_h3ljc_24"; const dropdownMenu = "_dropdownMenu_h3ljc_33"; const dropdownItem = "_dropdownItem_h3ljc_47"; -const styles$14 = { +const styles$17 = { dropdownContainer, toolButton, chevron, @@ -178272,29 +178595,29 @@ const ToolDropdownButton = reactExports.forwardRef(({ label: label2, icon: icon2 fn3(); setIsOpen(false); }; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$14.dropdownContainer, children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$17.dropdownContainer, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( "button", { ref, type: "button", - className: clsx("btn", "btn-tools", styles$14.toolButton, className2), + className: clsx("btn", "btn-tools", styles$17.toolButton, className2), onClick: () => setIsOpen(!isOpen), ...rest, children: [ icon2 && /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: `${icon2}` }), label2, - /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi-chevron-down", styles$14.chevron) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx("bi-chevron-down", styles$17.chevron) }) ] } ), isOpen && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$14.backdrop, onClick: () => setIsOpen(false) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$14.dropdownMenu, children: Object.entries(items).map(([itemLabel, fn3]) => /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.backdrop, onClick: () => setIsOpen(false) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$17.dropdownMenu, children: Object.entries(items).map(([itemLabel, fn3]) => /* @__PURE__ */ jsxRuntimeExports.jsx( "button", { type: "button", - className: styles$14.dropdownItem, + className: styles$17.dropdownItem, onClick: () => handleItemClick(fn3), children: itemLabel }, @@ -178348,17 +178671,62 @@ const Card = ({ id, children: children2, className: className2 }) => { return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("card", className2), id, children: children2 }); }; const panel$6 = "_panel_twp3v_1"; -const container$i = "_container_twp3v_7"; -const styles$13 = { +const container$j = "_container_twp3v_7"; +const styles$16 = { panel: panel$6, - container: container$i + container: container$j }; const NoContentsPanel = ({ text: text2 }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$13.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$13.container, "text-size-smaller"), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$16.panel), children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$16.container, "text-size-smaller"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.noSamples }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: text2 }) ] }) }); }; +const printHtml = (html2, css2) => { + const printWindow = window.open("", "", "height=600,width=800"); + if (printWindow !== null) { + printWindow.document.write("Print"); + printWindow.document.write(` + + + `); + printWindow.document.write(""); + printWindow.document.write(html2); + printWindow.document.write(""); + printWindow.document.close(); + printWindow.onload = function() { + printWindow.focus(); + printWindow.print(); + printWindow.close(); + }; + } else { + console.error("Print window failed to open."); + } +}; +const printHeadingHtml = () => { + const taskEl = document.getElementById("task-title"); + const modelEl = document.getElementById("task-model"); + const timeEl = document.getElementById("task-created"); + if (!taskEl || !modelEl || !timeEl) { + throw new Error( + "Failed to compute heading HTML. The task, model, or time element can't be found." + ); + } + const task = taskEl.innerText; + const model2 = modelEl.innerText; + const time = timeEl.innerText; + const headingHtml = ` +
+
${task}
+
${model2}
+
${time}
+
`; + return headingHtml; +}; const messagesToStr = (messages2, options2) => { const opts = {}; return messages2.map((msg) => messageToStr(msg, opts)).filter((str2) => str2 !== null).join("\n"); @@ -178459,15 +178827,15 @@ const betterContentText = (content2, excludeToolUsage, excludeReasoning) => { const allText = content2.map((c2) => textFromContent(c2, excludeToolUsage, excludeReasoning)).filter((text2) => text2 !== null); return allText.join("\n"); }; -const wrapper$2 = "_wrapper_sq96g_1"; -const col2$1 = "_col2_sq96g_8"; +const wrapper$3 = "_wrapper_sq96g_1"; +const col2$2 = "_col2_sq96g_8"; const col1_3$1 = "_col1_3_sq96g_12"; const col3$1 = "_col3_sq96g_16"; const separator$5 = "_separator_sq96g_20"; const padded$1 = "_padded_sq96g_26"; -const styles$12 = { - wrapper: wrapper$2, - col2: col2$1, +const styles$15 = { + wrapper: wrapper$3, + col2: col2$2, col1_3: col1_3$1, col3: col3$1, separator: separator$5, @@ -178527,14 +178895,14 @@ const ModelUsagePanel = ({ usage, className: className2 }) => { value: usage.total_tokens, secondary: false }); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$12.wrapper, className2), children: rows.map((row2, idx) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$15.wrapper, className2), children: rows.map((row2, idx) => { if (row2.label === "---") { return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( - styles$12.separator, - row2.padded ? styles$12.padded : void 0 + styles$15.separator, + row2.padded ? styles$15.padded : void 0 ) }, `$usage-sep-${idx}` @@ -178547,12 +178915,12 @@ const ModelUsagePanel = ({ usage, className: className2 }) => { className: clsx( "text-style-label", "text-style-secondary", - row2.secondary ? styles$12.col2 : styles$12.col1_3 + row2.secondary ? styles$15.col2 : styles$15.col1_3 ), children: row2.label } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$12.col3, children: row2.value ? formatNumber(row2.value) : "" }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$15.col3, children: row2.value ? formatNumber(row2.value) : "" }) ] }, `$usage-row-${idx}`); } }) }); @@ -178562,7 +178930,7 @@ const tableTokens = "_tableTokens_z217i_5"; const tableH = "_tableH_z217i_9"; const model = "_model_z217i_14"; const cellContents = "_cellContents_z217i_18"; -const styles$11 = { +const styles$14 = { table: table$1, tableTokens, tableH, @@ -178577,7 +178945,7 @@ const TokenTable$1 = ({ className: className2, children: children2 }) => { "table", "table-sm", "text-size-smaller", - styles$11.table, + styles$14.table, className2 ), children: children2 @@ -178594,7 +178962,7 @@ const TokenHeader = () => { colSpan: 3, className: clsx( "card-subheading", - styles$11.tableTokens, + styles$14.tableTokens, "text-size-small", "text-style-label", "text-style-secondary" @@ -178609,7 +178977,7 @@ const TokenHeader = () => { "th", { className: clsx( - styles$11.tableH, + styles$14.tableH, "text-sixe-small", "text-style-label", "text-style-secondary" @@ -178621,7 +178989,7 @@ const TokenHeader = () => { "th", { className: clsx( - styles$11.tableH, + styles$14.tableH, "text-sixe-small", "text-style-label", "text-style-secondary" @@ -178634,8 +179002,8 @@ const TokenHeader = () => { }; const TokenRow = ({ model: model2, usage }) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$11.model, styles$11.cellContents), children: model2 }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage, className: clsx(styles$11.cellContents) }) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$14.model, styles$14.cellContents), children: model2 }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("td", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage, className: clsx(styles$14.cellContents) }) }) ] }); }; const ModelTokenTable = ({ @@ -178652,7 +179020,7 @@ const ModelTokenTable = ({ }) }) ] }); }; -const container$h = "_container_4p85e_2"; +const container$i = "_container_4p85e_2"; const dotsContainer = "_dotsContainer_4p85e_8"; const small = "_small_4p85e_15"; const medium = "_medium_4p85e_19"; @@ -178661,8 +179029,8 @@ const dot = "_dot_4p85e_8"; const subtle = "_subtle_4p85e_36"; const primary = "_primary_4p85e_40"; const visuallyHidden = "_visuallyHidden_4p85e_59"; -const styles$10 = { - container: container$h, +const styles$13 = { + container: container$i, dotsContainer, small, medium, @@ -178683,30 +179051,30 @@ const PulsingDots = ({ "div", { className: clsx( - styles$10.container, - size === "small" ? styles$10.small : size === "medium" ? styles$10.medium : styles$10.large, + styles$13.container, + size === "small" ? styles$13.small : size === "medium" ? styles$13.medium : styles$13.large, className2 ), role: "status", children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$10.dotsContainer, children: [...Array(dotsCount)].map((_, index) => /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$13.dotsContainer, children: [...Array(dotsCount)].map((_, index) => /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( - styles$10.dot, - subtle2 ? styles$10.subtle : styles$10.primary + styles$13.dot, + subtle2 ? styles$13.subtle : styles$13.primary ), style: { animationDelay: `${index * 0.2}s` } }, index )) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$10.visuallyHidden, children: text2 }) + /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: styles$13.visuallyHidden, children: text2 }) ] } ); }; const progressContainer = "_progressContainer_1cjjr_1"; -const styles$$ = { +const styles$12 = { progressContainer }; const LiveVirtualList = ({ @@ -178914,7 +179282,7 @@ const LiveVirtualList = ({ countMatchesInData ]); const Footer = () => { - return showProgress ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$$.progressContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0; + return showProgress ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$12.progressContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0; }; reactExports.useEffect(() => { const parent = scrollRef?.current; @@ -178997,7 +179365,7 @@ const prepareSearchTerm = (term) => { jsonEscaped: lower.replace(/"/g, '\\"') }; }; -const styles$_ = {}; +const styles$11 = {}; const messageSearchText = (resolved) => { const texts = []; texts.push(...extractContentText$1(resolved.message.content)); @@ -179182,11 +179550,10 @@ const ChatViewVirtualListComponent = reactExports.memo( const renderRow = reactExports.useCallback( (index, item2) => { const number2 = collapsedMessages.length > 1 && numbered ? index + 1 : void 0; - const rowId = `${id}-msg-${index}`; return /* @__PURE__ */ jsxRuntimeExports.jsx( ChatMessageRow, { - id: rowId, + parentName: id || "chat-virtual-list", number: number2, resolvedMessage: item2, indented: indented2, @@ -179212,7 +179579,7 @@ const ChatViewVirtualListComponent = reactExports.memo( return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$_.item), + className: clsx(styles$11.item), "data-index": props["data-index"], "data-item-group-index": props["data-item-group-index"], "data-item-index": props["data-item-index"], @@ -179251,7 +179618,7 @@ const noTop = "_noTop_20s9q_38"; const chat = "_chat_20s9q_50"; const transcriptContainer = "_transcriptContainer_20s9q_58"; const overflowVisible$1 = "_overflowVisible_20s9q_62"; -const styles$Z = { +const styles$10 = { tabPanel, tabControls, fullWidth: fullWidth$1, @@ -179489,7 +179856,7 @@ const body$1 = "_body_x9ww7_1"; const safe = "_safe_x9ww7_9"; const iconSmall = "_iconSmall_x9ww7_13"; const message$1 = "_message_x9ww7_19"; -const styles$Y = { +const styles$$ = { body: body$1, safe, iconSmall, @@ -179505,22 +179872,23 @@ const SampleErrorView = ({ "div", { className: clsx( - styles$Y.body, - isCanceledError(type) ? styles$Y.safe : void 0 + styles$$.body, + isCanceledError(type) ? styles$$.safe : void 0 ), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.error, styles$Y.iconSmall) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$Y.message, style: ApplicationStyles.lineClamp(2), children: type }) + /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.error, styles$$.iconSmall) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$$.message, style: ApplicationStyles.lineClamp(2), children: type }) ] } ); }; const isCanceledError = (type) => { + console.log(type); return type === "CancelledError"; }; const target = "_target_10p8e_1"; const answer = "_answer_10p8e_5"; -const grid$6 = "_grid_10p8e_9"; +const grid$7 = "_grid_10p8e_9"; const centerLabel = "_centerLabel_10p8e_16"; const centerValue = "_centerValue_10p8e_21"; const wrap$2 = "_wrap_10p8e_26"; @@ -179532,10 +179900,10 @@ const invalidationContent = "_invalidationContent_10p8e_56"; const invalidationTitle = "_invalidationTitle_10p8e_63"; const invalidationDetails = "_invalidationDetails_10p8e_68"; const invalidationReason = "_invalidationReason_10p8e_76"; -const styles$X = { +const styles$_ = { target, answer, - grid: grid$6, + grid: grid$7, centerLabel, centerValue, wrap: wrap$2, @@ -179591,10 +179959,12 @@ const SampleSummaryView = ({ return void 0; } const fields = resolveSample(sample2, sampleDescriptor); - const shape = sampleDescriptor?.messageShape; - const limitSize = shape?.limitSize ?? 0; - const retrySize = shape?.retriesSize ?? 0; - const idSize = shape?.idSize ?? 2; + const limitSize = sampleDescriptor?.messageShape.normalized.limit > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.limit) : 0; + const retrySize = sampleDescriptor?.messageShape.normalized.retries > 0 ? 6 : 0; + const idSize = Math.max( + 2, + Math.min(10, sampleDescriptor?.messageShape.raw.id) + ); const columns = []; columns.push({ label: "Id", @@ -179621,7 +179991,7 @@ const SampleSummaryView = ({ arrayToString(fields?.target || "none"), kMaxCellTextLength ), - className: clsx("no-last-para-padding", styles$X.target) + className: clsx("no-last-para-padding", styles$_.target) } ), size: `minmax(auto, 3fr)`, @@ -179635,7 +180005,7 @@ const SampleSummaryView = ({ RenderedText, { markdown: truncateMarkdown(fields.answer || "", kMaxCellTextLength), - className: clsx("no-last-para-padding", styles$X.answer) + className: clsx("no-last-para-padding", styles$_.answer) } ) : "", size: `minmax(auto, 5fr)`, @@ -179661,7 +180031,7 @@ const SampleSummaryView = ({ columns.push({ label: "Limit", value: fields.limit, - size: `${limitSize}em`, + size: `fit-content(10rem)`, center: true }); } @@ -179669,7 +180039,7 @@ const SampleSummaryView = ({ columns.push({ label: "Retries", value: fields.retries, - size: `${retrySize}em`, + size: `fit-content(${retrySize}rem)`, center: true }); } @@ -179686,7 +180056,7 @@ const SampleSummaryView = ({ columns.push({ label: "Error", value: /* @__PURE__ */ jsxRuntimeExports.jsx(SampleErrorView, { message: fields.error }), - size: `${shape?.errorSize ?? 1}em`, + size: "fit-content(20em)", center: true }); } @@ -179696,7 +180066,7 @@ const SampleSummaryView = ({ /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$X.grid, "text-size-base"), + className: clsx(styles$_.grid, "text-size-base"), style: { gridTemplateColumns: `${columns.map((col) => { return col.size; @@ -179711,8 +180081,8 @@ const SampleSummaryView = ({ "text-style-label", "text-style-secondary", "text-size-smallest", - col.title ? styles$X.titled : void 0, - col.center ? styles$X.centerLabel : void 0 + col.title ? styles$_.titled : void 0, + col.center ? styles$_.centerLabel : void 0 ), title: col.title, "data-unsearchable": true, @@ -179726,10 +180096,10 @@ const SampleSummaryView = ({ "div", { className: clsx( - styles$X.value, - styles$X.wrap, + styles$_.value, + styles$_.wrap, col.clamp ? "three-line-clamp" : void 0, - col.center ? styles$X.centerValue : void 0 + col.center ? styles$_.centerValue : void 0 ), "data-unsearchable": true, children: col.value @@ -179752,11 +180122,11 @@ const InvalidationBanner = ({ return timestamp2; } }; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$X.invalidationBanner, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$X.invalidationIcon, children: "⚠" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$X.invalidationContent, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$X.invalidationTitle, children: "Sample Invalidated" }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$X.invalidationDetails, children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$_.invalidationBanner, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$_.invalidationIcon, children: "⚠" }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$_.invalidationContent, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$_.invalidationTitle, children: "Sample Invalidated" }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$_.invalidationDetails, children: [ invalidation.author && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [ "By: ", invalidation.author @@ -179765,7 +180135,7 @@ const InvalidationBanner = ({ "On: ", formatTimestamp(invalidation.timestamp) ] }), - invalidation.reason && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$X.invalidationReason, children: [ + invalidation.reason && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: styles$_.invalidationReason, children: [ "Reason: ", invalidation.reason ] }) @@ -179787,14 +180157,14 @@ const SampleScores = ({ sample: sample2, scorer: scorer2 }) => { ); return scorerDescriptor?.render(scoreData.value); }; -const container$g = "_container_kwhbh_1"; +const container$h = "_container_kwhbh_1"; const cell$1 = "_cell_kwhbh_9"; const fullWidth = "_fullWidth_kwhbh_13"; const separator$4 = "_separator_kwhbh_25"; const separatorPadded = "_separatorPadded_kwhbh_30"; const headerSep = "_headerSep_kwhbh_35"; -const styles$W = { - container: container$g, +const styles$Z = { + container: container$h, cell: cell$1, fullWidth, separator: separator$4, @@ -179810,7 +180180,7 @@ const SampleScoresGrid = ({ if (!evalDescriptor) { return /* @__PURE__ */ jsxRuntimeExports.jsx(EmptyPanel, { children: "No Sample Selected" }); } - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2, styles$W.container), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2, styles$Z.container), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { @@ -179858,7 +180228,7 @@ const SampleScoresGrid = ({ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$W.separator, styles$W.fullWidth, styles$W.headerSep) + className: clsx(styles$Z.separator, styles$Z.fullWidth, styles$Z.headerSep) } ), Object.keys(evalSample.scores || {}).map((scorer2) => { @@ -179870,16 +180240,16 @@ const SampleScoresGrid = ({ const answer2 = scoreData.answer; let metadata2 = scoreData.metadata || {}; return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$W.cell), children: scorer2 }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$W.cell, "text-size-base"), children: answer2 }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$W.cell, "text-size-base"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$Z.cell), children: scorer2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Z.cell, "text-size-base"), children: answer2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Z.cell, "text-size-base"), children: /* @__PURE__ */ jsxRuntimeExports.jsx( SampleScores, { sample: evalSample, scorer: scorer2 } ) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$W.cell), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base", styles$Z.cell), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RenderedContent, { id: `${scorer2}-explanation`, @@ -179897,12 +180267,12 @@ const SampleScoresGrid = ({ "text-size-smaller", "text-style-label", "text-style-secondary", - styles$W.fullWidth + styles$Z.fullWidth ), children: "Metadata" } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$W.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Z.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RecordTree, { id: `${scorer2}-metadataa`, @@ -179915,9 +180285,9 @@ const SampleScoresGrid = ({ "div", { className: clsx( - styles$W.separator, - styles$W.separatorPadded, - styles$W.fullWidth + styles$Z.separator, + styles$Z.separatorPadded, + styles$Z.fullWidth ) } ) @@ -179929,7 +180299,7 @@ const SampleScoresGrid = ({ const wordBreak = "_wordBreak_las07_9"; const scoreCard = "_scoreCard_las07_50"; const scores = "_scores_las07_54"; -const styles$V = { +const styles$Y = { wordBreak, scoreCard, scores @@ -179944,7 +180314,7 @@ const SampleScoresView = ({ return void 0; } if (!sample2) { - return /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "Scoring data not available" }); + return void 0; } const scoreInput = inputString(sample2.input); if (sample2.choices && sample2.choices.length > 0) { @@ -179962,9 +180332,9 @@ const SampleScoresView = ({ "container-fluid", className2, "font-size-base", - styles$V.container + styles$Y.container ), - children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: clsx(styles$V.scoreCard), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardBody, { children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsx(Card, { className: clsx(styles$Y.scoreCard), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(CardBody, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { @@ -179986,7 +180356,7 @@ const SampleScoresView = ({ RenderedText, { markdown: scoreInput.join("\n"), - className: clsx(styles$V.wordBreak, "text-size-base") + className: clsx(styles$Y.wordBreak, "text-size-base") } ) } @@ -179995,7 +180365,7 @@ const SampleScoresView = ({ SampleScoresGrid, { evalSample: sample2, - className: clsx(styles$V.scores), + className: clsx(styles$Y.scores), scrollRef } ) @@ -180044,19 +180414,12 @@ const useTranscriptFilter = () => { const setDefaultFilter = reactExports.useCallback(() => { setFilteredEventTypes([...kDefaultExcludeEvents]); }, [setFilteredEventTypes]); - const setNoneFilter = reactExports.useCallback(() => { - setFilteredEventTypes(Object.keys(eventTypes)); - }, [setFilteredEventTypes]); const isDefaultFilter = reactExports.useMemo(() => { return filtered.length === kDefaultExcludeEvents.length && [...filtered].every((type) => kDefaultExcludeEvents.includes(type)); }, [filtered]); const isDebugFilter = reactExports.useMemo(() => { return filtered.length === 0; }, [filtered]); - const isNoneFilter = reactExports.useMemo(() => { - const allTypes = Object.keys(eventTypes); - return filtered.length === allTypes.length && allTypes.every((type) => filtered.includes(type)); - }, [filtered]); const arrangedEventTypes = reactExports.useCallback((columns = 1) => { const keys = Object.keys(eventTypes); const sortedKeys = keys.sort((a, b) => { @@ -180091,24 +180454,22 @@ const useTranscriptFilter = () => { filtered, isDefaultFilter, isDebugFilter, - isNoneFilter, setDefaultFilter, setDebugFilter, - setNoneFilter, filterEventType, eventTypes, arrangedEventTypes }; }; -const grid$5 = "_grid_1ml4j_1"; -const row$1 = "_row_1ml4j_8"; +const grid$6 = "_grid_1ml4j_1"; +const row$2 = "_row_1ml4j_8"; const links$1 = "_links_1ml4j_22"; -const selected$2 = "_selected_1ml4j_40"; -const styles$U = { - grid: grid$5, - row: row$1, +const selected$3 = "_selected_1ml4j_40"; +const styles$X = { + grid: grid$6, + row: row$2, links: links$1, - selected: selected$2 + selected: selected$3 }; const TranscriptFilterPopover = ({ showing, @@ -180118,10 +180479,8 @@ const TranscriptFilterPopover = ({ const { isDefaultFilter, isDebugFilter, - isNoneFilter, setDefaultFilter, setDebugFilter, - setNoneFilter, filterEventType, eventTypes: eventTypes2, filtered, @@ -180137,13 +180496,13 @@ const TranscriptFilterPopover = ({ placement: "bottom-end", hoverDelay: -1, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$U.links, "text-size-smaller"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$X.links, "text-size-smaller"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { className: clsx( - styles$U.link, - isDefaultFilter ? styles$U.selected : void 0 + styles$X.link, + isDefaultFilter ? styles$X.selected : void 0 ), onClick: () => setDefaultFilter(), children: "Default" @@ -180154,31 +180513,19 @@ const TranscriptFilterPopover = ({ "a", { className: clsx( - styles$U.link, - isDebugFilter ? styles$U.selected : void 0 + styles$X.link, + isDebugFilter ? styles$X.selected : void 0 ), onClick: () => setDebugFilter(), children: "Debug" } - ), - "|", - /* @__PURE__ */ jsxRuntimeExports.jsx( - "a", - { - className: clsx( - styles$U.link, - isNoneFilter ? styles$U.selected : void 0 - ), - onClick: () => setNoneFilter(), - children: "None" - } ) ] }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$U.grid, "text-size-smaller"), children: arrangedEventTypes(2).map((eventType) => { + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$X.grid, "text-size-smaller"), children: arrangedEventTypes(2).map((eventType) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$U.row), + className: clsx(styles$X.row), onClick: () => { filterEventType(eventType, filtered.includes(eventType)); }, @@ -180547,19 +180894,19 @@ const createSpanEnd = (name2, timestamp2) => { }; }; const eventRow = "_eventRow_1j0jk_1"; -const selected$1 = "_selected_1j0jk_8"; +const selected$2 = "_selected_1j0jk_8"; const toggle = "_toggle_1j0jk_12"; const eventLink = "_eventLink_1j0jk_17"; -const label$6 = "_label_1j0jk_28"; +const label$7 = "_label_1j0jk_28"; const icon$2 = "_icon_1j0jk_34"; const progress$2 = "_progress_1j0jk_38"; const popover = "_popover_1j0jk_42"; -const styles$T = { +const styles$W = { eventRow, - selected: selected$1, + selected: selected$2, toggle, eventLink, - label: label$6, + label: label$7, icon: icon$2, progress: progress$2, popover @@ -180585,9 +180932,9 @@ const OutlineRow = ({ "div", { className: clsx( - styles$T.eventRow, + styles$W.eventRow, "text-size-smaller", - selected2 ? styles$T.selected : "" + selected2 ? styles$W.selected : "" ), style: { paddingLeft: `${node2.depth * 0.4}em` }, "data-unsearchable": true, @@ -180595,20 +180942,20 @@ const OutlineRow = ({ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$T.toggle), + className: clsx(styles$W.toggle), onClick: () => { setCollapsed(!collapsed2); }, children: toggle2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(toggle2) }) : void 0 } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$T.label), "data-depth": node2.depth, children: [ - icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$T.icon) }) : void 0, + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$W.label), "data-depth": node2.depth, children: [ + icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$W.icon) }) : void 0, sampleEventUrl2 ? /* @__PURE__ */ jsxRuntimeExports.jsx( Link, { to: sampleEventUrl2, - className: clsx(styles$T.eventLink), + className: clsx(styles$W.eventLink), ref, children: parsePackageName(labelForNode(node2)).module } @@ -180617,7 +180964,7 @@ const OutlineRow = ({ PulsingDots, { size: "small", - className: clsx(styles$T.progress), + className: clsx(styles$W.progress), subtle: false } ) : void 0 @@ -180632,7 +180979,7 @@ const OutlineRow = ({ positionEl: ref.current, isOpen: isShowing, setIsOpen: setShowing, - className: clsx(styles$T.popper), + className: clsx(styles$W.popper), placement: "auto-end", children: summarizeNode(node2) } @@ -180747,11 +181094,11 @@ const summarizeNode = (node2) => { { entries, size: "mini", - className: clsx(styles$T.popover, "text-size-smallest") + className: clsx(styles$W.popover, "text-size-smallest") } ); }; -const styles$S = {}; +const styles$V = {}; const kTurnType = "turn"; const kTurnsType = "turns"; const kCollapsedScoring = "scorings"; @@ -181020,7 +181367,7 @@ const TranscriptOutline = ({ return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$S.eventPadding), + className: clsx(styles$V.eventPadding), style: { height: "2em" } }, node2.id @@ -181063,14 +181410,14 @@ const TranscriptOutline = ({ } ); }; -const container$f = "_container_17sux_1"; +const container$g = "_container_17sux_1"; const collapsed = "_collapsed_17sux_9"; const treeContainer = "_treeContainer_17sux_13"; const listContainer = "_listContainer_17sux_25"; const outline = "_outline_17sux_29"; const outlineToggle = "_outlineToggle_17sux_33"; -const styles$R = { - container: container$f, +const styles$U = { + container: container$g, collapsed, treeContainer, listContainer, @@ -181079,7 +181426,7 @@ const styles$R = { }; const title$1 = "_title_19l1b_1"; const contents = "_contents_19l1b_8"; -const styles$Q = { +const styles$T = { title: title$1, contents }; @@ -181089,12 +181436,12 @@ const EventRow = ({ className: className2, children: children2 }) => { - const contentEl = title2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-small", styles$Q.title, className2), children: [ + const contentEl = title2 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-small", styles$T.title, className2), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: icon2 || ApplicationIcons.metadata }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: title2 }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: children2 }) ] }) : ""; - const card2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("card", styles$Q.contents), children: contentEl }); + const card2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("card", styles$T.contents), children: contentEl }); return card2; }; const sampleLimitTitles = { @@ -181117,16 +181464,8 @@ const eventTitle = (event) => { switch (event.event) { case "model": return event.role ? `Model Call (${event.role}): ${event.model}` : `Model Call: ${event.model}`; - case "tool": { - let title2 = event.view?.title || event.function; - if (event.view?.title) { - title2 = title2.replace( - /\{\{(\w+)\}\}/g, - (match2, key2) => Object.hasOwn(event.arguments, key2) ? String(event.arguments[key2]) : match2 - ); - } - return `Tool: ${title2}`; - } + case "tool": + return `Tool: ${event.view?.title || event.function}`; case "error": return "Error"; case "logger": @@ -181219,7 +181558,7 @@ const decisionIcon = (decision) => { } }; const tab = "_tab_1je38_1"; -const styles$P = { +const styles$S = { tab }; const EventNav = ({ @@ -181244,7 +181583,7 @@ const EventNav = ({ active ? "active " : "", "text-style-label", "text-size-small", - styles$P.tab + styles$S.tab ), onClick: handleClick, children: title2 @@ -181252,7 +181591,7 @@ const EventNav = ({ ) }); }; const navs$1 = "_navs_1vm6p_1"; -const styles$O = { +const styles$R = { navs: navs$1 }; const EventNavs = ({ @@ -181263,7 +181602,7 @@ const EventNavs = ({ return /* @__PURE__ */ jsxRuntimeExports.jsx( "ul", { - className: clsx("nav", "nav-pills", styles$O.navs), + className: clsx("nav", "nav-pills", styles$R.navs), role: "tablist", "aria-orientation": "horizontal", children: navs2.map((nav2) => { @@ -181366,7 +181705,7 @@ function useStickyObserver() { return ref; } const stickyWrapper = "_stickyWrapper_1yfru_1"; -const label$5 = "_label_1yfru_22"; +const label$6 = "_label_1yfru_22"; const navs = "_navs_1yfru_27"; const turnLabel = "_turnLabel_1yfru_33"; const card = "_card_1yfru_39"; @@ -181377,9 +181716,9 @@ const hover = "_hover_1yfru_68"; const root$1 = "_root_1yfru_72"; const bottomDongle = "_bottomDongle_1yfru_77"; const dongleIcon = "_dongleIcon_1yfru_94"; -const styles$N = { +const styles$Q = { stickyWrapper, - label: label$5, + label: label$6, navs, turnLabel, card, @@ -181429,20 +181768,20 @@ const EventPanel = ({ } ); const stickyRef = useStickyObserver(); - const gridColumns = []; + const gridColumns2 = []; if (isCollapsible && !useBottomDongle) { - gridColumns.push("minmax(0, max-content)"); + gridColumns2.push("minmax(0, max-content)"); } if (icon2) { - gridColumns.push("max-content"); + gridColumns2.push("max-content"); } - gridColumns.push("minmax(0, max-content)"); + gridColumns2.push("minmax(0, max-content)"); if (url) { - gridColumns.push("minmax(0, max-content)"); + gridColumns2.push("minmax(0, max-content)"); } - gridColumns.push("auto"); - gridColumns.push("minmax(0, max-content)"); - gridColumns.push("minmax(0, max-content)"); + gridColumns2.push("auto"); + gridColumns2.push("minmax(0, max-content)"); + gridColumns2.push("minmax(0, max-content)"); const toggleCollapse = reactExports.useCallback(() => { setCollapsed(!collapsed2); }, [setCollapsed, collapsed2]); @@ -181453,13 +181792,13 @@ const EventPanel = ({ title: subTitle, className: clsx( "text-size-small", - mouseOver ? styles$N.hover : "", - turnLabel2 ? styles$N.stickyWrapper : "" + mouseOver ? styles$Q.hover : "", + turnLabel2 ? styles$Q.stickyWrapper : "" ), ref: turnLabel2 ? stickyRef : null, style: { display: "grid", - gridTemplateColumns: gridColumns.join(" "), + gridTemplateColumns: gridColumns2.join(" "), columnGap: "0.3em", cursor: isCollapsible && !useBottomDongle ? "pointer" : void 0 }, @@ -181496,19 +181835,19 @@ const EventPanel = ({ { value: url, icon: ApplicationIcons.link, - className: clsx(styles$N.copyLink) + className: clsx(styles$Q.copyLink) } ) : "", /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: toggleCollapse }), /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx("text-style-secondary", styles$N.label), + className: clsx("text-style-secondary", styles$Q.label), onClick: toggleCollapse, children: collapsed2 ? text2 : "" } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$N.navs, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$Q.navs, children: [ isCollapsible && collapsibleContent && collapsed2 ? "" : filteredArrChildren && filteredArrChildren.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( EventNavs, { @@ -181525,7 +181864,7 @@ const EventPanel = ({ setSelectedNav } ) : "", - turnLabel2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$N.turnLabel), children: turnLabel2 }) + turnLabel2 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx(styles$Q.turnLabel), children: turnLabel2 }) ] }) ] } @@ -181536,8 +181875,8 @@ const EventPanel = ({ id: `event-panel-${eventNodeId}`, className: clsx( className2, - styles$N.card, - depth === 0 ? styles$N.root : void 0 + styles$Q.card, + depth === 0 ? styles$Q.root : void 0 ), children: [ titleEl, @@ -181546,8 +181885,8 @@ const EventPanel = ({ { className: clsx( "tab-content", - styles$N.cardContent, - isCollapsible && collapsed2 && collapsibleContent ? styles$N.hidden : void 0 + styles$Q.cardContent, + isCollapsible && collapsed2 && collapsibleContent ? styles$Q.hidden : void 0 ), children: filteredArrChildren?.map((child, index) => { const id = pillId(index); @@ -181570,7 +181909,7 @@ const EventPanel = ({ isCollapsible && useBottomDongle ? /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$N.bottomDongle, "text-size-smallest"), + className: clsx(styles$Q.bottomDongle, "text-size-smallest"), onClick: toggleCollapse, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -181578,7 +181917,7 @@ const EventPanel = ({ { className: clsx( collapsed2 ? ApplicationIcons.chevron.right : ApplicationIcons.chevron.down, - styles$N.dongleIcon + styles$Q.dongleIcon ) } ), @@ -181626,7 +181965,7 @@ const ErrorEventView = ({ ); }; const panel$5 = "_panel_vz394_1"; -const styles$M = { +const styles$P = { panel: panel$5 }; const InfoEventView = ({ @@ -181641,13 +181980,13 @@ const InfoEventView = ({ RenderedText, { markdown: event.data, - className: clsx(styles$M.panel, "text-size-base"), + className: clsx(styles$P.panel, "text-size-base"), omitMath: true } ) ); } else { - panels.push(/* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { data: event.data, className: styles$M.panel })); + panels.push(/* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { data: event.data, className: styles$P.panel })); } return /* @__PURE__ */ jsxRuntimeExports.jsx( EventPanel, @@ -181686,10 +182025,10 @@ const InputEventView = ({ } ); }; -const grid$4 = "_grid_159mg_1"; +const grid$5 = "_grid_159mg_1"; const wrap = "_wrap_159mg_12"; -const styles$L = { - grid: grid$4, +const styles$O = { + grid: grid$5, wrap }; const LoggerEventView = ({ @@ -181704,13 +182043,13 @@ const LoggerEventView = ({ className: className2, title: eventTitle(event), icon: ApplicationIcons.logging[event.message.level.toLowerCase()], - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-base", styles$L.grid), children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-base", styles$O.grid), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-smaller"), children: obj !== void 0 && obj !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: obj }) : /* @__PURE__ */ jsxRuntimeExports.jsx( ExpandablePanel, { id: `event-message-${event.uuid}`, collapse: true, - className: clsx(styles$L.wrap), + className: clsx(styles$O.wrap), children: event.message.message } ) }), @@ -181723,11 +182062,11 @@ const LoggerEventView = ({ } ); }; -const container$e = "_container_1ww70_1"; +const container$f = "_container_1ww70_1"; const titleRow = "_titleRow_1ww70_5"; const title = "_title_1ww70_5"; -const styles$K = { - container: container$e, +const styles$N = { + container: container$f, titleRow, title }; @@ -181737,11 +182076,11 @@ const EventSection = ({ copyContent, className: className2 }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$K.container, className2), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$K.titleRow), children: /* @__PURE__ */ jsxRuntimeExports.jsxs( + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$N.container, className2), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$N.titleRow), children: /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx("text-size-small", "text-style-label", styles$K.title), + className: clsx("text-size-small", "text-style-label", styles$N.title), children: [ title2, copyContent ? /* @__PURE__ */ jsxRuntimeExports.jsx(CopyButton, { value: copyContent, ariaLabel: "Copy to clipboard" }) : null @@ -181751,7 +182090,7 @@ const EventSection = ({ children2 ] }); }; -const container$d = "_container_1gr6b_1"; +const container$e = "_container_1gr6b_1"; const all = "_all_1gr6b_6"; const tableSelection = "_tableSelection_1gr6b_12"; const codePre = "_codePre_1gr6b_22"; @@ -181761,8 +182100,8 @@ const error$1 = "_error_1gr6b_38"; const toolConfig = "_toolConfig_1gr6b_54"; const toolChoice = "_toolChoice_1gr6b_62"; const traceback = "_traceback_1gr6b_71"; -const styles$J = { - container: container$d, +const styles$M = { + container: container$e, all, tableSelection, codePre, @@ -181773,15 +182112,15 @@ const styles$J = { toolChoice, traceback }; -const wrapper$1 = "_wrapper_cv5sf_1"; -const col2 = "_col2_cv5sf_8"; +const wrapper$2 = "_wrapper_cv5sf_1"; +const col2$1 = "_col2_cv5sf_8"; const col1_3 = "_col1_3_cv5sf_12"; const col3 = "_col3_cv5sf_16"; const separator$3 = "_separator_cv5sf_20"; const topMargin = "_topMargin_cv5sf_26"; -const styles$I = { - wrapper: wrapper$1, - col2, +const styles$L = { + wrapper: wrapper$2, + col2: col2$1, col1_3, col3, separator: separator$3, @@ -181853,9 +182192,9 @@ const EventTimingPanel = ({ }); } } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$I.wrapper), children: rows.map((row2, idx) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$L.wrapper), children: rows.map((row2, idx) => { if (row2.label === "---") { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$I.separator }, `$usage-sep-${idx}`); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$L.separator }, `$usage-sep-${idx}`); } else { return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -181864,13 +182203,13 @@ const EventTimingPanel = ({ className: clsx( "text-style-label", "text-style-secondary", - row2.secondary ? styles$I.col2 : styles$I.col1_3, - row2.topMargin ? styles$I.topMargin : void 0 + row2.secondary ? styles$L.col2 : styles$L.col1_3, + row2.topMargin ? styles$L.topMargin : void 0 ), children: row2.label } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$I.col3, children: row2.value ? row2.value : "" }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$L.col3, children: row2.value ? row2.value : "" }) ] }, `$usage-row-${idx}`); } }) }); @@ -181929,7 +182268,7 @@ const ModelEventView = ({ icon: ApplicationIcons.model, turnLabel: turnLabel2, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$J.container, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$M.container, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ChatView, { @@ -181942,7 +182281,7 @@ const ModelEventView = ({ unlabeledRoles: ["assistant"] } ), - event.error ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$J.error, children: [ + event.error ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$M.error, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.error, "aria-hidden": "true" }), /* @__PURE__ */ jsxRuntimeExports.jsx( ANSIDisplay, @@ -181953,20 +182292,20 @@ const ModelEventView = ({ } } ) - ] }) : event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$J.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0 + ] }) : event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$M.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0 ] }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "All", className: styles$J.container, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$J.all, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "All", className: styles$M.container, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$M.all, children: [ Object.keys(entries).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx( EventSection, { title: "Configuration", - className: styles$J.tableSelection, + className: styles$M.tableSelection, children: /* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries, plain: true }) } ), - /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Usage", className: styles$J.tableSelection, children: event.output.usage !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage: event.output.usage }) : void 0 }), - /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Timing", className: styles$J.tableSelection, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Usage", className: styles$M.tableSelection, children: event.output.usage !== null ? /* @__PURE__ */ jsxRuntimeExports.jsx(ModelUsagePanel, { usage: event.output.usage }) : void 0 }), + /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Timing", className: styles$M.tableSelection, children: /* @__PURE__ */ jsxRuntimeExports.jsx( EventTimingPanel, { timestamp: event.timestamp, @@ -181986,21 +182325,21 @@ const ModelEventView = ({ } ) }) ] }), - event.tools.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Tools", className: styles$J.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolsConfig, { tools: event.tools, toolChoice: event.tool_choice }) }), + event.tools.length > 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Tools", className: styles$M.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolsConfig, { tools: event.tools, toolChoice: event.tool_choice }) }), event.call ? /* @__PURE__ */ jsxRuntimeExports.jsx( APIView, { "data-name": "API", call: event.call, error: event.error, - className: styles$J.container + className: styles$M.container } ) : "", - event.traceback_ansi && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Error", className: styles$J.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + event.traceback_ansi && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Error", className: styles$M.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( ANSIDisplay, { output: event.traceback_ansi, - className: styles$J.traceback + className: styles$M.traceback } ) }) ] @@ -182028,11 +182367,11 @@ const APICodeCell = ({ id, sourceCode }) => { if (!sourceCode) { return null; } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: sourceCodeRef, className: clsx("model-call"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$J.codePre), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: sourceCodeRef, className: clsx("model-call"), children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$M.codePre), children: /* @__PURE__ */ jsxRuntimeExports.jsx( "code", { id, - className: clsx("language-json", styles$J.code, "text-size-small"), + className: clsx("language-json", styles$M.code, "text-size-small"), children: sourceCode } ) }) }); @@ -182045,8 +182384,8 @@ const ToolsConfig = ({ tools: tools2, toolChoice: toolChoice2 }) => { ] }, `${tool2.name}-${idx}`); }); return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$J.toolConfig, "text-size-small"), children: toolEls }), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$J.toolChoice, "text-size-small"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$M.toolConfig, "text-size-small"), children: toolEls }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$M.toolChoice, "text-size-small"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-style-secondary"), children: "Tool Choice" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(ToolChoiceView, { toolChoice: toolChoice2 }) }) ] }) @@ -182068,7 +182407,7 @@ const code$2 = "_code_1a3fk_5"; const sample = "_sample_1a3fk_10"; const section$1 = "_section_1a3fk_14"; const metadata$1 = "_metadata_1a3fk_21"; -const styles$H = { +const styles$K = { noMargin, code: code$2, sample, @@ -182085,13 +182424,13 @@ const SampleInitEventView = ({ if (event.sample.files && Object.keys(event.sample.files).length > 0) { sections.push( /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Files", children: Object.keys(event.sample.files).map((file) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$H.noMargin, children: file }, `sample-init-file-${file}`); + return /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$K.noMargin, children: file }, `sample-init-file-${file}`); }) }, `event-${eventNode.id}`) ); } if (event.sample.setup) { sections.push( - /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Setup", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$H.code, children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "sourceCode", children: event.sample.setup }) }) }, `${eventNode.id}-section-setup`) + /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Setup", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: styles$K.code, children: /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: "sourceCode", children: event.sample.setup }) }) }, `${eventNode.id}-section-setup`) ); } return /* @__PURE__ */ jsxRuntimeExports.jsxs( @@ -182104,7 +182443,7 @@ const SampleInitEventView = ({ icon: ApplicationIcons.sample, subTitle: formatDateTime(new Date(event.timestamp)), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Sample", className: styles$H.sample, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Sample", className: styles$K.sample, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ChatView, { @@ -182120,7 +182459,7 @@ const SampleInitEventView = ({ choice ] }, `$choice-{choice}`); }) : "", - sections.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$H.section, children: sections }) : "", + sections.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$K.section, children: sections }) : "", event.sample.target ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Target", children: toArray(event.sample.target).map((target2) => { return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-base"), children: target2 }, target2); }) }) : void 0 @@ -182130,7 +182469,7 @@ const SampleInitEventView = ({ MetaDataGrid, { "data-name": "Metadata", - className: styles$H.metadata, + className: styles$K.metadata, entries: event.sample.metadata } ) : "" @@ -182156,8 +182495,6 @@ const SampleLimitEventView = ({ return ApplicationIcons.limits.operator; case "working": return ApplicationIcons.limits.execution; - case "cost": - return ApplicationIcons.limits.cost; } }; const icon2 = resolve_icon(eventNode.event.type); @@ -182183,7 +182520,7 @@ const exec = "_exec_1irga_15"; const result = "_result_1irga_19"; const fileLabel = "_fileLabel_1irga_23"; const wrapPre = "_wrapPre_1irga_28"; -const styles$G = { +const styles$J = { twoColumn, exec, result, @@ -182217,10 +182554,10 @@ const ExecView = ({ id, event }) => { const input2 = event.input; const result2 = event.result; const output2 = event.output ? event.output.trim() : void 0; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$G.exec), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: `Command`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$G.twoColumn), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$G.wrapPre), children: cmd2 }), - /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$G.wrapPre), children: input2 !== null ? input2?.trim() : void 0 }), + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$J.exec), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: `Command`, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$J.twoColumn), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$J.wrapPre), children: cmd2 }), + /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$J.wrapPre), children: input2 !== null ? input2?.trim() : void 0 }), options2 !== null && Object.keys(options2).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: `Options`, children: /* @__PURE__ */ jsxRuntimeExports.jsx( MetaDataGrid, { @@ -182237,7 +182574,7 @@ const ExecView = ({ id, event }) => { entry: { name: "sandbox_output", value: output2 } } ) }) : void 0, - result2 !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$G.result, "text-size-base"), children: [ + result2 !== 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$J.result, "text-size-base"), children: [ "(exited with code ", result2, ")" @@ -182263,14 +182600,14 @@ const WriteFileView = ({ id, event }) => { }; const FileView = ({ id, file, contents: contents2 }) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "File", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$G.fileLabel), children: file }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "File", children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$J.fileLabel), children: file }) }), contents2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EventSection, { title: "Contents", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExpandablePanel, { id: `${id}-file`, collapse: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { children: contents2 }) }) }) : void 0 ] }); }; -const explanation = "_explanation_1k2k0_1"; -const wrappingContent$1 = "_wrappingContent_1k2k0_8"; -const separator$2 = "_separator_1k2k0_13"; -const styles$F = { +const explanation = "_explanation_2le0c_10"; +const wrappingContent$1 = "_wrappingContent_2le0c_17"; +const separator$2 = "_separator_2le0c_22"; +const styles$I = { explanation, wrappingContent: wrappingContent$1, separator: separator$2 @@ -182292,29 +182629,29 @@ const ScoreEventView = ({ icon: ApplicationIcons.scorer, collapsibleContent: true, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Explanation", className: clsx(styles$F.explanation), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Explanation", className: clsx(styles$I.explanation), children: [ event.target ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Target" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: resolvedTarget || "" }) }) ] }) : "", - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Answer" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.answer || "" }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.answer || "" }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Explanation" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.explanation || "" }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.score.explanation || "" }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Score" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderScore(event.score.value) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$F.separator) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$I.separator) }) ] }), event.score.metadata ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Metadata", children: /* @__PURE__ */ jsxRuntimeExports.jsx( RecordTree, { id: `${eventNode.id}-score-metadata`, record: event.score.metadata, - className: styles$F.metadataTree, + className: styles$I.metadataTree, defaultExpandLevel: 0 } ) }) : void 0 @@ -190427,7 +190764,7 @@ const lightboxContent = "_lightboxContent_1mvg8_33"; const lightboxButtonCloseWrapper = "_lightboxButtonCloseWrapper_1mvg8_45"; const lightboxButtonClose = "_lightboxButtonClose_1mvg8_45"; const lightboxPreviewButton = "_lightboxPreviewButton_1mvg8_63"; -const styles$E = { +const styles$H = { carouselThumbs, carouselThumb, carouselPlayIcon, @@ -190496,12 +190833,12 @@ const LightboxCarousel = ({ id, slides }) => { [openLightbox] ); return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("lightbox-carousel-container"), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$E.carouselThumbs), children: slides.map((slide, index) => { + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$H.carouselThumbs), children: slides.map((slide, index) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { "data-index": index, - className: clsx(styles$E.carouselThumb), + className: clsx(styles$H.carouselThumb), onClick: handleThumbClick, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: slide.label }), @@ -190510,7 +190847,7 @@ const LightboxCarousel = ({ id, slides }) => { { className: clsx( ApplicationIcons.play, - styles$E.carouselPlayIcon + styles$H.carouselPlayIcon ) } ) }) @@ -190522,12 +190859,12 @@ const LightboxCarousel = ({ id, slides }) => { showOverlay && /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$E.lightboxOverlay, isOpen ? "open" : "closed"), + className: clsx(styles$H.lightboxOverlay, isOpen ? "open" : "closed"), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$E.lightboxButtonCloseWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$H.lightboxButtonCloseWrapper), children: /* @__PURE__ */ jsxRuntimeExports.jsx( "button", { - className: styles$E.lightboxButtonClose, + className: styles$H.lightboxButtonClose, onClick: closeLightbox, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.close }) } @@ -190535,7 +190872,7 @@ const LightboxCarousel = ({ id, slides }) => { slides.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( "button", { - className: clsx(styles$E.lightboxPreviewButton, "prev"), + className: clsx(styles$H.lightboxPreviewButton, "prev"), onClick: showPrev, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.previous }) } @@ -190543,7 +190880,7 @@ const LightboxCarousel = ({ id, slides }) => { slides.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( "button", { - className: clsx(styles$E.lightboxPreviewButton, "next"), + className: clsx(styles$H.lightboxPreviewButton, "next"), onClick: showNext, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.next }) } @@ -190551,7 +190888,7 @@ const LightboxCarousel = ({ id, slides }) => { /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx(styles$E.lightboxContent, isOpen ? "open" : "closed"), + className: clsx(styles$H.lightboxContent, isOpen ? "open" : "closed"), children: slides[currentIndex].render() }, `carousel-slide-${currentIndex}` @@ -190651,7 +190988,7 @@ const extractSize = (value2, label2, defaultValue) => { const toolsGrid = "_toolsGrid_1qqm2_1"; const tools = "_tools_1qqm2_1"; const tool = "_tool_1qqm2_1"; -const styles$D = { +const styles$G = { toolsGrid, tools, tool @@ -190820,7 +191157,7 @@ const renderTools = (changes, resolvedState) => { toolsInfo["Tools"] = /* @__PURE__ */ jsxRuntimeExports.jsx(Tools, { toolDefinitions: filtered }); } } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$D.tools), children: Object.keys(toolsInfo).map((key2) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$G.tools), children: Object.keys(toolsInfo).map((key2) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", @@ -190875,7 +191212,7 @@ const StoreSpecificRenderableTypes = [ human_baseline_session ]; const Tools = ({ toolDefinitions }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$D.toolsGrid, children: toolDefinitions.map((toolDefinition, idx) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$G.toolsGrid, children: toolDefinitions.map((toolDefinition, idx) => { const toolName = toolDefinition.name; const toolArgs = toolDefinition.parameters?.properties ? Object.keys(toolDefinition.parameters.properties) : []; return /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -190890,11 +191227,11 @@ const Tools = ({ toolDefinitions }) => { }; const Tool = ({ toolName, toolArgs }) => { const functionCall = toolArgs && toolArgs.length > 0 ? `${toolName}(${toolArgs.join(", ")})` : toolName; - return /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-smallest", styles$D.tool), children: functionCall }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("code", { className: clsx("text-size-smallest", styles$G.tool), children: functionCall }); }; const diff = "_diff_eobja_1"; const summary$2 = "_summary_eobja_6"; -const styles$C = { +const styles$F = { diff, summary: summary$2 }; @@ -190939,14 +191276,14 @@ const StateEventView = ({ text: !changePreview ? summary2 : void 0, collapsibleContent: true, children: [ - changePreview ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Summary", className: clsx(styles$C.summary), children: changePreview }) : void 0, + changePreview ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { "data-name": "Summary", className: clsx(styles$F.summary), children: changePreview }) : void 0, /* @__PURE__ */ jsxRuntimeExports.jsx( StateDiffView, { before, after, "data-name": "Diff", - className: clsx(styles$C.diff) + className: clsx(styles$F.diff) } ) ] @@ -191219,7 +191556,7 @@ const summary$1 = "_summary_ac4z2_1"; const summaryRendered = "_summaryRendered_ac4z2_6"; const subtaskSummary = "_subtaskSummary_ac4z2_10"; const subtaskLabel = "_subtaskLabel_ac4z2_17"; -const styles$B = { +const styles$E = { summary: summary$1, summaryRendered, subtaskSummary, @@ -191234,9 +191571,9 @@ const SubtaskEventView = ({ const body2 = []; if (event.type === "fork") { body2.push( - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { title: "Summary", className: clsx(styles$B.summary), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { title: "Summary", className: clsx(styles$E.summary), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Inputs" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$B.summaryRendered), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: event.input }) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$E.summaryRendered), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: event.input }) }) ] }) ); } else { @@ -191267,12 +191604,12 @@ const SubtaskEventView = ({ }; const SubtaskSummary = ({ input: input2, result: result2 }) => { const output2 = typeof result2 === "object" ? result2 : { result: result2 }; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$B.subtaskSummary), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$E.subtaskSummary), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-size-small"), children: "Input" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-large", styles$B.subtaskLabel) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-large", styles$E.subtaskLabel) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label", "text-size-small"), children: "Output" }), input2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: input2 }) : void 0, - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-title-secondary", styles$B.subtaskLabel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-title-secondary", styles$E.subtaskLabel), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Rendered, { values: output2 }) }) ] }); }; @@ -191297,7 +191634,7 @@ const None = () => { const summary = "_summary_1qsnv_1"; const approval = "_approval_1qsnv_6"; const progress = "_progress_1qsnv_12"; -const styles$A = { +const styles$D = { summary, approval, progress @@ -191338,7 +191675,7 @@ const ToolEventView = ({ childIds: children2.map((child) => child.id), collapseControl: "bottom", turnLabel: turnLabel2, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$A.summary, children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { "data-name": "Summary", className: styles$D.summary, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ToolCallView, { @@ -191349,10 +191686,7 @@ const ToolEventView = ({ contentType, output: event.error?.message || event.result, mode: "compact", - view: event.view ? substituteToolCallContent( - event.view, - event.arguments - ) : void 0 + view: event.view ? event.view : void 0 } ), lastModelNode ? /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -191369,22 +191703,22 @@ const ToolEventView = ({ ApprovalEventView, { eventNode: approvalNode, - className: styles$A.approval + className: styles$D.approval } ) : "", - event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$A.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0 + event.pending ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$D.progress), children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false, size: "medium" }) }) : void 0 ] }) } ); }; -const container$c = "_container_io1r0_1"; +const container$d = "_container_io1r0_1"; const wrappingContent = "_wrappingContent_io1r0_8"; const separator$1 = "_separator_io1r0_13"; const unchanged = "_unchanged_io1r0_22"; const section = "_section_io1r0_27"; const spacer = "_spacer_io1r0_31"; -const styles$z = { - container: container$c, +const styles$C = { + container: container$d, wrappingContent, separator: separator$1, unchanged, @@ -191415,46 +191749,46 @@ const ScoreEditEventView = ({ className: clsx( "text-style-label", "text-style-secondary", - styles$z.section + styles$C.section ), children: "Updated Values" } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$z.container), children: [ - event.edit.value !== void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$C.container), children: [ + event.edit.value ? /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Value" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: renderScore(event.edit.value) }) ] }) : "", - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Answer" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.wrappingContent), children: event.edit.answer === kUnchangedSentinel ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$z.unchanged), children: "[unchanged]" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.answer || "" }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.wrappingContent), children: event.edit.answer === kUnchangedSentinel ? /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: clsx(styles$C.unchanged), children: "[unchanged]" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.answer || "" }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Explanation" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.explanation || "" }) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.explanation || "" }) }) ] }), - event.edit.provenance ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$z.container), children: [ + event.edit.provenance ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$C.container), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( "text-style-label", "text-style-secondary", - styles$z.section + styles$C.section ), children: "Provenance" } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.spacer) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.spacer) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Author" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.author }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.author }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Reason" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.reason || "" }) }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.separator) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx(RenderedText, { markdown: event.edit.provenance.reason || "" }) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.separator) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-style-label", children: "Time" }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$C.wrappingContent), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RenderedText, { markdown: formatDateTime(new Date(event.edit.provenance.timestamp)) || "" @@ -191466,7 +191800,7 @@ const ScoreEditEventView = ({ { id: `${eventNode.id}-score-metadata`, record: event.edit.metadata || {}, - className: styles$z.metadataTree, + className: styles$C.metadataTree, defaultExpandLevel: 0 } ) }) : void 0 @@ -191547,7 +191881,7 @@ const node = "_node_1r858_1"; const attached = "_attached_1r858_5"; const attachedParent = "_attachedParent_1r858_9"; const attachedChild = "_attachedChild_1r858_16"; -const styles$y = { +const styles$B = { node, attached, attachedParent, @@ -191593,13 +191927,6 @@ const eventSearchText = (node2) => { if (event.error?.message) { texts.push(event.error.message); } - if (event.view?.content) { - const substituted = substituteToolCallContent( - event.view, - event.arguments - ); - texts.push(substituted.content); - } break; } case "error": { @@ -191816,22 +192143,22 @@ const TranscriptVirtualListComponent = ({ }, [eventNodes, hasToolEventsAtCurrentDepth, turnMap]); const renderRow = reactExports.useCallback( (index, item2, style2) => { - const paddingClass = index === 0 ? styles$y.first : void 0; + const paddingClass = index === 0 ? styles$B.first : void 0; const previousIndex = index - 1; const nextIndex = index + 1; const previous = previousIndex > 0 && previousIndex <= eventNodes.length ? eventNodes[previousIndex] : void 0; const next = nextIndex < eventNodes.length ? eventNodes[nextIndex] : void 0; const attached2 = item2.event.event === "tool" && (previous?.event.event === "tool" || previous?.event.event === "model"); const attachedParent2 = item2.event.event === "model" && next?.event.event === "tool"; - const attachedClass = attached2 ? styles$y.attached : void 0; - const attachedChildClass = attached2 ? styles$y.attachedChild : void 0; - const attachedParentClass = attachedParent2 ? styles$y.attachedParent : void 0; + const attachedClass = attached2 ? styles$B.attached : void 0; + const attachedChildClass = attached2 ? styles$B.attachedChild : void 0; + const attachedParentClass = attachedParent2 ? styles$B.attachedParent : void 0; const context = contextMap.get(item2.id); return /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { id: item2.id, - className: clsx(styles$y.node, paddingClass, attachedClass), + className: clsx(styles$B.node, paddingClass, attachedClass), style: { ...style2, paddingLeft: `${item2.depth <= 1 ? item2.depth * 0.7 : (0.7 + item2.depth - 1) * 1}em`, @@ -191878,7 +192205,7 @@ const TranscriptVirtualListComponent = ({ } }; const panel$4 = "_panel_8zdtn_1"; -const styles$x = { +const styles$A = { panel: panel$4 }; const CompactionEventView = ({ @@ -191903,7 +192230,7 @@ const CompactionEventView = ({ className: className2, subTitle: formatDateTime(new Date(event.timestamp)), icon: ApplicationIcons.info, - children: [/* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: data, className: styles$x.panel })] + children: [/* @__PURE__ */ jsxRuntimeExports.jsx(MetaDataGrid, { entries: data, className: styles$A.panel })] } ); }; @@ -192095,8 +192422,8 @@ const RenderedEventNode = reactExports.memo( } } ); -const transformTree = (roots) => { - const treeNodeTransformers = transformers(); +const transformTree = (roots, options2 = {}) => { + const treeNodeTransformers = transformers(options2); const visitNode = (node2) => { let currentNodes = [node2]; currentNodes = currentNodes.map((n) => { @@ -192133,7 +192460,7 @@ const transformTree = (roots) => { } return [...processedRoots, ...flushedNodes]; }; -const transformers = () => { +const transformers = (options2 = {}) => { const treeNodeTransformers = [ { name: "unwrap_tools", @@ -192150,11 +192477,6 @@ const transformers = () => { matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 2 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE, process: (node2) => skipFirstChildNode(node2) }, - { - name: "unwrap_filtered-agent_solver", - matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 1 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT, - process: (node2) => skipFirstChildNode(node2) - }, { name: "unwrap_agent_solver w/store", matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event["type"] === TYPE_SOLVER && node2.children.length === 3 && node2.children[0].event.event === SPAN_BEGIN && node2.children[0].event.type === TYPE_AGENT && node2.children[1].event.event === STATE && node2.children[2].event.event === STORE, @@ -192184,6 +192506,13 @@ const transformers = () => { } } ]; + if (options2.flatView) { + treeNodeTransformers.push({ + name: "flatten_solver_spans", + matches: (node2) => node2.event.event === SPAN_BEGIN && node2.event.type === TYPE_SOLVER, + process: (node2) => discardNode(node2) + }); + } return treeNodeTransformers; }; const elevateChildNode = (node2, childEventType) => { @@ -192232,12 +192561,22 @@ const setDepth = (nodes, depth) => { return node2; }); }; -function treeifyEvents(events, depth) { +function treeifyEvents(events, depth, options2 = {}) { const useSpans = hasSpans(events); events = injectScorersSpan(events); const nodes = useSpans ? treeifyWithSpans(events, depth) : treeifyWithSteps(events, depth); - return useSpans ? transformTree(nodes) : nodes; + let result2 = useSpans ? transformTree(nodes, options2) : nodes; + if (options2.flatView) { + result2 = sortNodesByTime(result2); + } + return result2; } +const sortNodesByTime = (nodes) => { + return [...nodes].sort((a, b) => a.event.working_start - b.event.working_start).map((node2) => ({ + ...node2, + children: node2.children.length > 0 ? sortNodesByTime(node2.children) : [] + })); +}; const treeifyWithSpans = (events, depth) => { const { rootNodes, createNode } = createNodeFactory(depth); const spanNodes = /* @__PURE__ */ new Map(); @@ -192252,7 +192591,10 @@ const treeifyWithSpans = (events, depth) => { const parentNode = resolvedParent ?? null; const node2 = createNode(event, parentNode); if (event.event === SPAN_BEGIN) { - spanNodes.set(event.id, node2); + const spanId = getEventSpanId(event); + if (spanId !== null) { + spanNodes.set(spanId, node2); + } } }; events.forEach((event) => processEvent(event)); @@ -192403,10 +192745,10 @@ const injectScorersSpan = (events) => { } return results; }; -const useEventNodes = (events, running) => { +const useEventNodes = (events, running, flatView = false) => { const { eventTree, defaultCollapsedIds } = reactExports.useMemo(() => { const resolvedEvents = fixupEventStream(events, !running); - const rawEventTree = treeifyEvents(resolvedEvents, 0); + const rawEventTree = treeifyEvents(resolvedEvents, 0, { flatView }); const filterEmpty = (eventNodes) => { return eventNodes.filter((node2) => { if (node2.children && node2.children.length > 0) { @@ -192431,7 +192773,7 @@ const useEventNodes = (events, running) => { }; findCollapsibleEvents(eventTree2); return { eventTree: eventTree2, defaultCollapsedIds: defaultCollapsedIds2 }; - }, [events, running]); + }, [events, running, flatView]); return { eventNodes: eventTree, defaultCollapsedIds }; }; const collapseFilters = [ @@ -192458,7 +192800,8 @@ const TranscriptPanel = reactExports.memo((props) => { const filteredEventTypes = useStore( (state) => state.sample.eventFilter.filteredTypes ); - const sampleStatus2 = useStore((state) => state.sample.sampleStatus); + const sampleStatus = useStore((state) => state.sample.sampleStatus); + const flatView = useStore((state) => state.sample.flatView); const filteredEvents = reactExports.useMemo(() => { if (filteredEventTypes.length === 0) { return events; @@ -192469,7 +192812,8 @@ const TranscriptPanel = reactExports.memo((props) => { }, [events, filteredEventTypes]); const { eventNodes, defaultCollapsedIds } = useEventNodes( filteredEvents, - running === true + running === true, + flatView ); const collapsedEvents = useStore((state) => state.sample.collapsedEvents); const setCollapsedEvents = useStore( @@ -192593,7 +192937,7 @@ const TranscriptPanel = reactExports.memo((props) => { document.removeEventListener("keydown", handleKeyDown); }; }, [flattenedNodes]); - if (sampleStatus2 === "loading" && flattenedNodes.length === 0) { + if (sampleStatus === "loading" && flattenedNodes.length === 0) { return void 0; } if (flattenedNodes.length === 0) { @@ -192605,21 +192949,21 @@ const TranscriptPanel = reactExports.memo((props) => { "div", { className: clsx( - styles$R.container, - collapsed2 ? styles$R.collapsed : void 0 + styles$U.container, + collapsed2 ? styles$U.collapsed : void 0 ), children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( StickyScroll, { scrollRef, - className: styles$R.treeContainer, + className: styles$U.treeContainer, offsetTop: topOffset, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( TranscriptOutline, { - className: clsx(styles$R.outline), + className: clsx(styles$U.outline), eventNodes, filteredNodes: outlineFilteredNodes, running, @@ -192630,7 +192974,7 @@ const TranscriptPanel = reactExports.memo((props) => { /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: styles$R.outlineToggle, + className: styles$U.outlineToggle, onClick: () => setCollapsed(!collapsed2), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.sidebar }) } @@ -192648,7 +192992,7 @@ const TranscriptPanel = reactExports.memo((props) => { running, initialEventId: initialEventId === void 0 ? null : initialEventId, offsetTop: topOffset, - className: styles$R.listContainer, + className: styles$U.listContainer, turnMap } ) @@ -192657,47 +193001,9 @@ const TranscriptPanel = reactExports.memo((props) => { ); } }); -const printHtml = (html2, css2) => { - const printWindow = window.open("", "", "height=600,width=800"); - if (printWindow !== null) { - printWindow.document.write("Print"); - printWindow.document.write(` - - - `); - printWindow.document.write(""); - printWindow.document.write(html2); - printWindow.document.write(""); - printWindow.document.close(); - printWindow.onload = function() { - printWindow.focus(); - printWindow.print(); - printWindow.close(); - }; - } else { - console.error("Print window failed to open."); - } -}; -const printHeadingHtml = (evalSpec) => { - const task = evalSpec?.task || "Unknown Task"; - const model2 = evalSpec?.model || "Unknown Model"; - const time = evalSpec?.created ? new Date(evalSpec.created).toLocaleString() : "Unknown Time"; - const headingHtml = ` -
-
${task}
-
${model2}
-
${time}
-
`; - return headingHtml; -}; const SampleDisplay = ({ id, scrollRef, - showActivity, focusOnLoad }) => { const baseId = `sample-display`; @@ -192741,7 +193047,6 @@ const SampleDisplay = ({ return []; } }, [sample2?.messages, runningSampleData]); - const hasSampleData = sample2 !== void 0 || sampleEvents !== void 0 || sampleMessages !== void 0; const { logPath: urlLogPath, id: urlSampleId, @@ -192791,8 +193096,8 @@ const SampleDisplay = ({ const filterRef = reactExports.useRef(null); const optionsRef = reactExports.useRef(null); const handlePrintClick = reactExports.useCallback(() => { - printSample(id, targetId, evalSpec); - }, [id, targetId, evalSpec]); + printSample(id, targetId); + }, [id, targetId]); const toggleFilter = reactExports.useCallback(() => { setShowing(!isShowing); }, [setShowing, isShowing]); @@ -192809,9 +193114,9 @@ const SampleDisplay = ({ const toggleCollapsedMode = reactExports.useCallback(() => { setCollapsedMode(isCollapsed(collapsedMode) ? "expanded" : "collapsed"); }, [collapsedMode, setCollapsedMode]); - const { isDebugFilter, isDefaultFilter, isNoneFilter } = useTranscriptFilter(); - const api2 = useStore((state) => state.api); - const downloadFiles = useStore((state) => state.capabilities.downloadFiles); + const flatView = useStore((state) => state.sample.flatView); + const setFlatView = useStore((state) => state.sampleActions.setFlatView); + const { isDebugFilter, isDefaultFilter } = useTranscriptFilter(); const tools2 = []; const [icon2, setIcon] = reactExports.useState(ApplicationIcons.copy); tools2.push( @@ -192844,35 +193149,8 @@ const SampleDisplay = ({ "sample-copy" ) ); - if (downloadFiles && sample2 && api2?.download_file) { - const sampleId = sample2.id ?? "sample"; - tools2.push( - /* @__PURE__ */ jsxRuntimeExports.jsx( - ToolDropdownButton, - { - label: "Download", - icon: ApplicationIcons.downloadLog, - items: { - "Sample JSON": () => { - api2.download_file( - `${sampleId}.json`, - JSON.stringify(sample2, null, 2) - ); - }, - Transcript: () => { - api2.download_file( - `${sampleId}-transcript.txt`, - messagesToStr(sample2.messages ?? []) - ); - } - } - }, - "sample-download" - ) - ); - } if (selectedTab === kSampleTranscriptTabId) { - const label2 = isNoneFilter ? "None" : isDebugFilter ? "Debug" : isDefaultFilter ? "Default" : "Custom"; + const label2 = isDebugFilter ? "Debug" : isDefaultFilter ? "Default" : "Custom"; tools2.push( /* @__PURE__ */ jsxRuntimeExports.jsx( ToolButton, @@ -192896,6 +193174,17 @@ const SampleDisplay = ({ "sample-collapse-transcript" ) ); + tools2.push( + /* @__PURE__ */ jsxRuntimeExports.jsx( + ToolButton, + { + label: flatView ? "Tree" : "Flat", + icon: flatView ? "bi bi-list-nested" : "bi bi-diagram-3", + onClick: () => setFlatView(!flatView) + }, + "sample-flat-view" + ) + ); } tools2.push( /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -192927,17 +193216,17 @@ const SampleDisplay = ({ return isRunning(selectedSampleSummary, runningSampleData); }, [selectedSampleSummary, runningSampleData]); const sampleDetailNavigation = useSampleDetailNavigation(); + const displaySample = sample2 || selectedSampleSummary; return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - selectedSampleSummary ? /* @__PURE__ */ jsxRuntimeExports.jsx(SampleSummaryView, { parent_id: id, sample: selectedSampleSummary }) : void 0, - /* @__PURE__ */ jsxRuntimeExports.jsx(ActivityBar, { animating: showActivity }), - hasSampleData && /* @__PURE__ */ jsxRuntimeExports.jsxs( + displaySample ? /* @__PURE__ */ jsxRuntimeExports.jsx(SampleSummaryView, { parent_id: id, sample: displaySample }) : void 0, + /* @__PURE__ */ jsxRuntimeExports.jsxs( TabSet, { id: tabsetId, tabsRef, - className: clsx(styles$Z.tabControls), + className: clsx(styles$10.tabControls), tabControlsClassName: clsx("text-size-base"), - tabPanelsClassName: clsx(styles$Z.tabPanel), + tabPanelsClassName: clsx(styles$10.tabPanel), tools: tools2, children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs( @@ -192946,8 +193235,8 @@ const SampleDisplay = ({ id: kSampleTranscriptTabId, className: clsx( "sample-tab", - styles$Z.transcriptContainer, - styles$Z.overflowVisible + styles$10.transcriptContainer, + styles$10.overflowVisible ), title: "Transcript", onSelected: onSelectedTab, @@ -192985,9 +193274,9 @@ const SampleDisplay = ({ id: kSampleMessagesTabId, className: clsx( "sample-tab", - styles$Z.fullWidth, - styles$Z.chat, - styles$Z.overflowVisible + styles$10.fullWidth, + styles$10.chat, + styles$10.overflowVisible ), title: "Messages", onSelected: onSelectedTab, @@ -193004,7 +193293,7 @@ const SampleDisplay = ({ scrollRef, toolCallStyle: "complete", running, - className: styles$Z.fullWidth + className: styles$10.fullWidth }, `${baseId}-chat-${id}` ) @@ -193023,7 +193312,7 @@ const SampleDisplay = ({ SampleScoresView, { sample: sample2, - className: styles$Z.padded, + className: styles$10.padded, scrollRef } ) @@ -193038,7 +193327,7 @@ const SampleDisplay = ({ title: "Metadata", onSelected: onSelectedTab, selected: effectiveSelectedTab === kSampleMetdataTabId, - children: sampleMetadatas.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Z.padded, styles$Z.fullWidth), children: sampleMetadatas }) : /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "No sample metadata available" }) + children: !sample2 || sampleMetadatas.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$10.padded, styles$10.fullWidth), children: sampleMetadatas }) : /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "No metadata" }) } ), sample2?.error || sample2?.error_retries && sample2?.error_retries.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -193049,14 +193338,14 @@ const SampleDisplay = ({ title: "Errors", onSelected: onSelectedTab, selected: effectiveSelectedTab === kSampleErrorTabId, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$Z.error), children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$10.error), children: [ sample2?.error ? /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: `Sample Error` }), /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { children: /* @__PURE__ */ jsxRuntimeExports.jsx( ANSIDisplay, { output: sample2.error.traceback_ansi, - className: clsx("text-size-small", styles$Z.ansi), + className: clsx("text-size-small", styles$10.ansi), style: { fontSize: "clamp(0.3rem, 1.1vw, 0.8rem)", margin: "0.5em 0" @@ -193071,7 +193360,7 @@ const SampleDisplay = ({ ANSIDisplay, { output: retry.traceback_ansi, - className: clsx("text-size-small", styles$Z.ansi), + className: clsx("text-size-small", styles$10.ansi), style: { fontSize: "clamp(0.3rem, 1.1vw, 0.8rem)", margin: "0.5em 0" @@ -193091,7 +193380,7 @@ const SampleDisplay = ({ title: "JSON", onSelected: onSelectedTab, selected: effectiveSelectedTab === kSampleJsonTabId, - children: !sample2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON not available" }) : estimateSize(sample2.events) > 25 * 1024 * 1024 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON too large to display" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$Z.padded, styles$Z.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + children: !sample2 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON not available" }) : estimateSize(sample2.events) > 25 * 1024 * 1024 ? /* @__PURE__ */ jsxRuntimeExports.jsx(NoContentsPanel, { text: "JSON too large to display" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$10.padded, styles$10.fullWidth), children: /* @__PURE__ */ jsxRuntimeExports.jsx( JSONPanel, { data: sample2, @@ -193142,7 +193431,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { { id: `task-sample-invalidation-${id}`, record: invalidationRecord, - className: clsx("tab-pane", styles$Z.noTop), + className: clsx("tab-pane", styles$10.noTop), scrollRef } ) }) @@ -193157,7 +193446,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { ModelTokenTable, { model_usage: sample2.model_usage, - className: clsx(styles$Z.noTop) + className: clsx(styles$10.noTop) } ) }) ] }, `sample-usage-${id}`) @@ -193175,7 +193464,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { Working: formatTime$1(sample2.working_time), Total: formatTime$1(sample2.total_time) }, - className: clsx("tab-pane", styles$Z.noTop), + className: clsx("tab-pane", styles$10.noTop), scrollRef } ) }) @@ -193191,7 +193480,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { { id: `task-sample-metadata-${id}`, record: sample2?.metadata, - className: clsx("tab-pane", styles$Z.noTop), + className: clsx("tab-pane", styles$10.noTop), scrollRef } ) }) @@ -193207,7 +193496,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { { id: `task-sample-store-${id}`, record: sample2?.store, - className: clsx("tab-pane", styles$Z.noTop), + className: clsx("tab-pane", styles$10.noTop), scrollRef, processStore: true } @@ -193217,7 +193506,7 @@ const metadataViewsForSample = (id, scrollRef, sample2) => { } return sampleMetadatas; }; -const printSample = (id, targetId, evalSpec) => { +const printSample = (id, targetId) => { const targetTabEl = document.querySelector( `#${escapeSelector(targetId)} .sample-tab.tab-pane.show.active` ); @@ -193226,7 +193515,7 @@ const printSample = (id, targetId, evalSpec) => { if (targetEl) { const headingId = `sample-heading-${id}`; const headingEl = document.getElementById(headingId); - const headingHtml = printHeadingHtml(evalSpec); + const headingHtml = printHeadingHtml(); const css2 = ` html { font-size: 9pt } /* Allow content to break anywhere without any forced page breaks */ @@ -193239,6 +193528,13 @@ const printSample = (id, targetId, evalSpec) => { page-break-after: auto; } /* Specifically disable all page breaks for divs */ + div { + break-inside: auto; + page-break-inside: auto; + } + body > .transcript-step { + break-inside: avoid; + } body{ -webkit-print-color-adjust:exact !important; print-color-adjust:exact !important; @@ -193276,10 +193572,10 @@ const isRunning = (sampleSummary, runningSampleData) => { } return false; }; -const container$b = "_container_ly812_1"; +const container$c = "_container_ly812_1"; const scroller = "_scroller_ly812_7"; -const styles$w = { - container: container$b, +const styles$z = { + container: container$c, scroller }; const InlineSampleDisplay = ({ @@ -193295,35 +193591,44 @@ const InlineSampleComponent = ({ className: className2 }) => { const sampleData = useSampleData(); + const sampleProgress = sampleData.status === "loading" && sampleData.downloadProgress && sampleData.downloadProgress.bytesTotal > 0 ? sampleData.downloadProgress.bytesLoaded / sampleData.downloadProgress.bytesTotal : void 0; const scrollRef = reactExports.useRef(null); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(className2, styles$w.container), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$w.scroller), ref: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StickyScrollProvider, { value: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$w.body, children: sampleData.error ? /* @__PURE__ */ jsxRuntimeExports.jsx( - ErrorPanel, - { - title: "Unable to load sample", - error: sampleData.error - } - ) : /* @__PURE__ */ jsxRuntimeExports.jsx( - SampleDisplay, - { - id: "inline-sample-display", - showActivity: !!showActivity, - scrollRef - } - ) }) }) }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2, styles$z.container), children: [ + showActivity && /* @__PURE__ */ jsxRuntimeExports.jsx( + ActivityBar, + { + animating: sampleData.status === "loading" || sampleData.status === "streaming", + progress: sampleProgress + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$z.scroller), ref: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(StickyScrollProvider, { value: scrollRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$z.body, children: sampleData.error ? /* @__PURE__ */ jsxRuntimeExports.jsx( + ErrorPanel, + { + title: "Unable to load sample", + error: sampleData.error + } + ) : /* @__PURE__ */ jsxRuntimeExports.jsx( + SampleDisplay, + { + id: "inline-sample-display", + scrollRef + } + ) }) }) }) + ] }); }; const detail = "_detail_14cqz_1"; const panel$3 = "_panel_14cqz_7"; const sampleInfo = "_sampleInfo_14cqz_11"; const sampleNav = "_sampleNav_14cqz_17"; const nav$1 = "_nav_14cqz_25"; -const disabled = "_disabled_14cqz_25"; -const styles$v = { +const disabled$1 = "_disabled_14cqz_25"; +const styles$y = { detail, panel: panel$3, sampleInfo, sampleNav, nav: nav$1, - disabled + disabled: disabled$1 }; const SampleDetailComponent = ({ sampleId, @@ -193343,7 +193648,7 @@ const SampleDetailComponent = ({ const sample2 = reactExports.useMemo(() => { return sampleData.getSelectedSample(); }, [sampleData]); - const sampleStatus2 = useStore((state) => state.sample.sampleStatus); + const sampleStatus = useStore((state) => state.sample.sampleStatus); const sampleMatchesRequest = reactExports.useMemo(() => { if (!sampleId || !epoch) return false; if (!sample2) return true; @@ -193414,7 +193719,7 @@ const SampleDetailComponent = ({ ); return /* @__PURE__ */ jsxRuntimeExports.jsxs(ExtendedFindProvider, { children: [ showFind ? /* @__PURE__ */ jsxRuntimeExports.jsx(FindBand, {}) : "", - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$v.detail, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$y.detail, children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( ApplicationNavbar, { @@ -193422,7 +193727,7 @@ const SampleDetailComponent = ({ fnNavigationUrl, bordered: bordered2, breadcrumbsEnabled, - children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$v.sampleNav), children: [ + children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$y.sampleNav), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { @@ -193432,11 +193737,11 @@ const SampleDetailComponent = ({ role: "button", "aria-label": "Previous sample", "aria-disabled": !hasPrevious, - className: clsx(!hasPrevious && styles$v.disabled, styles$v.nav), + className: clsx(!hasPrevious && styles$y.disabled, styles$y.nav), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.previous) }) } ), - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$v.sampleInfo, "text-size-smallest"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$y.sampleInfo, "text-size-smallest"), children: [ "Sample ", sampleId, " (Epoch ", @@ -193452,18 +193757,18 @@ const SampleDetailComponent = ({ role: "button", "aria-label": "Next sample", "aria-disabled": !hasNext, - className: clsx(!hasNext && styles$v.disabled, styles$v.nav), + className: clsx(!hasNext && styles$y.disabled, styles$y.nav), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(ApplicationIcons.next) }) } ) ] }) } ), - sampleMatchesRequest && /* @__PURE__ */ jsxRuntimeExports.jsx( + sampleStatus !== "loading" && sampleMatchesRequest && /* @__PURE__ */ jsxRuntimeExports.jsx( InlineSampleComponent, { - showActivity: sampleStatus2 === "loading" || sampleStatus2 === "streaming", - className: styles$v.panel + showActivity: false, + className: styles$y.panel } ) ] }) @@ -193610,7 +193915,7 @@ const tabContainer = "_tabContainer_1r3mu_6"; const tabSet = "_tabSet_1r3mu_14"; const tabs = "_tabs_1r3mu_21"; const tabPanels = "_tabPanels_1r3mu_29"; -const styles$u = { +const styles$x = { workspace, tabContainer, tabSet, @@ -193618,7 +193923,7 @@ const styles$u = { tabPanels }; const message = "_message_1gb2h_5"; -const styles$t = { +const styles$w = { "task-error-display": "_task-error-display_1gb2h_1", message }; @@ -193637,7 +193942,7 @@ const TaskErrorCard = ({ error: error2 }) => { { id: "task-error-collapse", collapse: true, - className: clsx("text-size-smaller", styles$t.message), + className: clsx("text-size-smaller", styles$w.message), children: /* @__PURE__ */ jsxRuntimeExports.jsx( RenderedContent, { @@ -193651,7 +193956,7 @@ const TaskErrorCard = ({ error: error2 }) => { ANSIDisplay, { output: error2.traceback_ansi, - className: styles$t["task-error-display"] + className: styles$w["task-error-display"] } ) ] }) @@ -193717,7 +194022,7 @@ const MessageBand = ({ ] }); }; const item$1 = "_item_1uzhd_1"; -const styles$s = { +const styles$v = { item: item$1 }; const DatasetDetailView = ({ @@ -193728,12 +194033,12 @@ const DatasetDetailView = ({ Object.entries(dataset).filter(([key2]) => key2 !== "sample_ids") ); if (!dataset || Object.keys(filtered).length === 0) { - return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-base", styles$s.item), style: style2, children: "No dataset information available" }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("text-size-base", styles$v.item), style: style2, children: "No dataset information available" }); } return /* @__PURE__ */ jsxRuntimeExports.jsx( MetaDataGrid, { - className: clsx("text-size-base", styles$s.item), + className: clsx("text-size-base", styles$v.item), entries: filtered, style: style2, plain: true @@ -193741,11 +194046,11 @@ const DatasetDetailView = ({ ); }; const icon$1 = "_icon_59zaz_1"; -const container$a = "_container_59zaz_5"; +const container$b = "_container_59zaz_5"; const metadata = "_metadata_59zaz_11"; -const styles$r = { +const styles$u = { icon: icon$1, - container: container$a, + container: container$b, metadata }; const DetailStep = ({ @@ -193754,22 +194059,22 @@ const DetailStep = ({ params, className: className2 }) => { - const iconHtml = icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$r.icon) }) : ""; + const iconHtml = icon2 ? /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, styles$u.icon) }) : ""; return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(className2), children: [ iconHtml, " ", name2, - params && Object.keys(params).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$r.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + params && Object.keys(params).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$u.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( MetaDataGrid, { entries: params, - className: clsx("text-size-small", styles$r.metadata) + className: clsx("text-size-small", styles$u.metadata) } ) }) : "" ] }); }; const item = "_item_leq25_1"; -const styles$q = { +const styles$t = { item }; const ScorerDetailView = ({ @@ -193786,43 +194091,43 @@ const ScorerDetailView = ({ icon: ApplicationIcons.scorer, name: name2, params, - className: clsx(styles$q.item, "text-size-base") + className: clsx(styles$t.item, "text-size-base") } ); }; -const container$9 = "_container_12j2k_1"; +const container$a = "_container_12j2k_1"; const separator = "_separator_12j2k_11"; -const styles$p = { - container: container$9, +const styles$s = { + container: container$a, separator }; const SolversDetailView = ({ steps }) => { - const separator2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.items, "text-size-small", styles$p.separator), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) }); + const separator2 = /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$s.items, "text-size-small", styles$s.separator), children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: ApplicationIcons.arrows.right }) }); const details = steps?.map((step, index) => { return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( DetailStep, { name: step.solver, - className: clsx(styles$p.items, "text-size-small") + className: clsx(styles$s.items, "text-size-small") } ), index < steps.length - 1 ? separator2 : "" ] }, `solver-step-${index}`); }); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$p.container, children: details }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$s.container, children: details }); }; const floatingCol = "_floatingCol_1n79r_1"; const wideCol = "_wideCol_1n79r_9"; const planCol = "_planCol_1n79r_24"; -const container$8 = "_container_1n79r_29"; -const grid$3 = "_grid_1n79r_35"; -const styles$o = { +const container$9 = "_container_1n79r_29"; +const grid$4 = "_grid_1n79r_35"; +const styles$r = { floatingCol, wideCol, planCol, - container: container$8, - grid: grid$3 + container: container$9, + grid: grid$4 }; const PlanDetailView = ({ evaluation, @@ -193836,13 +194141,13 @@ const PlanDetailView = ({ const taskColumns = []; taskColumns.push({ title: "Dataset", - className: styles$o.floatingCol, + className: styles$r.floatingCol, contents: /* @__PURE__ */ jsxRuntimeExports.jsx(DatasetDetailView, { dataset: evaluation.dataset }) }); if (steps) { taskColumns.push({ title: "Solvers", - className: styles$o.wideCol, + className: styles$r.wideCol, contents: /* @__PURE__ */ jsxRuntimeExports.jsx(SolversDetailView, { steps }) }); } @@ -193876,15 +194181,15 @@ const PlanDetailView = ({ }); taskColumns.push({ title: label2, - className: styles$o.floatingCol, + className: styles$r.floatingCol, contents: scorerPanels }); } } - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$o.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$r.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: styles$o.grid, + className: styles$r.grid, style: { gridTemplateColumns: `repeat(${taskColumns.length}, fit-content(50%))` }, @@ -193912,7 +194217,7 @@ const PlanColumn = ({ title: title2, className: className2, children: children2 "text-size-small", "text-style-label", "text-style-secondary", - styles$o.planCol + styles$r.planCol ), children: title2 } @@ -193924,10 +194229,9 @@ const PlanCard = ({ evalSpec, evalPlan, scores: scores2, - metadata: metadataProp, scrollRef }) => { - const metadata2 = metadataProp || {}; + const metadata2 = evalSpec?.metadata || {}; return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Summary" }), @@ -193953,7 +194257,7 @@ const PlanCard = ({ ] }) ] }); }; -const useInfoTabConfig = (evalSpec, evalPlan, evalError, evalResults, evalStatus, metadata2) => { +const useInfoTabConfig = (evalSpec, evalPlan, evalError, evalResults, evalStatus) => { const scrollRef = reactExports.useRef(null); const totalSampleCount = useTotalSampleCount(); return reactExports.useMemo(() => { @@ -193968,7 +194272,6 @@ const useInfoTabConfig = (evalSpec, evalPlan, evalError, evalResults, evalStatus evalError, evalResults, evalStatus, - metadata: metadata2, sampleCount: totalSampleCount, scrollRef }, @@ -193980,7 +194283,6 @@ const useInfoTabConfig = (evalSpec, evalPlan, evalError, evalResults, evalStatus evalError, evalResults, evalStatus, - metadata2, totalSampleCount ]); }; @@ -193989,7 +194291,6 @@ const InfoTab = ({ evalPlan, evalResults, evalStatus, - metadata: metadata2, sampleCount, scrollRef }) => { @@ -194009,7 +194310,6 @@ const InfoTab = ({ evalSpec, evalPlan, scores: evalResults?.scores, - metadata: metadata2, scrollRef } ) }) @@ -194050,15 +194350,23 @@ const DownloadPanel = ({ ] }) }); }; const jsonTab = "_jsonTab_6pq03_1"; -const styles$n = { +const styles$q = { jsonTab }; const kJsonMaxSize = 1e7; -const useJsonTabConfig = (logDetails) => { +const useJsonTabConfig = (evalVersion, evalStatus, evalSpec, evalPlan, evalError, evalResults, evalStats) => { const selectedLogFile = useStore((state) => state.logs.selectedLogFile); const selectedTab = useStore((state) => state.app.tabs.workspace); return reactExports.useMemo(() => { - const { sampleSummaries: _, ...header2 } = logDetails ?? {}; + const evalHeader = { + version: evalVersion, + status: evalStatus, + eval: evalSpec, + plan: evalPlan, + error: evalError, + results: evalResults, + stats: evalStats + }; return { id: kLogViewJsonTabId, label: "JSON", @@ -194066,7 +194374,7 @@ const useJsonTabConfig = (logDetails) => { component: JsonTab, componentProps: { logFile: selectedLogFile, - json: JSON.stringify(header2, null, 2), + json: JSON.stringify(evalHeader, null, 2), selected: selectedTab === kLogViewJsonTabId }, tools: () => [ @@ -194083,7 +194391,17 @@ const useJsonTabConfig = (logDetails) => { ) ] }; - }, [selectedLogFile, logDetails, selectedTab]); + }, [ + selectedLogFile, + evalVersion, + evalStatus, + evalSpec, + evalPlan, + evalError, + evalResults, + evalStats, + selectedTab + ]); }; const copyFeedback = (e) => { const textEl = e.currentTarget.querySelector(".task-btn-copy-content"); @@ -194108,7 +194426,7 @@ const JsonTab = ({ logFile, json }) => { const downloadFiles = useStore((state) => state.capabilities.downloadFiles); if (logFile && json.length > kJsonMaxSize && downloadFiles) { const file = `${filename(logFile)}.json`; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$n.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx( DownloadPanel, { message: "The JSON for this log file is too large to render.", @@ -194118,15 +194436,15 @@ const JsonTab = ({ logFile, json }) => { } ) }); } else { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$n.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { id: "task-json-contents", json, simple: true }) }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$q.jsonTab, children: /* @__PURE__ */ jsxRuntimeExports.jsx(JSONPanel, { id: "task-json-contents", json, simple: true }) }); } }; -const container$7 = "_container_4wzpj_1"; +const container$8 = "_container_4wzpj_1"; const modelInfo = "_modelInfo_4wzpj_8"; const role = "_role_4wzpj_15"; const sep = "_sep_4wzpj_19"; -const styles$m = { - container: container$7, +const styles$p = { + container: container$8, modelInfo, role, sep @@ -194147,31 +194465,31 @@ const ModelCard = ({ evalSpec }) => { const noneEl = /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-style-secondary", children: "None" }); return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Models" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-model-card-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$m.container, children: Object.keys(modelsInfo || {}).map((modelKey) => { + /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: "task-model-card-body", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$p.container, children: Object.keys(modelsInfo || {}).map((modelKey) => { const modelInfo2 = modelsInfo[modelKey]; return /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$m.modelInfo, "text-size-small"), + className: clsx(styles$p.modelInfo, "text-size-small"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( - styles$m.role, + styles$p.role, "text-style-label", "text-style-secondary" ), children: modelKey } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$m.sep) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.sep) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Model" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: modelInfo2.model }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$m.sep) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.sep) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Base Url" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: modelInfo2.base_url || noneEl }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$m.sep) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.sep) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Configuration" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: modelInfo2.config && Object.keys(modelInfo2.config).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx( MetaDataGrid, @@ -194179,7 +194497,7 @@ const ModelCard = ({ evalSpec }) => { entries: modelInfo2.config } ) : noneEl }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$m.sep) }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.sep) }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-label"), children: "Args" }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-size-small", children: Object.keys(modelInfo2.args).length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx( MetaDataGrid, @@ -194187,7 +194505,7 @@ const ModelCard = ({ evalSpec }) => { entries: modelInfo2.args } ) : noneEl }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$m.sep) }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$p.sep) }) ] }, modelKey @@ -194195,26 +194513,20 @@ const ModelCard = ({ evalSpec }) => { }) }) }) ] }); }; -const cardsContainer = "_cardsContainer_d0qjo_1"; -const styles$l = { - cardsContainer +const wrapper$1 = "_wrapper_14r3b_1"; +const col2 = "_col2_14r3b_16"; +const styles$o = { + wrapper: wrapper$1, + col2 }; -const kModelUsageCardBodyId = "model-usage-card-body"; -const kRoleUsageCardBodyId = "role-usage-card-body"; +const kUsageCardBodyId = "usage-card-body"; const UsageCard = ({ stats }) => { if (!stats) { return null; } - const hasRoleUsage = stats.role_usage && Object.keys(stats.role_usage).length > 0; - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$l.cardsContainer, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Model Usage" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: kModelUsageCardBodyId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelTokenTable, { model_usage: stats.model_usage }) }) - ] }), - hasRoleUsage && /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Role Usage" }), - /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: kRoleUsageCardBodyId, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelTokenTable, { model_usage: stats.role_usage }) }) - ] }) + return /* @__PURE__ */ jsxRuntimeExports.jsxs(Card, { children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx(CardHeader, { label: "Usage" }), + /* @__PURE__ */ jsxRuntimeExports.jsx(CardBody, { id: kUsageCardBodyId, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$o.wrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$o.col2, children: /* @__PURE__ */ jsxRuntimeExports.jsx(ModelTokenTable, { model_usage: stats.model_usage }) }) }) }) ] }); }; const useModelsTab = (evalSpec, evalStats, evalStatus) => { @@ -194242,6 +194554,53 @@ const ModelTab = ({ evalStatus !== "started" && evalStats?.model_usage && Object.keys(evalStats.model_usage).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(UsageCard, { stats: evalStats }) ] }) }); }; +const container$7 = "_container_15b4r_1"; +const label$5 = "_label_15b4r_5"; +const styles$n = { + container: container$7, + label: label$5 +}; +const EpochFilter = ({ + epochs, + epoch, + setEpoch +}) => { + const options2 = ["all"]; + for (let i = 1; i <= epochs; i++) { + options2.push(i + ""); + } + const handleEpochChange = (e) => { + const sel = e.target; + setEpoch(sel.value); + }; + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$n.container, children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx( + "span", + { + className: clsx( + "epoch-filter-label", + "text-size-smaller", + "text-style-label", + "text-style-secondary", + styles$n.label + ), + children: "Epochs:" + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "select", + { + className: clsx("form-select", "form-select-sm", "text-size-smaller"), + "aria-label": ".epoch-filter-label", + value: epoch, + onChange: handleEpochChange, + children: options2.map((option) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: option, children: option }); + }) + } + ) + ] }); +}; let rangeFrom = [], rangeTo = []; (() => { let numbers2 = "lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map((s) => s ? parseInt(s, 36) : 1); @@ -214881,9 +215240,6 @@ function getCompletions(context, filterItems, samples) { if (isMetadataProperty(tokens, currentTokenIndex)) { return customRelationCompletions(); } - if (varName === "epoch") { - return continuousRelationCompletions(); - } if (varName === kSampleIdVariable) { return discreteRelationCompletions(); } @@ -214942,17 +215298,6 @@ function getCompletions(context, filterItems, samples) { includeDefault: false }); } - if (varName === "epoch" && samples) { - const epochValues = Array.from( - new Set(samples.map((s) => s.epoch).filter((e) => e !== void 0)) - ).sort((a, b) => a - b); - const epochCompletions = epochValues.map( - (e) => makeLiteralCompletion(String(e)) - ); - return makeCompletions(epochCompletions, { - includeDefault: epochCompletions.length === 0 - }); - } const item2 = findFilterItem(2); if (item2?.categories?.length) { return rhsCompletions(item2.categories); @@ -214968,7 +215313,7 @@ function getCompletions(context, filterItems, samples) { const label$4 = "_label_jbrqc_1"; const input = "_input_jbrqc_7"; const help = "_help_jbrqc_11"; -const styles$k = { +const styles$m = { label: label$4, input, help @@ -214976,7 +215321,6 @@ const styles$k = { const FILTER_TOOLTIP = ` Filter samples by: • Scores - • Epoch: e.g. "epoch == 1" or "epoch <= 2" • Samples with errors: has_error • Input, target and error regex search: input_contains, target_contains, error_contains • Samples that have been retried: has_retries @@ -215178,7 +215522,7 @@ const SampleFilter = () => { "text-size-smaller", "text-style-label", "text-style-secondary", - styles$k.label + styles$m.label ), children: "Filter:" } @@ -215187,13 +215531,13 @@ const SampleFilter = () => { "div", { ref: editorRef, - className: clsx(filterError && "filter-pending", styles$k.input) + className: clsx(filterError && "filter-pending", styles$m.input) } ), /* @__PURE__ */ jsxRuntimeExports.jsx( "span", { - className: clsx("bi", "bi-question-circle", styles$k.help), + className: clsx("bi", "bi-question-circle", styles$m.help), "data-tooltip": FILTER_TOOLTIP, "data-tooltip-position": "bottom-left" } @@ -215201,19 +215545,19 @@ const SampleFilter = () => { ] }); }; const container$6 = "_container_uvlpz_1"; -const grid$2 = "_grid_uvlpz_5"; -const row = "_row_uvlpz_12"; +const grid$3 = "_grid_uvlpz_5"; +const row$1 = "_row_uvlpz_12"; const label$3 = "_label_uvlpz_26"; const links = "_links_uvlpz_32"; -const selected = "_selected_uvlpz_50"; +const selected$1 = "_selected_uvlpz_50"; const bodyColorButton = "_bodyColorButton_uvlpz_54"; -const styles$j = { +const styles$l = { container: container$6, - grid: grid$2, - row, + grid: grid$3, + row: row$1, label: label$3, links, - selected, + selected: selected$1, bodyColorButton }; const SelectScorer = ({ @@ -215238,7 +215582,7 @@ const SelectScorer = ({ "text-size-smaller", "text-style-label", "text-style-secondary", - styles$j.label + styles$l.label ), children: "Scorers:" } @@ -215250,7 +215594,7 @@ const SelectScorer = ({ icon: ApplicationIcons.metrics, onClick: () => setShowing(!showing), ref: buttonRef, - className: clsx(styles$j.bodyColorButton) + className: clsx(styles$l.bodyColorButton) } ), /* @__PURE__ */ jsxRuntimeExports.jsxs( @@ -215266,13 +215610,13 @@ const SelectScorer = ({ padding: "3px 5px" }, children: [ - /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$j.links, "text-size-smaller"), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$l.links, "text-size-smaller"), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "a", { className: clsx( - styles$j.link, - !allScoresSelected ? styles$j.selected : void 0 + styles$l.link, + !allScoresSelected ? styles$l.selected : void 0 ), onClick: () => { if (scores2.length > 0) { @@ -215287,8 +215631,8 @@ const SelectScorer = ({ "a", { className: clsx( - styles$j.link, - allScoresSelected ? styles$j.selected : void 0 + styles$l.link, + allScoresSelected ? styles$l.selected : void 0 ), onClick: () => { setSelectedScores(scores2); @@ -215297,7 +215641,7 @@ const SelectScorer = ({ } ) ] }), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$j.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$l.container, children: /* @__PURE__ */ jsxRuntimeExports.jsx( ScoreCheckboxes, { scores: scores2, @@ -215329,13 +215673,13 @@ const ScoreCheckboxes = ({ }, [setSelectedScores, scores2, selectedKeys] ); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$j.grid, "text-size-smaller"), children: scores2.map((sc2) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$l.grid, "text-size-smaller"), children: scores2.map((sc2) => { const key2 = `${sc2.scorer}.${sc2.name}`; const isChecked = selectedKeys ? selectedKeys.has(key2) : false; return /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { - className: clsx(styles$j.row), + className: clsx(styles$l.row), onClick: () => handleToggle(sc2, isChecked), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -215357,11 +215701,17 @@ const ScoreCheckboxes = ({ }) }); }; const SampleTools = () => { + const selectedLogDetails = useStore((state) => state.log.selectedLogDetails); const scores2 = useScores(); const selectedScores = useSelectedScores(); const setSelectedScores = useStore( (state) => state.logActions.setSelectedScores ); + const epoch = useStore((state) => state.log.epoch); + const setEpoch = useStore((state) => state.logActions.setEpoch); + const sort2 = useStore((state) => state.log.sort); + const setSort = useStore((state) => state.logActions.setSort); + const epochs = selectedLogDetails?.eval.config.epochs || 1; return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [ /* @__PURE__ */ jsxRuntimeExports.jsx(SampleFilter, {}), scores2?.length > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -215371,7 +215721,9 @@ const SampleTools = () => { selectedScores, setSelectedScores } - ) : void 0 + ) : void 0, + epochs > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(EpochFilter, { epoch, setEpoch, epochs }) : void 0, + /* @__PURE__ */ jsxRuntimeExports.jsx(SortFilter, { sort: sort2, setSort, epochs }) ] }); }; const ScoreFilterTools = () => { @@ -215392,299 +215744,192 @@ const ScoreFilterTools = () => { } ); }; -const statusCell = "_statusCell_hunte_1"; -const error = "_error_hunte_7"; -const success = "_success_hunte_11"; -const cancelled = "_cancelled_hunte_15"; -const styles$i = { - statusCell, - error, - success, - cancelled -}; -const sampleStatus = (completed, error2) => { - if (error2) { - return errorType(error2) === "CancelledError" ? "cancelled" : "error"; - } - return completed ? "ok" : "running"; -}; -const kDefaultSampleSortValue = "3:ok"; -const sampleStatusSortValue = (status2, error2) => { - switch (status2) { - case "running": - return "0:running"; - case "error": - return `1:error:${errorType(error2)}`; - case "cancelled": - return "2:cancelled"; - default: - return kDefaultSampleSortValue; - } -}; -const SampleStatusIcon = ({ status: status2 }) => { - if (status2 === "running") { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$i.statusCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false }) }); - } - const icon2 = status2 === "error" ? ApplicationIcons.error : status2 === "cancelled" ? ApplicationIcons.cancelled : ApplicationIcons.success; - const colorClass = status2 === "error" ? styles$i.error : status2 === "cancelled" ? styles$i.cancelled : styles$i.success; - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$i.statusCell, children: /* @__PURE__ */ jsxRuntimeExports.jsx("i", { className: clsx(icon2, colorClass) }) }); -}; -const mainLayout = "_mainLayout_1pg7l_1"; -const samplesListGrid = "_samplesListGrid_1pg7l_7"; -const cell = "_cell_1pg7l_43"; -const wrapAnywhere = "_wrapAnywhere_1pg7l_47"; -const noLeft = "_noLeft_1pg7l_51"; -const score = "_score_1pg7l_55"; -const centered = "_centered_1pg7l_62"; -const styles$h = { - mainLayout, - samplesListGrid, +const grid$2 = "_grid_173xh_1"; +const selected = "_selected_173xh_11"; +const sampleLink = "_sampleLink_173xh_15"; +const disabledRow = "_disabledRow_173xh_34"; +const disabled = "_disabled_173xh_34"; +const cell = "_cell_173xh_44"; +const wrapAnywhere = "_wrapAnywhere_173xh_49"; +const noLeft = "_noLeft_173xh_53"; +const score = "_score_173xh_57"; +const centered = "_centered_173xh_62"; +const error = "_error_173xh_67"; +const styles$k = { + grid: grid$2, + selected, + sampleLink, + disabledRow, + disabled, cell, wrapAnywhere, noLeft, score, - centered + centered, + error }; -const ScoreCellDiv = ({ children: children2 }) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-size-small", styles$h.cell, styles$h.score), children: children2 }); -const MarkdownCellDiv = ({ semanticClass, text: text2, trimRenderedText }) => { - const markdown = truncateMarkdown(text2, 250); - return /* @__PURE__ */ jsxRuntimeExports.jsx( +const SampleRow = ({ + id, + sample: sample2, + answer: answer2, + completed, + scoresRendered, + gridColumnsTemplate, + height, + selected: selected2, + showSample, + sampleUrl +}) => { + const streamSampleData = useStore( + (state) => state.capabilities.streamSampleData + ); + const isViewable = completed || streamSampleData; + if (!completed && scoresRendered.length === 0 && Object.keys(sample2.scores || {}).length === 0) { + scoresRendered = [null]; + } + const scoreColumnContent = scoresRendered.map((scoreRendered, i) => { + if (completed) { + return scoreRendered; + } else if (i === scoresRendered.length - 1) { + return /* @__PURE__ */ jsxRuntimeExports.jsx(PulsingDots, { subtle: false }); + } else { + return void 0; + } + }); + const rowContent = /* @__PURE__ */ jsxRuntimeExports.jsxs( "div", { + id: `sample-${id}`, className: clsx( - semanticClass, + styles$k.grid, "text-size-base", - "three-line-clamp", - styles$h.cell, - styles$h.wrapAnywhere + selected2 ? styles$k.selected : void 0, + !isViewable && !sampleUrl ? styles$k.disabled : void 0 ), - children: /* @__PURE__ */ jsxRuntimeExports.jsx( - RenderedText, - { - markdown, - className: trimRenderedText ? clsx("no-last-para-padding", styles$h.noLeft) : void 0, - forceRender: true, - omitMedia: true - } - ) - } - ); -}; -function buildColumnDefs(samplesDescriptor, selectedScores, scores2, epochs) { - const shape = samplesDescriptor?.messageShape; - const inputFlex = shape?.inputSize || 3; - const targetFlex = shape?.targetSize || 1; - const answerFlex = shape?.answerSize || 1; - const scoreLabels = !selectedScores || selectedScores.length === 0 ? [] : scores2 && scores2.length === 1 ? ["Score"] : selectedScores?.map((s) => s.name) ?? []; - const columns = [ - { - colId: "sampleStatus", - headerName: "", - headerTooltipValueGetter: () => "Sample Status", - width: 24, - valueGetter: (params) => { - if (!params.data) return kDefaultSampleSortValue; - const s = sampleStatus(params.data.completed, params.data.data.error); - return sampleStatusSortValue(s, params.data.data.error); - }, - cellRenderer: (params) => { - if (!params.data) return null; - const s = sampleStatus(params.data.completed, params.data.data.error); - return /* @__PURE__ */ jsxRuntimeExports.jsx(SampleStatusIcon, { status: s }); - }, - tooltipValueGetter: (params) => { - if (!params.data) return null; - return params.data.data.error ? params.data.data.error : sampleStatus(params.data.completed, params.data.data.error); - } - }, - { - colId: "id", - headerName: "Id", - width: (shape?.idSize ?? 2) * 16, - // 16 for 1em in pixels - minWidth: 35, - valueGetter: (params) => params.data?.data?.id, - cellRenderer: (params) => { - if (!params.data) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( + style: { + height: `${height}px`, + gridTemplateRows: `${height - 28}px`, + gridTemplateColumns: gridColumnsTemplate + }, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-id", "three-line-clamp", styles$k.cell), children: sample2.id }), + /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( - "sample-id", - "text-size-base", + "sample-input", "three-line-clamp", - styles$h.cell, - styles$h.wrapAnywhere - ), - children: params.data.data.id - } - ); - } - }, - { - colId: "epoch", - headerName: "Epoch", - width: 50, - minWidth: 28, - hide: epochs <= 1, - valueGetter: (params) => params.data?.data?.epoch, - cellRenderer: (params) => { - if (!params.data) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - "div", - { - className: clsx( - "sample-epoch", - "text-size-base", - styles$h.cell, - styles$h.centered + styles$k.cell, + styles$k.wrapAnywhere ), - children: params.data.data.epoch - } - ); - } - }, - { - colId: "input", - headerName: "Input", - flex: inputFlex, - minWidth: 80, - hide: !shape?.inputSize, - valueGetter: (params) => { - return params.data ? inputString(params.data.data.input).join(" ") : ""; - }, - cellRenderer: (params) => { - if (!params.data) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - MarkdownCellDiv, - { - semanticClass: "sample-input", - text: inputString(params.data.data.input).join(" ") + children: /* @__PURE__ */ jsxRuntimeExports.jsx( + RenderedText, + { + markdown: truncateMarkdown(inputString(sample2.input).join(" "), 250), + forceRender: true, + omitMedia: true + } + ) } - ); - } - }, - { - colId: "target", - headerName: "Target", - flex: targetFlex, - minWidth: 80, - hide: !shape?.targetSize, - valueGetter: (params) => { - return params.data?.data?.target != null ? arrayToString(params.data.data.target) : ""; - }, - cellRenderer: (params) => { - if (!params.data?.data?.target) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - MarkdownCellDiv, + ), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-target", "three-line-clamp", styles$k.cell), children: sample2?.target ? /* @__PURE__ */ jsxRuntimeExports.jsx( + RenderedText, { - semanticClass: "sample-target", - text: arrayToString(params.data.data.target), - trimRenderedText: true - } - ); - } - }, - { - colId: "answer", - headerName: "Answer", - flex: answerFlex, - minWidth: 80, - hide: !shape?.answerSize, - valueGetter: (params) => params.data?.answer ?? "", - cellRenderer: (params) => { - if (!params.data) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( - MarkdownCellDiv, + markdown: truncateMarkdown(arrayToString(sample2.target), 250), + className: clsx("no-last-para-padding", styles$k.noLeft), + forceRender: true, + omitMedia: true + } + ) : void 0 }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("sample-answer", "three-line-clamp", styles$k.cell), children: sample2 ? /* @__PURE__ */ jsxRuntimeExports.jsx( + RenderedText, { - semanticClass: "sample-answer", - text: params.data.answer || "", - trimRenderedText: true + markdown: truncateMarkdown(answer2 || "", 250), + className: clsx("no-last-para-padding", styles$k.noLeft), + forceRender: true, + omitMedia: true } - ); - } - }, - { - colId: "limit", - headerName: "Limit", - width: (shape?.limitSize ?? 1) * 16, - minWidth: 28, - hide: !shape?.limitSize, - valueGetter: (params) => params.data?.data?.limit, - cellRenderer: (params) => { - if (!params.data) return null; - return /* @__PURE__ */ jsxRuntimeExports.jsx( + ) : "" }), + /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( "sample-limit", "text-size-small", "three-line-clamp", - styles$h.cell, - styles$h.wrapAnywhere + styles$k.cell ), - children: params.data.data.limit + children: sample2.limit } - ); - } - }, - { - colId: "retries", - headerName: "Retries", - width: (shape?.retriesSize ?? 1) * 16, - minWidth: 28, - hide: !shape?.retriesSize, - valueGetter: (params) => params.data?.data?.retries, - cellRenderer: (params) => { - if (!params.data) return null; - const { data } = params.data; - return /* @__PURE__ */ jsxRuntimeExports.jsx( + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { className: clsx( "sample-retries", "text-size-small", "three-line-clamp", - styles$h.cell, - styles$h.centered + styles$k.cell, + styles$k.centered ), - children: data.retries && data.retries > 0 ? data.retries : void 0 + children: sample2.retries && sample2.retries > 0 ? sample2.retries : void 0 } - ); - } + ), + scoreColumnContent.map((scoreColumnContent2, i) => /* @__PURE__ */ jsxRuntimeExports.jsx( + "div", + { + className: clsx("text-size-small", styles$k.cell, styles$k.score), + children: scoreColumnContent2 + }, + `score-${i}` + )), + /* @__PURE__ */ jsxRuntimeExports.jsx( + "div", + { + className: clsx( + "sample-error", + "text-size-small", + styles$k.cell, + styles$k.error + ), + children: sample2.error ? /* @__PURE__ */ jsxRuntimeExports.jsx(SampleErrorView, { message: sample2.error }) : void 0 + } + ) + ] } - ]; - scoreLabels.forEach((label2, i) => { - columns.push({ - headerName: label2, - colId: `score-${i}`, - width: 80, - minWidth: 28, - valueGetter: (params) => { - if (!params.data?.data || !samplesDescriptor) return void 0; - return samplesDescriptor.evalDescriptor.score( - params.data.data, - selectedScores[i] - )?.value; - }, - cellRenderer: (params) => { - if (!params.data) return null; - const { data, completed } = params.data; - const rendered = samplesDescriptor?.evalDescriptor.score(data, selectedScores[i])?.render(); - if (completed && rendered !== void 0) { - return /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreCellDiv, { children: rendered }); - } - return /* @__PURE__ */ jsxRuntimeExports.jsx(ScoreCellDiv, {}); - } - }); - }); - return columns; -} + ); + if (!sampleUrl || !isViewable) { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$k.disabledRow, children: rowContent }); + } + if (isVscode()) { + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { onClick: showSample, className: styles$k.sampleLink, children: rowContent }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: sampleUrl, className: styles$k.sampleLink, children: rowContent }); +}; +const row = "_row_utdq5_1"; +const styles$j = { + row +}; +const SampleSeparator = ({ + id, + title: title2, + height +}) => { + return /* @__PURE__ */ jsxRuntimeExports.jsx( + "div", + { + id, + className: clsx("text-style-secondary", "text-size-smaller", styles$j.row), + style: { height: `${height}px` }, + children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: title2 }) + } + ); +}; const footer = "_footer_vkofn_1"; const spinnerContainer = "_spinnerContainer_vkofn_11"; const spinner$1 = "_spinner_vkofn_11"; const label$2 = "_label_vkofn_25"; -const styles$g = { +const styles$i = { footer, spinnerContainer, spinner: spinner$1, @@ -215695,23 +215940,74 @@ const SampleFooter = ({ totalSampleCount, running }) => { - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$g.footer), children: [ - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: running ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$g.spinnerContainer), children: [ + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx("text-size-smaller", styles$i.footer), children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: running ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: clsx(styles$i.spinnerContainer), children: [ /* @__PURE__ */ jsxRuntimeExports.jsx( "div", { - className: clsx("spinner-border", styles$g.spinner), + className: clsx("spinner-border", styles$i.spinner), role: "status", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: clsx("visually-hidden"), children: "Running..." }) } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-secondary", styles$g.label), children: "running..." }) + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("text-style-secondary", styles$i.label), children: "running..." }) ] }) : void 0 }), /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: sampleCount < totalSampleCount ? `${sampleCount} / ${totalSampleCount} Samples` : `${sampleCount} Samples` }) ] }); }; +const header$1 = "_header_1qnb6_1"; +const center = "_center_1qnb6_9"; +const shrinkable = "_shrinkable_1qnb6_13"; +const styles$h = { + header: header$1, + center, + shrinkable +}; +const SampleHeader = ({ + input: input2 = true, + target: target2 = true, + answer: answer2 = true, + limit = true, + retries = false, + errors: errors2 = false, + scoreLabels = ["Score"], + gridColumnsTemplate +}) => /* @__PURE__ */ jsxRuntimeExports.jsxs( + "div", + { + className: clsx( + styles$h.header, + "text-size-smallestest", + "text-style-label", + "text-style-secondary" + ), + style: { gridTemplateColumns: gridColumnsTemplate }, + children: [ + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Id" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: input2 ? "Input" : "" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: target2 ? "Target" : "" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: answer2 ? "Answer" : "" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: limit ? "Limit" : "" }), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: retries ? "Retries" : "" }), + scoreLabels.map((label2, i) => /* @__PURE__ */ jsxRuntimeExports.jsx( + "div", + { + className: clsx(styles$h.center, styles$h.shrinkable), + children: label2 + }, + `score-header-${i}` + )), + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errors2 ? "Error" : "" }) + ] + } +); +const mainLayout = "_mainLayout_q79zq_7"; +const styles$g = { + mainLayout +}; const kSampleHeight = 88; -const makeSampleRowId = (id, epoch) => `${id}-${epoch}`.replace(/\s+/g, "_"); +const kSeparatorHeight = 24; +const kSampleFollowProp = "sample-list"; const SampleList = reactExports.memo((props) => { const { items, @@ -215722,190 +216018,201 @@ const SampleList = reactExports.memo((props) => { listHandle } = props; const selectedLogFile = useStore((state) => state.logs.selectedLogFile); + const { getRestoreState, isScrolling } = useVirtuosoState( + listHandle, + `sample-list-${selectedLogFile}` + ); reactExports.useEffect(() => { - listHandle.current?.api?.ensureIndexVisible(0, "top"); + listHandle.current?.scrollTo({ top: 0, behavior: "instant" }); }, [listHandle, selectedLogFile]); const sampleNavigation = useSampleNavigation(); const selectedSampleHandle = useStore( (state) => state.log.selectedSampleHandle ); - const selectedLogDetails = useStore((state) => state.log.selectedLogDetails); - const evalSpec = selectedLogDetails?.eval; - const epochs = evalSpec?.config?.epochs || 1; + const samplesDescriptor = useSampleDescriptor(); + const [followOutput, setFollowOutput] = useProperty( + kSampleFollowProp, + "follow", + { + defaultValue: !!running + } + ); + const evalSpec = useStore((state) => state.log.selectedLogDetails?.eval); const { setDocumentTitle } = useDocumentTitle(); reactExports.useEffect(() => { setDocumentTitle({ evalSpec }); }, [setDocumentTitle, evalSpec]); - const followOutputRef = reactExports.useRef(running); - const prevItemCountRef = reactExports.useRef(items.length); - reactExports.useEffect(() => { - if (running) { - followOutputRef.current = true; - } - }, [running]); - reactExports.useEffect(() => { - if (running && followOutputRef.current && items.length > prevItemCountRef.current && listHandle.current?.api) { - listHandle.current.api.ensureIndexVisible(items.length - 1, "bottom"); - } - prevItemCountRef.current = items.length; - }, [items.length, running, listHandle]); - const handleBodyScroll = reactExports.useCallback(() => { - if (!running || !listHandle.current?.api) return; - const api2 = listHandle.current.api; - const vPixel = api2.getVerticalPixelRange(); - const totalHeight = api2.getDisplayedRowCount() * kSampleHeight; - const viewportHeight = vPixel.bottom - vPixel.top; - const atBottom = vPixel.bottom >= totalHeight - viewportHeight * 0.1; - followOutputRef.current = atBottom; - }, [running, listHandle]); const prevRunningRef = reactExports.useRef(running); reactExports.useEffect(() => { - if (!running && prevRunningRef.current && listHandle.current?.api) { - followOutputRef.current = false; + if (!running && prevRunningRef.current && followOutput && listHandle.current) { + setFollowOutput(false); setTimeout(() => { - listHandle.current?.api?.ensureIndexVisible(0, "top"); + if (listHandle.current) { + listHandle.current.scrollTo({ top: 0, behavior: "instant" }); + } }, 100); } prevRunningRef.current = running; - }, [running, listHandle]); - const handleRowClick = reactExports.useCallback( - (e) => { - if (e.data && e.node && listHandle.current?.api) { - listHandle.current.api.deselectAll(); - e.node.setSelected(true); - const mouseEvent = e.event; - const openInNewWindow = mouseEvent?.metaKey || mouseEvent?.ctrlKey || mouseEvent?.shiftKey || mouseEvent?.button === 1; - if (openInNewWindow) { - const url = sampleNavigation.getSampleUrl( - e.data.data.id, - e.data.data.epoch - ); - if (url) window.open(url, "_blank"); - } else { - sampleNavigation.showSample(e.data.data.id, e.data.data.epoch); - } - } + }, [running, followOutput, listHandle, setFollowOutput]); + const loaded = reactExports.useRef(false); + const handleAtBottomStateChange = reactExports.useCallback( + (atBottom) => { + if (loaded.current && running) { + setFollowOutput(atBottom); + } + loaded.current = true; }, - [sampleNavigation, listHandle] + [running, setFollowOutput] ); - const handleOpenRow = reactExports.useCallback( - (rowNode, _e2) => { - if (rowNode.data) { - sampleNavigation.showSample( - rowNode.data.data.id, - rowNode.data.data.epoch - ); - } - }, - [sampleNavigation] - ); - const gridContainerRef = reactExports.useRef(null); - const handleKeyDown = reactExports.useMemo( - () => createGridKeyboardHandler({ - gridRef: listHandle, - onOpenRow: handleOpenRow - }), - [listHandle, handleOpenRow] - ); - reactExports.useEffect(() => { - const el2 = gridContainerRef.current; - if (!el2) return; - el2.addEventListener("keydown", handleKeyDown); - return () => { - el2.removeEventListener("keydown", handleKeyDown); - }; - }, [handleKeyDown]); - const handleCellMouseDown = reactExports.useCallback( + const onkeydown = reactExports.useCallback( (e) => { - const mouseEvent = e.event; - if (mouseEvent?.button === 1 && e.data) { - mouseEvent.preventDefault(); - const url = sampleNavigation.getSampleUrl( - e.data.data.id, - e.data.data.epoch - ); - if (url) window.open(url, "_blank"); + switch (e.key) { + case "ArrowUp": + if (e.metaKey || e.ctrlKey) { + sampleNavigation.firstSample(); + listHandle.current?.scrollToIndex({ + index: 0, + align: "start", + behavior: "auto" + }); + } else { + sampleNavigation.previousSample(); + } + e.preventDefault(); + e.stopPropagation(); + break; + case "ArrowDown": + if (e.metaKey || e.ctrlKey) { + sampleNavigation.lastSample(); + listHandle.current?.scrollToIndex({ + index: items.length - 1, + align: "end", + behavior: "auto" + }); + } else { + sampleNavigation.nextSample(); + } + e.preventDefault(); + e.stopPropagation(); + break; + case "Enter": { + const item2 = items.find((item22) => { + if (item22.type === "sample") { + return sampleIdsEqual(item22.sampleId, selectedSampleHandle?.id) && item22.sampleEpoch === selectedSampleHandle?.epoch; + } + }); + if (item2 && item2.type === "sample") { + sampleNavigation.showSample(item2.data.id, item2.data.epoch); + e.preventDefault(); + e.stopPropagation(); + } + break; + } } }, - [sampleNavigation] + [ + sampleNavigation, + listHandle, + items, + selectedSampleHandle?.id, + selectedSampleHandle?.epoch + ] ); - const selectCurrentSample = reactExports.useCallback(() => { - if (!listHandle.current?.api || !selectedSampleHandle) { - return; - } - const rowId = makeSampleRowId( - selectedSampleHandle.id, - selectedSampleHandle.epoch - ); - const node2 = listHandle.current.api.getRowNode(rowId); - if (node2) { - listHandle.current.api.deselectAll(); - node2.setSelected(true); - listHandle.current.api.ensureNodeVisible(node2, "middle"); - } - }, [listHandle, selectedSampleHandle]); - reactExports.useEffect(() => { - selectCurrentSample(); - }, [selectedSampleHandle, selectCurrentSample]); const selectedScores = useSelectedScores(); const scores2 = useScores(); - const samplesDescriptor = useSampleDescriptor(); - const columnDefs = reactExports.useMemo( - () => buildColumnDefs(samplesDescriptor, selectedScores, scores2, epochs), - [samplesDescriptor, selectedScores, scores2, epochs] - ); - const getRowId = reactExports.useCallback((params) => { - return makeSampleRowId(params.data.data.id, params.data.data.epoch); - }, []); - const manuallyResized = reactExports.useRef(/* @__PURE__ */ new Set()); - const handleColumnResized = reactExports.useCallback( - (event) => { - if (event.finished && event.source === "uiColumnResized" && event.column) { - manuallyResized.current.add(event.column.getColId()); - const state = columnDefs.filter( - (c2) => c2.colId && c2.flex && !manuallyResized.current.has(c2.colId) - ).map((c2) => ({ colId: c2.colId, flex: c2.flex })); - if (state.length > 0) { - listHandle.current?.api?.applyColumnState({ state }); - } + const sampleCount = items?.reduce((prev, current2) => { + if (current2.type === "sample") { + return prev + 1; + } else { + return prev; + } + }, 0); + const errorCount = items?.reduce((previous, item2) => { + if (typeof item2.data === "object" && item2.data.error) { + return previous + 1; + } + return previous; + }, 0); + const hasErrors = errorCount > 0; + const gridColumnsTemplate = reactExports.useMemo(() => { + return gridColumnsValue(samplesDescriptor, hasErrors); + }, [samplesDescriptor, hasErrors]); + const renderRow = reactExports.useCallback( + (_index, item2) => { + if (item2.type === "sample") { + return /* @__PURE__ */ jsxRuntimeExports.jsx( + SampleRow, + { + id: `${item2.number}`, + sample: item2.data, + height: kSampleHeight, + answer: item2.answer, + completed: item2.completed, + scoresRendered: item2.scoresRendered, + gridColumnsTemplate, + sampleUrl: sampleNavigation.getSampleUrl( + item2.data.id, + item2.data.epoch + ), + selected: sampleIdsEqual(selectedSampleHandle?.id, item2.sampleId) && selectedSampleHandle?.epoch === item2.sampleEpoch, + showSample: () => { + sampleNavigation.showSample(item2.data.id, item2.data.epoch); + } + } + ); + } else if (item2.type === "separator") { + return /* @__PURE__ */ jsxRuntimeExports.jsx( + SampleSeparator, + { + id: `sample-group${item2.number}`, + title: item2.data, + height: kSeparatorHeight + } + ); + } else { + return null; } }, - [listHandle, columnDefs] + [ + gridColumnsTemplate, + sampleNavigation, + selectedSampleHandle?.epoch, + selectedSampleHandle?.id + ] ); - const sampleCount = items.length; - const warnings = reactExports.useMemo(() => { - const errorCount = items.reduce( - (prev, item2) => item2.data.error ? prev + 1 : prev, - 0 - ); - const limitCount = items.reduce( - (prev, item2) => item2.data.limit ? prev + 1 : prev, - 0 - ); - const percentError = sampleCount > 0 ? errorCount / sampleCount * 100 : 0; - const percentLimit = sampleCount > 0 ? limitCount / sampleCount * 100 : 0; - const result2 = []; - if (errorCount > 0) { - result2.push({ - type: "info", - msg: `INFO: ${errorCount} of ${sampleCount} samples (${formatNoDecimal(percentError)}%) had errors and were not scored.` - }); - } - if (limitCount > 0) { - result2.push({ - type: "info", - msg: `INFO: ${limitCount} of ${sampleCount} samples (${formatNoDecimal(percentLimit)}%) completed due to exceeding a limit.` - }); - } - if (earlyStopping?.early_stops && earlyStopping?.early_stops?.length > 0) { - result2.push({ - type: "info", - msg: `Skipped ${earlyStopping.early_stops.length} samples due to early stopping (${earlyStopping.manager}). ` - }); + const { input: input2, limit, answer: answer2, target: target2, retries } = gridColumns( + samplesDescriptor, + hasErrors + ); + const limitCount = items?.reduce((previous, item2) => { + if (typeof item2.data === "object" && item2.data.limit) { + return previous + 1; + } else { + return previous; } - return result2; - }, [items, sampleCount, earlyStopping]); - return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$h.mainLayout, children: [ + }, 0); + const percentError = errorCount / sampleCount * 100; + const percentLimit = limitCount / sampleCount * 100; + const warnings = []; + if (errorCount > 0) { + warnings.push({ + type: "info", + msg: `INFO: ${errorCount} of ${sampleCount} samples (${formatNoDecimal(percentError)}%) had errors and were not scored.` + }); + } + if (limitCount > 0) { + warnings.push({ + type: "info", + msg: `INFO: ${limitCount} of ${sampleCount} samples (${formatNoDecimal(percentLimit)}%) completed due to exceeding a limit.` + }); + } + if (earlyStopping?.early_stops && earlyStopping?.early_stops?.length > 0) { + warnings.push({ + type: "info", + msg: `Skipped ${earlyStopping.early_stops.length} samples due to early stopping (${earlyStopping.manager}). ` + }); + } + return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: styles$g.mainLayout, children: [ warnings.map((warning2, index) => /* @__PURE__ */ jsxRuntimeExports.jsx( MessageBand, { @@ -215916,52 +216223,42 @@ const SampleList = reactExports.memo((props) => { `sample-warning-message-${index}` )), /* @__PURE__ */ jsxRuntimeExports.jsx( - "div", + SampleHeader, { - ref: gridContainerRef, - className: clsx(className2, styles$h.samplesListGrid, "samples-list"), - style: { - flex: 1, - minHeight: 0, - display: "flex", - flexDirection: "column" + input: input2 !== "0", + target: target2 !== "0", + answer: answer2 !== "0", + limit: limit !== "0", + retries: retries !== "0em", + errors: hasErrors, + scoreLabels: scoreHeaders(selectedScores, scores2), + gridColumnsTemplate + } + ), + /* @__PURE__ */ jsxRuntimeExports.jsx( + Yr, + { + ref: listHandle, + style: { height: "100%" }, + data: items, + defaultItemHeight: 50, + itemContent: renderRow, + followOutput: running ? (_atBottom) => { + return followOutput; + } : void 0, + atBottomStateChange: handleAtBottomStateChange, + atBottomThreshold: 30, + increaseViewportBy: { top: 300, bottom: 300 }, + overscan: { + main: 10, + reverse: 10 }, - tabIndex: 0, - children: /* @__PURE__ */ jsxRuntimeExports.jsx( - AgGridReact, - { - ref: listHandle, - rowData: items, - columnDefs, - defaultColDef: { - filter: false, - headerTooltipValueGetter: (params) => params.colDef?.headerName - }, - tooltipShowDelay: 300, - animateRows: false, - rowHeight: kSampleHeight, - headerHeight: 25, - getRowId, - rowSelection: { mode: "singleRow", checkboxes: false }, - onRowClicked: handleRowClick, - onCellMouseDown: handleCellMouseDown, - onColumnResized: handleColumnResized, - theme: themeBalham, - enableCellTextSelection: true, - suppressCellFocus: true, - domLayout: "normal", - onBodyScroll: handleBodyScroll, - onFirstDataRendered: () => { - if (running && followOutputRef.current) { - listHandle.current?.api?.ensureIndexVisible( - items.length - 1, - "bottom" - ); - } - selectCurrentSample(); - } - } - ) + className: clsx(className2, "samples-list"), + onKeyDown: onkeydown, + skipAnimationFrameInResizeObserver: true, + isScrolling, + restoreStateFrom: getRestoreState(), + tabIndex: 0 } ), /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -215974,6 +216271,53 @@ const SampleList = reactExports.memo((props) => { ) ] }); }); +const gridColumnsValue = (sampleDescriptor, hasErrors) => { + const { input: input2, target: target2, answer: answer2, limit, retries, id, scores: scores2, errors: errors2 } = gridColumns(sampleDescriptor, hasErrors); + const parts = [id, input2, target2, answer2, limit, retries, ...scores2, errors2]; + const result2 = parts.join(" "); + return result2; +}; +const gridColumns = (sampleDescriptor, hasErrors) => { + const input2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.input > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.input) : 0; + const target2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.target > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.target) : 0; + const answer2 = sampleDescriptor && sampleDescriptor.messageShape.normalized.answer > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.answer) : 0; + const limit = sampleDescriptor && sampleDescriptor.messageShape.normalized.limit > 0 ? Math.max(0.15, sampleDescriptor.messageShape.normalized.limit) : 0; + const retries = sampleDescriptor && sampleDescriptor.messageShape.normalized.retries > 0 ? 4 : 0; + const id = Math.max( + 2, + Math.min(10, sampleDescriptor?.messageShape.raw.id || 0) + ); + const scoresRaw = sampleDescriptor?.messageShape.raw.scores || []; + const scoreSizes = scoresRaw.map((size) => Math.max(3, size)); + const scores2 = scoreSizes.length > 0 ? scoreSizes.map((size) => `${size / 2}rem`) : []; + const frSize = (val) => { + if (val === 0) { + return "0"; + } else { + return `${val}fr`; + } + }; + const errors2 = hasErrors ? "fit-content(20em)" : "0"; + return { + input: frSize(input2), + target: frSize(target2), + answer: frSize(answer2), + limit: frSize(limit), + retries: `${retries}em`, + errors: errors2, + id: `${id}rem`, + scores: scores2 + }; +}; +const scoreHeaders = (selectedScores, availableScores) => { + if (!selectedScores || selectedScores.length === 0) { + return []; + } + if (availableScores && availableScores.length === 1) { + return ["Score"]; + } + return selectedScores.map((s) => s.name); +}; const panel$2 = "_panel_1yknn_1"; const container$5 = "_container_1yknn_7"; const spinner = "_spinner_1yknn_14"; @@ -215990,6 +216334,167 @@ const RunningNoSamples = () => { /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx(styles$f.text), children: "starting...." }) ] }) }); }; +const getSampleProcessor = (samples, epochs, groupBy, groupByOrder, sampleDescriptor, selectedScores) => { + selectedScores = selectedScores || []; + if (groupBy == "epoch") { + return groupByEpoch( + samples, + epochs, + sampleDescriptor, + groupByOrder, + selectedScores + ); + } else if (groupBy === "sample") { + return groupBySample( + samples, + epochs, + sampleDescriptor, + groupByOrder, + selectedScores + ); + } else { + return noGrouping(samples, groupByOrder, sampleDescriptor, selectedScores); + } +}; +const noGrouping = (samples, order2, sampleDescriptor, selectedScores) => { + const counter2 = getCounter(samples.length, 1, order2); + return (sample2, index) => { + counter2.incrementItem(); + const itemCount = counter2.item(); + return [ + { + sampleId: sample2.id, + sampleEpoch: sample2.epoch, + label: `Sample ${sample2.id}`, + number: itemCount, + index, + data: sample2, + type: "sample", + answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "", + scoresRendered: selectedScores.map( + (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render() + ), + completed: sample2.completed !== void 0 ? sample2.completed : true + } + ]; + }; +}; +const groupBySample = (samples, epochs, sampleDescriptor, order2, selectedScores) => { + samples = samples.sort((a, b) => { + if (typeof a.id === "string") { + if (order2 === "asc") { + return String(a.id).localeCompare(String(b.id)); + } else { + return String(b.id).localeCompare(String(a.id)); + } + } else { + if (order2 === "asc") { + return Number(a.id) - Number(b.id); + } else { + return Number(b.id) - Number(b.id); + } + } + }); + const groupCount = samples.length / epochs; + const itemCount = samples.length / groupCount; + const counter2 = getCounter(itemCount, groupCount, order2); + return (sample2, index, previousSample) => { + const results = []; + const lastId = previousSample ? previousSample.id : void 0; + if (sample2.id !== lastId) { + counter2.incrementGroup(); + results.push({ + label: `Sample ${sample2.id}`, + number: counter2.group(), + index, + data: `Sample ${sample2.id}`, + type: "separator" + }); + counter2.resetItem(); + } + counter2.incrementItem(); + results.push({ + sampleId: sample2.id, + sampleEpoch: sample2.epoch, + label: `Sample ${counter2.group()} (Epoch ${counter2.item()})`, + number: counter2.item(), + index, + data: sample2, + type: "sample", + answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "", + scoresRendered: selectedScores.map( + (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render() + ), + completed: sample2.completed !== void 0 ? sample2.completed : true + }); + return results; + }; +}; +const groupByEpoch = (samples, epochs, sampleDescriptor, order2, selectedScores) => { + const groupCount = epochs; + const itemCount = samples.length / groupCount; + const counter2 = getCounter(itemCount, groupCount, order2); + return (sample2, index, previousSample) => { + const results = []; + const lastEpoch = previousSample ? previousSample.epoch : -1; + if (lastEpoch !== sample2.epoch) { + counter2.incrementGroup(); + results.push({ + label: `Epoch ${counter2.group()}`, + number: counter2.group(), + index, + data: `Epoch ${counter2.group()}`, + type: "separator" + }); + counter2.resetItem(); + } + counter2.incrementItem(); + results.push({ + sampleId: sample2.id, + sampleEpoch: sample2.epoch, + label: `Sample ${sample2.id} (Epoch ${sample2.epoch})`, + number: counter2.item(), + index, + data: sample2, + type: "sample", + answer: sampleDescriptor.selectedScorerDescriptor(sample2)?.answer() || "", + scoresRendered: selectedScores.map( + (sc2) => sampleDescriptor.evalDescriptor.score(sample2, sc2)?.render() + ), + completed: sample2.completed !== void 0 ? sample2.completed : true + }); + return results; + }; +}; +const getCounter = (itemCount, groupCount, order2) => { + let itemIndex = order2 !== "desc" ? 0 : itemCount + 1; + let groupIndex = order2 !== "desc" ? 0 : groupCount + 1; + return { + resetItem: () => { + itemIndex = order2 !== "desc" ? 0 : itemCount + 1; + }, + incrementItem: () => { + if (order2 !== "desc") { + itemIndex++; + } else { + itemIndex--; + } + }, + incrementGroup: () => { + if (order2 !== "desc") { + groupIndex++; + } else { + groupIndex--; + } + }, + item: () => { + return itemIndex; + }, + group: () => { + return groupIndex; + } + }; +}; const useSamplesTabConfig = (evalStatus, refreshLog) => { const totalSampleCount = useTotalSampleCount(); const samplesDescriptor = useSampleDescriptor(); @@ -216025,6 +216530,9 @@ const useSamplesTabConfig = (evalStatus, refreshLog) => { ]); }; const SamplesTab = ({ running }) => { + const selectedSampleHandle = useStore( + (state) => state.log.selectedSampleHandle + ); const sampleSummaries = useFilteredSamples(); const selectedLogDetails = useStore((state) => state.log.selectedLogDetails); const selectedLogFile = useStore((state) => state.logs.selectedLogFile); @@ -216039,19 +216547,57 @@ const SamplesTab = ({ running }) => { ]); const totalSampleCount = useTotalSampleCount(); const samplesDescriptor = useSampleDescriptor(); + const groupBy = useGroupBy(); + const groupByOrder = useGroupByOrder(); + const selectedScores = useSelectedScores(); const selectSample = useStore((state) => state.logActions.selectSample); - const sampleStatus2 = useStore((state) => state.sample.sampleStatus); + const sampleStatus = useStore((state) => state.sample.sampleStatus); const sampleListHandle = reactExports.useRef(null); - const items = reactExports.useMemo(() => { - if (!samplesDescriptor) return []; - return sampleSummaries.map( - (sample2) => ({ - data: sample2, - answer: samplesDescriptor.selectedScorerDescriptor(sample2)?.answer() || "", - completed: sample2.completed !== void 0 ? sample2.completed : true - }) + const sampleProcessor = reactExports.useMemo(() => { + if (!samplesDescriptor) return void 0; + return getSampleProcessor( + sampleSummaries || [], + selectedLogDetails?.eval?.config?.epochs || 1, + groupBy, + groupByOrder, + samplesDescriptor, + selectedScores ); - }, [sampleSummaries, samplesDescriptor]); + }, [ + samplesDescriptor, + sampleSummaries, + selectedLogDetails?.eval?.config?.epochs, + groupBy, + groupByOrder, + selectedScores + ]); + const items = reactExports.useMemo(() => { + const resolvedSamples = sampleSummaries?.flatMap((sample2, index) => { + const results = []; + const previousSample = index !== 0 ? sampleSummaries[index - 1] : void 0; + const items2 = sampleProcessor ? sampleProcessor(sample2, index, previousSample) : []; + results.push(...items2); + return results; + }); + return resolvedSamples || []; + }, [sampleSummaries, sampleProcessor]); + const selectedItemIndex = reactExports.useMemo(() => { + return items.findIndex((item2) => { + if (item2.type !== "sample") { + return false; + } + return sampleIdsEqual(item2.sampleId, selectedSampleHandle?.id) && item2.sampleEpoch === selectedSampleHandle?.epoch; + }); + }, [selectedSampleHandle, items]); + reactExports.useEffect(() => { + setTimeout(() => { + if (sampleListHandle.current && selectedItemIndex >= 0) { + sampleListHandle.current.scrollIntoView({ + index: selectedItemIndex + }); + } + }, 0); + }, [selectedItemIndex]); reactExports.useEffect(() => { if (sampleSummaries.length === 1 && selectedLogFile) { const sample2 = sampleSummaries[0]; @@ -216066,12 +216612,7 @@ const SamplesTab = ({ running }) => { } } else { return /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Fragment, { children: [ - samplesDescriptor && totalSampleCount === 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( - InlineSampleDisplay, - { - showActivity: sampleStatus2 === "loading" || sampleStatus2 === "streaming" - } - ) : void 0, + samplesDescriptor && totalSampleCount === 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(InlineSampleDisplay, { showActivity: sampleStatus === "loading" }) : void 0, samplesDescriptor && totalSampleCount > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx( SampleList, { @@ -216093,7 +216634,7 @@ const grid$1 = "_grid_er9fb_1"; const styles$e = { grid: grid$1 }; -const useTaskTabConfig = (evalSpec, evalStats, earlyStopping, tags2) => { +const useTaskTabConfig = (evalSpec, evalStats, earlyStopping) => { return reactExports.useMemo(() => { return { id: kLogViewTaskTabId, @@ -216103,17 +216644,15 @@ const useTaskTabConfig = (evalSpec, evalStats, earlyStopping, tags2) => { componentProps: { evalSpec, evalStats, - earlyStopping, - tags: tags2 + earlyStopping } }; - }, [evalSpec, evalStats, earlyStopping, tags2]); + }, [evalSpec, evalStats, earlyStopping]); }; const TaskTab = ({ evalSpec, evalStats, - earlyStopping, - tags: tags2 + earlyStopping }) => { Object.entries(evalSpec?.config || {}).forEach((entry) => { entry[0]; @@ -216140,8 +216679,8 @@ const TaskTab = ({ taskInformation["Inspect"] = names; } } - if (tags2 && tags2.length > 0) { - taskInformation["tags"] = tags2.join(", "); + if (evalSpec?.tags) { + taskInformation["tags"] = evalSpec?.tags.join(", "); } if (evalSpec?.sandbox) { if (Array.isArray(evalSpec?.sandbox)) { @@ -217347,22 +217886,28 @@ const LogView = () => { selectedLogDetails?.plan, selectedLogDetails?.error, selectedLogDetails?.results, - selectedLogDetails?.status, - selectedLogDetails?.metadata + selectedLogDetails?.status ); const errorTabConfig = useErrorTabConfig(selectedLogDetails?.error); const taskTabConfig = useTaskTabConfig( evalSpec, selectedLogDetails?.stats, - selectedLogDetails?.results?.early_stopping, - selectedLogDetails?.tags + selectedLogDetails?.results?.early_stopping ); const modelsTabConfig = useModelsTab( evalSpec, selectedLogDetails?.stats, selectedLogDetails?.status ); - const jsonTabConfig = useJsonTabConfig(selectedLogDetails); + const jsonTabConfig = useJsonTabConfig( + selectedLogDetails?.version, + selectedLogDetails?.status, + evalSpec, + selectedLogDetails?.plan, + selectedLogDetails?.error, + selectedLogDetails?.results, + selectedLogDetails?.stats + ); const tabs2 = { ...samplesTabConfig ? { samples: samplesTabConfig } : {}, task: taskTabConfig, @@ -217411,15 +217956,15 @@ const LogView = () => { status: selectedLogDetails?.status } ), - /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: divRef, className: clsx("workspace", styles$u.workspace), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("log-detail", styles$u.tabContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx( + /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: divRef, className: clsx("workspace", styles$x.workspace), children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: clsx("log-detail", styles$x.tabContainer), children: /* @__PURE__ */ jsxRuntimeExports.jsx( TabSet, { id: "log-details", tools: tabTools2, type: "pills", - className: clsx(styles$u.tabSet, "text-size-smaller"), - tabControlsClassName: clsx(styles$u.tabs, "text-size-smaller"), - tabPanelsClassName: clsx(styles$u.tabPanels), + className: clsx(styles$x.tabSet, "text-size-smaller"), + tabControlsClassName: clsx(styles$x.tabs, "text-size-smaller"), + tabPanelsClassName: clsx(styles$x.tabPanels), children: Object.keys(tabs2).map((key2) => { const tab2 = tabs2[key2]; return /* @__PURE__ */ jsxRuntimeExports.jsx( @@ -217712,7 +218257,7 @@ const useSampleColumns = (logDetails) => { pinned: "left", cellRenderer: (params) => { if (params.data?.displayIndex !== void 0) { - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$18.numberCell, children: params.data.displayIndex }); + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1b.numberCell, children: params.data.displayIndex }); } return ""; } @@ -218045,7 +218590,7 @@ const SamplesGrid = ({ reactExports.useEffect(() => { resizeGridColumns(); }, [columns, resizeGridColumns]); - return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$18.gridWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$18.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx( + return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: styles$1b.gridWrapper, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: gridContainerRef, className: styles$1b.gridContainer, tabIndex: 0, children: /* @__PURE__ */ jsxRuntimeExports.jsx( AgGridReact, { ref: gridRef, @@ -218057,7 +218602,6 @@ const SamplesGrid = ({ filter: true, resizable: true }, - tooltipShowDelay: 300, autoSizeStrategy: { type: "fitGridWidth" }, headerHeight: 25, rowSelection: { mode: "singleRow", checkboxes: false }, @@ -218735,8 +219279,8 @@ if (vscode) { 'meta[name="inspect-extension:version"]' ); const extensionVersion = extensionVersionEl ? extensionVersionEl.getAttribute("content") : void 0; - capabilities.downloadFiles = false; if (!extensionVersion) { + capabilities.downloadFiles = false; capabilities.webWorkers = false; } } diff --git a/src/inspect_ai/_view/www/src/app/log-list/grid/LogListGrid.tsx b/src/inspect_ai/_view/www/src/app/log-list/grid/LogListGrid.tsx index a8d0c05bdc..29dbbc659a 100644 --- a/src/inspect_ai/_view/www/src/app/log-list/grid/LogListGrid.tsx +++ b/src/inspect_ai/_view/www/src/app/log-list/grid/LogListGrid.tsx @@ -1,4 +1,5 @@ import type { + CellMouseDownEvent, GridColumnsChangedEvent, IRowNode, RowClickedEvent, @@ -229,6 +230,17 @@ export const LogListGrid: FC = ({ }; }, [handleKeyDown]); + const handleCellMouseDown = useCallback( + (e: CellMouseDownEvent) => { + const mouseEvent = e.event as MouseEvent | undefined; + if (mouseEvent?.button === 1 && e.data?.url) { + mouseEvent.preventDefault(); + window.open(`#${e.data.url}`, "_blank"); + } + }, + [], + ); + useEffect(() => { const loadHeaders = async () => { const filesToLoad = logFiles.filter((file) => !logPreviews[file.name]); @@ -410,6 +422,7 @@ export const LogListGrid: FC = ({ } }} onRowClicked={handleRowClick} + onCellMouseDown={handleCellMouseDown} onSortChanged={handleSortChanged} onFilterChanged={handleFilterChanged} loading={data.length === 0 && (loading > 0 || syncing)} diff --git a/src/inspect_ai/_view/www/src/app/samples-panel/samples-grid/SamplesGrid.tsx b/src/inspect_ai/_view/www/src/app/samples-panel/samples-grid/SamplesGrid.tsx index f9d2d5030c..d0c7f9e429 100644 --- a/src/inspect_ai/_view/www/src/app/samples-panel/samples-grid/SamplesGrid.tsx +++ b/src/inspect_ai/_view/www/src/app/samples-panel/samples-grid/SamplesGrid.tsx @@ -1,4 +1,5 @@ import type { + CellMouseDownEvent, ColDef, GridApi, GridColumnsChangedEvent, @@ -64,7 +65,7 @@ export const SamplesGrid: FC = ({ ); const internalGridRef = useRef>(null); - const gridRef = externalGridRef || internalGridRef; + const gridRef = externalGridRef ?? internalGridRef; const gridContainerRef = useRef(null); // Polling for updated log files @@ -154,7 +155,6 @@ export const SamplesGrid: FC = ({ [gridRef, handleOpenRow], ); - // Set up keyboard event listener useEffect(() => { const gridElement = gridContainerRef.current; if (!gridElement) return; @@ -166,6 +166,22 @@ export const SamplesGrid: FC = ({ }; }, [handleKeyDown]); + const handleCellMouseDown = useCallback( + (e: CellMouseDownEvent) => { + const mouseEvent = e.event as MouseEvent | undefined; + if (mouseEvent?.button === 1 && e.data) { + mouseEvent.preventDefault(); + navigateToSampleDetail( + e.data.logFile, + e.data.sampleId, + e.data.epoch, + true, + ); + } + }, + [navigateToSampleDetail], + ); + const sampleRowId = ( logFile: string, sampleId: string | number, @@ -257,6 +273,7 @@ export const SamplesGrid: FC = ({ } }} onRowClicked={handleRowClick} + onCellMouseDown={handleCellMouseDown} onFilterChanged={() => { if (gridRef.current?.api) { const newDisplayedSamples = gridDisplayedSamples(