@cartanova/qgrid-cli 2.10.9 → 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 (318) 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 +22 -20
  10. package/bundle/dist/application/qgrid/qgrid-run-lifecycle.js +43 -34
  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 -69
  24. package/bundle/dist/application/request-log/request-log.types.js +8 -2
  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 +40 -16
  33. package/bundle/dist/application/sonamu.generated.sso.js +2 -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 +2 -1
  39. package/bundle/dist/migrations/20260807133553_manual__backfill_request_log_cost.js +8 -6
  40. package/bundle/dist/migrations/20261018215031_alter_request_logs_add1_alter1.js +15 -0
  41. package/bundle/dist/server-bootstrap.js +4 -2
  42. package/bundle/dist/server-error-handler.js +1 -1
  43. package/bundle/dist/sonamu.config.js +37 -8
  44. package/bundle/dist/startup-migrations.js +17 -7
  45. package/bundle/dist/testing/global.js +1 -1
  46. package/bundle/dist/testing/schema-bench.js +0 -0
  47. package/bundle/dist/testing/test-database-name.js +1 -1
  48. package/bundle/dist/utils/providers/anthropic/anthropic-constants.js +1 -1
  49. package/bundle/dist/utils/providers/anthropic/anthropic-dispatcher.js +11 -5
  50. package/bundle/dist/utils/providers/anthropic/anthropic-quota.js +4 -4
  51. package/bundle/dist/utils/providers/anthropic/anthropic-thinking.js +1 -1
  52. package/bundle/dist/utils/providers/anthropic/claude-session.js +20 -19
  53. package/bundle/dist/utils/providers/anthropic/fence-strip.js +1 -1
  54. package/bundle/dist/utils/providers/anthropic/stream-json-adapter.js +49 -23
  55. package/bundle/dist/utils/providers/common/credentials.js +5 -1
  56. package/bundle/dist/utils/providers/common/effort.js +3 -3
  57. package/bundle/dist/utils/providers/common/model-cost.js +69 -14
  58. package/bundle/dist/utils/providers/common/provider-types.js +29 -1
  59. package/bundle/dist/utils/providers/common/schema-validation.js +78 -40
  60. package/bundle/dist/utils/providers/common/smooth-weighted-round-robin.js +1 -1
  61. package/bundle/dist/utils/providers/common/strictifier.js +62 -43
  62. package/bundle/dist/utils/providers/common/thinking.js +3 -2
  63. package/bundle/dist/utils/providers/common/ttft.js +1 -1
  64. package/bundle/dist/utils/providers/grok/grok-backend-protocol.js +427 -0
  65. package/bundle/dist/utils/providers/grok/grok-constants.js +55 -0
  66. package/bundle/dist/utils/providers/grok/grok-direct-client.js +196 -0
  67. package/bundle/dist/utils/providers/grok/grok-dispatcher.js +1313 -0
  68. package/bundle/dist/utils/providers/grok/grok-headers.js +118 -0
  69. package/bundle/dist/utils/providers/grok/grok-media-client.js +420 -0
  70. package/bundle/dist/utils/providers/grok/grok-models.js +114 -0
  71. package/bundle/dist/utils/providers/grok/grok-oauth.js +455 -0
  72. package/bundle/dist/utils/providers/grok/grok-quota.js +119 -0
  73. package/bundle/dist/utils/providers/grok/grok-refresh.js +192 -0
  74. package/bundle/dist/utils/providers/grok/grok-types.js +186 -0
  75. package/bundle/dist/utils/providers/grok/grok-voice-client.js +199 -0
  76. package/bundle/dist/utils/providers/grok/index.js +11 -0
  77. package/bundle/dist/utils/providers/openai/openai-backend-protocol.js +111 -83
  78. package/bundle/dist/utils/providers/openai/openai-callback-relay.js +3 -2
  79. package/bundle/dist/utils/providers/openai/openai-constants.js +1 -1
  80. package/bundle/dist/utils/providers/openai/openai-direct-client.js +23 -7
  81. package/bundle/dist/utils/providers/openai/openai-dispatcher.js +143 -106
  82. package/bundle/dist/utils/providers/openai/openai-image-generation.js +48 -33
  83. package/bundle/dist/utils/providers/openai/openai-oauth.js +28 -13
  84. package/bundle/dist/utils/providers/openai/openai-quota.js +38 -27
  85. package/bundle/dist/utils/providers/openai/openai-refresh.js +17 -9
  86. package/bundle/dist/utils/providers/openai/openai-sse.js +1 -1
  87. package/bundle/dist/utils/providers/openai/openai-transport-config.js +1 -1
  88. package/bundle/dist/utils/quiet-hours.js +1 -1
  89. package/bundle/dist/utils/slack-notify.js +14 -8
  90. package/bundle/dist/utils/subset-loaders.js +4 -5
  91. package/bundle/src/application/monit/log-buffer.ts +23 -9
  92. package/bundle/src/application/monit/monit.frame.ts +22 -5
  93. package/bundle/src/application/monit/monit.types.ts +6 -0
  94. package/bundle/src/application/qgrid/conv-routing.test.ts +76 -4
  95. package/bundle/src/application/qgrid/conv-routing.ts +35 -9
  96. package/bundle/src/application/qgrid/expired-token-reminder.ts +9 -1
  97. package/bundle/src/application/qgrid/oauth.ts +51 -15
  98. package/bundle/src/application/qgrid/qgrid-image-generation.ts +9 -0
  99. package/bundle/src/application/qgrid/qgrid-response-format.ts +50 -25
  100. package/bundle/src/application/qgrid/qgrid-run-lifecycle.test.ts +33 -0
  101. package/bundle/src/application/qgrid/qgrid-run-lifecycle.ts +87 -40
  102. package/bundle/src/application/qgrid/qgrid.dispatcher.test.ts +97 -0
  103. package/bundle/src/application/qgrid/qgrid.dispatcher.ts +274 -126
  104. package/bundle/src/application/qgrid/qgrid.frame.test.ts +1013 -3
  105. package/bundle/src/application/qgrid/qgrid.frame.ts +1415 -60
  106. package/bundle/src/application/qgrid/qgrid.types.ts +335 -0
  107. package/bundle/src/application/qgrid/schema-prompt.ts +105 -41
  108. package/bundle/src/application/qgrid/slack-user-map.ts +5 -0
  109. package/bundle/src/application/qgrid/token-death.ts +4 -0
  110. package/bundle/src/application/qgrid/token-subscriber.test.ts +21 -19
  111. package/bundle/src/application/qgrid/token-subscriber.ts +186 -53
  112. package/bundle/src/application/qgrid/token-trigger-setup.ts +2 -0
  113. package/bundle/src/application/qgrid/token-window-keepalive.ts +49 -6
  114. package/bundle/src/application/qgrid/tool-emulation-schema.ts +33 -29
  115. package/bundle/src/application/qgrid/tool-emulation.ts +52 -27
  116. package/bundle/src/application/request-log/json-schema-type-text.test.ts +5 -5
  117. package/bundle/src/application/request-log/json-schema-type-text.ts +81 -26
  118. package/bundle/src/application/request-log/request-log.entity.json +8 -0
  119. package/bundle/src/application/request-log/request-log.model.test.ts +111 -4
  120. package/bundle/src/application/request-log/request-log.model.ts +279 -145
  121. package/bundle/src/application/request-log/request-log.types.ts +17 -0
  122. package/bundle/src/application/request-log/zod-code-format.ts +11 -0
  123. package/bundle/src/application/request-log-step/request-log-step.model.ts +1 -0
  124. package/bundle/src/application/request-log-step/request-log-step.types.ts +2 -0
  125. package/bundle/src/application/setting/setting.constant.ts +9 -0
  126. package/bundle/src/application/setting/setting.model.ts +12 -2
  127. package/bundle/src/application/setting/setting.store.ts +5 -1
  128. package/bundle/src/application/setting/setting.types.ts +8 -0
  129. package/bundle/src/application/sonamu.generated.http +135 -0
  130. package/bundle/src/application/sonamu.generated.sso.ts +3 -0
  131. package/bundle/src/application/sonamu.generated.ts +29 -0
  132. package/bundle/src/application/token/token.identity.test.ts +20 -0
  133. package/bundle/src/application/token/token.model.ts +66 -7
  134. package/bundle/src/application/token/token.types.ts +24 -1
  135. package/bundle/src/i18n/en.ts +19 -0
  136. package/bundle/src/i18n/ko.ts +21 -0
  137. package/bundle/src/i18n/sd.generated.ts +24 -2
  138. package/bundle/src/migrations/20260807133553_manual__backfill_request_log_cost.ts +16 -8
  139. package/bundle/src/migrations/20261018215031_alter_request_logs_add1_alter1.ts +15 -0
  140. package/bundle/src/server-bootstrap.ts +4 -2
  141. package/bundle/src/server-error-handler.ts +1 -0
  142. package/bundle/src/sonamu.config.ts +69 -7
  143. package/bundle/src/startup-migrations.ts +27 -9
  144. package/bundle/src/testing/global.ts +20 -0
  145. package/bundle/src/testing/schema-bench.ts +105 -30
  146. package/bundle/src/testing/test-database-name.ts +2 -0
  147. package/bundle/src/utils/providers/anthropic/anthropic-constants.ts +8 -0
  148. package/bundle/src/utils/providers/anthropic/anthropic-dispatcher.ts +41 -6
  149. package/bundle/src/utils/providers/anthropic/anthropic-quota.ts +7 -3
  150. package/bundle/src/utils/providers/anthropic/anthropic-thinking.ts +6 -0
  151. package/bundle/src/utils/providers/anthropic/claude-session.ts +58 -24
  152. package/bundle/src/utils/providers/anthropic/fence-strip.ts +11 -0
  153. package/bundle/src/utils/providers/anthropic/stream-json-adapter.ts +110 -45
  154. package/bundle/src/utils/providers/common/credentials.ts +8 -0
  155. package/bundle/src/utils/providers/common/effort.ts +9 -2
  156. package/bundle/src/utils/providers/common/model-cost.test.ts +48 -1
  157. package/bundle/src/utils/providers/common/model-cost.ts +259 -158
  158. package/bundle/src/utils/providers/common/provider-dispatcher.ts +98 -2
  159. package/bundle/src/utils/providers/common/provider-types.ts +46 -3
  160. package/bundle/src/utils/providers/common/schema-validation.test.ts +5 -1
  161. package/bundle/src/utils/providers/common/schema-validation.ts +124 -56
  162. package/bundle/src/utils/providers/common/smooth-weighted-round-robin.ts +4 -0
  163. package/bundle/src/utils/providers/common/strictifier.ts +185 -59
  164. package/bundle/src/utils/providers/common/thinking.ts +2 -2
  165. package/bundle/src/utils/providers/common/ttft.ts +4 -2
  166. package/bundle/src/utils/providers/grok/__fixtures__/golden-responses-1.0.60.json +164 -0
  167. package/bundle/src/utils/providers/grok/grok-backend-protocol.test.ts +325 -0
  168. package/bundle/src/utils/providers/grok/grok-backend-protocol.ts +721 -0
  169. package/bundle/src/utils/providers/grok/grok-constants.ts +105 -0
  170. package/bundle/src/utils/providers/grok/grok-direct-client.test.ts +179 -0
  171. package/bundle/src/utils/providers/grok/grok-direct-client.ts +313 -0
  172. package/bundle/src/utils/providers/grok/grok-dispatcher.test.ts +1395 -0
  173. package/bundle/src/utils/providers/grok/grok-dispatcher.ts +2105 -0
  174. package/bundle/src/utils/providers/grok/grok-headers.test.ts +149 -0
  175. package/bundle/src/utils/providers/grok/grok-headers.ts +199 -0
  176. package/bundle/src/utils/providers/grok/grok-media-client.test.ts +446 -0
  177. package/bundle/src/utils/providers/grok/grok-media-client.ts +703 -0
  178. package/bundle/src/utils/providers/grok/grok-models.test.ts +96 -0
  179. package/bundle/src/utils/providers/grok/grok-models.ts +161 -0
  180. package/bundle/src/utils/providers/grok/grok-oauth.test.ts +406 -0
  181. package/bundle/src/utils/providers/grok/grok-oauth.ts +771 -0
  182. package/bundle/src/utils/providers/grok/grok-quota.test.ts +142 -0
  183. package/bundle/src/utils/providers/grok/grok-quota.ts +198 -0
  184. package/bundle/src/utils/providers/grok/grok-refresh.test.ts +239 -0
  185. package/bundle/src/utils/providers/grok/grok-refresh.ts +325 -0
  186. package/bundle/src/utils/providers/grok/grok-types.test.ts +252 -0
  187. package/bundle/src/utils/providers/grok/grok-types.ts +374 -0
  188. package/bundle/src/utils/providers/grok/grok-voice-client.test.ts +321 -0
  189. package/bundle/src/utils/providers/grok/grok-voice-client.ts +284 -0
  190. package/bundle/src/utils/providers/grok/index.ts +20 -0
  191. package/bundle/src/utils/providers/openai/openai-backend-protocol.ts +221 -137
  192. package/bundle/src/utils/providers/openai/openai-callback-relay.ts +12 -1
  193. package/bundle/src/utils/providers/openai/openai-constants.ts +2 -0
  194. package/bundle/src/utils/providers/openai/openai-direct-client.ts +111 -21
  195. package/bundle/src/utils/providers/openai/openai-dispatcher.ts +322 -169
  196. package/bundle/src/utils/providers/openai/openai-image-generation.ts +116 -36
  197. package/bundle/src/utils/providers/openai/openai-oauth.ts +48 -20
  198. package/bundle/src/utils/providers/openai/openai-quota.ts +77 -46
  199. package/bundle/src/utils/providers/openai/openai-refresh.ts +42 -18
  200. package/bundle/src/utils/providers/openai/openai-sse.ts +27 -3
  201. package/bundle/src/utils/providers/openai/openai-transport-config.ts +2 -0
  202. package/bundle/src/utils/quiet-hours.ts +12 -1
  203. package/bundle/src/utils/slack-notify.ts +44 -13
  204. package/bundle/src/utils/subset-loaders.ts +7 -7
  205. package/bundle/web-dist/client/assets/clsx-5XM_pHvN.js +1 -0
  206. package/bundle/web-dist/client/assets/index-BA7uQ-6c.js +31 -0
  207. package/bundle/web-dist/client/assets/index-Be2qCZmI.css +1 -0
  208. package/bundle/web-dist/client/assets/logs-C47OJGEI.js +1 -0
  209. package/bundle/web-dist/client/assets/monit-BS9no0dU.js +4 -0
  210. package/bundle/web-dist/client/assets/plus-sdACTfH0.js +1 -0
  211. package/bundle/web-dist/client/assets/refresh-cw-CY8o_1cT.js +1 -0
  212. package/bundle/web-dist/client/assets/request-model-BRtFuZvj.js +1 -0
  213. package/bundle/web-dist/client/assets/routes-kqgkUxE8.js +5 -0
  214. package/bundle/web-dist/client/assets/{services.generated-BsieU37H.js → services.generated-CefiDXEv.js} +5 -5
  215. package/bundle/web-dist/client/assets/settings-DNDvFGSw.js +1 -0
  216. package/bundle/web-dist/client/assets/show-u8Np69q3.js +2 -0
  217. package/bundle/web-dist/client/assets/tokens-QvP410NW.js +1 -0
  218. package/bundle/web-dist/client/assets/total-cost-MnfKU8IN.js +1 -0
  219. package/bundle/web-dist/client/assets/use-oauth-login-flow-Bzdh28Ws.js +1 -0
  220. package/bundle/web-dist/client/assets/use-update-token-mutation-CfJKaxmR.js +1 -0
  221. package/bundle/web-dist/client/assets/vendor-react-CUFFrVN9.js +244 -0
  222. package/bundle/web-dist/client/assets/vendor-tanstack-Bf_jag9G.js +1 -0
  223. package/bundle/web-dist/client/index.html +6 -6
  224. package/bundle/web-dist/server/assets/clsx-D_N5PN_2.js +16 -0
  225. package/bundle/web-dist/server/assets/{lazyRouteComponent-Dtd0NR4r.js → lazyRouteComponent-D8iTIHyn.js} +129 -2
  226. package/bundle/web-dist/server/assets/logs-B3OTd9hy.js +825 -0
  227. package/bundle/web-dist/server/assets/{monit-DvzribSE.js → monit-B2hqorPe.js} +385 -126
  228. package/bundle/web-dist/server/assets/plus-DwG7h9kq.js +28 -0
  229. package/bundle/web-dist/server/assets/{react-dom-B4a6-uuR.js → react-dom-BIYQzBqG.js} +2 -129
  230. package/bundle/web-dist/server/assets/refresh-cw-mMBkwOq0.js +44 -0
  231. package/bundle/web-dist/server/assets/{request-model-CbqfnQOJ.js → request-model-I6OdODSH.js} +15 -6
  232. package/bundle/web-dist/server/assets/{routes-BAPWTizT.js → routes-B95YlUv2.js} +760 -213
  233. package/bundle/web-dist/server/assets/{services.generated-CEbGjsI0.js → services.generated-DQATJ6qf.js} +12821 -12194
  234. package/bundle/web-dist/server/assets/settings-C3gbGk0m.js +830 -0
  235. package/bundle/web-dist/server/assets/{show-CxVZTAdv.js → show-Bxaj3rhH.js} +1355 -419
  236. package/bundle/web-dist/server/assets/tokens-CZjH3cB7.js +1038 -0
  237. package/bundle/web-dist/server/assets/total-cost-fTE9Xy82.js +18 -0
  238. package/bundle/web-dist/server/assets/use-oauth-login-flow-CKDHgc3U.js +2379 -0
  239. package/bundle/web-dist/server/assets/{use-update-token-mutation-CfYmk_4_.js → use-update-token-mutation-BEbgOzaa.js} +1 -1
  240. package/bundle/web-dist/server/entry-server.generated.js +4303 -22810
  241. package/dist/cli.js +9 -9
  242. package/package.json +4 -11
  243. package/postinstall.mjs +12 -0
  244. package/skills/qgrid/SKILL.md +1 -0
  245. package/skills/qgrid/references/cli-env-and-server-boot.md +4 -1
  246. package/skills/qgrid/references/decision-rationale.md +24 -1
  247. package/skills/qgrid/references/grok-runtime.md +89 -0
  248. package/skills/qgrid/references/provider-runtime-differences.md +30 -29
  249. package/skills/qgrid/references/repo-map.md +10 -0
  250. package/skills/qgrid/references/request-log-run-lifecycle.md +1 -1
  251. package/skills/qgrid/references/sonamu-api-web-flow.md +1 -1
  252. package/skills/qgrid/references/token-auth-quota-lifecycle.md +56 -3
  253. package/bundle/dist/node_modules/.pnpm/@jridgewell_sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.js +0 -406
  254. package/bundle/dist/node_modules/.pnpm/@vitest_expect@4.1.10/node_modules/@vitest/expect/dist/index.js +0 -1507
  255. package/bundle/dist/node_modules/.pnpm/@vitest_pretty-format@4.1.10/node_modules/@vitest/pretty-format/dist/index.js +0 -887
  256. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/chunk-artifact.js +0 -2756
  257. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/index.js +0 -8
  258. package/bundle/dist/node_modules/.pnpm/@vitest_runner@4.1.10/node_modules/@vitest/runner/dist/utils.js +0 -8
  259. package/bundle/dist/node_modules/.pnpm/@vitest_snapshot@4.1.10/node_modules/@vitest/snapshot/dist/index.js +0 -922
  260. package/bundle/dist/node_modules/.pnpm/@vitest_spy@4.1.10/node_modules/@vitest/spy/dist/index.js +0 -386
  261. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/chunk-pathe.M-eThtNZ.js +0 -121
  262. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/constants.js +0 -51
  263. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/diff.js +0 -1317
  264. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/display.js +0 -561
  265. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/error.js +0 -40
  266. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/helpers.js +0 -272
  267. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/offset.js +0 -27
  268. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/serialize.js +0 -77
  269. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/source-map.js +0 -381
  270. package/bundle/dist/node_modules/.pnpm/@vitest_utils@4.1.10/node_modules/@vitest/utils/dist/timers.js +0 -51
  271. package/bundle/dist/node_modules/.pnpm/chai@6.2.2/node_modules/chai/index.js +0 -2986
  272. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/branding.js +0 -10
  273. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/index.js +0 -109
  274. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/messages.js +0 -10
  275. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/overloads.js +0 -10
  276. package/bundle/dist/node_modules/.pnpm/expect-type@1.3.0/node_modules/expect-type/dist/utils.js +0 -10
  277. package/bundle/dist/node_modules/.pnpm/magic-string@0.30.21/node_modules/magic-string/dist/magic-string.es.js +0 -1126
  278. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/index.js +0 -21
  279. package/bundle/dist/node_modules/.pnpm/pathe@2.0.3/node_modules/pathe/dist/shared/pathe.M-eThtNZ.js +0 -432
  280. package/bundle/dist/node_modules/.pnpm/tinybench@2.9.0/node_modules/tinybench/dist/index.js +0 -517
  281. package/bundle/dist/node_modules/.pnpm/tinyrainbow@3.1.0/node_modules/tinyrainbow/dist/index.js +0 -101
  282. 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
  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/_commonjsHelpers.D26ty3Ew.js +0 -9
  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/benchmark.CX_oY03V.js +0 -41
  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/evaluatedModules.Dg1zASAC.js +0 -19
  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/chunks/index.Chj8NDwU.js +0 -202
  287. 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
  288. 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
  289. 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
  290. 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
  291. 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
  292. package/bundle/dist/testing/setup-mocks.js +0 -16
  293. package/bundle/src/testing/setup-mocks.ts +0 -44
  294. package/bundle/web-dist/client/assets/index-Bw2s88Ot.css +0 -1
  295. package/bundle/web-dist/client/assets/index-CrXKu_J8.js +0 -106
  296. package/bundle/web-dist/client/assets/logs-B2SmWJXA.js +0 -1
  297. package/bundle/web-dist/client/assets/monit-D-JwXXoA.js +0 -1
  298. package/bundle/web-dist/client/assets/plus-B62CuqT8.js +0 -1
  299. package/bundle/web-dist/client/assets/refresh-cw-NNcU0Cmq.js +0 -1
  300. package/bundle/web-dist/client/assets/request-model-CojtinqK.js +0 -1
  301. package/bundle/web-dist/client/assets/routes-C5r4gTvY.js +0 -5
  302. package/bundle/web-dist/client/assets/settings-D3tDSAck.js +0 -1
  303. package/bundle/web-dist/client/assets/show-Cah_kUKC.js +0 -2
  304. package/bundle/web-dist/client/assets/tokens-DU2Iyxxd.js +0 -1
  305. package/bundle/web-dist/client/assets/use-oauth-login-flow-D0UaR9_e.js +0 -1
  306. package/bundle/web-dist/client/assets/use-update-token-mutation-DAq0F8p-.js +0 -1
  307. package/bundle/web-dist/client/assets/vendor-react-DH4kUfK2.js +0 -9
  308. package/bundle/web-dist/client/assets/vendor-tanstack-DJRQAbrY.js +0 -1
  309. package/bundle/web-dist/server/assets/logs-l91avYif.js +0 -509
  310. package/bundle/web-dist/server/assets/plus-KZrECewT.js +0 -19
  311. package/bundle/web-dist/server/assets/refresh-cw-BND93JrF.js +0 -23
  312. package/bundle/web-dist/server/assets/settings-BZR5HSAL.js +0 -461
  313. package/bundle/web-dist/server/assets/tokens-D1hb4eKk.js +0 -448
  314. package/bundle/web-dist/server/assets/use-oauth-login-flow-Cvdy0zF8.js +0 -178
  315. package/dist/cli.d.ts +0 -10
  316. /package/bundle/web-dist/client/assets/{cost-DH2jZbrw.js → cost-DB3HbU7T.js} +0 -0
  317. /package/bundle/web-dist/client/assets/{preload-helper-ca-nBW7U.js → preload-helper-DWTEM3RW.js} +0 -0
  318. /package/bundle/web-dist/server/assets/{cost-eEHeTRT5.js → cost-BC9yzyA9.js} +0 -0
@@ -0,0 +1,1038 @@
1
+ import { F as require_react, N as useQueryClient, k as require_jsx_dev_runtime, n as QgridService, o as TokenService, tt as __toESM } from "./services.generated-DQATJ6qf.js";
2
+ import { i as o, n as useOAuthLoginFlow, r as OAuthCodeEntry } from "./use-oauth-login-flow-CKDHgc3U.js";
3
+ import { u as lucideKeyRound } from "../entry-server.generated.js";
4
+ import { t as useUpdateTokenMutation } from "./use-update-token-mutation-BEbgOzaa.js";
5
+ import { t as lucidePlus } from "./plus-DwG7h9kq.js";
6
+ //#region src/components/qgrid/DeviceCodeEntry.tsx
7
+ var import_react = /* @__PURE__ */ __toESM(require_react(), 1);
8
+ var import_jsx_dev_runtime = require_jsx_dev_runtime();
9
+ var _jsxFileName$5 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/DeviceCodeEntry.tsx";
10
+ function formatRemaining(ms) {
11
+ const totalSec = Math.max(Math.ceil(ms / 1e3), 0);
12
+ const m = Math.floor(totalSec / 60);
13
+ const s = totalSec % 60;
14
+ return `${m}:${String(s).padStart(2, "0")}`;
15
+ }
16
+ /** 만료 시각까지 1초마다 갱신되는 남은 시간. */
17
+ function Countdown({ expiresAt }) {
18
+ const [now, setNow] = (0, import_react.useState)(() => Date.now());
19
+ (0, import_react.useEffect)(() => {
20
+ const id = window.setInterval(() => setNow(Date.now()), 1e3);
21
+ return () => clearInterval(id);
22
+ }, []);
23
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
24
+ className: "tabular-nums",
25
+ children: formatRemaining(expiresAt - now)
26
+ }, void 0, false, {
27
+ fileName: _jsxFileName$5,
28
+ lineNumber: 22,
29
+ columnNumber: 10
30
+ }, this);
31
+ }
32
+ /**
33
+ * Grok device-code 로그인 단계. 사용자 코드와 인증 링크를 보여 주고, 폴링 상태를 표시한다.
34
+ * 폴링 자체는 `useOAuthLoginFlow().startDevice` 가 소유한다.
35
+ */
36
+ function DeviceCodeEntry({ flow, onRestart }) {
37
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
38
+ className: "space-y-2",
39
+ children: [
40
+ flow.status === "starting" && /* @__PURE__ */ (void 0)("p", {
41
+ className: "flex items-center gap-1.5 text-[12px] text-sand-600",
42
+ children: [/* @__PURE__ */ (void 0)("span", { className: "w-3.5 h-3.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
43
+ fileName: _jsxFileName$5,
44
+ lineNumber: 40,
45
+ columnNumber: 11
46
+ }, this), "Requesting device code..."]
47
+ }, void 0, true, {
48
+ fileName: _jsxFileName$5,
49
+ lineNumber: 39,
50
+ columnNumber: 9
51
+ }, this),
52
+ flow.status === "waiting" && /* @__PURE__ */ (void 0)(import_jsx_dev_runtime.Fragment, { children: [
53
+ /* @__PURE__ */ (void 0)("p", {
54
+ className: "text-[12px] text-sand-600 leading-relaxed",
55
+ children: "아래 링크를 열어 xAI 계정으로 로그인한 뒤 이 코드를 입력하세요. 승인되면 토큰이 자동으로 추가됩니다."
56
+ }, void 0, false, {
57
+ fileName: _jsxFileName$5,
58
+ lineNumber: 47,
59
+ columnNumber: 11
60
+ }, this),
61
+ /* @__PURE__ */ (void 0)("div", {
62
+ className: "rounded-md border border-sand-200 bg-sand-50 px-3 py-3 text-center",
63
+ children: [/* @__PURE__ */ (void 0)("p", {
64
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
65
+ children: "Device code"
66
+ }, void 0, false, {
67
+ fileName: _jsxFileName$5,
68
+ lineNumber: 52,
69
+ columnNumber: 13
70
+ }, this), /* @__PURE__ */ (void 0)("p", {
71
+ className: "mt-1 font-mono text-lg tracking-widest text-sand-900 select-all",
72
+ children: flow.userCode
73
+ }, void 0, false, {
74
+ fileName: _jsxFileName$5,
75
+ lineNumber: 55,
76
+ columnNumber: 13
77
+ }, this)]
78
+ }, void 0, true, {
79
+ fileName: _jsxFileName$5,
80
+ lineNumber: 51,
81
+ columnNumber: 11
82
+ }, this),
83
+ /* @__PURE__ */ (void 0)("a", {
84
+ href: flow.verificationUriComplete ?? flow.verificationUri,
85
+ target: "_blank",
86
+ rel: "noopener noreferrer",
87
+ className: "block w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white text-center hover:bg-sand-800 transition-colors duration-150",
88
+ children: "Open xAI to approve"
89
+ }, void 0, false, {
90
+ fileName: _jsxFileName$5,
91
+ lineNumber: 59,
92
+ columnNumber: 11
93
+ }, this),
94
+ /* @__PURE__ */ (void 0)("p", {
95
+ className: "flex items-center justify-between text-[11px] text-sand-500",
96
+ children: [/* @__PURE__ */ (void 0)("span", {
97
+ className: "flex items-center gap-1.5",
98
+ children: [/* @__PURE__ */ (void 0)("span", { className: "w-2.5 h-2.5 border-2 border-sand-400 border-t-transparent rounded-full animate-spin" }, void 0, false, {
99
+ fileName: _jsxFileName$5,
100
+ lineNumber: 69,
101
+ columnNumber: 15
102
+ }, this), flow.slowDown ? "Waiting for approval (polling slowed down)..." : "Waiting for approval..."]
103
+ }, void 0, true, {
104
+ fileName: _jsxFileName$5,
105
+ lineNumber: 68,
106
+ columnNumber: 13
107
+ }, this), /* @__PURE__ */ (void 0)("span", { children: ["expires in ", /* @__PURE__ */ (void 0)(Countdown, { expiresAt: flow.expiresAt }, void 0, false, {
108
+ fileName: _jsxFileName$5,
109
+ lineNumber: 75,
110
+ columnNumber: 26
111
+ }, this)] }, void 0, true, {
112
+ fileName: _jsxFileName$5,
113
+ lineNumber: 74,
114
+ columnNumber: 13
115
+ }, this)]
116
+ }, void 0, true, {
117
+ fileName: _jsxFileName$5,
118
+ lineNumber: 67,
119
+ columnNumber: 11
120
+ }, this)
121
+ ] }, void 0, true),
122
+ flow.status === "added" && /* @__PURE__ */ (void 0)("p", {
123
+ className: "text-[12px] text-sage-600",
124
+ children: [
125
+ "Token \"",
126
+ flow.name,
127
+ "\" added."
128
+ ]
129
+ }, void 0, true, {
130
+ fileName: _jsxFileName$5,
131
+ lineNumber: 82,
132
+ columnNumber: 9
133
+ }, this),
134
+ flow.status === "expired" && /* @__PURE__ */ (void 0)("p", {
135
+ className: "text-[11px] text-red-500",
136
+ children: "Device code가 만료되었습니다 — 로그인을 다시 시작하세요."
137
+ }, void 0, false, {
138
+ fileName: _jsxFileName$5,
139
+ lineNumber: 86,
140
+ columnNumber: 9
141
+ }, this),
142
+ flow.status === "error" && /* @__PURE__ */ (void 0)("p", {
143
+ className: "text-[11px] text-red-500",
144
+ children: flow.message
145
+ }, void 0, false, {
146
+ fileName: _jsxFileName$5,
147
+ lineNumber: 91,
148
+ columnNumber: 35
149
+ }, this),
150
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
151
+ type: "button",
152
+ className: "w-full py-1.5 text-[12px] text-sand-500 hover:text-sand-700 transition-colors duration-150",
153
+ onClick: onRestart,
154
+ children: "처음부터 다시 시작"
155
+ }, void 0, false, {
156
+ fileName: _jsxFileName$5,
157
+ lineNumber: 93,
158
+ columnNumber: 7
159
+ }, this)
160
+ ]
161
+ }, void 0, true, {
162
+ fileName: _jsxFileName$5,
163
+ lineNumber: 37,
164
+ columnNumber: 5
165
+ }, this);
166
+ }
167
+ //#endregion
168
+ //#region src/components/qgrid/AddTokenModal.tsx
169
+ var _jsxFileName$4 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/AddTokenModal.tsx";
170
+ function Spinner({ light }) {
171
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
172
+ className: "flex items-center gap-1.5",
173
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: `w-3.5 h-3.5 border-2 border-t-transparent rounded-full animate-spin ${light ? "border-white" : "border-sand-400"}` }, void 0, false, {
174
+ fileName: _jsxFileName$4,
175
+ lineNumber: 13,
176
+ columnNumber: 7
177
+ }, this), "Waiting for login..."]
178
+ }, void 0, true, {
179
+ fileName: _jsxFileName$4,
180
+ lineNumber: 12,
181
+ columnNumber: 5
182
+ }, this);
183
+ }
184
+ function OrDivider() {
185
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
186
+ className: "flex items-center gap-3",
187
+ children: [
188
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex-1 h-px bg-sand-200" }, void 0, false, {
189
+ fileName: _jsxFileName$4,
190
+ lineNumber: 24,
191
+ columnNumber: 7
192
+ }, this),
193
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
194
+ className: "text-[10px] text-sand-400 uppercase",
195
+ children: "or"
196
+ }, void 0, false, {
197
+ fileName: _jsxFileName$4,
198
+ lineNumber: 25,
199
+ columnNumber: 7
200
+ }, this),
201
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "flex-1 h-px bg-sand-200" }, void 0, false, {
202
+ fileName: _jsxFileName$4,
203
+ lineNumber: 26,
204
+ columnNumber: 7
205
+ }, this)
206
+ ]
207
+ }, void 0, true, {
208
+ fileName: _jsxFileName$4,
209
+ lineNumber: 23,
210
+ columnNumber: 5
211
+ }, this);
212
+ }
213
+ /** Provider 선택 버튼들. 상태는 상위(`useOAuthLoginFlow`)가 소유한다. */
214
+ function AddTokenProviderOptions({ disabled, loadingProvider, onStart, onStartGrokDevice }) {
215
+ const secondary = "w-full py-2.5 text-sm font-medium rounded-md border border-sand-300 text-sand-700 hover:bg-sand-100 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2";
216
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
217
+ className: "space-y-2",
218
+ children: [
219
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
220
+ type: "button",
221
+ className: "w-full py-2.5 text-sm font-medium rounded-md bg-sand-900 text-white hover:bg-sand-800 disabled:opacity-50 transition-colors duration-150 flex items-center justify-center gap-2",
222
+ disabled,
223
+ onClick: () => onStart("openai"),
224
+ children: loadingProvider === "openai" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: true }, void 0, false, {
225
+ fileName: _jsxFileName$4,
226
+ lineNumber: 55,
227
+ columnNumber: 11
228
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
229
+ fileName: _jsxFileName$4,
230
+ lineNumber: 58,
231
+ columnNumber: 13
232
+ }, this), "Login with OpenAI"] }, void 0, true)
233
+ }, void 0, false, {
234
+ fileName: _jsxFileName$4,
235
+ lineNumber: 48,
236
+ columnNumber: 7
237
+ }, this),
238
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(OrDivider, {}, void 0, false, {
239
+ fileName: _jsxFileName$4,
240
+ lineNumber: 64,
241
+ columnNumber: 7
242
+ }, this),
243
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
244
+ type: "button",
245
+ className: secondary,
246
+ disabled,
247
+ onClick: () => onStart("anthropic"),
248
+ children: loadingProvider === "anthropic" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: false }, void 0, false, {
249
+ fileName: _jsxFileName$4,
250
+ lineNumber: 73,
251
+ columnNumber: 11
252
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
253
+ fileName: _jsxFileName$4,
254
+ lineNumber: 76,
255
+ columnNumber: 13
256
+ }, this), "Login with Claude"] }, void 0, true)
257
+ }, void 0, false, {
258
+ fileName: _jsxFileName$4,
259
+ lineNumber: 66,
260
+ columnNumber: 7
261
+ }, this),
262
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(OrDivider, {}, void 0, false, {
263
+ fileName: _jsxFileName$4,
264
+ lineNumber: 82,
265
+ columnNumber: 7
266
+ }, this),
267
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
268
+ type: "button",
269
+ className: secondary,
270
+ disabled,
271
+ onClick: onStartGrokDevice,
272
+ children: loadingProvider === "grok" ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(Spinner, { light: false }, void 0, false, {
273
+ fileName: _jsxFileName$4,
274
+ lineNumber: 86,
275
+ columnNumber: 11
276
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideKeyRound, { className: "size-4" }, void 0, false, {
277
+ fileName: _jsxFileName$4,
278
+ lineNumber: 89,
279
+ columnNumber: 13
280
+ }, this), "Login with xAI"] }, void 0, true)
281
+ }, void 0, false, {
282
+ fileName: _jsxFileName$4,
283
+ lineNumber: 84,
284
+ columnNumber: 7
285
+ }, this)
286
+ ]
287
+ }, void 0, true, {
288
+ fileName: _jsxFileName$4,
289
+ lineNumber: 47,
290
+ columnNumber: 5
291
+ }, this);
292
+ }
293
+ function AddTokenModal() {
294
+ const [open, setOpen] = (0, import_react.useState)(false);
295
+ const [name, setName] = (0, import_react.useState)("");
296
+ const oauth = useOAuthLoginFlow();
297
+ const close = () => {
298
+ setOpen(false);
299
+ setName("");
300
+ oauth.reset();
301
+ };
302
+ const submitPastedCode = async (pastedCode) => {
303
+ if (await oauth.submitCode(pastedCode)) close();
304
+ };
305
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
306
+ type: "button",
307
+ className: "px-3.5 py-1.5 text-[12px] font-medium rounded-lg bg-sienna-500 text-white hover:bg-sienna-600 disabled:opacity-50 transition-all duration-150 active:scale-[0.97] flex items-center gap-1.5 shadow-sm",
308
+ onClick: () => setOpen(true),
309
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucidePlus, { className: "size-3.5" }, void 0, false, {
310
+ fileName: _jsxFileName$4,
311
+ lineNumber: 120,
312
+ columnNumber: 9
313
+ }, this), "Add Token"]
314
+ }, void 0, true, {
315
+ fileName: _jsxFileName$4,
316
+ lineNumber: 115,
317
+ columnNumber: 7
318
+ }, this), open && /* @__PURE__ */ (void 0)("div", {
319
+ className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
320
+ children: [/* @__PURE__ */ (void 0)("div", {
321
+ className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
322
+ onClick: close,
323
+ onKeyDown: () => {}
324
+ }, void 0, false, {
325
+ fileName: _jsxFileName$4,
326
+ lineNumber: 126,
327
+ columnNumber: 11
328
+ }, this), /* @__PURE__ */ (void 0)("div", {
329
+ className: "relative panel shadow-xl w-full max-w-md mx-4",
330
+ children: [
331
+ /* @__PURE__ */ (void 0)("div", {
332
+ className: "px-5 py-4 border-b border-sand-100/50",
333
+ children: /* @__PURE__ */ (void 0)("h2", {
334
+ className: "text-base font-medium text-sand-900",
335
+ children: "Add Token"
336
+ }, void 0, false, {
337
+ fileName: _jsxFileName$4,
338
+ lineNumber: 134,
339
+ columnNumber: 15
340
+ }, this)
341
+ }, void 0, false, {
342
+ fileName: _jsxFileName$4,
343
+ lineNumber: 133,
344
+ columnNumber: 13
345
+ }, this),
346
+ /* @__PURE__ */ (void 0)("div", {
347
+ className: "px-5 py-4 space-y-4",
348
+ children: [/* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("label", {
349
+ htmlFor: "token-name",
350
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
351
+ children: "Name *"
352
+ }, void 0, false, {
353
+ fileName: _jsxFileName$4,
354
+ lineNumber: 140,
355
+ columnNumber: 17
356
+ }, this), /* @__PURE__ */ (void 0)(o, {
357
+ value: name,
358
+ onChange: (e) => setName(e.target.value),
359
+ placeholder: "e.g. your-token-name",
360
+ className: "mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300"
361
+ }, void 0, false, {
362
+ fileName: _jsxFileName$4,
363
+ lineNumber: 146,
364
+ columnNumber: 17
365
+ }, this)] }, void 0, true, {
366
+ fileName: _jsxFileName$4,
367
+ lineNumber: 139,
368
+ columnNumber: 15
369
+ }, this), oauth.codeEntryProvider ? /* @__PURE__ */ (void 0)(OAuthCodeEntry, {
370
+ provider: oauth.codeEntryProvider,
371
+ isPending: oauth.completeMutation.isPending,
372
+ isError: oauth.completeMutation.isError,
373
+ onSubmit: (code) => void submitPastedCode(code),
374
+ onRestart: oauth.reset
375
+ }, void 0, false, {
376
+ fileName: _jsxFileName$4,
377
+ lineNumber: 156,
378
+ columnNumber: 17
379
+ }, this) : oauth.deviceFlow ? /* @__PURE__ */ (void 0)(DeviceCodeEntry, {
380
+ flow: oauth.deviceFlow,
381
+ onRestart: oauth.reset
382
+ }, void 0, false, {
383
+ fileName: _jsxFileName$4,
384
+ lineNumber: 164,
385
+ columnNumber: 17
386
+ }, this) : /* @__PURE__ */ (void 0)(AddTokenProviderOptions, {
387
+ disabled: !name.trim() || oauth.loadingProvider !== null,
388
+ loadingProvider: oauth.loadingProvider,
389
+ onStart: (provider) => void oauth.start(provider, name),
390
+ onStartGrokDevice: () => void oauth.startDevice(name, close)
391
+ }, void 0, false, {
392
+ fileName: _jsxFileName$4,
393
+ lineNumber: 166,
394
+ columnNumber: 17
395
+ }, this)]
396
+ }, void 0, true, {
397
+ fileName: _jsxFileName$4,
398
+ lineNumber: 137,
399
+ columnNumber: 13
400
+ }, this),
401
+ /* @__PURE__ */ (void 0)("div", {
402
+ className: "px-5 py-3 border-t border-sand-100/50 flex items-center justify-end gap-2",
403
+ children: /* @__PURE__ */ (void 0)("button", {
404
+ type: "button",
405
+ className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
406
+ onClick: close,
407
+ children: "Cancel"
408
+ }, void 0, false, {
409
+ fileName: _jsxFileName$4,
410
+ lineNumber: 176,
411
+ columnNumber: 15
412
+ }, this)
413
+ }, void 0, false, {
414
+ fileName: _jsxFileName$4,
415
+ lineNumber: 175,
416
+ columnNumber: 13
417
+ }, this)
418
+ ]
419
+ }, void 0, true, {
420
+ fileName: _jsxFileName$4,
421
+ lineNumber: 132,
422
+ columnNumber: 11
423
+ }, this)]
424
+ }, void 0, true, {
425
+ fileName: _jsxFileName$4,
426
+ lineNumber: 125,
427
+ columnNumber: 9
428
+ }, this)] }, void 0, true);
429
+ }
430
+ //#endregion
431
+ //#region ~icons/lucide/pencil.jsx
432
+ var _jsxFileName$3 = "~icons/lucide/pencil.jsx";
433
+ var lucidePencil = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
434
+ viewBox: "0 0 24 24",
435
+ width: "1.2em",
436
+ height: "1.2em",
437
+ ...props,
438
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
439
+ fill: "none",
440
+ stroke: "currentColor",
441
+ strokeLinecap: "round",
442
+ strokeLinejoin: "round",
443
+ strokeWidth: 2,
444
+ d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497zM15 5l4 4"
445
+ }, void 0, false, {
446
+ fileName: _jsxFileName$3,
447
+ lineNumber: 2,
448
+ columnNumber: 96
449
+ }, void 0)
450
+ }, void 0, false, {
451
+ fileName: _jsxFileName$3,
452
+ lineNumber: 2,
453
+ columnNumber: 31
454
+ }, void 0);
455
+ //#endregion
456
+ //#region ~icons/lucide/trash-2.jsx
457
+ var _jsxFileName$2 = "~icons/lucide/trash-2.jsx";
458
+ var lucideTrash2 = (props) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("svg", {
459
+ viewBox: "0 0 24 24",
460
+ width: "1.2em",
461
+ height: "1.2em",
462
+ ...props,
463
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("path", {
464
+ fill: "none",
465
+ stroke: "currentColor",
466
+ strokeLinecap: "round",
467
+ strokeLinejoin: "round",
468
+ strokeWidth: 2,
469
+ d: "M10 11v6m4-6v6m5-11v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"
470
+ }, void 0, false, {
471
+ fileName: _jsxFileName$2,
472
+ lineNumber: 2,
473
+ columnNumber: 96
474
+ }, void 0)
475
+ }, void 0, false, {
476
+ fileName: _jsxFileName$2,
477
+ lineNumber: 2,
478
+ columnNumber: 31
479
+ }, void 0);
480
+ //#endregion
481
+ //#region src/lib/token-label.ts
482
+ function maskAccessToken(credentials) {
483
+ const token = credentials.accessToken;
484
+ if (!token) return "—";
485
+ return token.length <= 12 ? token : `${token.slice(0, 8)}...${token.slice(-4)}`;
486
+ }
487
+ //#endregion
488
+ //#region src/components/qgrid/TokenTable.tsx
489
+ var _jsxFileName$1 = "/home/runner/work/qgrid/qgrid/packages/web/src/components/qgrid/TokenTable.tsx";
490
+ function getExpiresAt(token) {
491
+ const c = token.credentials;
492
+ if ("accessTokenExpiresAt" in c) return c.accessTokenExpiresAt;
493
+ if ("authMode" in c) {
494
+ const ms = Date.parse(c.expiresAt);
495
+ return Number.isNaN(ms) ? null : ms;
496
+ }
497
+ return c.expiresAt;
498
+ }
499
+ function formatExpiry(expiresAt) {
500
+ if (!expiresAt) return {
501
+ text: "",
502
+ color: ""
503
+ };
504
+ const diff = expiresAt - Date.now();
505
+ if (diff <= 0) return {
506
+ text: "expired",
507
+ color: "text-red-500"
508
+ };
509
+ const h = Math.floor(diff / 36e5);
510
+ const m = Math.floor(diff % 36e5 / 6e4);
511
+ const text = h > 0 ? `${h}h ${m}m` : `${m}m`;
512
+ if (diff < 36e5) return {
513
+ text,
514
+ color: "text-amber-500"
515
+ };
516
+ return {
517
+ text,
518
+ color: "text-sand-400"
519
+ };
520
+ }
521
+ function TokenTable({ data, isLoading }) {
522
+ const [deleteTarget, setDeleteTarget] = (0, import_react.useState)(null);
523
+ const [editTarget, setEditTarget] = (0, import_react.useState)(null);
524
+ const [editName, setEditName] = (0, import_react.useState)("");
525
+ const queryClient = useQueryClient();
526
+ const removeMutation = QgridService.useRemoveTokenMutation();
527
+ const updateMutation = useUpdateTokenMutation();
528
+ const toggleMutation = QgridService.useToggleTokenMutation();
529
+ const invalidate = () => Promise.all([queryClient.invalidateQueries({ queryKey: ["Token"] }), queryClient.invalidateQueries({ queryKey: ["Qgrid"] })]);
530
+ const handleToggle = async (token) => {
531
+ await toggleMutation.mutateAsync({ id: token.id });
532
+ await invalidate();
533
+ };
534
+ const handleDelete = async () => {
535
+ if (!deleteTarget) return;
536
+ await removeMutation.mutateAsync({ id: deleteTarget.id });
537
+ await invalidate();
538
+ setDeleteTarget(null);
539
+ };
540
+ const openEdit = (token) => {
541
+ setEditTarget(token);
542
+ setEditName(token.name ?? "");
543
+ };
544
+ const handleUpdate = async () => {
545
+ if (!editTarget) return;
546
+ await updateMutation.mutateAsync({
547
+ id: editTarget.id,
548
+ name: editName.trim()
549
+ });
550
+ await invalidate();
551
+ setEditTarget(null);
552
+ };
553
+ if (isLoading) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
554
+ className: "space-y-2",
555
+ children: Array.from({ length: 3 }).map((_, i) => /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", { className: "h-12 bg-sand-100 rounded-md animate-pulse" }, `skeleton-${i}`, false, {
556
+ fileName: _jsxFileName$1,
557
+ lineNumber: 101,
558
+ columnNumber: 11
559
+ }, this))
560
+ }, void 0, false, {
561
+ fileName: _jsxFileName$1,
562
+ lineNumber: 99,
563
+ columnNumber: 7
564
+ }, this);
565
+ const tokens = data ?? [];
566
+ if (tokens.length === 0) return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
567
+ className: "text-sand-400 text-center py-16 text-sm",
568
+ children: [
569
+ "No tokens registered. Click ",
570
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("strong", {
571
+ className: "text-sand-600",
572
+ children: "Add Token"
573
+ }, void 0, false, {
574
+ fileName: _jsxFileName$1,
575
+ lineNumber: 112,
576
+ columnNumber: 37
577
+ }, this),
578
+ " to get started."
579
+ ]
580
+ }, void 0, true, {
581
+ fileName: _jsxFileName$1,
582
+ lineNumber: 111,
583
+ columnNumber: 7
584
+ }, this);
585
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(import_jsx_dev_runtime.Fragment, { children: [
586
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
587
+ className: "panel overflow-hidden",
588
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
589
+ className: "overflow-x-auto",
590
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("table", {
591
+ className: "w-full min-w-[640px] text-[13px]",
592
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("thead", { children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tr", {
593
+ className: "panel-header",
594
+ children: [
595
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
596
+ className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
597
+ children: "Provider"
598
+ }, void 0, false, {
599
+ fileName: _jsxFileName$1,
600
+ lineNumber: 127,
601
+ columnNumber: 17
602
+ }, this),
603
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
604
+ className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
605
+ children: "Name"
606
+ }, void 0, false, {
607
+ fileName: _jsxFileName$1,
608
+ lineNumber: 130,
609
+ columnNumber: 17
610
+ }, this),
611
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
612
+ className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
613
+ children: "Token"
614
+ }, void 0, false, {
615
+ fileName: _jsxFileName$1,
616
+ lineNumber: 133,
617
+ columnNumber: 17
618
+ }, this),
619
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
620
+ className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
621
+ children: "Status"
622
+ }, void 0, false, {
623
+ fileName: _jsxFileName$1,
624
+ lineNumber: 136,
625
+ columnNumber: 17
626
+ }, this),
627
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", {
628
+ className: "text-left px-5 py-2.5 text-[10px] uppercase tracking-wider text-sand-400 font-medium",
629
+ children: "Expires"
630
+ }, void 0, false, {
631
+ fileName: _jsxFileName$1,
632
+ lineNumber: 139,
633
+ columnNumber: 17
634
+ }, this),
635
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("th", { className: "w-20 px-3 py-2.5" }, void 0, false, {
636
+ fileName: _jsxFileName$1,
637
+ lineNumber: 142,
638
+ columnNumber: 17
639
+ }, this)
640
+ ]
641
+ }, void 0, true, {
642
+ fileName: _jsxFileName$1,
643
+ lineNumber: 126,
644
+ columnNumber: 15
645
+ }, this) }, void 0, false, {
646
+ fileName: _jsxFileName$1,
647
+ lineNumber: 125,
648
+ columnNumber: 13
649
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tbody", {
650
+ className: "divide-y divide-sand-100/80",
651
+ children: tokens.map((token) => {
652
+ const expiry = formatExpiry(getExpiresAt(token));
653
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("tr", {
654
+ className: `transition-colors duration-150 hover:bg-sand-100/60 ${token.active ? "" : "opacity-50"}`,
655
+ children: [
656
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
657
+ className: "px-5 py-3",
658
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
659
+ className: "text-xs font-medium text-sand-500 uppercase",
660
+ children: token.provider
661
+ }, void 0, false, {
662
+ fileName: _jsxFileName$1,
663
+ lineNumber: 155,
664
+ columnNumber: 23
665
+ }, this)
666
+ }, void 0, false, {
667
+ fileName: _jsxFileName$1,
668
+ lineNumber: 154,
669
+ columnNumber: 21
670
+ }, this),
671
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
672
+ className: "px-5 py-3",
673
+ children: token.name ? /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
674
+ className: "text-sm text-sand-700",
675
+ children: token.name
676
+ }, void 0, false, {
677
+ fileName: _jsxFileName$1,
678
+ lineNumber: 161,
679
+ columnNumber: 25
680
+ }, this) : /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", {
681
+ className: "text-[11px] text-sand-400",
682
+ children: "—"
683
+ }, void 0, false, {
684
+ fileName: _jsxFileName$1,
685
+ lineNumber: 163,
686
+ columnNumber: 25
687
+ }, this)
688
+ }, void 0, false, {
689
+ fileName: _jsxFileName$1,
690
+ lineNumber: 159,
691
+ columnNumber: 21
692
+ }, this),
693
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
694
+ className: "px-5 py-3",
695
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("code", {
696
+ className: "text-[13px] font-mono text-sand-800",
697
+ children: maskAccessToken(token.credentials)
698
+ }, void 0, false, {
699
+ fileName: _jsxFileName$1,
700
+ lineNumber: 167,
701
+ columnNumber: 23
702
+ }, this)
703
+ }, void 0, false, {
704
+ fileName: _jsxFileName$1,
705
+ lineNumber: 166,
706
+ columnNumber: 21
707
+ }, this),
708
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
709
+ className: "px-5 py-3",
710
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
711
+ type: "button",
712
+ className: `relative inline-flex h-5 w-9 items-center rounded-full transition-colors duration-200 ${token.active ? "bg-sage-400" : "bg-sand-300"}`,
713
+ onClick: () => handleToggle(token),
714
+ disabled: toggleMutation.isPending || !token.active && token.reauth_required,
715
+ title: !token.active && token.reauth_required ? "재로그인이 필요한 토큰입니다" : void 0,
716
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("span", { className: `inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform duration-200 ${token.active ? "translate-x-4.5" : "translate-x-0.5"}` }, void 0, false, {
717
+ fileName: _jsxFileName$1,
718
+ lineNumber: 185,
719
+ columnNumber: 25
720
+ }, this)
721
+ }, void 0, false, {
722
+ fileName: _jsxFileName$1,
723
+ lineNumber: 172,
724
+ columnNumber: 23
725
+ }, this)
726
+ }, void 0, false, {
727
+ fileName: _jsxFileName$1,
728
+ lineNumber: 171,
729
+ columnNumber: 21
730
+ }, this),
731
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
732
+ className: "px-5 py-3",
733
+ children: expiry.text && /* @__PURE__ */ (void 0)("span", {
734
+ className: `text-xs ${expiry.color}`,
735
+ children: expiry.text
736
+ }, void 0, false, {
737
+ fileName: _jsxFileName$1,
738
+ lineNumber: 192,
739
+ columnNumber: 25
740
+ }, this)
741
+ }, void 0, false, {
742
+ fileName: _jsxFileName$1,
743
+ lineNumber: 190,
744
+ columnNumber: 21
745
+ }, this),
746
+ /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("td", {
747
+ className: "px-3 py-3",
748
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
749
+ className: "flex items-center gap-1",
750
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
751
+ type: "button",
752
+ className: "p-1 rounded text-sand-400 hover:text-sienna-500 transition-colors duration-150",
753
+ onClick: () => openEdit(token),
754
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucidePencil, { className: "size-4" }, void 0, false, {
755
+ fileName: _jsxFileName$1,
756
+ lineNumber: 202,
757
+ columnNumber: 27
758
+ }, this)
759
+ }, void 0, false, {
760
+ fileName: _jsxFileName$1,
761
+ lineNumber: 197,
762
+ columnNumber: 25
763
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("button", {
764
+ type: "button",
765
+ className: "p-1 rounded text-sand-400 hover:text-red-500 transition-colors duration-150",
766
+ onClick: () => setDeleteTarget(token),
767
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(lucideTrash2, { className: "size-4" }, void 0, false, {
768
+ fileName: _jsxFileName$1,
769
+ lineNumber: 209,
770
+ columnNumber: 27
771
+ }, this)
772
+ }, void 0, false, {
773
+ fileName: _jsxFileName$1,
774
+ lineNumber: 204,
775
+ columnNumber: 25
776
+ }, this)]
777
+ }, void 0, true, {
778
+ fileName: _jsxFileName$1,
779
+ lineNumber: 196,
780
+ columnNumber: 23
781
+ }, this)
782
+ }, void 0, false, {
783
+ fileName: _jsxFileName$1,
784
+ lineNumber: 195,
785
+ columnNumber: 21
786
+ }, this)
787
+ ]
788
+ }, token.id, true, {
789
+ fileName: _jsxFileName$1,
790
+ lineNumber: 150,
791
+ columnNumber: 19
792
+ }, this);
793
+ })
794
+ }, void 0, false, {
795
+ fileName: _jsxFileName$1,
796
+ lineNumber: 145,
797
+ columnNumber: 13
798
+ }, this)]
799
+ }, void 0, true, {
800
+ fileName: _jsxFileName$1,
801
+ lineNumber: 124,
802
+ columnNumber: 11
803
+ }, this)
804
+ }, void 0, false, {
805
+ fileName: _jsxFileName$1,
806
+ lineNumber: 123,
807
+ columnNumber: 9
808
+ }, this)
809
+ }, void 0, false, {
810
+ fileName: _jsxFileName$1,
811
+ lineNumber: 120,
812
+ columnNumber: 7
813
+ }, this),
814
+ editTarget && /* @__PURE__ */ (void 0)("div", {
815
+ className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
816
+ children: [/* @__PURE__ */ (void 0)("div", {
817
+ className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
818
+ onClick: () => setEditTarget(null),
819
+ onKeyDown: () => {}
820
+ }, void 0, false, {
821
+ fileName: _jsxFileName$1,
822
+ lineNumber: 224,
823
+ columnNumber: 11
824
+ }, this), /* @__PURE__ */ (void 0)("div", {
825
+ className: "relative panel shadow-xl w-full max-w-sm mx-4",
826
+ children: [
827
+ /* @__PURE__ */ (void 0)("div", {
828
+ className: "px-5 py-4 border-b border-sand-100/60",
829
+ children: /* @__PURE__ */ (void 0)("h3", {
830
+ className: "text-base font-medium text-sand-900",
831
+ children: "Edit Token"
832
+ }, void 0, false, {
833
+ fileName: _jsxFileName$1,
834
+ lineNumber: 231,
835
+ columnNumber: 15
836
+ }, this)
837
+ }, void 0, false, {
838
+ fileName: _jsxFileName$1,
839
+ lineNumber: 230,
840
+ columnNumber: 13
841
+ }, this),
842
+ /* @__PURE__ */ (void 0)("div", {
843
+ className: "px-5 py-4 space-y-3",
844
+ children: /* @__PURE__ */ (void 0)("div", { children: [/* @__PURE__ */ (void 0)("label", {
845
+ htmlFor: "token-name",
846
+ className: "text-[10px] uppercase tracking-wider text-sand-500 font-medium",
847
+ children: "Name"
848
+ }, void 0, false, {
849
+ fileName: _jsxFileName$1,
850
+ lineNumber: 235,
851
+ columnNumber: 17
852
+ }, this), /* @__PURE__ */ (void 0)(o, {
853
+ value: editName,
854
+ onChange: (e) => setEditName(e.target.value),
855
+ placeholder: "e.g. prod, dev, team-a",
856
+ className: "mt-1 w-full border border-sand-200 rounded-md px-3 py-2 text-sm text-sand-900 bg-white placeholder:text-sand-300 focus:outline-none focus:border-sienna-300"
857
+ }, void 0, false, {
858
+ fileName: _jsxFileName$1,
859
+ lineNumber: 241,
860
+ columnNumber: 17
861
+ }, this)] }, void 0, true, {
862
+ fileName: _jsxFileName$1,
863
+ lineNumber: 234,
864
+ columnNumber: 15
865
+ }, this)
866
+ }, void 0, false, {
867
+ fileName: _jsxFileName$1,
868
+ lineNumber: 233,
869
+ columnNumber: 13
870
+ }, this),
871
+ /* @__PURE__ */ (void 0)("div", {
872
+ className: "px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2",
873
+ children: [/* @__PURE__ */ (void 0)("button", {
874
+ type: "button",
875
+ className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
876
+ onClick: () => setEditTarget(null),
877
+ children: "Cancel"
878
+ }, void 0, false, {
879
+ fileName: _jsxFileName$1,
880
+ lineNumber: 250,
881
+ columnNumber: 15
882
+ }, this), /* @__PURE__ */ (void 0)("button", {
883
+ type: "button",
884
+ className: "px-3 py-1 text-xs font-medium rounded-md bg-sienna-400 text-white hover:bg-sienna-500 disabled:opacity-50 transition-colors duration-150",
885
+ disabled: updateMutation.isPending,
886
+ onClick: handleUpdate,
887
+ children: updateMutation.isPending ? "Saving..." : "Save"
888
+ }, void 0, false, {
889
+ fileName: _jsxFileName$1,
890
+ lineNumber: 257,
891
+ columnNumber: 15
892
+ }, this)]
893
+ }, void 0, true, {
894
+ fileName: _jsxFileName$1,
895
+ lineNumber: 249,
896
+ columnNumber: 13
897
+ }, this)
898
+ ]
899
+ }, void 0, true, {
900
+ fileName: _jsxFileName$1,
901
+ lineNumber: 229,
902
+ columnNumber: 11
903
+ }, this)]
904
+ }, void 0, true, {
905
+ fileName: _jsxFileName$1,
906
+ lineNumber: 223,
907
+ columnNumber: 9
908
+ }, this),
909
+ deleteTarget && /* @__PURE__ */ (void 0)("div", {
910
+ className: "fixed inset-0 z-50 flex items-start justify-center pt-[15vh]",
911
+ children: [/* @__PURE__ */ (void 0)("div", {
912
+ className: "absolute inset-0 bg-sand-900/8 backdrop-blur-sm",
913
+ onClick: () => setDeleteTarget(null),
914
+ onKeyDown: () => {}
915
+ }, void 0, false, {
916
+ fileName: _jsxFileName$1,
917
+ lineNumber: 273,
918
+ columnNumber: 11
919
+ }, this), /* @__PURE__ */ (void 0)("div", {
920
+ className: "relative panel shadow-xl w-full max-w-sm mx-4",
921
+ children: [/* @__PURE__ */ (void 0)("div", {
922
+ className: "px-5 py-4",
923
+ children: [/* @__PURE__ */ (void 0)("h3", {
924
+ className: "text-base font-medium text-sand-900",
925
+ children: "Remove Token"
926
+ }, void 0, false, {
927
+ fileName: _jsxFileName$1,
928
+ lineNumber: 280,
929
+ columnNumber: 15
930
+ }, this), /* @__PURE__ */ (void 0)("p", {
931
+ className: "text-sm text-sand-700 mt-2",
932
+ children: [
933
+ "Are you sure you want to remove",
934
+ " ",
935
+ /* @__PURE__ */ (void 0)("code", {
936
+ className: "text-[13px] font-mono text-sand-800",
937
+ children: maskAccessToken(deleteTarget.credentials)
938
+ }, void 0, false, {
939
+ fileName: _jsxFileName$1,
940
+ lineNumber: 283,
941
+ columnNumber: 17
942
+ }, this),
943
+ deleteTarget.name && /* @__PURE__ */ (void 0)("span", {
944
+ className: "text-sand-500",
945
+ children: [
946
+ " (",
947
+ deleteTarget.name,
948
+ ")"
949
+ ]
950
+ }, void 0, true, {
951
+ fileName: _jsxFileName$1,
952
+ lineNumber: 286,
953
+ columnNumber: 39
954
+ }, this),
955
+ "?"
956
+ ]
957
+ }, void 0, true, {
958
+ fileName: _jsxFileName$1,
959
+ lineNumber: 281,
960
+ columnNumber: 15
961
+ }, this)]
962
+ }, void 0, true, {
963
+ fileName: _jsxFileName$1,
964
+ lineNumber: 279,
965
+ columnNumber: 13
966
+ }, this), /* @__PURE__ */ (void 0)("div", {
967
+ className: "px-5 py-3 border-t border-sand-100/60 flex items-center justify-end gap-2",
968
+ children: [/* @__PURE__ */ (void 0)("button", {
969
+ type: "button",
970
+ className: "px-3 py-1 text-xs font-medium rounded-md border border-sand-200 text-sand-600 hover:bg-sand-100 transition-colors duration-150",
971
+ onClick: () => setDeleteTarget(null),
972
+ children: "Cancel"
973
+ }, void 0, false, {
974
+ fileName: _jsxFileName$1,
975
+ lineNumber: 291,
976
+ columnNumber: 15
977
+ }, this), /* @__PURE__ */ (void 0)("button", {
978
+ type: "button",
979
+ className: "px-3 py-1 text-xs font-medium rounded-md bg-red-500 text-white hover:bg-red-600 disabled:opacity-50 transition-colors duration-150",
980
+ disabled: removeMutation.isPending,
981
+ onClick: handleDelete,
982
+ children: removeMutation.isPending ? "Removing..." : "Remove"
983
+ }, void 0, false, {
984
+ fileName: _jsxFileName$1,
985
+ lineNumber: 298,
986
+ columnNumber: 15
987
+ }, this)]
988
+ }, void 0, true, {
989
+ fileName: _jsxFileName$1,
990
+ lineNumber: 290,
991
+ columnNumber: 13
992
+ }, this)]
993
+ }, void 0, true, {
994
+ fileName: _jsxFileName$1,
995
+ lineNumber: 278,
996
+ columnNumber: 11
997
+ }, this)]
998
+ }, void 0, true, {
999
+ fileName: _jsxFileName$1,
1000
+ lineNumber: 272,
1001
+ columnNumber: 9
1002
+ }, this)
1003
+ ] }, void 0, true);
1004
+ }
1005
+ //#endregion
1006
+ //#region src/routes/tokens.tsx?tsr-split=component
1007
+ var _jsxFileName = "/home/runner/work/qgrid/qgrid/packages/web/src/routes/tokens.tsx?tsr-split=component";
1008
+ function TokensPage() {
1009
+ const { data, isLoading } = TokenService.useTokens("A");
1010
+ return /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
1011
+ className: "max-w-6xl mx-auto space-y-4",
1012
+ children: [/* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)("div", {
1013
+ className: "flex items-center justify-end",
1014
+ children: /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(AddTokenModal, {}, void 0, false, {
1015
+ fileName: _jsxFileName,
1016
+ lineNumber: 11,
1017
+ columnNumber: 9
1018
+ }, this)
1019
+ }, void 0, false, {
1020
+ fileName: _jsxFileName,
1021
+ lineNumber: 10,
1022
+ columnNumber: 7
1023
+ }, this), /* @__PURE__ */ (0, import_jsx_dev_runtime.jsxDEV)(TokenTable, {
1024
+ data: data?.rows,
1025
+ isLoading
1026
+ }, void 0, false, {
1027
+ fileName: _jsxFileName,
1028
+ lineNumber: 13,
1029
+ columnNumber: 7
1030
+ }, this)]
1031
+ }, void 0, true, {
1032
+ fileName: _jsxFileName,
1033
+ lineNumber: 9,
1034
+ columnNumber: 10
1035
+ }, this);
1036
+ }
1037
+ //#endregion
1038
+ export { TokensPage as component };