@tonyclaw/agent-inspector 2.0.3 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/assets/{CompareDrawer-D5A4bTfV.js → CompareDrawer-3nRwtk8J.js} +1 -1
  3. package/.output/public/assets/ProxyViewerContainer-CbW5VRER.js +101 -0
  4. package/.output/public/assets/ReplayDialog-Cl62N9PI.js +1 -0
  5. package/.output/public/assets/RequestAnatomy-DgQWGvjs.js +1 -0
  6. package/.output/public/assets/ResponseView-Cvc-ct4E.js +1 -0
  7. package/.output/public/assets/StreamingChunkSequence-BCQaCAIe.js +1 -0
  8. package/.output/public/assets/_sessionId-CcD_aLGq.js +1 -0
  9. package/.output/public/assets/index-B_dffD3u.js +1 -0
  10. package/.output/public/assets/index-CX796gvi.css +1 -0
  11. package/.output/public/assets/{json-viewer-BbU0n8eM.js → json-viewer-IXejqXB0.js} +1 -1
  12. package/.output/public/assets/{main-CZT_F-gu.js → main-2NlGzgOe.js} +2 -2
  13. package/.output/server/_libs/lucide-react.mjs +181 -114
  14. package/.output/server/{_sessionId-B-s9P7fJ.mjs → _sessionId-DWCTasJU.mjs} +3 -3
  15. package/.output/server/_ssr/{CompareDrawer-C08L3UOO.mjs → CompareDrawer-DhrN1uC2.mjs} +6 -6
  16. package/.output/server/_ssr/{ProxyViewerContainer-CMWl3Ijy.mjs → ProxyViewerContainer-DRl51s_n.mjs} +910 -186
  17. package/.output/server/_ssr/{ReplayDialog-CPDo9_G5.mjs → ReplayDialog-BQT_ygxC.mjs} +240 -14
  18. package/.output/server/_ssr/{RequestAnatomy-D9wt_K1E.mjs → RequestAnatomy-DS2tZOgq.mjs} +5 -5
  19. package/.output/server/_ssr/{ResponseView-DXaL7nY3.mjs → ResponseView-e0kL2C3x.mjs} +25 -21
  20. package/.output/server/_ssr/{StreamingChunkSequence-B_hudZyb.mjs → StreamingChunkSequence-BJG-m7xs.mjs} +3 -3
  21. package/.output/server/_ssr/{index-CuE_BN86.mjs → index-Dea3OeRw.mjs} +2 -2
  22. package/.output/server/_ssr/index.mjs +2 -2
  23. package/.output/server/_ssr/{json-viewer-Ci6kkjde.mjs → json-viewer-DDU55MLK.mjs} +3 -3
  24. package/.output/server/_ssr/{router-BemxgIg7.mjs → router-Dl7oh0zx.mjs} +164 -82
  25. package/.output/server/_tanstack-start-manifest_v-m-FJNBVf.mjs +4 -0
  26. package/.output/server/index.mjs +70 -70
  27. package/package.json +1 -1
  28. package/src/components/OnboardingBanner.tsx +11 -19
  29. package/src/components/ProxyViewer.tsx +26 -16
  30. package/src/components/ProxyViewerContainer.tsx +2 -1
  31. package/src/components/providers/ProviderCard.tsx +6 -20
  32. package/src/components/providers/SettingsDialog.tsx +140 -3
  33. package/src/components/proxy-viewer/AgentTraceSummary.tsx +731 -72
  34. package/src/components/proxy-viewer/AnswerMarkdown.tsx +16 -0
  35. package/src/components/proxy-viewer/CompareDrawer.tsx +4 -2
  36. package/src/components/proxy-viewer/ConversationGroup.tsx +12 -0
  37. package/src/components/proxy-viewer/ConversationHeader.tsx +6 -6
  38. package/src/components/proxy-viewer/LogEntry.tsx +5 -5
  39. package/src/components/proxy-viewer/LogEntryHeader.tsx +21 -36
  40. package/src/components/proxy-viewer/ReplayDialog.tsx +190 -8
  41. package/src/components/proxy-viewer/ResponseView.tsx +4 -8
  42. package/src/components/proxy-viewer/ToolTraceEvents.tsx +37 -17
  43. package/src/components/proxy-viewer/TurnGroup.tsx +18 -2
  44. package/src/components/proxy-viewer/anatomy/SegmentBar.tsx +2 -2
  45. package/src/components/proxy-viewer/formats/anthropic/ContentBlocks.tsx +6 -12
  46. package/src/components/proxy-viewer/formats/anthropic/ResponseView.tsx +2 -2
  47. package/src/components/proxy-viewer/formats/openai/ResponseView.tsx +10 -14
  48. package/src/components/proxy-viewer/replayComparison.ts +131 -0
  49. package/src/components/proxy-viewer/useKeyboardNavigation.ts +64 -22
  50. package/src/components/proxy-viewer/viewerState.ts +14 -2
  51. package/src/knowledge/candidateStore.ts +32 -1
  52. package/src/lib/runtimeConfig.ts +6 -0
  53. package/src/lib/timeDisplay.ts +22 -0
  54. package/src/lib/useOnboarding.ts +2 -0
  55. package/src/lib/useStripConfig.ts +16 -0
  56. package/src/proxy/config.ts +3 -0
  57. package/src/routes/api/config.ts +5 -1
  58. package/src/routes/api/knowledge.candidates.$candidateId.ts +50 -0
  59. package/src/routes/api/knowledge.sessions.$sessionId.candidates.ts +12 -2
  60. package/.output/public/assets/ProxyViewerContainer-Da0jpBkp.js +0 -101
  61. package/.output/public/assets/ReplayDialog-CxUk_TF0.js +0 -1
  62. package/.output/public/assets/RequestAnatomy-DIlzjgjJ.js +0 -1
  63. package/.output/public/assets/ResponseView-DQCuKJ1G.js +0 -1
  64. package/.output/public/assets/StreamingChunkSequence-DHk4SGGL.js +0 -1
  65. package/.output/public/assets/_sessionId-dY1TTl7N.js +0 -1
  66. package/.output/public/assets/index-D7wwbwly.css +0 -1
  67. package/.output/public/assets/index-FqQZbfl2.js +0 -1
  68. package/.output/server/_tanstack-start-manifest_v--L1_b4sd.mjs +0 -4
@@ -49,8 +49,8 @@ import "../_libs/mimic-function.mjs";
49
49
  import "../_libs/semver.mjs";
50
50
  import "../_libs/uint8array-extras.mjs";
51
51
  const faviconSvg = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%20role='img'%20aria-label='Agent%20Inspector'%3e%3crect%20width='64'%20height='64'%20rx='14'%20fill='%23111827'%20/%3e%3cg%20fill='none'%20stroke='%23f59e0b'%20stroke-width='4.2'%20stroke-linecap='round'%20stroke-linejoin='round'%3e%3cpath%20fill='%23f59e0b'%20d='M15%2036c0-11%207-18%2017-18s17%207%2017%2018c0%208-7%2013-17%2013s-17-5-17-13z'%20/%3e%3cpath%20d='M16%2031c-6-5-12-3-12%204%200%205%206%206%2011%202'%20/%3e%3cpath%20d='M48%2031c6-5%2012-3%2012%204%200%205-6%206-11%202'%20/%3e%3cpath%20d='M27%2019l-3-7'%20/%3e%3cpath%20d='M37%2019l3-7'%20/%3e%3cpath%20d='M19%2045l-6%209'%20/%3e%3cpath%20d='M27%2048l-3%209'%20/%3e%3cpath%20d='M37%2048l3%209'%20/%3e%3cpath%20d='M45%2045l6%209'%20/%3e%3c/g%3e%3cpath%20d='M14%2047l9-8%208%209c-5%203.5-12%203-17-1z'%20fill='%232f6b3f'%20opacity='.95'%20/%3e%3cpath%20d='M18%2046l5-5%205%206c-3%201.6-7%201.4-10-1z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M23%2041v10'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='1.6'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='31'%20cy='48'%20r='1.8'%20fill='%23c2412d'%20/%3e%3cpath%20d='M24%2044l13-11%2014%2013c-8%205.8-18%205.3-27-2z'%20fill='%232f6b3f'%20opacity='.97'%20/%3e%3cpath%20d='M30%2043l7-7%209%209c-5%202.7-11%202.5-16-2z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M37%2036v14'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='2'%20stroke-linecap='round'%20/%3e%3cpath%20d='M30%2043c5-2%2011-1.5%2016%202'%20fill='none'%20stroke='%239fca78'%20stroke-width='1.8'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='51'%20cy='46'%20r='2'%20fill='%23c2412d'%20/%3e%3cpath%20d='M40%2050l8-8%207%208c-4.2%203.2-10%203-15%200z'%20fill='%232f6b3f'%20opacity='.95'%20/%3e%3cpath%20d='M43%2049l5-5%204.5%205.5c-3%201.5-6%201.2-9.5-.5z'%20fill='%236fb36f'%20opacity='.95'%20/%3e%3cpath%20d='M48%2044v9'%20fill='none'%20stroke='%23d6b45f'%20stroke-width='1.5'%20stroke-linecap='round'%20/%3e%3ccircle%20cx='55'%20cy='50'%20r='1.7'%20fill='%23c2412d'%20/%3e%3ccircle%20cx='24'%20cy='11'%20r='3.2'%20fill='%23f59e0b'%20/%3e%3ccircle%20cx='40'%20cy='11'%20r='3.2'%20fill='%23f59e0b'%20/%3e%3ccircle%20cx='25'%20cy='34'%20r='2.1'%20fill='%23111827'%20/%3e%3ccircle%20cx='39'%20cy='34'%20r='2.1'%20fill='%23111827'%20/%3e%3c/svg%3e";
52
- const appCss = "/assets/index-D7wwbwly.css";
53
- const Route$q = createRootRoute({
52
+ const appCss = "/assets/index-CX796gvi.css";
53
+ const Route$r = createRootRoute({
54
54
  head: () => ({
55
55
  meta: [
56
56
  { charSet: "utf-8" },
@@ -76,8 +76,8 @@ function RootDocument({ children }) {
76
76
  ] })
77
77
  ] });
78
78
  }
79
- const $$splitComponentImporter$1 = () => import("./index-CuE_BN86.mjs");
80
- const Route$p = createFileRoute("/")({
79
+ const $$splitComponentImporter$1 = () => import("./index-Dea3OeRw.mjs");
80
+ const Route$q = createFileRoute("/")({
81
81
  component: lazyRouteComponent($$splitComponentImporter$1, "component")
82
82
  });
83
83
  const B64URL_RE = /^[A-Za-z0-9_-]+$/;
@@ -119,8 +119,8 @@ function decodeSessionIdFromPath(encoded) {
119
119
  function getSessionPath(sessionId) {
120
120
  return `/session/${encodeSessionIdForPath(sessionId)}`;
121
121
  }
122
- const $$splitComponentImporter = () => import("../_sessionId-B-s9P7fJ.mjs");
123
- const Route$o = createFileRoute("/session/$sessionId")({
122
+ const $$splitComponentImporter = () => import("../_sessionId-DWCTasJU.mjs");
123
+ const Route$p = createFileRoute("/session/$sessionId")({
124
124
  component: lazyRouteComponent($$splitComponentImporter, "component"),
125
125
  parseParams: (params) => ({
126
126
  sessionId: decodeSessionIdFromPath(params.sessionId)
@@ -2634,10 +2634,13 @@ async function getClientInfo(request) {
2634
2634
  }
2635
2635
  const DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS = 10;
2636
2636
  const MAX_SLOW_RESPONSE_THRESHOLD_SECONDS = 600;
2637
+ const DEFAULT_TIME_DISPLAY_FORMAT = "time";
2638
+ const TimeDisplayFormatSchema = _enum(["time", "full"]);
2637
2639
  const RuntimeConfigSchema = object({
2638
2640
  stripClaudeCodeBillingHeader: boolean(),
2639
2641
  hasSeenOnboarding: boolean().default(false),
2640
- slowResponseThresholdSeconds: number().int().min(0).max(MAX_SLOW_RESPONSE_THRESHOLD_SECONDS).default(DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS)
2642
+ slowResponseThresholdSeconds: number().int().min(0).max(MAX_SLOW_RESPONSE_THRESHOLD_SECONDS).default(DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS),
2643
+ timeDisplayFormat: TimeDisplayFormatSchema.default(DEFAULT_TIME_DISPLAY_FORMAT)
2641
2644
  });
2642
2645
  function getConfigFilePath() {
2643
2646
  return join(getDataDir(), "config.json");
@@ -2670,13 +2673,15 @@ function resolveInitialConfig() {
2670
2673
  return {
2671
2674
  stripClaudeCodeBillingHeader: true,
2672
2675
  hasSeenOnboarding: false,
2673
- slowResponseThresholdSeconds: DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS
2676
+ slowResponseThresholdSeconds: DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS,
2677
+ timeDisplayFormat: DEFAULT_TIME_DISPLAY_FORMAT
2674
2678
  };
2675
2679
  }
2676
2680
  return {
2677
2681
  stripClaudeCodeBillingHeader: false,
2678
2682
  hasSeenOnboarding: false,
2679
- slowResponseThresholdSeconds: DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS
2683
+ slowResponseThresholdSeconds: DEFAULT_SLOW_RESPONSE_THRESHOLD_SECONDS,
2684
+ timeDisplayFormat: DEFAULT_TIME_DISPLAY_FORMAT
2680
2685
  };
2681
2686
  }
2682
2687
  function getConfig() {
@@ -3342,7 +3347,7 @@ async function handleProxy(req) {
3342
3347
  }
3343
3348
  return handleStreamingResponse(upstreamRes, req, startTime, upstreamUrl, log);
3344
3349
  }
3345
- const Route$n = createFileRoute("/proxy/$")({
3350
+ const Route$o = createFileRoute("/proxy/$")({
3346
3351
  server: {
3347
3352
  handlers: {
3348
3353
  GET: ({ request }) => handleProxy(request),
@@ -3354,7 +3359,7 @@ const Route$n = createFileRoute("/proxy/$")({
3354
3359
  }
3355
3360
  }
3356
3361
  });
3357
- const Route$m = createFileRoute("/api/sessions")({
3362
+ const Route$n = createFileRoute("/api/sessions")({
3358
3363
  server: {
3359
3364
  handlers: {
3360
3365
  GET: ({ request }) => {
@@ -3380,7 +3385,7 @@ const ProviderInputSchema = object({
3380
3385
  apiDocsUrl: string().optional(),
3381
3386
  source: _enum(["company", "personal"]).optional()
3382
3387
  });
3383
- const Route$l = createFileRoute("/api/providers")({
3388
+ const Route$m = createFileRoute("/api/providers")({
3384
3389
  server: {
3385
3390
  handlers: {
3386
3391
  GET: () => {
@@ -3409,7 +3414,7 @@ const Route$l = createFileRoute("/api/providers")({
3409
3414
  }
3410
3415
  }
3411
3416
  });
3412
- const Route$k = createFileRoute("/api/models")({
3417
+ const Route$l = createFileRoute("/api/models")({
3413
3418
  server: {
3414
3419
  handlers: {
3415
3420
  GET: () => Response.json(getModels())
@@ -4021,7 +4026,7 @@ PATCH-style update: only the fields you supply are changed. Returns the updated
4021
4026
  (args) => safeCall(() => getProjectContextImpl(callApi, args))
4022
4027
  );
4023
4028
  }
4024
- const Route$j = createFileRoute("/api/mcp")({
4029
+ const Route$k = createFileRoute("/api/mcp")({
4025
4030
  server: {
4026
4031
  handlers: {
4027
4032
  // The SDK may issue either POST, GET, or DELETE. TanStack Start only
@@ -4036,7 +4041,7 @@ const Route$j = createFileRoute("/api/mcp")({
4036
4041
  const DeleteBodySchema = object({
4037
4042
  ids: array(number().int().positive()).optional()
4038
4043
  }).optional();
4039
- const Route$i = createFileRoute("/api/logs")({
4044
+ const Route$j = createFileRoute("/api/logs")({
4040
4045
  server: {
4041
4046
  handlers: {
4042
4047
  GET: ({ request }) => {
@@ -4083,7 +4088,7 @@ const Route$i = createFileRoute("/api/logs")({
4083
4088
  }
4084
4089
  });
4085
4090
  logger.debug("Health endpoint loaded");
4086
- const Route$h = createFileRoute("/api/health")({
4091
+ const Route$i = createFileRoute("/api/health")({
4087
4092
  server: {
4088
4093
  handlers: {
4089
4094
  GET: () => {
@@ -4095,11 +4100,12 @@ const Route$h = createFileRoute("/api/health")({
4095
4100
  const RuntimeConfigPatchSchema = object({
4096
4101
  stripClaudeCodeBillingHeader: boolean().optional(),
4097
4102
  hasSeenOnboarding: boolean().optional(),
4098
- slowResponseThresholdSeconds: number().int().min(0).max(MAX_SLOW_RESPONSE_THRESHOLD_SECONDS).optional()
4103
+ slowResponseThresholdSeconds: number().int().min(0).max(MAX_SLOW_RESPONSE_THRESHOLD_SECONDS).optional(),
4104
+ timeDisplayFormat: TimeDisplayFormatSchema.optional()
4099
4105
  }).strict().refine((v) => Object.keys(v).length > 0, {
4100
4106
  message: "At least one field must be provided"
4101
4107
  });
4102
- const Route$g = createFileRoute("/api/config")({
4108
+ const Route$h = createFileRoute("/api/config")({
4103
4109
  server: {
4104
4110
  handlers: {
4105
4111
  GET: () => {
@@ -4508,7 +4514,7 @@ function scanExternalProviders() {
4508
4514
  }
4509
4515
  return { providers: filteredProviders, warnings };
4510
4516
  }
4511
- const Route$f = createFileRoute("/api/providers/scan")({
4517
+ const Route$g = createFileRoute("/api/providers/scan")({
4512
4518
  server: {
4513
4519
  handlers: {
4514
4520
  GET: () => {
@@ -4529,7 +4535,7 @@ const Route$f = createFileRoute("/api/providers/scan")({
4529
4535
  }
4530
4536
  });
4531
4537
  union([string(), object({ providers: unknown() })]);
4532
- const Route$e = createFileRoute("/api/providers/import")({
4538
+ const Route$f = createFileRoute("/api/providers/import")({
4533
4539
  server: {
4534
4540
  handlers: {
4535
4541
  POST: async ({ request }) => {
@@ -4562,7 +4568,7 @@ const Route$e = createFileRoute("/api/providers/import")({
4562
4568
  }
4563
4569
  }
4564
4570
  });
4565
- const Route$d = createFileRoute("/api/providers/export")({
4571
+ const Route$e = createFileRoute("/api/providers/export")({
4566
4572
  server: {
4567
4573
  handlers: {
4568
4574
  GET: ({ request }) => {
@@ -4593,7 +4599,7 @@ const ProviderUpdateSchema = object({
4593
4599
  apiDocsUrl: string().optional(),
4594
4600
  source: _enum(["company", "personal"]).optional()
4595
4601
  });
4596
- const Route$c = createFileRoute("/api/providers/$providerId")({
4602
+ const Route$d = createFileRoute("/api/providers/$providerId")({
4597
4603
  server: {
4598
4604
  handlers: {
4599
4605
  GET: ({ params }) => {
@@ -4625,7 +4631,7 @@ const Route$c = createFileRoute("/api/providers/$providerId")({
4625
4631
  }
4626
4632
  }
4627
4633
  });
4628
- const Route$b = createFileRoute("/api/logs/stream")({
4634
+ const Route$c = createFileRoute("/api/logs/stream")({
4629
4635
  server: {
4630
4636
  handlers: {
4631
4637
  GET: ({ request }) => {
@@ -4689,7 +4695,7 @@ const Route$b = createFileRoute("/api/logs/stream")({
4689
4695
  }
4690
4696
  }
4691
4697
  });
4692
- const Route$a = createFileRoute("/api/logs/$id")({
4698
+ const Route$b = createFileRoute("/api/logs/$id")({
4693
4699
  server: {
4694
4700
  handlers: {
4695
4701
  GET: async ({ params }) => {
@@ -5226,7 +5232,7 @@ const SearchBodySchema = object({
5226
5232
  query: string().min(1),
5227
5233
  project: string().optional()
5228
5234
  });
5229
- const Route$9 = createFileRoute("/api/knowledge/search")({
5235
+ const Route$a = createFileRoute("/api/knowledge/search")({
5230
5236
  server: {
5231
5237
  handlers: {
5232
5238
  GET: async ({ request }) => {
@@ -5248,7 +5254,7 @@ const Route$9 = createFileRoute("/api/knowledge/search")({
5248
5254
  }
5249
5255
  }
5250
5256
  });
5251
- const Route$8 = createFileRoute("/api/knowledge/project-context")({
5257
+ const Route$9 = createFileRoute("/api/knowledge/project-context")({
5252
5258
  server: {
5253
5259
  handlers: {
5254
5260
  GET: async ({ request }) => {
@@ -5312,14 +5318,32 @@ function markCandidateFailed(id, error) {
5312
5318
  candidates.set(id, updated);
5313
5319
  return updated;
5314
5320
  }
5315
- const Route$7 = createFileRoute("/api/knowledge/candidates")({
5321
+ function updateCandidateDraft(id, updates) {
5322
+ const existing = candidates.get(id);
5323
+ if (existing === void 0) return null;
5324
+ if (existing.status === "promoted") return null;
5325
+ const updated = redactCandidate({
5326
+ ...existing,
5327
+ type: updates.type ?? existing.type,
5328
+ title: updates.title ?? existing.title,
5329
+ content: updates.content ?? existing.content,
5330
+ tags: updates.tags ?? existing.tags,
5331
+ status: "draft",
5332
+ error: null,
5333
+ openClawMemoryId: null,
5334
+ updatedAt: (/* @__PURE__ */ new Date()).toISOString()
5335
+ });
5336
+ candidates.set(id, updated);
5337
+ return updated;
5338
+ }
5339
+ const Route$8 = createFileRoute("/api/knowledge/candidates")({
5316
5340
  server: {
5317
5341
  handlers: {
5318
5342
  GET: () => Response.json({ candidates: listCandidates() })
5319
5343
  }
5320
5344
  }
5321
5345
  });
5322
- const Route$6 = createFileRoute("/api/config/paths")({
5346
+ const Route$7 = createFileRoute("/api/config/paths")({
5323
5347
  server: {
5324
5348
  handlers: {
5325
5349
  GET: () => {
@@ -5788,7 +5812,7 @@ async function testStreamingEndpoint(baseUrl, provider, path2, model, isOpenAI)
5788
5812
  return createErrorResult(err, Date.now() - startTime, true);
5789
5813
  }
5790
5814
  }
5791
- const Route$5 = createFileRoute("/api/providers/$providerId/test")({
5815
+ const Route$6 = createFileRoute("/api/providers/$providerId/test")({
5792
5816
  server: {
5793
5817
  handlers: {
5794
5818
  POST: async ({ params }) => {
@@ -5862,7 +5886,7 @@ const Route$5 = createFileRoute("/api/providers/$providerId/test")({
5862
5886
  const ReplayRequestSchema = object({
5863
5887
  modifiedBody: string()
5864
5888
  });
5865
- const Route$4 = createFileRoute("/api/logs/$id/replay")({
5889
+ const Route$5 = createFileRoute("/api/logs/$id/replay")({
5866
5890
  server: {
5867
5891
  handlers: {
5868
5892
  POST: async ({ params, request }) => {
@@ -5980,7 +6004,7 @@ const Route$4 = createFileRoute("/api/logs/$id/replay")({
5980
6004
  }
5981
6005
  }
5982
6006
  });
5983
- const Route$3 = createFileRoute("/api/logs/$id/chunks")({
6007
+ const Route$4 = createFileRoute("/api/logs/$id/chunks")({
5984
6008
  server: {
5985
6009
  handlers: {
5986
6010
  GET: async ({ params }) => {
@@ -6006,6 +6030,43 @@ const Route$3 = createFileRoute("/api/logs/$id/chunks")({
6006
6030
  }
6007
6031
  }
6008
6032
  });
6033
+ const CandidateUpdateSchema = object({
6034
+ type: KnowledgeCandidateTypeSchema.optional(),
6035
+ title: string().trim().min(1).max(160).optional(),
6036
+ content: string().trim().min(1).max(12e3).optional(),
6037
+ tags: array(string().trim().min(1).max(64)).max(24).optional()
6038
+ }).strict();
6039
+ object({
6040
+ candidate: KnowledgeCandidateSchema
6041
+ });
6042
+ const Route$3 = createFileRoute("/api/knowledge/candidates/$candidateId")({
6043
+ server: {
6044
+ handlers: {
6045
+ PATCH: async ({ params, request }) => {
6046
+ const existing = getCandidate(params.candidateId);
6047
+ if (existing === null) {
6048
+ return Response.json({ error: "Knowledge candidate not found" }, { status: 404 });
6049
+ }
6050
+ if (existing.status === "promoted") {
6051
+ return Response.json(
6052
+ { error: "Promoted knowledge candidates cannot be edited" },
6053
+ { status: 409 }
6054
+ );
6055
+ }
6056
+ const raw = await request.json().catch(() => null);
6057
+ const parsed = CandidateUpdateSchema.safeParse(raw);
6058
+ if (!parsed.success) {
6059
+ return Response.json({ error: parsed.error.message }, { status: 400 });
6060
+ }
6061
+ const updated = updateCandidateDraft(existing.id, parsed.data);
6062
+ if (updated === null) {
6063
+ return Response.json({ error: "Knowledge candidate update failed" }, { status: 409 });
6064
+ }
6065
+ return Response.json({ candidate: updated });
6066
+ }
6067
+ }
6068
+ }
6069
+ });
6009
6070
  const ProviderTestErrorTypeSchema = _enum([
6010
6071
  "timeout",
6011
6072
  "network_unreachable",
@@ -6329,11 +6390,19 @@ function distillSessionCandidates(sessionId, logs) {
6329
6390
  };
6330
6391
  return [redactCandidate(candidate)];
6331
6392
  }
6393
+ function getCandidateScopeId(log) {
6394
+ return getLogSessionId(log) ?? "default";
6395
+ }
6396
+ function getLogsForCandidateScope(scopeId) {
6397
+ const direct = getFilteredLogs(scopeId);
6398
+ if (direct.length > 0) return direct;
6399
+ return getFilteredLogs().filter((log) => getCandidateScopeId(log) === scopeId);
6400
+ }
6332
6401
  const Route$1 = createFileRoute("/api/knowledge/sessions/$sessionId/candidates")({
6333
6402
  server: {
6334
6403
  handlers: {
6335
6404
  POST: ({ params }) => {
6336
- const logs = getFilteredLogs(params.sessionId);
6405
+ const logs = getLogsForCandidateScope(params.sessionId);
6337
6406
  const candidates2 = saveCandidates(distillSessionCandidates(params.sessionId, logs));
6338
6407
  return Response.json({ candidates: candidates2 });
6339
6408
  }
@@ -6362,121 +6431,126 @@ const Route = createFileRoute("/api/knowledge/candidates/$candidateId/promote")(
6362
6431
  }
6363
6432
  }
6364
6433
  });
6365
- const IndexRoute = Route$p.update({
6434
+ const IndexRoute = Route$q.update({
6366
6435
  id: "/",
6367
6436
  path: "/",
6368
- getParentRoute: () => Route$q
6437
+ getParentRoute: () => Route$r
6369
6438
  });
6370
- const SessionSessionIdRoute = Route$o.update({
6439
+ const SessionSessionIdRoute = Route$p.update({
6371
6440
  id: "/session/$sessionId",
6372
6441
  path: "/session/$sessionId",
6373
- getParentRoute: () => Route$q
6442
+ getParentRoute: () => Route$r
6374
6443
  });
6375
- const ProxySplatRoute = Route$n.update({
6444
+ const ProxySplatRoute = Route$o.update({
6376
6445
  id: "/proxy/$",
6377
6446
  path: "/proxy/$",
6378
- getParentRoute: () => Route$q
6447
+ getParentRoute: () => Route$r
6379
6448
  });
6380
- const ApiSessionsRoute = Route$m.update({
6449
+ const ApiSessionsRoute = Route$n.update({
6381
6450
  id: "/api/sessions",
6382
6451
  path: "/api/sessions",
6383
- getParentRoute: () => Route$q
6452
+ getParentRoute: () => Route$r
6384
6453
  });
6385
- const ApiProvidersRoute = Route$l.update({
6454
+ const ApiProvidersRoute = Route$m.update({
6386
6455
  id: "/api/providers",
6387
6456
  path: "/api/providers",
6388
- getParentRoute: () => Route$q
6457
+ getParentRoute: () => Route$r
6389
6458
  });
6390
- const ApiModelsRoute = Route$k.update({
6459
+ const ApiModelsRoute = Route$l.update({
6391
6460
  id: "/api/models",
6392
6461
  path: "/api/models",
6393
- getParentRoute: () => Route$q
6462
+ getParentRoute: () => Route$r
6394
6463
  });
6395
- const ApiMcpRoute = Route$j.update({
6464
+ const ApiMcpRoute = Route$k.update({
6396
6465
  id: "/api/mcp",
6397
6466
  path: "/api/mcp",
6398
- getParentRoute: () => Route$q
6467
+ getParentRoute: () => Route$r
6399
6468
  });
6400
- const ApiLogsRoute = Route$i.update({
6469
+ const ApiLogsRoute = Route$j.update({
6401
6470
  id: "/api/logs",
6402
6471
  path: "/api/logs",
6403
- getParentRoute: () => Route$q
6472
+ getParentRoute: () => Route$r
6404
6473
  });
6405
- const ApiHealthRoute = Route$h.update({
6474
+ const ApiHealthRoute = Route$i.update({
6406
6475
  id: "/api/health",
6407
6476
  path: "/api/health",
6408
- getParentRoute: () => Route$q
6477
+ getParentRoute: () => Route$r
6409
6478
  });
6410
- const ApiConfigRoute = Route$g.update({
6479
+ const ApiConfigRoute = Route$h.update({
6411
6480
  id: "/api/config",
6412
6481
  path: "/api/config",
6413
- getParentRoute: () => Route$q
6482
+ getParentRoute: () => Route$r
6414
6483
  });
6415
- const ApiProvidersScanRoute = Route$f.update({
6484
+ const ApiProvidersScanRoute = Route$g.update({
6416
6485
  id: "/scan",
6417
6486
  path: "/scan",
6418
6487
  getParentRoute: () => ApiProvidersRoute
6419
6488
  });
6420
- const ApiProvidersImportRoute = Route$e.update({
6489
+ const ApiProvidersImportRoute = Route$f.update({
6421
6490
  id: "/import",
6422
6491
  path: "/import",
6423
6492
  getParentRoute: () => ApiProvidersRoute
6424
6493
  });
6425
- const ApiProvidersExportRoute = Route$d.update({
6494
+ const ApiProvidersExportRoute = Route$e.update({
6426
6495
  id: "/export",
6427
6496
  path: "/export",
6428
6497
  getParentRoute: () => ApiProvidersRoute
6429
6498
  });
6430
- const ApiProvidersProviderIdRoute = Route$c.update({
6499
+ const ApiProvidersProviderIdRoute = Route$d.update({
6431
6500
  id: "/$providerId",
6432
6501
  path: "/$providerId",
6433
6502
  getParentRoute: () => ApiProvidersRoute
6434
6503
  });
6435
- const ApiLogsStreamRoute = Route$b.update({
6504
+ const ApiLogsStreamRoute = Route$c.update({
6436
6505
  id: "/stream",
6437
6506
  path: "/stream",
6438
6507
  getParentRoute: () => ApiLogsRoute
6439
6508
  });
6440
- const ApiLogsIdRoute = Route$a.update({
6509
+ const ApiLogsIdRoute = Route$b.update({
6441
6510
  id: "/$id",
6442
6511
  path: "/$id",
6443
6512
  getParentRoute: () => ApiLogsRoute
6444
6513
  });
6445
- const ApiKnowledgeSearchRoute = Route$9.update({
6514
+ const ApiKnowledgeSearchRoute = Route$a.update({
6446
6515
  id: "/api/knowledge/search",
6447
6516
  path: "/api/knowledge/search",
6448
- getParentRoute: () => Route$q
6517
+ getParentRoute: () => Route$r
6449
6518
  });
6450
- const ApiKnowledgeProjectContextRoute = Route$8.update({
6519
+ const ApiKnowledgeProjectContextRoute = Route$9.update({
6451
6520
  id: "/api/knowledge/project-context",
6452
6521
  path: "/api/knowledge/project-context",
6453
- getParentRoute: () => Route$q
6522
+ getParentRoute: () => Route$r
6454
6523
  });
6455
- const ApiKnowledgeCandidatesRoute = Route$7.update({
6524
+ const ApiKnowledgeCandidatesRoute = Route$8.update({
6456
6525
  id: "/api/knowledge/candidates",
6457
6526
  path: "/api/knowledge/candidates",
6458
- getParentRoute: () => Route$q
6527
+ getParentRoute: () => Route$r
6459
6528
  });
6460
- const ApiConfigPathsRoute = Route$6.update({
6529
+ const ApiConfigPathsRoute = Route$7.update({
6461
6530
  id: "/paths",
6462
6531
  path: "/paths",
6463
6532
  getParentRoute: () => ApiConfigRoute
6464
6533
  });
6465
- const ApiProvidersProviderIdTestRoute = Route$5.update({
6534
+ const ApiProvidersProviderIdTestRoute = Route$6.update({
6466
6535
  id: "/test",
6467
6536
  path: "/test",
6468
6537
  getParentRoute: () => ApiProvidersProviderIdRoute
6469
6538
  });
6470
- const ApiLogsIdReplayRoute = Route$4.update({
6539
+ const ApiLogsIdReplayRoute = Route$5.update({
6471
6540
  id: "/replay",
6472
6541
  path: "/replay",
6473
6542
  getParentRoute: () => ApiLogsIdRoute
6474
6543
  });
6475
- const ApiLogsIdChunksRoute = Route$3.update({
6544
+ const ApiLogsIdChunksRoute = Route$4.update({
6476
6545
  id: "/chunks",
6477
6546
  path: "/chunks",
6478
6547
  getParentRoute: () => ApiLogsIdRoute
6479
6548
  });
6549
+ const ApiKnowledgeCandidatesCandidateIdRoute = Route$3.update({
6550
+ id: "/$candidateId",
6551
+ path: "/$candidateId",
6552
+ getParentRoute: () => ApiKnowledgeCandidatesRoute
6553
+ });
6480
6554
  const ApiProvidersProviderIdTestLogRoute = Route$2.update({
6481
6555
  id: "/log",
6482
6556
  path: "/log",
@@ -6485,12 +6559,12 @@ const ApiProvidersProviderIdTestLogRoute = Route$2.update({
6485
6559
  const ApiKnowledgeSessionsSessionIdCandidatesRoute = Route$1.update({
6486
6560
  id: "/api/knowledge/sessions/$sessionId/candidates",
6487
6561
  path: "/api/knowledge/sessions/$sessionId/candidates",
6488
- getParentRoute: () => Route$q
6562
+ getParentRoute: () => Route$r
6489
6563
  });
6490
6564
  const ApiKnowledgeCandidatesCandidateIdPromoteRoute = Route.update({
6491
- id: "/$candidateId/promote",
6492
- path: "/$candidateId/promote",
6493
- getParentRoute: () => ApiKnowledgeCandidatesRoute
6565
+ id: "/promote",
6566
+ path: "/promote",
6567
+ getParentRoute: () => ApiKnowledgeCandidatesCandidateIdRoute
6494
6568
  });
6495
6569
  const ApiConfigRouteChildren = {
6496
6570
  ApiConfigPathsRoute
@@ -6531,9 +6605,15 @@ const ApiProvidersRouteChildren = {
6531
6605
  const ApiProvidersRouteWithChildren = ApiProvidersRoute._addFileChildren(
6532
6606
  ApiProvidersRouteChildren
6533
6607
  );
6534
- const ApiKnowledgeCandidatesRouteChildren = {
6608
+ const ApiKnowledgeCandidatesCandidateIdRouteChildren = {
6535
6609
  ApiKnowledgeCandidatesCandidateIdPromoteRoute
6536
6610
  };
6611
+ const ApiKnowledgeCandidatesCandidateIdRouteWithChildren = ApiKnowledgeCandidatesCandidateIdRoute._addFileChildren(
6612
+ ApiKnowledgeCandidatesCandidateIdRouteChildren
6613
+ );
6614
+ const ApiKnowledgeCandidatesRouteChildren = {
6615
+ ApiKnowledgeCandidatesCandidateIdRoute: ApiKnowledgeCandidatesCandidateIdRouteWithChildren
6616
+ };
6537
6617
  const ApiKnowledgeCandidatesRouteWithChildren = ApiKnowledgeCandidatesRoute._addFileChildren(
6538
6618
  ApiKnowledgeCandidatesRouteChildren
6539
6619
  );
@@ -6553,7 +6633,7 @@ const rootRouteChildren = {
6553
6633
  ApiKnowledgeSearchRoute,
6554
6634
  ApiKnowledgeSessionsSessionIdCandidatesRoute
6555
6635
  };
6556
- const routeTree = Route$q._addFileChildren(rootRouteChildren)._addFileTypes();
6636
+ const routeTree = Route$r._addFileChildren(rootRouteChildren)._addFileTypes();
6557
6637
  function getRouter() {
6558
6638
  const router2 = createRouter({
6559
6639
  routeTree,
@@ -6573,15 +6653,17 @@ export {
6573
6653
  MAX_SLOW_RESPONSE_THRESHOLD_SECONDS as M,
6574
6654
  OpenAIRequestSchema as O,
6575
6655
  ProviderTestResultsSchema as P,
6576
- Route$o as R,
6577
- RuntimeConfigSchema as a,
6578
- AnthropicRequestSchema as b,
6579
- safeGetOwnProperty as c,
6580
- createPendingProviderTestResults as d,
6581
- createFailedProviderTestResults as e,
6582
- ProviderConfigSchema as f,
6656
+ Route$p as R,
6657
+ TimeDisplayFormatSchema as T,
6658
+ DEFAULT_TIME_DISPLAY_FORMAT as a,
6659
+ RuntimeConfigSchema as b,
6660
+ AnthropicRequestSchema as c,
6661
+ safeGetOwnProperty as d,
6662
+ createPendingProviderTestResults as e,
6663
+ createFailedProviderTestResults as f,
6583
6664
  getSessionPath as g,
6584
- router as h,
6665
+ ProviderConfigSchema as h,
6666
+ router as i,
6585
6667
  parseOpenAIResponse as p,
6586
6668
  requestFormatForPath as r,
6587
6669
  stripClaudeCodeBillingHeader as s
@@ -0,0 +1,4 @@
1
+ const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/__root.tsx", "children": ["/", "/api/config", "/api/health", "/api/logs", "/api/mcp", "/api/models", "/api/providers", "/api/sessions", "/proxy/$", "/session/$sessionId", "/api/knowledge/candidates", "/api/knowledge/project-context", "/api/knowledge/search", "/api/knowledge/sessions/$sessionId/candidates"], "preloads": ["/assets/main-2NlGzgOe.js"], "assets": [] }, "/": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-B_dffD3u.js", "/assets/ProxyViewerContainer-CbW5VRER.js"] }, "/api/config": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.ts", "children": ["/api/config/paths"] }, "/api/health": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/health.ts" }, "/api/logs": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.ts", "children": ["/api/logs/$id", "/api/logs/stream"] }, "/api/mcp": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/mcp.ts" }, "/api/models": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/models.ts" }, "/api/providers": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.ts", "children": ["/api/providers/$providerId", "/api/providers/export", "/api/providers/import", "/api/providers/scan"] }, "/api/sessions": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/sessions.ts" }, "/proxy/$": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/proxy/$.ts" }, "/session/$sessionId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/session/$sessionId.tsx", "assets": [], "preloads": ["/assets/_sessionId-CcD_aLGq.js", "/assets/ProxyViewerContainer-CbW5VRER.js"] }, "/api/config/paths": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/config.paths.ts" }, "/api/knowledge/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.ts", "children": ["/api/knowledge/candidates/$candidateId"] }, "/api/knowledge/project-context": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.project-context.ts" }, "/api/knowledge/search": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.search.ts" }, "/api/logs/$id": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.ts", "children": ["/api/logs/$id/chunks", "/api/logs/$id/replay"] }, "/api/logs/stream": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.stream.ts" }, "/api/providers/$providerId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.ts", "children": ["/api/providers/$providerId/test"] }, "/api/providers/export": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.export.ts" }, "/api/providers/import": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.import.ts" }, "/api/providers/scan": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.scan.ts" }, "/api/knowledge/candidates/$candidateId": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.ts", "children": ["/api/knowledge/candidates/$candidateId/promote"] }, "/api/logs/$id/chunks": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.chunks.ts" }, "/api/logs/$id/replay": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/logs.$id.replay.ts" }, "/api/providers/$providerId/test": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.ts", "children": ["/api/providers/$providerId/test/log"] }, "/api/knowledge/candidates/$candidateId/promote": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.candidates.$candidateId.promote.ts" }, "/api/knowledge/sessions/$sessionId/candidates": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/knowledge.sessions.$sessionId.candidates.ts" }, "/api/providers/$providerId/test/log": { "filePath": "C:/Users/claw/workspace/agent-inspector/src/routes/api/providers.$providerId.test.log.ts" } }, "clientEntry": "/assets/main-2NlGzgOe.js" });
2
+ export {
3
+ tsrStartManifest
4
+ };