67router 1.0.5 → 1.0.13

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 (466) hide show
  1. package/README.md +139 -190
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +4 -4
  4. package/app/.next-cli-build/build-manifest.json +3 -3
  5. package/app/.next-cli-build/prerender-manifest.json +17 -17
  6. package/app/.next-cli-build/react-loadable-manifest.json +20 -29
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  64. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  65. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  66. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  71. package/app/.next-cli-build/server/app/_not-found.rsc +9 -9
  72. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +9 -9
  73. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +9 -9
  74. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  75. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  142. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  144. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  169. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  242. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  262. package/app/.next-cli-build/server/app/callback.html +1 -1
  263. package/app/.next-cli-build/server/app/callback.rsc +9 -9
  264. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +9 -9
  265. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  266. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +9 -9
  267. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +12 -12
  269. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +12 -12
  270. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +12 -12
  271. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  272. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +12 -12
  274. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +12 -12
  275. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +12 -12
  276. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  277. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/combos.rsc +12 -12
  279. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +12 -12
  280. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +12 -12
  281. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  283. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +13 -13
  284. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +13 -13
  285. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +13 -13
  286. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  287. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +12 -12
  289. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +12 -12
  290. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +12 -12
  291. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  292. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  293. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +12 -12
  294. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +12 -12
  295. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +12 -12
  296. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  297. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/profile.rsc +12 -12
  299. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +12 -12
  300. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +12 -12
  301. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  302. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  303. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +12 -12
  304. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +12 -12
  305. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +12 -12
  306. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  307. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/providers.rsc +12 -12
  309. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +12 -12
  310. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +12 -12
  311. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  312. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  313. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +12 -12
  314. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +12 -12
  315. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +12 -12
  316. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  317. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +12 -12
  319. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +12 -12
  320. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +12 -12
  321. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  323. package/app/.next-cli-build/server/app/dashboard/quota.rsc +13 -13
  324. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +13 -13
  325. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +13 -13
  326. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +9 -9
  331. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +9 -9
  332. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  333. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +9 -9
  334. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/skills.rsc +12 -12
  336. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +12 -12
  337. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +12 -12
  338. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +12 -12
  341. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +12 -12
  342. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +12 -12
  343. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  344. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/translator.rsc +12 -12
  346. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +12 -12
  347. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +12 -12
  348. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  349. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  350. package/app/.next-cli-build/server/app/dashboard/usage.rsc +13 -13
  351. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +13 -13
  352. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +13 -13
  353. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  355. package/app/.next-cli-build/server/app/dashboard.rsc +13 -13
  356. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +13 -13
  357. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +13 -13
  358. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  359. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/index.html +1 -1
  361. package/app/.next-cli-build/server/app/index.rsc +9 -9
  362. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +9 -9
  363. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +9 -9
  364. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  365. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  367. package/app/.next-cli-build/server/app/landing.html +1 -1
  368. package/app/.next-cli-build/server/app/landing.rsc +9 -9
  369. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +9 -9
  370. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  371. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +9 -9
  372. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  374. package/app/.next-cli-build/server/app/login.html +1 -1
  375. package/app/.next-cli-build/server/app/login.rsc +11 -11
  376. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +11 -11
  377. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +11 -11
  379. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  382. package/app/.next-cli-build/server/app-paths-manifest.json +4 -4
  383. package/app/.next-cli-build/server/chunks/3449.js +1 -1
  384. package/app/.next-cli-build/server/chunks/412.js +2 -2
  385. package/app/.next-cli-build/server/chunks/4190.js +1 -1
  386. package/app/.next-cli-build/server/chunks/4254.js +1 -0
  387. package/app/.next-cli-build/server/chunks/5500.js +1 -1
  388. package/app/.next-cli-build/server/chunks/5946.js +6 -6
  389. package/app/.next-cli-build/server/chunks/6540.js +1 -1
  390. package/app/.next-cli-build/server/chunks/7037.js +1 -1
  391. package/app/.next-cli-build/server/chunks/7066.js +1 -1
  392. package/app/.next-cli-build/server/chunks/827.js +1 -1
  393. package/app/.next-cli-build/server/chunks/869.js +1 -1
  394. package/app/.next-cli-build/server/chunks/9604.js +1 -1
  395. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  396. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  397. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  398. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/pages/404.html +1 -1
  400. package/app/.next-cli-build/server/pages/500.html +1 -1
  401. package/app/.next-cli-build/static/chunks/124.c1b5af11afe50408.js +1 -0
  402. package/app/.next-cli-build/static/chunks/2435.73c540d31dae9ecf.js +1 -0
  403. package/app/.next-cli-build/static/chunks/2694-e38089f3fbc4f795.js +18 -0
  404. package/app/.next-cli-build/static/chunks/3521.f0ac0c88103b9f6c.js +1 -0
  405. package/app/.next-cli-build/static/chunks/5497-424fa4c770985a02.js +7 -0
  406. package/app/.next-cli-build/static/chunks/5524.a4e52491e3114015.js +1 -0
  407. package/app/.next-cli-build/static/chunks/6808-54de8b855aaccfa4.js +1 -0
  408. package/app/.next-cli-build/static/chunks/7309-733bb48477dcf18e.js +1 -0
  409. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-5a39e2c930083958.js → page-11398bffb8f731d6.js} +1 -1
  410. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-efa13471ca90cb6f.js → page-4b6f03d26918f2c8.js} +1 -1
  411. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-1b13e2f309dace52.js +1 -0
  412. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-52812c2f1eec1542.js +1 -0
  413. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-4533d3729d0f3d2f.js → page-3f9ff52f7de3d5ce.js} +1 -1
  414. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-fb985695b0a7fece.js +1 -0
  415. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-99efb86d0bd7063d.js → page-cc18e2e55c9fc034.js} +1 -1
  416. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-34a9de93009415b2.js → page-98408a15a31af09e.js} +1 -1
  417. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-259a9fbcb19b32bb.js +4 -0
  418. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-e49129de51260b20.js → page-be260619b6663f68.js} +1 -1
  419. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-0527ed7a1e5796d2.js → page-eb32542bad219188.js} +1 -1
  420. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-1f58f279da3d1d2e.js +1 -0
  421. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-e293bc909c375fda.js +1 -0
  422. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-4af847c5b1581140.js +27 -0
  423. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-8c4efaab91f7315d.js → page-64c2ea1d68752a95.js} +1 -1
  424. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-4598bf7897896efe.js +1 -0
  425. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-e104456d4f92f5d7.js +4 -0
  426. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/{page-0d4b8225aa2a0570.js → page-90866408d05de0ea.js} +1 -1
  427. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-c2e6b6ae60d66ee6.js → page-3f4373ff4d41429d.js} +1 -1
  428. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-44136b54dd60ab1a.js → page-d30a8e3bcd1739fe.js} +1 -1
  429. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/{page-4b073ba7273cde14.js → page-2d72a14feff46003.js} +1 -1
  430. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-9219cd8e2828aeb2.js → page-0aac17733e26291b.js} +1 -1
  431. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-f30d37a1c0a41094.js +1 -0
  432. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-85b42e3587cdd780.js → layout-e2a9c08e575d5fb1.js} +1 -1
  433. package/app/.next-cli-build/static/chunks/app/{layout-53a33c2d919bd8e4.js → layout-6693e2013812704c.js} +1 -1
  434. package/app/.next-cli-build/static/chunks/app/login/{page-8c450d820c6b4a84.js → page-424bb7b9a4fadbef.js} +1 -1
  435. package/app/.next-cli-build/static/chunks/webpack-5f3126bff1640c83.js +1 -0
  436. package/app/.next-cli-build/static/css/9ade909ac2a94202.css +1 -0
  437. package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-shm +0 -0
  438. package/app/cli/.build-home/AppData/Roaming/67router/db/data.sqlite-wal +0 -0
  439. package/app/package.json +1 -1
  440. package/cli.js +54 -54
  441. package/package.json +1 -1
  442. package/src/cli/tray/tray.ps1 +64 -10
  443. package/src/cli/tray/trayWin.js +38 -15
  444. package/app/.next-cli-build/server/chunks/6708.js +0 -1
  445. package/app/.next-cli-build/server/chunks/7121.js +0 -1
  446. package/app/.next-cli-build/static/chunks/124.c092990b4bdb9713.js +0 -1
  447. package/app/.next-cli-build/static/chunks/1321-a966036b7e3ae8c3.js +0 -1
  448. package/app/.next-cli-build/static/chunks/2435.8a5a02e626c780d0.js +0 -1
  449. package/app/.next-cli-build/static/chunks/2694-fa4a038c7addaf24.js +0 -18
  450. package/app/.next-cli-build/static/chunks/3521.a9e2daf685420cc7.js +0 -1
  451. package/app/.next-cli-build/static/chunks/5497-3cf29976f188352b.js +0 -7
  452. package/app/.next-cli-build/static/chunks/6808-9540d7ac65c3e6a0.js +0 -1
  453. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/page-e8e532618d63f944.js +0 -1
  454. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-dec9bfc425fb3885.js +0 -1
  455. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/page-7bd0715367619619.js +0 -1
  456. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/page-c5ec58d3c27337fa.js +0 -4
  457. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/page-b75f168ba5367af9.js +0 -1
  458. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/page-13b9f3596564691a.js +0 -1
  459. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-3ec2eae580cfd6e9.js +0 -27
  460. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-eafb435acef415a1.js +0 -1
  461. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/page-d61c6b11bb916a3c.js +0 -4
  462. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/page-1f79ed13b16582ef.js +0 -1
  463. package/app/.next-cli-build/static/chunks/webpack-97b250ee703d0d92.js +0 -1
  464. package/app/.next-cli-build/static/css/d9ba36d87937fec6.css +0 -1
  465. /package/app/.next-cli-build/static/{RC_KHxUynSqU7uk0euJap → sKwjEEJfz6HiCKK5ronYO}/_buildManifest.js +0 -0
  466. /package/app/.next-cli-build/static/{RC_KHxUynSqU7uk0euJap → sKwjEEJfz6HiCKK5ronYO}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{9912:(e,t,a)=>{Promise.resolve().then(a.bind(a,70323))},70323:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006);let o=["zh-CN","zh-TW"],c=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],d=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}];function m(){let[e,t]=(0,l.useState)(!0),[a,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)("http://localhost:8787"),[p,u]=(0,l.useState)(3e3),[f,g]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[b,j]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(""),[k,C]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[S,E]=(0,l.useState)([]),[P,T]=(0,l.useState)(!1),[$,I]=(0,l.useState)(""),[R,M]=(0,l.useState)(null),[O,L]=(0,l.useState)(""),[U,_]=(0,l.useState)(null),[H,A]=(0,l.useState)(!1),[F,D]=(0,l.useState)(!0),[B,J]=(0,l.useState)(!1),W=(0,l.useRef)(null),[z,G]=(0,l.useState)(!1),[q,K]=(0,l.useState)("full"),[X,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)("full"),[V,ee]=(0,l.useState)(!1),[et,ea]=(0,l.useState)(!1),[es,el]=(0,l.useState)(25e3),[er,en]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[ei,eo]=(0,l.useState)(null),[ec,ed]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(!1),[eh,ep]=(0,l.useState)(""),[eu,ef]=(0,l.useState)("en"),{copied:eg,copy:eb}=(0,n.C)();(0,l.useEffect)(()=>(ef((0,i.kk)()),(0,i.oQ)(()=>ef((0,i.kk)()))),[]);let ej=o.includes(eu),ey=ej?c:c.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=c.find(e=>e.id===q);e?.wenyan&&!ej&&(K("ultra"),ev({cavemanLevel:"ultra"}))},[ej,q]);let ev=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},eN=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},ew=async()=>{let e=x.trim()||"http://localhost:8787";h(e),await ev({headroomUrl:e}),ek()},ek=(0,l.useCallback)(async()=>{g(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(g({...t,loading:!1}),!t?.installed){C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();C(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),E([])}catch{C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}}catch{g({installed:!1,running:!1,python:null,loading:!1}),C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}},[]),eC=(0,l.useCallback)(async()=>{w(""),v(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await ek()}catch(e){w(e.message)}finally{v(!1)}},[ek]),eS=(0,l.useCallback)(async()=>{v(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await ek()}finally{v(!1)}},[ek]),eE=(0,l.useCallback)(()=>{L(""),W.current&&clearInterval(W.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&L(t.log)}catch{}};e(),W.current=setInterval(e,1500)},[]),eP=(0,l.useCallback)(()=>{W.current&&(clearInterval(W.current),W.current=null)},[]);(0,l.useEffect)(()=>()=>eP(),[eP]);let eT=(0,l.useCallback)(async()=>{if(0!==S.length){T(!0),I(""),eE();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:S})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");C(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),E([])}catch(e){I(e.message)}finally{eP(),T(!1)}}},[S,eE,eP]),e$=(0,l.useCallback)(async e=>{M(e),I(""),eE();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");C(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){I(e.message)}finally{eP(),M(null)}},[eE,eP]),eI=(0,l.useCallback)(()=>{if(0!==S.length){if(S.includes("ml"))return void _({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:eT});eT()}},[S,eT]),eR=(0,l.useCallback)(e=>{_({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>e$(e)})},[e$]),eM=(0,l.useCallback)(async(e,t)=>{if(I(""),"code"===e&&A(t),"ml"===e&&D(t),await ev({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),f.running){J(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await ek()}catch(e){I(e.message)}finally{J(!1)}}},[f.running,ek]),eO=(0,l.useCallback)(async()=>{en(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();en({...t,loading:!1}),"number"==typeof t.minChars&&el(t.minChars)}catch{en({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eL=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});eo(await e.json())}catch(e){eo({healthy:!1,checks:[],error:e.message})}},[]),eU=(0,l.useCallback)(async e=>{ep(""),ex(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eO(),await eL()}catch(e){ep(e.message)}finally{ex(!1)}},[eO,eL]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),m(!!a.headroomEnabled),h(a.headroomUrl||"http://localhost:8787"),"number"==typeof a.headroomTimeoutMs&&u(a.headroomTimeoutMs),A(!0===a.headroomCodeAware),D(!1!==a.headroomKompress),G(!!a.cavemanEnabled),K(a.cavemanLevel||"full"),Y(!!a.ponytailEnabled),Z(a.ponytailLevel||"full"),ee(!!a.antislopCodeEnabled),ea(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&el(a.pxpipeMinChars),ek(),eO().then(eL)}}catch{}})()},[ek,eO,eL]);let e_=!!f.running,eH=f.loading?"Checking…":e_?"Running":!1===f.localUrl||f.installed?!1!==f.localUrl?"Stopped":"External":"Not installed",eA=!1!==f.localUrl,eF=!!f.canStart,eD=eA&&!!f.managedPid,eB=ei?.healthy===!0,eJ=er.loading?"Checking…":er.installing?"Installing…":er.installed?eB?"Healthy":er.running?"Running":"Stopped":"Not installed";return eB||er.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"smart_toy"}),"Agent Skills"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>eN(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${e_?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eH}),(0,s.jsx)("button",{type:"button",onClick:()=>j(!0),className:"text-xs text-primary underline hover:opacity-80",children:e_?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a,onChange:()=>{var e;let t;return e=!a,void(h(t=x.trim()||"http://localhost:8787"),m(e),ev({headroomEnabled:e,headroomUrl:t}))}})]}),f.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",k.version?` \xb7 v${k.version}`:"",":"]}),k.available.map(e=>{let t=!!k.extras[e],a=S.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?H:F;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 rounded border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:B,onChange:()=>eM(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>eR(e),disabled:R===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:R===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),S.length>0&&(0,s.jsx)("button",{onClick:eI,disabled:P,className:"text-xs px-2.5 py-1 rounded bg-primary text-white hover:opacity-90 disabled:opacity-50",children:P?"Installing…":`Install [proxy,${S.join(",")}]`})]}),$&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:$}),B&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(P||R)&&O&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:O}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:ey.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;K(t=e.id),ev({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:c.find(e=>e.id===q)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),ev({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[X&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;Z(t=e.id),ev({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${Q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:d.find(e=>e.id===Q)?.desc})]}),(0,s.jsx)(r.lM,{checked:X,onChange:()=>{var e;Y(e=!X),ev({ponytailEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Code comment hygiene"," ",(0,s.jsx)("span",{className:"text-xs font-mono font-semibold text-primary",children:"(@antislop-code)"})]}),(0,s.jsxs)("a",{href:"https://github.com/miqdadbadjuber/anti-slop",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80 inline-flex items-center gap-0.5",children:["Powered by miqdadbadjuber/anti-slop",(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:"Filter generic AI-slop comments, keep valuable ones, never touch code logic"})]}),(0,s.jsx)("div",{className:"flex items-center gap-3 shrink-0",children:(0,s.jsx)(r.lM,{checked:V,onChange:()=>{var e;ee(e=!V),ev({antislopCodeEnabled:e})}})})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:b,title:e_?"Headroom":"Setup Headroom",onClose:()=>j(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:e_?"text-success":"text-warning",children:eH})]}),e_&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:x,onChange:e=>h(e.target.value),onBlur:ew,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,s.jsx)(r.pd,{value:String(p),onChange:e=>u(e.target.value),onBlur:()=>{let e=Math.round(Number(p)),t=Number.isFinite(e)&&e>0?e:3e3;u(t),ev({headroomTimeoutMs:t})},placeholder:"3000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),eD?(0,s.jsx)(r.$n,{onClick:eS,variant:"ghost",fullWidth:!0,disabled:y,children:y?"Stopping…":"Stop Headroom"}):e_?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eF?(0,s.jsx)(r.$n,{onClick:eC,fullWidth:!0,disabled:y,children:y?"Starting…":"Start Headroom"}):eA?f.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>eb('pip install "headroom-ai[proxy]"'),children:eg?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),N&&(0,s.jsx)("p",{className:"text-sm text-warning",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>ek(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>j(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:er.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>ed(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eB||er.running?"text-success":"text-warning",children:[eJ,er.version?` \xb7 v${er.version}`:""]})]}),ei?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),ei.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),ei.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:ei.error})]}),er.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[er.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eU("restart"),variant:"ghost",disabled:em,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eU("stop"),variant:"ghost",disabled:em,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eU("start"),disabled:em,children:em?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),variant:"ghost",disabled:em,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),fullWidth:!0,disabled:em||er.installing,children:em||er.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(es),onChange:e=>el(e.target.value),onBlur:()=>{let e=Math.max(0,Number(es)||25e3);el(e),ev({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),eh&&(0,s.jsx)("p",{className:"text-sm text-warning",children:eh}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eO().then(eL),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>ed(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!U,onClose:()=>_(null),onConfirm:()=>{let e=U?.onConfirm;_(null),e?.()},title:U?.title,message:U?.message,confirmText:U?.confirmText,variant:U?.variant})]})}}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=9912)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9839],{9912:(e,t,a)=>{Promise.resolve().then(a.bind(a,70323))},70323:(e,t,a)=>{"use strict";a.d(t,{default:()=>m});var s=a(95155),l=a(12115),r=a(35497),n=a(11059),i=a(73006);let o=["zh-CN","zh-TW"],c=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],d=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}];function m(){let[e,t]=(0,l.useState)(!0),[a,m]=(0,l.useState)(!1),[x,h]=(0,l.useState)("http://localhost:8787"),[p,u]=(0,l.useState)(3e3),[f,g]=(0,l.useState)({installed:!1,running:!1,python:null,loading:!0}),[b,j]=(0,l.useState)(!1),[y,v]=(0,l.useState)(!1),[N,w]=(0,l.useState)(""),[k,C]=(0,l.useState)({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),[S,E]=(0,l.useState)([]),[P,T]=(0,l.useState)(!1),[$,I]=(0,l.useState)(""),[R,M]=(0,l.useState)(null),[O,L]=(0,l.useState)(""),[U,_]=(0,l.useState)(null),[H,A]=(0,l.useState)(!1),[F,D]=(0,l.useState)(!0),[B,J]=(0,l.useState)(!1),W=(0,l.useRef)(null),[z,G]=(0,l.useState)(!1),[q,K]=(0,l.useState)("full"),[X,Y]=(0,l.useState)(!1),[Q,Z]=(0,l.useState)("full"),[V,ee]=(0,l.useState)(!1),[et,ea]=(0,l.useState)(!1),[es,el]=(0,l.useState)(25e3),[er,en]=(0,l.useState)({installed:!1,installing:!1,running:!1,version:null,loading:!0}),[ei,eo]=(0,l.useState)(null),[ec,ed]=(0,l.useState)(!1),[em,ex]=(0,l.useState)(!1),[eh,ep]=(0,l.useState)(""),[eu,ef]=(0,l.useState)("en"),{copied:eg,copy:eb}=(0,n.C)();(0,l.useEffect)(()=>(ef((0,i.kk)()),(0,i.oQ)(()=>ef((0,i.kk)()))),[]);let ej=o.includes(eu),ey=ej?c:c.filter(e=>!e.wenyan);(0,l.useEffect)(()=>{let e=c.find(e=>e.id===q);e?.wenyan&&!ej&&(K("ultra"),ev({cavemanLevel:"ultra"}))},[ej,q]);let ev=async e=>{try{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})}catch(e){console.log("Error updating setting:",e)}},eN=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({rtkEnabled:e})})).ok&&t(e)}catch(e){console.log("Error updating rtkEnabled:",e)}},ew=async()=>{let e=x.trim()||"http://localhost:8787";h(e),await ev({headroomUrl:e}),ek()},ek=(0,l.useCallback)(async()=>{g(e=>({...e,loading:!0}));try{let e=await fetch("/api/headroom/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();if(g({...t,loading:!1}),!t?.installed){C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([]);return}try{let e=await fetch("/api/headroom/extras",{headers:{"Cache-Control":"no-store"}});if(!e.ok)throw Error("extras status failed");let t=await e.json();C(e=>({...e,version:t.version??null,extras:t.extras||{code:!1,ml:!1},available:t.available||["code","ml"],loading:!1})),E([])}catch{C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}}catch{g({installed:!1,running:!1,python:null,loading:!1}),C({version:null,extras:{code:!1,ml:!1},available:["code","ml"],loading:!1}),E([])}},[]),eC=(0,l.useCallback)(async()=>{w(""),v(!0);try{let e=await fetch("/api/headroom/start",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Failed to start proxy");await ek()}catch(e){w(e.message)}finally{v(!1)}},[ek]),eS=(0,l.useCallback)(async()=>{v(!0);try{await fetch("/api/headroom/stop",{method:"POST"}),await ek()}finally{v(!1)}},[ek]),eE=(0,l.useCallback)(()=>{L(""),W.current&&clearInterval(W.current);let e=async()=>{try{let e=await fetch("/api/headroom/extras?log=1",{headers:{"Cache-Control":"no-store"}}),t=await e.json().catch(()=>({}));"string"==typeof t.log&&L(t.log)}catch{}};e(),W.current=setInterval(e,1500)},[]),eP=(0,l.useCallback)(()=>{W.current&&(clearInterval(W.current),W.current=null)},[]);(0,l.useEffect)(()=>()=>eP(),[eP]);let eT=(0,l.useCallback)(async()=>{if(0!==S.length){T(!0),I(""),eE();try{let e=await fetch("/api/headroom/extras",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:S})}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Install failed");C(e=>({...e,version:t.version??e.version,extras:t.extras||e.extras})),E([])}catch(e){I(e.message)}finally{eP(),T(!1)}}},[S,eE,eP]),e$=(0,l.useCallback)(async e=>{M(e),I(""),eE();try{let t=await fetch("/api/headroom/extras",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({extras:[e]})}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||"Remove failed");C(e=>({...e,version:a.version??e.version,extras:a.extras||e.extras}))}catch(e){I(e.message)}finally{eP(),M(null)}},[eE,eP]),eI=(0,l.useCallback)(()=>{if(0!==S.length){if(S.includes("ml"))return void _({title:"Install [ml]",message:"[ml] downloads ~1 GB (torch + huggingface-hub). Continue?",confirmText:"Install",variant:"primary",onConfirm:eT});eT()}},[S,eT]),eR=(0,l.useCallback)(e=>{_({title:`Remove [${e}]`,message:`Remove [${e}] and its packages?`,confirmText:"Remove",variant:"danger",onConfirm:()=>e$(e)})},[e$]),eM=(0,l.useCallback)(async(e,t)=>{if(I(""),"code"===e&&A(t),"ml"===e&&D(t),await ev({["code"===e?"headroomCodeAware":"headroomKompress"]:t}),f.running){J(!0);try{let e=await fetch("/api/headroom/restart",{method:"POST"}),t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Restart failed");await ek()}catch(e){I(e.message)}finally{J(!1)}}},[f.running,ek]),eO=(0,l.useCallback)(async()=>{en(e=>({...e,loading:!0}));try{let e=await fetch("/api/pxpipe/status",{headers:{"Cache-Control":"no-store"}}),t=await e.json();en({...t,loading:!1}),"number"==typeof t.minChars&&el(t.minChars)}catch{en({installed:!1,installing:!1,running:!1,version:null,loading:!1})}},[]),eL=(0,l.useCallback)(async()=>{try{let e=await fetch("/api/pxpipe/health",{method:"POST"});eo(await e.json())}catch(e){eo({healthy:!1,checks:[],error:e.message})}},[]),eU=(0,l.useCallback)(async e=>{ep(""),ex(!0);try{let t=await fetch(`/api/pxpipe/${e}`,{method:"POST"}),a=await t.json().catch(()=>({}));if(!t.ok)throw Error(a.error||`PXPIPE ${e} failed`);await eO(),await eL()}catch(e){ep(e.message)}finally{ex(!1)}},[eO,eL]);(0,l.useEffect)(()=>{(async()=>{try{let e=await fetch("/api/settings");if(e.ok){let a=await e.json();t(!1!==a.rtkEnabled),m(!!a.headroomEnabled),h(a.headroomUrl||"http://localhost:8787"),"number"==typeof a.headroomTimeoutMs&&u(a.headroomTimeoutMs),A(!0===a.headroomCodeAware),D(!1!==a.headroomKompress),G(!!a.cavemanEnabled),K(a.cavemanLevel||"full"),Y(!!a.ponytailEnabled),Z(a.ponytailLevel||"full"),ee(!!a.antislopCodeEnabled),ea(!!a.pxpipeEnabled),"number"==typeof a.pxpipeMinChars&&el(a.pxpipeMinChars),ek(),eO().then(eL)}}catch{}})()},[ek,eO,eL]);let e_=!!f.running,eH=f.loading?"Checking…":e_?"Running":!1===f.localUrl||f.installed?!1!==f.localUrl?"Stopped":"External":"Not installed",eA=!1!==f.localUrl,eF=!!f.canStart,eD=eA&&!!f.managedPid,eB=ei?.healthy===!0,eJ=er.loading?"Checking…":er.installing?"Installing…":er.installed?eB?"Healthy":er.running?"Running":"Stopped":"Not installed";return eB||er.running,(0,s.jsxs)("div",{className:"space-y-6 p-6",children:[(0,s.jsxs)(r.Zp,{id:"rtk",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary",children:"smart_toy"}),"Agent Skills"]})}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-2 pb-4 border-b border-border gap-4",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress tool output"," ",(0,s.jsx)("a",{href:"https://github.com/rtk-ai/rtk",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(RTK)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"git/grep/ls/tree/logs → 60-90% fewer input tokens"})]}),(0,s.jsx)(r.lM,{checked:e,onChange:()=>eN(!e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between py-4 gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress context"," ",(0,s.jsx)("a",{href:"https://github.com/chopratejas/headroom",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Headroom)"})]}),(0,s.jsx)("span",{className:`text-xs px-2 py-0.5 rounded ${e_?"bg-success/15 text-success":"bg-warning/15 text-warning"}`,children:eH}),(0,s.jsx)("button",{type:"button",onClick:()=>j(!0),className:"text-xs text-primary underline hover:opacity-80",children:e_?"Manage":"Setup"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Compress prompts via /v1/compress before routing to the model"})]}),(0,s.jsx)(r.lM,{checked:a,onChange:()=>{var e;let t;return e=!a,void(h(t=x.trim()||"http://localhost:8787"),m(e),ev({headroomEnabled:e,headroomUrl:t}))}})]}),f.installed&&(0,s.jsxs)("div",{className:"mb-3 ml-1 pl-3 pb-4 border-l-2 border-border",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["Compression extras",k.version?` \xb7 v${k.version}`:"",":"]}),k.available.map(e=>{let t=!!k.extras[e],a=S.includes(e),l="code"===e?"tree-sitter AST compression for code responses":"Kompress-v2 HF model for prose/agentic traces (~+1GB)";if(t){let t="code"===e?H:F;return(0,s.jsxs)("div",{className:"flex items-center gap-1.5 text-xs px-2 py-1 rounded border border-success/40 bg-success/5 text-text",title:l,children:[(0,s.jsx)(r.lM,{size:"sm",checked:t,disabled:B,onChange:()=>eM(e,!t)}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("button",{type:"button",onClick:()=>eR(e),disabled:R===e,className:"ml-1 text-error underline hover:opacity-80 disabled:opacity-50",title:`Uninstall [${e}]`,children:R===e?"Uninstalling…":"Uninstall"})]},e)}return(0,s.jsxs)("label",{className:`flex items-center gap-1.5 text-xs px-2 py-1 rounded border cursor-pointer transition-colors ${a?"border-primary bg-primary/10 text-primary":"border-border text-text-muted hover:bg-surface-2"}`,title:l,children:[(0,s.jsx)("input",{type:"checkbox",className:"w-3 h-3",checked:a,onChange:()=>{E(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}}),(0,s.jsxs)("span",{className:"font-medium",children:["[",e,"]"]}),(0,s.jsx)("span",{className:"opacity-70",children:"not installed"})]},e)}),S.length>0&&(0,s.jsx)("button",{onClick:eI,disabled:P,className:"text-xs px-2.5 py-1 rounded bg-primary text-white hover:opacity-90 disabled:opacity-50",children:P?"Installing…":`Install [proxy,${S.join(",")}]`})]}),$&&(0,s.jsx)("p",{className:"text-xs text-error mt-1",children:$}),B&&(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Restarting proxy…"}),(P||R)&&O&&(0,s.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded bg-surface-2 p-2 text-[10px] leading-tight text-text-muted whitespace-pre-wrap",children:O}),(0,s.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Installing adds the package; use ",(0,s.jsx)("code",{children:"on"}),"/",(0,s.jsx)("code",{children:"off"})," ","to activate it (restarts the proxy). Default install is"," ",(0,s.jsx)("code",{children:"[proxy]"})," only (SmartCrusher for JSON). Adding"," ",(0,s.jsx)("code",{children:"[code]"})," enables AST compression (Python/JS/TS/Go/Rust/Java/C/C++/Perl). Adding ",(0,s.jsx)("code",{children:"[ml]"})," ","enables the Kompress-v2 HF model for prose/agentic traces but adds ~1 GB (torch + huggingface-hub)."]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Compress LLM output"," ",(0,s.jsx)("a",{href:"https://github.com/JuliusBrussee/caveman",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Caveman)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Terse-style system prompt → ~65% fewer output tokens (up to 87%)"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[z&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:ey.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;K(t=e.id),ev({cavemanLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:c.find(e=>e.id===q)?.desc})]}),(0,s.jsx)(r.lM,{checked:z,onChange:()=>{var e;G(e=!z),ev({cavemanEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Lazy senior dev"," ",(0,s.jsx)("a",{href:"https://github.com/DietrichGebert/ponytail",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80",children:"(Ponytail)"})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Bias the model toward minimal code: YAGNI, reuse stdlib, deletion over addition"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 shrink-0",children:[X&&(0,s.jsxs)("div",{className:"flex flex-col items-end gap-1",children:[(0,s.jsx)("div",{className:"flex items-center gap-1.5",children:d.map(e=>(0,s.jsx)("button",{onClick:()=>{var t;Z(t=e.id),ev({ponytailLevel:t})},className:`px-3 py-1.5 rounded text-xs font-medium border transition-colors ${Q===e.id?"bg-primary text-white border-primary":"bg-transparent border-border text-text-muted hover:bg-surface-2"}`,title:e.desc,children:e.label},e.id))}),(0,s.jsx)("p",{className:"text-xs text-primary",children:d.find(e=>e.id===Q)?.desc})]}),(0,s.jsx)(r.lM,{checked:X,onChange:()=>{var e;Y(e=!X),ev({ponytailEnabled:e})}})]})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between pt-4 mt-4 border-t border-border gap-4 flex-wrap",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("p",{className:"font-medium",children:["Code comment hygiene"," ",(0,s.jsx)("span",{className:"text-xs font-mono font-semibold text-primary",children:"(@antislop-code)"})]}),(0,s.jsxs)("a",{href:"https://github.com/miqdadbadjuber/anti-slop",target:"_blank",rel:"noreferrer",className:"text-xs font-normal text-primary underline hover:opacity-80 inline-flex items-center gap-0.5",children:["Powered by miqdadbadjuber/anti-slop",(0,s.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),(0,s.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:"Filter generic AI-slop comments, keep valuable ones, never touch code logic"})]}),(0,s.jsx)("div",{className:"flex items-center gap-3 shrink-0",children:(0,s.jsx)(r.lM,{checked:V,onChange:()=>{var e;ee(e=!V),ev({antislopCodeEnabled:e})}})})]}),!1]}),(0,s.jsx)(r.aF,{isOpen:b,title:e_?"Headroom":"Setup Headroom",onClose:()=>j(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsx)("span",{className:e_?"text-success":"text-warning",children:eH})]}),e_&&(0,s.jsx)("a",{href:"/api/headroom/proxy/dashboard",target:"_blank",rel:"noreferrer",className:"w-full rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Headroom Dashboard"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Proxy URL"}),(0,s.jsx)(r.pd,{value:x,onChange:e=>h(e.target.value),onBlur:ew,placeholder:"http://localhost:8787",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Use a local proxy for Start/Stop, or an external Docker sidecar like http://headroom:8787."})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Timeout (ms)"}),(0,s.jsx)(r.pd,{value:String(p),onChange:e=>u(e.target.value),onBlur:()=>{let e=Math.round(Number(p)),t=Number.isFinite(e)&&e>0?e:3e3;u(t),ev({headroomTimeoutMs:t})},placeholder:"3000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Request timeout in milliseconds. Defaults to 3000 ms."})]}),eD?(0,s.jsx)(r.$n,{onClick:eS,variant:"ghost",fullWidth:!0,disabled:y,children:y?"Stopping…":"Stop Headroom"}):e_?(0,s.jsx)("p",{className:"text-sm text-success",children:"Headroom proxy is reachable. You can enable the token saver."}):eF?(0,s.jsx)(r.$n,{onClick:eC,fullWidth:!0,disabled:y,children:y?"Starting…":"Start Headroom"}):eA?f.python?(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Install then click Start:"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("pre",{className:"flex-1 rounded bg-black/5 dark:bg-white/5 p-2 text-xs font-mono overflow-x-auto",children:'pip install "headroom-ai[proxy]"'}),(0,s.jsx)(r.$n,{size:"sm",variant:"ghost",onClick:()=>eb('pip install "headroom-ai[proxy]"'),children:eg?"Copied":"Copy"})]})]}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Python ≥ 3.10 required for local managed mode. Install Python first, or use an external proxy URL."}):(0,s.jsx)("p",{className:"text-sm text-warning",children:"Start Headroom separately at the configured URL, then recheck."}),N&&(0,s.jsx)("p",{className:"text-sm text-warning",children:N}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>ek(),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>j(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.aF,{isOpen:!1,title:er.installed?"PXPIPE":"Setup PXPIPE",onClose:()=>ed(!1),children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Compress prompts using multimodal encoding. Runs in-process — no extra server or environment variables required."}),(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{children:"Status"}),(0,s.jsxs)("span",{className:eB||er.running?"text-success":"text-warning",children:[eJ,er.version?` \xb7 v${er.version}`:""]})]}),ei?.checks?.length>0&&(0,s.jsxs)("div",{className:"flex flex-col gap-1 rounded border border-border p-3",children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-1",children:"Health check"}),ei.checks.map(e=>(0,s.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,s.jsxs)("span",{className:e.ok?"text-success":"text-warning",children:[e.ok?"●":"○"," ",e.label]}),e.detail&&(0,s.jsx)("span",{className:"text-text-muted font-mono truncate max-w-[50%]",children:e.detail})]},e.id)),ei.error&&(0,s.jsx)("p",{className:"text-xs text-warning mt-1",children:ei.error})]}),er.installed?(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[er.running?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(r.$n,{onClick:()=>eU("restart"),variant:"ghost",disabled:em,children:"Restart"}),(0,s.jsx)(r.$n,{onClick:()=>eU("stop"),variant:"ghost",disabled:em,children:"Stop"})]}):(0,s.jsx)(r.$n,{onClick:()=>eU("start"),disabled:em,children:em?"Starting…":"Start"}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),variant:"ghost",disabled:em,children:"Repair"}),(0,s.jsx)("a",{href:"/dashboard/pxpipe#logs",className:"col-span-2 rounded border border-border px-4 py-2 text-center text-sm hover:bg-surface-2",children:"Open Logs"})]}):(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("p",{className:"text-sm text-warning",children:"PXPIPE is not installed."}),(0,s.jsx)(r.$n,{onClick:()=>eU("install"),fullWidth:!0,disabled:em||er.installing,children:em||er.installing?"Installing…":"Install"}),(0,s.jsxs)("p",{className:"text-xs text-text-muted",children:["Installs the npm package ",(0,s.jsx)("code",{className:"font-mono",children:"pxpipe-proxy"})," into the 9Router data directory. May take a few minutes."]})]}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("p",{className:"text-sm font-medium",children:"Minimum prompt size (chars)"}),(0,s.jsx)(r.pd,{value:String(es),onChange:e=>el(e.target.value),onBlur:()=>{let e=Math.max(0,Number(es)||25e3);el(e),ev({pxpipeMinChars:e})},placeholder:"25000",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted",children:"Requests smaller than this bypass PXPIPE and are sent as-is."})]}),eh&&(0,s.jsx)("p",{className:"text-sm text-warning",children:eh}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(r.$n,{onClick:()=>eO().then(eL),variant:"ghost",fullWidth:!0,children:"Recheck"}),(0,s.jsx)(r.$n,{onClick:()=>ed(!1),fullWidth:!0,children:"Done"})]})]})}),(0,s.jsx)(r.uo,{isOpen:!!U,onClose:()=>_(null),onConfirm:()=>{let e=U?.onConfirm;_(null),e?.()},title:U?.title,message:U?.message,confirmText:U?.confirmText,variant:U?.variant})]})}}},e=>{e.O(0,[763,7309,705,5497,8441,3794,7358],()=>e(e.s=9912)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(17828)},17828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(64054).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},21957:(e,t,r)=>{"use strict";function n({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(95155),r(47650),r(5214),r(2451),r(53887)},37206:(e,t,r)=>{"use strict";r.d(t,{default:()=>a.a});var n=r(75707),a=r.n(n)},41112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return s}});let n=r(12115),a=r(47650);r(1980);let o=r(60614).createReactBrowserBailoutReason.bind(null,"next/dynamic");function s({children:e}){return(0,n.use)((0,a.browser)(o)),e}},51092:(e,t,r)=>{Promise.resolve().then(r.bind(r,76084))},60614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={createReactBrowserBailoutReason:function(){return o},getReactBrowserBailoutReason:function(){return s},isNextBrowserBailoutError:function(){return l}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=Symbol.for("next.browser-bailout-reason");function o(e){return{$$typeof:a,reason:e}}function s(e){let t=e?.cause;return t?.$$typeof===a?t.reason:void 0}function l(e){return void 0!==s(e)}},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={bindSnapshot:function(){return d},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return c},getOrCreateGlobalAsyncLocalStorage:function(){return i}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class o{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return s?new s:new o}function i(e){let t=Symbol.for(`@next/${e}@16.4.0`),r=globalThis;return r[t]??=l()}function d(e){return s?s.bind(e):o.bind(e)}function c(){return s?s.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(95155),a=r(12115),o=r(41112);function s(e){return{default:e&&"default"in e?e.default:e}}r(21957);let l={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},i=function(e){let t={...l,...e},r=(0,a.lazy)(()=>t.loader().then(s)),i=t.loading;function d(e){let s=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSRForNextDynamic,{children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...l?{fallback:s}:{},children:c})}return d.displayName="LoadableComponent",d}},75707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let n=r(73623)._(r(68635));function a(e,t){let r={};"function"==typeof e&&(r.loader=e);let a={...r,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76084:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(95155),a=r(12115),o=r(35497),s=r(11059);let l=(0,r(37206).default)(()=>r.e(8202).then(r.bind(r,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),i=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],d={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function c(){let[e,t]=(0,a.useState)({}),[r,c]=(0,a.useState)({1:!0}),[f,p]=(0,a.useState)({}),[x,m]=(0,a.useState)(null),g=(e,t)=>p(r=>({...r,[e]:t})),b=(e,r)=>t(t=>({...t,[e]:r})),y=e=>c(t=>{let r={};return i.forEach(e=>{r[e.id]=!1}),r[e]=!0,r}),h=async e=>{let t=i.find(t=>t.id===e);g(`load-${e}`,!0);try{let r=await fetch(`/api/translator/load?file=${t.file}`),n=await r.json();n.success?(b(e,n.content),1===e&&await j(n.content)):alert(n.error||"File not found")}catch(e){alert(e.message)}g(`load-${e}`,!1)},j=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),n=await r.json();n.success&&m(n.result)}catch{}},v=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),_=async()=>{g("toOpenAI",!0);try{let t=e[1],r=JSON.parse(t);v("1_req_client.json",t),v("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:r.body||r},null,2));let n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:r})}),a=await n.json();if(!a.success)return void alert(a.error);let o=JSON.stringify(a.result.body,null,2);b(3,o),y(3)}catch(e){alert(e.message)}g("toOpenAI",!1)},w=async()=>{g("toTarget",!0);try{let t=e[3],r=JSON.parse(t);v("3_req_openai.json",t);let n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...r,provider:x?.provider,model:x?.model}})}),a=await n.json();if(!a.success)return void alert(a.error);let o={...a.result,provider:x?.provider,model:x?.model};b(4,JSON.stringify(o,null,2)),y(4)}catch(e){alert(e.message)}g("toTarget",!1)},O=async()=>{g("send",!0);try{let t=e[4],r=JSON.parse(t);v("4_req_target.json",t);let n=r.provider||x?.provider,a=r.model||x?.model;if(!n||!a)return void alert("Missing provider or model. Please run step 1 first to detect them.");let o=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,model:a,body:r.body||r})});if(!o.ok){let e=await o.json().catch(()=>({error:o.statusText}));alert(e.error||"Send failed");return}let s=o.body.getReader(),l=new TextDecoder,i="";for(;;){let{done:e,value:t}=await s.read();if(e)break;i+=l.decode(t,{stream:!0})}b(5,i),y(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){alert(e.message)}finally{g("send",!1)}},{copy:S}=(0,s.C)(),N=async t=>{e[t]&&S(e[t],`translator-step-${t}`)};return(0,n.jsxs)("div",{className:"p-8 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,n.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),x&&(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,n.jsx)(u,{label:"src",value:x.sourceFormat,color:"blue"}),(0,n.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,n.jsx)(u,{label:"dst",value:x.targetFormat,color:"orange"}),(0,n.jsx)(u,{label:"provider",value:x.provider,color:"green"}),(0,n.jsx)(u,{label:"model",value:x.model,color:"purple"})]})]}),i.map(t=>{var a;let s=1===(a=t.id)?(0,n.jsx)(o.$n,{size:"sm",icon:"arrow_forward",loading:f.toOpenAI,onClick:_,children:"→ OpenAI"}):3===a?(0,n.jsx)(o.$n,{size:"sm",icon:"arrow_forward",loading:f.toTarget,onClick:w,children:"→ Target"}):4===a?(0,n.jsx)(o.$n,{size:"sm",icon:"send",loading:f.send,onClick:O,children:"Send"}):null,i=!!r[t.id],u=e[t.id]||"";return(0,n.jsx)(o.Zp,{children:(0,n.jsxs)("div",{className:"p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("button",{onClick:()=>{let e;return e=t.id,c(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:i?"expand_more":"chevron_right"}),(0,n.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,n.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),u&&(0,n.jsxs)("span",{className:"text-xs text-green-500",children:["(",u.length," chars)"]})]}),!i&&(0,n.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,n.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:f[`load-${t.id}`],onClick:()=>h(t.id)}),s]})]}),i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,n.jsx)(l,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:u,onChange:e=>{b(t.id,e||""),1===t.id&&j(e||"")},theme:"vs-dark",options:d})}),(0,n.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:f[`load-${t.id}`],onClick:()=>h(t.id),children:"Load"}),(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let r=JSON.parse(e[t]);b(t,JSON.stringify(r,null,2))}catch{}})(t.id),children:"Format"}),(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>N(t.id),children:"Copy"}),s]})]})]})},t.id)})]})}function u({label:e,value:t,color:r}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[r]}`,children:[(0,n.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=51092)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3528],{5214:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorage",{enumerable:!0,get:function(){return n.workAsyncStorageInstance}});let n=r(17828)},17828:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"workAsyncStorageInstance",{enumerable:!0,get:function(){return n}});let n=(0,r(64054).getOrCreateGlobalAsyncLocalStorage)("work-async-storage")},21957:(e,t,r)=>{"use strict";function n({moduleIds:e}){return null}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadChunks",{enumerable:!0,get:function(){return n}}),r(95155),r(47650),r(5214),r(2451),r(53887)},37206:(e,t,r)=>{"use strict";r.d(t,{default:()=>a.a});var n=r(75707),a=r.n(n)},41112:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSRForNextDynamic",{enumerable:!0,get:function(){return s}});let n=r(12115),a=r(47650);r(1980);let o=r(60614).createReactBrowserBailoutReason.bind(null,"next/dynamic");function s({children:e}){return(0,n.use)((0,a.browser)(o)),e}},51092:(e,t,r)=>{Promise.resolve().then(r.bind(r,76084))},60614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={createReactBrowserBailoutReason:function(){return o},getReactBrowserBailoutReason:function(){return s},isNextBrowserBailoutError:function(){return l}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=Symbol.for("next.browser-bailout-reason");function o(e){return{$$typeof:a,reason:e}}function s(e){let t=e?.cause;return t?.$$typeof===a?t.reason:void 0}function l(e){return void 0!==s(e)}},64054:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={bindSnapshot:function(){return d},createAsyncLocalStorage:function(){return l},createSnapshot:function(){return c},getOrCreateGlobalAsyncLocalStorage:function(){return i}};for(var n in r)Object.defineProperty(t,n,{enumerable:!0,get:r[n]});let a=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class o{disable(){throw a}getStore(){}run(){throw a}exit(){throw a}enterWith(){throw a}static bind(e){return e}}let s="u">typeof globalThis&&globalThis.AsyncLocalStorage;function l(){return s?new s:new o}function i(e){let t=Symbol.for(`@next/${e}@16.4.0`),r=globalThis;return r[t]??=l()}function d(e){return s?s.bind(e):o.bind(e)}function c(){return s?s.snapshot():function(e,...t){return e(...t)}}},68635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return i}});let n=r(95155),a=r(12115),o=r(41112);function s(e){return{default:e&&"default"in e?e.default:e}}r(21957);let l={loader:()=>Promise.resolve(s(()=>null)),loading:null,ssr:!0},i=function(e){let t={...l,...e},r=(0,a.lazy)(()=>t.loader().then(s)),i=t.loading;function d(e){let s=i?(0,n.jsx)(i,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,d=l?a.Suspense:a.Fragment,c=t.ssr?(0,n.jsxs)(n.Fragment,{children:[null,(0,n.jsx)(r,{...e})]}):(0,n.jsx)(o.BailoutToCSRForNextDynamic,{children:(0,n.jsx)(r,{...e})});return(0,n.jsx)(d,{...l?{fallback:s}:{},children:c})}return d.displayName="LoadableComponent",d}},75707:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let n=r(73623)._(r(68635));function a(e,t){let r={};"function"==typeof e&&(r.loader=e);let a={...r,...t};return(0,n.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76084:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var n=r(95155),a=r(12115),o=r(35497),s=r(11059);let l=(0,r(37206).default)(()=>r.e(8202).then(r.bind(r,28202)),{loadableGenerated:{webpack:()=>[28202]},ssr:!1}),i=[{id:1,label:"Client Request",file:"1_req_client.json",lang:"json",desc:"Raw request from client"},{id:2,label:"Source Body",file:"2_req_source.json",lang:"json",desc:"After initial conversion"},{id:3,label:"OpenAI Intermediate",file:"3_req_openai.json",lang:"json",desc:"source → openai"},{id:4,label:"Target Request",file:"4_req_target.json",lang:"json",desc:"openai → target + URL + headers"},{id:5,label:"Provider Response",file:"5_res_provider.txt",lang:"text",desc:"Raw SSE from provider"},{id:6,label:"OpenAI Response",file:"6_res_openai.txt",lang:"text",desc:"target → openai (response)"},{id:7,label:"Client Response",file:"7_res_client.txt",lang:"text",desc:"Final response to client"}],d={minimap:{enabled:!1},fontSize:12,lineNumbers:"on",scrollBeyondLastLine:!1,wordWrap:"on",automaticLayout:!0};function c(){let[e,t]=(0,a.useState)({}),[r,c]=(0,a.useState)({1:!0}),[f,p]=(0,a.useState)({}),[x,m]=(0,a.useState)(null),g=(e,t)=>p(r=>({...r,[e]:t})),b=(e,r)=>t(t=>({...t,[e]:r})),y=e=>c(t=>{let r={};return i.forEach(e=>{r[e.id]=!1}),r[e]=!0,r}),h=async e=>{let t=i.find(t=>t.id===e);g(`load-${e}`,!0);try{let r=await fetch(`/api/translator/load?file=${t.file}`),n=await r.json();n.success?(b(e,n.content),1===e&&await j(n.content)):alert(n.error||"File not found")}catch(e){alert(e.message)}g(`load-${e}`,!1)},j=async e=>{try{let t="string"==typeof e?JSON.parse(e):e,r=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:1,body:t})}),n=await r.json();n.success&&m(n.result)}catch{}},v=(e,t)=>fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:e,content:t})}).catch(()=>{}),_=async()=>{g("toOpenAI",!0);try{let t=e[1],r=JSON.parse(t);v("1_req_client.json",t),v("2_req_source.json",JSON.stringify({timestamp:new Date().toISOString(),headers:{},body:r.body||r},null,2));let n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:2,body:r})}),a=await n.json();if(!a.success)return void alert(a.error);let o=JSON.stringify(a.result.body,null,2);b(3,o),y(3)}catch(e){alert(e.message)}g("toOpenAI",!1)},w=async()=>{g("toTarget",!0);try{let t=e[3],r=JSON.parse(t);v("3_req_openai.json",t);let n=await fetch("/api/translator/translate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({step:3,body:{...r,provider:x?.provider,model:x?.model}})}),a=await n.json();if(!a.success)return void alert(a.error);let o={...a.result,provider:x?.provider,model:x?.model};b(4,JSON.stringify(o,null,2)),y(4)}catch(e){alert(e.message)}g("toTarget",!1)},O=async()=>{g("send",!0);try{let t=e[4],r=JSON.parse(t);v("4_req_target.json",t);let n=r.provider||x?.provider,a=r.model||x?.model;if(!n||!a)return void alert("Missing provider or model. Please run step 1 first to detect them.");let o=await fetch("/api/translator/send",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:n,model:a,body:r.body||r})});if(!o.ok){let e=await o.json().catch(()=>({error:o.statusText}));alert(e.error||"Send failed");return}let s=o.body.getReader(),l=new TextDecoder,i="";for(;;){let{done:e,value:t}=await s.read();if(e)break;i+=l.decode(t,{stream:!0})}b(5,i),y(5),await fetch("/api/translator/save",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({file:"5_res_provider.txt",content:i})})}catch(e){alert(e.message)}finally{g("send",!1)}},{copy:S}=(0,s.C)(),N=async t=>{e[t]&&S(e[t],`translator-step-${t}`)};return(0,n.jsxs)("div",{className:"p-8 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Translator Debug"}),(0,n.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Replay request flow — matches log files"})]}),x&&(0,n.jsxs)("div",{className:"flex items-center gap-2 flex-wrap justify-end",children:[(0,n.jsx)(u,{label:"src",value:x.sourceFormat,color:"blue"}),(0,n.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px]",children:"arrow_forward"}),(0,n.jsx)(u,{label:"dst",value:x.targetFormat,color:"orange"}),(0,n.jsx)(u,{label:"provider",value:x.provider,color:"green"}),(0,n.jsx)(u,{label:"model",value:x.model,color:"purple"})]})]}),i.map(t=>{var a;let s=1===(a=t.id)?(0,n.jsx)(o.$n,{size:"sm",icon:"arrow_forward",loading:f.toOpenAI,onClick:_,children:"→ OpenAI"}):3===a?(0,n.jsx)(o.$n,{size:"sm",icon:"arrow_forward",loading:f.toTarget,onClick:w,children:"→ Target"}):4===a?(0,n.jsx)(o.$n,{size:"sm",icon:"send",loading:f.send,onClick:O,children:"Send"}):null,i=!!r[t.id],u=e[t.id]||"";return(0,n.jsx)(o.Zp,{children:(0,n.jsxs)("div",{className:"p-4 space-y-3",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("button",{onClick:()=>{let e;return e=t.id,c(t=>({...t,[e]:!t[e]}))},className:"flex items-center gap-2 flex-1 text-left group",children:[(0,n.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted group-hover:text-primary transition-colors",children:i?"expand_more":"chevron_right"}),(0,n.jsx)("span",{className:"text-xs font-mono text-text-muted/60 w-4",children:t.id}),(0,n.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:t.label}),(0,n.jsx)("span",{className:"text-xs text-text-muted/60 font-mono",children:t.file}),u&&(0,n.jsxs)("span",{className:"text-xs text-green-500",children:["(",u.length," chars)"]})]}),!i&&(0,n.jsxs)("div",{className:"flex gap-1 shrink-0",children:[(0,n.jsx)(o.$n,{size:"sm",variant:"ghost",icon:"folder_open",loading:f[`load-${t.id}`],onClick:()=>h(t.id)}),s]})]}),i&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"border border-border rounded-lg overflow-hidden",children:(0,n.jsx)(l,{height:"400px",defaultLanguage:"text"===t.lang?"plaintext":"json",value:u,onChange:e=>{b(t.id,e||""),1===t.id&&j(e||"")},theme:"vs-dark",options:d})}),(0,n.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"folder_open",loading:f[`load-${t.id}`],onClick:()=>h(t.id),children:"Load"}),(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"data_object",onClick:()=>(t=>{try{let r=JSON.parse(e[t]);b(t,JSON.stringify(r,null,2))}catch{}})(t.id),children:"Format"}),(0,n.jsx)(o.$n,{size:"sm",variant:"outline",icon:"content_copy",onClick:()=>N(t.id),children:"Copy"}),s]})]})]})},t.id)})]})}function u({label:e,value:t,color:r}){return(0,n.jsxs)("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-mono ${{blue:"bg-blue-500/10 text-blue-500",orange:"bg-orange-500/10 text-orange-500",green:"bg-green-500/10 text-green-500",purple:"bg-purple-500/10 text-purple-500"}[r]}`,children:[(0,n.jsxs)("span",{className:"text-text-muted/70 font-sans text-[10px]",children:[e,":"]}),t]})}}},e=>{e.O(0,[763,7309,705,5497,8441,3794,7358],()=>e(e.s=51092)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2825],{2689:(e,t,s)=>{Promise.resolve().then(s.bind(s,81772))},81772:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>S});var a=s(95155),n=s(12115),l=s(73321),r=s(35497),i=s(6808),d=s(7520),o=s(84588),c=s(92542),x=s(31474);function m({isOpen:e,onClose:t,title:s,children:l,width:r="md",className:i}){let d={sm:"w-[400px]",md:"w-[500px]",lg:"w-[600px]",xl:"w-[800px]",full:"w-full"};return((0,n.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,n.useEffect)(()=>{let s=s=>{"Escape"===s.key&&e&&t()};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[e,t]),e)?(0,a.jsxs)("div",{className:"fixed inset-0 z-50",children:[(0,a.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-[2px] fade-in cursor-pointer",onClick:t,"aria-hidden":"true"}),(0,a.jsxs)("div",{className:(0,x.cn)("absolute right-0 top-0 h-full bg-surface flex flex-col","shadow-[var(--shadow-elev)]","slide-in-right","border-l border-border-subtle",d[r]||d.md,i),children:[(0,a.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-border-subtle flex-shrink-0",children:[(0,a.jsx)("div",{className:"flex items-center gap-3",children:s&&(0,a.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:s})}),(0,a.jsx)("button",{type:"button",onClick:t,className:"p-1.5 rounded-none text-text-muted hover:bg-surface-2 hover:text-text-main transition-colors cursor-pointer",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto p-6 custom-scrollbar",children:l})]})]}):null}function p({currentPage:e,pageSize:t,totalItems:s,onPageChange:n,onPageSizeChange:l,className:r}){let i=Math.ceil(s/t),d=s>0?(e-1)*t+1:0,o=Math.min(e*t,s),m=(()=>{let t=[],s=Math.max(1,e-2),a=Math.min(i,s+5-1);a-s+1<5&&(s=Math.max(1,a-5+1));for(let e=s;e<=a;e++)t.push(e);return t})();return(0,a.jsxs)("div",{className:(0,x.cn)("flex flex-col sm:flex-row items-center justify-between gap-4 py-4 px-2",r),children:[s>0&&(0,a.jsxs)("div",{className:"text-sm text-text-muted",children:["Showing ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:d})," to"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:o})," of"," ",(0,a.jsx)("span",{className:"font-medium text-text-main",children:s})," results"]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-2 sm:gap-4",children:[l&&(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"text-sm text-text-muted",children:"Rows:"}),(0,a.jsx)("select",{value:t,onChange:e=>l(Number(e.target.value)),className:(0,x.cn)("h-9 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","cursor-pointer"),style:{colorScheme:"auto"},children:[10,20,50].map(e=>(0,a.jsx)("option",{value:e,children:e},e))})]}),i>1&&(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(c.default,{variant:"outline",size:"sm",onClick:()=>n(e-1),disabled:1===e,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_left"})}),m[0]>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.default,{variant:"ghost",size:"sm",onClick:()=>n(1),className:"w-9 px-0 hidden sm:inline-flex",children:"1"}),m[0]>2&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."})]}),m.map(t=>(0,a.jsx)(c.default,{variant:e===t?"primary":"ghost",size:"sm",onClick:()=>n(t),className:(0,x.cn)("w-9 px-0",e===t?"inline-flex":"hidden sm:inline-flex"),children:t},t)),m[m.length-1]<i&&(0,a.jsxs)(a.Fragment,{children:[m[m.length-1]<i-1&&(0,a.jsx)("span",{className:"text-text-muted px-1 hidden sm:inline",children:"..."}),(0,a.jsx)(c.default,{variant:"ghost",size:"sm",onClick:()=>n(i),className:"w-9 px-0 hidden sm:inline-flex",children:i})]}),(0,a.jsx)(c.default,{variant:"outline",size:"sm",onClick:()=>n(e+1),disabled:e===i,className:"w-9 px-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"chevron_right"})})]})]})]})}var h=s(88105);let u=null,f=null;async function b(){if(u&&f)return{providerNameCache:u,providerNodesCache:f};let e=await fetch("/api/provider-nodes"),t=(await e.json()).nodes||[];for(let e of(f={},t))f[e.id]=e.name;return{providerNameCache:u={...h.Q2,...f},providerNodesCache:f}}function j(e,t){if(!e||!t)return e;let s=t[e];if("string"==typeof s)return s;if(s?.name)return s.name;let a=(0,h.zt)(e)||h.Q2[e];return a?.name||e}function g({title:e,children:t,defaultOpen:s=!1,icon:l=null}){let[r,i]=(0,n.useState)(s);return(0,a.jsxs)("div",{className:"border border-black/5 dark:border-white/5 rounded-lg overflow-hidden",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>i(!r),className:"w-full flex items-center justify-between p-3 bg-black/[0.02] dark:bg-white/[0.02] hover:bg-black/[0.04] dark:hover:bg-white/[0.04] transition-colors",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[l&&(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:l}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:e})]}),(0,a.jsx)("span",{className:(0,x.cn)("material-symbols-outlined text-[20px] text-text-muted transition-transform duration-200",r?"rotate-90":""),children:"chevron_right"})]}),r&&(0,a.jsx)("div",{className:"p-4 border-t border-black/5 dark:border-white/5",children:t})]})}function v(e){return e?.cached_tokens||e?.cache_read_input_tokens||0}function N(e){return e?.cache_creation_input_tokens||0}function k(e){let t=e?.prompt_tokens||e?.input_tokens||0,s=v(e);return t<s?s:t}function w(){let[e,t]=(0,n.useState)([]),[s,l]=(0,n.useState)({page:1,pageSize:20,totalItems:0,totalPages:0}),[r,i]=(0,n.useState)(!1),[d,h]=(0,n.useState)(null),[u,f]=(0,n.useState)(!1),[w,y]=(0,n.useState)([]),[S,C]=(0,n.useState)(null),[D,_]=(0,n.useState)({provider:"",startDate:"",endDate:""}),P=(0,n.useCallback)(async()=>{try{let e=await fetch("/api/usage/providers"),t=await e.json();y(t.providers||[]);let s=await b();C(s.providerNameCache)}catch(e){console.error("Failed to fetch providers:",e)}},[]),L=(0,n.useCallback)(async()=>{i(!0);try{let e=new URLSearchParams({page:s.page.toString(),pageSize:s.pageSize.toString()});D.provider&&e.append("provider",D.provider),D.startDate&&e.append("startDate",D.startDate),D.endDate&&e.append("endDate",D.endDate);let a=await fetch(`/api/usage/request-details?${e}`),n=await a.json();t(n.details||[]),l(e=>({...e,...n.pagination}))}catch(e){console.error("Failed to fetch request details:",e)}finally{i(!1)}},[s.page,s.pageSize,D]);return(0,n.useEffect)(()=>{P()},[P]),(0,n.useEffect)(()=>{L()},[L]),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6",children:[(0,a.jsx)(o.default,{padding:"md",children:(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"provider-filter",className:"text-sm font-medium text-text-main",children:"Provider"}),(0,a.jsxs)("select",{id:"provider-filter",value:D.provider,onChange:e=>_({...D,provider:e.target.value}),className:(0,x.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20","w-full min-w-0 cursor-pointer"),style:{colorScheme:"auto"},children:[(0,a.jsx)("option",{value:"",children:"All Providers"}),w.map(e=>(0,a.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"start-date-filter",className:"text-sm font-medium text-text-main",children:"Start Date"}),(0,a.jsx)("input",{id:"start-date-filter",type:"datetime-local",value:D.startDate,onChange:e=>_({...D,startDate:e.target.value}),className:(0,x.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"end-date-filter",className:"text-sm font-medium text-text-main",children:"End Date"}),(0,a.jsx)("input",{id:"end-date-filter",type:"datetime-local",value:D.endDate,onChange:e=>_({...D,endDate:e.target.value}),className:(0,x.cn)("h-9 px-3 rounded-lg border border-black/10 dark:border-white/10 bg-surface","w-full min-w-0 text-sm text-text-main focus:outline-none focus:ring-2 focus:ring-primary/20")})]}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-2 sm:col-span-2 lg:col-span-1",children:[(0,a.jsx)("span",{className:"hidden text-sm font-medium text-text-main opacity-0 lg:block","aria-hidden":"true",children:"Clear"}),(0,a.jsx)(c.default,{variant:"ghost",onClick:()=>{_({provider:"",startDate:"",endDate:""})},disabled:!D.provider&&!D.startDate&&!D.endDate,className:"w-full",children:"Clear Filters"})]})]})}),(0,a.jsxs)(o.default,{padding:"none",children:[(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsxs)("table",{className:"w-full min-w-[880px]",children:[(0,a.jsx)("thead",{children:(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5",children:[(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Timestamp"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Model"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Provider"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Input Tokens"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cached"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Cache Creation"}),(0,a.jsx)("th",{className:"text-right p-4 text-sm font-semibold text-text-main",children:"Output Tokens"}),(0,a.jsx)("th",{className:"text-left p-4 text-sm font-semibold text-text-main",children:"Latency"}),(0,a.jsx)("th",{className:"text-center p-4 text-sm font-semibold text-text-main",children:"Action"})]})}),(0,a.jsx)("tbody",{children:r?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading..."]})})}):0===e.length?(0,a.jsx)("tr",{children:(0,a.jsx)("td",{colSpan:"7",className:"p-8 text-center text-text-muted",children:"No request details found"})}):e.map((e,t)=>(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 last:border-b-0 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:"whitespace-nowrap p-4 text-sm text-text-main",children:new Date(e.timestamp).toLocaleString()}),(0,a.jsx)("td",{className:"max-w-[260px] truncate p-4 font-mono text-sm text-text-main",children:e.model}),(0,a.jsx)("td",{className:"max-w-[180px] truncate p-4 text-sm text-text-main",children:(0,a.jsx)("span",{className:"font-medium",children:j(e.provider,S)})}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:k(e.tokens).toLocaleString()}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:v(e.tokens)>0?v(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:N(e.tokens)>0?N(e.tokens).toLocaleString():"—"}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-main text-right font-mono",children:e.tokens?.completion_tokens?.toLocaleString()||0}),(0,a.jsx)("td",{className:"p-4 text-sm text-text-muted",children:(0,a.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,a.jsxs)("div",{children:["TTFT: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.ttft||0,"ms"]})]}),(0,a.jsxs)("div",{children:["Total: ",(0,a.jsxs)("span",{className:"font-mono",children:[e.latency?.total||0,"ms"]})]})]})}),(0,a.jsx)("td",{className:"p-4 text-center",children:(0,a.jsx)(c.default,{variant:"outline",size:"sm",onClick:()=>{h(e),f(!0)},children:"Detail"})})]},`${e.id}-${t}`))})]})}),!r&&e.length>0&&(0,a.jsx)("div",{className:"border-t border-black/5 dark:border-white/5",children:(0,a.jsx)(p,{currentPage:s.page,pageSize:s.pageSize,totalItems:s.totalItems,onPageChange:e=>{l(t=>({...t,page:e}))},onPageSizeChange:e=>{l(t=>({...t,pageSize:e,page:1}))}})})]}),(0,a.jsx)(m,{isOpen:u,onClose:()=>f(!1),title:"Request Details",width:"lg",children:d&&(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-1 gap-4 text-sm sm:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"ID:"})," ",(0,a.jsx)("span",{className:"break-all font-mono text-text-main",children:d.id})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Timestamp:"})," ",(0,a.jsx)("span",{className:"text-text-main",children:new Date(d.timestamp).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Provider:"})," ",(0,a.jsx)("span",{className:"text-text-main font-medium",children:j(d.provider,S)})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Model:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:d.model})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Status:"})," ",(0,a.jsx)("span",{className:(0,x.cn)("font-medium","success"===d.status?"text-green-600":"text-red-600"),children:d.status})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Latency:"})," ",(0,a.jsxs)("span",{className:"text-text-main font-mono",children:["TTFT ",d.latency?.ttft||0,"ms / Total ",d.latency?.total||0,"ms"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Input Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:k(d.tokens).toLocaleString()})]}),v(d.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cached Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:v(d.tokens).toLocaleString()})]}),N(d.tokens)>0&&(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Cache Creation:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:N(d.tokens).toLocaleString()})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted",children:"Output Tokens:"})," ",(0,a.jsx)("span",{className:"text-text-main font-mono",children:d.tokens?.completion_tokens?.toLocaleString()||0})]})]}),d.pxpipe&&(0,a.jsxs)("div",{className:"rounded-lg border border-black/5 dark:border-white/5 p-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 mb-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-text-muted",children:"image"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"PXPIPE"}),(0,a.jsx)("span",{className:(0,x.cn)("text-xs px-2 py-0.5 rounded",d.pxpipe.applied?"bg-green-500/15 text-green-600":"bg-amber-500/15 text-amber-600"),children:d.pxpipe.applied?"Activated":"Skipped"})]}),d.pxpipe.applied?(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-2 text-sm sm:grid-cols-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Original (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(d.pxpipe.tokensBeforeEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Compressed (est.)"}),(0,a.jsxs)("span",{className:"font-mono",children:[(d.pxpipe.tokensAfterEst||0).toLocaleString()," tokens"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Saved"}),(0,a.jsxs)("span",{className:"font-mono text-green-600",children:[d.pxpipe.savedPct||0,"%"]})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("span",{className:"text-text-muted block text-xs",children:"Images"}),(0,a.jsxs)("span",{className:"font-mono",children:[d.pxpipe.imageCount||0," (",d.pxpipe.durationMs||0,"ms)"]})]})]}):(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Reason: ",(0,a.jsx)("span",{className:"font-mono",children:d.pxpipe.reason}),d.pxpipe.detail?` — ${d.pxpipe.detail}`:""]})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(g,{title:"1. Client Request (Input)",defaultOpen:!0,icon:"input",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(d.request,null,2)})}),d.providerRequest&&(0,a.jsx)(g,{title:"2. Provider Request (Translated)",icon:"translate",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:JSON.stringify(d.providerRequest,null,2)})}),d.providerResponse&&(0,a.jsx)(g,{title:"3. Provider Response (Raw)",icon:"data_object",children:(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:"object"==typeof d.providerResponse?JSON.stringify(d.providerResponse,null,2):d.providerResponse})}),(0,a.jsxs)(g,{title:"4. Client Response (Final)",defaultOpen:!0,icon:"output",children:[d.response?.thinking&&(0,a.jsxs)("div",{className:"mb-4",children:[(0,a.jsxs)("h4",{className:"font-semibold text-text-main mb-2 flex items-center gap-2 text-xs uppercase tracking-wide opacity-70",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"psychology"}),"Thinking Process"]}),(0,a.jsx)("pre",{className:"max-h-[200px] max-w-full overflow-auto rounded-lg border border-amber-200 bg-amber-50 p-3 font-mono text-xs text-amber-900 dark:border-amber-800 dark:bg-amber-950/30 dark:text-amber-100 sm:p-4",children:d.response.thinking})]}),(0,a.jsx)("h4",{className:"font-semibold text-text-main mb-2 text-xs uppercase tracking-wide opacity-70",children:"Content"}),(0,a.jsx)("pre",{className:"max-h-[300px] max-w-full overflow-auto rounded-lg border border-black/5 bg-black/5 p-3 font-mono text-xs text-text-main dark:border-white/5 dark:bg-white/5 sm:p-4",children:d.response?.content||"[No content]"})]})]})]})})]})}let y=[{value:"today",label:"Today"},{value:"24h",label:"24h"},{value:"7d",label:"7D"},{value:"30d",label:"30D"},{value:"60d",label:"60D"},{value:"all",label:"All"}];function S(){return(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(d.Ay,{}),children:(0,a.jsx)(C,{})})}function C(){let e=(0,l.useSearchParams)(),t=(0,l.useRouter)(),[s,o]=(0,n.useState)("today"),c=e.get("tab"),x=c&&["overview","logs","details"].includes(c)?c:"overview",m=s=>{if(s===x)return;let a=new URLSearchParams(e);a.set("tab",s),t.push(`/dashboard/usage?${a.toString()}`,{scroll:!1})};return(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between border-b border-[#23242a] pb-4",children:[(0,a.jsxs)("div",{className:"inline-flex items-center p-1 bg-[#141418] border border-[#23242a]",children:[(0,a.jsxs)("button",{onClick:()=>m("overview"),className:`px-4 py-1.5 font-medium text-xs transition-all flex items-center gap-1.5 ${"overview"===x?"bg-[#1f1f26] text-[#ededef] shadow-sm":"text-[#9c9ca4] hover:text-[#ededef]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-sm ${"overview"===x?"text-[#c5a880]":""}`,children:"dashboard"}),"Overview"]}),(0,a.jsxs)("button",{onClick:()=>m("details"),className:`px-4 py-1.5 font-medium text-xs transition-all flex items-center gap-1.5 ${"details"===x?"bg-[#1f1f26] text-[#ededef] shadow-sm":"text-[#9c9ca4] hover:text-[#ededef]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-sm ${"details"===x?"text-[#c5a880]":""}`,children:"data_thresholding"}),"Details"]})]}),"overview"===x&&(0,a.jsx)("div",{className:"inline-flex items-center p-1 bg-[#141418] border border-[#23242a]",children:y.map(e=>{let t=s===e.value;return(0,a.jsx)("button",{onClick:()=>o(e.value),className:`px-3 py-1 text-xs transition-all ${t?"font-semibold bg-[#c5a880] text-[#0e0e11] shadow-sm":"font-medium text-[#9c9ca4] hover:text-[#ededef]"}`,children:e.label},e.value)})})]}),"overview"===x&&(0,a.jsx)(n.Suspense,{fallback:(0,a.jsx)(d.Ay,{}),children:(0,a.jsx)(i.default,{period:s,setPeriod:o,hidePeriodSelector:!0})}),"logs"===x&&(0,a.jsx)(r.gM,{}),"details"===x&&(0,a.jsx)(w,{})]})}}},e=>{e.O(0,[763,7309,705,5497,6808,8441,3794,7358],()=>e(e.s=2689)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{18671:(e,n,s)=>{Promise.resolve().then(s.bind(s,96748)),Promise.resolve().then(s.bind(s,56319)),Promise.resolve().then(s.bind(s,56061)),Promise.resolve().then(s.bind(s,92542)),Promise.resolve().then(s.bind(s,29366)),Promise.resolve().then(s.bind(s,84588)),Promise.resolve().then(s.bind(s,40197)),Promise.resolve().then(s.bind(s,45455)),Promise.resolve().then(s.bind(s,30815)),Promise.resolve().then(s.bind(s,73579)),Promise.resolve().then(s.bind(s,92173)),Promise.resolve().then(s.bind(s,95088)),Promise.resolve().then(s.bind(s,24747)),Promise.resolve().then(s.bind(s,80752)),Promise.resolve().then(s.bind(s,23936)),Promise.resolve().then(s.bind(s,11910)),Promise.resolve().then(s.bind(s,61500)),Promise.resolve().then(s.bind(s,62899)),Promise.resolve().then(s.bind(s,94230)),Promise.resolve().then(s.bind(s,21931)),Promise.resolve().then(s.bind(s,91450)),Promise.resolve().then(s.bind(s,7648)),Promise.resolve().then(s.bind(s,25086)),Promise.resolve().then(s.bind(s,28815)),Promise.resolve().then(s.bind(s,28058)),Promise.resolve().then(s.bind(s,81127)),Promise.resolve().then(s.bind(s,72908)),Promise.resolve().then(s.bind(s,67968)),Promise.resolve().then(s.bind(s,4823)),Promise.resolve().then(s.bind(s,90882)),Promise.resolve().then(s.bind(s,51825)),Promise.resolve().then(s.bind(s,23615)),Promise.resolve().then(s.bind(s,28067)),Promise.resolve().then(s.bind(s,98)),Promise.resolve().then(s.bind(s,92622)),Promise.resolve().then(s.bind(s,21110)),Promise.resolve().then(s.bind(s,38587)),Promise.resolve().then(s.bind(s,98542)),Promise.resolve().then(s.bind(s,97677)),Promise.resolve().then(s.bind(s,40684)),Promise.resolve().then(s.bind(s,30312))},38587:(e,n,s)=>{"use strict";function r(){return null}s.d(n,{default:()=>r})}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=18671)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{18671:(e,n,s)=>{Promise.resolve().then(s.bind(s,96748)),Promise.resolve().then(s.bind(s,56319)),Promise.resolve().then(s.bind(s,56061)),Promise.resolve().then(s.bind(s,92542)),Promise.resolve().then(s.bind(s,29366)),Promise.resolve().then(s.bind(s,84588)),Promise.resolve().then(s.bind(s,40197)),Promise.resolve().then(s.bind(s,45455)),Promise.resolve().then(s.bind(s,30815)),Promise.resolve().then(s.bind(s,73579)),Promise.resolve().then(s.bind(s,92173)),Promise.resolve().then(s.bind(s,95088)),Promise.resolve().then(s.bind(s,99257)),Promise.resolve().then(s.bind(s,80752)),Promise.resolve().then(s.bind(s,23936)),Promise.resolve().then(s.bind(s,11910)),Promise.resolve().then(s.bind(s,61500)),Promise.resolve().then(s.bind(s,62899)),Promise.resolve().then(s.bind(s,94230)),Promise.resolve().then(s.bind(s,21931)),Promise.resolve().then(s.bind(s,91450)),Promise.resolve().then(s.bind(s,7648)),Promise.resolve().then(s.bind(s,25086)),Promise.resolve().then(s.bind(s,28815)),Promise.resolve().then(s.bind(s,28058)),Promise.resolve().then(s.bind(s,81127)),Promise.resolve().then(s.bind(s,72908)),Promise.resolve().then(s.bind(s,67968)),Promise.resolve().then(s.bind(s,4823)),Promise.resolve().then(s.bind(s,90882)),Promise.resolve().then(s.bind(s,51825)),Promise.resolve().then(s.bind(s,23615)),Promise.resolve().then(s.bind(s,28067)),Promise.resolve().then(s.bind(s,98)),Promise.resolve().then(s.bind(s,92622)),Promise.resolve().then(s.bind(s,75688)),Promise.resolve().then(s.bind(s,38587)),Promise.resolve().then(s.bind(s,98542)),Promise.resolve().then(s.bind(s,97677)),Promise.resolve().then(s.bind(s,40684)),Promise.resolve().then(s.bind(s,30312))},38587:(e,n,s)=>{"use strict";function r(){return null}s.d(n,{default:()=>r})}},e=>{e.O(0,[763,7309,705,5497,8441,3794,7358],()=>e(e.s=18671)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{6679:(e,n,r)=>{Promise.resolve().then(r.bind(r,30565)),Promise.resolve().then(r.bind(r,90285)),Promise.resolve().then(r.bind(r,26300)),Promise.resolve().then(r.t.bind(r,5887,23)),Promise.resolve().then(r.t.bind(r,42593,23)),Promise.resolve().then(r.t.bind(r,74301,23)),Promise.resolve().then(r.t.bind(r,51743,23)),Promise.resolve().then(r.bind(r,94635)),Promise.resolve().then(r.bind(r,21110))},51743:()=>{},94635:(e,n,r)=>{"use strict";r.d(n,{RuntimeI18nProvider:()=>m});var s=r(95155),i=r(12115),t=r(73321),o=r(73006);function m({children:e}){let n=(0,t.usePathname)();return(0,i.useEffect)(()=>{(0,o.FE)()},[]),(0,i.useEffect)(()=>{n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{(0,o.wn)()})})},[n]),(0,s.jsx)(s.Fragment,{children:e})}}},e=>{e.O(0,[3497,3334,5665,1321,8441,3794,7358],()=>e(e.s=6679)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{6679:(e,n,r)=>{Promise.resolve().then(r.bind(r,30565)),Promise.resolve().then(r.bind(r,90285)),Promise.resolve().then(r.bind(r,26300)),Promise.resolve().then(r.t.bind(r,5887,23)),Promise.resolve().then(r.t.bind(r,42593,23)),Promise.resolve().then(r.t.bind(r,74301,23)),Promise.resolve().then(r.t.bind(r,51743,23)),Promise.resolve().then(r.bind(r,94635)),Promise.resolve().then(r.bind(r,75688))},51743:()=>{},94635:(e,n,r)=>{"use strict";r.d(n,{RuntimeI18nProvider:()=>m});var s=r(95155),i=r(12115),t=r(73321),o=r(73006);function m({children:e}){let n=(0,t.usePathname)();return(0,i.useEffect)(()=>{(0,o.FE)()},[]),(0,i.useEffect)(()=>{n&&requestAnimationFrame(()=>{requestAnimationFrame(()=>{(0,o.wn)()})})},[n]),(0,s.jsx)(s.Fragment,{children:e})}}},e=>{e.O(0,[3497,3334,5665,7309,8441,3794,7358],()=>e(e.s=6679)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{83016:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(95155),r=s(12115),l=s(73321),n=s(35497);function o(){let e=(0,l.useRouter)(),[t,s]=(0,r.useState)(""),[o,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[x,h]=(0,r.useState)(!1),[u,p]=(0,r.useState)(null),[m,f]=(0,r.useState)(!1),[b,g]=(0,r.useState)(0),[w,j]=(0,r.useState)(""),[N,y]=(0,r.useState)("password"),[S,v]=(0,r.useState)(null),[A,C]=(0,r.useState)(!1),[I,L]=(0,r.useState)(!1),[T,E]=(0,r.useState)("Sign in with SAML SSO"),[O,k]=(0,r.useState)("Sign in with OIDC");(0,r.useEffect)(()=>{P()},[]);let P=async()=>{try{let t=await fetch("/api/auth/status"),s=await t.json();if(s.authenticated)return void e.push("/dashboard");p(s.hasPassword),y(s.authMode||"password"),v(s.ssoType||null),C(!!s.samlConfigured),L(!!s.oidcConfigured),s.samlLoginLabel&&E(s.samlLoginLabel),s.oidcLoginLabel&&k(s.oidcLoginLabel)}catch(e){console.error("Failed to check auth:",e),p(!0)}},F=async s=>{s.preventDefault(),d(""),h(!0);try{let s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})}),a=await s.json();if(s.ok)a.mustChangePassword?f(!0):e.push("/dashboard");else{if(d(a.error||"Login failed"),a.retryAfter){g(a.retryAfter);let e=setInterval(()=>{g(t=>t<=1?(clearInterval(e),0):t-1)},1e3)}a.resetHint&&j(a.resetHint)}}catch{d("An error occurred. Please try again.")}finally{h(!1)}},R=async t=>{t.preventDefault(),d(""),h(!0);try{let t=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPassword:o})}),s=await t.json();t.ok?e.push("/dashboard"):d(s.error||"Failed to set password")}catch{d("An error occurred. Please try again.")}finally{h(!1)}},_=["sso","oidc","saml","both"].includes(N),D=S||("saml"===N?"saml":"oidc"),M=_&&"saml"===D&&A,H=_&&"oidc"===D&&I,$=M||H,U="password"===N||"both"===N||!$;return null===u?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4 font-mono text-xs text-[#A1A1A6]",children:(0,a.jsx)("div",{className:"text-center",children:(0,a.jsx)("p",{children:"INITIALIZING AUTHENTICATION APPARATUS..."})})}):(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-[#080808] p-4 relative overflow-hidden select-none",children:[(0,a.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8 flex flex-col items-center",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"67Router",className:"w-16 h-16 rounded-xl object-cover border border-[#2E2E33] shadow-md mb-3"}),(0,a.jsx)("h1",{className:"font-display text-2xl font-bold tracking-tight text-[#F5F5F7]",children:"67Router"}),(0,a.jsx)("p",{className:"text-xs text-[#A1A1A6] mt-1 font-mono",children:M?"Sign in with SAML 2.0 Single Sign-On":H?"Sign in with your OIDC provider to access the dashboard":"Enter root password to access the gateway"})]}),(0,a.jsx)(n.Zp,{children:m?(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-4 font-mono",children:[(0,a.jsx)("p",{className:"text-xs text-amber-500 text-center",children:"Set a new root password before accessing the gateway remotely."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs uppercase text-text-muted",children:"New password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter new password",value:o,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:c})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!o,children:"COMMIT CREDENTIAL"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[M&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/saml/start"},children:T}),H&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/oidc/start"},children:O}),$&&U&&(0,a.jsx)("div",{className:"h-px bg-border/60"}),U?(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-4 font-mono",children:[_&&!$&&(0,a.jsx)("p",{className:"text-xs text-amber-500 text-center",children:"SSO is enabled, but configuration is incomplete. Root password access active."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs uppercase text-text-muted",children:"Password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter password",value:t,onChange:e=>s(e.target.value),required:!0,autoFocus:!H}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:c}),b>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-500",children:["Locked. Retry in ",(0,a.jsxs)("span",{className:"font-mono",children:[b,"s"]}),"."]}),w&&(0,a.jsxs)("p",{className:"text-[10px] text-text-muted",children:["Forgot password? Open ",(0,a.jsx)("code",{className:"bg-[#141416] px-1 py-0.5 border border-[#222226] text-[#C5A880]",children:"67router"})," CLI on the host → ",(0,a.jsx)("b",{children:"Settings"})," → ",(0,a.jsx)("b",{children:"Reset Password"}),"."]})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!t,children:"AUTHENTICATE"})]}):null]})})]})]})}s(73006)},86930:(e,t,s)=>{Promise.resolve().then(s.bind(s,83016))}},e=>{e.O(0,[763,1321,705,5497,8441,3794,7358],()=>e(e.s=86930)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4520],{83016:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>o});var a=s(95155),r=s(12115),l=s(73321),n=s(35497);function o(){let e=(0,l.useRouter)(),[t,s]=(0,r.useState)(""),[o,i]=(0,r.useState)(""),[c,d]=(0,r.useState)(""),[x,h]=(0,r.useState)(!1),[u,p]=(0,r.useState)(null),[m,f]=(0,r.useState)(!1),[b,g]=(0,r.useState)(0),[w,j]=(0,r.useState)(""),[N,y]=(0,r.useState)("password"),[S,v]=(0,r.useState)(null),[A,C]=(0,r.useState)(!1),[I,L]=(0,r.useState)(!1),[T,E]=(0,r.useState)("Sign in with SAML SSO"),[O,k]=(0,r.useState)("Sign in with OIDC");(0,r.useEffect)(()=>{P()},[]);let P=async()=>{try{let t=await fetch("/api/auth/status"),s=await t.json();if(s.authenticated)return void e.push("/dashboard");p(s.hasPassword),y(s.authMode||"password"),v(s.ssoType||null),C(!!s.samlConfigured),L(!!s.oidcConfigured),s.samlLoginLabel&&E(s.samlLoginLabel),s.oidcLoginLabel&&k(s.oidcLoginLabel)}catch(e){console.error("Failed to check auth:",e),p(!0)}},F=async s=>{s.preventDefault(),d(""),h(!0);try{let s=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:t})}),a=await s.json();if(s.ok)a.mustChangePassword?f(!0):e.push("/dashboard");else{if(d(a.error||"Login failed"),a.retryAfter){g(a.retryAfter);let e=setInterval(()=>{g(t=>t<=1?(clearInterval(e),0):t-1)},1e3)}a.resetHint&&j(a.resetHint)}}catch{d("An error occurred. Please try again.")}finally{h(!1)}},R=async t=>{t.preventDefault(),d(""),h(!0);try{let t=await fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({newPassword:o})}),s=await t.json();t.ok?e.push("/dashboard"):d(s.error||"Failed to set password")}catch{d("An error occurred. Please try again.")}finally{h(!1)}},_=["sso","oidc","saml","both"].includes(N),D=S||("saml"===N?"saml":"oidc"),M=_&&"saml"===D&&A,H=_&&"oidc"===D&&I,$=M||H,U="password"===N||"both"===N||!$;return null===u?(0,a.jsx)("div",{className:"min-h-screen flex items-center justify-center bg-bg p-4 font-mono text-xs text-[#A1A1A6]",children:(0,a.jsx)("div",{className:"text-center",children:(0,a.jsx)("p",{children:"INITIALIZING AUTHENTICATION APPARATUS..."})})}):(0,a.jsxs)("div",{className:"min-h-screen flex items-center justify-center bg-[#080808] p-4 relative overflow-hidden select-none",children:[(0,a.jsx)("div",{className:"landing-grid absolute inset-0 pointer-events-none","aria-hidden":"true"}),(0,a.jsxs)("div",{className:"relative z-10 w-full max-w-md",children:[(0,a.jsxs)("div",{className:"text-center mb-8 flex flex-col items-center",children:[(0,a.jsx)("img",{src:"/logo.png",alt:"67Router",className:"w-16 h-16 rounded-xl object-cover border border-[#2E2E33] shadow-md mb-3"}),(0,a.jsx)("h1",{className:"font-display text-2xl font-bold tracking-tight text-[#F5F5F7]",children:"67Router"}),(0,a.jsx)("p",{className:"text-xs text-[#A1A1A6] mt-1 font-mono",children:M?"Sign in with SAML 2.0 Single Sign-On":H?"Sign in with your OIDC provider to access the dashboard":"Enter root password to access the gateway"})]}),(0,a.jsx)(n.Zp,{children:m?(0,a.jsxs)("form",{onSubmit:R,className:"flex flex-col gap-4 font-mono",children:[(0,a.jsx)("p",{className:"text-xs text-amber-500 text-center",children:"Set a new root password before accessing the gateway remotely."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs uppercase text-text-muted",children:"New password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter new password",value:o,onChange:e=>i(e.target.value),required:!0,autoFocus:!0}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:c})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!o,children:"COMMIT CREDENTIAL"})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[M&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/saml/start"},children:T}),H&&(0,a.jsx)(n.$n,{type:"button",variant:"primary",className:"w-full",onClick:()=>{window.location.href="/api/auth/oidc/start"},children:O}),$&&U&&(0,a.jsx)("div",{className:"h-px bg-border/60"}),U?(0,a.jsxs)("form",{onSubmit:F,className:"flex flex-col gap-4 font-mono",children:[_&&!$&&(0,a.jsx)("p",{className:"text-xs text-amber-500 text-center",children:"SSO is enabled, but configuration is incomplete. Root password access active."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{className:"text-xs uppercase text-text-muted",children:"Password"}),(0,a.jsx)(n.pd,{type:"password",placeholder:"Enter password",value:t,onChange:e=>s(e.target.value),required:!0,autoFocus:!H}),c&&(0,a.jsx)("p",{className:"text-xs text-red-500",children:c}),b>0&&(0,a.jsxs)("p",{className:"text-xs text-amber-500",children:["Locked. Retry in ",(0,a.jsxs)("span",{className:"font-mono",children:[b,"s"]}),"."]}),w&&(0,a.jsxs)("p",{className:"text-[10px] text-text-muted",children:["Forgot password? Open ",(0,a.jsx)("code",{className:"bg-[#141416] px-1 py-0.5 border border-[#222226] text-[#C5A880]",children:"67router"})," CLI on the host → ",(0,a.jsx)("b",{children:"Settings"})," → ",(0,a.jsx)("b",{children:"Reset Password"}),"."]})]}),(0,a.jsx)(n.$n,{type:"submit",variant:"primary",className:"w-full",loading:x,disabled:!t,children:"AUTHENTICATE"})]}):null]})})]})]})}s(73006)},86930:(e,t,s)=>{Promise.resolve().then(s.bind(s,83016))}},e=>{e.O(0,[763,7309,705,5497,8441,3794,7358],()=>e(e.s=86930)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (()=>{"use strict";var e,t,r,o,n,a,i,c,l,s={},u={};function f(e){var t=u[e];if(void 0!==t)return t.exports;var r=u[e]={exports:{}},o=!0;try{s[e].call(r.exports,r,r.exports,f),o=!1}finally{o&&delete u[e]}return r.exports}f.m=s,e=[],f.O=(t,r,o,n)=>{if(r){n=n||0;for(var a=e.length;a>0&&e[a-1][2]>n;a--)e[a]=e[a-1];e[a]=[r,o,n];return}for(var i=1/0,a=0;a<e.length;a++){for(var[r,o,n]=e[a],c=!0,l=0;l<r.length;l++)(!1&n||i>=n)&&Object.keys(f.O).every(e=>f.O[e](r[l]))?r.splice(l--,1):(c=!1,n<i&&(i=n));if(c){e.splice(a--,1);var s=o();void 0!==s&&(t=s)}}return t},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,f.t=function(e,o){if(1&o&&(e=this(e)),8&o||"object"==typeof e&&e&&(4&o&&e.__esModule||16&o&&"function"==typeof e.then))return e;var n=Object.create(null);f.r(n);var a={};t=t||[null,r({}),r([]),r(r)];for(var i=2&o&&e;"object"==typeof i&&!~t.indexOf(i);i=r(i))Object.getOwnPropertyNames(i).forEach(t=>a[t]=()=>e[t]);return a.default=()=>e,f.d(n,a),n},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.f={},f.e=e=>Promise.all(Object.keys(f.f).reduce((t,r)=>(f.f[r](e,t),t),[])),f.u=e=>6808===e?"static/chunks/6808-54de8b855aaccfa4.js":3842===e?"static/chunks/3842-cc4f39fa50ab8b93.js":5815===e?"static/chunks/5815-2eb6990de66e825b.js":1649===e?"static/chunks/1649-772a31b7f3a65900.js":"static/chunks/"+(3862===e?"1a258343":e)+"."+({124:"c1b5af11afe50408",1966:"b8f83f7ba376c962",2435:"73c540d31dae9ecf",3521:"f0ac0c88103b9f6c",3862:"290297ea7c7f28c0",3899:"d4d0ae202f418161",5462:"c82c64c26a864ec0",5524:"a4e52491e3114015",6357:"99dc54a064c984c0",8202:"69dace5daa86686d",8569:"df0d706176dc1f57",9233:"e0ace25b5b543835"})[e]+".js",f.miniCssF=e=>"static/css/e07f2bf4fa519943.css",f.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o={},f.l=(e,t,r,n)=>{if(o[e])return void o[e].push(t);if(void 0!==r)for(var a,i,c=document.getElementsByTagName("script"),l=0;l<c.length;l++){var s=c[l];if(s.getAttribute("src")==e||s.getAttribute("data-webpack")=="_N_E:"+r){a=s;break}}a||(i=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,f.nc&&a.setAttribute("nonce",f.nc),a.setAttribute("data-webpack","_N_E:"+r),a.src=f.tu(e)),o[e]=[t];var u=(t,r)=>{a.onerror=a.onload=null,clearTimeout(d);var n=o[e];if(delete o[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach(e=>e(r)),t)return t(r)},d=setTimeout(u.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=u.bind(null,a.onerror),a.onload=u.bind(null,a.onload),i&&document.head.appendChild(a)},f.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.tt=()=>(void 0===n&&(n={createScriptURL:e=>e},"u">typeof trustedTypes&&trustedTypes.createPolicy&&(n=trustedTypes.createPolicy("nextjs#bundler",n))),n),f.tu=e=>f.tt().createScriptURL(e),f.p="/_next/",a={8068:0},f.f.miniCss=(e,t)=>{if(a[e])t.push(a[e]);else 0!==a[e]&&({2574:1})[e]&&t.push(a[e]=new Promise((t,r)=>{var o=f.miniCssF(e),n=f.p+o;if(((e,t)=>{for(var r=document.getElementsByTagName("link"),o=0;o<r.length;o++){var n=r[o],a=n.getAttribute("data-href")||n.getAttribute("href");if("stylesheet"===n.rel&&(a===e||a===t))return n}for(var i=document.getElementsByTagName("style"),o=0;o<i.length;o++){var n=i[o],a=n.getAttribute("data-href");if(a===e||a===t)return n}})(o,n))return t();((e,t,r,o)=>{var n=document.createElement("link");n.rel="stylesheet",n.type="text/css",n.onerror=n.onload=a=>{if(n.onerror=n.onload=null,"load"===a.type)r();else{var i=a&&("load"===a.type?"missing":a.type),c=a&&a.target&&a.target.href||t,l=Error("Loading CSS chunk "+e+" failed.\n("+c+")");l.code="CSS_CHUNK_LOAD_FAILED",l.type=i,l.request=c,n.parentNode.removeChild(n),o(l)}},n.href=t;if("function"==typeof _N_E_STYLE_LOAD){var a=n.href,i=n.onload,c=n.onerror;_N_E_STYLE_LOAD(0===a.indexOf(window.location.origin)?new URL(a).pathname:a).then(function(){i&&i.call(n,{type:"load"})},function(){c&&c.call(n,{})})}else document.head.appendChild(n)})(e,n,t,r)}).then(()=>{a[e]=0},t=>{throw delete a[e],t}))},i={8068:0,3497:0,3334:0},f.f.j=(e,t)=>{var r=f.o(i,e)?i[e]:void 0;if(0!==r)if(r)t.push(r[2]);else if(/^(2574|3334|3497|8068)$/.test(e))i[e]=0;else{var o=new Promise((t,o)=>r=i[e]=[t,o]);t.push(r[2]=o);var n=f.p+f.u(e),a=Error();f.l(n,t=>{if(f.o(i,e)&&(0!==(r=i[e])&&(i[e]=void 0),r)){var o=t&&("load"===t.type?"missing":t.type),n=t&&t.target&&t.target.src;a.message="Loading chunk "+e+" failed.\n("+o+": "+n+")",a.name="ChunkLoadError",a.type=o,a.request=n,r[1](a)}},"chunk-"+e,e)}},f.O.j=e=>0===i[e],c=(e,t)=>{var r,o,[n,a,c]=t,l=0;if(n.some(e=>0!==i[e])){for(r in a)f.o(a,r)&&(f.m[r]=a[r]);if(c)var s=c(f)}for(e&&e(t);l<n.length;l++)o=n[l],f.o(i,o)&&i[o]&&i[o][0](),i[o]=0;return f.O(s)},(l=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(c.bind(null,0)),l.push=c.bind(null,l.push.bind(l))})();