@tonyclaw/agent-inspector 3.0.13 → 3.0.15
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-BRV9ztWd.js → CompareDrawer-UaIxykqz.js} +1 -1
- package/.output/public/assets/ProxyViewerContainer-DlpfcX56.js +106 -0
- package/.output/public/assets/{ReplayDialog-B4b6aD0q.js → ReplayDialog-BFFomU1m.js} +1 -1
- package/.output/public/assets/{RequestAnatomy-ybH1l2Bp.js → RequestAnatomy-DKQJBt_c.js} +1 -1
- package/.output/public/assets/{ResponseView-DpPKgH-Y.js → ResponseView-D7yotmne.js} +2 -2
- package/.output/public/assets/{StreamingChunkSequence-9f_rtMzz.js → StreamingChunkSequence-Da-6WNFG.js} +1 -1
- package/.output/public/assets/{_sessionId-gEmO-b2f.js → _sessionId-ByTXLS-w.js} +1 -1
- package/.output/public/assets/{index-JgHKqbP1.js → index-BrM8t5mc.js} +1 -1
- package/.output/public/assets/index-CGpPRty8.js +1 -0
- package/.output/public/assets/index-HRfrFVYw.css +1 -0
- package/.output/public/assets/{json-viewer-DFpIPmLo.js → json-viewer-DyjXQdVu.js} +1 -1
- package/.output/public/assets/{main-YvdO47OP.js → main-Zv_gjZMb.js} +2 -2
- package/.output/server/_libs/lucide-react.mjs +216 -202
- package/.output/server/{_sessionId-wSX-l7m2.mjs → _sessionId-GcFhWT0i.mjs} +3 -3
- package/.output/server/_ssr/{CompareDrawer-R4d8V0Rv.mjs → CompareDrawer-BV7dw1TN.mjs} +3 -3
- package/.output/server/_ssr/{ProxyViewerContainer-CDtJhGg8.mjs → ProxyViewerContainer-CcgfvaS4.mjs} +931 -393
- package/.output/server/_ssr/{ReplayDialog-BvmLERpW.mjs → ReplayDialog-B7sBKxIO.mjs} +4 -4
- package/.output/server/_ssr/{RequestAnatomy-CH-oO6mY.mjs → RequestAnatomy-s_9Veje2.mjs} +3 -3
- package/.output/server/_ssr/{ResponseView-D7shbJw0.mjs → ResponseView-DsOFPCvF.mjs} +3 -3
- package/.output/server/_ssr/{StreamingChunkSequence-DB2YHGJj.mjs → StreamingChunkSequence-CyA1XtiF.mjs} +3 -3
- package/.output/server/_ssr/{index-CS4QLxuv.mjs → index-CDDRt201.mjs} +2 -2
- package/.output/server/_ssr/index.mjs +2 -2
- package/.output/server/_ssr/{json-viewer-HxOn73kS.mjs → json-viewer-BFV-xtRM.mjs} +3 -3
- package/.output/server/_ssr/{router-l4O3mQ4T.mjs → router-B2Q7vHPM.mjs} +321 -121
- package/.output/server/_tanstack-start-manifest_v-Dm_GmuRz.mjs +4 -0
- package/.output/server/index.mjs +73 -73
- package/README.md +24 -0
- package/package.json +1 -1
- package/src/components/ProxyViewer.tsx +470 -197
- package/src/components/ProxyViewerContainer.tsx +145 -17
- package/src/components/ecosystem/AgentLabDialog.tsx +221 -10
- package/src/components/proxy-viewer/ToolTraceEvents.tsx +36 -10
- package/src/components/proxy-viewer/TurnGroup.tsx +4 -1
- package/src/lib/ecosystemContract.ts +21 -1
- package/src/proxy/ecosystemRegistry.ts +52 -0
- package/src/proxy/ecosystemTasks.ts +95 -1
- package/src/proxy/formats/openai/codexMetadata.ts +61 -0
- package/src/proxy/formats/openai/handler.ts +8 -2
- package/src/routes/api/ecosystem.packages.ts +2 -1
- package/src/routes/api/ecosystem.recipes.$recipeId.run.ts +16 -0
- package/styles/globals.css +54 -0
- package/.output/public/assets/ProxyViewerContainer-BVsv8OFb.js +0 -106
- package/.output/public/assets/index-BIgsQvaF.css +0 -1
- package/.output/public/assets/index-CF3MPYb3.js +0 -1
- package/.output/server/_tanstack-start-manifest_v-Dckf_NHV.mjs +0 -4
package/.output/server/_ssr/{ProxyViewerContainer-CDtJhGg8.mjs → ProxyViewerContainer-CcgfvaS4.mjs}
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { r as reactExports, j as jsxRuntimeExports, a as React } from "../_libs/react.mjs";
|
|
2
|
-
import { C as CapturedLogSchema, 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, d as RuntimeConfigSchema, p as packageJson, P as ProviderConfigSchema, i as apiFormatForPath,
|
|
2
|
+
import { C as CapturedLogSchema, n 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, d as RuntimeConfigSchema, p as packageJson, P as ProviderConfigSchema, i as apiFormatForPath, o as GroupEvidenceExportResultSchema, q as DeleteInspectorGroupResponseSchema, l as AlertSummarySchema, m as AlertListResponseSchema, I as InspectorGroupsListResponseSchema, G as GroupEvidenceReadResponseSchema, z as createPendingProviderTestResults, B as ProviderTestResultsSchema, E as createFailedProviderTestResults, M as MAX_SLOW_RESPONSE_THRESHOLD_SECONDS, F as MAX_PROVIDER_TEST_TIMEOUT_SECONDS, T as TimeDisplayFormatSchema, t as maskApiKey, v as PATH_V1_MESSAGES, w as PATH_V1_CHAT_COMPLETIONS, x as PATH_V1_RESPONSES, r as providerHasContextMetadata, f as parseOpenAIResponse, g as parseOpenAIResponsesResponse, O as OpenAIRequestSchema, h as OpenAIResponsesRequestSchema, A as AnthropicResponseSchema$1, e as AnthropicRequestSchema, s as safeGetOwnProperty, H as resolveProviderContextWindow, j as getSessionPath, u as findProviderModelMetadata, y as previewUpstreamUrl, K as KnowledgeCandidateSchema, J as isPlainRecord, k as stripClaudeCodeBillingHeader, L as LogBodyChunkSchema } from "./router-B2Q7vHPM.mjs";
|
|
3
3
|
import { u as useSWR, a as useSWRConfig } from "../_libs/swr.mjs";
|
|
4
4
|
import { J as JSZip } from "../_libs/jszip.mjs";
|
|
5
5
|
import { c as clsx } from "../_libs/clsx.mjs";
|
|
@@ -9,7 +9,7 @@ import { c as cva } from "../_libs/class-variance-authority.mjs";
|
|
|
9
9
|
import { u as useWindowVirtualizer, a as useVirtualizer } from "../_libs/tanstack__react-virtual.mjs";
|
|
10
10
|
import { d as diffJson, a as diffLines } from "../_libs/diff.mjs";
|
|
11
11
|
import { R as Root2, T as Trigger, I as Icon, V as Value, P as Portal, C as Content2, a as Viewport, b as Item, c as ItemIndicator, d as ItemText, S as ScrollUpButton, e as ScrollDownButton } from "../_libs/radix-ui__react-select.mjs";
|
|
12
|
-
import { T as TriangleAlert, C as CircleCheck, X, I as Info, a as ChevronDown, b as Check,
|
|
12
|
+
import { T as TriangleAlert, C as CircleCheck, X, I as Info, a as ChevronDown, b as Check, P as PanelRightOpen, c as PanelRightClose, S as Search, U as Upload, D as Download, F as FileBraces, R as RefreshCw, d as Trash2, e as Plus, A as ArrowLeft, f as ChevronUp, g as Copy, h as ChevronsLeft, i as ChevronLeft, j as ChevronRight, k as ChevronsRight, l as Clapperboard, m as Flag, n as Siren, o as Timer, G as Gauge, L as LoaderCircle, p as Layers, q as FlaskConical, r as Sparkles, s as Activity, B as Beaker, N as Network, t as Terminal, u as Settings, M as Monitor, v as Rocket, w as PackageCheck, H as History, x as Scan, y as CircleAlert, z as ArrowUpRight, E as ArrowDownRight, J as Cpu, K as FolderOpen, O as Bell, Q as Clock3, V as ShieldAlert, W as EyeOff, Y as Eye, Z as ExternalLink, _ as Clock, $ as RotateCw, a0 as Pencil, a1 as MessageSquare, a2 as Zap, a3 as Wrench, a4 as Brain, a5 as CircleCheckBig, a6 as Minus, a7 as CircleQuestionMark, a8 as Server, a9 as Lock, aa as Wifi, ab as WifiOff, ac as CircleX, ad as ShieldCheck, ae as Save, af as FileSearch, ag as CloudUpload, ah as OctagonAlert, ai as Radio, aj as Globe, ak as FileTerminal, al as ChevronsUp, am as ChevronsDown, an as FileDiff, ao as RotateCcw, ap as GitCompareArrows, aq as ArrowUp, ar as ArrowDown, as as Ellipsis, at as CodeXml, au as Blocks, av as MousePointerClick, aw as FileText, ax as Rows3, ay as Columns2 } from "../_libs/lucide-react.mjs";
|
|
13
13
|
import { u as union, d as object, a as array, l as literal, n as number, c as boolean, b as string, _ as _enum } from "../_libs/zod.mjs";
|
|
14
14
|
import { S as Slot } from "../_libs/radix-ui__react-slot.mjs";
|
|
15
15
|
import { R as Root2$1, L as List, T as Trigger$2, C as Content$1 } from "../_libs/radix-ui__react-tabs.mjs";
|
|
@@ -2546,27 +2546,27 @@ function useCopyFeedback(text) {
|
|
|
2546
2546
|
return { copied, copy };
|
|
2547
2547
|
}
|
|
2548
2548
|
const LazyCompareDrawer = reactExports.lazy(
|
|
2549
|
-
() => import("./CompareDrawer-
|
|
2549
|
+
() => import("./CompareDrawer-BV7dw1TN.mjs").then((m) => ({ default: m.CompareDrawer }))
|
|
2550
2550
|
);
|
|
2551
2551
|
const LazyReplayDialog = reactExports.lazy(
|
|
2552
|
-
() => import("./ReplayDialog-
|
|
2552
|
+
() => import("./ReplayDialog-B7sBKxIO.mjs").then((m) => ({ default: m.ReplayDialog }))
|
|
2553
2553
|
);
|
|
2554
2554
|
const LazyRequestAnatomy = reactExports.lazy(
|
|
2555
|
-
() => import("./RequestAnatomy-
|
|
2555
|
+
() => import("./RequestAnatomy-s_9Veje2.mjs").then((m) => ({ default: m.RequestAnatomy }))
|
|
2556
2556
|
);
|
|
2557
2557
|
const LazyResponseView = reactExports.lazy(
|
|
2558
|
-
() => import("./ResponseView-
|
|
2558
|
+
() => import("./ResponseView-DsOFPCvF.mjs").then((m) => ({ default: m.ResponseView }))
|
|
2559
2559
|
);
|
|
2560
2560
|
const LazyStreamingChunkSequence = reactExports.lazy(
|
|
2561
|
-
() => import("./StreamingChunkSequence-
|
|
2561
|
+
() => import("./StreamingChunkSequence-CyA1XtiF.mjs").then((m) => ({
|
|
2562
2562
|
default: m.StreamingChunkSequence
|
|
2563
2563
|
}))
|
|
2564
2564
|
);
|
|
2565
2565
|
const LazyJsonViewer = reactExports.lazy(
|
|
2566
|
-
() => import("./json-viewer-
|
|
2566
|
+
() => import("./json-viewer-BFV-xtRM.mjs").then((m) => ({ default: m.JsonViewer }))
|
|
2567
2567
|
);
|
|
2568
2568
|
const LazyJsonViewerFromString = reactExports.lazy(
|
|
2569
|
-
() => import("./json-viewer-
|
|
2569
|
+
() => import("./json-viewer-BFV-xtRM.mjs").then((m) => ({ default: m.JsonViewerFromString }))
|
|
2570
2570
|
);
|
|
2571
2571
|
const HIGHLIGHT_DURATION_MS = 1200;
|
|
2572
2572
|
const MAX_HIGHLIGHT_ATTEMPTS = 12;
|
|
@@ -4641,30 +4641,51 @@ function ThreadConnector({
|
|
|
4641
4641
|
) })
|
|
4642
4642
|
] });
|
|
4643
4643
|
}
|
|
4644
|
+
const VISIBLE_TOOL_LIMIT = 4;
|
|
4644
4645
|
function ToolTraceEventChip({ event }) {
|
|
4645
4646
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
4646
4647
|
"button",
|
|
4647
4648
|
{
|
|
4648
4649
|
type: "button",
|
|
4649
|
-
className: "inline-flex min-w-0 items-center gap-1
|
|
4650
|
+
className: "inline-flex h-6 max-w-[11rem] min-w-0 items-center gap-1 rounded-md bg-white/[0.028] px-1.5 text-[11px] text-muted-foreground transition-colors hover:bg-sky-400/[0.08] hover:text-sky-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
4650
4651
|
onClick: () => dispatchLogFocusRequest({
|
|
4651
4652
|
logId: event.logId,
|
|
4652
4653
|
tab: "response",
|
|
4653
4654
|
toolCallIndex: event.index
|
|
4654
4655
|
}),
|
|
4655
4656
|
"aria-label": `Open response tool call ${event.name}`,
|
|
4656
|
-
title: `Open ${event.name} in Response`,
|
|
4657
4657
|
children: [
|
|
4658
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "size-3
|
|
4658
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "size-3 shrink-0 text-sky-400/65" }),
|
|
4659
4659
|
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "min-w-0 truncate font-mono font-semibold", children: event.name })
|
|
4660
4660
|
]
|
|
4661
4661
|
},
|
|
4662
4662
|
event.id
|
|
4663
4663
|
);
|
|
4664
4664
|
}
|
|
4665
|
-
function ToolTraceEvents({
|
|
4666
|
-
|
|
4667
|
-
|
|
4665
|
+
function ToolTraceEvents({
|
|
4666
|
+
events,
|
|
4667
|
+
warnings = []
|
|
4668
|
+
}) {
|
|
4669
|
+
if (events.length === 0 && warnings.length === 0) return null;
|
|
4670
|
+
const visibleEvents = events.slice(0, VISIBLE_TOOL_LIMIT);
|
|
4671
|
+
const hiddenCount = Math.max(0, events.length - visibleEvents.length);
|
|
4672
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mx-3 mb-2 flex min-w-0 items-center gap-1.5 overflow-hidden rounded-md bg-black/[0.10] px-2 py-1 shadow-[inset_0_1px_0_rgba(255,255,255,0.025)]", children: [
|
|
4673
|
+
events.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex h-6 shrink-0 items-center gap-1 rounded-md px-1.5 font-mono text-[10px] font-semibold uppercase tracking-[0.12em] text-sky-300/70", children: [
|
|
4674
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Wrench, { className: "size-3" }),
|
|
4675
|
+
events.length
|
|
4676
|
+
] }),
|
|
4677
|
+
warnings.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex h-6 shrink-0 items-center gap-1 rounded-md border border-amber-300/20 bg-amber-300/[0.08] px-1.5 font-mono text-[10px] font-semibold text-amber-100", children: [
|
|
4678
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(TriangleAlert, { className: "size-3" }),
|
|
4679
|
+
warnings.length
|
|
4680
|
+
] }),
|
|
4681
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-1 overflow-hidden", children: [
|
|
4682
|
+
visibleEvents.map((event) => /* @__PURE__ */ jsxRuntimeExports.jsx(ToolTraceEventChip, { event }, event.id)),
|
|
4683
|
+
hiddenCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex h-6 shrink-0 items-center rounded-md bg-white/[0.025] px-1.5 font-mono text-[11px] font-semibold text-muted-foreground", children: [
|
|
4684
|
+
"+",
|
|
4685
|
+
hiddenCount
|
|
4686
|
+
] })
|
|
4687
|
+
] })
|
|
4688
|
+
] });
|
|
4668
4689
|
}
|
|
4669
4690
|
const PREVIEW_LIMIT = 180;
|
|
4670
4691
|
const toolTraceCache = /* @__PURE__ */ new WeakMap();
|
|
@@ -5196,7 +5217,13 @@ const TurnGroup = reactExports.memo(function TurnGroup2({
|
|
|
5196
5217
|
onCompareWithPrevious: comparisonPredecessors.has(log.id) ? onCompareWithPrevious : void 0
|
|
5197
5218
|
}
|
|
5198
5219
|
),
|
|
5199
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5220
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
5221
|
+
ToolTraceEvents,
|
|
5222
|
+
{
|
|
5223
|
+
events: toolEventsByLogId.get(log.id) ?? [],
|
|
5224
|
+
warnings: log.warnings ?? []
|
|
5225
|
+
}
|
|
5226
|
+
)
|
|
5200
5227
|
] })
|
|
5201
5228
|
] }, log.id);
|
|
5202
5229
|
})
|
|
@@ -11084,17 +11111,35 @@ const EcosystemRunnerPresetSchema = object({
|
|
|
11084
11111
|
skillsDir: string(),
|
|
11085
11112
|
agentsDir: string()
|
|
11086
11113
|
});
|
|
11114
|
+
const EcosystemRecipeSchema = object({
|
|
11115
|
+
id: string(),
|
|
11116
|
+
title: string(),
|
|
11117
|
+
stage: string(),
|
|
11118
|
+
packageId: string(),
|
|
11119
|
+
description: string(),
|
|
11120
|
+
command: string(),
|
|
11121
|
+
requiresSession: boolean(),
|
|
11122
|
+
runnable: boolean()
|
|
11123
|
+
});
|
|
11087
11124
|
const EcosystemPackagesResponseSchema = object({
|
|
11088
11125
|
checkedAt: string(),
|
|
11089
11126
|
packages: array(EcosystemPackageSchema),
|
|
11090
|
-
runnerPresets: array(EcosystemRunnerPresetSchema)
|
|
11127
|
+
runnerPresets: array(EcosystemRunnerPresetSchema),
|
|
11128
|
+
recipes: array(EcosystemRecipeSchema)
|
|
11091
11129
|
});
|
|
11092
|
-
const EcosystemTaskActionSchema = _enum([
|
|
11130
|
+
const EcosystemTaskActionSchema = _enum([
|
|
11131
|
+
"install",
|
|
11132
|
+
"upgrade",
|
|
11133
|
+
"help",
|
|
11134
|
+
"runner-presets",
|
|
11135
|
+
"recipe"
|
|
11136
|
+
]);
|
|
11093
11137
|
const EcosystemTaskStatusSchema = _enum(["queued", "running", "succeeded", "failed"]);
|
|
11094
11138
|
const EcosystemTaskSchema = object({
|
|
11095
11139
|
id: string(),
|
|
11096
11140
|
packageId: string(),
|
|
11097
11141
|
npmName: string(),
|
|
11142
|
+
recipeId: string().nullable().default(null),
|
|
11098
11143
|
action: EcosystemTaskActionSchema,
|
|
11099
11144
|
status: EcosystemTaskStatusSchema,
|
|
11100
11145
|
command: string(),
|
|
@@ -11108,7 +11153,7 @@ const EcosystemTaskSchema = object({
|
|
|
11108
11153
|
const EcosystemTaskResponseSchema = object({
|
|
11109
11154
|
task: EcosystemTaskSchema
|
|
11110
11155
|
});
|
|
11111
|
-
object({
|
|
11156
|
+
const EcosystemTasksResponseSchema = object({
|
|
11112
11157
|
tasks: array(EcosystemTaskSchema)
|
|
11113
11158
|
});
|
|
11114
11159
|
const WORKFLOWS = [
|
|
@@ -11161,6 +11206,14 @@ async function fetchEcosystemTask(url) {
|
|
|
11161
11206
|
(response) => `Failed to load ecosystem task: ${String(response.status)}`
|
|
11162
11207
|
);
|
|
11163
11208
|
}
|
|
11209
|
+
async function fetchEcosystemTasks(url) {
|
|
11210
|
+
return fetchJson(
|
|
11211
|
+
url,
|
|
11212
|
+
EcosystemTasksResponseSchema,
|
|
11213
|
+
void 0,
|
|
11214
|
+
(response) => `Failed to load ecosystem tasks: ${String(response.status)}`
|
|
11215
|
+
);
|
|
11216
|
+
}
|
|
11164
11217
|
async function startEcosystemTask(packageId, action) {
|
|
11165
11218
|
const response = await fetchJson(
|
|
11166
11219
|
`/api/ecosystem/packages/${encodeURIComponent(packageId)}/${action}`,
|
|
@@ -11170,6 +11223,15 @@ async function startEcosystemTask(packageId, action) {
|
|
|
11170
11223
|
);
|
|
11171
11224
|
return response.task;
|
|
11172
11225
|
}
|
|
11226
|
+
async function startEcosystemRecipe(recipeId) {
|
|
11227
|
+
const response = await fetchJson(
|
|
11228
|
+
`/api/ecosystem/recipes/${encodeURIComponent(recipeId)}/run`,
|
|
11229
|
+
EcosystemTaskResponseSchema,
|
|
11230
|
+
{ method: "POST" },
|
|
11231
|
+
(result) => `Failed to start ecosystem recipe: ${String(result.status)}`
|
|
11232
|
+
);
|
|
11233
|
+
return response.task;
|
|
11234
|
+
}
|
|
11173
11235
|
function stateLabel(state) {
|
|
11174
11236
|
switch (state) {
|
|
11175
11237
|
case "installed":
|
|
@@ -11217,6 +11279,8 @@ function taskActionLabel(action) {
|
|
|
11217
11279
|
return "Help";
|
|
11218
11280
|
case "runner-presets":
|
|
11219
11281
|
return "Presets";
|
|
11282
|
+
case "recipe":
|
|
11283
|
+
return "Recipe";
|
|
11220
11284
|
}
|
|
11221
11285
|
}
|
|
11222
11286
|
function taskStatusLabel(task) {
|
|
@@ -11231,6 +11295,17 @@ function taskStatusLabel(task) {
|
|
|
11231
11295
|
return `${taskActionLabel(task.action)} failed`;
|
|
11232
11296
|
}
|
|
11233
11297
|
}
|
|
11298
|
+
function taskStatusClassName(status) {
|
|
11299
|
+
switch (status) {
|
|
11300
|
+
case "queued":
|
|
11301
|
+
case "running":
|
|
11302
|
+
return "border-cyan-300/20 bg-cyan-300/8 text-cyan-100";
|
|
11303
|
+
case "succeeded":
|
|
11304
|
+
return "border-emerald-400/20 bg-emerald-400/8 text-emerald-100";
|
|
11305
|
+
case "failed":
|
|
11306
|
+
return "border-red-400/20 bg-red-400/8 text-red-100";
|
|
11307
|
+
}
|
|
11308
|
+
}
|
|
11234
11309
|
function packagePrimaryAction(pkg) {
|
|
11235
11310
|
switch (pkg.state) {
|
|
11236
11311
|
case "available":
|
|
@@ -11325,17 +11400,7 @@ function TaskConsole({ task }) {
|
|
|
11325
11400
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "break-all font-mono text-[11px] text-white/35", children: task.command })
|
|
11326
11401
|
] })
|
|
11327
11402
|
] }),
|
|
11328
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11329
|
-
Badge,
|
|
11330
|
-
{
|
|
11331
|
-
variant: "outline",
|
|
11332
|
-
className: cn(
|
|
11333
|
-
"shrink-0",
|
|
11334
|
-
task.status === "failed" ? "border-red-400/20 bg-red-400/8 text-red-100" : "border-cyan-300/20 bg-cyan-300/8 text-cyan-100"
|
|
11335
|
-
),
|
|
11336
|
-
children: task.status
|
|
11337
|
-
}
|
|
11338
|
-
)
|
|
11403
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", className: cn("shrink-0", taskStatusClassName(task.status)), children: task.status })
|
|
11339
11404
|
] }),
|
|
11340
11405
|
/* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "mt-3 max-h-56 overflow-auto whitespace-pre-wrap rounded-md bg-black/30 p-3 font-mono text-[11px] leading-5 text-white/60 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: task.output.trim().length > 0 ? task.output : "Waiting for npm output..." }),
|
|
11341
11406
|
task.error !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 text-xs text-red-100", children: task.error })
|
|
@@ -11392,10 +11457,89 @@ function RunnerPresetCard({ preset }) {
|
|
|
11392
11457
|
] })
|
|
11393
11458
|
] });
|
|
11394
11459
|
}
|
|
11460
|
+
function RecipeCard({
|
|
11461
|
+
recipe,
|
|
11462
|
+
copied,
|
|
11463
|
+
running,
|
|
11464
|
+
onCopy,
|
|
11465
|
+
onRun
|
|
11466
|
+
}) {
|
|
11467
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-lg bg-white/[0.025] p-3 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.055)]", children: [
|
|
11468
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-start justify-between gap-3", children: [
|
|
11469
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
|
|
11470
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-start gap-2", children: [
|
|
11471
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FlaskConical, { className: "size-4 shrink-0 text-cyan-200/75" }),
|
|
11472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold leading-snug", children: recipe.title })
|
|
11473
|
+
] }),
|
|
11474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-xs leading-5 text-muted-foreground", children: recipe.description })
|
|
11475
|
+
] }),
|
|
11476
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", className: "border-white/10 bg-white/[0.04] text-white/55", children: recipe.runnable ? recipe.stage : "Template" })
|
|
11477
|
+
] }),
|
|
11478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 rounded-md bg-black/20 p-2 font-mono text-[11px] leading-5 text-white/50 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: recipe.command }),
|
|
11479
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 flex items-center justify-between gap-2", children: [
|
|
11480
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "rounded bg-white/[0.035] px-2 py-1 font-mono text-[11px] text-white/35", children: recipe.packageId }),
|
|
11481
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
11482
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { type: "button", size: "sm", variant: "outline", onClick: () => onCopy(recipe), children: [
|
|
11483
|
+
copied ? /* @__PURE__ */ jsxRuntimeExports.jsx(Check, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Copy, { className: "size-3.5" }),
|
|
11484
|
+
copied ? "Copied" : "Copy"
|
|
11485
|
+
] }),
|
|
11486
|
+
recipe.runnable && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
11487
|
+
Button,
|
|
11488
|
+
{
|
|
11489
|
+
type: "button",
|
|
11490
|
+
size: "sm",
|
|
11491
|
+
variant: "secondary",
|
|
11492
|
+
disabled: running,
|
|
11493
|
+
onClick: () => onRun(recipe),
|
|
11494
|
+
children: [
|
|
11495
|
+
running ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "size-3.5 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(Rocket, { className: "size-3.5" }),
|
|
11496
|
+
running ? "Running" : "Run"
|
|
11497
|
+
]
|
|
11498
|
+
}
|
|
11499
|
+
)
|
|
11500
|
+
] })
|
|
11501
|
+
] })
|
|
11502
|
+
] });
|
|
11503
|
+
}
|
|
11504
|
+
function RecentTaskRow({
|
|
11505
|
+
task,
|
|
11506
|
+
selected,
|
|
11507
|
+
onSelect
|
|
11508
|
+
}) {
|
|
11509
|
+
const label = task.recipeId ?? taskActionLabel(task.action);
|
|
11510
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between gap-3 rounded-md bg-white/[0.025] px-3 py-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: [
|
|
11511
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
|
|
11512
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
|
|
11513
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(History, { className: "size-3.5 shrink-0 text-white/40" }),
|
|
11514
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "truncate text-xs font-semibold text-white/75", children: label }),
|
|
11515
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Badge, { variant: "outline", className: cn("shrink-0", taskStatusClassName(task.status)), children: task.status })
|
|
11516
|
+
] }),
|
|
11517
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 flex min-w-0 flex-wrap items-center gap-2 font-mono text-[10px] text-white/35", children: [
|
|
11518
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: task.packageId }),
|
|
11519
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: new Date(task.createdAt).toLocaleTimeString() }),
|
|
11520
|
+
task.exitCode !== null && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
11521
|
+
"exit ",
|
|
11522
|
+
String(task.exitCode)
|
|
11523
|
+
] })
|
|
11524
|
+
] })
|
|
11525
|
+
] }),
|
|
11526
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11527
|
+
Button,
|
|
11528
|
+
{
|
|
11529
|
+
type: "button",
|
|
11530
|
+
size: "sm",
|
|
11531
|
+
variant: selected ? "secondary" : "outline",
|
|
11532
|
+
onClick: () => onSelect(task),
|
|
11533
|
+
children: selected ? "Open" : "View"
|
|
11534
|
+
}
|
|
11535
|
+
)
|
|
11536
|
+
] });
|
|
11537
|
+
}
|
|
11395
11538
|
function AgentLabDialog({ currentSessionId, logCount }) {
|
|
11396
11539
|
const [open, setOpen] = reactExports.useState(false);
|
|
11397
11540
|
const [copied, setCopied] = reactExports.useState(false);
|
|
11398
11541
|
const [copiedPresets, setCopiedPresets] = reactExports.useState(false);
|
|
11542
|
+
const [copiedRecipeId, setCopiedRecipeId] = reactExports.useState(null);
|
|
11399
11543
|
const [activeTaskId, setActiveTaskId] = reactExports.useState(null);
|
|
11400
11544
|
const [taskError, setTaskError] = reactExports.useState(null);
|
|
11401
11545
|
const response = useSWR("/api/ecosystem/packages", fetchEcosystemPackages, {
|
|
@@ -11413,8 +11557,14 @@ function AgentLabDialog({ currentSessionId, logCount }) {
|
|
|
11413
11557
|
revalidateOnFocus: false
|
|
11414
11558
|
}
|
|
11415
11559
|
);
|
|
11560
|
+
const tasksResponse = useSWR(open ? "/api/ecosystem/tasks" : null, fetchEcosystemTasks, {
|
|
11561
|
+
refreshInterval: 2500,
|
|
11562
|
+
revalidateOnFocus: false
|
|
11563
|
+
});
|
|
11416
11564
|
const packages = response.data?.packages ?? [];
|
|
11417
11565
|
const runnerPresets = response.data?.runnerPresets ?? [];
|
|
11566
|
+
const recipes = response.data?.recipes ?? [];
|
|
11567
|
+
const recentTasks = (tasksResponse.data?.tasks ?? []).slice(0, 6);
|
|
11418
11568
|
const installedCount = reactExports.useMemo(
|
|
11419
11569
|
() => packages.filter((pkg) => pkg.state === "installed" || pkg.state === "update-available").length,
|
|
11420
11570
|
[packages]
|
|
@@ -11433,17 +11583,35 @@ function AgentLabDialog({ currentSessionId, logCount }) {
|
|
|
11433
11583
|
window.setTimeout(() => setCopiedPresets(false), 1200);
|
|
11434
11584
|
});
|
|
11435
11585
|
};
|
|
11586
|
+
const copyRecipeCommand = (recipe) => {
|
|
11587
|
+
void copyTextToClipboard(recipe.command).then(() => {
|
|
11588
|
+
setCopiedRecipeId(recipe.id);
|
|
11589
|
+
window.setTimeout(() => setCopiedRecipeId(null), 1200);
|
|
11590
|
+
});
|
|
11591
|
+
};
|
|
11592
|
+
const runRecipe = (recipe) => {
|
|
11593
|
+
setTaskError(null);
|
|
11594
|
+
void startEcosystemRecipe(recipe.id).then((task) => {
|
|
11595
|
+
setActiveTaskId(task.id);
|
|
11596
|
+
void activeTaskResponse.mutate({ task }, { revalidate: true });
|
|
11597
|
+
void tasksResponse.mutate();
|
|
11598
|
+
}).catch((error) => {
|
|
11599
|
+
setTaskError(error instanceof Error ? error.message : "Failed to start ecosystem recipe");
|
|
11600
|
+
});
|
|
11601
|
+
};
|
|
11436
11602
|
const activeTask = activeTaskResponse.data?.task ?? null;
|
|
11437
11603
|
reactExports.useEffect(() => {
|
|
11438
11604
|
if (activeTask === null) return;
|
|
11605
|
+
void tasksResponse.mutate();
|
|
11439
11606
|
if (activeTask.status !== "succeeded") return;
|
|
11440
11607
|
void response.mutate();
|
|
11441
|
-
}, [activeTask, response]);
|
|
11608
|
+
}, [activeTask, response, tasksResponse]);
|
|
11442
11609
|
const handleStartTask = (packageId, action) => {
|
|
11443
11610
|
setTaskError(null);
|
|
11444
11611
|
void startEcosystemTask(packageId, action).then((task) => {
|
|
11445
11612
|
setActiveTaskId(task.id);
|
|
11446
11613
|
void activeTaskResponse.mutate({ task }, { revalidate: true });
|
|
11614
|
+
void tasksResponse.mutate();
|
|
11447
11615
|
}).catch((error) => {
|
|
11448
11616
|
setTaskError(error instanceof Error ? error.message : "Failed to start ecosystem task");
|
|
11449
11617
|
});
|
|
@@ -11509,6 +11677,35 @@ function AgentLabDialog({ currentSessionId, logCount }) {
|
|
|
11509
11677
|
] })
|
|
11510
11678
|
] })
|
|
11511
11679
|
] }),
|
|
11680
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mt-3", children: [
|
|
11681
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
|
|
11682
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold", children: "Lab recipes" }),
|
|
11683
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hidden items-center gap-1 font-mono text-[11px] text-muted-foreground sm:flex", children: [
|
|
11684
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Sparkles, { className: "size-3.5" }),
|
|
11685
|
+
"copy-ready workflows"
|
|
11686
|
+
] })
|
|
11687
|
+
] }),
|
|
11688
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid gap-3 md:grid-cols-2", children: [
|
|
11689
|
+
recipes.map((recipe) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11690
|
+
RecipeCard,
|
|
11691
|
+
{
|
|
11692
|
+
recipe,
|
|
11693
|
+
copied: copiedRecipeId === recipe.id,
|
|
11694
|
+
running: activeTask !== null && activeTask.recipeId === recipe.id && (activeTask.status === "queued" || activeTask.status === "running"),
|
|
11695
|
+
onCopy: copyRecipeCommand,
|
|
11696
|
+
onRun: runRecipe
|
|
11697
|
+
},
|
|
11698
|
+
recipe.id
|
|
11699
|
+
)),
|
|
11700
|
+
response.isLoading && recipes.length === 0 && [0, 1].map((index) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11701
|
+
"div",
|
|
11702
|
+
{
|
|
11703
|
+
className: "h-40 animate-pulse rounded-lg bg-white/[0.025] shadow-[inset_0_0_0_1px_rgba(255,255,255,0.055)]"
|
|
11704
|
+
},
|
|
11705
|
+
index
|
|
11706
|
+
))
|
|
11707
|
+
] })
|
|
11708
|
+
] }),
|
|
11512
11709
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mt-3", children: [
|
|
11513
11710
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
|
|
11514
11711
|
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold", children: "Runner presets" }),
|
|
@@ -11554,6 +11751,27 @@ function AgentLabDialog({ currentSessionId, logCount }) {
|
|
|
11554
11751
|
] })
|
|
11555
11752
|
] }),
|
|
11556
11753
|
taskError !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3 rounded-lg bg-red-500/8 p-3 text-xs text-red-100 shadow-[inset_0_0_0_1px_rgba(248,113,113,0.16)]", children: taskError }),
|
|
11754
|
+
recentTasks.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("section", { className: "mt-3", children: [
|
|
11755
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-2 flex items-center justify-between gap-3", children: [
|
|
11756
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold", children: "Recent Lab runs" }),
|
|
11757
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "hidden font-mono text-[11px] text-muted-foreground sm:block", children: [
|
|
11758
|
+
"last ",
|
|
11759
|
+
String(recentTasks.length)
|
|
11760
|
+
] })
|
|
11761
|
+
] }),
|
|
11762
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid gap-2 md:grid-cols-2", children: recentTasks.map((task) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
11763
|
+
RecentTaskRow,
|
|
11764
|
+
{
|
|
11765
|
+
task,
|
|
11766
|
+
selected: activeTaskId === task.id,
|
|
11767
|
+
onSelect: (selectedTask) => {
|
|
11768
|
+
setActiveTaskId(selectedTask.id);
|
|
11769
|
+
void activeTaskResponse.mutate({ task: selectedTask }, { revalidate: true });
|
|
11770
|
+
}
|
|
11771
|
+
},
|
|
11772
|
+
task.id
|
|
11773
|
+
)) })
|
|
11774
|
+
] }),
|
|
11557
11775
|
/* @__PURE__ */ jsxRuntimeExports.jsx(TaskConsole, { task: activeTask })
|
|
11558
11776
|
] })
|
|
11559
11777
|
] })
|
|
@@ -14024,6 +14242,256 @@ function BrandHeader({
|
|
|
14024
14242
|
] })
|
|
14025
14243
|
] });
|
|
14026
14244
|
}
|
|
14245
|
+
const FLOATING_LOGO_SIZE = 56;
|
|
14246
|
+
const FLOATING_LOGO_MARGIN = 14;
|
|
14247
|
+
const FLOATING_LOGO_MIN_DRIFT_MS = 5200;
|
|
14248
|
+
const FLOATING_LOGO_DRIFT_WINDOW_MS = 2400;
|
|
14249
|
+
const FLOATING_LOGO_MIN_STEP = 72;
|
|
14250
|
+
const FLOATING_LOGO_MAX_STEP = 156;
|
|
14251
|
+
const DETAILS_PANEL_COLLAPSED_STORAGE_KEY = "agent-inspector.detailsPanelCollapsed";
|
|
14252
|
+
function readStoredDetailsPanelCollapsed() {
|
|
14253
|
+
if (typeof window === "undefined") return true;
|
|
14254
|
+
const stored = window.localStorage.getItem(DETAILS_PANEL_COLLAPSED_STORAGE_KEY);
|
|
14255
|
+
return stored === null || stored === "1";
|
|
14256
|
+
}
|
|
14257
|
+
function clampFloatingLogoPosition(position) {
|
|
14258
|
+
const maxX = Math.max(
|
|
14259
|
+
FLOATING_LOGO_MARGIN,
|
|
14260
|
+
window.innerWidth - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14261
|
+
);
|
|
14262
|
+
const maxY = Math.max(
|
|
14263
|
+
FLOATING_LOGO_MARGIN,
|
|
14264
|
+
window.innerHeight - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14265
|
+
);
|
|
14266
|
+
return {
|
|
14267
|
+
x: Math.min(Math.max(position.x, FLOATING_LOGO_MARGIN), maxX),
|
|
14268
|
+
y: Math.min(Math.max(position.y, FLOATING_LOGO_MARGIN), maxY)
|
|
14269
|
+
};
|
|
14270
|
+
}
|
|
14271
|
+
function snapFloatingLogoToEdge(position) {
|
|
14272
|
+
const clamped = clampFloatingLogoPosition(position);
|
|
14273
|
+
const maxX = Math.max(
|
|
14274
|
+
FLOATING_LOGO_MARGIN,
|
|
14275
|
+
window.innerWidth - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14276
|
+
);
|
|
14277
|
+
const maxY = Math.max(
|
|
14278
|
+
FLOATING_LOGO_MARGIN,
|
|
14279
|
+
window.innerHeight - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14280
|
+
);
|
|
14281
|
+
const leftDistance = clamped.x - FLOATING_LOGO_MARGIN;
|
|
14282
|
+
const rightDistance = maxX - clamped.x;
|
|
14283
|
+
const topDistance = clamped.y - FLOATING_LOGO_MARGIN;
|
|
14284
|
+
const bottomDistance = maxY - clamped.y;
|
|
14285
|
+
const nearestDistance = Math.min(leftDistance, rightDistance, topDistance, bottomDistance);
|
|
14286
|
+
if (nearestDistance === leftDistance) return { x: FLOATING_LOGO_MARGIN, y: clamped.y };
|
|
14287
|
+
if (nearestDistance === rightDistance) return { x: maxX, y: clamped.y };
|
|
14288
|
+
if (nearestDistance === topDistance) return { x: clamped.x, y: FLOATING_LOGO_MARGIN };
|
|
14289
|
+
return { x: clamped.x, y: maxY };
|
|
14290
|
+
}
|
|
14291
|
+
function randomFloatingLogoEdgePosition() {
|
|
14292
|
+
const maxX = Math.max(
|
|
14293
|
+
FLOATING_LOGO_MARGIN,
|
|
14294
|
+
window.innerWidth - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14295
|
+
);
|
|
14296
|
+
const maxY = Math.max(
|
|
14297
|
+
FLOATING_LOGO_MARGIN,
|
|
14298
|
+
window.innerHeight - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14299
|
+
);
|
|
14300
|
+
const randomX = FLOATING_LOGO_MARGIN + Math.random() * (maxX - FLOATING_LOGO_MARGIN);
|
|
14301
|
+
const randomY = FLOATING_LOGO_MARGIN + Math.random() * (maxY - FLOATING_LOGO_MARGIN);
|
|
14302
|
+
const edgeIndex = Math.floor(Math.random() * 4);
|
|
14303
|
+
switch (edgeIndex) {
|
|
14304
|
+
case 0:
|
|
14305
|
+
return { x: FLOATING_LOGO_MARGIN, y: randomY };
|
|
14306
|
+
case 1:
|
|
14307
|
+
return { x: maxX, y: randomY };
|
|
14308
|
+
case 2:
|
|
14309
|
+
return { x: randomX, y: FLOATING_LOGO_MARGIN };
|
|
14310
|
+
case 3:
|
|
14311
|
+
return { x: randomX, y: maxY };
|
|
14312
|
+
default:
|
|
14313
|
+
return { x: maxX, y: FLOATING_LOGO_MARGIN };
|
|
14314
|
+
}
|
|
14315
|
+
}
|
|
14316
|
+
function nearestFloatingLogoEdge(position) {
|
|
14317
|
+
const clamped = clampFloatingLogoPosition(position);
|
|
14318
|
+
const maxX = Math.max(
|
|
14319
|
+
FLOATING_LOGO_MARGIN,
|
|
14320
|
+
window.innerWidth - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14321
|
+
);
|
|
14322
|
+
const maxY = Math.max(
|
|
14323
|
+
FLOATING_LOGO_MARGIN,
|
|
14324
|
+
window.innerHeight - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14325
|
+
);
|
|
14326
|
+
const distances = [
|
|
14327
|
+
{ edge: "left", distance: clamped.x - FLOATING_LOGO_MARGIN },
|
|
14328
|
+
{ edge: "right", distance: maxX - clamped.x },
|
|
14329
|
+
{ edge: "top", distance: clamped.y - FLOATING_LOGO_MARGIN },
|
|
14330
|
+
{ edge: "bottom", distance: maxY - clamped.y }
|
|
14331
|
+
];
|
|
14332
|
+
return distances.reduce((best, current) => current.distance < best.distance ? current : best).edge;
|
|
14333
|
+
}
|
|
14334
|
+
function nextFloatingLogoWalkingPosition(position) {
|
|
14335
|
+
const clamped = snapFloatingLogoToEdge(position);
|
|
14336
|
+
const maxX = Math.max(
|
|
14337
|
+
FLOATING_LOGO_MARGIN,
|
|
14338
|
+
window.innerWidth - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14339
|
+
);
|
|
14340
|
+
const maxY = Math.max(
|
|
14341
|
+
FLOATING_LOGO_MARGIN,
|
|
14342
|
+
window.innerHeight - FLOATING_LOGO_SIZE - FLOATING_LOGO_MARGIN
|
|
14343
|
+
);
|
|
14344
|
+
const step = FLOATING_LOGO_MIN_STEP + Math.random() * (FLOATING_LOGO_MAX_STEP - FLOATING_LOGO_MIN_STEP);
|
|
14345
|
+
const direction = Math.random() > 0.5 ? 1 : -1;
|
|
14346
|
+
const edge = nearestFloatingLogoEdge(clamped);
|
|
14347
|
+
switch (edge) {
|
|
14348
|
+
case "left": {
|
|
14349
|
+
const nextY = clamped.y + step * direction;
|
|
14350
|
+
if (nextY <= FLOATING_LOGO_MARGIN)
|
|
14351
|
+
return { x: FLOATING_LOGO_MARGIN, y: FLOATING_LOGO_MARGIN };
|
|
14352
|
+
if (nextY >= maxY) return { x: FLOATING_LOGO_MARGIN, y: maxY };
|
|
14353
|
+
return { x: FLOATING_LOGO_MARGIN, y: nextY };
|
|
14354
|
+
}
|
|
14355
|
+
case "right": {
|
|
14356
|
+
const nextY = clamped.y + step * direction;
|
|
14357
|
+
if (nextY <= FLOATING_LOGO_MARGIN) return { x: maxX, y: FLOATING_LOGO_MARGIN };
|
|
14358
|
+
if (nextY >= maxY) return { x: maxX, y: maxY };
|
|
14359
|
+
return { x: maxX, y: nextY };
|
|
14360
|
+
}
|
|
14361
|
+
case "top": {
|
|
14362
|
+
const nextX = clamped.x + step * direction;
|
|
14363
|
+
if (nextX <= FLOATING_LOGO_MARGIN)
|
|
14364
|
+
return { x: FLOATING_LOGO_MARGIN, y: FLOATING_LOGO_MARGIN };
|
|
14365
|
+
if (nextX >= maxX) return { x: maxX, y: FLOATING_LOGO_MARGIN };
|
|
14366
|
+
return { x: nextX, y: FLOATING_LOGO_MARGIN };
|
|
14367
|
+
}
|
|
14368
|
+
case "bottom": {
|
|
14369
|
+
const nextX = clamped.x + step * direction;
|
|
14370
|
+
if (nextX <= FLOATING_LOGO_MARGIN) return { x: FLOATING_LOGO_MARGIN, y: maxY };
|
|
14371
|
+
if (nextX >= maxX) return { x: maxX, y: maxY };
|
|
14372
|
+
return { x: nextX, y: maxY };
|
|
14373
|
+
}
|
|
14374
|
+
}
|
|
14375
|
+
}
|
|
14376
|
+
function FloatingInspectorLogo() {
|
|
14377
|
+
const [position, setPosition] = reactExports.useState({
|
|
14378
|
+
x: FLOATING_LOGO_MARGIN,
|
|
14379
|
+
y: FLOATING_LOGO_MARGIN
|
|
14380
|
+
});
|
|
14381
|
+
const [motionTick, setMotionTick] = reactExports.useState(0);
|
|
14382
|
+
const [dragging, setDragging] = reactExports.useState(false);
|
|
14383
|
+
const dragStateRef = reactExports.useRef(null);
|
|
14384
|
+
reactExports.useEffect(() => {
|
|
14385
|
+
setPosition(randomFloatingLogoEdgePosition());
|
|
14386
|
+
}, []);
|
|
14387
|
+
reactExports.useEffect(() => {
|
|
14388
|
+
if (dragging) return void 0;
|
|
14389
|
+
let timeoutId = null;
|
|
14390
|
+
const scheduleDrift = () => {
|
|
14391
|
+
const delay = FLOATING_LOGO_MIN_DRIFT_MS + Math.random() * FLOATING_LOGO_DRIFT_WINDOW_MS;
|
|
14392
|
+
timeoutId = window.setTimeout(() => {
|
|
14393
|
+
setMotionTick((current) => current + 1);
|
|
14394
|
+
setPosition((current) => nextFloatingLogoWalkingPosition(current));
|
|
14395
|
+
scheduleDrift();
|
|
14396
|
+
}, delay);
|
|
14397
|
+
};
|
|
14398
|
+
scheduleDrift();
|
|
14399
|
+
return () => {
|
|
14400
|
+
if (timeoutId !== null) {
|
|
14401
|
+
window.clearTimeout(timeoutId);
|
|
14402
|
+
}
|
|
14403
|
+
};
|
|
14404
|
+
}, [dragging]);
|
|
14405
|
+
reactExports.useEffect(() => {
|
|
14406
|
+
const handleResize = () => {
|
|
14407
|
+
setPosition((current) => snapFloatingLogoToEdge(current));
|
|
14408
|
+
};
|
|
14409
|
+
window.addEventListener("resize", handleResize);
|
|
14410
|
+
return () => window.removeEventListener("resize", handleResize);
|
|
14411
|
+
}, []);
|
|
14412
|
+
const handlePointerDown = reactExports.useCallback((event) => {
|
|
14413
|
+
const rect = event.currentTarget.getBoundingClientRect();
|
|
14414
|
+
dragStateRef.current = {
|
|
14415
|
+
pointerId: event.pointerId,
|
|
14416
|
+
offsetX: event.clientX - rect.left,
|
|
14417
|
+
offsetY: event.clientY - rect.top
|
|
14418
|
+
};
|
|
14419
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
14420
|
+
setDragging(true);
|
|
14421
|
+
}, []);
|
|
14422
|
+
const handlePointerMove = reactExports.useCallback((event) => {
|
|
14423
|
+
const dragState = dragStateRef.current;
|
|
14424
|
+
if (dragState === null || dragState.pointerId !== event.pointerId) return;
|
|
14425
|
+
setPosition(
|
|
14426
|
+
clampFloatingLogoPosition({
|
|
14427
|
+
x: event.clientX - dragState.offsetX,
|
|
14428
|
+
y: event.clientY - dragState.offsetY
|
|
14429
|
+
})
|
|
14430
|
+
);
|
|
14431
|
+
}, []);
|
|
14432
|
+
const handlePointerUp = reactExports.useCallback((event) => {
|
|
14433
|
+
const dragState = dragStateRef.current;
|
|
14434
|
+
if (dragState === null || dragState.pointerId !== event.pointerId) return;
|
|
14435
|
+
if (event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
14436
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
14437
|
+
}
|
|
14438
|
+
dragStateRef.current = null;
|
|
14439
|
+
setDragging(false);
|
|
14440
|
+
setPosition((current) => snapFloatingLogoToEdge(current));
|
|
14441
|
+
}, []);
|
|
14442
|
+
const style = reactExports.useMemo(
|
|
14443
|
+
() => ({
|
|
14444
|
+
transform: `translate3d(${position.x}px, ${position.y}px, 0) rotate(${motionTick % 2 === 0 ? "-4deg" : "5deg"}) scale(${dragging ? "1.08" : "1"})`,
|
|
14445
|
+
transition: dragging ? "none" : "transform 4800ms cubic-bezier(0.33, 1, 0.68, 1)",
|
|
14446
|
+
touchAction: "none"
|
|
14447
|
+
}),
|
|
14448
|
+
[dragging, motionTick, position.x, position.y]
|
|
14449
|
+
);
|
|
14450
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14451
|
+
"button",
|
|
14452
|
+
{
|
|
14453
|
+
type: "button",
|
|
14454
|
+
className: cn(
|
|
14455
|
+
"fixed left-0 top-0 z-40 flex size-14 items-center justify-center rounded-full bg-transparent text-foreground outline-none transition-[filter,opacity] duration-200 hover:opacity-95 hover:drop-shadow-[0_0_24px_rgba(245,158,11,0.36)] focus-visible:ring-1 focus-visible:ring-amber-300/55",
|
|
14456
|
+
dragging ? "cursor-grabbing" : "cursor-grab"
|
|
14457
|
+
),
|
|
14458
|
+
style,
|
|
14459
|
+
onPointerDown: handlePointerDown,
|
|
14460
|
+
onPointerMove: handlePointerMove,
|
|
14461
|
+
onPointerUp: handlePointerUp,
|
|
14462
|
+
onPointerCancel: handlePointerUp,
|
|
14463
|
+
"aria-label": "Floating Inspector logo",
|
|
14464
|
+
title: "Drag Inspector logo",
|
|
14465
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14466
|
+
"span",
|
|
14467
|
+
{
|
|
14468
|
+
className: cn(
|
|
14469
|
+
"relative flex size-12 items-center justify-center",
|
|
14470
|
+
!dragging && "floating-crab-body"
|
|
14471
|
+
),
|
|
14472
|
+
"aria-hidden": "true",
|
|
14473
|
+
children: [
|
|
14474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CrabLogo, { className: "relative z-10 size-11 text-amber-500 drop-shadow-[0_0_15px_rgba(245,158,11,0.30)]" }),
|
|
14475
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "pointer-events-none absolute inset-x-0 bottom-0 z-0 flex items-end justify-center gap-1 text-amber-400/80", children: [0, 1, 2, 3, 4, 5].map((leg) => /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14476
|
+
"span",
|
|
14477
|
+
{
|
|
14478
|
+
className: cn(
|
|
14479
|
+
"floating-crab-leg h-2 w-0.5 rounded-full bg-current shadow-[0_0_7px_rgba(245,158,11,0.24)]",
|
|
14480
|
+
leg < 3 ? "floating-crab-leg-left" : "floating-crab-leg-right",
|
|
14481
|
+
dragging && "animate-none"
|
|
14482
|
+
),
|
|
14483
|
+
style: {
|
|
14484
|
+
animationDelay: `${leg % 2 === 0 ? 0 : 180}ms`
|
|
14485
|
+
}
|
|
14486
|
+
},
|
|
14487
|
+
leg
|
|
14488
|
+
)) })
|
|
14489
|
+
]
|
|
14490
|
+
}
|
|
14491
|
+
)
|
|
14492
|
+
}
|
|
14493
|
+
);
|
|
14494
|
+
}
|
|
14027
14495
|
function SessionContextLogButton({ label, logId }) {
|
|
14028
14496
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14029
14497
|
"button",
|
|
@@ -14346,8 +14814,10 @@ function ProxyViewer({
|
|
|
14346
14814
|
const [importStatus, setImportStatus] = reactExports.useState(null);
|
|
14347
14815
|
const [importError, setImportError] = reactExports.useState(null);
|
|
14348
14816
|
const [deleteDialogOpen, setDeleteDialogOpen] = reactExports.useState(false);
|
|
14349
|
-
const [deleteStoredData, setDeleteStoredData] = reactExports.useState(false);
|
|
14350
14817
|
const [deletingCurrentView, setDeletingCurrentView] = reactExports.useState(false);
|
|
14818
|
+
const [detailsPanelCollapsed, setDetailsPanelCollapsed] = reactExports.useState(
|
|
14819
|
+
readStoredDetailsPanelCollapsed
|
|
14820
|
+
);
|
|
14351
14821
|
const [comparePair, setComparePair] = reactExports.useState(null);
|
|
14352
14822
|
const [crabEntrancePhase, setCrabEntrancePhase] = reactExports.useState(
|
|
14353
14823
|
"hidden"
|
|
@@ -14384,6 +14854,12 @@ function ProxyViewer({
|
|
|
14384
14854
|
clearTimeout(t2);
|
|
14385
14855
|
};
|
|
14386
14856
|
}, []);
|
|
14857
|
+
reactExports.useEffect(() => {
|
|
14858
|
+
window.localStorage.setItem(
|
|
14859
|
+
DETAILS_PANEL_COLLAPSED_STORAGE_KEY,
|
|
14860
|
+
detailsPanelCollapsed ? "1" : "0"
|
|
14861
|
+
);
|
|
14862
|
+
}, [detailsPanelCollapsed]);
|
|
14387
14863
|
reactExports.useEffect(() => {
|
|
14388
14864
|
if (pinnedSessionId === void 0) {
|
|
14389
14865
|
document.title = "Agent Inspector";
|
|
@@ -14465,7 +14941,6 @@ function ProxyViewer({
|
|
|
14465
14941
|
onClearAll();
|
|
14466
14942
|
}, [cancelTransientTasks, onClearAll]);
|
|
14467
14943
|
const handleRequestDeleteCurrentView = reactExports.useCallback(() => {
|
|
14468
|
-
setDeleteStoredData(false);
|
|
14469
14944
|
setDeleteDialogOpen(true);
|
|
14470
14945
|
}, []);
|
|
14471
14946
|
const handleConfirmDeleteCurrentView = reactExports.useCallback(() => {
|
|
@@ -14473,13 +14948,9 @@ function ProxyViewer({
|
|
|
14473
14948
|
setImportStatus(null);
|
|
14474
14949
|
setImportError(null);
|
|
14475
14950
|
setComparePair(null);
|
|
14476
|
-
if (
|
|
14477
|
-
setDeleteDialogOpen(false);
|
|
14478
|
-
onClearAll();
|
|
14479
|
-
return;
|
|
14480
|
-
}
|
|
14951
|
+
if (onDeleteCurrentView === void 0) return;
|
|
14481
14952
|
setDeletingCurrentView(true);
|
|
14482
|
-
void onDeleteCurrentView(
|
|
14953
|
+
void onDeleteCurrentView().then(() => {
|
|
14483
14954
|
setDeleteDialogOpen(false);
|
|
14484
14955
|
}).catch((err) => {
|
|
14485
14956
|
const message = err instanceof Error ? err.message : "Failed to delete stored logs";
|
|
@@ -14491,7 +14962,7 @@ function ProxyViewer({
|
|
|
14491
14962
|
}).finally(() => {
|
|
14492
14963
|
setDeletingCurrentView(false);
|
|
14493
14964
|
});
|
|
14494
|
-
}, [cancelTransientTasks,
|
|
14965
|
+
}, [cancelTransientTasks, onDeleteCurrentView, onNotify]);
|
|
14495
14966
|
const handleReloadCurrentSession = reactExports.useCallback(() => {
|
|
14496
14967
|
if (onReloadSession === void 0) return;
|
|
14497
14968
|
cancelTransientTasks();
|
|
@@ -14503,6 +14974,9 @@ function ProxyViewer({
|
|
|
14503
14974
|
const closeCompare = reactExports.useCallback(() => {
|
|
14504
14975
|
setComparePair(null);
|
|
14505
14976
|
}, []);
|
|
14977
|
+
const toggleDetailsPanelCollapsed = reactExports.useCallback(() => {
|
|
14978
|
+
setDetailsPanelCollapsed((value) => !value);
|
|
14979
|
+
}, []);
|
|
14506
14980
|
const groups = reactExports.useMemo(() => groupLogsByConversation(logs), [logs]);
|
|
14507
14981
|
const displayNumberByLogId = reactExports.useMemo(() => buildDisplayNumberByLogId(groups), [groups]);
|
|
14508
14982
|
const sessionContextScope = reactExports.useMemo(
|
|
@@ -14524,6 +14998,9 @@ function ProxyViewer({
|
|
|
14524
14998
|
const exportActionVisibility = getExportActionVisibility(captureMode, logs.length);
|
|
14525
14999
|
const isPinnedSessionPage = pinnedSessionId !== void 0;
|
|
14526
15000
|
const canClearCurrentView = logs.length > 0;
|
|
15001
|
+
const canDeleteCurrentView = onDeleteCurrentView !== void 0 && (logs.length > 0 || selectedSession !== "__all__");
|
|
15002
|
+
const deleteTargetLabel = selectedSession === "__all__" ? "all sessions" : "this session";
|
|
15003
|
+
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.";
|
|
14527
15004
|
const reloadSessionLabel = logs.length === 0 ? "Load" : "Reload";
|
|
14528
15005
|
const sessionInputValue = selectedSession === "__all__" ? "" : selectedSession;
|
|
14529
15006
|
const sessionSelectValue = selectedSession === "__all__" || sessions.includes(selectedSession) ? selectedSession : "__typed__";
|
|
@@ -14561,376 +15038,341 @@ function ProxyViewer({
|
|
|
14561
15038
|
);
|
|
14562
15039
|
const labSessionId = pinnedSessionId !== void 0 ? pinnedSessionId : selectedSession === "__all__" ? null : selectedSession;
|
|
14563
15040
|
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-background min-h-screen w-full text-foreground", children: [
|
|
14564
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14565
|
-
|
|
14566
|
-
|
|
14567
|
-
|
|
14568
|
-
|
|
14569
|
-
|
|
14570
|
-
|
|
14571
|
-
|
|
14572
|
-
logCount: logs.length
|
|
14573
|
-
}
|
|
15041
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15042
|
+
"button",
|
|
15043
|
+
{
|
|
15044
|
+
type: "button",
|
|
15045
|
+
onClick: toggleDetailsPanelCollapsed,
|
|
15046
|
+
className: cn(
|
|
15047
|
+
"group fixed top-1/2 right-3 z-40 inline-flex h-14 w-7 -translate-y-1/2 items-center justify-center rounded-l-md border border-white/[0.08] bg-background/90 text-muted-foreground shadow-[0_12px_34px_rgba(0,0,0,0.26),inset_0_1px_0_rgba(255,255,255,0.06)] backdrop-blur transition-[right,background-color,color,border-color] duration-200 hover:border-white/[0.16] hover:bg-white/[0.07] hover:text-foreground focus-visible:ring-1 focus-visible:ring-ring focus-visible:outline-none",
|
|
15048
|
+
detailsPanelCollapsed ? "right-3" : "lg:right-[326px] xl:right-[346px]"
|
|
14574
15049
|
),
|
|
14575
|
-
|
|
14576
|
-
|
|
14577
|
-
|
|
14578
|
-
|
|
14579
|
-
|
|
14580
|
-
|
|
14581
|
-
|
|
14582
|
-
|
|
14583
|
-
|
|
14584
|
-
|
|
14585
|
-
|
|
15050
|
+
"aria-label": detailsPanelCollapsed ? "Show details panel" : "Hide details panel",
|
|
15051
|
+
title: detailsPanelCollapsed ? "Show details panel" : "Hide details panel",
|
|
15052
|
+
children: [
|
|
15053
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "absolute left-1 top-2 bottom-2 w-px rounded-full bg-white/[0.16] transition-colors group-hover:bg-white/[0.28]" }),
|
|
15054
|
+
detailsPanelCollapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(PanelRightOpen, { className: "size-3.5" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(PanelRightClose, { className: "size-3.5" })
|
|
15055
|
+
]
|
|
15056
|
+
}
|
|
15057
|
+
),
|
|
15058
|
+
detailsPanelCollapsed && /* @__PURE__ */ jsxRuntimeExports.jsx(FloatingInspectorLogo, {}),
|
|
15059
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15060
|
+
"div",
|
|
15061
|
+
{
|
|
15062
|
+
className: cn(
|
|
15063
|
+
"grid min-h-screen w-full grid-cols-1",
|
|
15064
|
+
detailsPanelCollapsed ? "lg:grid-cols-[minmax(0,1fr)]" : "lg:grid-cols-[minmax(0,1fr)_340px] xl:grid-cols-[minmax(0,1fr)_360px]"
|
|
15065
|
+
),
|
|
15066
|
+
children: [
|
|
15067
|
+
!detailsPanelCollapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("aside", { className: "bg-background/95 order-1 border-b border-white/[0.045] lg:sticky lg:top-0 lg:order-2 lg:h-screen lg:overflow-y-auto lg:border-b-0 lg:border-l lg:border-white/[0.055]", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4 p-4", children: [
|
|
14586
15068
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14587
|
-
|
|
14588
|
-
{
|
|
14589
|
-
label: "Output",
|
|
14590
|
-
value: formatTokens(hasSessionContext ? sessionContextTotalOut : totalOut)
|
|
14591
|
-
}
|
|
14592
|
-
)
|
|
14593
|
-
] }),
|
|
14594
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 grid grid-cols-2 gap-2", children: [
|
|
14595
|
-
onReloadSession !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14596
|
-
"button",
|
|
15069
|
+
BrandHeader,
|
|
14597
15070
|
{
|
|
14598
|
-
|
|
14599
|
-
|
|
14600
|
-
|
|
14601
|
-
|
|
14602
|
-
title: "Load stored logs for this session",
|
|
14603
|
-
children: [
|
|
14604
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: cn("size-3.5", isLoading && "animate-spin") }),
|
|
14605
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: reloadSessionLabel })
|
|
14606
|
-
]
|
|
15071
|
+
compact: true,
|
|
15072
|
+
crabEntrancePhase,
|
|
15073
|
+
currentSessionId: labSessionId,
|
|
15074
|
+
logCount: logs.length
|
|
14607
15075
|
}
|
|
14608
15076
|
),
|
|
14609
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14610
|
-
"
|
|
14611
|
-
|
|
14612
|
-
|
|
14613
|
-
|
|
14614
|
-
|
|
14615
|
-
|
|
14616
|
-
|
|
14617
|
-
|
|
15077
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SidebarPanel, { label: "Session", children: [
|
|
15078
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-2", children: [
|
|
15079
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarMetric, { label: "Requests", value: logs.length }),
|
|
15080
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarMetric, { label: "Sessions", value: sessions.length }),
|
|
15081
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15082
|
+
SidebarMetric,
|
|
15083
|
+
{
|
|
15084
|
+
label: "Input",
|
|
15085
|
+
value: formatTokens(hasSessionContext ? sessionContextTotalIn : totalIn)
|
|
15086
|
+
}
|
|
14618
15087
|
),
|
|
14619
|
-
|
|
14620
|
-
|
|
14621
|
-
|
|
14622
|
-
|
|
14623
|
-
|
|
14624
|
-
|
|
14625
|
-
|
|
14626
|
-
|
|
14627
|
-
"
|
|
14628
|
-
{
|
|
14629
|
-
type: "button",
|
|
14630
|
-
onClick: handleRequestDeleteCurrentView,
|
|
14631
|
-
disabled: !canClearCurrentView || deletingCurrentView,
|
|
14632
|
-
className: "bg-red-500/[0.07] hover:bg-red-500/[0.12] inline-flex h-8 min-w-0 items-center justify-center gap-1.5 rounded-md px-2 text-xs text-red-200 shadow-[inset_0_0_0_1px_rgba(248,113,113,0.14)] transition-colors hover:text-red-100 disabled:cursor-not-allowed disabled:opacity-50",
|
|
14633
|
-
title: "Choose whether to delete stored data for the current view.",
|
|
14634
|
-
children: [
|
|
14635
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "size-3.5" }),
|
|
14636
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Delete" })
|
|
14637
|
-
]
|
|
14638
|
-
}
|
|
14639
|
-
)
|
|
14640
|
-
] }),
|
|
14641
|
-
sessionLoadProgress !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md bg-black/20 px-2 py-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionLoadProgressBar, { progress: sessionLoadProgress }) })
|
|
14642
|
-
] }),
|
|
14643
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Workspace", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-black/20 rounded-md px-3 py-2 shadow-[inset_0_1px_0_rgba(255,255,255,0.035)]", children: [
|
|
14644
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14645
|
-
"div",
|
|
14646
|
-
{
|
|
14647
|
-
className: "truncate font-mono text-xs font-semibold text-cyan-100",
|
|
14648
|
-
title: activeScopeLabel,
|
|
14649
|
-
children: activeScopeLabel
|
|
14650
|
-
}
|
|
14651
|
-
),
|
|
14652
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-[11px] text-muted-foreground", children: isPinnedSessionPage ? "Session workspace" : "Live workspace" })
|
|
14653
|
-
] }) }),
|
|
14654
|
-
hasSessionContext && sessionContextScope !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14655
|
-
SessionContextBar,
|
|
14656
|
-
{
|
|
14657
|
-
label: sessionContextScope.label,
|
|
14658
|
-
logs: sessionContextLogs,
|
|
14659
|
-
totalIn: sessionContextTotalIn,
|
|
14660
|
-
totalOut: sessionContextTotalOut,
|
|
14661
|
-
timeDisplayFormat,
|
|
14662
|
-
contextSummary: sessionContextSummary,
|
|
14663
|
-
showBackLink: sessionContextScope.showBackLink
|
|
14664
|
-
}
|
|
14665
|
-
),
|
|
14666
|
-
hasSessionContext && pinnedSessionId !== void 0 && sessionMemberships.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(SessionMembershipPanel, { memberships: sessionMemberships }),
|
|
14667
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Filters", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
14668
|
-
!hideSessionFilter && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
14669
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
14670
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
14671
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14672
|
-
"input",
|
|
14673
|
-
{
|
|
14674
|
-
type: "search",
|
|
14675
|
-
value: sessionInputValue,
|
|
14676
|
-
onChange: handleSessionInputChange,
|
|
14677
|
-
placeholder: "Paste session ID",
|
|
14678
|
-
className: "bg-black/25 hover:bg-white/[0.045] focus-visible:ring-ring h-9 w-full rounded-md px-8 font-mono text-xs text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors placeholder:font-sans placeholder:text-muted-foreground focus-visible:ring-1",
|
|
14679
|
-
"aria-label": "Filter by session ID",
|
|
14680
|
-
title: "Filter by exact session ID"
|
|
14681
|
-
}
|
|
14682
|
-
),
|
|
14683
|
-
sessionInputValue !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14684
|
-
"button",
|
|
14685
|
-
{
|
|
14686
|
-
type: "button",
|
|
14687
|
-
onClick: () => onSessionChange("__all__"),
|
|
14688
|
-
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",
|
|
14689
|
-
"aria-label": "Clear session filter",
|
|
14690
|
-
title: "Clear session filter",
|
|
14691
|
-
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "size-3.5" })
|
|
14692
|
-
}
|
|
14693
|
-
)
|
|
14694
|
-
] }),
|
|
14695
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: sessionSelectValue, onValueChange: handleSessionSelectChange, children: [
|
|
14696
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { 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)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All sessions" }) }),
|
|
14697
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
14698
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All sessions" }),
|
|
14699
|
-
sessionSelectValue === "__typed__" && /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectItem, { value: "__typed__", children: [
|
|
14700
|
-
"Typed: ",
|
|
14701
|
-
truncateSessionId(selectedSession)
|
|
14702
|
-
] }),
|
|
14703
|
-
sessions.map((s) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: s, children: truncateSessionId(s) }, s))
|
|
14704
|
-
] })
|
|
14705
|
-
] })
|
|
14706
|
-
] }),
|
|
14707
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: selectedModel, onValueChange: onModelChange, children: [
|
|
14708
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { 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)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All models" }) }),
|
|
14709
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
14710
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All models" }),
|
|
14711
|
-
models.map((m) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: m, children: m }, m))
|
|
14712
|
-
] })
|
|
14713
|
-
] })
|
|
14714
|
-
] }) })
|
|
14715
|
-
] }) }),
|
|
14716
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "order-2 min-w-0 lg:order-1", children: [
|
|
14717
|
-
/* @__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: [
|
|
14718
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
14719
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-[180px] flex-1", children: [
|
|
14720
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold text-foreground", children: "Logs" }),
|
|
14721
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-0.5 font-mono text-[11px] text-muted-foreground", children: activeScopeLabel })
|
|
15088
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15089
|
+
SidebarMetric,
|
|
15090
|
+
{
|
|
15091
|
+
label: "Output",
|
|
15092
|
+
value: formatTokens(hasSessionContext ? sessionContextTotalOut : totalOut)
|
|
15093
|
+
}
|
|
15094
|
+
)
|
|
15095
|
+
] }),
|
|
15096
|
+
sessionLoadProgress !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md bg-black/20 px-2 py-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionLoadProgressBar, { progress: sessionLoadProgress }) })
|
|
14722
15097
|
] }),
|
|
14723
|
-
|
|
15098
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Workspace", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-black/20 rounded-md px-3 py-2 shadow-[inset_0_1px_0_rgba(255,255,255,0.035)]", children: [
|
|
14724
15099
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14725
|
-
"
|
|
15100
|
+
"div",
|
|
14726
15101
|
{
|
|
14727
|
-
|
|
14728
|
-
|
|
14729
|
-
|
|
14730
|
-
className: "hidden",
|
|
14731
|
-
onChange: handleImportFileChange
|
|
15102
|
+
className: "truncate font-mono text-xs font-semibold text-cyan-100",
|
|
15103
|
+
title: activeScopeLabel,
|
|
15104
|
+
children: activeScopeLabel
|
|
14732
15105
|
}
|
|
14733
15106
|
),
|
|
14734
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14735
|
-
|
|
14736
|
-
|
|
14737
|
-
|
|
14738
|
-
onClick: handleImportClick,
|
|
14739
|
-
disabled: importing,
|
|
14740
|
-
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
14741
|
-
title: "Import Agent Inspector export",
|
|
14742
|
-
children: importing ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Importing..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
14743
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "size-3.5" }),
|
|
14744
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Import" })
|
|
14745
|
-
] })
|
|
14746
|
-
}
|
|
14747
|
-
)
|
|
14748
|
-
] }),
|
|
14749
|
-
exportActionVisibility.redacted && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14750
|
-
"button",
|
|
15107
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 text-[11px] text-muted-foreground", children: isPinnedSessionPage ? "Session workspace" : "Live workspace" })
|
|
15108
|
+
] }) }),
|
|
15109
|
+
hasSessionContext && sessionContextScope !== null && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15110
|
+
SessionContextBar,
|
|
14751
15111
|
{
|
|
14752
|
-
|
|
14753
|
-
|
|
14754
|
-
|
|
14755
|
-
|
|
14756
|
-
|
|
14757
|
-
|
|
14758
|
-
|
|
14759
|
-
children: exporting === "redacted" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Exporting..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
14760
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(Download, { className: "size-3.5" }),
|
|
14761
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Export" })
|
|
14762
|
-
] })
|
|
15112
|
+
label: sessionContextScope.label,
|
|
15113
|
+
logs: sessionContextLogs,
|
|
15114
|
+
totalIn: sessionContextTotalIn,
|
|
15115
|
+
totalOut: sessionContextTotalOut,
|
|
15116
|
+
timeDisplayFormat,
|
|
15117
|
+
contextSummary: sessionContextSummary,
|
|
15118
|
+
showBackLink: sessionContextScope.showBackLink
|
|
14763
15119
|
}
|
|
14764
15120
|
),
|
|
14765
|
-
|
|
14766
|
-
|
|
14767
|
-
{
|
|
14768
|
-
|
|
14769
|
-
|
|
14770
|
-
|
|
14771
|
-
|
|
14772
|
-
|
|
14773
|
-
|
|
14774
|
-
|
|
14775
|
-
|
|
14776
|
-
|
|
14777
|
-
|
|
15121
|
+
hasSessionContext && pinnedSessionId !== void 0 && sessionMemberships.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(SessionMembershipPanel, { memberships: sessionMemberships }),
|
|
15122
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SidebarPanel, { label: "Filters", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-2", children: [
|
|
15123
|
+
!hideSessionFilter && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15124
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "relative", children: [
|
|
15125
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Search, { className: "pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
15126
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15127
|
+
"input",
|
|
15128
|
+
{
|
|
15129
|
+
type: "search",
|
|
15130
|
+
value: sessionInputValue,
|
|
15131
|
+
onChange: handleSessionInputChange,
|
|
15132
|
+
placeholder: "Paste session ID",
|
|
15133
|
+
className: "bg-black/25 hover:bg-white/[0.045] focus-visible:ring-ring h-9 w-full rounded-md px-8 font-mono text-xs text-foreground outline-none shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors placeholder:font-sans placeholder:text-muted-foreground focus-visible:ring-1",
|
|
15134
|
+
"aria-label": "Filter by session ID",
|
|
15135
|
+
title: "Filter by exact session ID"
|
|
15136
|
+
}
|
|
15137
|
+
),
|
|
15138
|
+
sessionInputValue !== "" && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15139
|
+
"button",
|
|
15140
|
+
{
|
|
15141
|
+
type: "button",
|
|
15142
|
+
onClick: () => onSessionChange("__all__"),
|
|
15143
|
+
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",
|
|
15144
|
+
"aria-label": "Clear session filter",
|
|
15145
|
+
title: "Clear session filter",
|
|
15146
|
+
children: /* @__PURE__ */ jsxRuntimeExports.jsx(X, { className: "size-3.5" })
|
|
15147
|
+
}
|
|
15148
|
+
)
|
|
15149
|
+
] }),
|
|
15150
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: sessionSelectValue, onValueChange: handleSessionSelectChange, children: [
|
|
15151
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { 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)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All sessions" }) }),
|
|
15152
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
15153
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All sessions" }),
|
|
15154
|
+
sessionSelectValue === "__typed__" && /* @__PURE__ */ jsxRuntimeExports.jsxs(SelectItem, { value: "__typed__", children: [
|
|
15155
|
+
"Typed: ",
|
|
15156
|
+
truncateSessionId(selectedSession)
|
|
15157
|
+
] }),
|
|
15158
|
+
sessions.map((s) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: s, children: truncateSessionId(s) }, s))
|
|
15159
|
+
] })
|
|
14778
15160
|
] })
|
|
14779
|
-
}
|
|
14780
|
-
|
|
14781
|
-
|
|
14782
|
-
|
|
14783
|
-
|
|
14784
|
-
|
|
14785
|
-
|
|
14786
|
-
|
|
14787
|
-
|
|
14788
|
-
|
|
14789
|
-
|
|
14790
|
-
|
|
14791
|
-
|
|
14792
|
-
]
|
|
14793
|
-
|
|
14794
|
-
|
|
14795
|
-
|
|
14796
|
-
|
|
14797
|
-
|
|
14798
|
-
|
|
14799
|
-
|
|
14800
|
-
|
|
14801
|
-
|
|
14802
|
-
|
|
14803
|
-
|
|
14804
|
-
|
|
14805
|
-
|
|
14806
|
-
|
|
14807
|
-
|
|
14808
|
-
|
|
14809
|
-
|
|
14810
|
-
|
|
14811
|
-
|
|
14812
|
-
|
|
14813
|
-
|
|
14814
|
-
|
|
14815
|
-
|
|
14816
|
-
|
|
14817
|
-
|
|
14818
|
-
|
|
14819
|
-
|
|
14820
|
-
|
|
14821
|
-
|
|
14822
|
-
|
|
14823
|
-
|
|
14824
|
-
|
|
14825
|
-
|
|
14826
|
-
|
|
14827
|
-
|
|
14828
|
-
|
|
14829
|
-
|
|
14830
|
-
|
|
14831
|
-
|
|
14832
|
-
|
|
14833
|
-
|
|
14834
|
-
|
|
14835
|
-
|
|
14836
|
-
|
|
14837
|
-
|
|
14838
|
-
|
|
14839
|
-
|
|
15161
|
+
] }),
|
|
15162
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(Select, { value: selectedModel, onValueChange: onModelChange, children: [
|
|
15163
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectTrigger, { 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)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SelectValue, { placeholder: "All models" }) }),
|
|
15164
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(SelectContent, { children: [
|
|
15165
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: "__all__", children: "All models" }),
|
|
15166
|
+
models.map((m) => /* @__PURE__ */ jsxRuntimeExports.jsx(SelectItem, { value: m, children: m }, m))
|
|
15167
|
+
] })
|
|
15168
|
+
] })
|
|
15169
|
+
] }) })
|
|
15170
|
+
] }) }),
|
|
15171
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("main", { className: "order-2 min-w-0 lg:order-1", children: [
|
|
15172
|
+
/* @__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: [
|
|
15173
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
15174
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-[180px] flex-1", children: [
|
|
15175
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-semibold text-foreground", children: "Logs" }),
|
|
15176
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-0.5 font-mono text-[11px] text-muted-foreground", children: activeScopeLabel })
|
|
15177
|
+
] }),
|
|
15178
|
+
onImportLogs !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15179
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15180
|
+
"input",
|
|
15181
|
+
{
|
|
15182
|
+
ref: importInputRef,
|
|
15183
|
+
type: "file",
|
|
15184
|
+
accept: ".zip,.json,.jsonl,application/zip,application/json",
|
|
15185
|
+
className: "hidden",
|
|
15186
|
+
onChange: handleImportFileChange
|
|
15187
|
+
}
|
|
15188
|
+
),
|
|
15189
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15190
|
+
"button",
|
|
15191
|
+
{
|
|
15192
|
+
type: "button",
|
|
15193
|
+
onClick: handleImportClick,
|
|
15194
|
+
disabled: importing,
|
|
15195
|
+
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
15196
|
+
title: "Import Agent Inspector export",
|
|
15197
|
+
children: importing ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Importing..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Upload, { className: "size-3.5" }),
|
|
15199
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Import" })
|
|
15200
|
+
] })
|
|
15201
|
+
}
|
|
15202
|
+
)
|
|
15203
|
+
] }),
|
|
15204
|
+
exportActionVisibility.redacted && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15205
|
+
"button",
|
|
15206
|
+
{
|
|
15207
|
+
type: "button",
|
|
15208
|
+
onClick: () => {
|
|
15209
|
+
void handleExport("redacted");
|
|
15210
|
+
},
|
|
15211
|
+
disabled: exporting !== null,
|
|
15212
|
+
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
15213
|
+
title: "Export redacted logs as JSON ZIP",
|
|
15214
|
+
children: exporting === "redacted" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Exporting..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15215
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Download, { className: "size-3.5" }),
|
|
15216
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Export" })
|
|
15217
|
+
] })
|
|
15218
|
+
}
|
|
15219
|
+
),
|
|
15220
|
+
exportActionVisibility.raw && /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15221
|
+
"button",
|
|
15222
|
+
{
|
|
15223
|
+
type: "button",
|
|
15224
|
+
onClick: () => {
|
|
15225
|
+
void handleExport("raw");
|
|
15226
|
+
},
|
|
15227
|
+
disabled: exporting !== null,
|
|
15228
|
+
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-2.5 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
15229
|
+
title: "Export raw logs without redaction",
|
|
15230
|
+
children: exporting === "raw" ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Exporting..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
15231
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FileBraces, { className: "size-3.5" }),
|
|
15232
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Raw" })
|
|
15233
|
+
] })
|
|
15234
|
+
}
|
|
15235
|
+
),
|
|
14840
15236
|
onReloadSession !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14841
15237
|
"button",
|
|
14842
15238
|
{
|
|
14843
15239
|
type: "button",
|
|
14844
15240
|
onClick: handleReloadCurrentSession,
|
|
14845
|
-
|
|
15241
|
+
disabled: isLoading,
|
|
15242
|
+
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
15243
|
+
title: "Reload this session from stored logs",
|
|
14846
15244
|
children: [
|
|
14847
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "size-3.5" }),
|
|
14848
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children:
|
|
15245
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: cn("size-3.5", isLoading && "animate-spin") }),
|
|
15246
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: reloadSessionLabel })
|
|
14849
15247
|
]
|
|
14850
15248
|
}
|
|
14851
15249
|
),
|
|
14852
|
-
|
|
14853
|
-
"
|
|
15250
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15251
|
+
"button",
|
|
14854
15252
|
{
|
|
14855
|
-
|
|
14856
|
-
|
|
14857
|
-
|
|
15253
|
+
type: "button",
|
|
15254
|
+
onClick: handleClearCurrentView,
|
|
15255
|
+
disabled: !canClearCurrentView,
|
|
15256
|
+
className: "bg-white/[0.035] hover:bg-white/[0.065] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground disabled:cursor-not-allowed disabled:opacity-50",
|
|
15257
|
+
title: "Clear the current view. Stored logs remain reloadable.",
|
|
15258
|
+
children: [
|
|
15259
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "size-3.5" }),
|
|
15260
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Clear" })
|
|
15261
|
+
]
|
|
14858
15262
|
}
|
|
14859
|
-
)
|
|
15263
|
+
),
|
|
15264
|
+
onDeleteCurrentView !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
14860
15265
|
"button",
|
|
14861
15266
|
{
|
|
14862
15267
|
type: "button",
|
|
14863
|
-
onClick:
|
|
14864
|
-
|
|
14865
|
-
|
|
15268
|
+
onClick: handleRequestDeleteCurrentView,
|
|
15269
|
+
disabled: !canDeleteCurrentView || deletingCurrentView,
|
|
15270
|
+
className: "bg-red-500/[0.07] hover:bg-red-500/[0.12] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-red-200 shadow-[inset_0_0_0_1px_rgba(248,113,113,0.14)] transition-colors hover:text-red-100 disabled:cursor-not-allowed disabled:opacity-50",
|
|
15271
|
+
title: "Delete persisted history for the selected session.",
|
|
15272
|
+
children: [
|
|
15273
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "size-3.5" }),
|
|
15274
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Delete" })
|
|
15275
|
+
]
|
|
14866
15276
|
}
|
|
14867
15277
|
)
|
|
14868
|
-
] })
|
|
14869
|
-
|
|
14870
|
-
|
|
14871
|
-
|
|
14872
|
-
|
|
14873
|
-
|
|
14874
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyableCommand, { command: "ANTHROPIC_BASE_URL=http://localhost:9527/proxy <your-tool>" }),
|
|
14875
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyableCommand, { command: "OPENAI_BASE_URL=http://localhost:9527/proxy <your-tool>" })
|
|
15278
|
+
] }),
|
|
15279
|
+
pagination === void 0 && sessionLoadProgress !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md bg-black/20 px-2 py-2 shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionLoadProgressBar, { progress: sessionLoadProgress }) }),
|
|
15280
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(LogPaginationBar, { logs, pagination, embedded: true }),
|
|
15281
|
+
onNotify === void 0 && exportError !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: exportError }),
|
|
15282
|
+
onNotify === void 0 && importError !== null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md border border-destructive/30 bg-destructive/10 px-3 py-2 text-xs text-destructive", children: importError }),
|
|
15283
|
+
onNotify === void 0 && importStatus !== null && importError === null && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-2 rounded-md border border-cyan-400/25 bg-cyan-500/10 px-3 py-2 text-xs text-cyan-100", children: importStatus })
|
|
14876
15284
|
] }),
|
|
14877
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
14878
|
-
|
|
14879
|
-
|
|
14880
|
-
|
|
14881
|
-
|
|
14882
|
-
|
|
14883
|
-
|
|
14884
|
-
|
|
14885
|
-
|
|
14886
|
-
|
|
14887
|
-
|
|
14888
|
-
|
|
14889
|
-
|
|
14890
|
-
|
|
14891
|
-
|
|
14892
|
-
|
|
14893
|
-
|
|
14894
|
-
|
|
14895
|
-
|
|
14896
|
-
|
|
14897
|
-
|
|
14898
|
-
|
|
14899
|
-
|
|
14900
|
-
|
|
14901
|
-
|
|
14902
|
-
|
|
14903
|
-
|
|
14904
|
-
|
|
14905
|
-
|
|
14906
|
-
|
|
15285
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "px-4 py-4 lg:px-5", children: [
|
|
15286
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(SessionOpeningSlate, { stats: slateStats }),
|
|
15287
|
+
logs.length === 0 ? selectedSession !== "__all__" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "py-16 text-center text-muted-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/[0.035] shadow-[inset_0_1px_0_rgba(255,255,255,0.045),0_18px_52px_rgba(0,0,0,0.18)] mx-auto max-w-xl space-y-4 rounded-[8px] px-4 py-8", children: [
|
|
15288
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm font-medium", children: isLoading ? "Loading session data..." : "No logs loaded for this session" }),
|
|
15289
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "inline-block max-w-full rounded bg-muted px-3 py-1 font-mono text-xs break-all", children: truncateSessionId(selectedSession) }),
|
|
15290
|
+
sessionLoadProgress !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mx-auto max-w-md rounded-md bg-black/20 px-2 py-2 text-left shadow-[inset_0_0_0_1px_rgba(255,255,255,0.045)]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionLoadProgressBar, { progress: sessionLoadProgress }) }),
|
|
15291
|
+
sessionMemberships.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-left", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SessionMembershipPanel, { memberships: sessionMemberships }) }),
|
|
15292
|
+
!isLoading && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-3 text-xs", children: [
|
|
15293
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Stored logs may still be available." }),
|
|
15294
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center justify-center gap-2", children: [
|
|
15295
|
+
onReloadSession !== void 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15296
|
+
"button",
|
|
15297
|
+
{
|
|
15298
|
+
type: "button",
|
|
15299
|
+
onClick: handleReloadCurrentSession,
|
|
15300
|
+
className: "bg-white/[0.045] hover:bg-white/[0.075] inline-flex h-8 items-center gap-1.5 rounded-md px-3 text-xs text-muted-foreground shadow-[inset_0_0_0_1px_rgba(255,255,255,0.06)] transition-colors hover:text-foreground",
|
|
15301
|
+
children: [
|
|
15302
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "size-3.5" }),
|
|
15303
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Load session" })
|
|
15304
|
+
]
|
|
15305
|
+
}
|
|
15306
|
+
),
|
|
15307
|
+
hideSessionFilter ? /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15308
|
+
"a",
|
|
15309
|
+
{
|
|
15310
|
+
href: "/",
|
|
15311
|
+
className: "inline-flex h-8 items-center rounded-md px-3 text-xs text-muted-foreground underline transition-colors hover:text-foreground",
|
|
15312
|
+
children: "Back to all sessions"
|
|
15313
|
+
}
|
|
15314
|
+
) : /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15315
|
+
"button",
|
|
15316
|
+
{
|
|
15317
|
+
type: "button",
|
|
15318
|
+
onClick: () => onSessionChange("__all__"),
|
|
15319
|
+
className: "inline-flex h-8 items-center rounded-md px-3 text-xs text-muted-foreground underline transition-colors hover:text-foreground",
|
|
15320
|
+
children: "Show all sessions"
|
|
15321
|
+
}
|
|
15322
|
+
)
|
|
15323
|
+
] })
|
|
15324
|
+
] })
|
|
15325
|
+
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "py-16 text-center text-muted-foreground", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "bg-white/[0.035] shadow-[inset_0_1px_0_rgba(255,255,255,0.045),0_18px_52px_rgba(0,0,0,0.18)] mx-auto max-w-2xl space-y-4 rounded-[8px] px-4 py-8", children: [
|
|
15326
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm", children: "No logs loaded in the current view." }),
|
|
15327
|
+
sessions.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mx-auto max-w-xl text-xs leading-relaxed text-muted-foreground", children: "Pick a session from the filter panel to load stored logs on demand." }),
|
|
15328
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
15329
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyableCommand, { command: "ANTHROPIC_BASE_URL=http://localhost:9527/proxy <your-tool>" }),
|
|
15330
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(CopyableCommand, { command: "OPENAI_BASE_URL=http://localhost:9527/proxy <your-tool>" })
|
|
15331
|
+
] }),
|
|
15332
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mx-auto max-w-xl text-xs leading-relaxed text-muted-foreground", children: "Container note: if your AI tool runs in a different container or host than Agent Inspector, replace localhost with an address reachable from that tool and verify the network/firewall path." })
|
|
15333
|
+
] }) }) : /* @__PURE__ */ jsxRuntimeExports.jsxs(
|
|
15334
|
+
"div",
|
|
15335
|
+
{
|
|
15336
|
+
ref: logListWrapperRef,
|
|
15337
|
+
tabIndex: 0,
|
|
15338
|
+
className: "flex flex-col gap-2 focus:outline-none",
|
|
15339
|
+
children: [
|
|
15340
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: logListRef, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
15341
|
+
ConversationGroupList,
|
|
15342
|
+
{
|
|
15343
|
+
groups,
|
|
15344
|
+
viewMode,
|
|
15345
|
+
strip,
|
|
15346
|
+
slowResponseThresholdSeconds,
|
|
15347
|
+
cacheTrends,
|
|
15348
|
+
onCompareWithPrevious: handleCompareWithPrevious,
|
|
15349
|
+
comparisonPredecessors,
|
|
15350
|
+
onClearGroup,
|
|
15351
|
+
defaultExpanded: groups.length === 1,
|
|
15352
|
+
timeDisplayFormat
|
|
15353
|
+
}
|
|
15354
|
+
) }),
|
|
15355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-3", children: /* @__PURE__ */ jsxRuntimeExports.jsx(LogPaginationBar, { logs, pagination }) })
|
|
15356
|
+
]
|
|
15357
|
+
}
|
|
15358
|
+
)
|
|
15359
|
+
] })
|
|
15360
|
+
] })
|
|
15361
|
+
]
|
|
15362
|
+
}
|
|
15363
|
+
),
|
|
14907
15364
|
/* @__PURE__ */ jsxRuntimeExports.jsx(Dialog, { open: deleteDialogOpen, onOpenChange: setDeleteDialogOpen, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(DialogContent, { className: "border-red-500/20 bg-zinc-950 text-zinc-100 sm:max-w-md", children: [
|
|
14908
15365
|
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogHeader, { children: [
|
|
14909
|
-
/* @__PURE__ */ jsxRuntimeExports.
|
|
14910
|
-
|
|
15366
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs(DialogTitle, { children: [
|
|
15367
|
+
"Delete ",
|
|
15368
|
+
deleteTargetLabel,
|
|
15369
|
+
" history?"
|
|
15370
|
+
] }),
|
|
15371
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(DialogDescription, { children: "Clear only hides logs from the UI. Delete removes stored history from disk." })
|
|
14911
15372
|
] }),
|
|
14912
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("
|
|
14913
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
14914
|
-
|
|
14915
|
-
{
|
|
14916
|
-
type: "checkbox",
|
|
14917
|
-
className: "mt-0.5 size-4 shrink-0",
|
|
14918
|
-
checked: deleteStoredData,
|
|
14919
|
-
disabled: deletingCurrentView,
|
|
14920
|
-
onChange: (event) => setDeleteStoredData(event.currentTarget.checked)
|
|
14921
|
-
}
|
|
14922
|
-
),
|
|
14923
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "min-w-0", children: [
|
|
14924
|
-
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block font-medium", children: "Also delete stored data" }),
|
|
14925
|
-
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "mt-1 block text-xs text-red-200/80", children: [
|
|
14926
|
-
"Removes persisted log rows, streaming chunks, and session archive entries for these",
|
|
14927
|
-
" ",
|
|
14928
|
-
logs.length.toString(),
|
|
14929
|
-
" visible request",
|
|
14930
|
-
logs.length === 1 ? "" : "s",
|
|
14931
|
-
"."
|
|
14932
|
-
] })
|
|
14933
|
-
] })
|
|
15373
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-md bg-red-500/[0.08] px-3 py-3 text-sm text-red-100 shadow-[inset_0_0_0_1px_rgba(248,113,113,0.16)]", children: [
|
|
15374
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "block font-medium", children: "This is a full history delete." }),
|
|
15375
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "mt-1 block text-xs text-red-200/80", children: deleteTargetDescription })
|
|
14934
15376
|
] }),
|
|
14935
15377
|
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end gap-2", children: [
|
|
14936
15378
|
/* @__PURE__ */ jsxRuntimeExports.jsx(
|
|
@@ -14948,11 +15390,11 @@ function ProxyViewer({
|
|
|
14948
15390
|
Button,
|
|
14949
15391
|
{
|
|
14950
15392
|
type: "button",
|
|
14951
|
-
variant:
|
|
15393
|
+
variant: "destructive",
|
|
14952
15394
|
size: "sm",
|
|
14953
15395
|
disabled: deletingCurrentView,
|
|
14954
15396
|
onClick: handleConfirmDeleteCurrentView,
|
|
14955
|
-
children: deletingCurrentView ? "Deleting..." :
|
|
15397
|
+
children: deletingCurrentView ? "Deleting..." : "Delete history"
|
|
14956
15398
|
}
|
|
14957
15399
|
)
|
|
14958
15400
|
] })
|
|
@@ -15089,6 +15531,38 @@ function fetchSessionLogsPage(sessionId, request, limit = SESSION_PAGE_LIMIT) {
|
|
|
15089
15531
|
SESSION_LOGS_FETCH_TIMEOUT_MS
|
|
15090
15532
|
);
|
|
15091
15533
|
}
|
|
15534
|
+
async function collectSessionLogIds(sessionId, onProgress) {
|
|
15535
|
+
const ids = /* @__PURE__ */ new Set();
|
|
15536
|
+
let page = await fetchSessionLogsPage(sessionId, { kind: "oldest" }, SESSION_RELOAD_PAGE_LIMIT);
|
|
15537
|
+
for (const log of page.logs) {
|
|
15538
|
+
ids.add(log.id);
|
|
15539
|
+
}
|
|
15540
|
+
onProgress(ids.size, 1);
|
|
15541
|
+
let loadedPages = 1;
|
|
15542
|
+
while (page.hasNewer && page.newestLogId !== null && loadedPages < MAX_SESSION_RELOAD_PAGES) {
|
|
15543
|
+
page = await fetchSessionLogsPage(
|
|
15544
|
+
sessionId,
|
|
15545
|
+
{ kind: "newer", afterLogId: page.newestLogId },
|
|
15546
|
+
SESSION_RELOAD_PAGE_LIMIT
|
|
15547
|
+
);
|
|
15548
|
+
for (const log of page.logs) {
|
|
15549
|
+
ids.add(log.id);
|
|
15550
|
+
}
|
|
15551
|
+
loadedPages += 1;
|
|
15552
|
+
onProgress(ids.size, loadedPages);
|
|
15553
|
+
}
|
|
15554
|
+
return { ids: [...ids], truncated: page.hasNewer };
|
|
15555
|
+
}
|
|
15556
|
+
async function deleteAllGroupsForFullHistoryDelete() {
|
|
15557
|
+
try {
|
|
15558
|
+
const result = await fetchJson("/api/groups", DeleteInspectorGroupsResponseSchema, {
|
|
15559
|
+
method: "DELETE"
|
|
15560
|
+
});
|
|
15561
|
+
return { deleted: result.deleted, ok: true };
|
|
15562
|
+
} catch {
|
|
15563
|
+
return { deleted: 0, ok: false };
|
|
15564
|
+
}
|
|
15565
|
+
}
|
|
15092
15566
|
function mergeLogsById(previousLogs, incomingLogs) {
|
|
15093
15567
|
if (incomingLogs.length === 0) return [...previousLogs];
|
|
15094
15568
|
const byId = /* @__PURE__ */ new Map();
|
|
@@ -15505,43 +15979,107 @@ function ProxyViewerContainer({
|
|
|
15505
15979
|
},
|
|
15506
15980
|
[showToast]
|
|
15507
15981
|
);
|
|
15508
|
-
const handleDeleteCurrentView = reactExports.useCallback(
|
|
15509
|
-
|
|
15510
|
-
|
|
15511
|
-
|
|
15982
|
+
const handleDeleteCurrentView = reactExports.useCallback(async () => {
|
|
15983
|
+
const deleteRequestId = sessionPageRequestIdRef.current + 1;
|
|
15984
|
+
sessionPageRequestIdRef.current = deleteRequestId;
|
|
15985
|
+
setSessionPageLoading(true);
|
|
15986
|
+
stopSessionLoadProgress();
|
|
15987
|
+
dismissToast();
|
|
15988
|
+
try {
|
|
15989
|
+
if (selectedSession === "__all__") {
|
|
15990
|
+
startSessionLoadProgress("Deleting stored history", deleteRequestId);
|
|
15991
|
+
const result2 = await fetchJson("/api/logs", DeleteLogsResponseSchema, {
|
|
15992
|
+
method: "DELETE"
|
|
15993
|
+
});
|
|
15994
|
+
const groupCleanup = await deleteAllGroupsForFullHistoryDelete();
|
|
15995
|
+
if (sessionPageRequestIdRef.current !== deleteRequestId) return;
|
|
15996
|
+
setAllLogs([]);
|
|
15997
|
+
logIndexRef.current.clear();
|
|
15998
|
+
setLogPage(null);
|
|
15999
|
+
setKnownSessions([]);
|
|
16000
|
+
setSessionMemberships([]);
|
|
16001
|
+
setSessionPageLoading(false);
|
|
16002
|
+
stopSessionLoadProgress();
|
|
16003
|
+
const groupMessage = groupCleanup.ok ? ` Cleared ${groupCleanup.deleted.toString()} group${groupCleanup.deleted === 1 ? "" : "s"}.` : " Group cleanup failed; open Groups to retry Clear.";
|
|
16004
|
+
showToast({
|
|
16005
|
+
message: `Deleted ${result2.cleared.toString()} stored log${result2.cleared === 1 ? "" : "s"} across all sessions.${groupMessage}`,
|
|
16006
|
+
tone: groupCleanup.ok ? "success" : "error"
|
|
16007
|
+
});
|
|
16008
|
+
return;
|
|
16009
|
+
}
|
|
16010
|
+
const sessionId = selectedSession;
|
|
16011
|
+
startSessionLoadProgress("Deleting session history", deleteRequestId);
|
|
16012
|
+
const collected = await collectSessionLogIds(sessionId, (logCount, pageCount) => {
|
|
16013
|
+
updateSessionLoadProgress("Deleting session history", deleteRequestId, logCount, pageCount);
|
|
16014
|
+
});
|
|
16015
|
+
const idSet = new Set(collected.ids);
|
|
16016
|
+
for (const log of allLogs) {
|
|
16017
|
+
if (log.sessionId === sessionId) {
|
|
16018
|
+
idSet.add(log.id);
|
|
16019
|
+
}
|
|
16020
|
+
}
|
|
16021
|
+
const persistedIds = [...idSet].filter((id) => Number.isInteger(id) && id >= 0);
|
|
15512
16022
|
if (persistedIds.length === 0) {
|
|
16023
|
+
if (sessionPageRequestIdRef.current !== deleteRequestId) return;
|
|
16024
|
+
setAllLogs((prev) => {
|
|
16025
|
+
const remaining = prev.filter((log) => log.sessionId !== sessionId);
|
|
16026
|
+
logIndexRef.current = buildLogIndex(remaining);
|
|
16027
|
+
return remaining;
|
|
16028
|
+
});
|
|
16029
|
+
setLogPage(
|
|
16030
|
+
(prev) => prev === null ? null : {
|
|
16031
|
+
...prev,
|
|
16032
|
+
logs: prev.logs.filter((log) => log.sessionId !== sessionId)
|
|
16033
|
+
}
|
|
16034
|
+
);
|
|
16035
|
+
setKnownSessions((prev) => prev.filter((session) => session !== sessionId));
|
|
16036
|
+
setSessionPageLoading(false);
|
|
16037
|
+
stopSessionLoadProgress();
|
|
15513
16038
|
showToast({
|
|
15514
|
-
message: "No
|
|
15515
|
-
tone: "
|
|
16039
|
+
message: "No stored log records were found for this session.",
|
|
16040
|
+
tone: "success"
|
|
15516
16041
|
});
|
|
15517
16042
|
return;
|
|
15518
16043
|
}
|
|
15519
|
-
const idSet = new Set(persistedIds);
|
|
15520
|
-
const removed = allLogs.filter((log) => idSet.has(log.id));
|
|
15521
16044
|
const result = await fetchJson("/api/logs", DeleteLogsResponseSchema, {
|
|
15522
16045
|
method: "DELETE",
|
|
15523
16046
|
headers: { "content-type": "application/json" },
|
|
15524
16047
|
body: JSON.stringify({ ids: persistedIds })
|
|
15525
16048
|
});
|
|
16049
|
+
if (sessionPageRequestIdRef.current !== deleteRequestId) return;
|
|
15526
16050
|
setAllLogs((prev) => {
|
|
15527
|
-
const remaining = prev.filter((log) =>
|
|
16051
|
+
const remaining = prev.filter((log) => log.sessionId !== sessionId);
|
|
15528
16052
|
logIndexRef.current = buildLogIndex(remaining);
|
|
15529
16053
|
return remaining;
|
|
15530
16054
|
});
|
|
15531
16055
|
setLogPage(
|
|
15532
16056
|
(prev) => prev === null ? null : {
|
|
15533
16057
|
...prev,
|
|
15534
|
-
logs: prev.logs.filter((log) =>
|
|
16058
|
+
logs: prev.logs.filter((log) => log.sessionId !== sessionId)
|
|
15535
16059
|
}
|
|
15536
16060
|
);
|
|
15537
|
-
setKnownSessions((prev) =>
|
|
16061
|
+
setKnownSessions((prev) => prev.filter((session) => session !== sessionId));
|
|
16062
|
+
setSessionPageLoading(false);
|
|
16063
|
+
stopSessionLoadProgress();
|
|
15538
16064
|
showToast({
|
|
15539
|
-
message: `Deleted ${result.cleared.toString()} stored log${result.cleared === 1 ? "" : "s"}
|
|
15540
|
-
tone: "success"
|
|
16065
|
+
message: `Deleted ${result.cleared.toString()} stored log${result.cleared === 1 ? "" : "s"} for this session${collected.truncated ? ". More history may remain." : "."}`,
|
|
16066
|
+
tone: collected.truncated ? "error" : "success"
|
|
15541
16067
|
});
|
|
15542
|
-
}
|
|
15543
|
-
|
|
15544
|
-
|
|
16068
|
+
} finally {
|
|
16069
|
+
if (sessionPageRequestIdRef.current === deleteRequestId) {
|
|
16070
|
+
setSessionPageLoading(false);
|
|
16071
|
+
stopSessionLoadProgress();
|
|
16072
|
+
}
|
|
16073
|
+
}
|
|
16074
|
+
}, [
|
|
16075
|
+
allLogs,
|
|
16076
|
+
dismissToast,
|
|
16077
|
+
selectedSession,
|
|
16078
|
+
showToast,
|
|
16079
|
+
startSessionLoadProgress,
|
|
16080
|
+
stopSessionLoadProgress,
|
|
16081
|
+
updateSessionLoadProgress
|
|
16082
|
+
]);
|
|
15545
16083
|
const handleReloadSession = reactExports.useCallback(() => {
|
|
15546
16084
|
if (initialSessionId !== void 0) {
|
|
15547
16085
|
loadSessionPage({ kind: "newest" });
|