@tonyclaw/agent-inspector 3.0.35 → 3.0.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.output/nitro.json +1 -1
- package/.output/public/assets/{CompareDrawer-R4_8sh1x.js → CompareDrawer-BF8Yk4Nq.js} +1 -1
- package/.output/public/assets/{InspectorPet-BXOiEEuy.js → InspectorPet-D01knLHJ.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-CArcMNg_.js +126 -0
- package/.output/public/assets/{ReplayDialog-ChEc6SEZ.js → ReplayDialog-NRgCp09o.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-Ur266kvo.js → RequestAnatomy-BPiUptQ-.js} +1 -1
- package/.output/public/assets/{ResponseView-JmIcAvf3.js → ResponseView-C6oCKVyP.js} +1 -1
- package/.output/public/assets/{StreamingChunkSequence-BxRDf8X0.js → StreamingChunkSequence-B90BNPvD.js} +1 -1
- package/.output/public/assets/{_sessionId-T0zMdPhW.js → _sessionId-B7pqqX6S.js} +1 -1
- package/.output/public/assets/{_sessionId-BcTM61oL.js → _sessionId-c3quqe4s.js} +1 -1
- package/.output/public/assets/index-BQqVblQv.css +1 -0
- package/.output/public/assets/{index-BCy0oH7t.js → index-CjODQxYY.js} +1 -1
- package/.output/public/assets/{index-DXzxeHNI.js → index-CmGZ17BL.js} +1 -1
- package/.output/public/assets/{index-nPB39bG1.js → index-D444FJGM.js} +3 -3
- package/.output/public/assets/{index-DoGM_H4R.js → index-D4Atppe6.js} +1 -1
- package/.output/public/assets/{json-viewer-AR5MqNsi.js → json-viewer-CuYTDXFj.js} +1 -1
- package/.output/public/assets/{jszip.min-Dp1qaNzl.js → jszip.min-C-avw0w1.js} +1 -1
- package/.output/server/_libs/lucide-react.mjs +15 -15
- package/.output/server/_libs/radix-ui__react-id.mjs +1 -1
- package/.output/server/_libs/radix-ui__react-select.mjs +7 -7
- package/.output/server/{_sessionId-D0V28kT_.mjs → _sessionId-BTazjVlZ.mjs} +1 -1
- package/.output/server/{_sessionId-3-efukTe.mjs → _sessionId-BsDZ3m3b.mjs} +23 -23
- package/.output/server/_ssr/{CompareDrawer-CwUnVrgf.mjs → CompareDrawer-BMo93_DO.mjs} +24 -24
- package/.output/server/_ssr/{InspectorPet-DEPoGC_D.mjs → InspectorPet-DApzyYro.mjs} +1 -1
- package/.output/server/_ssr/{ProxyViewerContainer-DT2GnM6k.mjs → ProxyViewerContainer-CiXXtVXH.mjs} +313 -119
- package/.output/server/_ssr/{ReplayDialog-DWjyvYZk.mjs → ReplayDialog-B8bP1qUr.mjs} +25 -25
- package/.output/server/_ssr/{RequestAnatomy-DstKoDNo.mjs → RequestAnatomy-DkVynjyh.mjs} +23 -23
- package/.output/server/_ssr/{ResponseView-_dBVL1_Y.mjs → ResponseView-BAQa0WUP.mjs} +24 -24
- package/.output/server/_ssr/{StreamingChunkSequence-Dv3MUYgf.mjs → StreamingChunkSequence-B4_K4_VI.mjs} +23 -23
- package/.output/server/_ssr/{index-D9TfBt-A.mjs → index-BiwG5Sws.mjs} +23 -23
- package/.output/server/_ssr/{index-DmUQkdzY.mjs → index-DhjNsApq.mjs} +1 -1
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-CWGsCD5R.mjs → json-viewer-Dlpq5S-r.mjs} +24 -24
- package/.output/server/_ssr/{router-BGaTQE2M.mjs → router-6s7p8rsX.mjs} +11 -11
- package/.output/server/{_tanstack-start-manifest_v-BjoievXr.mjs → _tanstack-start-manifest_v-ClIF-cfh.mjs} +1 -1
- package/.output/server/index.mjs +93 -93
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +286 -84
- package/src/components/pi-agent/PiAgentPanel.tsx +90 -33
- package/src/services/piAgent.ts +7 -5
- package/.output/public/assets/ProxyViewerContainer-F4pd4poo.js +0 -126
- package/.output/public/assets/index-D17dU-mX.css +0 -1
package/.output/server/_ssr/{ProxyViewerContainer-DT2GnM6k.mjs → ProxyViewerContainer-CiXXtVXH.mjs}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports, R as React } from "../_libs/react.mjs";
|
|
2
|
-
import { C as CapturedLogSchema, M as DeleteInspectorGroupsResponseSchema, D as DEFAULT_CAPTURE_MODE, a as DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS, b as DEFAULT_PROVIDER_TEST_TIMEOUT_SECONDS, c as DEFAULT_TIME_DISPLAY_FORMAT, m as cn, F as LazyFeatureBoundary, x as formatTokens, B as Button, d as RuntimeConfigSchema, g as readStoredUiScalePreference, h as persistUiScalePreference, j as applyUiScalePreference, ac as CrabLogo, p as packageJson, k as normalizeUiScalePreference, N as GroupEvidenceExportResultSchema, P as DeleteInspectorGroupResponseSchema, y as copyTextToClipboard, l as RedactedProviderDtoSchema, U as UI_SCALE_STORAGE_KEY, v as apiFormatForPath, i as isRecord, a2 as createPendingProviderTestResults, a3 as ProviderTestResultsSchema, a4 as createFailedProviderTestResults, a5 as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, a6 as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, a7 as TimeDisplayFormatSchema, G as AlertSummarySchema, H as AlertListResponseSchema, r as readStoredThemeMode, e as applyThemeMode, f as persistThemeMode, af as formatUiScale, J as InspectorGroupsListResponseSchema, I as GroupEvidenceReadResponseSchema, a8 as EcosystemPackagesResponseSchema, a9 as EcosystemTaskResponseSchema, aa as EcosystemTasksResponseSchema, Y as PATH_V1_MESSAGES, Z as PATH_V1_CHAT_COMPLETIONS, _ as PATH_V1_RESPONSES, V as providerHasContextMetadata, Q as ProviderScanResponseSchema, T as THEME_MODE_STORAGE_KEY, n as normalizeThemeMode, ab as EcosystemExecutionConfirmationResponseSchema, s as safeGetOwnProperty, $ as formatContextWindowInput, W as findProviderModelMetadata, X as formatContextWindowTokens, w as getSessionPath, q as parseOpenAIResponse, t as parseOpenAIResponsesResponse, O as OpenAIRequestSchema, u as OpenAIResponsesRequestSchema, A as AnthropicResponseSchema$1, o as AnthropicRequestSchema, ad as resolveProviderContextWindow, a0 as parseContextWindowTokensInput, a1 as previewUpstreamUrl, K as KnowledgeCandidateSchema, ae as isPlainRecord, E as stripClaudeCodeBillingHeader, L as LogBodyChunkSchema, z as getStatusCategory } from "./router-
|
|
2
|
+
import { C as CapturedLogSchema, M as DeleteInspectorGroupsResponseSchema, D as DEFAULT_CAPTURE_MODE, a as DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS, b as DEFAULT_PROVIDER_TEST_TIMEOUT_SECONDS, c as DEFAULT_TIME_DISPLAY_FORMAT, m as cn, F as LazyFeatureBoundary, x as formatTokens, B as Button, d as RuntimeConfigSchema, g as readStoredUiScalePreference, h as persistUiScalePreference, j as applyUiScalePreference, ac as CrabLogo, p as packageJson, k as normalizeUiScalePreference, N as GroupEvidenceExportResultSchema, P as DeleteInspectorGroupResponseSchema, y as copyTextToClipboard, l as RedactedProviderDtoSchema, U as UI_SCALE_STORAGE_KEY, v as apiFormatForPath, i as isRecord, a2 as createPendingProviderTestResults, a3 as ProviderTestResultsSchema, a4 as createFailedProviderTestResults, a5 as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, a6 as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, a7 as TimeDisplayFormatSchema, G as AlertSummarySchema, H as AlertListResponseSchema, r as readStoredThemeMode, e as applyThemeMode, f as persistThemeMode, af as formatUiScale, J as InspectorGroupsListResponseSchema, I as GroupEvidenceReadResponseSchema, a8 as EcosystemPackagesResponseSchema, a9 as EcosystemTaskResponseSchema, aa as EcosystemTasksResponseSchema, Y as PATH_V1_MESSAGES, Z as PATH_V1_CHAT_COMPLETIONS, _ as PATH_V1_RESPONSES, V as providerHasContextMetadata, Q as ProviderScanResponseSchema, T as THEME_MODE_STORAGE_KEY, n as normalizeThemeMode, ab as EcosystemExecutionConfirmationResponseSchema, s as safeGetOwnProperty, $ as formatContextWindowInput, W as findProviderModelMetadata, X as formatContextWindowTokens, w as getSessionPath, q as parseOpenAIResponse, t as parseOpenAIResponsesResponse, O as OpenAIRequestSchema, u as OpenAIResponsesRequestSchema, A as AnthropicResponseSchema$1, o as AnthropicRequestSchema, ad as resolveProviderContextWindow, a0 as parseContextWindowTokensInput, a1 as previewUpstreamUrl, K as KnowledgeCandidateSchema, ae as isPlainRecord, E as stripClaudeCodeBillingHeader, L as LogBodyChunkSchema, z as getStatusCategory } from "./router-6s7p8rsX.mjs";
|
|
3
3
|
import { u as useSWR, a as useSWRConfig } from "../_libs/swr.mjs";
|
|
4
4
|
import { u as useWindowVirtualizer, a as useVirtualizer } from "../_libs/tanstack__react-virtual.mjs";
|
|
5
5
|
import { c as cva } from "../_libs/class-variance-authority.mjs";
|
|
6
6
|
import { d as diffJson, a as diffLines } from "../_libs/diff.mjs";
|
|
7
|
-
import { T as TriangleAlert, C as CircleCheck, X, P as PanelRightOpen, a as PanelRightClose,
|
|
7
|
+
import { T as TriangleAlert, C as CircleCheck, X, P as PanelRightOpen, a as PanelRightClose, U as Upload, D as Download, F as FileBraces, R as RefreshCw, b as Trash2, I as Info, c as ChevronDown, d as Check, S as Settings, e as Siren, L as LoaderCircle, f as Sun, E as Eye, M as Moon, A as ALargeSmall, g as Layers, h as FlaskConical, i as Sparkles, j as Activity, B as Beaker, N as Network, k as Copy, l as Terminal, m as BrainCircuit, n as RotateCcw, o as Send, p as ArrowLeft, q as ChevronUp, r as Search, s as ChevronsLeft, t as ChevronLeft, u as ChevronRight, v as ChevronsRight, w as CircleStop, x as Clapperboard, y as Flag, z as Timer, G as Gauge, H as Minimize2, J as Maximize2, K as Scan, O as Plus, Q as CircleAlert, V as Rocket, W as PackageCheck, Y as History, Z as Monitor, _ as EyeOff, $ as ExternalLink, a0 as Clock, a1 as RotateCw, a2 as CircleCheckBig, a3 as Pencil, a4 as Bell, a5 as Clock3, a6 as ShieldAlert, a7 as ArrowUpRight, a8 as ArrowDownRight, a9 as CodeXml, aa as Cpu, ab as FolderOpen, ac as MessageSquare, ad as Zap, ae as Wrench, af as Brain, ag as Minus, ah as CircleQuestionMark, ai as Server, aj as Lock, ak as Wifi, al as WifiOff, am as CircleX, an as ShieldCheck, ao as Save, ap as FileSearch, aq as CloudUpload, ar as OctagonAlert, as as Radio, at as Globe, au as FileTerminal, av as ChevronsUp, aw as ChevronsDown, ax as FileDiff, ay as GitCompareArrows, az as ArrowUp, aA as ArrowDown, aB as Ellipsis, aC as Blocks, aD as MousePointerClick, aE as FileText, aF as Rows3, aG as Columns2 } from "../_libs/lucide-react.mjs";
|
|
8
8
|
import { u as union, o as object, e as array, l as literal, n as number, d as boolean, b as string } from "../_libs/zod.mjs";
|
|
9
|
-
import { S as Select$1, a as SelectTrigger$1, b as SelectIcon, c as SelectValue$1, d as SelectPortal, e as SelectContent$1, f as SelectViewport, g as SelectItem$1, h as SelectItemIndicator, i as SelectItemText, j as SelectScrollUpButton$1, k as SelectScrollDownButton$1 } from "../_libs/radix-ui__react-select.mjs";
|
|
10
9
|
import { D as Dialog$1, a as DialogContent$1, b as DialogClose, c as DialogTitle$1, d as DialogDescription$1, e as DialogTrigger$1, f as DialogPortal$1, g as DialogOverlay$1 } from "../_libs/radix-ui__react-dialog.mjs";
|
|
11
10
|
import { R as Root2, C as Content, L as List, T as Trigger } from "../_libs/radix-ui__react-tabs.mjs";
|
|
12
11
|
import { S as Slot } from "../_libs/radix-ui__react-slot.mjs";
|
|
12
|
+
import { S as Select$1, a as SelectTrigger$1, b as SelectIcon, c as SelectPortal, d as SelectContent$1, e as SelectViewport, f as SelectItem$1, g as SelectItemIndicator, h as SelectItemText, i as SelectValue$1, j as SelectScrollUpButton$1, k as SelectScrollDownButton$1 } from "../_libs/radix-ui__react-select.mjs";
|
|
13
13
|
import { P as Provider, R as Root3, T as Trigger$1, a as Portal, C as Content2, A as Arrow2 } from "../_libs/radix-ui__react-tooltip.mjs";
|
|
14
14
|
import { R as Root, C as CollapsibleContent$1, a as CollapsibleTrigger$1 } from "../_libs/radix-ui__react-collapsible.mjs";
|
|
15
15
|
import { R as Root$1, V as Viewport, C as Corner, S as ScrollAreaScrollbar, a as ScrollAreaThumb } from "../_libs/radix-ui__react-scroll-area.mjs";
|
|
@@ -2504,30 +2504,30 @@ function useCopyFeedback(text) {
|
|
|
2504
2504
|
return { copied, copy };
|
|
2505
2505
|
}
|
|
2506
2506
|
const LazyCompareDrawer = reactExports.lazy(
|
|
2507
|
-
() => import("./CompareDrawer-
|
|
2507
|
+
() => import("./CompareDrawer-BMo93_DO.mjs").then((m) => ({ default: m.CompareDrawer }))
|
|
2508
2508
|
);
|
|
2509
2509
|
const LazyInspectorPet = reactExports.lazy(
|
|
2510
|
-
() => import("./InspectorPet-
|
|
2510
|
+
() => import("./InspectorPet-DApzyYro.mjs").then((m) => ({ default: m.InspectorPet }))
|
|
2511
2511
|
);
|
|
2512
2512
|
const LazyReplayDialog = reactExports.lazy(
|
|
2513
|
-
() => import("./ReplayDialog-
|
|
2513
|
+
() => import("./ReplayDialog-B8bP1qUr.mjs").then((m) => ({ default: m.ReplayDialog }))
|
|
2514
2514
|
);
|
|
2515
2515
|
const LazyRequestAnatomy = reactExports.lazy(
|
|
2516
|
-
() => import("./RequestAnatomy-
|
|
2516
|
+
() => import("./RequestAnatomy-DkVynjyh.mjs").then((m) => ({ default: m.RequestAnatomy }))
|
|
2517
2517
|
);
|
|
2518
2518
|
const LazyResponseView = reactExports.lazy(
|
|
2519
|
-
() => import("./ResponseView-
|
|
2519
|
+
() => import("./ResponseView-BAQa0WUP.mjs").then((m) => ({ default: m.ResponseView }))
|
|
2520
2520
|
);
|
|
2521
2521
|
const LazyStreamingChunkSequence = reactExports.lazy(
|
|
2522
|
-
() => import("./StreamingChunkSequence-
|
|
2522
|
+
() => import("./StreamingChunkSequence-B4_K4_VI.mjs").then((m) => ({
|
|
2523
2523
|
default: m.StreamingChunkSequence
|
|
2524
2524
|
}))
|
|
2525
2525
|
);
|
|
2526
2526
|
const LazyJsonViewer = reactExports.lazy(
|
|
2527
|
-
() => import("./json-viewer-
|
|
2527
|
+
() => import("./json-viewer-Dlpq5S-r.mjs").then((m) => ({ default: m.JsonViewer }))
|
|
2528
2528
|
);
|
|
2529
2529
|
const LazyJsonViewerFromString = reactExports.lazy(
|
|
2530
|
-
() => import("./json-viewer-
|
|
2530
|
+
() => import("./json-viewer-Dlpq5S-r.mjs").then((m) => ({ default: m.JsonViewerFromString }))
|
|
2531
2531
|
);
|
|
2532
2532
|
const HIGHLIGHT_DURATION_MS = 1200;
|
|
2533
2533
|
const MAX_HIGHLIGHT_ATTEMPTS = 12;
|
|
@@ -12485,12 +12485,32 @@ function sortProviderBySource(providers) {
|
|
|
12485
12485
|
function nextMessageId(role) {
|
|
12486
12486
|
return `${role}-${String(Date.now())}-${String(Math.random()).slice(2)}`;
|
|
12487
12487
|
}
|
|
12488
|
+
function TerminalLabel({
|
|
12489
|
+
label,
|
|
12490
|
+
value,
|
|
12491
|
+
tone = "muted"
|
|
12492
|
+
}) {
|
|
12493
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-center gap-1.5 font-mono text-[10px]", children: [
|
|
12494
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: tone === "cyan" ? "text-cyan-100" : "text-muted-foreground", children: label }),
|
|
12495
|
+
value !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
12496
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground/55", children: ":" }),
|
|
12497
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate text-muted-foreground", children: value })
|
|
12498
|
+
] })
|
|
12499
|
+
] });
|
|
12500
|
+
}
|
|
12488
12501
|
function MetricStrip({ metrics }) {
|
|
12489
12502
|
if (metrics.length === 0) return null;
|
|
12490
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "
|
|
12491
|
-
|
|
12492
|
-
|
|
12493
|
-
|
|
12503
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2 gap-1.5", children: metrics.slice(0, 8).map((metric) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12504
|
+
"div",
|
|
12505
|
+
{
|
|
12506
|
+
className: "rounded-sm bg-black/25 px-2 py-1 shadow-[inset_2px_0_0_rgba(103,232,249,0.22)]",
|
|
12507
|
+
children: [
|
|
12508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate font-mono text-[9px] text-muted-foreground", children: metric.label }),
|
|
12509
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate font-mono text-[11px] text-cyan-50/95", children: metric.value })
|
|
12510
|
+
]
|
|
12511
|
+
},
|
|
12512
|
+
metric.key
|
|
12513
|
+
)) });
|
|
12494
12514
|
}
|
|
12495
12515
|
function EvidenceCard({ evidence }) {
|
|
12496
12516
|
const openLog = () => {
|
|
@@ -12504,7 +12524,7 @@ function EvidenceCard({ evidence }) {
|
|
|
12504
12524
|
type: "button",
|
|
12505
12525
|
onClick: openLog,
|
|
12506
12526
|
disabled: evidence.logId === null,
|
|
12507
|
-
className: "w-full rounded-sm bg-black/
|
|
12527
|
+
className: "w-full rounded-sm bg-black/25 px-2 py-2 text-left shadow-[inset_2px_0_0_rgba(103,232,249,0.22),inset_0_0_0_1px_rgba(255,255,255,0.045)] transition-colors hover:bg-black/35 disabled:cursor-default disabled:hover:bg-black/25",
|
|
12508
12528
|
children: [
|
|
12509
12529
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2", children: [
|
|
12510
12530
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "truncate font-mono text-[10px] text-cyan-100", children: title }),
|
|
@@ -12528,31 +12548,49 @@ function EvidenceCard({ evidence }) {
|
|
|
12528
12548
|
);
|
|
12529
12549
|
}
|
|
12530
12550
|
function AssistantMessage({ response }) {
|
|
12531
|
-
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-md bg-
|
|
12532
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
12533
|
-
|
|
12534
|
-
|
|
12535
|
-
|
|
12536
|
-
|
|
12537
|
-
|
|
12538
|
-
response.protocol,
|
|
12539
|
-
" /",
|
|
12540
|
-
" ",
|
|
12541
|
-
String(response.logCount),
|
|
12542
|
-
" matched logs"
|
|
12551
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-hidden rounded-md bg-[#050b12]/85 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.12),0_10px_24px_rgba(0,0,0,0.18)]", children: [
|
|
12552
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-center justify-between gap-2 border-b border-cyan-100/[0.08] bg-cyan-400/[0.045] px-3 py-2", children: [
|
|
12553
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "assistant@inspector", value: "output", tone: "cyan" }),
|
|
12554
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "shrink-0 font-mono text-[9px] text-muted-foreground", children: [
|
|
12555
|
+
String(response.logCount),
|
|
12556
|
+
" logs"
|
|
12557
|
+
] })
|
|
12543
12558
|
] }),
|
|
12544
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
12545
|
-
|
|
12546
|
-
|
|
12559
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 p-3", children: [
|
|
12560
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "rounded-sm bg-black/20 px-2.5 py-2 text-xs leading-5 shadow-[inset_2px_0_0_rgba(103,232,249,0.28)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(AnswerMarkdown, { text: response.answer }) }),
|
|
12561
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-1.5 rounded-sm bg-black/20 px-2 py-1.5", children: [
|
|
12562
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "provider", value: response.providerName }),
|
|
12563
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "model", value: response.model }),
|
|
12564
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "protocol", value: response.protocol })
|
|
12565
|
+
] }),
|
|
12566
|
+
(response.summaryMetrics.length > 0 || response.queryMetrics.length > 0) && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
12567
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "metrics", tone: "cyan" }),
|
|
12568
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(MetricStrip, { metrics: [...response.summaryMetrics, ...response.queryMetrics] })
|
|
12569
|
+
] }),
|
|
12570
|
+
response.evidence.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-1.5", children: [
|
|
12571
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "evidence", value: "click to inspect source log", tone: "cyan" }),
|
|
12572
|
+
response.evidence.slice(0, 6).map((evidence) => /* @__PURE__ */ jsxRuntimeExports.jsx(EvidenceCard, { evidence }, `${evidence.source}-${evidence.id}`))
|
|
12573
|
+
] })
|
|
12574
|
+
] })
|
|
12547
12575
|
] });
|
|
12548
12576
|
}
|
|
12549
12577
|
function ConversationMessage({ message }) {
|
|
12550
12578
|
if (message.role === "assistant" && message.response !== null) {
|
|
12551
12579
|
return /* @__PURE__ */ jsxRuntimeExports.jsx(AssistantMessage, { response: message.response });
|
|
12552
12580
|
}
|
|
12553
|
-
return /* @__PURE__ */ jsxRuntimeExports.
|
|
12581
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "overflow-hidden rounded-md bg-black/25 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.055)]", children: [
|
|
12582
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border-b border-white/[0.06] px-3 py-1.5", children: /* @__PURE__ */ jsxRuntimeExports.jsx(TerminalLabel, { label: "user@inspector", value: "query", tone: "cyan" }) }),
|
|
12583
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-3 py-2 font-mono text-[11px] leading-5 text-cyan-50", children: [
|
|
12584
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "select-none text-cyan-100/60", children: "> " }),
|
|
12585
|
+
message.content
|
|
12586
|
+
] })
|
|
12587
|
+
] });
|
|
12554
12588
|
}
|
|
12555
|
-
function PiAgentPanel({
|
|
12589
|
+
function PiAgentPanel({
|
|
12590
|
+
currentSessionId,
|
|
12591
|
+
logCount,
|
|
12592
|
+
suggestedQuestion
|
|
12593
|
+
}) {
|
|
12556
12594
|
const { providers } = useProviders();
|
|
12557
12595
|
const piProviders = reactExports.useMemo(
|
|
12558
12596
|
() => sortProviderBySource(providers.filter(providerSupportsPiAgent)),
|
|
@@ -12569,6 +12607,10 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12569
12607
|
const modelOptions = selectedProvider?.models ?? [];
|
|
12570
12608
|
const question = conversation.question;
|
|
12571
12609
|
const canAsk = question.trim() !== "" && piProviders.length > 0 && !loading;
|
|
12610
|
+
reactExports.useEffect(() => {
|
|
12611
|
+
if (suggestedQuestion === void 0 || suggestedQuestion.trim() === "") return;
|
|
12612
|
+
setConversation((current) => ({ ...current, question: suggestedQuestion, error: null }));
|
|
12613
|
+
}, [suggestedQuestion]);
|
|
12572
12614
|
const handleQuestionChange = (event) => {
|
|
12573
12615
|
setConversation((current) => ({ ...current, question: event.currentTarget.value }));
|
|
12574
12616
|
};
|
|
@@ -12619,7 +12661,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12619
12661
|
if (!response.ok) {
|
|
12620
12662
|
setConversation((current) => ({
|
|
12621
12663
|
...current,
|
|
12622
|
-
error: `
|
|
12664
|
+
error: `Inspector Assistant failed: HTTP ${String(response.status)} ${raw}`
|
|
12623
12665
|
}));
|
|
12624
12666
|
return;
|
|
12625
12667
|
}
|
|
@@ -12628,7 +12670,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12628
12670
|
if (normalized === null) {
|
|
12629
12671
|
setConversation((current) => ({
|
|
12630
12672
|
...current,
|
|
12631
|
-
error: "
|
|
12673
|
+
error: "Inspector Assistant returned an unexpected response."
|
|
12632
12674
|
}));
|
|
12633
12675
|
return;
|
|
12634
12676
|
}
|
|
@@ -12647,7 +12689,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12647
12689
|
}).catch((err) => {
|
|
12648
12690
|
setConversation((current) => ({
|
|
12649
12691
|
...current,
|
|
12650
|
-
error: err instanceof Error ? err.message : "
|
|
12692
|
+
error: err instanceof Error ? err.message : "Inspector Assistant request failed."
|
|
12651
12693
|
}));
|
|
12652
12694
|
}).finally(() => {
|
|
12653
12695
|
setLoading(false);
|
|
@@ -12657,7 +12699,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12657
12699
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
12658
12700
|
/* @__PURE__ */ jsxRuntimeExports.jsx(BrainCircuit, { className: "size-4 text-cyan-200" }),
|
|
12659
12701
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
12660
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-semibold text-foreground", children: "
|
|
12702
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs font-semibold text-foreground", children: "Inspector Assistant" }),
|
|
12661
12703
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-[11px] text-muted-foreground", children: currentSessionId === null ? "Ask saved Inspector data" : "Ask this session" })
|
|
12662
12704
|
] }),
|
|
12663
12705
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -12672,7 +12714,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12672
12714
|
)
|
|
12673
12715
|
] }),
|
|
12674
12716
|
conversation.messages.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 rounded-md bg-black/[0.18] px-3 py-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: [
|
|
12675
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] leading-5 text-muted-foreground", children: "
|
|
12717
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] leading-5 text-muted-foreground", children: "Ask your Inspector memory across saved traffic, sessions, tools, Provider signals, alerts, runs, groups, and knowledge candidates. Answers include linked evidence." }),
|
|
12676
12718
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 grid gap-1.5", children: PI_AGENT_SCOPE_PILLS.map((pill) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
12677
12719
|
"div",
|
|
12678
12720
|
{
|
|
@@ -12733,7 +12775,7 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12733
12775
|
value: question,
|
|
12734
12776
|
onChange: handleQuestionChange,
|
|
12735
12777
|
className: "mt-3 min-h-20 w-full resize-y rounded-md bg-black/25 px-3 py-2 text-xs leading-5 text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors placeholder:text-muted-foreground focus-visible:ring-1 focus-visible:ring-ring",
|
|
12736
|
-
placeholder: "Ask
|
|
12778
|
+
placeholder: "Ask across saved Inspector data..."
|
|
12737
12779
|
}
|
|
12738
12780
|
),
|
|
12739
12781
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
@@ -12745,13 +12787,13 @@ function PiAgentPanel({ currentSessionId, logCount }) {
|
|
|
12745
12787
|
className: "mt-2 inline-flex h-8 w-full items-center justify-center gap-2 rounded-md bg-cyan-400/12 px-3 text-xs font-medium text-cyan-100 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.18)] transition-colors hover:bg-cyan-400/18 disabled:cursor-not-allowed disabled:opacity-50",
|
|
12746
12788
|
children: [
|
|
12747
12789
|
loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Send, { className: "size-3.5" }),
|
|
12748
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: loading ? "Thinking..." : "Ask
|
|
12790
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: loading ? "Thinking..." : "Ask Assistant" })
|
|
12749
12791
|
]
|
|
12750
12792
|
}
|
|
12751
12793
|
),
|
|
12752
12794
|
conversation.error !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 break-words text-[11px] leading-5 text-red-200", children: conversation.error }),
|
|
12753
|
-
piProviders.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-[11px] leading-5 text-muted-foreground", children: "Configure a Provider with Responses, Chat, or Anthropic URL to enable
|
|
12754
|
-
logCount === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-[11px] leading-5 text-muted-foreground", children: "No logs are visible in this scope yet;
|
|
12795
|
+
piProviders.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-[11px] leading-5 text-muted-foreground", children: "Configure a Provider with Responses, Chat, or Anthropic URL to enable Inspector Assistant." }),
|
|
12796
|
+
logCount === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-2 text-[11px] leading-5 text-muted-foreground", children: "No logs are visible in this scope yet; Inspector Assistant can still answer Provider setup questions." })
|
|
12755
12797
|
] });
|
|
12756
12798
|
}
|
|
12757
12799
|
function computeCacheTrends(groups) {
|
|
@@ -14796,6 +14838,173 @@ function truncateSessionId(id) {
|
|
|
14796
14838
|
if (id.length <= 30) return id;
|
|
14797
14839
|
return `${id.slice(0, 12)}...${id.slice(-12)}`;
|
|
14798
14840
|
}
|
|
14841
|
+
function normalizeSearchQuery(value) {
|
|
14842
|
+
return value.trim().toLowerCase();
|
|
14843
|
+
}
|
|
14844
|
+
function includesSearchText(value, query) {
|
|
14845
|
+
return value !== null && value !== void 0 && value.toLowerCase().includes(query);
|
|
14846
|
+
}
|
|
14847
|
+
function buildSessionSuggestionDetail(sessionId, logs) {
|
|
14848
|
+
const scopedLogs = logs.filter((log) => log.sessionId === sessionId);
|
|
14849
|
+
if (scopedLogs.length === 0) return "Stored session";
|
|
14850
|
+
const models = /* @__PURE__ */ new Set();
|
|
14851
|
+
const providers = /* @__PURE__ */ new Set();
|
|
14852
|
+
for (const log of scopedLogs) {
|
|
14853
|
+
if (log.model !== null && log.model !== "") models.add(log.model);
|
|
14854
|
+
if (log.providerName !== null && log.providerName !== void 0 && log.providerName.trim() !== "") {
|
|
14855
|
+
providers.add(log.providerName);
|
|
14856
|
+
}
|
|
14857
|
+
}
|
|
14858
|
+
const modelLabel = models.size === 0 ? "unknown model" : [...models].slice(0, 2).join(", ");
|
|
14859
|
+
const providerLabel = providers.size === 0 ? "unknown provider" : [...providers].slice(0, 2).join(", ");
|
|
14860
|
+
return `${String(scopedLogs.length)} req · ${providerLabel} · ${modelLabel}`;
|
|
14861
|
+
}
|
|
14862
|
+
function sessionMatchesSearchQuery(sessionId, logs, query) {
|
|
14863
|
+
if (includesSearchText(sessionId, query)) return true;
|
|
14864
|
+
return logs.some(
|
|
14865
|
+
(log) => log.sessionId === sessionId && (includesSearchText(log.model, query) || includesSearchText(log.providerName, query) || includesSearchText(log.path, query))
|
|
14866
|
+
);
|
|
14867
|
+
}
|
|
14868
|
+
function buildSessionSearchSuggestions({
|
|
14869
|
+
query,
|
|
14870
|
+
sessions,
|
|
14871
|
+
models,
|
|
14872
|
+
logs
|
|
14873
|
+
}) {
|
|
14874
|
+
const normalizedQuery = normalizeSearchQuery(query);
|
|
14875
|
+
const suggestions = [];
|
|
14876
|
+
if (normalizedQuery === "") {
|
|
14877
|
+
suggestions.push({
|
|
14878
|
+
id: "all",
|
|
14879
|
+
label: "All sessions",
|
|
14880
|
+
detail: `${String(logs.length)} visible requests`,
|
|
14881
|
+
kind: "all",
|
|
14882
|
+
value: "__all__"
|
|
14883
|
+
});
|
|
14884
|
+
for (const session of sessions.slice(0, 5)) {
|
|
14885
|
+
suggestions.push({
|
|
14886
|
+
id: `session-${session}`,
|
|
14887
|
+
label: truncateSessionId(session),
|
|
14888
|
+
detail: buildSessionSuggestionDetail(session, logs),
|
|
14889
|
+
kind: "session",
|
|
14890
|
+
value: session
|
|
14891
|
+
});
|
|
14892
|
+
}
|
|
14893
|
+
return suggestions;
|
|
14894
|
+
}
|
|
14895
|
+
const matchingSessions = sessions.filter(
|
|
14896
|
+
(session) => sessionMatchesSearchQuery(session, logs, normalizedQuery)
|
|
14897
|
+
);
|
|
14898
|
+
for (const session of matchingSessions.slice(0, 5)) {
|
|
14899
|
+
suggestions.push({
|
|
14900
|
+
id: `session-${session}`,
|
|
14901
|
+
label: truncateSessionId(session),
|
|
14902
|
+
detail: buildSessionSuggestionDetail(session, logs),
|
|
14903
|
+
kind: "session",
|
|
14904
|
+
value: session
|
|
14905
|
+
});
|
|
14906
|
+
}
|
|
14907
|
+
const matchingModels = models.filter((model) => includesSearchText(model, normalizedQuery));
|
|
14908
|
+
for (const model of matchingModels.slice(0, 3)) {
|
|
14909
|
+
suggestions.push({
|
|
14910
|
+
id: `model-${model}`,
|
|
14911
|
+
label: model,
|
|
14912
|
+
detail: "Model filter",
|
|
14913
|
+
kind: "model",
|
|
14914
|
+
value: model
|
|
14915
|
+
});
|
|
14916
|
+
}
|
|
14917
|
+
return suggestions.slice(0, 7);
|
|
14918
|
+
}
|
|
14919
|
+
function buildAssistantQuestionFromSearch(query, selectedSession) {
|
|
14920
|
+
const trimmed = query.trim();
|
|
14921
|
+
const scope = selectedSession === "__all__" ? "all visible Inspector sessions" : `session ${selectedSession}`;
|
|
14922
|
+
if (trimmed === "") {
|
|
14923
|
+
return `Analyze ${scope}. What failed, slowed down, or deserves attention?`;
|
|
14924
|
+
}
|
|
14925
|
+
return `Search ${scope} for "${trimmed}" and explain the relevant failures, latency, token usage, provider behavior, and evidence.`;
|
|
14926
|
+
}
|
|
14927
|
+
function SessionSearchBox({
|
|
14928
|
+
query,
|
|
14929
|
+
suggestions,
|
|
14930
|
+
selectedSession,
|
|
14931
|
+
selectedModel,
|
|
14932
|
+
onQueryChange,
|
|
14933
|
+
onApplySuggestion,
|
|
14934
|
+
onClear,
|
|
14935
|
+
onAskAssistant
|
|
14936
|
+
}) {
|
|
14937
|
+
const handleKeyDown = (event) => {
|
|
14938
|
+
if (event.key !== "Enter") return;
|
|
14939
|
+
const firstSuggestion = suggestions[0];
|
|
14940
|
+
if (firstSuggestion === void 0) return;
|
|
14941
|
+
event.preventDefault();
|
|
14942
|
+
onApplySuggestion(firstSuggestion);
|
|
14943
|
+
};
|
|
14944
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-xl bg-black/20 p-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.055)]", children: [
|
|
14945
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
14946
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "pointer-events-none absolute left-3 top-1/2 size-3.5 -translate-y-1/2 text-cyan-100/70" }),
|
|
14947
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14948
|
+
"input",
|
|
14949
|
+
{
|
|
14950
|
+
type: "search",
|
|
14951
|
+
value: query,
|
|
14952
|
+
onChange: (event) => onQueryChange(event.currentTarget.value),
|
|
14953
|
+
onKeyDown: handleKeyDown,
|
|
14954
|
+
placeholder: "Search sessions, models, providers...",
|
|
14955
|
+
className: "h-10 w-full rounded-full bg-black/30 px-9 pr-9 text-xs text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(103,232,249,0.13)] transition-colors placeholder:text-muted-foreground hover:bg-black/35 focus-visible:ring-1 focus-visible:ring-cyan-200/70",
|
|
14956
|
+
"aria-label": "Search sessions and models"
|
|
14957
|
+
}
|
|
14958
|
+
),
|
|
14959
|
+
(query !== "" || selectedSession !== "__all__" || selectedModel !== "__all__") && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14960
|
+
"button",
|
|
14961
|
+
{
|
|
14962
|
+
type: "button",
|
|
14963
|
+
onClick: onClear,
|
|
14964
|
+
className: "absolute right-2 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-white/[0.07] hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none",
|
|
14965
|
+
"aria-label": "Clear session search",
|
|
14966
|
+
title: "Clear search",
|
|
14967
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "size-3.5" })
|
|
14968
|
+
}
|
|
14969
|
+
)
|
|
14970
|
+
] }),
|
|
14971
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 flex flex-wrap gap-1.5", children: [
|
|
14972
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14973
|
+
"button",
|
|
14974
|
+
{
|
|
14975
|
+
type: "button",
|
|
14976
|
+
onClick: onAskAssistant,
|
|
14977
|
+
className: "inline-flex h-7 items-center rounded-full bg-cyan-400/10 px-2.5 text-[11px] font-medium text-cyan-100 shadow-[inset_0_0_0_1px_rgba(103,232,249,0.14)] transition-colors hover:bg-cyan-400/16",
|
|
14978
|
+
children: "Ask Assistant"
|
|
14979
|
+
}
|
|
14980
|
+
),
|
|
14981
|
+
selectedSession !== "__all__" && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex h-7 max-w-full items-center rounded-full bg-white/[0.045] px-2.5 font-mono text-[10px] text-muted-foreground", children: [
|
|
14982
|
+
"session:",
|
|
14983
|
+
truncateSessionId(selectedSession)
|
|
14984
|
+
] }),
|
|
14985
|
+
selectedModel !== "__all__" && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex h-7 max-w-full items-center rounded-full bg-white/[0.045] px-2.5 text-[10px] text-muted-foreground", children: [
|
|
14986
|
+
"model:",
|
|
14987
|
+
selectedModel
|
|
14988
|
+
] })
|
|
14989
|
+
] }),
|
|
14990
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 space-y-1", children: suggestions.map((suggestion) => /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14991
|
+
"button",
|
|
14992
|
+
{
|
|
14993
|
+
type: "button",
|
|
14994
|
+
onClick: () => onApplySuggestion(suggestion),
|
|
14995
|
+
className: "grid w-full grid-cols-[minmax(0,1fr)_auto] items-center gap-2 rounded-lg px-2 py-1.5 text-left transition-colors hover:bg-white/[0.045] focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none",
|
|
14996
|
+
children: [
|
|
14997
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "min-w-0", children: [
|
|
14998
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block truncate text-[11px] font-medium text-foreground", children: suggestion.label }),
|
|
14999
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block truncate text-[10px] text-muted-foreground", children: suggestion.detail })
|
|
15000
|
+
] }),
|
|
15001
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded-full bg-white/[0.045] px-2 py-0.5 text-[9px] uppercase tracking-[0.12em] text-muted-foreground", children: suggestion.kind })
|
|
15002
|
+
]
|
|
15003
|
+
},
|
|
15004
|
+
suggestion.id
|
|
15005
|
+
)) })
|
|
15006
|
+
] });
|
|
15007
|
+
}
|
|
14799
15008
|
function buildDisplayNumberByLogId(groups) {
|
|
14800
15009
|
const result = /* @__PURE__ */ new Map();
|
|
14801
15010
|
for (const group of groups) {
|
|
@@ -15822,6 +16031,10 @@ function ProxyViewer({
|
|
|
15822
16031
|
const [detailsPanelStorageLoaded, setDetailsPanelStorageLoaded] = reactExports.useState(false);
|
|
15823
16032
|
const [petVisible, setPetVisible] = reactExports.useState(true);
|
|
15824
16033
|
const [petVisibilityStorageLoaded, setPetVisibilityStorageLoaded] = reactExports.useState(false);
|
|
16034
|
+
const [sessionSearchQuery, setSessionSearchQuery] = reactExports.useState("");
|
|
16035
|
+
const [assistantSuggestedQuestion, setAssistantSuggestedQuestion] = reactExports.useState(
|
|
16036
|
+
void 0
|
|
16037
|
+
);
|
|
15825
16038
|
const [comparePair, setComparePair] = reactExports.useState(null);
|
|
15826
16039
|
const logListRef = reactExports.useRef(null);
|
|
15827
16040
|
const logListWrapperRef = reactExports.useRef(null);
|
|
@@ -16029,8 +16242,15 @@ function ProxyViewer({
|
|
|
16029
16242
|
const deleteTargetLabel = selectedSession === "__all__" ? "all sessions" : "this session";
|
|
16030
16243
|
const deleteTargetDescription = selectedSession === "__all__" ? "Deletes every stored log, streaming chunk, and session archive entry across all sessions." : "Deletes every stored log, streaming chunk, and session archive entry for this session, including history that is not currently loaded.";
|
|
16031
16244
|
const reloadSessionLabel = logs.length === 0 ? "Load" : "Reload";
|
|
16032
|
-
const
|
|
16033
|
-
|
|
16245
|
+
const sessionSearchSuggestions = reactExports.useMemo(
|
|
16246
|
+
() => buildSessionSearchSuggestions({
|
|
16247
|
+
query: sessionSearchQuery,
|
|
16248
|
+
sessions,
|
|
16249
|
+
models,
|
|
16250
|
+
logs
|
|
16251
|
+
}),
|
|
16252
|
+
[logs, models, sessionSearchQuery, sessions]
|
|
16253
|
+
);
|
|
16034
16254
|
const activeScopeLabel = hasSessionContext && sessionContextScope !== null ? truncateSessionId(sessionContextScope.label) : selectedSession === "__all__" ? "All sessions" : truncateSessionId(selectedSession);
|
|
16035
16255
|
const liveEmptyState = resolveLiveEmptyState(liveConnection);
|
|
16036
16256
|
const liveEmptyStateCopy = getLiveEmptyStateCopy(liveEmptyState);
|
|
@@ -16051,20 +16271,36 @@ function ProxyViewer({
|
|
|
16051
16271
|
},
|
|
16052
16272
|
[comparisonPredecessors]
|
|
16053
16273
|
);
|
|
16054
|
-
const
|
|
16055
|
-
(
|
|
16056
|
-
|
|
16057
|
-
|
|
16058
|
-
|
|
16059
|
-
|
|
16060
|
-
|
|
16061
|
-
|
|
16062
|
-
|
|
16063
|
-
|
|
16064
|
-
|
|
16274
|
+
const handleApplySessionSearchSuggestion = reactExports.useCallback(
|
|
16275
|
+
(suggestion) => {
|
|
16276
|
+
switch (suggestion.kind) {
|
|
16277
|
+
case "all":
|
|
16278
|
+
onSessionChange("__all__");
|
|
16279
|
+
onModelChange("__all__");
|
|
16280
|
+
setSessionSearchQuery("");
|
|
16281
|
+
break;
|
|
16282
|
+
case "session":
|
|
16283
|
+
onSessionChange(suggestion.value);
|
|
16284
|
+
setSessionSearchQuery(suggestion.value);
|
|
16285
|
+
break;
|
|
16286
|
+
case "model":
|
|
16287
|
+
onModelChange(suggestion.value);
|
|
16288
|
+
setSessionSearchQuery(suggestion.value);
|
|
16289
|
+
break;
|
|
16290
|
+
}
|
|
16065
16291
|
},
|
|
16066
|
-
[onSessionChange]
|
|
16292
|
+
[onModelChange, onSessionChange]
|
|
16067
16293
|
);
|
|
16294
|
+
const handleClearSessionSearch = reactExports.useCallback(() => {
|
|
16295
|
+
setSessionSearchQuery("");
|
|
16296
|
+
onSessionChange("__all__");
|
|
16297
|
+
onModelChange("__all__");
|
|
16298
|
+
}, [onModelChange, onSessionChange]);
|
|
16299
|
+
const handleAskAssistantFromSearch = reactExports.useCallback(() => {
|
|
16300
|
+
setAssistantSuggestedQuestion(
|
|
16301
|
+
buildAssistantQuestionFromSearch(sessionSearchQuery, selectedSession)
|
|
16302
|
+
);
|
|
16303
|
+
}, [selectedSession, sessionSearchQuery]);
|
|
16068
16304
|
const labSessionId = pinnedSessionId !== void 0 ? pinnedSessionId : selectedSession === "__all__" ? null : selectedSession;
|
|
16069
16305
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-background min-h-screen w-full overflow-x-clip text-foreground lg:h-screen lg:flex lg:flex-col lg:overflow-hidden", children: [
|
|
16070
16306
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -16147,7 +16383,14 @@ function ProxyViewer({
|
|
|
16147
16383
|
),
|
|
16148
16384
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-[11px] text-muted-foreground", children: isPinnedSessionPage ? "Session workspace" : "Live workspace" })
|
|
16149
16385
|
] }) }),
|
|
16150
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16386
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16387
|
+
PiAgentPanel,
|
|
16388
|
+
{
|
|
16389
|
+
currentSessionId: labSessionId,
|
|
16390
|
+
logCount: logs.length,
|
|
16391
|
+
suggestedQuestion: assistantSuggestedQuestion
|
|
16392
|
+
}
|
|
16393
|
+
),
|
|
16151
16394
|
hasSessionContext && sessionContextScope !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16152
16395
|
SessionContextBar,
|
|
16153
16396
|
{
|
|
@@ -16161,68 +16404,19 @@ function ProxyViewer({
|
|
|
16161
16404
|
}
|
|
16162
16405
|
),
|
|
16163
16406
|
hasSessionContext && pinnedSessionId !== void 0 && sessionMemberships.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(SessionMembershipPanel, { memberships: sessionMemberships }),
|
|
16164
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Filters", children: /* @__PURE__ */ jsxRuntimeExports.
|
|
16165
|
-
|
|
16166
|
-
|
|
16167
|
-
|
|
16168
|
-
|
|
16169
|
-
|
|
16170
|
-
|
|
16171
|
-
|
|
16172
|
-
|
|
16173
|
-
|
|
16174
|
-
|
|
16175
|
-
|
|
16176
|
-
|
|
16177
|
-
title: "Filter by exact session ID"
|
|
16178
|
-
}
|
|
16179
|
-
),
|
|
16180
|
-
sessionInputValue !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16181
|
-
"button",
|
|
16182
|
-
{
|
|
16183
|
-
type: "button",
|
|
16184
|
-
onClick: () => onSessionChange("__all__"),
|
|
16185
|
-
className: "absolute right-1.5 top-1/2 inline-flex size-6 -translate-y-1/2 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-white/[0.06] hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none",
|
|
16186
|
-
"aria-label": "Clear session filter",
|
|
16187
|
-
title: "Clear session filter",
|
|
16188
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "size-3.5" })
|
|
16189
|
-
}
|
|
16190
|
-
)
|
|
16191
|
-
] }),
|
|
16192
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: sessionSelectValue, onValueChange: handleSessionSelectChange, children: [
|
|
16193
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16194
|
-
SelectTrigger,
|
|
16195
|
-
{
|
|
16196
|
-
"aria-label": "Select a session",
|
|
16197
|
-
className: "bg-black/25 hover:bg-white/[0.045] h-9 w-full border-0 text-xs text-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]",
|
|
16198
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All sessions" })
|
|
16199
|
-
}
|
|
16200
|
-
),
|
|
16201
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
16202
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All sessions" }),
|
|
16203
|
-
sessionSelectValue === "__typed__" && /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectItem, { value: "__typed__", children: [
|
|
16204
|
-
"Typed: ",
|
|
16205
|
-
truncateSessionId(selectedSession)
|
|
16206
|
-
] }),
|
|
16207
|
-
sessions.map((s) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: s, children: truncateSessionId(s) }, s))
|
|
16208
|
-
] })
|
|
16209
|
-
] })
|
|
16210
|
-
] }),
|
|
16211
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: selectedModel, onValueChange: onModelChange, children: [
|
|
16212
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16213
|
-
SelectTrigger,
|
|
16214
|
-
{
|
|
16215
|
-
"aria-label": "Select a model",
|
|
16216
|
-
className: "bg-black/25 hover:bg-white/[0.045] h-9 w-full border-0 text-xs text-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)]",
|
|
16217
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All models" })
|
|
16218
|
-
}
|
|
16219
|
-
),
|
|
16220
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
16221
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All models" }),
|
|
16222
|
-
models.map((m) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: m, children: m }, m))
|
|
16223
|
-
] })
|
|
16224
|
-
] })
|
|
16225
|
-
] }) })
|
|
16407
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Filters", children: hideSessionFilter ? /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-[11px] leading-5 text-muted-foreground", children: "This session is pinned by the current URL." }) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
16408
|
+
SessionSearchBox,
|
|
16409
|
+
{
|
|
16410
|
+
query: sessionSearchQuery,
|
|
16411
|
+
suggestions: sessionSearchSuggestions,
|
|
16412
|
+
selectedSession,
|
|
16413
|
+
selectedModel,
|
|
16414
|
+
onQueryChange: setSessionSearchQuery,
|
|
16415
|
+
onApplySuggestion: handleApplySessionSearchSuggestion,
|
|
16416
|
+
onClear: handleClearSessionSearch,
|
|
16417
|
+
onAskAssistant: handleAskAssistantFromSearch
|
|
16418
|
+
}
|
|
16419
|
+
) })
|
|
16226
16420
|
] }) }),
|
|
16227
16421
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "order-2 min-w-0 lg:order-1 lg:h-full lg:overflow-y-auto inspector-scrollbar", children: [
|
|
16228
16422
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-background/95 shadow-[0_12px_36px_rgba(0,0,0,0.18),inset_0_-1px_0_rgba(255,255,255,0.045)] sticky top-0 z-30 px-4 py-3 lg:px-5", children: [
|