@cartanova/qgrid-cli 2.10.10 → 2.11.0

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 (313) hide show
  1. package/bundle/dist/_virtual/_rolldown/runtime.js +1 -10
  2. package/bundle/dist/application/monit/log-buffer.js +12 -6
  3. package/bundle/dist/application/monit/monit.frame.js +11 -3
  4. package/bundle/dist/application/monit/monit.types.js +1 -1
  5. package/bundle/dist/application/qgrid/conv-routing.js +9 -6
  6. package/bundle/dist/application/qgrid/expired-token-reminder.js +2 -2
  7. package/bundle/dist/application/qgrid/oauth.js +31 -4
  8. package/bundle/dist/application/qgrid/qgrid-image-generation.js +1 -1
  9. package/bundle/dist/application/qgrid/qgrid-response-format.js +21 -19
  10. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +40 -33
  11. package/bundle/dist/application/qgrid/qgrid.dispatcher.js +128 -93
  12. package/bundle/dist/application/qgrid/qgrid.frame.js +930 -49
  13. package/bundle/dist/application/qgrid/qgrid.types.js +212 -5
  14. package/bundle/dist/application/qgrid/schema-prompt.js +75 -48
  15. package/bundle/dist/application/qgrid/slack-user-map.js +1 -1
  16. package/bundle/dist/application/qgrid/token-death.js +1 -1
  17. package/bundle/dist/application/qgrid/token-subscriber.js +83 -30
  18. package/bundle/dist/application/qgrid/token-trigger-setup.js +1 -1
  19. package/bundle/dist/application/qgrid/token-window-keepalive.js +8 -6
  20. package/bundle/dist/application/qgrid/tool-emulation-schema.js +13 -13
  21. package/bundle/dist/application/qgrid/tool-emulation.js +19 -15
  22. package/bundle/dist/application/request-log/json-schema-type-text.js +29 -12
  23. package/bundle/dist/application/request-log/request-log.model.js +83 -70
  24. package/bundle/dist/application/request-log/request-log.types.js +1 -1
  25. package/bundle/dist/application/request-log/zod-code-format.js +1 -1
  26. package/bundle/dist/application/request-log-step/request-log-step.model.js +1 -1
  27. package/bundle/dist/application/request-log-step/request-log-step.types.js +1 -1
  28. package/bundle/dist/application/setting/setting.constant.js +1 -1
  29. package/bundle/dist/application/setting/setting.model.js +2 -2
  30. package/bundle/dist/application/setting/setting.store.js +2 -2
  31. package/bundle/dist/application/setting/setting.types.js +1 -1
  32. package/bundle/dist/application/sonamu.generated.js +32 -16
  33. package/bundle/dist/application/sonamu.generated.sso.js +1 -1
  34. package/bundle/dist/application/token/token.model.js +26 -9
  35. package/bundle/dist/application/token/token.types.js +20 -3
  36. package/bundle/dist/i18n/en.js +15 -1
  37. package/bundle/dist/i18n/ko.js +15 -1
  38. package/bundle/dist/i18n/sd.generated.js +1 -1
  39. package/bundle/dist/migrations/20260807133553_manual__backfill_request_log_cost.js +8 -6
  40. package/bundle/dist/server-bootstrap.js +4 -2
  41. package/bundle/dist/server-error-handler.js +1 -1
  42. package/bundle/dist/sonamu.config.js +37 -8
  43. package/bundle/dist/startup-migrations.js +17 -7
  44. package/bundle/dist/testing/global.js +1 -1
  45. package/bundle/dist/testing/schema-bench.js +0 -0
  46. package/bundle/dist/testing/test-database-name.js +1 -1
  47. package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +1 -1
  48. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +11 -5
  49. package/bundle/dist/utils/providers/anthropic/anthropic-quota.js +4 -4
  50. package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +1 -1
  51. package/bundle/dist/utils/providers/anthropic/claude-session.js +20 -19
  52. package/bundle/dist/utils/providers/anthropic/fence-strip.js +1 -1
  53. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +49 -23
  54. package/bundle/dist/utils/providers/common/credentials.js +5 -1
  55. package/bundle/dist/utils/providers/common/effort.js +3 -3
  56. package/bundle/dist/utils/providers/common/model-cost.js +69 -14
  57. package/bundle/dist/utils/providers/common/provider-types.js +29 -1
  58. package/bundle/dist/utils/providers/common/schema-validation.js +78 -40
  59. package/bundle/dist/utils/providers/common/smooth-weighted-round-robin.js +1 -1
  60. package/bundle/dist/utils/providers/common/strictifier.js +62 -43
  61. package/bundle/dist/utils/providers/common/thinking.js +3 -2
  62. package/bundle/dist/utils/providers/common/ttft.js +1 -1
  63. package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +427 -0
  64. package/bundle/dist/utils/providers/grok/grok-constants.js +55 -0
  65. package/bundle/dist/utils/providers/grok/grok-direct-client.js +196 -0
  66. package/bundle/dist/utils/providers/grok/grok-dispatcher.js +1313 -0
  67. package/bundle/dist/utils/providers/grok/grok-headers.js +118 -0
  68. package/bundle/dist/utils/providers/grok/grok-media-client.js +420 -0
  69. package/bundle/dist/utils/providers/grok/grok-models.js +114 -0
  70. package/bundle/dist/utils/providers/grok/grok-oauth.js +455 -0
  71. package/bundle/dist/utils/providers/grok/grok-quota.js +119 -0
  72. package/bundle/dist/utils/providers/grok/grok-refresh.js +192 -0
  73. package/bundle/dist/utils/providers/grok/grok-types.js +186 -0
  74. package/bundle/dist/utils/providers/grok/grok-voice-client.js +199 -0
  75. package/bundle/dist/utils/providers/grok/index.js +11 -0
  76. package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +111 -83
  77. package/bundle/dist/utils/providers/openai/openai-callback-relay.js +3 -2
  78. package/bundle/dist/utils/providers/openai/openai-constants.js +1 -1
  79. package/bundle/dist/utils/providers/openai/openai-direct-client.js +23 -7
  80. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +143 -106
  81. package/bundle/dist/utils/providers/openai/openai-image-generation.js +48 -33
  82. package/bundle/dist/utils/providers/openai/openai-oauth.js +28 -13
  83. package/bundle/dist/utils/providers/openai/openai-quota.js +38 -27
  84. package/bundle/dist/utils/providers/openai/openai-refresh.js +17 -9
  85. package/bundle/dist/utils/providers/openai/openai-sse.js +1 -1
  86. package/bundle/dist/utils/providers/openai/openai-transport-config.js +1 -1
  87. package/bundle/dist/utils/quiet-hours.js +1 -1
  88. package/bundle/dist/utils/slack-notify.js +14 -8
  89. package/bundle/dist/utils/subset-loaders.js +4 -5
  90. package/bundle/src/application/monit/log-buffer.ts +23 -9
  91. package/bundle/src/application/monit/monit.frame.ts +22 -5
  92. package/bundle/src/application/monit/monit.types.ts +6 -0
  93. package/bundle/src/application/qgrid/conv-routing.test.ts +76 -4
  94. package/bundle/src/application/qgrid/conv-routing.ts +35 -9
  95. package/bundle/src/application/qgrid/expired-token-reminder.ts +9 -1
  96. package/bundle/src/application/qgrid/oauth.ts +51 -15
  97. package/bundle/src/application/qgrid/qgrid-image-generation.ts +9 -0
  98. package/bundle/src/application/qgrid/qgrid-response-format.ts +50 -25
  99. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +19 -0
  100. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +84 -40
  101. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +97 -0
  102. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +274 -126
  103. package/bundle/src/application/qgrid/qgrid.frame.test.ts +1013 -3
  104. package/bundle/src/application/qgrid/qgrid.frame.ts +1415 -60
  105. package/bundle/src/application/qgrid/qgrid.types.ts +335 -0
  106. package/bundle/src/application/qgrid/schema-prompt.ts +105 -41
  107. package/bundle/src/application/qgrid/slack-user-map.ts +5 -0
  108. package/bundle/src/application/qgrid/token-death.ts +4 -0
  109. package/bundle/src/application/qgrid/token-subscriber.test.ts +21 -19
  110. package/bundle/src/application/qgrid/token-subscriber.ts +186 -53
  111. package/bundle/src/application/qgrid/token-trigger-setup.ts +2 -0
  112. package/bundle/src/application/qgrid/token-window-keepalive.ts +49 -6
  113. package/bundle/src/application/qgrid/tool-emulation-schema.ts +33 -29
  114. package/bundle/src/application/qgrid/tool-emulation.ts +52 -27
  115. package/bundle/src/application/request-log/json-schema-type-text.test.ts +5 -5
  116. package/bundle/src/application/request-log/json-schema-type-text.ts +81 -26
  117. package/bundle/src/application/request-log/request-log.model.test.ts +111 -4
  118. package/bundle/src/application/request-log/request-log.model.ts +277 -146
  119. package/bundle/src/application/request-log/request-log.types.ts +6 -0
  120. package/bundle/src/application/request-log/zod-code-format.ts +11 -0
  121. package/bundle/src/application/request-log-step/request-log-step.model.ts +1 -0
  122. package/bundle/src/application/request-log-step/request-log-step.types.ts +2 -0
  123. package/bundle/src/application/setting/setting.constant.ts +9 -0
  124. package/bundle/src/application/setting/setting.model.ts +12 -2
  125. package/bundle/src/application/setting/setting.store.ts +5 -1
  126. package/bundle/src/application/setting/setting.types.ts +8 -0
  127. package/bundle/src/application/sonamu.generated.http +133 -0
  128. package/bundle/src/application/sonamu.generated.sso.ts +2 -0
  129. package/bundle/src/application/sonamu.generated.ts +15 -0
  130. package/bundle/src/application/token/token.identity.test.ts +20 -0
  131. package/bundle/src/application/token/token.model.ts +66 -7
  132. package/bundle/src/application/token/token.types.ts +24 -1
  133. package/bundle/src/i18n/en.ts +19 -0
  134. package/bundle/src/i18n/ko.ts +21 -0
  135. package/bundle/src/i18n/sd.generated.ts +23 -2
  136. package/bundle/src/migrations/20260807133553_manual__backfill_request_log_cost.ts +16 -8
  137. package/bundle/src/server-bootstrap.ts +4 -2
  138. package/bundle/src/server-error-handler.ts +1 -0
  139. package/bundle/src/sonamu.config.ts +69 -7
  140. package/bundle/src/startup-migrations.ts +27 -9
  141. package/bundle/src/testing/global.ts +20 -0
  142. package/bundle/src/testing/schema-bench.ts +105 -30
  143. package/bundle/src/testing/test-database-name.ts +2 -0
  144. package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +8 -0
  145. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +41 -6
  146. package/bundle/src/utils/providers/anthropic/anthropic-quota.ts +7 -3
  147. package/bundle/src/utils/providers/anthropic/anthropic-thinking.ts +6 -0
  148. package/bundle/src/utils/providers/anthropic/claude-session.ts +58 -24
  149. package/bundle/src/utils/providers/anthropic/fence-strip.ts +11 -0
  150. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +110 -45
  151. package/bundle/src/utils/providers/common/credentials.ts +8 -0
  152. package/bundle/src/utils/providers/common/effort.ts +9 -2
  153. package/bundle/src/utils/providers/common/model-cost.test.ts +48 -1
  154. package/bundle/src/utils/providers/common/model-cost.ts +259 -158
  155. package/bundle/src/utils/providers/common/provider-dispatcher.ts +98 -2
  156. package/bundle/src/utils/providers/common/provider-types.ts +46 -3
  157. package/bundle/src/utils/providers/common/schema-validation.test.ts +5 -1
  158. package/bundle/src/utils/providers/common/schema-validation.ts +124 -56
  159. package/bundle/src/utils/providers/common/smooth-weighted-round-robin.ts +4 -0
  160. package/bundle/src/utils/providers/common/strictifier.ts +185 -59
  161. package/bundle/src/utils/providers/common/thinking.ts +2 -2
  162. package/bundle/src/utils/providers/common/ttft.ts +4 -2
  163. package/bundle/src/utils/providers/grok/__fixtures__/golden-responses-1.0.60.json +164 -0
  164. package/bundle/src/utils/providers/grok/grok-backend-protocol.test.ts +325 -0
  165. package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +721 -0
  166. package/bundle/src/utils/providers/grok/grok-constants.ts +105 -0
  167. package/bundle/src/utils/providers/grok/grok-direct-client.test.ts +179 -0
  168. package/bundle/src/utils/providers/grok/grok-direct-client.ts +313 -0
  169. package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +1395 -0
  170. package/bundle/src/utils/providers/grok/grok-dispatcher.ts +2105 -0
  171. package/bundle/src/utils/providers/grok/grok-headers.test.ts +149 -0
  172. package/bundle/src/utils/providers/grok/grok-headers.ts +199 -0
  173. package/bundle/src/utils/providers/grok/grok-media-client.test.ts +446 -0
  174. package/bundle/src/utils/providers/grok/grok-media-client.ts +703 -0
  175. package/bundle/src/utils/providers/grok/grok-models.test.ts +96 -0
  176. package/bundle/src/utils/providers/grok/grok-models.ts +161 -0
  177. package/bundle/src/utils/providers/grok/grok-oauth.test.ts +406 -0
  178. package/bundle/src/utils/providers/grok/grok-oauth.ts +771 -0
  179. package/bundle/src/utils/providers/grok/grok-quota.test.ts +142 -0
  180. package/bundle/src/utils/providers/grok/grok-quota.ts +198 -0
  181. package/bundle/src/utils/providers/grok/grok-refresh.test.ts +239 -0
  182. package/bundle/src/utils/providers/grok/grok-refresh.ts +325 -0
  183. package/bundle/src/utils/providers/grok/grok-types.test.ts +252 -0
  184. package/bundle/src/utils/providers/grok/grok-types.ts +374 -0
  185. package/bundle/src/utils/providers/grok/grok-voice-client.test.ts +321 -0
  186. package/bundle/src/utils/providers/grok/grok-voice-client.ts +284 -0
  187. package/bundle/src/utils/providers/grok/index.ts +20 -0
  188. package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +221 -137
  189. package/bundle/src/utils/providers/openai/openai-callback-relay.ts +12 -1
  190. package/bundle/src/utils/providers/openai/openai-constants.ts +2 -0
  191. package/bundle/src/utils/providers/openai/openai-direct-client.ts +111 -21
  192. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +322 -169
  193. package/bundle/src/utils/providers/openai/openai-image-generation.ts +116 -36
  194. package/bundle/src/utils/providers/openai/openai-oauth.ts +48 -20
  195. package/bundle/src/utils/providers/openai/openai-quota.ts +77 -46
  196. package/bundle/src/utils/providers/openai/openai-refresh.ts +42 -18
  197. package/bundle/src/utils/providers/openai/openai-sse.ts +27 -3
  198. package/bundle/src/utils/providers/openai/openai-transport-config.ts +2 -0
  199. package/bundle/src/utils/quiet-hours.ts +12 -1
  200. package/bundle/src/utils/slack-notify.ts +44 -13
  201. package/bundle/src/utils/subset-loaders.ts +7 -7
  202. package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +1 -0
  203. package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +31 -0
  204. package/bundle/web-dist/client/assets/index-Be2qCZmI.css +1 -0
  205. package/bundle/web-dist/client/assets/logs-C47OJGEI.js +1 -0
  206. package/bundle/web-dist/client/assets/monit-BS9no0dU.js +4 -0
  207. package/bundle/web-dist/client/assets/plus-sdACTfH0.js +1 -0
  208. package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +1 -0
  209. package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +1 -0
  210. package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +5 -0
  211. package/bundle/web-dist/client/assets/{services.generated-NP-ValHd.js → services.generated-CefiDXEv.js} +5 -5
  212. package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +1 -0
  213. package/bundle/web-dist/client/assets/show-u8Np69q3.js +2 -0
  214. package/bundle/web-dist/client/assets/tokens-QvP410NW.js +1 -0
  215. package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +1 -0
  216. package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +1 -0
  217. package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +1 -0
  218. package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +244 -0
  219. package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +1 -0
  220. package/bundle/web-dist/client/index.html +6 -6
  221. package/bundle/web-dist/server/assets/clsx-D_N5PN_2.js +16 -0
  222. package/bundle/web-dist/server/assets/{lazyRouteComponent-CgBdabgd.js → lazyRouteComponent-D8iTIHyn.js} +129 -2
  223. package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +825 -0
  224. package/bundle/web-dist/server/assets/{monit-ZPt66W5M.js → monit-B2hqorPe.js} +385 -126
  225. package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +28 -0
  226. package/bundle/web-dist/server/assets/{react-dom-Ds75e4Jl.js → react-dom-BIYQzBqG.js} +2 -129
  227. package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +44 -0
  228. package/bundle/web-dist/server/assets/{request-model-DjGldb-h.js → request-model-I6OdODSH.js} +15 -6
  229. package/bundle/web-dist/server/assets/{routes-Ct-k7nBA.js → routes-B95YlUv2.js} +760 -213
  230. package/bundle/web-dist/server/assets/{services.generated-BA4AcAf5.js → services.generated-DQATJ6qf.js} +12820 -12194
  231. package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +830 -0
  232. package/bundle/web-dist/server/assets/{show-LSFIzvO2.js → show-Bxaj3rhH.js} +1350 -418
  233. package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +1038 -0
  234. package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +18 -0
  235. package/bundle/web-dist/server/assets/use-oauth-login-flow-CKDHgc3U.js +2379 -0
  236. package/bundle/web-dist/server/assets/{use-update-token-mutation-pkArIzCP.js → use-update-token-mutation-BEbgOzaa.js} +1 -1
  237. package/bundle/web-dist/server/entry-server.generated.js +4295 -22810
  238. package/dist/cli.js +9 -9
  239. package/package.json +4 -11
  240. package/postinstall.mjs +12 -0
  241. package/skills/qgrid/SKILL.md +1 -0
  242. package/skills/qgrid/references/cli-env-and-server-boot.md +4 -1
  243. package/skills/qgrid/references/decision-rationale.md +23 -0
  244. package/skills/qgrid/references/grok-runtime.md +89 -0
  245. package/skills/qgrid/references/provider-runtime-differences.md +30 -29
  246. package/skills/qgrid/references/repo-map.md +10 -0
  247. package/skills/qgrid/references/token-auth-quota-lifecycle.md +56 -3
  248. package/bundle/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -406
  249. package/bundle/dist/node_modules/.pnpm/@vitest_expect@4.1.10/node_modules/@vitest/expect/dist/index.js +0 -1507
  250. package/bundle/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js +0 -887
  251. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/chunk-artifact.js +0 -2756
  252. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/index.js +0 -8
  253. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/utils.js +0 -8
  254. package/bundle/dist/node_modules/.pnpm/@vitest_snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.js +0 -922
  255. package/bundle/dist/node_modules/.pnpm/@vitest_spy@4.1.10/node_modules/@vitest/spy/dist/index.js +0 -386
  256. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +0 -121
  257. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/constants.js +0 -51
  258. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/diff.js +0 -1317
  259. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js +0 -561
  260. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js +0 -40
  261. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js +0 -272
  262. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/offset.js +0 -27
  263. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/serialize.js +0 -77
  264. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/source-map.js +0 -381
  265. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/timers.js +0 -51
  266. package/bundle/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.js +0 -2986
  267. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.js +0 -10
  268. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.js +0 -109
  269. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.js +0 -10
  270. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.js +0 -10
  271. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.js +0 -10
  272. package/bundle/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1126
  273. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
  274. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -432
  275. package/bundle/dist/node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js +0 -517
  276. package/bundle/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js +0 -101
  277. package/bundle/dist/node_modules/.pnpm/vite@8.0.3_@emnapi_core@1.11.2_@emnapi_runtime@1.11.2_@types_node@25.0.7_esbuild@0.27.4_5b35fc1fb85d2af4d105e0d74f940f50/node_modules/vite/dist/node/module-runner.js +0 -1265
  278. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/_commonjsHelpers.D26ty3Ew.js +0 -9
  279. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/benchmark.CX_oY03V.js +0 -41
  280. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/evaluatedModules.Dg1zASAC.js +0 -19
  281. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.Chj8NDwU.js +0 -202
  282. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/index.DdgEv5B1.js +0 -46
  283. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/rpc.MzXet3jl.js +0 -119
  284. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/test.DNmyFkvJ.js +0 -3044
  285. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/chunks/utils.BX5Fg8C4.js +0 -59
  286. package/bundle/dist/node_modules/.pnpm/vitest@4.1.10_@opentelemetry_api@1.9.0_@types_node@25.0.7_@vitest_coverage-v8@4.1.10_vi_a1977b93af7bb69308bcb1dbab39b618/node_modules/vitest/dist/index.js +0 -28
  287. package/bundle/dist/testing/setup-mocks.js +0 -16
  288. package/bundle/src/testing/setup-mocks.ts +0 -44
  289. package/bundle/web-dist/client/assets/index-Bw2s88Ot.css +0 -1
  290. package/bundle/web-dist/client/assets/index-DZwzUfI-.js +0 -106
  291. package/bundle/web-dist/client/assets/logs-Cog79DU5.js +0 -1
  292. package/bundle/web-dist/client/assets/monit-2auznBys.js +0 -1
  293. package/bundle/web-dist/client/assets/plus-B62CuqT8.js +0 -1
  294. package/bundle/web-dist/client/assets/refresh-cw-NNcU0Cmq.js +0 -1
  295. package/bundle/web-dist/client/assets/request-model-CojtinqK.js +0 -1
  296. package/bundle/web-dist/client/assets/routes-B0lTeLK-.js +0 -5
  297. package/bundle/web-dist/client/assets/settings-D8ZxZGSJ.js +0 -1
  298. package/bundle/web-dist/client/assets/show-CFSERlnM.js +0 -2
  299. package/bundle/web-dist/client/assets/tokens-CZXUyI7O.js +0 -1
  300. package/bundle/web-dist/client/assets/use-oauth-login-flow-hboOs3wG.js +0 -1
  301. package/bundle/web-dist/client/assets/use-update-token-mutation-BQHS0byG.js +0 -1
  302. package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
  303. package/bundle/web-dist/client/assets/vendor-tanstack-DJRQAbrY.js +0 -1
  304. package/bundle/web-dist/server/assets/logs-BMyR98rU.js +0 -509
  305. package/bundle/web-dist/server/assets/plus-BZ9I0VgC.js +0 -19
  306. package/bundle/web-dist/server/assets/refresh-cw-CztCFis-.js +0 -23
  307. package/bundle/web-dist/server/assets/settings-CBUZ47Xx.js +0 -461
  308. package/bundle/web-dist/server/assets/tokens-DxrBW512.js +0 -448
  309. package/bundle/web-dist/server/assets/use-oauth-login-flow-Gn8flMK5.js +0 -178
  310. package/dist/cli.d.ts +0 -10
  311. /package/bundle/web-dist/client/assets/{cost-DH2jZbrw.js → cost-DB3HbU7T.js} +0 -0
  312. /package/bundle/web-dist/client/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
  313. /package/bundle/web-dist/server/assets/{cost-eEHeTRT5.js → cost-BC9yzyA9.js} +0 -0
@@ -1,8 +1,8 @@
1
- import { A as require_react, E as useQuery, X as __toESM, i as RequestLogStepService, k as require_jsx_runtime, l as isSonamuError, q as __commonJSMin, r as RequestLogService } from "./services.generated-BA4AcAf5.js";
2
- import { a as Link } from "./lazyRouteComponent-CgBdabgd.js";
3
- import { c as lucideX, d as Markdown, t as Route, u as remarkGfm } from "../entry-server.generated.js";
4
- import { n as formatMicroUsd, t as cacheHitRate } from "./cost-eEHeTRT5.js";
5
- import { n as lucideZap, t as requestModelDisplay } from "./request-model-DjGldb-h.js";
1
+ import { C as number, E as union, F as require_react, P as require_jsx_runtime, Q as __commonJSMin, S as looseObject, T as string, b as json, h as array, i as RequestLogStepService, j as useQuery, k as require_jsx_dev_runtime, l as isSonamuError, r as RequestLogService, tt as __toESM, w as object } from "./services.generated-DQATJ6qf.js";
2
+ import { a as Link } from "./lazyRouteComponent-D8iTIHyn.js";
3
+ import { c as remarkGfm, l as Markdown, o as lucideX, t as Route } from "../entry-server.generated.js";
4
+ import { n as formatMicroUsd, t as cacheHitRate } from "./cost-BC9yzyA9.js";
5
+ import { n as lucideZap, t as requestModelDisplay } from "./request-model-I6OdODSH.js";
6
6
  //#region ../../node_modules/.pnpm/@babel+runtime@7.29.2/node_modules/@babel/runtime/helpers/extends.js
7
7
  var require_extends = /* @__PURE__ */ __commonJSMin(((exports, module) => {
8
8
  function _extends() {
@@ -1835,90 +1835,141 @@ var lightTheme = {
1835
1835
  };
1836
1836
  //#endregion
1837
1837
  //#region ~icons/lucide/arrow-left.jsx
1838
- var lucideArrowLeft = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1838
+ var import_jsx_dev_runtime = require_jsx_dev_runtime();
1839
+ var _jsxFileName$4 = "~icons/lucide/arrow-left.jsx";
1840
+ var lucideArrowLeft = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
1839
1841
  viewBox: "0 0 24 24",
1840
1842
  width: "1.2em",
1841
1843
  height: "1.2em",
1842
1844
  ...props,
1843
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1845
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
1844
1846
  fill: "none",
1845
1847
  stroke: "currentColor",
1846
1848
  strokeLinecap: "round",
1847
1849
  strokeLinejoin: "round",
1848
1850
  strokeWidth: 2,
1849
1851
  d: "m12 19l-7-7l7-7m7 7H5"
1850
- })
1851
- });
1852
+ }, void 0, false, {
1853
+ fileName: _jsxFileName$4,
1854
+ lineNumber: 2,
1855
+ columnNumber: 99
1856
+ }, void 0)
1857
+ }, void 0, false, {
1858
+ fileName: _jsxFileName$4,
1859
+ lineNumber: 2,
1860
+ columnNumber: 34
1861
+ }, void 0);
1852
1862
  //#endregion
1853
1863
  //#region ~icons/lucide/check.jsx
1854
- var lucideCheck = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1864
+ var _jsxFileName$3 = "~icons/lucide/check.jsx";
1865
+ var lucideCheck = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
1855
1866
  viewBox: "0 0 24 24",
1856
1867
  width: "1.2em",
1857
1868
  height: "1.2em",
1858
1869
  ...props,
1859
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1870
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
1860
1871
  fill: "none",
1861
1872
  stroke: "currentColor",
1862
1873
  strokeLinecap: "round",
1863
1874
  strokeLinejoin: "round",
1864
1875
  strokeWidth: 2,
1865
1876
  d: "M20 6L9 17l-5-5"
1866
- })
1867
- });
1877
+ }, void 0, false, {
1878
+ fileName: _jsxFileName$3,
1879
+ lineNumber: 2,
1880
+ columnNumber: 95
1881
+ }, void 0)
1882
+ }, void 0, false, {
1883
+ fileName: _jsxFileName$3,
1884
+ lineNumber: 2,
1885
+ columnNumber: 30
1886
+ }, void 0);
1868
1887
  //#endregion
1869
1888
  //#region ~icons/lucide/chevron-down.jsx
1870
- var lucideChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1889
+ var _jsxFileName$2 = "~icons/lucide/chevron-down.jsx";
1890
+ var lucideChevronDown = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
1871
1891
  viewBox: "0 0 24 24",
1872
1892
  width: "1.2em",
1873
1893
  height: "1.2em",
1874
1894
  ...props,
1875
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", {
1895
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
1876
1896
  fill: "none",
1877
1897
  stroke: "currentColor",
1878
1898
  strokeLinecap: "round",
1879
1899
  strokeLinejoin: "round",
1880
1900
  strokeWidth: 2,
1881
1901
  d: "m6 9l6 6l6-6"
1882
- })
1883
- });
1902
+ }, void 0, false, {
1903
+ fileName: _jsxFileName$2,
1904
+ lineNumber: 2,
1905
+ columnNumber: 101
1906
+ }, void 0)
1907
+ }, void 0, false, {
1908
+ fileName: _jsxFileName$2,
1909
+ lineNumber: 2,
1910
+ columnNumber: 36
1911
+ }, void 0);
1884
1912
  //#endregion
1885
1913
  //#region ~icons/lucide/copy.jsx
1886
- var lucideCopy = (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("svg", {
1914
+ var _jsxFileName$1 = "~icons/lucide/copy.jsx";
1915
+ var lucideCopy = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
1887
1916
  viewBox: "0 0 24 24",
1888
1917
  width: "1.2em",
1889
1918
  height: "1.2em",
1890
1919
  ...props,
1891
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("g", {
1920
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("g", {
1892
1921
  fill: "none",
1893
1922
  stroke: "currentColor",
1894
1923
  strokeLinecap: "round",
1895
1924
  strokeLinejoin: "round",
1896
1925
  strokeWidth: 2,
1897
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("rect", {
1926
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("rect", {
1898
1927
  width: 14,
1899
1928
  height: 14,
1900
1929
  x: 8,
1901
1930
  y: 8,
1902
1931
  rx: 2,
1903
1932
  ry: 2
1904
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })]
1905
- })
1906
- });
1933
+ }, void 0, false, {
1934
+ fileName: _jsxFileName$1,
1935
+ lineNumber: 2,
1936
+ columnNumber: 192
1937
+ }, void 0), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" }, void 0, false, {
1938
+ fileName: _jsxFileName$1,
1939
+ lineNumber: 2,
1940
+ columnNumber: 249
1941
+ }, void 0)]
1942
+ }, void 0, true, {
1943
+ fileName: _jsxFileName$1,
1944
+ lineNumber: 2,
1945
+ columnNumber: 94
1946
+ }, void 0)
1947
+ }, void 0, false, {
1948
+ fileName: _jsxFileName$1,
1949
+ lineNumber: 2,
1950
+ columnNumber: 29
1951
+ }, void 0);
1907
1952
  //#endregion
1908
1953
  //#region src/routes/requests/show.tsx?tsr-split=component
1954
+ var _jsxFileName = "/home/runner/work/qgrid/qgrid/packages/web/src/routes/requests/show.tsx?tsr-split=component";
1909
1955
  function RequestShowPage() {
1910
1956
  const { id } = Route.useSearch();
1911
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RequestDetail, { id });
1957
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(RequestDetail, { id }, void 0, false, {
1958
+ fileName: _jsxFileName,
1959
+ lineNumber: 28,
1960
+ columnNumber: 10
1961
+ }, this);
1912
1962
  }
1913
1963
  function formatNum(n) {
1914
1964
  return n.toLocaleString();
1915
1965
  }
1916
1966
  var TOKENS_PER_SEC_PROVIDERS = /* @__PURE__ */ new Set();
1967
+ var JsonValue = json();
1917
1968
  function tryParseJson(text) {
1918
1969
  try {
1919
1970
  return {
1920
1971
  ok: true,
1921
- value: JSON.parse(text)
1972
+ value: JsonValue.parse(JSON.parse(text))
1922
1973
  };
1923
1974
  } catch {
1924
1975
  return { ok: false };
@@ -1927,7 +1978,7 @@ function tryParseJson(text) {
1927
1978
  function safeParseJson(text) {
1928
1979
  if (!text) return {};
1929
1980
  try {
1930
- return JSON.parse(text);
1981
+ return JsonValue.parse(JSON.parse(text));
1931
1982
  } catch {
1932
1983
  return text;
1933
1984
  }
@@ -1943,12 +1994,24 @@ function CopyButton({ text, dark }) {
1943
1994
  navigator.clipboard.writeText(text);
1944
1995
  setCopied(true);
1945
1996
  };
1946
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
1997
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
1947
1998
  type: "button",
1948
1999
  className: `absolute top-2 right-2 p-1 rounded transition-colors ${dark ? "text-sand-500 hover:text-sand-300" : "text-sand-400 hover:text-sand-600"}`,
1949
2000
  onClick: handleCopy,
1950
- children: copied ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCheck, { className: "size-3.5 text-sage-500" }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideCopy, { className: "size-3.5" })
1951
- });
2001
+ children: copied ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideCheck, { className: "size-3.5 text-sage-500" }, void 0, false, {
2002
+ fileName: _jsxFileName,
2003
+ lineNumber: 82,
2004
+ columnNumber: 17
2005
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideCopy, { className: "size-3.5" }, void 0, false, {
2006
+ fileName: _jsxFileName,
2007
+ lineNumber: 82,
2008
+ columnNumber: 68
2009
+ }, this)
2010
+ }, void 0, false, {
2011
+ fileName: _jsxFileName,
2012
+ lineNumber: 81,
2013
+ columnNumber: 10
2014
+ }, this);
1952
2015
  }
1953
2016
  var DATA_IMAGE_TAG_RE = /<img\s+[^>]*src=["'](data:image\/[^"']+;base64,[^"']+)["'][^>]*(?:alt=["']([^"']*)["'][^>]*)?\/?>/gi;
1954
2017
  function parseImageSegments(text) {
@@ -1976,94 +2039,178 @@ function parseImageSegments(text) {
1976
2039
  function ImageAwareContent({ text, markdown }) {
1977
2040
  const [viewerSrc, setViewerSrc] = (0, import_react.useState)(null);
1978
2041
  const segments = parseImageSegments(text);
1979
- if (!segments.some((segment) => segment.type === "image")) return markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2042
+ if (!segments.some((segment) => segment.type === "image")) return markdown ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
1980
2043
  className: "prose prose-sm prose-qgrid max-w-none",
1981
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
2044
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Markdown, {
1982
2045
  remarkPlugins: [remarkGfm],
1983
2046
  children: text
1984
- })
1985
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2047
+ }, void 0, false, {
2048
+ fileName: _jsxFileName,
2049
+ lineNumber: 128,
2050
+ columnNumber: 9
2051
+ }, this)
2052
+ }, void 0, false, {
2053
+ fileName: _jsxFileName,
2054
+ lineNumber: 127,
2055
+ columnNumber: 23
2056
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
1986
2057
  className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
1987
2058
  children: text
1988
- });
1989
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2059
+ }, void 0, false, {
2060
+ fileName: _jsxFileName,
2061
+ lineNumber: 129,
2062
+ columnNumber: 16
2063
+ }, this);
2064
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
1990
2065
  className: "space-y-3",
1991
- children: [segments.map((segment, index) => segment.type === "text" ? markdown ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2066
+ children: [segments.map((segment, index) => segment.type === "text" ? markdown ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
1992
2067
  className: "prose prose-sm prose-qgrid max-w-none",
1993
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Markdown, {
2068
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Markdown, {
1994
2069
  remarkPlugins: [remarkGfm],
1995
2070
  children: segment.text
1996
- })
1997
- }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2071
+ }, void 0, false, {
2072
+ fileName: _jsxFileName,
2073
+ lineNumber: 135,
2074
+ columnNumber: 15
2075
+ }, this)
2076
+ }, `text-${index}`, false, {
2077
+ fileName: _jsxFileName,
2078
+ lineNumber: 134,
2079
+ columnNumber: 78
2080
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
1998
2081
  className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
1999
2082
  children: segment.text
2000
- }, `text-${index}`) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2083
+ }, `text-${index}`, false, {
2084
+ fileName: _jsxFileName,
2085
+ lineNumber: 136,
2086
+ columnNumber: 22
2087
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2001
2088
  type: "button",
2002
2089
  className: "block max-w-full rounded-md border border-sand-200 overflow-hidden bg-white hover:border-sienna-300 transition-colors",
2003
2090
  onClick: () => setViewerSrc(segment.src),
2004
2091
  title: "Open image",
2005
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2092
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("img", {
2006
2093
  src: segment.src,
2007
2094
  alt: segment.alt,
2008
2095
  className: "max-h-[520px] max-w-full object-contain",
2009
2096
  loading: "lazy"
2010
- })
2011
- }, `image-${index}`)), viewerSrc && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2097
+ }, void 0, false, {
2098
+ fileName: _jsxFileName,
2099
+ lineNumber: 139,
2100
+ columnNumber: 13
2101
+ }, this)
2102
+ }, `image-${index}`, false, {
2103
+ fileName: _jsxFileName,
2104
+ lineNumber: 138,
2105
+ columnNumber: 22
2106
+ }, this)), viewerSrc && /* @__PURE__ */ (void 0)("div", {
2012
2107
  className: "fixed inset-0 z-50 bg-black/70 p-4 flex items-center justify-center",
2013
2108
  onClick: () => setViewerSrc(null),
2014
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2109
+ children: [/* @__PURE__ */ (void 0)("button", {
2015
2110
  type: "button",
2016
2111
  className: "absolute top-4 right-4 p-2 rounded-full bg-white/90 text-sand-700 hover:bg-white",
2017
2112
  onClick: () => setViewerSrc(null),
2018
2113
  title: "Close image",
2019
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideX, { className: "size-5" })
2020
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2114
+ children: /* @__PURE__ */ (void 0)(lucideX, { className: "size-5" }, void 0, false, {
2115
+ fileName: _jsxFileName,
2116
+ lineNumber: 143,
2117
+ columnNumber: 13
2118
+ }, this)
2119
+ }, void 0, false, {
2120
+ fileName: _jsxFileName,
2121
+ lineNumber: 142,
2122
+ columnNumber: 11
2123
+ }, this), /* @__PURE__ */ (void 0)("img", {
2021
2124
  src: viewerSrc,
2022
2125
  alt: "generated preview",
2023
2126
  className: "max-h-full max-w-full object-contain rounded-md bg-white",
2024
2127
  onClick: (e) => e.stopPropagation()
2025
- })]
2026
- })]
2027
- });
2128
+ }, void 0, false, {
2129
+ fileName: _jsxFileName,
2130
+ lineNumber: 145,
2131
+ columnNumber: 11
2132
+ }, this)]
2133
+ }, void 0, true, {
2134
+ fileName: _jsxFileName,
2135
+ lineNumber: 141,
2136
+ columnNumber: 21
2137
+ }, this)]
2138
+ }, void 0, true, {
2139
+ fileName: _jsxFileName,
2140
+ lineNumber: 133,
2141
+ columnNumber: 10
2142
+ }, this);
2028
2143
  }
2029
2144
  function FormattedContent({ text, markdown }) {
2030
2145
  const parsed = tryParseJson(text);
2031
2146
  const [mode, setMode] = (0, import_react.useState)("pretty");
2032
- const canRenderJsonView = parsed.ok && parsed.value !== null && (Array.isArray(parsed.value) || typeof parsed.value === "object");
2033
- if (!parsed.ok || !canRenderJsonView) {
2034
- if (markdown) return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, {
2147
+ const jsonContainer = parsed.ok && parsed.value instanceof Object ? parsed.value : null;
2148
+ if (!parsed.ok || jsonContainer === null) {
2149
+ if (markdown) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ImageAwareContent, {
2035
2150
  text,
2036
2151
  markdown: true
2037
- });
2038
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ImageAwareContent, { text: parsed.ok ? JSON.stringify(parsed.value, null, 2) : text });
2152
+ }, void 0, false, {
2153
+ fileName: _jsxFileName,
2154
+ lineNumber: 163,
2155
+ columnNumber: 14
2156
+ }, this);
2157
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ImageAwareContent, { text: parsed.ok ? JSON.stringify(parsed.value, null, 2) : text }, void 0, false, {
2158
+ fileName: _jsxFileName,
2159
+ lineNumber: 165,
2160
+ columnNumber: 12
2161
+ }, this);
2039
2162
  }
2040
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2163
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2041
2164
  className: "flex gap-1 mb-2",
2042
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2165
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2043
2166
  type: "button",
2044
2167
  className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "plain" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
2045
2168
  onClick: () => setMode("plain"),
2046
2169
  children: "Plain"
2047
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
2170
+ }, void 0, false, {
2171
+ fileName: _jsxFileName,
2172
+ lineNumber: 169,
2173
+ columnNumber: 9
2174
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2048
2175
  type: "button",
2049
2176
  className: `px-2 py-0.5 text-[10px] rounded-md transition-colors ${mode === "pretty" ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600"}`,
2050
2177
  onClick: () => setMode("pretty"),
2051
2178
  children: "Pretty"
2052
- })]
2053
- }), mode === "pretty" ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(JsonView, {
2054
- value: parsed.value,
2179
+ }, void 0, false, {
2180
+ fileName: _jsxFileName,
2181
+ lineNumber: 172,
2182
+ columnNumber: 9
2183
+ }, this)]
2184
+ }, void 0, true, {
2185
+ fileName: _jsxFileName,
2186
+ lineNumber: 168,
2187
+ columnNumber: 7
2188
+ }, this), mode === "pretty" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(JsonView, {
2189
+ value: jsonContainer,
2055
2190
  style: lightTheme,
2056
2191
  displayDataTypes: false,
2057
2192
  enableClipboard: true,
2058
2193
  collapsed: false
2059
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2194
+ }, void 0, false, {
2195
+ fileName: _jsxFileName,
2196
+ lineNumber: 176,
2197
+ columnNumber: 28
2198
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
2060
2199
  className: "text-sm text-sand-800 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed",
2061
2200
  children: JSON.stringify(parsed.value, null, 2)
2062
- })] });
2201
+ }, void 0, false, {
2202
+ fileName: _jsxFileName,
2203
+ lineNumber: 176,
2204
+ columnNumber: 143
2205
+ }, this)] }, void 0, true, {
2206
+ fileName: _jsxFileName,
2207
+ lineNumber: 167,
2208
+ columnNumber: 10
2209
+ }, this);
2063
2210
  }
2064
2211
  function Section({ title, defaultOpen = true, headerMetadata, onOpenChange, children }) {
2065
2212
  const [open, setOpen] = (0, import_react.useState)(defaultOpen);
2066
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2213
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("details", {
2067
2214
  open,
2068
2215
  className: "group panel overflow-hidden",
2069
2216
  onToggle: (event) => {
@@ -2071,60 +2218,116 @@ function Section({ title, defaultOpen = true, headerMetadata, onOpenChange, chil
2071
2218
  setOpen(nextOpen);
2072
2219
  onOpenChange?.(nextOpen);
2073
2220
  },
2074
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2221
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("summary", {
2075
2222
  className: "panel-header flex min-w-0 items-center gap-1.5 whitespace-nowrap cursor-pointer select-none list-none px-4 py-2.5",
2076
2223
  children: [
2077
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90" }),
2078
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2224
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideChevronDown, { className: "size-3.5 shrink-0 text-sand-400 transition-transform group-open:rotate-0 -rotate-90" }, void 0, false, {
2225
+ fileName: _jsxFileName,
2226
+ lineNumber: 201,
2227
+ columnNumber: 9
2228
+ }, this),
2229
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2079
2230
  className: "shrink-0 text-[11px] uppercase tracking-wider text-sand-500 font-medium",
2080
2231
  children: title
2081
- }),
2082
- headerMetadata && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2232
+ }, void 0, false, {
2233
+ fileName: _jsxFileName,
2234
+ lineNumber: 202,
2235
+ columnNumber: 9
2236
+ }, this),
2237
+ headerMetadata && /* @__PURE__ */ (void 0)("span", {
2083
2238
  className: "flex min-w-0 flex-1 items-center gap-1.5 overflow-hidden whitespace-nowrap text-[11px] normal-case text-sand-400",
2084
2239
  children: headerMetadata
2085
- })
2240
+ }, void 0, false, {
2241
+ fileName: _jsxFileName,
2242
+ lineNumber: 205,
2243
+ columnNumber: 28
2244
+ }, this)
2086
2245
  ]
2087
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2246
+ }, void 0, true, {
2247
+ fileName: _jsxFileName,
2248
+ lineNumber: 200,
2249
+ columnNumber: 7
2250
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2088
2251
  className: "p-4",
2089
2252
  children
2090
- })]
2091
- });
2253
+ }, void 0, false, {
2254
+ fileName: _jsxFileName,
2255
+ lineNumber: 209,
2256
+ columnNumber: 7
2257
+ }, this)]
2258
+ }, void 0, true, {
2259
+ fileName: _jsxFileName,
2260
+ lineNumber: 195,
2261
+ columnNumber: 10
2262
+ }, this);
2092
2263
  }
2093
2264
  function Metric({ label, value }) {
2094
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2265
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2095
2266
  className: "min-w-0",
2096
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("dt", {
2267
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("dt", {
2097
2268
  className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate",
2098
2269
  children: label
2099
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("dd", {
2270
+ }, void 0, false, {
2271
+ fileName: _jsxFileName,
2272
+ lineNumber: 220,
2273
+ columnNumber: 7
2274
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("dd", {
2100
2275
  className: "text-[15px] font-semibold text-sand-800 tabular-nums mt-0.5 truncate",
2101
2276
  children: value
2102
- })]
2103
- });
2277
+ }, void 0, false, {
2278
+ fileName: _jsxFileName,
2279
+ lineNumber: 223,
2280
+ columnNumber: 7
2281
+ }, this)]
2282
+ }, void 0, true, {
2283
+ fileName: _jsxFileName,
2284
+ lineNumber: 219,
2285
+ columnNumber: 10
2286
+ }, this);
2104
2287
  }
2105
- var STATUS_STYLE = {
2106
- running: "bg-blue-100 text-blue-600",
2107
- succeeded: "bg-sage-100 text-sage-600",
2108
- error: "bg-red-100 text-red-600",
2109
- aborted: "bg-caution-400/15 text-caution-500"
2110
- };
2288
+ var STATUS_STYLE = new Map([
2289
+ ["running", "bg-blue-100 text-blue-600"],
2290
+ ["succeeded", "bg-sage-100 text-sage-600"],
2291
+ ["error", "bg-red-100 text-red-600"],
2292
+ ["aborted", "bg-caution-400/15 text-caution-500"]
2293
+ ]);
2111
2294
  function ErrorPanel({ message }) {
2112
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2295
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2113
2296
  className: "panel overflow-hidden border border-red-200 bg-red-50/60",
2114
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2297
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2115
2298
  className: "px-4 py-2.5 border-b border-red-100 flex items-center gap-1.5",
2116
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2299
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2117
2300
  className: "text-[11px] uppercase tracking-wider text-red-600 font-medium",
2118
2301
  children: "Error"
2119
- })
2120
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2302
+ }, void 0, false, {
2303
+ fileName: _jsxFileName,
2304
+ lineNumber: 236,
2305
+ columnNumber: 9
2306
+ }, this)
2307
+ }, void 0, false, {
2308
+ fileName: _jsxFileName,
2309
+ lineNumber: 235,
2310
+ columnNumber: 7
2311
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2121
2312
  className: "p-4",
2122
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2313
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
2123
2314
  className: "text-[12px] text-red-700 whitespace-pre-wrap break-words font-mono leading-relaxed max-h-80 overflow-auto",
2124
2315
  children: message
2125
- })
2126
- })]
2127
- });
2316
+ }, void 0, false, {
2317
+ fileName: _jsxFileName,
2318
+ lineNumber: 239,
2319
+ columnNumber: 9
2320
+ }, this)
2321
+ }, void 0, false, {
2322
+ fileName: _jsxFileName,
2323
+ lineNumber: 238,
2324
+ columnNumber: 7
2325
+ }, this)]
2326
+ }, void 0, true, {
2327
+ fileName: _jsxFileName,
2328
+ lineNumber: 234,
2329
+ columnNumber: 10
2330
+ }, this);
2128
2331
  }
2129
2332
  function HeaderBar({ data }) {
2130
2333
  const isRunning = data.status === "running";
@@ -2135,120 +2338,241 @@ function HeaderBar({ data }) {
2135
2338
  imageCostMethod: data.image_cost_method
2136
2339
  });
2137
2340
  const hasRequestedOnly = !isRunning && data.requested_model_name !== null && data.model_name === null;
2138
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2341
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2139
2342
  className: "panel overflow-hidden px-4 py-3 flex flex-wrap items-center gap-x-2 gap-y-1.5 sm:px-5",
2140
2343
  children: [
2141
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2344
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2142
2345
  className: "text-[15px] font-semibold text-sand-900 break-all",
2143
2346
  children: modelDisplay.label === "—" ? "Unknown model" : modelDisplay.label
2144
- }),
2145
- hasRequestedOnly && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2347
+ }, void 0, false, {
2348
+ fileName: _jsxFileName,
2349
+ lineNumber: 261,
2350
+ columnNumber: 7
2351
+ }, this),
2352
+ hasRequestedOnly && /* @__PURE__ */ (void 0)("span", {
2146
2353
  className: "text-[10px] text-sand-400",
2147
2354
  children: "요청"
2148
- }),
2149
- data.service_tier === "fast" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2355
+ }, void 0, false, {
2356
+ fileName: _jsxFileName,
2357
+ lineNumber: 264,
2358
+ columnNumber: 28
2359
+ }, this),
2360
+ data.service_tier === "fast" && /* @__PURE__ */ (void 0)("span", {
2150
2361
  title: "Fast 모드",
2151
2362
  className: "inline-flex shrink-0",
2152
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideZap, {
2363
+ children: /* @__PURE__ */ (void 0)(lucideZap, {
2153
2364
  "aria-label": "Fast 모드",
2154
2365
  className: "size-3.5 text-[#1877F2] [&_path]:fill-current"
2155
- })
2156
- }),
2157
- !isRunning && (data.fallback_count ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2366
+ }, void 0, false, {
2367
+ fileName: _jsxFileName,
2368
+ lineNumber: 266,
2369
+ columnNumber: 11
2370
+ }, this)
2371
+ }, void 0, false, {
2372
+ fileName: _jsxFileName,
2373
+ lineNumber: 265,
2374
+ columnNumber: 40
2375
+ }, this),
2376
+ !isRunning && (data.fallback_count ?? 0) > 0 && /* @__PURE__ */ (void 0)("span", {
2158
2377
  className: "text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase",
2159
2378
  children: ["fallback ×", data.fallback_count]
2160
- }),
2161
- !isRunning && data.status !== "succeeded" && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2162
- className: `text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${STATUS_STYLE[data.status] ?? "bg-sand-100 text-sand-500"}`,
2379
+ }, void 0, true, {
2380
+ fileName: _jsxFileName,
2381
+ lineNumber: 268,
2382
+ columnNumber: 56
2383
+ }, this),
2384
+ !isRunning && data.status !== "succeeded" && /* @__PURE__ */ (void 0)("span", {
2385
+ className: `text-[10px] px-1.5 py-0.5 rounded-full font-medium uppercase ${STATUS_STYLE.get(data.status) ?? "bg-sand-100 text-sand-500"}`,
2163
2386
  children: data.status
2164
- }),
2165
- data.response_json_ok === false && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2387
+ }, void 0, false, {
2388
+ fileName: _jsxFileName,
2389
+ lineNumber: 271,
2390
+ columnNumber: 53
2391
+ }, this),
2392
+ data.response_json_ok === false && /* @__PURE__ */ (void 0)("span", {
2166
2393
  title: "structured 요청의 응답이 JSON 파싱에 실패했습니다",
2167
2394
  className: "text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase",
2168
2395
  children: "broken json"
2169
- }),
2170
- data.effort && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2396
+ }, void 0, false, {
2397
+ fileName: _jsxFileName,
2398
+ lineNumber: 274,
2399
+ columnNumber: 43
2400
+ }, this),
2401
+ data.effort && /* @__PURE__ */ (void 0)("span", {
2171
2402
  className: "text-[11px] px-1.5 py-0.5 rounded-md bg-sand-100 text-sand-500 font-mono",
2172
2403
  children: ["effort=", data.effort]
2173
- }),
2174
- data.project_name && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2404
+ }, void 0, true, {
2405
+ fileName: _jsxFileName,
2406
+ lineNumber: 277,
2407
+ columnNumber: 23
2408
+ }, this),
2409
+ data.project_name && /* @__PURE__ */ (void 0)("span", {
2175
2410
  className: "text-[12px] text-sand-400",
2176
2411
  children: ["· project=", data.project_name]
2177
- }),
2178
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2412
+ }, void 0, true, {
2413
+ fileName: _jsxFileName,
2414
+ lineNumber: 280,
2415
+ columnNumber: 29
2416
+ }, this),
2417
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2179
2418
  className: "ml-auto text-[11px] text-sand-400",
2180
2419
  children: data.token_name
2181
- })
2420
+ }, void 0, false, {
2421
+ fileName: _jsxFileName,
2422
+ lineNumber: 281,
2423
+ columnNumber: 7
2424
+ }, this)
2182
2425
  ]
2183
- });
2426
+ }, void 0, true, {
2427
+ fileName: _jsxFileName,
2428
+ lineNumber: 260,
2429
+ columnNumber: 5
2430
+ }, this);
2184
2431
  }
2185
2432
  function MetricsPanel({ data, toolCallCount }) {
2186
2433
  const tokensPerSecEnabled = isTokensPerSecEnabled(data);
2187
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2434
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2188
2435
  className: "panel overflow-hidden px-5 py-3 space-y-3",
2189
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2436
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2190
2437
  className: "grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3",
2191
2438
  children: [
2192
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2439
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2193
2440
  label: "Duration",
2194
2441
  value: `${(data.duration_ms / 1e3).toFixed(1)}s`
2195
- }),
2196
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2442
+ }, void 0, false, {
2443
+ fileName: _jsxFileName,
2444
+ lineNumber: 295,
2445
+ columnNumber: 9
2446
+ }, this),
2447
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2197
2448
  label: "TTFT",
2198
2449
  value: formatRunTtftMs(data.ttft_ms)
2199
- }),
2200
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2450
+ }, void 0, false, {
2451
+ fileName: _jsxFileName,
2452
+ lineNumber: 296,
2453
+ columnNumber: 9
2454
+ }, this),
2455
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2201
2456
  label: "Tokens/sec",
2202
2457
  value: formatTokensPerSec(data.output_tokens, data.duration_ms, data.ttft_ms, tokensPerSecEnabled)
2203
- }),
2204
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2458
+ }, void 0, false, {
2459
+ fileName: _jsxFileName,
2460
+ lineNumber: 297,
2461
+ columnNumber: 9
2462
+ }, this),
2463
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2205
2464
  label: "Driver",
2206
2465
  value: data.cost_usd !== null ? formatMicroUsd(data.cost_usd) : "—"
2207
- }),
2208
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2466
+ }, void 0, false, {
2467
+ fileName: _jsxFileName,
2468
+ lineNumber: 298,
2469
+ columnNumber: 9
2470
+ }, this),
2471
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2209
2472
  label: "Image",
2210
2473
  value: data.image_cost_usd !== null ? formatMicroUsd(data.image_cost_usd) : "—"
2211
- }),
2212
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2474
+ }, void 0, false, {
2475
+ fileName: _jsxFileName,
2476
+ lineNumber: 299,
2477
+ columnNumber: 9
2478
+ }, this),
2479
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2213
2480
  label: "Tool Calls",
2214
2481
  value: `${toolCallCount}회`
2215
- })
2482
+ }, void 0, false, {
2483
+ fileName: _jsxFileName,
2484
+ lineNumber: 300,
2485
+ columnNumber: 9
2486
+ }, this)
2216
2487
  ]
2217
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2488
+ }, void 0, true, {
2489
+ fileName: _jsxFileName,
2490
+ lineNumber: 294,
2491
+ columnNumber: 7
2492
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2218
2493
  className: "border-t border-sand-100/60 pt-3 grid grid-cols-2 sm:grid-cols-3 lg:grid-cols-5 gap-x-6 gap-y-3",
2219
2494
  children: [
2220
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2495
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2221
2496
  label: "Input",
2222
2497
  value: formatNum(data.input_tokens)
2223
- }),
2224
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2498
+ }, void 0, false, {
2499
+ fileName: _jsxFileName,
2500
+ lineNumber: 303,
2501
+ columnNumber: 9
2502
+ }, this),
2503
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2225
2504
  label: "Output",
2226
2505
  value: formatNum(data.output_tokens)
2227
- }),
2228
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2506
+ }, void 0, false, {
2507
+ fileName: _jsxFileName,
2508
+ lineNumber: 304,
2509
+ columnNumber: 9
2510
+ }, this),
2511
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2229
2512
  label: "Cache Read",
2230
2513
  value: formatNum(data.cache_read_tokens)
2231
- }),
2232
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2514
+ }, void 0, false, {
2515
+ fileName: _jsxFileName,
2516
+ lineNumber: 305,
2517
+ columnNumber: 9
2518
+ }, this),
2519
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2233
2520
  label: "Cache Write",
2234
2521
  value: formatNum(data.cache_creation_tokens)
2235
- }),
2236
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2522
+ }, void 0, false, {
2523
+ fileName: _jsxFileName,
2524
+ lineNumber: 306,
2525
+ columnNumber: 9
2526
+ }, this),
2527
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2237
2528
  label: "Cache Write (5m)",
2238
2529
  value: data.cache_creation_5m_tokens === null ? "—" : formatNum(data.cache_creation_5m_tokens)
2239
- }),
2240
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2530
+ }, void 0, false, {
2531
+ fileName: _jsxFileName,
2532
+ lineNumber: 307,
2533
+ columnNumber: 9
2534
+ }, this),
2535
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2241
2536
  label: "Cache Write (1h)",
2242
2537
  value: data.cache_creation_1h_tokens === null ? "—" : formatNum(data.cache_creation_1h_tokens)
2243
- }),
2244
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Metric, {
2538
+ }, void 0, false, {
2539
+ fileName: _jsxFileName,
2540
+ lineNumber: 308,
2541
+ columnNumber: 9
2542
+ }, this),
2543
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Metric, {
2245
2544
  label: "Cache Hit",
2246
2545
  value: cacheHitRate(data)
2247
- })
2546
+ }, void 0, false, {
2547
+ fileName: _jsxFileName,
2548
+ lineNumber: 309,
2549
+ columnNumber: 9
2550
+ }, this)
2248
2551
  ]
2249
- })]
2250
- });
2552
+ }, void 0, true, {
2553
+ fileName: _jsxFileName,
2554
+ lineNumber: 302,
2555
+ columnNumber: 7
2556
+ }, this)]
2557
+ }, void 0, true, {
2558
+ fileName: _jsxFileName,
2559
+ lineNumber: 293,
2560
+ columnNumber: 10
2561
+ }, this);
2251
2562
  }
2563
+ var ToolInputImage = object({
2564
+ mediaType: string().optional(),
2565
+ data: string().optional(),
2566
+ url: string().optional(),
2567
+ byteSize: number().optional()
2568
+ });
2569
+ var ToolInputArgs = looseObject({ inputImages: array(JsonValue) });
2570
+ var MaskableToolInputImage = looseObject({
2571
+ mediaType: JsonValue.optional(),
2572
+ byteSize: JsonValue.optional(),
2573
+ url: JsonValue.optional(),
2574
+ data: JsonValue.optional()
2575
+ });
2252
2576
  function formatDurationMs(ms) {
2253
2577
  if (ms === null || ms === void 0) return "—";
2254
2578
  return ms >= 1e3 ? `${(ms / 1e3).toFixed(1)}s` : `${ms}ms`;
@@ -2263,10 +2587,12 @@ function detectTokenRateProvider(source) {
2263
2587
  const canonical = modelName.includes("/") ? modelName.split("/").pop() : modelName;
2264
2588
  if (canonical.startsWith("claude-")) return "anthropic";
2265
2589
  if (/^(gpt-|codex-|o\d)/.test(canonical)) return "openai";
2590
+ if (canonical.startsWith("grok-")) return "grok";
2266
2591
  }
2267
2592
  const tokenName = source.token_name?.trim().toLowerCase();
2268
2593
  if (tokenName?.startsWith("anthropic/")) return "anthropic";
2269
2594
  if (tokenName?.startsWith("openai/")) return "openai";
2595
+ if (tokenName?.startsWith("grok/")) return "grok";
2270
2596
  return null;
2271
2597
  }
2272
2598
  function isTokensPerSecEnabled(source) {
@@ -2280,47 +2606,60 @@ function formatTokensPerSec(outputTokens, durationMs, ttftMs, enabled) {
2280
2606
  return `${Math.round(outputTokens / (generationMs / 1e3)).toLocaleString()} tok/s`;
2281
2607
  }
2282
2608
  function CompactMetric({ label, value }) {
2283
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2609
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2284
2610
  className: "min-w-0 self-end",
2285
- children: [label && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2611
+ children: [label && /* @__PURE__ */ (void 0)("div", {
2286
2612
  className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium truncate",
2287
2613
  children: label
2288
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2614
+ }, void 0, false, {
2615
+ fileName: _jsxFileName,
2616
+ lineNumber: 419,
2617
+ columnNumber: 17
2618
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2289
2619
  className: "mt-0.5 text-[13px] font-semibold text-sand-800 tabular-nums truncate",
2290
2620
  children: value
2291
- })]
2292
- });
2293
- }
2294
- function readToolInputImages(args) {
2295
- if (!args || typeof args !== "object" || Array.isArray(args)) return [];
2296
- const inputImages = args.inputImages;
2297
- return Array.isArray(inputImages) ? inputImages : void 0;
2621
+ }, void 0, false, {
2622
+ fileName: _jsxFileName,
2623
+ lineNumber: 422,
2624
+ columnNumber: 7
2625
+ }, this)]
2626
+ }, void 0, true, {
2627
+ fileName: _jsxFileName,
2628
+ lineNumber: 418,
2629
+ columnNumber: 5
2630
+ }, this);
2298
2631
  }
2299
2632
  function getToolInputImages(args) {
2300
- return (readToolInputImages(args) ?? []).filter((item) => {
2301
- if (!item || typeof item !== "object" || Array.isArray(item)) return false;
2302
- const image = item;
2303
- return typeof image.url === "string" && image.url.length > 0 || typeof image.data === "string" && image.data.length > 0;
2633
+ const parsedArgs = ToolInputArgs.safeParse(args);
2634
+ if (!parsedArgs.success) return [];
2635
+ return parsedArgs.data.inputImages.flatMap((item) => {
2636
+ const image = ToolInputImage.safeParse(item);
2637
+ return image.success && (image.data.url || image.data.data) ? [image.data] : [];
2304
2638
  });
2305
2639
  }
2640
+ function maskToolInputImage(item) {
2641
+ const parsed = MaskableToolInputImage.safeParse(item);
2642
+ if (!parsed.success) return item;
2643
+ const image = parsed.data;
2644
+ const masked = {};
2645
+ if (image.mediaType !== void 0) masked.mediaType = image.mediaType;
2646
+ if (image.byteSize !== void 0) masked.byteSize = image.byteSize;
2647
+ const url = string().safeParse(image.url);
2648
+ const maskedUrl = url.success && url.data.toLowerCase().startsWith("data:") ? `[data-url ${url.data.length} chars]` : image.url;
2649
+ if (maskedUrl) masked.url = maskedUrl;
2650
+ if (image.data) {
2651
+ const data = string().safeParse(image.data);
2652
+ masked.data = data.success ? `[base64 ${data.data.length} chars]` : "[base64 data]";
2653
+ }
2654
+ return masked;
2655
+ }
2656
+ /** Returns the value passed to JSON.stringify for display; undefined fields are omitted there. */
2306
2657
  function hideToolInputImages(args) {
2307
- if (!args || typeof args !== "object" || Array.isArray(args)) return args;
2308
- const record = args;
2309
- const inputImages = readToolInputImages(record);
2310
- if (!inputImages) return args;
2658
+ const parsedArgs = ToolInputArgs.safeParse(args);
2659
+ if (!parsedArgs.success || !(args instanceof Object) || Array.isArray(args)) return args;
2311
2660
  return {
2312
- ...record,
2313
- inputImages: inputImages.map((item) => {
2314
- if (!item || typeof item !== "object" || Array.isArray(item)) return item;
2315
- const image = item;
2316
- const maskedUrl = typeof image.url === "string" && image.url.toLowerCase().startsWith("data:") ? `[data-url ${image.url.length} chars]` : image.url;
2317
- return {
2318
- mediaType: image.mediaType,
2319
- byteSize: image.byteSize,
2320
- ...maskedUrl ? { url: maskedUrl } : {},
2321
- ...image.data ? { data: `[base64 ${image.data.length} chars]` } : {}
2322
- };
2323
- })
2661
+ ...args,
2662
+ inputImages: parsedArgs.data.inputImages.map(maskToolInputImage)
2324
2663
  };
2325
2664
  }
2326
2665
  function ToolInputImages({ images }) {
@@ -2335,20 +2674,28 @@ function ToolInputImages({ images }) {
2335
2674
  } : null;
2336
2675
  }).filter((item) => item !== null);
2337
2676
  if (renderableImages.length === 0) return null;
2338
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2677
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2339
2678
  className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2340
2679
  children: "Input Images"
2341
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2680
+ }, void 0, false, {
2681
+ fileName: _jsxFileName,
2682
+ lineNumber: 483,
2683
+ columnNumber: 7
2684
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2342
2685
  className: "mt-1 grid grid-cols-1 sm:grid-cols-2 gap-2",
2343
2686
  children: renderableImages.map(({ image, index, src }) => {
2344
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2687
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2345
2688
  className: "rounded-md border border-sand-200 bg-white overflow-hidden",
2346
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("img", {
2689
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("img", {
2347
2690
  src,
2348
2691
  alt: `reference ${index + 1}`,
2349
2692
  className: "max-h-64 w-full object-contain bg-white",
2350
2693
  loading: "lazy"
2351
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2694
+ }, void 0, false, {
2695
+ fileName: _jsxFileName,
2696
+ lineNumber: 493,
2697
+ columnNumber: 15
2698
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2352
2699
  className: "px-2 py-1 text-[10px] text-sand-500 font-mono border-t border-sand-100",
2353
2700
  children: [
2354
2701
  image.mediaType ?? "image",
@@ -2356,15 +2703,35 @@ function ToolInputImages({ images }) {
2356
2703
  " ",
2357
2704
  image.byteSize !== void 0 ? `${image.byteSize.toLocaleString()} bytes` : "url"
2358
2705
  ]
2359
- })]
2360
- }, `${image.mediaType ?? "image"}-${index}`);
2706
+ }, void 0, true, {
2707
+ fileName: _jsxFileName,
2708
+ lineNumber: 494,
2709
+ columnNumber: 15
2710
+ }, this)]
2711
+ }, `${image.mediaType ?? "image"}-${index}`, true, {
2712
+ fileName: _jsxFileName,
2713
+ lineNumber: 492,
2714
+ columnNumber: 16
2715
+ }, this);
2361
2716
  })
2362
- })] });
2717
+ }, void 0, false, {
2718
+ fileName: _jsxFileName,
2719
+ lineNumber: 486,
2720
+ columnNumber: 7
2721
+ }, this)] }, void 0, true, {
2722
+ fileName: _jsxFileName,
2723
+ lineNumber: 482,
2724
+ columnNumber: 10
2725
+ }, this);
2363
2726
  }
2364
2727
  function RequestInputImages({ images, stepId }) {
2365
2728
  const { data: detail } = RequestLogStepService.useRequestLogStep("I", stepId ?? 0, { enabled: images === null && stepId !== null });
2366
2729
  const args = detail ? safeParseJson(detail.tool_args) : null;
2367
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolInputImages, { images: images ?? getToolInputImages(args) });
2730
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ToolInputImages, { images: images ?? getToolInputImages(args) }, void 0, false, {
2731
+ fileName: _jsxFileName,
2732
+ lineNumber: 518,
2733
+ columnNumber: 10
2734
+ }, this);
2368
2735
  }
2369
2736
  function ToolCallItem({ entry }) {
2370
2737
  const hasError = !!entry.error;
@@ -2372,200 +2739,430 @@ function ToolCallItem({ entry }) {
2372
2739
  const { data: detail } = RequestLogStepService.useRequestLogStep("A", entry.id, { enabled: opened });
2373
2740
  const displayArgs = hideToolInputImages(detail ? safeParseJson(detail.tool_args) : null);
2374
2741
  const result = detail ? safeParseJson(detail.tool_result) : null;
2742
+ const resultText = string().safeParse(result);
2743
+ const responseText = resultText.success ? resultText.data : JSON.stringify(result);
2375
2744
  const error = detail?.error ?? entry.error;
2376
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2745
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("details", {
2377
2746
  className: "group/tool",
2378
2747
  onToggle: (e) => setOpened(e.currentTarget.open),
2379
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2748
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("summary", {
2380
2749
  className: "flex items-center gap-2 px-3 py-2 cursor-pointer select-none list-none hover:bg-sand-50 transition-colors rounded-md",
2381
2750
  children: [
2382
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0" }),
2383
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2751
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/tool:rotate-0 -rotate-90 shrink-0" }, void 0, false, {
2752
+ fileName: _jsxFileName,
2753
+ lineNumber: 540,
2754
+ columnNumber: 9
2755
+ }, this),
2756
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2384
2757
  className: "text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0",
2385
2758
  children: ["call ", entry.callIndex + 1]
2386
- }),
2387
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2759
+ }, void 0, true, {
2760
+ fileName: _jsxFileName,
2761
+ lineNumber: 541,
2762
+ columnNumber: 9
2763
+ }, this),
2764
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2388
2765
  className: "text-[13px] font-medium text-sand-800 font-mono truncate",
2389
2766
  children: entry.toolName
2390
- }),
2391
- hasError && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2767
+ }, void 0, false, {
2768
+ fileName: _jsxFileName,
2769
+ lineNumber: 544,
2770
+ columnNumber: 9
2771
+ }, this),
2772
+ hasError && /* @__PURE__ */ (void 0)("span", {
2392
2773
  className: "text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0",
2393
2774
  children: "error"
2394
- }),
2395
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2775
+ }, void 0, false, {
2776
+ fileName: _jsxFileName,
2777
+ lineNumber: 547,
2778
+ columnNumber: 22
2779
+ }, this),
2780
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2396
2781
  className: "ml-auto text-[11px] text-sand-400 tabular-nums shrink-0",
2397
2782
  children: formatDurationMs(entry.durationMs)
2398
- })
2783
+ }, void 0, false, {
2784
+ fileName: _jsxFileName,
2785
+ lineNumber: 550,
2786
+ columnNumber: 9
2787
+ }, this)
2399
2788
  ]
2400
- }), opened && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2789
+ }, void 0, true, {
2790
+ fileName: _jsxFileName,
2791
+ lineNumber: 539,
2792
+ columnNumber: 7
2793
+ }, this), opened && /* @__PURE__ */ (void 0)("div", {
2401
2794
  className: "mt-1 mx-1 mb-3 space-y-2",
2402
2795
  children: [
2403
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2796
+ /* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("span", {
2404
2797
  className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2405
2798
  children: "Request"
2406
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2799
+ }, void 0, false, {
2800
+ fileName: _jsxFileName,
2801
+ lineNumber: 556,
2802
+ columnNumber: 13
2803
+ }, this), /* @__PURE__ */ (void 0)("div", {
2407
2804
  className: "mt-1 rounded-md bg-sand-50 p-3 overflow-auto",
2408
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, { text: detail ? JSON.stringify(displayArgs) : "Loading..." })
2409
- })] }),
2410
- error && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2805
+ children: /* @__PURE__ */ (void 0)(FormattedContent, { text: detail ? JSON.stringify(displayArgs) : "Loading..." }, void 0, false, {
2806
+ fileName: _jsxFileName,
2807
+ lineNumber: 560,
2808
+ columnNumber: 15
2809
+ }, this)
2810
+ }, void 0, false, {
2811
+ fileName: _jsxFileName,
2812
+ lineNumber: 559,
2813
+ columnNumber: 13
2814
+ }, this)] }, void 0, true, {
2815
+ fileName: _jsxFileName,
2816
+ lineNumber: 555,
2817
+ columnNumber: 11
2818
+ }, this),
2819
+ error && /* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("span", {
2411
2820
  className: "text-[10px] uppercase tracking-wider text-red-500 font-medium px-2",
2412
2821
  children: "Error"
2413
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2822
+ }, void 0, false, {
2823
+ fileName: _jsxFileName,
2824
+ lineNumber: 564,
2825
+ columnNumber: 15
2826
+ }, this), /* @__PURE__ */ (void 0)("div", {
2414
2827
  className: "mt-1 rounded-md bg-red-50 border border-red-100 p-3 overflow-auto",
2415
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, { text: error })
2416
- })] }),
2417
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2828
+ children: /* @__PURE__ */ (void 0)(FormattedContent, { text: error }, void 0, false, {
2829
+ fileName: _jsxFileName,
2830
+ lineNumber: 568,
2831
+ columnNumber: 17
2832
+ }, this)
2833
+ }, void 0, false, {
2834
+ fileName: _jsxFileName,
2835
+ lineNumber: 567,
2836
+ columnNumber: 15
2837
+ }, this)] }, void 0, true, {
2838
+ fileName: _jsxFileName,
2839
+ lineNumber: 563,
2840
+ columnNumber: 21
2841
+ }, this),
2842
+ /* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("span", {
2418
2843
  className: "text-[10px] uppercase tracking-wider text-sand-400 font-medium px-2",
2419
2844
  children: "Response"
2420
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2845
+ }, void 0, false, {
2846
+ fileName: _jsxFileName,
2847
+ lineNumber: 572,
2848
+ columnNumber: 13
2849
+ }, this), /* @__PURE__ */ (void 0)("div", {
2421
2850
  className: "mt-1 rounded-md bg-sand-50 p-3 overflow-auto",
2422
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2423
- text: detail ? typeof result === "string" ? result : JSON.stringify(result) : "Loading...",
2851
+ children: /* @__PURE__ */ (void 0)(FormattedContent, {
2852
+ text: detail ? responseText : "Loading...",
2424
2853
  markdown: true
2425
- })
2426
- })] })
2854
+ }, void 0, false, {
2855
+ fileName: _jsxFileName,
2856
+ lineNumber: 576,
2857
+ columnNumber: 15
2858
+ }, this)
2859
+ }, void 0, false, {
2860
+ fileName: _jsxFileName,
2861
+ lineNumber: 575,
2862
+ columnNumber: 13
2863
+ }, this)] }, void 0, true, {
2864
+ fileName: _jsxFileName,
2865
+ lineNumber: 571,
2866
+ columnNumber: 11
2867
+ }, this)
2427
2868
  ]
2428
- })]
2429
- });
2869
+ }, void 0, true, {
2870
+ fileName: _jsxFileName,
2871
+ lineNumber: 554,
2872
+ columnNumber: 18
2873
+ }, this)]
2874
+ }, void 0, true, {
2875
+ fileName: _jsxFileName,
2876
+ lineNumber: 538,
2877
+ columnNumber: 10
2878
+ }, this);
2430
2879
  }
2431
2880
  function ReasoningBlock({ stepId }) {
2432
2881
  const [opened, setOpened] = (0, import_react.useState)(false);
2433
2882
  const { data: detail } = RequestLogStepService.useRequestLogStep("A", stepId, { enabled: opened });
2434
2883
  const reasoningText = detail?.reasoning_text ?? null;
2435
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2884
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("details", {
2436
2885
  className: "group/reason mt-3",
2437
2886
  onToggle: (e) => setOpened(e.currentTarget.open),
2438
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2887
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("summary", {
2439
2888
  className: "flex items-center gap-2 cursor-pointer select-none list-none",
2440
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2889
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideChevronDown, { className: "size-3 text-sand-400 transition-transform group-open/reason:rotate-0 -rotate-90 shrink-0" }, void 0, false, {
2890
+ fileName: _jsxFileName,
2891
+ lineNumber: 596,
2892
+ columnNumber: 9
2893
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2441
2894
  className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
2442
2895
  children: "Reasoning"
2443
- })]
2444
- }), opened && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2896
+ }, void 0, false, {
2897
+ fileName: _jsxFileName,
2898
+ lineNumber: 597,
2899
+ columnNumber: 9
2900
+ }, this)]
2901
+ }, void 0, true, {
2902
+ fileName: _jsxFileName,
2903
+ lineNumber: 595,
2904
+ columnNumber: 7
2905
+ }, this), opened && /* @__PURE__ */ (void 0)("div", {
2445
2906
  className: "mt-2 rounded-md bg-white/70 border border-sand-100 p-3 overflow-auto",
2446
- children: reasoningText ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
2907
+ children: reasoningText ? /* @__PURE__ */ (void 0)(FormattedContent, {
2447
2908
  text: reasoningText,
2448
2909
  markdown: true
2449
- }) : !detail ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2910
+ }, void 0, false, {
2911
+ fileName: _jsxFileName,
2912
+ lineNumber: 602,
2913
+ columnNumber: 28
2914
+ }, this) : !detail ? /* @__PURE__ */ (void 0)("p", {
2450
2915
  className: "text-sm text-sand-400",
2451
2916
  children: "Loading..."
2452
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
2917
+ }, void 0, false, {
2918
+ fileName: _jsxFileName,
2919
+ lineNumber: 602,
2920
+ columnNumber: 91
2921
+ }, this) : /* @__PURE__ */ (void 0)("p", {
2453
2922
  className: "text-sm text-sand-400",
2454
2923
  children: "No reasoning text captured."
2455
- })
2456
- })]
2457
- });
2924
+ }, void 0, false, {
2925
+ fileName: _jsxFileName,
2926
+ lineNumber: 602,
2927
+ columnNumber: 145
2928
+ }, this)
2929
+ }, void 0, false, {
2930
+ fileName: _jsxFileName,
2931
+ lineNumber: 601,
2932
+ columnNumber: 18
2933
+ }, this)]
2934
+ }, void 0, true, {
2935
+ fileName: _jsxFileName,
2936
+ lineNumber: 594,
2937
+ columnNumber: 10
2938
+ }, this);
2458
2939
  }
2459
2940
  function StepTreeItem({ entry, tokensPerSecEnabled }) {
2460
2941
  const generate = entry.generate;
2461
2942
  const hasReasoning = generate !== null && generate.reasoningTokens !== null && generate.reasoningTokens !== void 0 && generate.reasoningTokens > 0;
2462
2943
  const errorCount = entry.toolCalls.filter((toolCall) => toolCall.error).length;
2463
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("details", {
2944
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("details", {
2464
2945
  open: true,
2465
2946
  className: "group/step border-l border-sand-200 pl-3",
2466
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("summary", {
2947
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("summary", {
2467
2948
  className: "flex items-center gap-2 py-2 cursor-pointer select-none list-none",
2468
2949
  children: [
2469
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideChevronDown, { className: "size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0" }),
2470
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2950
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideChevronDown, { className: "size-3.5 text-sand-400 transition-transform group-open/step:rotate-0 -rotate-90 shrink-0" }, void 0, false, {
2951
+ fileName: _jsxFileName,
2952
+ lineNumber: 618,
2953
+ columnNumber: 9
2954
+ }, this),
2955
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2471
2956
  className: "text-[10px] px-1.5 py-0.5 rounded bg-sienna-100 text-sienna-700 font-mono shrink-0",
2472
2957
  children: ["step ", entry.stepIndex + 1]
2473
- }),
2474
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2958
+ }, void 0, true, {
2959
+ fileName: _jsxFileName,
2960
+ lineNumber: 619,
2961
+ columnNumber: 9
2962
+ }, this),
2963
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2475
2964
  className: "text-[13px] font-semibold text-sand-900",
2476
2965
  children: "LLM call"
2477
- }),
2478
- generate?.finishReason && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2966
+ }, void 0, false, {
2967
+ fileName: _jsxFileName,
2968
+ lineNumber: 622,
2969
+ columnNumber: 9
2970
+ }, this),
2971
+ generate?.finishReason && /* @__PURE__ */ (void 0)("span", {
2479
2972
  className: "text-[10px] px-1.5 py-0.5 rounded bg-sand-100 text-sand-500 font-mono shrink-0",
2480
2973
  children: generate.finishReason
2481
- }),
2482
- generate && (generate.fallbackCount ?? 0) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2974
+ }, void 0, false, {
2975
+ fileName: _jsxFileName,
2976
+ lineNumber: 623,
2977
+ columnNumber: 36
2978
+ }, this),
2979
+ generate && (generate.fallbackCount ?? 0) > 0 && /* @__PURE__ */ (void 0)("span", {
2483
2980
  className: "text-[10px] px-1.5 py-0.5 rounded-full bg-caution-400/15 text-caution-500 font-medium uppercase shrink-0",
2484
2981
  children: [
2485
2982
  generate.requestedModelName,
2486
2983
  " → ",
2487
2984
  generate.modelName
2488
2985
  ]
2489
- }),
2490
- hasReasoning && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
2986
+ }, void 0, true, {
2987
+ fileName: _jsxFileName,
2988
+ lineNumber: 626,
2989
+ columnNumber: 59
2990
+ }, this),
2991
+ hasReasoning && /* @__PURE__ */ (void 0)("span", {
2491
2992
  className: "text-[10px] px-1.5 py-0.5 rounded bg-blue-100 text-blue-600 font-medium shrink-0",
2492
2993
  children: "reasoning"
2493
- }),
2494
- errorCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
2994
+ }, void 0, false, {
2995
+ fileName: _jsxFileName,
2996
+ lineNumber: 629,
2997
+ columnNumber: 26
2998
+ }, this),
2999
+ errorCount > 0 && /* @__PURE__ */ (void 0)("span", {
2495
3000
  className: "text-[10px] px-1.5 py-0.5 rounded-full bg-red-100 text-red-600 font-medium uppercase shrink-0",
2496
3001
  children: [errorCount, " error"]
2497
- }),
2498
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3002
+ }, void 0, true, {
3003
+ fileName: _jsxFileName,
3004
+ lineNumber: 632,
3005
+ columnNumber: 28
3006
+ }, this),
3007
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2499
3008
  className: "ml-auto text-[11px] text-sand-400 tabular-nums shrink-0",
2500
3009
  children: [entry.toolCalls.length, " tools"]
2501
- })
3010
+ }, void 0, true, {
3011
+ fileName: _jsxFileName,
3012
+ lineNumber: 635,
3013
+ columnNumber: 9
3014
+ }, this)
2502
3015
  ]
2503
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3016
+ }, void 0, true, {
3017
+ fileName: _jsxFileName,
3018
+ lineNumber: 617,
3019
+ columnNumber: 7
3020
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2504
3021
  className: "ml-4 mb-4 space-y-3",
2505
- children: [generate && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3022
+ children: [generate && /* @__PURE__ */ (void 0)("div", {
2506
3023
  className: "rounded-md border border-sand-100 bg-sand-50/70 p-3",
2507
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3024
+ children: [/* @__PURE__ */ (void 0)("div", {
2508
3025
  className: "grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 xl:grid-cols-8 gap-x-4 gap-y-3",
2509
3026
  children: [
2510
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3027
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2511
3028
  label: "Duration",
2512
3029
  value: formatDurationMs(generate.durationMs)
2513
- }),
2514
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3030
+ }, void 0, false, {
3031
+ fileName: _jsxFileName,
3032
+ lineNumber: 643,
3033
+ columnNumber: 15
3034
+ }, this),
3035
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2515
3036
  label: "TTFT",
2516
3037
  value: formatRunTtftMs(generate.ttftMs)
2517
- }),
2518
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3038
+ }, void 0, false, {
3039
+ fileName: _jsxFileName,
3040
+ lineNumber: 644,
3041
+ columnNumber: 15
3042
+ }, this),
3043
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2519
3044
  label: "Tokens/sec",
2520
3045
  value: formatTokensPerSec(generate.outputTokens, generate.durationMs, generate.ttftMs, tokensPerSecEnabled)
2521
- }),
2522
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3046
+ }, void 0, false, {
3047
+ fileName: _jsxFileName,
3048
+ lineNumber: 645,
3049
+ columnNumber: 15
3050
+ }, this),
3051
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2523
3052
  label: "Input",
2524
3053
  value: formatNum(generate.inputTokens ?? 0)
2525
- }),
2526
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3054
+ }, void 0, false, {
3055
+ fileName: _jsxFileName,
3056
+ lineNumber: 646,
3057
+ columnNumber: 15
3058
+ }, this),
3059
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2527
3060
  label: "Output",
2528
3061
  value: formatNum(generate.outputTokens ?? 0)
2529
- }),
2530
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3062
+ }, void 0, false, {
3063
+ fileName: _jsxFileName,
3064
+ lineNumber: 647,
3065
+ columnNumber: 15
3066
+ }, this),
3067
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2531
3068
  label: "Cache Read",
2532
3069
  value: formatNum(generate.cacheReadTokens ?? 0)
2533
- }),
2534
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3070
+ }, void 0, false, {
3071
+ fileName: _jsxFileName,
3072
+ lineNumber: 648,
3073
+ columnNumber: 15
3074
+ }, this),
3075
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2535
3076
  label: "Cache Write",
2536
3077
  value: formatNum(generate.cacheCreationTokens ?? 0)
2537
- }),
2538
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3078
+ }, void 0, false, {
3079
+ fileName: _jsxFileName,
3080
+ lineNumber: 649,
3081
+ columnNumber: 15
3082
+ }, this),
3083
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2539
3084
  label: "Cache 5m / 1h",
2540
3085
  value: `${generate.cacheCreation5mTokens === null ? "—" : formatNum(generate.cacheCreation5mTokens)} / ${generate.cacheCreation1hTokens === null ? "—" : formatNum(generate.cacheCreation1hTokens)}`
2541
- }),
2542
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, { value: generate.costUsd === null ? "—" : formatMicroUsd(generate.costUsd) }),
2543
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CompactMetric, {
3086
+ }, void 0, false, {
3087
+ fileName: _jsxFileName,
3088
+ lineNumber: 650,
3089
+ columnNumber: 15
3090
+ }, this),
3091
+ /* @__PURE__ */ (void 0)(CompactMetric, { value: generate.costUsd === null ? "—" : formatMicroUsd(generate.costUsd) }, void 0, false, {
3092
+ fileName: _jsxFileName,
3093
+ lineNumber: 651,
3094
+ columnNumber: 15
3095
+ }, this),
3096
+ /* @__PURE__ */ (void 0)(CompactMetric, {
2544
3097
  label: "Reasoning",
2545
3098
  value: generate.reasoningTokens !== null && generate.reasoningTokens !== void 0 ? formatNum(generate.reasoningTokens) : "—"
2546
- })
3099
+ }, void 0, false, {
3100
+ fileName: _jsxFileName,
3101
+ lineNumber: 652,
3102
+ columnNumber: 15
3103
+ }, this)
2547
3104
  ]
2548
- }), hasReasoning && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ReasoningBlock, { stepId: generate.id })]
2549
- }), entry.toolCalls.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3105
+ }, void 0, true, {
3106
+ fileName: _jsxFileName,
3107
+ lineNumber: 642,
3108
+ columnNumber: 13
3109
+ }, this), hasReasoning && /* @__PURE__ */ (void 0)(ReasoningBlock, { stepId: generate.id }, void 0, false, {
3110
+ fileName: _jsxFileName,
3111
+ lineNumber: 655,
3112
+ columnNumber: 30
3113
+ }, this)]
3114
+ }, void 0, true, {
3115
+ fileName: _jsxFileName,
3116
+ lineNumber: 641,
3117
+ columnNumber: 22
3118
+ }, this), entry.toolCalls.length > 0 && /* @__PURE__ */ (void 0)("div", {
2550
3119
  className: "space-y-0.5",
2551
- children: entry.toolCalls.map((toolCall) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCallItem, { entry: toolCall }, `${toolCall.stepIndex}-${toolCall.callIndex}-${toolCall.toolCallId}`))
2552
- })]
2553
- })]
2554
- });
3120
+ children: entry.toolCalls.map((toolCall) => /* @__PURE__ */ (void 0)(ToolCallItem, { entry: toolCall }, `${toolCall.stepIndex}-${toolCall.callIndex}-${toolCall.toolCallId}`, false, {
3121
+ fileName: _jsxFileName,
3122
+ lineNumber: 659,
3123
+ columnNumber: 46
3124
+ }, this))
3125
+ }, void 0, false, {
3126
+ fileName: _jsxFileName,
3127
+ lineNumber: 658,
3128
+ columnNumber: 40
3129
+ }, this)]
3130
+ }, void 0, true, {
3131
+ fileName: _jsxFileName,
3132
+ lineNumber: 640,
3133
+ columnNumber: 7
3134
+ }, this)]
3135
+ }, void 0, true, {
3136
+ fileName: _jsxFileName,
3137
+ lineNumber: 616,
3138
+ columnNumber: 10
3139
+ }, this);
2555
3140
  }
2556
3141
  function StepTreeSection({ steps, tokensPerSecEnabled }) {
2557
3142
  const toolCallCount = steps.reduce((sum, step) => sum + step.toolCalls.length, 0);
2558
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3143
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2559
3144
  title: `Steps (${steps.length} steps · ${toolCallCount} tool calls)`,
2560
3145
  defaultOpen: true,
2561
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3146
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2562
3147
  className: "space-y-1",
2563
- children: steps.map((step) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StepTreeItem, {
3148
+ children: steps.map((step) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StepTreeItem, {
2564
3149
  entry: step,
2565
3150
  tokensPerSecEnabled
2566
- }, step.stepIndex))
2567
- })
2568
- });
3151
+ }, step.stepIndex, false, {
3152
+ fileName: _jsxFileName,
3153
+ lineNumber: 674,
3154
+ columnNumber: 28
3155
+ }, this))
3156
+ }, void 0, false, {
3157
+ fileName: _jsxFileName,
3158
+ lineNumber: 673,
3159
+ columnNumber: 7
3160
+ }, this)
3161
+ }, void 0, false, {
3162
+ fileName: _jsxFileName,
3163
+ lineNumber: 672,
3164
+ columnNumber: 10
3165
+ }, this);
2569
3166
  }
2570
3167
  function buildStepTree(steps) {
2571
3168
  const grouped = /* @__PURE__ */ new Map();
@@ -2628,40 +3225,83 @@ function historyItemLabel(item) {
2628
3225
  if (item.type === "function_call_output") return `fn result`;
2629
3226
  return item.role ?? item.type;
2630
3227
  }
3228
+ var HistoryTextPart = looseObject({ text: string() });
3229
+ var HistoryContent = union([
3230
+ string(),
3231
+ array(union([HistoryTextPart, JsonValue])),
3232
+ JsonValue
3233
+ ]);
2631
3234
  function extractText(content) {
2632
- if (typeof content === "string") return content;
2633
- if (Array.isArray(content)) return content.map((c) => {
2634
- if (typeof c === "object" && c !== null && "text" in c) return c.text;
2635
- return JSON.stringify(c);
3235
+ const text = string().safeParse(content);
3236
+ if (text.success) return text.data;
3237
+ const parts = array(union([HistoryTextPart, JsonValue])).safeParse(content);
3238
+ if (parts.success) return parts.data.map((part) => {
3239
+ const textPart = HistoryTextPart.safeParse(part);
3240
+ return textPart.success ? textPart.data.text : JSON.stringify(part);
2636
3241
  }).join("\n");
2637
3242
  return JSON.stringify(content);
2638
3243
  }
2639
3244
  function MonoPre({ className, children }) {
2640
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
3245
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
2641
3246
  className: `text-[12px] text-sand-700 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-40 overflow-auto ${className ?? ""}`,
2642
3247
  children
2643
- });
3248
+ }, void 0, false, {
3249
+ fileName: _jsxFileName,
3250
+ lineNumber: 774,
3251
+ columnNumber: 10
3252
+ }, this);
2644
3253
  }
2645
3254
  function HistorySection({ history }) {
2646
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3255
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2647
3256
  title: "History",
2648
3257
  defaultOpen: false,
2649
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3258
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2650
3259
  className: "space-y-1.5",
2651
- children: history.map((item, i) => /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
2652
- className: `rounded-md px-3 py-2 ${historyItemBg(item)}`,
2653
- children: [
2654
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
2655
- className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1",
2656
- children: historyItemLabel(item)
2657
- }),
2658
- item.content !== null && item.content !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: extractText(item.content) }),
2659
- item.arguments && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: item.arguments }),
2660
- item.output && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MonoPre, { children: item.output })
2661
- ]
2662
- }, `hist-${i}`))
2663
- })
2664
- });
3260
+ children: history.map((item, i) => {
3261
+ const content = HistoryContent.safeParse(item.content);
3262
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
3263
+ className: `rounded-md px-3 py-2 ${historyItemBg(item)}`,
3264
+ children: [
3265
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
3266
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium mb-1",
3267
+ children: historyItemLabel(item)
3268
+ }, void 0, false, {
3269
+ fileName: _jsxFileName,
3270
+ lineNumber: 788,
3271
+ columnNumber: 15
3272
+ }, this),
3273
+ item.content !== null && item.content !== void 0 && /* @__PURE__ */ (void 0)(MonoPre, { children: content.success ? extractText(content.data) : JSON.stringify(item.content) }, void 0, false, {
3274
+ fileName: _jsxFileName,
3275
+ lineNumber: 791,
3276
+ columnNumber: 71
3277
+ }, this),
3278
+ item.arguments && /* @__PURE__ */ (void 0)(MonoPre, { children: item.arguments }, void 0, false, {
3279
+ fileName: _jsxFileName,
3280
+ lineNumber: 794,
3281
+ columnNumber: 34
3282
+ }, this),
3283
+ item.output && /* @__PURE__ */ (void 0)(MonoPre, { children: item.output }, void 0, false, {
3284
+ fileName: _jsxFileName,
3285
+ lineNumber: 795,
3286
+ columnNumber: 31
3287
+ }, this)
3288
+ ]
3289
+ }, `hist-${i}`, true, {
3290
+ fileName: _jsxFileName,
3291
+ lineNumber: 787,
3292
+ columnNumber: 16
3293
+ }, this);
3294
+ })
3295
+ }, void 0, false, {
3296
+ fileName: _jsxFileName,
3297
+ lineNumber: 784,
3298
+ columnNumber: 7
3299
+ }, this)
3300
+ }, void 0, false, {
3301
+ fileName: _jsxFileName,
3302
+ lineNumber: 783,
3303
+ columnNumber: 10
3304
+ }, this);
2665
3305
  }
2666
3306
  var TOOL_NAME_PREVIEW_CHARACTERS = 60;
2667
3307
  var TOOL_NAME_COMPACT_PREVIEW_CHARACTERS = 30;
@@ -2681,81 +3321,145 @@ function ToolsHeaderMetadata({ tools }) {
2681
3321
  const wide = toolNamePreview(tools);
2682
3322
  const compact = toolNamePreview(tools, TOOL_NAME_COMPACT_PREVIEW_CHARACTERS);
2683
3323
  const mobile = toolNamePreview(tools, TOOL_NAME_MOBILE_PREVIEW_CHARACTERS);
2684
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
2685
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3324
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [
3325
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2686
3326
  className: "shrink-0",
2687
3327
  children: "·"
2688
- }),
2689
- wide.names.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3328
+ }, void 0, false, {
3329
+ fileName: _jsxFileName,
3330
+ lineNumber: 829,
3331
+ columnNumber: 7
3332
+ }, this),
3333
+ wide.names.length > 0 && /* @__PURE__ */ (void 0)("span", {
2690
3334
  className: "hidden shrink-0 xl:inline",
2691
3335
  children: wide.names.join(", ")
2692
- }),
2693
- wide.omittedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3336
+ }, void 0, false, {
3337
+ fileName: _jsxFileName,
3338
+ lineNumber: 830,
3339
+ columnNumber: 33
3340
+ }, this),
3341
+ wide.omittedCount > 0 && /* @__PURE__ */ (void 0)("span", {
2694
3342
  className: "hidden shrink-0 xl:inline",
2695
3343
  children: ["+", wide.omittedCount]
2696
- }),
2697
- compact.names.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3344
+ }, void 0, true, {
3345
+ fileName: _jsxFileName,
3346
+ lineNumber: 831,
3347
+ columnNumber: 33
3348
+ }, this),
3349
+ compact.names.length > 0 && /* @__PURE__ */ (void 0)("span", {
2698
3350
  className: "hidden shrink-0 sm:inline xl:hidden",
2699
3351
  children: compact.names.join(", ")
2700
- }),
2701
- compact.omittedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3352
+ }, void 0, false, {
3353
+ fileName: _jsxFileName,
3354
+ lineNumber: 832,
3355
+ columnNumber: 36
3356
+ }, this),
3357
+ compact.omittedCount > 0 && /* @__PURE__ */ (void 0)("span", {
2702
3358
  className: "hidden shrink-0 sm:inline xl:hidden",
2703
3359
  children: ["+", compact.omittedCount]
2704
- }),
2705
- mobile.names.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3360
+ }, void 0, true, {
3361
+ fileName: _jsxFileName,
3362
+ lineNumber: 833,
3363
+ columnNumber: 36
3364
+ }, this),
3365
+ mobile.names.length > 0 && /* @__PURE__ */ (void 0)("span", {
2706
3366
  className: "shrink-0 sm:hidden",
2707
3367
  children: mobile.names.join(", ")
2708
- }),
2709
- mobile.omittedCount > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("span", {
3368
+ }, void 0, false, {
3369
+ fileName: _jsxFileName,
3370
+ lineNumber: 834,
3371
+ columnNumber: 35
3372
+ }, this),
3373
+ mobile.omittedCount > 0 && /* @__PURE__ */ (void 0)("span", {
2710
3374
  className: "shrink-0 sm:hidden",
2711
3375
  children: ["+", mobile.omittedCount]
2712
- })
2713
- ] });
3376
+ }, void 0, true, {
3377
+ fileName: _jsxFileName,
3378
+ lineNumber: 835,
3379
+ columnNumber: 35
3380
+ }, this)
3381
+ ] }, void 0, true);
2714
3382
  }
2715
3383
  function ToolInputZod({ code, fullCode }) {
2716
3384
  const highlighted = (0, import_react.useMemo)(() => highlightTypeText(code), [code]);
2717
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
2718
- "data-zod-parameter-shape": true,
3385
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
3386
+ "data-zod-parameter-schema": true,
2719
3387
  className: `max-h-64 overflow-auto rounded-md bg-sand-900 px-3 py-2.5 font-mono text-[11px] leading-relaxed whitespace-pre text-sand-200 ${fullCode ? "cursor-help outline-none focus-visible:ring-2 focus-visible:ring-sienna-300" : ""}`,
2720
3388
  tabIndex: fullCode ? 0 : void 0,
2721
3389
  title: fullCode,
2722
- children: fullCode ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3390
+ children: fullCode ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2723
3391
  "aria-hidden": "true",
2724
3392
  children: highlighted
2725
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3393
+ }, void 0, false, {
3394
+ fileName: _jsxFileName,
3395
+ lineNumber: 848,
3396
+ columnNumber: 11
3397
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2726
3398
  className: "sr-only",
2727
3399
  children: fullCode
2728
- })] }) : highlighted
2729
- });
3400
+ }, void 0, false, {
3401
+ fileName: _jsxFileName,
3402
+ lineNumber: 849,
3403
+ columnNumber: 11
3404
+ }, this)] }, void 0, true) : highlighted
3405
+ }, void 0, false, {
3406
+ fileName: _jsxFileName,
3407
+ lineNumber: 846,
3408
+ columnNumber: 10
3409
+ }, this);
2730
3410
  }
2731
3411
  function ToolCard({ tool }) {
2732
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3412
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2733
3413
  className: "min-w-0 rounded-md border border-sand-100 bg-sand-50/70 p-3",
2734
3414
  children: [
2735
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3415
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2736
3416
  className: "break-all font-mono text-[13px] font-semibold text-sand-900",
2737
3417
  children: tool.name
2738
- }),
2739
- tool.description && /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
3418
+ }, void 0, false, {
3419
+ fileName: _jsxFileName,
3420
+ lineNumber: 859,
3421
+ columnNumber: 7
3422
+ }, this),
3423
+ tool.description && /* @__PURE__ */ (void 0)("p", {
2740
3424
  className: "mt-2 text-[12px] leading-relaxed text-sand-700",
2741
3425
  children: tool.description
2742
- }),
2743
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3426
+ }, void 0, false, {
3427
+ fileName: _jsxFileName,
3428
+ lineNumber: 860,
3429
+ columnNumber: 28
3430
+ }, this),
3431
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2744
3432
  className: "mt-3",
2745
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3433
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2746
3434
  className: "mb-1.5 text-[10px] font-medium uppercase tracking-wider text-sand-400",
2747
3435
  children: [
2748
3436
  "Parameters (",
2749
3437
  tool.parameterCount,
2750
3438
  ")"
2751
3439
  ]
2752
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolInputZod, {
3440
+ }, void 0, true, {
3441
+ fileName: _jsxFileName,
3442
+ lineNumber: 862,
3443
+ columnNumber: 9
3444
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ToolInputZod, {
2753
3445
  code: tool.inputZod,
2754
3446
  fullCode: tool.fullInputZod
2755
- })]
2756
- })
3447
+ }, void 0, false, {
3448
+ fileName: _jsxFileName,
3449
+ lineNumber: 865,
3450
+ columnNumber: 9
3451
+ }, this)]
3452
+ }, void 0, true, {
3453
+ fileName: _jsxFileName,
3454
+ lineNumber: 861,
3455
+ columnNumber: 7
3456
+ }, this)
2757
3457
  ]
2758
- });
3458
+ }, void 0, true, {
3459
+ fileName: _jsxFileName,
3460
+ lineNumber: 858,
3461
+ columnNumber: 10
3462
+ }, this);
2759
3463
  }
2760
3464
  function ToolsPanel({ id, tools }) {
2761
3465
  const [open, setOpen] = (0, import_react.useState)(false);
@@ -2767,22 +3471,46 @@ function ToolsPanel({ id, tools }) {
2767
3471
  refetchOnReconnect: false
2768
3472
  });
2769
3473
  const hasView = query.data !== void 0 && query.data.length > 0;
2770
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3474
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2771
3475
  title: `Tools (${tools.length})`,
2772
3476
  defaultOpen: false,
2773
- headerMetadata: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolsHeaderMetadata, { tools }),
3477
+ headerMetadata: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ToolsHeaderMetadata, { tools }, void 0, false, {
3478
+ fileName: _jsxFileName,
3479
+ lineNumber: 885,
3480
+ columnNumber: 89
3481
+ }, this),
2774
3482
  onOpenChange: setOpen,
2775
- children: query.isFetching && !hasView ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
3483
+ children: query.isFetching && !hasView ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
2776
3484
  className: "text-[12px] text-sand-400",
2777
3485
  children: "Loading tool contracts…"
2778
- }) : query.isError || !hasView ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
3486
+ }, void 0, false, {
3487
+ fileName: _jsxFileName,
3488
+ lineNumber: 886,
3489
+ columnNumber: 39
3490
+ }, this) : query.isError || !hasView ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
2779
3491
  className: "text-[12px] text-sand-400",
2780
3492
  children: "Tool contracts could not be loaded."
2781
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3493
+ }, void 0, false, {
3494
+ fileName: _jsxFileName,
3495
+ lineNumber: 886,
3496
+ columnNumber: 138
3497
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2782
3498
  className: "space-y-2",
2783
- children: query.data.map((tool, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolCard, { tool }, `${tool.name}-${index}`))
2784
- })
2785
- });
3499
+ children: query.data.map((tool, index) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ToolCard, { tool }, `${tool.name}-${index}`, false, {
3500
+ fileName: _jsxFileName,
3501
+ lineNumber: 887,
3502
+ columnNumber: 44
3503
+ }, this))
3504
+ }, void 0, false, {
3505
+ fileName: _jsxFileName,
3506
+ lineNumber: 886,
3507
+ columnNumber: 221
3508
+ }, this)
3509
+ }, void 0, false, {
3510
+ fileName: _jsxFileName,
3511
+ lineNumber: 885,
3512
+ columnNumber: 10
3513
+ }, this);
2786
3514
  }
2787
3515
  var TYPE_TOKEN_RE = /("(?:[^"\\]|\\.)*")|(\b\d+(?:\.\d+)?\b)|(\btype\b|\bz\b(?=\.))|(\b(?:string|number|boolean|null|unknown|Record)\b)|([{}[\]()<>|?:,.=])|([A-Za-z_$][\w$]*)|(\s+|.)/g;
2788
3516
  function highlightTypeText(text) {
@@ -2791,30 +3519,50 @@ function highlightTypeText(text) {
2791
3519
  for (const match of text.matchAll(TYPE_TOKEN_RE)) {
2792
3520
  const [token, str, num, kw, builtin, punct, ident] = match;
2793
3521
  const key = `${match.index}-${token}`;
2794
- if (str || num) nodes.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3522
+ if (str || num) nodes.push(/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2795
3523
  className: "text-sage-400",
2796
3524
  children: token
2797
- }, key));
3525
+ }, key, false, {
3526
+ fileName: _jsxFileName,
3527
+ lineNumber: 902,
3528
+ columnNumber: 18
3529
+ }, this));
2798
3530
  else if (kw) {
2799
3531
  afterTypeKeyword = token === "type";
2800
- nodes.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3532
+ nodes.push(/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2801
3533
  className: "text-sienna-400",
2802
3534
  children: token
2803
- }, key));
2804
- } else if (builtin) nodes.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3535
+ }, key, false, {
3536
+ fileName: _jsxFileName,
3537
+ lineNumber: 908,
3538
+ columnNumber: 18
3539
+ }, this));
3540
+ } else if (builtin) nodes.push(/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2805
3541
  className: "text-blue-300",
2806
3542
  children: token
2807
- }, key));
2808
- else if (punct) nodes.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3543
+ }, key, false, {
3544
+ fileName: _jsxFileName,
3545
+ lineNumber: 912,
3546
+ columnNumber: 18
3547
+ }, this));
3548
+ else if (punct) nodes.push(/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2809
3549
  className: "text-sand-500",
2810
3550
  children: token
2811
- }, key));
3551
+ }, key, false, {
3552
+ fileName: _jsxFileName,
3553
+ lineNumber: 916,
3554
+ columnNumber: 18
3555
+ }, this));
2812
3556
  else if (ident && afterTypeKeyword) {
2813
3557
  afterTypeKeyword = false;
2814
- nodes.push(/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3558
+ nodes.push(/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2815
3559
  className: "font-semibold text-sand-50",
2816
3560
  children: token
2817
- }, key));
3561
+ }, key, false, {
3562
+ fileName: _jsxFileName,
3563
+ lineNumber: 922,
3564
+ columnNumber: 18
3565
+ }, this));
2818
3566
  } else nodes.push(token);
2819
3567
  }
2820
3568
  return nodes;
@@ -2826,14 +3574,18 @@ function ResponseTypePanel({ id }) {
2826
3574
  const code = mode === "zod" ? zod ?? typescript : typescript ?? zod;
2827
3575
  const highlighted = (0, import_react.useMemo)(() => code === null ? null : highlightTypeText(code), [code]);
2828
3576
  if (!data || code === null || highlighted === null) return null;
2829
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3577
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2830
3578
  className: "panel overflow-hidden",
2831
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3579
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2832
3580
  className: "panel-header flex items-center px-4 py-2",
2833
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {
3581
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
2834
3582
  className: "text-[11px] uppercase tracking-wider text-sand-500 font-medium",
2835
3583
  children: "Response Type"
2836
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3584
+ }, void 0, false, {
3585
+ fileName: _jsxFileName,
3586
+ lineNumber: 954,
3587
+ columnNumber: 9
3588
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2837
3589
  className: "ml-auto flex gap-1",
2838
3590
  children: [{
2839
3591
  value: "zod",
@@ -2843,25 +3595,53 @@ function ResponseTypePanel({ id }) {
2843
3595
  value: "ts",
2844
3596
  label: "ts",
2845
3597
  available: typescript !== null
2846
- }].map((option) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("button", {
3598
+ }].map((option) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
2847
3599
  type: "button",
2848
3600
  disabled: !option.available,
2849
3601
  className: `px-3 py-1 text-[12px] font-mono rounded-md transition-colors ${mode === option.value ? "bg-sand-200 text-sand-700" : "text-sand-400 hover:text-sand-600 disabled:text-sand-300 disabled:cursor-not-allowed"}`,
2850
3602
  onClick: () => setMode(option.value),
2851
3603
  children: option.label
2852
- }, option.value))
2853
- })]
2854
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3604
+ }, option.value, false, {
3605
+ fileName: _jsxFileName,
3606
+ lineNumber: 966,
3607
+ columnNumber: 36
3608
+ }, this))
3609
+ }, void 0, false, {
3610
+ fileName: _jsxFileName,
3611
+ lineNumber: 957,
3612
+ columnNumber: 9
3613
+ }, this)]
3614
+ }, void 0, true, {
3615
+ fileName: _jsxFileName,
3616
+ lineNumber: 953,
3617
+ columnNumber: 7
3618
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2855
3619
  className: "relative",
2856
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, {
3620
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(CopyButton, {
2857
3621
  text: code,
2858
3622
  dark: true
2859
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("pre", {
3623
+ }, void 0, false, {
3624
+ fileName: _jsxFileName,
3625
+ lineNumber: 972,
3626
+ columnNumber: 9
3627
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("pre", {
2860
3628
  className: "bg-sand-900 px-4 py-3 text-[12px] text-sand-200 whitespace-pre-wrap wrap-break-word font-mono leading-relaxed max-h-64 overflow-auto",
2861
3629
  children: highlighted
2862
- })]
2863
- })]
2864
- });
3630
+ }, void 0, false, {
3631
+ fileName: _jsxFileName,
3632
+ lineNumber: 974,
3633
+ columnNumber: 9
3634
+ }, this)]
3635
+ }, void 0, true, {
3636
+ fileName: _jsxFileName,
3637
+ lineNumber: 971,
3638
+ columnNumber: 7
3639
+ }, this)]
3640
+ }, void 0, true, {
3641
+ fileName: _jsxFileName,
3642
+ lineNumber: 952,
3643
+ columnNumber: 10
3644
+ }, this);
2865
3645
  }
2866
3646
  function RequestDetail({ id }) {
2867
3647
  const { data, isLoading, error, isError } = RequestLogService.useRequestLog("A", id);
@@ -2872,26 +3652,58 @@ function RequestDetail({ id }) {
2872
3652
  orderBy: "id-asc"
2873
3653
  });
2874
3654
  const stepTree = buildStepTree(stepsData?.rows ?? []);
2875
- if (isLoading || isStepsLoading) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3655
+ if (isLoading || isStepsLoading) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2876
3656
  className: "max-w-6xl mx-auto space-y-4",
2877
3657
  children: [
2878
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-4 w-32 bg-sand-200 rounded animate-pulse" }),
2879
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-40 panel animate-pulse" }),
2880
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "h-32 panel animate-pulse" })
3658
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-4 w-32 bg-sand-200 rounded animate-pulse" }, void 0, false, {
3659
+ fileName: _jsxFileName,
3660
+ lineNumber: 1005,
3661
+ columnNumber: 9
3662
+ }, this),
3663
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-40 panel animate-pulse" }, void 0, false, {
3664
+ fileName: _jsxFileName,
3665
+ lineNumber: 1006,
3666
+ columnNumber: 9
3667
+ }, this),
3668
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-32 panel animate-pulse" }, void 0, false, {
3669
+ fileName: _jsxFileName,
3670
+ lineNumber: 1007,
3671
+ columnNumber: 9
3672
+ }, this)
2881
3673
  ]
2882
- });
2883
- if (isError || isStepsError || !data) return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3674
+ }, void 0, true, {
3675
+ fileName: _jsxFileName,
3676
+ lineNumber: 1004,
3677
+ columnNumber: 12
3678
+ }, this);
3679
+ if (isError || isStepsError || !data) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2884
3680
  className: "max-w-6xl mx-auto",
2885
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
3681
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Link, {
2886
3682
  to: "/logs",
2887
3683
  className: "flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 mb-4",
2888
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideArrowLeft, { className: "size-3.5" }), "Back to Logs"]
2889
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {
3684
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideArrowLeft, { className: "size-3.5" }, void 0, false, {
3685
+ fileName: _jsxFileName,
3686
+ lineNumber: 1013,
3687
+ columnNumber: 11
3688
+ }, this), "Back to Logs"]
3689
+ }, void 0, true, {
3690
+ fileName: _jsxFileName,
3691
+ lineNumber: 1012,
3692
+ columnNumber: 9
3693
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("p", {
2890
3694
  role: "alert",
2891
3695
  className: "text-danger-500 text-sm",
2892
3696
  children: isError ? isSonamuError(error) && error.code === 404 ? "Request not found." : "Failed to load request." : isStepsError ? "Failed to load request steps." : "Request not found."
2893
- })]
2894
- });
3697
+ }, void 0, false, {
3698
+ fileName: _jsxFileName,
3699
+ lineNumber: 1016,
3700
+ columnNumber: 9
3701
+ }, this)]
3702
+ }, void 0, true, {
3703
+ fileName: _jsxFileName,
3704
+ lineNumber: 1011,
3705
+ columnNumber: 12
3706
+ }, this);
2895
3707
  const toolCalls = stepTree.flatMap((step) => step.toolCalls);
2896
3708
  const firstImageGenerationStepId = toolCalls.find((toolCall) => toolCall.toolName === "image_generation")?.id ?? null;
2897
3709
  const hasSteps = stepTree.length > 0;
@@ -2900,90 +3712,210 @@ function RequestDetail({ id }) {
2900
3712
  const hasHistory = history !== null && history.length > 0;
2901
3713
  const tools = data.tools ?? null;
2902
3714
  const hasTools = tools !== null && tools.length > 0;
2903
- const responseTypePanel = data.is_structured ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ResponseTypePanel, { id }) : null;
2904
- const promptSections = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3715
+ const responseTypePanel = data.is_structured ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(ResponseTypePanel, { id }, void 0, false, {
3716
+ fileName: _jsxFileName,
3717
+ lineNumber: 1031,
3718
+ columnNumber: 50
3719
+ }, this) : null;
3720
+ const promptSections = /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2905
3721
  className: "space-y-4",
2906
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3722
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2907
3723
  title: "System",
2908
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3724
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2909
3725
  className: "relative",
2910
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.system_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3726
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(CopyButton, { text: data.system_prompt ?? "null" }, void 0, false, {
3727
+ fileName: _jsxFileName,
3728
+ lineNumber: 1035,
3729
+ columnNumber: 11
3730
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(FormattedContent, {
2911
3731
  text: data.system_prompt ?? "null",
2912
3732
  markdown: true
2913
- })]
2914
- })
2915
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3733
+ }, void 0, false, {
3734
+ fileName: _jsxFileName,
3735
+ lineNumber: 1036,
3736
+ columnNumber: 11
3737
+ }, this)]
3738
+ }, void 0, true, {
3739
+ fileName: _jsxFileName,
3740
+ lineNumber: 1034,
3741
+ columnNumber: 9
3742
+ }, this)
3743
+ }, void 0, false, {
3744
+ fileName: _jsxFileName,
3745
+ lineNumber: 1033,
3746
+ columnNumber: 7
3747
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2916
3748
  title: "User",
2917
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3749
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2918
3750
  className: "space-y-3",
2919
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3751
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2920
3752
  className: "relative",
2921
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.user_prompt ?? "null" }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3753
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(CopyButton, { text: data.user_prompt ?? "null" }, void 0, false, {
3754
+ fileName: _jsxFileName,
3755
+ lineNumber: 1042,
3756
+ columnNumber: 13
3757
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(FormattedContent, {
2922
3758
  text: data.user_prompt ?? "null",
2923
3759
  markdown: true
2924
- })]
2925
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(RequestInputImages, {
3760
+ }, void 0, false, {
3761
+ fileName: _jsxFileName,
3762
+ lineNumber: 1043,
3763
+ columnNumber: 13
3764
+ }, this)]
3765
+ }, void 0, true, {
3766
+ fileName: _jsxFileName,
3767
+ lineNumber: 1041,
3768
+ columnNumber: 11
3769
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(RequestInputImages, {
2926
3770
  images: data.input_images,
2927
3771
  stepId: firstImageGenerationStepId
2928
- })]
2929
- })
2930
- })]
2931
- });
2932
- return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3772
+ }, void 0, false, {
3773
+ fileName: _jsxFileName,
3774
+ lineNumber: 1045,
3775
+ columnNumber: 11
3776
+ }, this)]
3777
+ }, void 0, true, {
3778
+ fileName: _jsxFileName,
3779
+ lineNumber: 1040,
3780
+ columnNumber: 9
3781
+ }, this)
3782
+ }, void 0, false, {
3783
+ fileName: _jsxFileName,
3784
+ lineNumber: 1039,
3785
+ columnNumber: 7
3786
+ }, this)]
3787
+ }, void 0, true, {
3788
+ fileName: _jsxFileName,
3789
+ lineNumber: 1032,
3790
+ columnNumber: 26
3791
+ }, this);
3792
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2933
3793
  className: `mx-auto space-y-4 ${hasSteps ? "max-w-[120rem]" : "max-w-6xl"}`,
2934
3794
  children: [
2935
- /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Link, {
3795
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Link, {
2936
3796
  to: "/logs",
2937
3797
  className: "inline-flex items-center gap-1 text-[13px] text-sand-500 hover:text-sienna-500 transition-colors",
2938
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(lucideArrowLeft, { className: "size-3.5" }), "Back to Logs"]
2939
- }),
2940
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HeaderBar, { data }),
2941
- data.error_message && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ErrorPanel, { message: data.error_message }),
2942
- hasHistory && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(HistorySection, { history }),
2943
- hasSteps ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3798
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideArrowLeft, { className: "size-3.5" }, void 0, false, {
3799
+ fileName: _jsxFileName,
3800
+ lineNumber: 1051,
3801
+ columnNumber: 9
3802
+ }, this), "Back to Logs"]
3803
+ }, void 0, true, {
3804
+ fileName: _jsxFileName,
3805
+ lineNumber: 1050,
3806
+ columnNumber: 7
3807
+ }, this),
3808
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(HeaderBar, { data }, void 0, false, {
3809
+ fileName: _jsxFileName,
3810
+ lineNumber: 1055,
3811
+ columnNumber: 7
3812
+ }, this),
3813
+ data.error_message && /* @__PURE__ */ (void 0)(ErrorPanel, { message: data.error_message }, void 0, false, {
3814
+ fileName: _jsxFileName,
3815
+ lineNumber: 1057,
3816
+ columnNumber: 30
3817
+ }, this),
3818
+ hasHistory && /* @__PURE__ */ (void 0)(HistorySection, { history }, void 0, false, {
3819
+ fileName: _jsxFileName,
3820
+ lineNumber: 1059,
3821
+ columnNumber: 22
3822
+ }, this),
3823
+ hasSteps ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2944
3824
  className: "flex flex-col lg:flex-row gap-4 items-stretch lg:items-start",
2945
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3825
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2946
3826
  className: "order-1 lg:order-2 flex-1 min-w-0 space-y-4",
2947
3827
  children: [
2948
3828
  responseTypePanel,
2949
- hasTools && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolsPanel, {
3829
+ hasTools && /* @__PURE__ */ (void 0)(ToolsPanel, {
2950
3830
  id,
2951
3831
  tools
2952
- }),
2953
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(StepTreeSection, {
3832
+ }, void 0, false, {
3833
+ fileName: _jsxFileName,
3834
+ lineNumber: 1067,
3835
+ columnNumber: 26
3836
+ }, this),
3837
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(StepTreeSection, {
2954
3838
  steps: stepTree,
2955
3839
  tokensPerSecEnabled
2956
- })
3840
+ }, void 0, false, {
3841
+ fileName: _jsxFileName,
3842
+ lineNumber: 1068,
3843
+ columnNumber: 13
3844
+ }, this)
2957
3845
  ]
2958
- }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
3846
+ }, void 0, true, {
3847
+ fileName: _jsxFileName,
3848
+ lineNumber: 1065,
3849
+ columnNumber: 11
3850
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2959
3851
  className: "order-2 lg:order-1 flex-1 min-w-0",
2960
3852
  children: promptSections
2961
- })]
2962
- }) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [
3853
+ }, void 0, false, {
3854
+ fileName: _jsxFileName,
3855
+ lineNumber: 1070,
3856
+ columnNumber: 11
3857
+ }, this)]
3858
+ }, void 0, true, {
3859
+ fileName: _jsxFileName,
3860
+ lineNumber: 1064,
3861
+ columnNumber: 5
3862
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [
2963
3863
  responseTypePanel,
2964
- hasTools && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ToolsPanel, {
3864
+ hasTools && /* @__PURE__ */ (void 0)(ToolsPanel, {
2965
3865
  id,
2966
3866
  tools
2967
- }),
3867
+ }, void 0, false, {
3868
+ fileName: _jsxFileName,
3869
+ lineNumber: 1073,
3870
+ columnNumber: 24
3871
+ }, this),
2968
3872
  promptSections
2969
- ] }),
2970
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Section, {
3873
+ ] }, void 0, true),
3874
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Section, {
2971
3875
  title: "Response",
2972
- children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)("div", {
3876
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
2973
3877
  className: "relative",
2974
- children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(CopyButton, { text: data.response }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FormattedContent, {
3878
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(CopyButton, { text: data.response }, void 0, false, {
3879
+ fileName: _jsxFileName,
3880
+ lineNumber: 1079,
3881
+ columnNumber: 11
3882
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(FormattedContent, {
2975
3883
  text: data.response,
2976
3884
  markdown: true
2977
- })]
2978
- })
2979
- }),
2980
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)(MetricsPanel, {
3885
+ }, void 0, false, {
3886
+ fileName: _jsxFileName,
3887
+ lineNumber: 1080,
3888
+ columnNumber: 11
3889
+ }, this)]
3890
+ }, void 0, true, {
3891
+ fileName: _jsxFileName,
3892
+ lineNumber: 1078,
3893
+ columnNumber: 9
3894
+ }, this)
3895
+ }, void 0, false, {
3896
+ fileName: _jsxFileName,
3897
+ lineNumber: 1077,
3898
+ columnNumber: 7
3899
+ }, this),
3900
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(MetricsPanel, {
2981
3901
  data,
2982
3902
  toolCallCount: toolCalls.length
2983
- }),
2984
- /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", { className: "pb-8" })
3903
+ }, void 0, false, {
3904
+ fileName: _jsxFileName,
3905
+ lineNumber: 1084,
3906
+ columnNumber: 7
3907
+ }, this),
3908
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "pb-8" }, void 0, false, {
3909
+ fileName: _jsxFileName,
3910
+ lineNumber: 1086,
3911
+ columnNumber: 7
3912
+ }, this)
2985
3913
  ]
2986
- });
3914
+ }, void 0, true, {
3915
+ fileName: _jsxFileName,
3916
+ lineNumber: 1049,
3917
+ columnNumber: 10
3918
+ }, this);
2987
3919
  }
2988
3920
  //#endregion
2989
3921
  export { RequestShowPage as component };