@hilbras/omnihilbras 2.0.0 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (592) hide show
  1. package/README.md +14 -14
  2. package/app/.next-cli-build/BUILD_ID +1 -1
  3. package/app/.next-cli-build/app-path-routes-manifest.json +18 -18
  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 +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +12 -12
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +2 -2
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  88. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  89. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +3 -3
  90. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  91. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/codewhale-settings/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/crush-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/forge-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/hermes-profiles/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/omp-settings/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/smelt-settings/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/combos/presets/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/combos/presets/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  159. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  189. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  191. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/start/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/login/status/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  238. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  240. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/[id]/overrides/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  267. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  268. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +2 -2
  269. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js +1 -1
  273. package/app/.next-cli-build/server/app/api/proxy-pools/netlify-deploy/route.js.nft.json +1 -1
  274. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  275. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  276. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  277. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
  283. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  289. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  290. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  346. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  348. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  384. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  385. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  386. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  394. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  396. package/app/.next-cli-build/server/app/callback.html +1 -1
  397. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  398. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  399. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  400. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +3 -3
  401. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +23 -21
  403. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +25 -23
  404. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +23 -21
  405. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +26 -24
  408. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +27 -25
  409. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +26 -24
  410. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  411. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/combos.rsc +27 -25
  413. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +29 -27
  414. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +27 -25
  415. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  417. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +25 -23
  418. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +26 -24
  419. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +25 -23
  420. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +27 -25
  423. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +29 -27
  424. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +27 -25
  425. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  427. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +25 -23
  428. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +27 -25
  429. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +25 -23
  430. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  431. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/profile.rsc +26 -24
  433. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +28 -26
  434. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +26 -24
  435. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +27 -25
  438. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +29 -27
  439. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +27 -25
  440. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/providers.rsc +26 -24
  443. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +28 -26
  444. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +26 -24
  445. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +26 -24
  448. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +28 -26
  449. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +26 -24
  450. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  451. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +26 -24
  453. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +28 -26
  454. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +26 -24
  455. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/quota.rsc +24 -22
  458. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +26 -24
  459. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +24 -22
  460. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  466. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  467. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  468. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +3 -3
  469. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/skills.rsc +26 -24
  471. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +28 -26
  472. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +26 -24
  473. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  474. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +23 -21
  476. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +25 -23
  477. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +23 -21
  478. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/translator.rsc +26 -24
  481. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +28 -26
  482. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +26 -24
  483. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  484. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/usage.rsc +27 -25
  486. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +29 -27
  487. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +27 -25
  488. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard.rsc +24 -22
  491. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +24 -22
  492. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +24 -22
  493. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/index.html +1 -1
  496. package/app/.next-cli-build/server/app/index.rsc +3 -3
  497. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +3 -3
  498. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  499. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  501. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  502. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  503. package/app/.next-cli-build/server/app/landing.html +1 -1
  504. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  505. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  506. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  507. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +3 -3
  508. package/app/.next-cli-build/server/app/login/page.js +1 -1
  509. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  510. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  511. package/app/.next-cli-build/server/app/login.html +1 -1
  512. package/app/.next-cli-build/server/app/login.rsc +3 -3
  513. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +3 -3
  514. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  515. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +3 -3
  516. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  517. package/app/.next-cli-build/server/app/page.js +1 -1
  518. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  519. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  520. package/app/.next-cli-build/server/app-paths-manifest.json +18 -18
  521. package/app/.next-cli-build/server/chunks/1019.js +1 -1
  522. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  523. package/app/.next-cli-build/server/chunks/3276.js +3 -3
  524. package/app/.next-cli-build/server/chunks/3799.js +1 -1
  525. package/app/.next-cli-build/server/chunks/4043.js +1 -1
  526. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  527. package/app/.next-cli-build/server/chunks/4199.js +1 -1
  528. package/app/.next-cli-build/server/chunks/436.js +1 -1
  529. package/app/.next-cli-build/server/chunks/4663.js +1 -1
  530. package/app/.next-cli-build/server/chunks/4785.js +25 -0
  531. package/app/.next-cli-build/server/chunks/5036.js +1 -0
  532. package/app/.next-cli-build/server/chunks/5245.js +1 -1
  533. package/app/.next-cli-build/server/chunks/5330.js +2 -2
  534. package/app/.next-cli-build/server/chunks/7211.js +1 -1
  535. package/app/.next-cli-build/server/chunks/7525.js +1 -1
  536. package/app/.next-cli-build/server/chunks/7557.js +1 -1
  537. package/app/.next-cli-build/server/chunks/7811.js +1 -1
  538. package/app/.next-cli-build/server/chunks/827.js +1 -1
  539. package/app/.next-cli-build/server/chunks/8416.js +1 -1
  540. package/app/.next-cli-build/server/chunks/8499.js +2 -2
  541. package/app/.next-cli-build/server/chunks/8895.js +1 -1
  542. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  543. package/app/.next-cli-build/server/chunks/915.js +2 -2
  544. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  545. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  546. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  547. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  548. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  549. package/app/.next-cli-build/server/pages/404.html +1 -1
  550. package/app/.next-cli-build/server/pages/500.html +1 -1
  551. package/app/.next-cli-build/static/chunks/{761-2556f561563ff774.js → 761-7590878484e89ed1.js} +1 -1
  552. package/app/.next-cli-build/static/chunks/7958-b44b343c4ee9f7e0.js +5 -0
  553. package/app/.next-cli-build/static/chunks/{85-614327c9c3f40a7d.js → 85-abdd4f18753cba17.js} +1 -1
  554. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-4cf42b10bafdba52.js +1 -0
  555. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-82a7e01a2e463ba2.js +1 -0
  556. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/error-c23142e5f5729b5c.js +1 -0
  557. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-7451e45c01e9f365.js → page-de738056c6c3f5e2.js} +12 -12
  558. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-e32ad708ff93ccbb.js +1 -0
  559. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-1e8ce4fa24e2def5.js +1 -0
  560. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-61bfa3b2f16b0c6d.js +1 -0
  561. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-e478c2c7c2491d20.js +1 -0
  562. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-5b432879d2c3afc9.js → page-5bc45ce6d914f906.js} +1 -1
  563. package/app/.next-cli-build/static/chunks/{webpack-13acc920e6f6a68b.js → webpack-bdd19f62aea907f6.js} +1 -1
  564. package/app/.next-cli-build/static/css/c478309e956d6de4.css +1 -0
  565. package/app/cli/.build-home/.omnihilbras/db/data.sqlite +0 -0
  566. package/app/custom-server.js +7 -0
  567. package/app/package.json +1 -1
  568. package/app/public/i18n/literals/fa.json +2 -2
  569. package/app/public/i18n/literals/id.json +2 -2
  570. package/app/public/i18n/literals/km.json +2 -2
  571. package/app/public/i18n/literals/th.json +2 -2
  572. package/app/public/i18n/literals/zh-CN.json +2 -2
  573. package/app/src/mitm/server.js +29 -29
  574. package/cli.js +12 -7
  575. package/hooks/postinstall.js +1 -1
  576. package/package.json +1 -1
  577. package/src/cli/api/client.js +1 -1
  578. package/src/cli/commands/connect.js +6 -6
  579. package/src/cli/terminalUI.js +1 -1
  580. package/src/cli/utils/endpoint.js +2 -2
  581. package/app/.next-cli-build/server/chunks/7960.js +0 -1
  582. package/app/.next-cli-build/server/chunks/9100.js +0 -21
  583. package/app/.next-cli-build/static/chunks/7958-7e4ad761a83f2a9e.js +0 -5
  584. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/page-31316583ab546200.js +0 -1
  585. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-decadb6df9e9b417.js +0 -1
  586. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-a1700bfc6ebb2aac.js +0 -1
  587. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/pxpipe/page-71f0c81cddbab903.js +0 -1
  588. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-e925ebcef32004ab.js +0 -1
  589. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/page-2422a9a60e84a259.js +0 -1
  590. package/app/.next-cli-build/static/css/cf553f425046a901.css +0 -1
  591. /package/app/.next-cli-build/static/{fAJh8_GCT173XCQuAE5si → 2lzaQ8Vt54PR86aQkWaou}/_buildManifest.js +0 -0
  592. /package/app/.next-cli-build/static/{fAJh8_GCT173XCQuAE5si → 2lzaQ8Vt54PR86aQkWaou}/_ssgManifest.js +0 -0
@@ -41,7 +41,7 @@ devin --version`}},opendesign:{id:"opendesign",name:"OpenDesign",image:"/provide
41
41
  gemini extensions install https://github.com/manalkaff/opendesign
42
42
 
43
43
  # OpenCode
44
- # Fetch and follow .opencode/INSTALL.md from the repo`}},pi:{id:"pi",name:"Pi (pi-coding-agent)",image:"/providers/pi.svg",color:"#6366F1",description:"Pi coding agent — minimal, extensible agent harness (pi.dev)",configType:"custom",docsUrl:"https://pi.dev",notes:[{type:"info",text:"Pi uses ~/.pi/agent/models.json. OmniHilbras is configured under providers.omnihilbras as an OpenAI-compatible endpoint."}]},omp:{id:"omp",name:"Oh My Pi",image:"/providers/omp.png",color:"#EC4899",description:"Oh My Pi terminal AI agent with auto-discovery support",configType:"custom",docsUrl:"https://github.com/can1357/oh-my-pi",notes:[{type:"info",text:"Oh My Pi uses ~/.omp/agent/models.yml and agent.db. OmniHilbras is configured with proxy discovery so all models appear automatically under /model."}]},crush:{id:"crush",name:"Crush",image:"/providers/crush.png",color:"#FB923C",description:"Charm Crush terminal AI coding agent",configType:"custom",docsUrl:"https://github.com/charmbracelet/crush",notes:[{type:"info",text:"Crush uses ~/.config/crush/crush.json. OmniHilbras registers as an openai-compat provider."}]},forge:{id:"forge",name:"ForgeCode",image:"/providers/forge.png",color:"#EAB308",description:"Antinomy HQ ForgeCode agent harness",configType:"custom",docsUrl:"https://github.com/antinomyhq/forge",notes:[{type:"info",text:"ForgeCode uses ~/.forge/config.toml. OmniHilbras updates the [openai] section with your baseUrl, apiKey, and model."}]},smelt:{id:"smelt",name:"Smelt",image:"/providers/smelt.svg",color:"#EF4444",description:"Smelt terminal AI coding assistant",configType:"custom",docsUrl:"https://github.com/leonardcser/smelt",notes:[{type:"info",text:"Smelt uses ~/.smelt/config.json for OpenAI-compatible endpoint configuration."}]},codewhale:{id:"codewhale",name:"CodeWhale",image:"/providers/codewhale.svg",color:"#4F46E5",description:"CodeWhale terminal coding agent (successor to DeepSeek TUI)",configType:"custom",docsUrl:"https://github.com/Hmbown/CodeWhale",notes:[{type:"info",text:"CodeWhale uses ~/.codewhale/config.toml. OmniHilbras configures the [openai] provider with your base_url, api_key, and model."}]}}},10761:(e,t,s)=>{s.d(t,{Tk:()=>I,aG:()=>X,Ah:()=>L,Q6:()=>Q,lF:()=>es,a7:()=>J,ZM:()=>R,WE:()=>em,E_:()=>ed,RF:()=>B,mW:()=>el,c9:()=>ee,gY:()=>eb,tA:()=>ep,kn:()=>eh,yZ:()=>K,qO:()=>V});var l=s(95155),a=s(12115),r=s(35497),i=s(5772),n=s(90620);function o({storageKey:e,changeEvent:t,itemField:s,normalize:l=e=>e,defaultName:a=e=>e}){let r=()=>{try{let t=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(t))return[];return t.filter(e=>e?.name&&e?.[s])}catch{return[]}},i=s=>{window.localStorage.setItem(e,JSON.stringify(s)),window.dispatchEvent(new CustomEvent(t))};return{read:r,subscribe:e=>(window.addEventListener(t,e),()=>window.removeEventListener(t,e)),upsert:(e,t)=>{let n=l(e);if(!n)return null;let o=r(),d=o.find(e=>l(e[s])===n);if(d&&!t)return d.name;let c=(t||a(n)).trim();return c?(i([...o.filter(e=>e.name!==c&&l(e[s])!==n),{name:c,[s]:n}].sort((e,t)=>e.name.localeCompare(t.name))),c):null},remove:e=>i(r().filter(t=>t.name!==e))}}let d=e=>(e||"").replace(/\/+$/,""),c=o({storageKey:"omnihilbras.cliToolEndpointPresets",changeEvent:"omnihilbras:endpoint-presets-changed",itemField:"baseUrl",normalize:d,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),m=o({storageKey:"omnihilbras.cliToolApiKeyPresets",changeEvent:"omnihilbras:api-key-presets-changed",itemField:"key"}),x=c.read,p=c.subscribe,u=c.upsert,h=c.remove,g=m.read,f=m.subscribe,b=m.upsert,y=m.remove;function j(e,{tunnelPublicUrl:t,tailscaleUrl:s,cloudUrl:l}={}){let a=d(e);return!a||[`http://127.0.0.1:${n.h0.appPort}`,t,s,l].filter(Boolean).flatMap(e=>[d(e),`${d(e)}/v1`]).includes(a)?null:u(a)}let v="__custom__",N="__save__",w=e=>{let t=(e||"").replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:""};function k({value:e,onChange:t,requiresExternalUrl:s=!1,tunnelEnabled:r=!1,tunnelPublicUrl:i="",tailscaleEnabled:o=!1,tailscaleUrl:c="",cloudEnabled:m=!1,cloudUrl:g="",withV1:f=!0,currentUrl:b=""}){let[y,j]=(0,a.useState)([]),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(""),[A,O]=(0,a.useState)(""),$=(0,a.useRef)(!1),M=(0,a.useRef)(""),I=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=x();j(e),E(t=>{if(t!==v)return t;let s=d(I.current);if(!s)return t;let l=e.find(e=>{let t=d(e.baseUrl);return t===s||t===w(s)});return l?`saved:${l.name}`:t})};return e(),_(!0),p(e)},[]);let P=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:t,tunnelPublicUrl:s,tailscaleEnabled:l,tailscaleUrl:a,cloudEnabled:r,cloudUrl:i,savedPresets:o,withV1:d})=>{let c=[],m=e=>d?w(e):(e||"").replace(/\/+$/,"");if(!e){let e=m(`http://127.0.0.1:${n.h0.appPort}`);c.push({value:"local",label:e,url:e})}if(t&&s){let e=m(s);c.push({value:"tunnel",label:e,url:e})}if(l&&a){let e=m(a);c.push({value:"tailscale",label:e,url:e})}if(r&&i){let e=m(i);c.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{c.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),c.push({value:v,label:"Custom URL...",url:""}),c})({requiresExternalUrl:s,tunnelEnabled:r,tunnelPublicUrl:i,tailscaleEnabled:o,tailscaleUrl:c,cloudEnabled:m,cloudUrl:g,savedPresets:y,withV1:f}),[s,r,i,o,c,m,g,y,f]);(0,a.useEffect)(()=>{if(!C||0===P.length)return;let e=e=>f?w(e):d(e),s=e(b);if($.current&&M.current===s)return;$.current=!0,M.current=s;let l=s?P.find(t=>t.value!==v&&e(t.url)===s):null;if(l)O(""),I.current="",E(l.value),t(l.url);else if(s)O(s),I.current=s,E(v),t(s);else{let e=P.find(e=>e.value!==v);if(!e)return;E(e.value),t(e.url)}},[C,P,t,b,f]);let U=S.startsWith("saved:"),T=S===v,D=T&&(A||"").trim().length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:S,onChange:s=>{let l=s.target.value;if(l===N){let t=(e||"").trim();if(!t)return;let s=t;try{s=new URL(t).host}catch{}let l=window.prompt("Save endpoint as:",s),a=l?.trim()?u(t,l.trim()):null;a&&E(`saved:${a}`);return}if(E(l),l===v){O(""),t("");return}let a=P.find(e=>e.value===l);a&&t(a.url)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[P.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value)),D&&(0,l.jsx)("option",{value:N,children:"+ Save current as..."})]}),U&&(0,l.jsx)("button",{type:"button",onClick:()=>{if(!S.startsWith("saved:"))return;h(S.slice(6)),O("");let e=P.find(e=>e.value!==v&&e.value!==S);e?(E(e.value),t(e.url)):(E(v),t(""))},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),T&&(0,l.jsx)("input",{type:"text",value:A,onChange:e=>{let s=e.target.value;I.current=s,O(s),t(s)},placeholder:f?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}let C="__custom__",_="__save_key__";function S({value:e,onChange:t,apiKeys:s=[],cloudEnabled:r=!1,className:i=""}){let[n,o]=(0,a.useState)([]),[d,c]=(0,a.useState)(!1),[m,x]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>o(g());return e(),f(e)},[]);let p=(0,a.useMemo)(()=>[...s.map(e=>({value:e.key,label:e.key})),...n.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:C,label:"Custom...",url:""}],[s,n]),u=e?p.find(t=>t.value===e||t.url===e):null,h=u?u.value:d||e?C:p[0]?.value??C,j=d?m:e||"",v="string"==typeof h&&h.startsWith("saved:"),N=h===C,w=N&&(e||"").trim().length>0&&!s.some(t=>t.key===e);return 0!==s.length||0!==n.length||d||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${i}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:h,onChange:s=>{let l=s.target.value;if(l===_)return void b((e||"").trim());if(l===C){c(!0),x(""),t("");return}c(!1),x("");let a=p.find(e=>e.value===l);a&&t(a.url??a.value)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[p.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value)),w&&(0,l.jsx)("option",{value:_,children:"+ Save current as..."})]}),v&&(0,l.jsx)("button",{type:"button",onClick:()=>{if(!v)return;y(h.slice(6)),c(!1),x("");let e=p.find(e=>e.value!==C&&e.value!==h);t(e?e.url??e.value:"")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),N&&(0,l.jsx)("input",{type:"text",value:j,onChange:e=>{let s=e.target.value;c(!0),x(s),t(s)},placeholder:"sk-...",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5 ${i}`,children:r?"No API keys - Create one in Keys page":"sk_omnihilbras (default)"})}let E=e=>(e||"").replace(/\/+$/,"");function A(e,t={}){if(!e)return!1;let s=E(e),{tunnelPublicUrl:l,tailscaleUrl:a,cloudUrl:r}=t;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(s)||l&&s.startsWith(E(l))||a&&s.startsWith(E(a))||r&&s.startsWith(E(r)))}let O=/\[1m\]$/i,$=s(41463).env.NEXT_PUBLIC_CLOUD_URL,M=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function I({tool:e,isExpanded:t,onToggle:s,activeProviders:n,modelMappings:o,onModelMappingChange:d,baseUrl:c,hasActiveProviders:m,apiKeys:x,cloudEnabled:p,initialStatus:u,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:b}){let y,v,N,[w,C]=(0,a.useState)(u||null),[_,E]=(0,a.useState)(!1),[P,U]=(0,a.useState)(!1),[T,D]=(0,a.useState)(!1),[L,z]=(0,a.useState)(null),[R,K]=(0,a.useState)(!1),[H,F]=(0,a.useState)(!1),[q,B]=(0,a.useState)(null),[W,G]=(0,a.useState)(""),[J,V]=(0,a.useState)({}),[Y,Z]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(""),[ee,et]=(0,a.useState)(!1),[es,el]=(0,a.useState)(!1),[ea,er]=(0,a.useState)(""),[ei,en]=(0,a.useState)(!1),eo=(0,a.useRef)(!1),ed=w?.settings?.env?.ANTHROPIC_BASE_URL||"",ec=(()=>{if(!w?.installed)return null;let e=w.settings?.env?.ANTHROPIC_BASE_URL;return e?A(e,{tunnelPublicUrl:g,tailscaleUrl:b,cloudUrl:p?$:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{x?.length>0&&!W&&G(x[0].key)},[x,W]),(0,a.useEffect)(()=>{u&&(C(u),el(!!u.exaMcpEnabled))},[u]),(0,a.useEffect)(()=>{er(w?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[w?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let t=w?.settings?.env;t&&en(e.defaultModels.some(e=>t[e.envKey]?.endsWith("[1m]")))},[w?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{t&&(w||ep(),ex())},[t]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{et(!!e.ccFilterNaming)}).catch(()=>{})},[]);let em=async e=>{let t=e.target.checked;et(t),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:t})}).catch(()=>{})},ex=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&V(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(w?.installed&&!eo.current){eo.current=!0;let t=w.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&G(s)}},[w,x,e.defaultModels,d]);let ep=async()=>{E(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();C(t),el(!!t.exaMcpEnabled)}catch(e){C({installed:!1,error:e.message})}finally{E(!1)}},eu=()=>{let e=Q||c;return e.endsWith("/v1")?e:`${e}/v1`},eh=async()=>{U(!0),z(null);try{let t={ANTHROPIC_BASE_URL:eu()},s=W?.trim()||(x?.length>0?x[0].key:null)||(p?null:"sk_omnihilbras");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(t[e.envKey]=s)}),ea&&(t.CLAUDE_CODE_AUTO_COMPACT_WINDOW=ea);let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,exaMcpEnabled:es,autoCompactWindow:ea})}),a=await l.json();l.ok?(j(eu(),{tunnelPublicUrl:g,tailscaleUrl:b}),z({type:"success",text:"Settings applied successfully!"}),C(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t},exaMcpEnabled:es}))):z({type:"error",text:a.error||"Failed to apply settings"})}catch(e){z({type:"error",text:e.message})}finally{U(!1)}},eg=async()=>{D(!0),z(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(z({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),G(""),el(!1),er(""),en(!1)):z({type:"error",text:s.error||"Failed to reset settings"})}catch(e){z({type:"error",text:e.message})}finally{D(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.A,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!_&&w&&!w.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if omnihilbras is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>Z(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>K(!R),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:R?"expand_less":"help"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!_&&w?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(k,{value:Q||((y=Q||c).endsWith("/v1")?y:`${y}/v1`),onChange:X,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:b,currentUrl:ed})]}),w?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(S,{value:W,onChange:G,apiKeys:x,cloudEnabled:p})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,l.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),o[e.alias]&&(0,l.jsx)("button",{onClick:()=>d(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{B(e.alias),F(!0)},disabled:!m,className:`rounded border px-2.5 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap shrink-0 ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("select",{value:ea,onChange:e=>er(e.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:M.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.label))})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:ei,onChange:t=>{var s;en(s=t.target.checked),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&d(e.alias,((e,t)=>{let{model:s}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let t=e.trim(),s=t.match(O);return s?{model:t.slice(0,-s[0].length),contextMarker:s[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return t?`${s}[1m]`:s})(t,s))})},className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Append [1m] to the model name"}),(0,l.jsx)(r.m_,{text:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:ee,onChange:em,className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"}),(0,l.jsx)(r.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:es,onChange:e=>el(e.target.checked),className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Exa MCP"}),(0,l.jsx)(r.m_,{text:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===L.type?"check_circle":"error"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eh,disabled:!m,loading:P,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eg,disabled:!w?.hasOmniHilbras,loading:T,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),H&&(0,l.jsx)(r.rq,{isOpen:H,onClose:()=>F(!1),onSelect:e=>{q&&d(q,e.value)},selectedModel:q?o[q]:null,activeProviders:n,modelAliases:J,title:`Select model for ${q}`}),(0,l.jsx)(r.uR,{isOpen:Y,onClose:()=>Z(!1),title:"Claude CLI - Manual Configuration",configs:(v=W&&W.trim()?W:p?"<API_KEY_FROM_DASHBOARD>":"sk_omnihilbras",N={ANTHROPIC_BASE_URL:eu(),ANTHROPIC_AUTH_TOKEN:v},e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(N[e.envKey]=t)}),ea&&(N.CLAUDE_CODE_AUTO_COMPACT_WINDOW=ea),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:N},null,2)}])})]})}var P=s(57250);let U=(e,t)=>{let s=e.match(RegExp(`^\\s*${t}\\s*=\\s*(["'])([^\\n]*?)\\1\\s*(?:#.*)?$`));return s?s[2]:""};function T(e){if("string"!=typeof e)return{baseUrl:"",apiKey:""};let t=e.split(/\r?\n/),s="",l=!0;for(let e of t){if(/^\s*\[/.test(e)){l=!1;continue}l&&(s=U(e,"model_provider")||s)}if(!s)return{baseUrl:"",apiKey:""};let a=`model_providers.${s}`,r=!1,i=!1,n="",o="";for(let e of t){let t=e.match(/^\s*\[\s*([^\]]+?)\s*\]\s*(?:#.*)?$/);if(t){r=t[1]===a,i=t[1]===`${a}.http_headers`;continue}if(r&&(n=U(e,"base_url")||n),i){let t=U(e,"Authorization").match(/^Bearer\s+(.+)$/i);o=t?t[1]:o}}return{baseUrl:n,apiKey:o}}function D(e,t=[]){if(!e||"string"!=typeof e)return"model";let s="",l=e.trim();"config"===(s=(s=l.includes("/")?l.split("/")[0].toLowerCase().replace(/[^a-z0-9_-]/g,""):l.toLowerCase().replace(/[^a-z0-9_-]/g,"")).replace(/^[-_]+|[-_]+$/g,"")||"model")&&(s="model-config");let a=s,r=2;for(;t.includes(a);)a=`${s}-${r}`,r++;return a}function L({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:x,tunnelPublicUrl:p,tailscaleEnabled:u,tailscaleUrl:h}){let g,f,[b,y]=(0,a.useState)(m||null),[v,N]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),[_,E]=(0,a.useState)(!1),[O,$]=(0,a.useState)(null),[M,I]=(0,a.useState)(!1),[U,z]=(0,a.useState)(""),[R,K]=(0,a.useState)(""),[H,F]=(0,a.useState)(""),[q,B]=(0,a.useState)(!1),[W,G]=(0,a.useState)(!1),[J,V]=(0,a.useState)({}),[Y,Z]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(""),[ee,et]=(0,a.useState)([]),[es,el]=(0,a.useState)(""),[ea,er]=(0,a.useState)(""),[ei,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(!1),[ec,em]=(0,a.useState)(null),[ex,ep]=(0,a.useState)("");(0,a.useEffect)(()=>{eh()},[]),(0,a.useEffect)(()=>{!(o?.length>0)||U||b?.config||z(o[0].key)},[o,U,b?.config]),(0,a.useEffect)(()=>{m&&y(m)},[m]),(0,a.useEffect)(()=>{t&&(b||eN(),eu(),eh())},[t]);let eu=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&V(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},eh=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&et(t.profiles||[])}catch(e){console.log("Error fetching codex profiles:",e)}},eg=async()=>{let e=es.trim().toLowerCase().replace(/[^a-z0-9_-]/g,""),t=ea.trim();if(e&&t){ed(!0);try{let s=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,model:t})}),l=await s.json();s.ok?(el(""),er(""),eh()):$({type:"error",text:l.error||"Failed to add model"})}catch(e){$({type:"error",text:e.message})}finally{ed(!1)}}},ef=async e=>{em(e);try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})).ok&&eh()}catch(e){console.log("Error deleting codex profile:",e)}finally{em(null)}},eb=async e=>{try{await navigator.clipboard.writeText(e),ep(e),setTimeout(()=>ep(""),2e3)}catch(e){console.log("Copy failed",e)}};(0,a.useEffect)(()=>{let e=b?.config;if(e){let{baseUrl:t,apiKey:s}=T(e);X(t),z(s);let l=e.match(/^model\s*=\s*"([^"]+)"/m);l&&K(l[1]);let a=e.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);a&&F(a[1])}},[b?.config]);let ey=T(b?.config).baseUrl,ej=b?.installed?b.config?A(ey,{tunnelPublicUrl:p,tailscaleUrl:h})?"configured":"other":"not_configured":null,ev=()=>{let e=(Q||`${n}/v1`).replace(/\/+$/,"");return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/codex-settings",{cache:"no-store"}),t=await e.json();y(t)}catch(e){y({installed:!1,error:e.message})}finally{N(!1)}},ew=async()=>{C(!0),$(null);try{let e=U&&U.trim()||c?U:"sk_omnihilbras",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ev(),apiKey:e,model:R,subagentModel:H||R})}),s=await t.json();t.ok?(j(ev(),{tunnelPublicUrl:p,tailscaleUrl:h}),$({type:"success",text:"Settings applied successfully!"}),eN()):$({type:"error",text:s.error||"Failed to apply settings"})}catch(e){$({type:"error",text:e.message})}finally{C(!1)}},ek=async()=>{E(!0),$(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?($({type:"success",text:"Settings reset successfully!"}),K(""),F(""),eN()):$({type:"error",text:t.error||"Failed to reset settings"})}catch(e){$({type:"error",text:e.message})}finally{E(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.A,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!v&&b&&!b.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if omnihilbras is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>Z(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>I(!M),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:M?"expand_less":"help"}),M?"Hide":"How to Install"]})]})]}),M&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex reads custom providers from ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!v&&b?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(k,{value:Q||Q||`${n}/v1`,onChange:X,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:x,tunnelPublicUrl:p,tailscaleEnabled:u,tailscaleUrl:h,currentUrl:ey})]}),b?.config&&(ey?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:ey})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(S,{value:U,onChange:z,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:R,onChange:e=>K(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,l.jsx)("button",{onClick:()=>K(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>B(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:H,onChange:e=>F(e.target.value),placeholder:R||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),H&&(0,l.jsx)("button",{onClick:()=>F(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>G(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),O&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,l.jsx)("span",{children:O.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ew,disabled:!U&&c&&o.length>0||!R,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ek,disabled:_,loading:_,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]}),(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:"text-xs font-semibold text-text-main flex items-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"layers"}),"Additional Models"]}),ee.length>0&&(0,l.jsx)("span",{className:"px-1.5 py-0.2 bg-primary/10 text-primary text-[10px] font-medium rounded-full",children:ee.length})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-1.5 p-2.5 bg-surface/40 border border-border rounded-lg",children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[10rem_1fr_auto_auto] sm:items-center",children:[(0,l.jsx)("input",{type:"text",value:es,onChange:e=>el(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),placeholder:"Alias (e.g. claude)",className:"w-full min-w-0 px-2.5 py-1.5 bg-surface rounded border border-border text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&eg()}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:ea,onChange:e=>{let t=e.target.value;er(t),el(D(t.includes("/")?t.split("/")[0]:t,ee.map(e=>e.name)))},placeholder:"provider/model-id",className:"w-full min-w-0 pl-2.5 pr-7 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&eg()}),ea&&(0,l.jsx)("button",{onClick:()=>er(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>en(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2.5 py-1.5 text-xs transition-colors whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eg,disabled:!es.trim()||!ea.trim()||eo,loading:eo,className:"!h-7.5 whitespace-nowrap",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px] mr-1",children:"add"}),"Add"]})]})}),0===ee.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center p-4 border border-dashed border-border rounded-lg text-center bg-surface/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted mb-1 opacity-60",children:"terminal"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Only the main model is active. Add an alias above to configure more models for Codex CLI."})]}):(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ee.map(e=>{let t=e.model.includes("/")?e.model.split("/")[0]:e.name,s=ex===e.command;return(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2.5 bg-surface/50 border border-border hover:border-border-hover rounded-lg transition-colors group",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,l.jsx)("div",{className:"size-6 flex items-center justify-center shrink-0 rounded bg-black/5 dark:bg-white/5 p-0.5",children:(0,l.jsx)(P.A,{providerId:t,size:18,fallbackText:e.name.slice(0,2).toUpperCase()})}),(0,l.jsxs)("div",{className:"min-w-0 flex flex-col",children:[(0,l.jsx)("span",{className:"font-medium text-xs text-text-main truncate",children:e.name}),(0,l.jsx)("span",{className:"text-[11px] text-text-muted truncate font-mono",children:e.model})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,l.jsxs)("button",{onClick:()=>eb(e.command),className:`flex items-center gap-1 px-2 py-1 rounded text-[11px] font-mono border transition-all ${s?"bg-green-500/10 border-green-500/30 text-green-600 dark:text-green-400":"bg-surface border-border text-text-muted hover:text-text-main hover:border-primary/50 cursor-pointer"}`,title:"Click to copy command",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:s?"check":"terminal"}),(0,l.jsx)("span",{className:"hidden md:inline",children:e.command}),(0,l.jsx)("span",{className:"md:hidden",children:"copy"})]}),(0,l.jsx)("button",{onClick:()=>ef(e.name),disabled:ec===e.name,className:"p-1 text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity rounded",title:"Delete model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"close"})})]})]},e.name)})})]})]})]}),q&&(0,l.jsx)(r.rq,{isOpen:q,onClose:()=>B(!1),onSelect:e=>{K(e.value),H||F(e.value),B(!1)},selectedModel:R,activeProviders:d,modelAliases:J,title:"Select Model for Codex"}),W&&(0,l.jsx)(r.rq,{isOpen:W,onClose:()=>G(!1),onSelect:e=>{F(e.value),G(!1)},selectedModel:H,activeProviders:d,modelAliases:J,title:"Select Subagent Model for Codex"}),ei&&(0,l.jsx)(r.rq,{isOpen:ei,onClose:()=>en(!1),onSelect:e=>{en(!1);let t=e?.value||e?.id;t&&(er(t),el(D(e?.provider||(t.includes("/")?t.split("/")[0]:t),ee.map(e=>e.name))))},selectedModel:ea,activeProviders:d,modelAliases:J,title:"Select Model for Codex CLI"}),(0,l.jsx)(r.uR,{isOpen:Y,onClose:()=>Z(!1),title:"Codex CLI - Manual Configuration",configs:(g=U&&U.trim()?U:c?"<API_KEY_FROM_DASHBOARD>":"sk_omnihilbras",f=H||R,[{filename:"~/.codex/config.toml",content:`# OmniHilbras Configuration for Codex CLI
44
+ # Fetch and follow .opencode/INSTALL.md from the repo`}},pi:{id:"pi",name:"Pi (pi-coding-agent)",image:"/providers/pi.svg",color:"#6366F1",description:"Pi coding agent — minimal, extensible agent harness (pi.dev)",configType:"custom",docsUrl:"https://pi.dev",notes:[{type:"info",text:"Pi uses ~/.pi/agent/models.json. OmniHilbras is configured under providers.omnihilbras as an OpenAI-compatible endpoint."}]},omp:{id:"omp",name:"Oh My Pi",image:"/providers/omp.png",color:"#EC4899",description:"Oh My Pi terminal AI agent with auto-discovery support",configType:"custom",docsUrl:"https://github.com/can1357/oh-my-pi",notes:[{type:"info",text:"Oh My Pi uses ~/.omp/agent/models.yml and agent.db. OmniHilbras is configured with proxy discovery so all models appear automatically under /model."}]},crush:{id:"crush",name:"Crush",image:"/providers/crush.png",color:"#FB923C",description:"Charm Crush terminal AI coding agent",configType:"custom",docsUrl:"https://github.com/charmbracelet/crush",notes:[{type:"info",text:"Crush uses ~/.config/crush/crush.json. OmniHilbras registers as an openai-compat provider."}]},forge:{id:"forge",name:"ForgeCode",image:"/providers/forge.png",color:"#EAB308",description:"Antinomy HQ ForgeCode agent harness",configType:"custom",docsUrl:"https://github.com/antinomyhq/forge",notes:[{type:"info",text:"ForgeCode uses ~/.forge/config.toml. OmniHilbras updates the [openai] section with your baseUrl, apiKey, and model."}]},smelt:{id:"smelt",name:"Smelt",image:"/providers/smelt.svg",color:"#EF4444",description:"Smelt terminal AI coding assistant",configType:"custom",docsUrl:"https://github.com/leonardcser/smelt",notes:[{type:"info",text:"Smelt uses ~/.smelt/config.json for OpenAI-compatible endpoint configuration."}]},codewhale:{id:"codewhale",name:"CodeWhale",image:"/providers/codewhale.svg",color:"#4F46E5",description:"CodeWhale terminal coding agent (successor to DeepSeek TUI)",configType:"custom",docsUrl:"https://github.com/Hmbown/CodeWhale",notes:[{type:"info",text:"CodeWhale uses ~/.codewhale/config.toml. OmniHilbras configures the [openai] provider with your base_url, api_key, and model."}]}}},10761:(e,t,s)=>{s.d(t,{Tk:()=>I,aG:()=>X,Ah:()=>L,Q6:()=>Q,lF:()=>es,a7:()=>J,ZM:()=>R,WE:()=>em,E_:()=>ed,RF:()=>B,mW:()=>el,c9:()=>ee,gY:()=>eb,tA:()=>ep,kn:()=>eh,yZ:()=>K,qO:()=>V});var l=s(95155),a=s(12115),r=s(35497),i=s(5772),n=s(90620);function o({storageKey:e,changeEvent:t,itemField:s,normalize:l=e=>e,defaultName:a=e=>e}){let r=()=>{try{let t=JSON.parse(window.localStorage.getItem(e)||"[]");if(!Array.isArray(t))return[];return t.filter(e=>e?.name&&e?.[s])}catch{return[]}},i=s=>{window.localStorage.setItem(e,JSON.stringify(s)),window.dispatchEvent(new CustomEvent(t))};return{read:r,subscribe:e=>(window.addEventListener(t,e),()=>window.removeEventListener(t,e)),upsert:(e,t)=>{let n=l(e);if(!n)return null;let o=r(),d=o.find(e=>l(e[s])===n);if(d&&!t)return d.name;let c=(t||a(n)).trim();return c?(i([...o.filter(e=>e.name!==c&&l(e[s])!==n),{name:c,[s]:n}].sort((e,t)=>e.name.localeCompare(t.name))),c):null},remove:e=>i(r().filter(t=>t.name!==e))}}let d=e=>(e||"").replace(/\/+$/,""),c=o({storageKey:"omnihilbras.cliToolEndpointPresets",changeEvent:"omnihilbras:endpoint-presets-changed",itemField:"baseUrl",normalize:d,defaultName:e=>{try{return new URL(e).host}catch{return e}}}),m=o({storageKey:"omnihilbras.cliToolApiKeyPresets",changeEvent:"omnihilbras:api-key-presets-changed",itemField:"key"}),x=c.read,p=c.subscribe,u=c.upsert,h=c.remove,g=m.read,f=m.subscribe,b=m.upsert,y=m.remove;function j(e,{tunnelPublicUrl:t,tailscaleUrl:s,cloudUrl:l}={}){let a=d(e);return!a||[`http://127.0.0.1:${n.h0.appPort}`,t,s,l].filter(Boolean).flatMap(e=>[d(e),`${d(e)}/v1`]).includes(a)?null:u(a)}let v="__custom__",N="__save__",w=e=>{let t=(e||"").replace(/\/+$/,"");return t?/\/v1$/.test(t)?t:`${t}/v1`:""};function k({value:e,onChange:t,requiresExternalUrl:s=!1,tunnelEnabled:r=!1,tunnelPublicUrl:i="",tailscaleEnabled:o=!1,tailscaleUrl:c="",cloudEnabled:m=!1,cloudUrl:g="",withV1:f=!0,currentUrl:b=""}){let[y,j]=(0,a.useState)([]),[C,_]=(0,a.useState)(!1),[S,E]=(0,a.useState)(""),[A,O]=(0,a.useState)(""),$=(0,a.useRef)(!1),M=(0,a.useRef)(""),I=(0,a.useRef)("");(0,a.useEffect)(()=>{let e=()=>{let e=x();j(e),E(t=>{if(t!==v)return t;let s=d(I.current);if(!s)return t;let l=e.find(e=>{let t=d(e.baseUrl);return t===s||t===w(s)});return l?`saved:${l.name}`:t})};return e(),_(!0),p(e)},[]);let P=(0,a.useMemo)(()=>(({requiresExternalUrl:e,tunnelEnabled:t,tunnelPublicUrl:s,tailscaleEnabled:l,tailscaleUrl:a,cloudEnabled:r,cloudUrl:i,savedPresets:o,withV1:d})=>{let c=[],m=e=>d?w(e):(e||"").replace(/\/+$/,"");if(!e){let e=m(`http://127.0.0.1:${n.h0.appPort}`);c.push({value:"local",label:e,url:e})}if(t&&s){let e=m(s);c.push({value:"tunnel",label:e,url:e})}if(l&&a){let e=m(a);c.push({value:"tailscale",label:e,url:e})}if(r&&i){let e=m(i);c.push({value:"cloud",label:e,url:e})}return o.forEach(e=>{c.push({value:`saved:${e.name}`,label:e.baseUrl,url:e.baseUrl,saved:!0})}),c.push({value:v,label:"Custom URL...",url:""}),c})({requiresExternalUrl:s,tunnelEnabled:r,tunnelPublicUrl:i,tailscaleEnabled:o,tailscaleUrl:c,cloudEnabled:m,cloudUrl:g,savedPresets:y,withV1:f}),[s,r,i,o,c,m,g,y,f]);(0,a.useEffect)(()=>{if(!C||0===P.length)return;let e=e=>f?w(e):d(e),s=e(b);if($.current&&M.current===s)return;$.current=!0,M.current=s;let l=s?P.find(t=>t.value!==v&&e(t.url)===s):null;if(l)O(""),I.current="",E(l.value),t(l.url);else if(s)O(s),I.current=s,E(v),t(s);else{let e=P.find(e=>e.value!==v);if(!e)return;E(e.value),t(e.url)}},[C,P,t,b,f]);let U=S.startsWith("saved:"),T=S===v,D=T&&(A||"").trim().length>0;return(0,l.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:S,onChange:s=>{let l=s.target.value;if(l===N){let t=(e||"").trim();if(!t)return;let s=t;try{s=new URL(t).host}catch{}let l=window.prompt("Save endpoint as:",s),a=l?.trim()?u(t,l.trim()):null;a&&E(`saved:${a}`);return}if(E(l),l===v){O(""),t("");return}let a=P.find(e=>e.value===l);a&&t(a.url)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[P.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value)),D&&(0,l.jsx)("option",{value:N,children:"+ Save current as..."})]}),U&&(0,l.jsx)("button",{type:"button",onClick:()=>{if(!S.startsWith("saved:"))return;h(S.slice(6)),O("");let e=P.find(e=>e.value!==v&&e.value!==S);e?(E(e.value),t(e.url)):(E(v),t(""))},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),T&&(0,l.jsx)("input",{type:"text",value:A,onChange:e=>{let s=e.target.value;I.current=s,O(s),t(s)},placeholder:f?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}let C="__custom__",_="__save_key__";function S({value:e,onChange:t,apiKeys:s=[],cloudEnabled:r=!1,className:i=""}){let[n,o]=(0,a.useState)([]),[d,c]=(0,a.useState)(!1),[m,x]=(0,a.useState)("");(0,a.useEffect)(()=>{let e=()=>o(g());return e(),f(e)},[]);let p=(0,a.useMemo)(()=>[...s.map(e=>({value:e.key,label:e.key})),...n.map(e=>({value:`saved:${e.name}`,label:e.key,url:e.key,saved:!0})),{value:C,label:"Custom...",url:""}],[s,n]),u=e?p.find(t=>t.value===e||t.url===e):null,h=u?u.value:d||e?C:p[0]?.value??C,j=d?m:e||"",v="string"==typeof h&&h.startsWith("saved:"),N=h===C,w=N&&(e||"").trim().length>0&&!s.some(t=>t.key===e);return 0!==s.length||0!==n.length||d||e?(0,l.jsxs)("div",{className:`flex flex-col gap-1.5 ${i}`,children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("select",{value:h,onChange:s=>{let l=s.target.value;if(l===_)return void b((e||"").trim());if(l===C){c(!0),x(""),t("");return}c(!1),x("");let a=p.find(e=>e.value===l);a&&t(a.url??a.value)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[p.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value)),w&&(0,l.jsx)("option",{value:_,children:"+ Save current as..."})]}),v&&(0,l.jsx)("button",{type:"button",onClick:()=>{if(!v)return;y(h.slice(6)),c(!1),x("");let e=p.find(e=>e.value!==C&&e.value!==h);t(e?e.url??e.value:"")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved key",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),N&&(0,l.jsx)("input",{type:"text",value:j,onChange:e=>{let s=e.target.value;c(!0),x(s),t(s)},placeholder:"sk-...",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]}):(0,l.jsx)("span",{className:`min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5 ${i}`,children:r?"No API keys - Create one in Keys page":"sk_omnihilbras (default)"})}let E=e=>(e||"").replace(/\/+$/,"");function A(e,t={}){if(!e)return!1;let s=E(e),{tunnelPublicUrl:l,tailscaleUrl:a,cloudUrl:r}=t;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(s)||l&&s.startsWith(E(l))||a&&s.startsWith(E(a))||r&&s.startsWith(E(r)))}let O=/\[1m\]$/i,$=s(41463).env.NEXT_PUBLIC_CLOUD_URL,M=[{label:"Default",value:""},{label:"200K",value:"198000"},{label:"300K",value:"298000"},{label:"500K",value:"498000"},{label:"700K",value:"698000"}];function I({tool:e,isExpanded:t,onToggle:s,activeProviders:n,modelMappings:o,onModelMappingChange:d,baseUrl:c,hasActiveProviders:m,apiKeys:x,cloudEnabled:p,initialStatus:u,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:b}){let y,v,N,[w,C]=(0,a.useState)(u||null),[_,E]=(0,a.useState)(!1),[P,U]=(0,a.useState)(!1),[T,D]=(0,a.useState)(!1),[L,z]=(0,a.useState)(null),[R,K]=(0,a.useState)(!1),[H,F]=(0,a.useState)(!1),[q,B]=(0,a.useState)(null),[W,G]=(0,a.useState)(""),[J,V]=(0,a.useState)({}),[Y,Z]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(""),[ee,et]=(0,a.useState)(!1),[es,el]=(0,a.useState)(!1),[ea,er]=(0,a.useState)(""),[ei,en]=(0,a.useState)(!1),eo=(0,a.useRef)(!1),ed=w?.settings?.env?.ANTHROPIC_BASE_URL||"",ec=(()=>{if(!w?.installed)return null;let e=w.settings?.env?.ANTHROPIC_BASE_URL;return e?A(e,{tunnelPublicUrl:g,tailscaleUrl:b,cloudUrl:p?$:null})?"configured":"other":"not_configured"})();(0,a.useEffect)(()=>{x?.length>0&&!W&&G(x[0].key)},[x,W]),(0,a.useEffect)(()=>{u&&(C(u),el(!!u.exaMcpEnabled))},[u]),(0,a.useEffect)(()=>{er(w?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW||"")},[w?.settings?.env?.CLAUDE_CODE_AUTO_COMPACT_WINDOW]),(0,a.useEffect)(()=>{let t=w?.settings?.env;t&&en(e.defaultModels.some(e=>t[e.envKey]?.endsWith("[1m]")))},[w?.settings?.env,e.defaultModels]),(0,a.useEffect)(()=>{t&&(w||ep(),ex())},[t]),(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.ok?e.json():(z({type:"error",text:"Failed to load settings"}),null)).then(e=>{e&&et(!!e.ccFilterNaming)}).catch(()=>{})},[]);let em=async e=>{let t=e.target.checked;et(t),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:t})}).catch(()=>{})},ex=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&V(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}};(0,a.useEffect)(()=>{if(w?.installed&&!eo.current){eo.current=!0;let t=w.settings?.env||{};e.defaultModels.forEach(e=>{if(e.envKey){let s=t[e.envKey]||e.defaultValue||"";s&&d(e.alias,s)}});let s=t.ANTHROPIC_AUTH_TOKEN;s&&G(s)}},[w,x,e.defaultModels,d]);let ep=async()=>{E(!0);try{let e=await fetch("/api/cli-tools/claude-settings"),t=await e.json();C(t),el(!!t.exaMcpEnabled)}catch(e){C({installed:!1,error:e.message})}finally{E(!1)}},eu=()=>{let e=Q||c;return e.endsWith("/v1")?e:`${e}/v1`},eh=async()=>{U(!0),z(null);try{let t={ANTHROPIC_BASE_URL:eu()},s=W?.trim()||(x?.length>0?x[0].key:null)||(p?null:"sk_omnihilbras");s&&(t.ANTHROPIC_AUTH_TOKEN=s),e.defaultModels.forEach(e=>{let s=o[e.alias];s&&e.envKey&&(t[e.envKey]=s)}),ea&&(t.CLAUDE_CODE_AUTO_COMPACT_WINDOW=ea);let l=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:t,exaMcpEnabled:es,autoCompactWindow:ea})}),a=await l.json();l.ok?(j(eu(),{tunnelPublicUrl:g,tailscaleUrl:b}),z({type:"success",text:"Settings applied successfully!"}),C(e=>({...e,hasBackup:!0,settings:{...e?.settings,env:t},exaMcpEnabled:es}))):z({type:"error",text:a.error||"Failed to apply settings"})}catch(e){z({type:"error",text:e.message})}finally{U(!1)}},eg=async()=>{D(!0),z(null);try{let t=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),s=await t.json();t.ok?(z({type:"success",text:"Settings reset successfully!"}),e.defaultModels.forEach(e=>d(e.alias,e.defaultValue||"")),G(""),el(!1),er(""),en(!1)):z({type:"error",text:s.error||"Failed to reset settings"})}catch(e){z({type:"error",text:e.message})}finally{D(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.A,{src:"/providers/claude.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ec&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[_&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Claude CLI..."})]}),!_&&w&&!w.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if omnihilbras is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>Z(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>K(!R),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:R?"expand_less":"help"}),R?"Hide":"How to Install"]})]})]}),R&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!_&&w?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(k,{value:Q||((y=Q||c).endsWith("/v1")?y:`${y}/v1`),onChange:X,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:h,tunnelPublicUrl:g,tailscaleEnabled:f,tailscaleUrl:b,currentUrl:ed})]}),w?.settings?.env?.ANTHROPIC_BASE_URL&&(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.settings.env.ANTHROPIC_BASE_URL})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(S,{value:W,onChange:G,apiKeys:x,cloudEnabled:p})]}),e.defaultModels.map(e=>(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:e.name}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,l.jsxs)("div",{className:"relative flex-1 min-w-0",children:[(0,l.jsx)("input",{type:"text",value:o[e.alias]||"",onChange:t=>d(e.alias,t.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),o[e.alias]&&(0,l.jsx)("button",{onClick:()=>d(e.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>{B(e.alias),F(!0)},disabled:!m,className:`rounded border px-2.5 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap shrink-0 ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]},e.alias)),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Auto-compact"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("select",{value:ea,onChange:e=>er(e.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:M.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.label))})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"1M context"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:ei,onChange:t=>{var s;en(s=t.target.checked),e.defaultModels.forEach(e=>{let t=o[e.alias];t&&d(e.alias,((e,t)=>{let{model:s}=function(e){if("string"!=typeof e)return{model:e,contextMarker:null};let t=e.trim(),s=t.match(O);return s?{model:t.slice(0,-s[0].length),contextMarker:s[0].slice(1,-1).toLowerCase()}:{model:e,contextMarker:null}}(e);return t?`${s}[1m]`:s})(t,s))})},className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Append [1m] to the model name"}),(0,l.jsx)(r.m_,{text:"Claude Code otherwise assumes a 200K window, which clamps the auto-compact window above. Applied to every mapped model — only enable it for models that really accept 1M.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:ee,onChange:em,className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"}),(0,l.jsx)(r.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-1.5 sm:grid sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Web Search"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,l.jsx)("input",{type:"checkbox",checked:es,onChange:e=>el(e.target.checked),className:"w-3.5 h-3.5 accent-primary cursor-pointer shrink-0"}),(0,l.jsx)("span",{className:"text-xs text-text-muted",children:"Exa MCP"}),(0,l.jsx)(r.m_,{text:"Injects Exa MCP into ~/.claude.json so non-Claude models gain web search. Restart Claude Code after Apply.",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]})]}),L&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===L.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===L.type?"check_circle":"error"}),(0,l.jsx)("span",{children:L.text})]}),(0,l.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eh,disabled:!m,loading:P,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:eg,disabled:!w?.hasOmniHilbras,loading:T,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),H&&(0,l.jsx)(r.rq,{isOpen:H,onClose:()=>F(!1),onSelect:e=>{q&&d(q,e.value)},selectedModel:q?o[q]:null,activeProviders:n,modelAliases:J,title:`Select model for ${q}`}),(0,l.jsx)(r.uR,{isOpen:Y,onClose:()=>Z(!1),title:"Claude CLI - Manual Configuration",configs:(v=W&&W.trim()?W:p?"<API_KEY_FROM_DASHBOARD>":"sk_omnihilbras",N={ANTHROPIC_BASE_URL:eu(),ANTHROPIC_AUTH_TOKEN:v},e.defaultModels.forEach(e=>{let t=o[e.alias];t&&e.envKey&&(N[e.envKey]=t)}),ea&&(N.CLAUDE_CODE_AUTO_COMPACT_WINDOW=ea),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:N},null,2)}])})]})}var P=s(57250);let U=(e,t)=>{let s=e.match(RegExp(`^\\s*${t}\\s*=\\s*(["'])([^\\n]*?)\\1\\s*(?:#.*)?$`));return s?s[2]:""};function T(e){if("string"!=typeof e)return{baseUrl:"",apiKey:""};let t=e.split(/\r?\n/),s="",l=!0;for(let e of t){if(/^\s*\[/.test(e)){l=!1;continue}l&&(s=U(e,"model_provider")||s)}if(!s)return{baseUrl:"",apiKey:""};let a=`model_providers.${s}`,r=!1,i=!1,n="",o="";for(let e of t){let t=e.match(/^\s*\[\s*([^\]]+?)\s*\]\s*(?:#.*)?$/);if(t){r=t[1]===a,i=t[1]===`${a}.http_headers`;continue}if(r&&(n=U(e,"base_url")||n),i){let t=U(e,"Authorization").match(/^Bearer\s+(.+)$/i);o=t?t[1]:o}}return{baseUrl:n,apiKey:o}}function D(e,t=[]){if(!e||"string"!=typeof e)return"model";let s="",l=e.trim();"config"===(s=(s=l.includes("/")?l.split("/")[0].toLowerCase().replace(/[^a-z0-9_-]/g,""):l.toLowerCase().replace(/[^a-z0-9_-]/g,"")).replace(/^[-_]+|[-_]+$/g,"")||"model")&&(s="model-config");let a=s,r=2;for(;t.includes(a);)a=`${s}-${r}`,r++;return a}function L({tool:e,isExpanded:t,onToggle:s,baseUrl:n,apiKeys:o,activeProviders:d,cloudEnabled:c,initialStatus:m,tunnelEnabled:x,tunnelPublicUrl:p,tailscaleEnabled:u,tailscaleUrl:h}){let g,f,[b,y]=(0,a.useState)(m||null),[v,N]=(0,a.useState)(!1),[w,C]=(0,a.useState)(!1),[_,E]=(0,a.useState)(!1),[O,$]=(0,a.useState)(null),[M,I]=(0,a.useState)(!1),[U,z]=(0,a.useState)(""),[R,K]=(0,a.useState)(""),[H,F]=(0,a.useState)(""),[q,B]=(0,a.useState)(!1),[W,G]=(0,a.useState)(!1),[J,V]=(0,a.useState)({}),[Y,Z]=(0,a.useState)(!1),[Q,X]=(0,a.useState)(""),[ee,et]=(0,a.useState)([]),[es,el]=(0,a.useState)(""),[ea,er]=(0,a.useState)(""),[ei,en]=(0,a.useState)(!1),[eo,ed]=(0,a.useState)(!1),[ec,em]=(0,a.useState)(null),[ex,ep]=(0,a.useState)("");(0,a.useEffect)(()=>{eh()},[]),(0,a.useEffect)(()=>{!(o?.length>0)||U||b?.config||z(o[0].key)},[o,U,b?.config]),(0,a.useEffect)(()=>{m&&y(m)},[m]),(0,a.useEffect)(()=>{t&&(b||eN(),eu(),eh())},[t]);let eu=async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&V(t.aliases||{})}catch(e){console.log("Error fetching model aliases:",e)}},eh=async()=>{try{let e=await fetch("/api/cli-tools/codex-profiles"),t=await e.json();e.ok&&et(t.profiles||[])}catch(e){console.log("Error fetching codex profiles:",e)}},eg=async()=>{let e=es.trim().toLowerCase().replace(/[^a-z0-9_-]/g,""),t=ea.trim();if(e&&t){ed(!0);try{let s=await fetch("/api/cli-tools/codex-profiles",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,model:t})}),l=await s.json();s.ok?(el(""),er(""),eh()):$({type:"error",text:l.error||"Failed to add model"})}catch(e){$({type:"error",text:e.message})}finally{ed(!1)}}},ef=async e=>{em(e);try{(await fetch("/api/cli-tools/codex-profiles",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})})).ok&&eh()}catch(e){console.log("Error deleting codex profile:",e)}finally{em(null)}},eb=async e=>{try{await navigator.clipboard.writeText(e),ep(e),setTimeout(()=>ep(""),2e3)}catch(e){console.log("Copy failed",e)}};(0,a.useEffect)(()=>{let e=b?.config;if(e){let{baseUrl:t,apiKey:s}=T(e);X(t),z(s);let l=e.match(/^model\s*=\s*"([^"]+)"/m);l&&K(l[1]);let a=e.match(/^default_subagent_model\s*=\s*"([^"]+)"/m);a&&F(a[1])}},[b?.config]);let ey=T(b?.config).baseUrl,ej=b?.installed?b.config?A(ey,{tunnelPublicUrl:p,tailscaleUrl:h})?"configured":"other":"not_configured":null,ev=()=>{let e=(Q||`${n}/v1`).replace(/\/+$/,"");return e.endsWith("/v1")?e:`${e}/v1`},eN=async()=>{N(!0);try{let e=await fetch("/api/cli-tools/codex-settings",{cache:"no-store"}),t=await e.json();y(t)}catch(e){y({installed:!1,error:e.message})}finally{N(!1)}},ew=async()=>{C(!0),$(null);try{let e=U&&U.trim()||c?U:"sk_omnihilbras",t=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ev(),apiKey:e,model:R,subagentModel:H||R})}),s=await t.json();t.ok?(j(ev(),{tunnelPublicUrl:p,tailscaleUrl:h}),$({type:"success",text:"Settings applied successfully!"}),eN()):$({type:"error",text:s.error||"Failed to apply settings"})}catch(e){$({type:"error",text:e.message})}finally{C(!1)}},ek=async()=>{E(!0),$(null);try{let e=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),t=await e.json();e.ok?($({type:"success",text:"Settings reset successfully!"}),K(""),F(""),eN()):$({type:"error",text:t.error||"Failed to reset settings"})}catch(e){$({type:"error",text:e.message})}finally{E(!1)}};return(0,l.jsxs)(r.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:s,children:[(0,l.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,l.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,l.jsx)(i.A,{src:"/providers/codex.png",alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,l.jsx)("h3",{className:"font-medium text-sm",children:e.name}),"configured"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ej&&(0,l.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,l.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,l.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${t?"rotate-180":""}`,children:"expand_more"})]}),t&&(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[v&&(0,l.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,l.jsx)("span",{children:"Checking Codex CLI..."})]}),!v&&b&&!b.installed&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,l.jsxs)("div",{className:"flex items-start gap-3",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,l.jsxs)("div",{className:"flex-1",children:[(0,l.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,l.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if omnihilbras is deployed on a remote server."})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,l.jsxs)(r.$n,{variant:"secondary",size:"sm",onClick:()=>Z(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:()=>I(!M),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:M?"expand_less":"help"}),M?"Hide":"How to Install"]})]})]}),M&&(0,l.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,l.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,l.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,l.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,l.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,l.jsx)("div",{className:"pt-2 border-t border-border",children:(0,l.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex reads custom providers from ",(0,l.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/config.toml"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!v&&b?.installed&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(k,{value:Q||Q||`${n}/v1`,onChange:X,requiresExternalUrl:e.requiresExternalUrl,tunnelEnabled:x,tunnelPublicUrl:p,tailscaleEnabled:u,tailscaleUrl:h,currentUrl:ey})]}),b?.config&&(ey?(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:ey})]}):null),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsx)(S,{value:U,onChange:z,apiKeys:o,cloudEnabled:c})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:R,onChange:e=>K(e.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),R&&(0,l.jsx)("button",{onClick:()=>K(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>B(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,l.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,l.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:H,onChange:e=>F(e.target.value),placeholder:R||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),H&&(0,l.jsx)("button",{onClick:()=>F(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>G(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),O&&(0,l.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===O.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===O.type?"check_circle":"error"}),(0,l.jsx)("span",{children:O.text})]}),(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:ew,disabled:!U&&c&&o.length>0||!R,loading:w,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,l.jsxs)(r.$n,{variant:"outline",size:"sm",onClick:ek,disabled:_,loading:_,children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,l.jsxs)(r.$n,{variant:"ghost",size:"sm",onClick:()=>Z(!0),children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]}),(0,l.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-3",children:[(0,l.jsx)("div",{className:"flex items-center justify-between",children:(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsxs)("span",{className:"text-xs font-semibold text-text-main flex items-center gap-1.5",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"layers"}),"Additional Models"]}),ee.length>0&&(0,l.jsx)("span",{className:"px-1.5 py-0.2 bg-primary/10 text-primary text-[10px] font-medium rounded-full",children:ee.length})]})}),(0,l.jsx)("div",{className:"flex flex-col gap-1.5 p-2.5 bg-surface/40 border border-border rounded-lg",children:(0,l.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-[10rem_1fr_auto_auto] sm:items-center",children:[(0,l.jsx)("input",{type:"text",value:es,onChange:e=>el(e.target.value.toLowerCase().replace(/[^a-z0-9_-]/g,"")),placeholder:"Alias (e.g. claude)",className:"w-full min-w-0 px-2.5 py-1.5 bg-surface rounded border border-border text-xs font-mono focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&eg()}),(0,l.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,l.jsx)("input",{type:"text",value:ea,onChange:e=>{let t=e.target.value;er(t),el(D(t.includes("/")?t.split("/")[0]:t,ee.map(e=>e.name)))},placeholder:"provider/model-id",className:"w-full min-w-0 pl-2.5 pr-7 py-1.5 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50",onKeyDown:e=>"Enter"===e.key&&eg()}),ea&&(0,l.jsx)("button",{onClick:()=>er(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,l.jsx)("button",{onClick:()=>en(!0),disabled:!d?.length,className:`w-full sm:w-auto rounded border px-2.5 py-1.5 text-xs transition-colors whitespace-nowrap sm:shrink-0 ${d?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),(0,l.jsxs)(r.$n,{variant:"primary",size:"sm",onClick:eg,disabled:!es.trim()||!ea.trim()||eo,loading:eo,className:"!h-7.5 whitespace-nowrap",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px] mr-1",children:"add"}),"Add"]})]})}),0===ee.length?(0,l.jsxs)("div",{className:"flex flex-col items-center justify-center p-4 border border-dashed border-border rounded-lg text-center bg-surface/30",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px] text-text-muted mb-1 opacity-60",children:"terminal"}),(0,l.jsx)("p",{className:"text-xs text-text-muted",children:"Only the main model is active. Add an alias above to configure more models for Codex CLI."})]}):(0,l.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:ee.map(e=>{let t=e.model.includes("/")?e.model.split("/")[0]:e.name,s=ex===e.command;return(0,l.jsxs)("div",{className:"flex items-center justify-between gap-2 p-2.5 bg-surface/50 border border-border hover:border-border-hover rounded-lg transition-colors group",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2.5 min-w-0",children:[(0,l.jsx)("div",{className:"size-6 flex items-center justify-center shrink-0 rounded bg-black/5 dark:bg-white/5 p-0.5",children:(0,l.jsx)(P.A,{providerId:t,size:18,fallbackText:e.name.slice(0,2).toUpperCase()})}),(0,l.jsxs)("div",{className:"min-w-0 flex flex-col",children:[(0,l.jsx)("span",{className:"font-medium text-xs text-text-main truncate",children:e.name}),(0,l.jsx)("span",{className:"text-[11px] text-text-muted truncate font-mono",children:e.model})]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,l.jsxs)("button",{onClick:()=>eb(e.command),className:`flex items-center gap-1 px-2 py-1 rounded text-[11px] font-mono border transition-all ${s?"bg-green-500/10 border-green-500/30 text-green-600 dark:text-green-400":"bg-surface border-border text-text-muted hover:text-text-main hover:border-primary/50 cursor-pointer"}`,title:"Click to copy command",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:s?"check":"terminal"}),(0,l.jsx)("span",{className:"hidden md:inline",children:e.command}),(0,l.jsx)("span",{className:"md:hidden",children:"copy"})]}),(0,l.jsx)("button",{onClick:()=>ef(e.name),disabled:ec===e.name,className:"p-1 text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity rounded",title:"Delete model",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"close"})})]})]},e.name)})})]})]})]}),q&&(0,l.jsx)(r.rq,{isOpen:q,onClose:()=>B(!1),onSelect:e=>{K(e.value),H||F(e.value),B(!1)},selectedModel:R,activeProviders:d,modelAliases:J,title:"Select Model for Codex"}),W&&(0,l.jsx)(r.rq,{isOpen:W,onClose:()=>G(!1),onSelect:e=>{F(e.value),G(!1)},selectedModel:H,activeProviders:d,modelAliases:J,title:"Select Subagent Model for Codex"}),ei&&(0,l.jsx)(r.rq,{isOpen:ei,onClose:()=>en(!1),onSelect:e=>{en(!1);let t=e?.value||e?.id;t&&(er(t),el(D(e?.provider||(t.includes("/")?t.split("/")[0]:t),ee.map(e=>e.name))))},selectedModel:ea,activeProviders:d,modelAliases:J,title:"Select Model for Codex CLI"}),(0,l.jsx)(r.uR,{isOpen:Y,onClose:()=>Z(!1),title:"Codex CLI - Manual Configuration",configs:(g=U&&U.trim()?U:c?"<API_KEY_FROM_DASHBOARD>":"sk_omnihilbras",f=H||R,[{filename:"~/.codex/config.toml",content:`# OmniHilbras Configuration for Codex CLI
45
45
  model = "${R}"
46
46
  model_provider = "omnihilbras"
47
47
 
@@ -0,0 +1,5 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7958],{15536:(e,t,s)=>{"use strict";s.d(t,{Cp:()=>r,Hx:()=>n,Iv:()=>d,Nv:()=>u,RL:()=>c,ev:()=>m,fl:()=>i,hT:()=>a,oX:()=>l,t6:()=>o});let a=["zh-CN","zh-TW"],l=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],n=2e3,r=3e5,i=5e3,o=5,c=1e4,d=5e3,m=[{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}],u=[{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"}]},54856:(e,t,s)=>{"use strict";s.d(t,{default:()=>g});var a=s(95155),l=s(12115),n=s(14051),r=s.n(n),i=s(35497),o=s(11059),c=s(15536);async function d(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(c.Iv)})).ok}catch{return!1}}async function m(...e){let t=e.filter(Boolean).map(d);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}var u=s(72767);function x({label:e,url:t,copyId:s,copied:l,onCopy:n,badge:r,actions:o}){return(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===r||"TS"===r?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(i.pd,{value:t,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>n(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})}),o]})}function h({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function p({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:e})]})}function b({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}function y({apiKey:e,onChange:t,onRequestRestrict:s}){let n=e.access||{restricted:!1,allow:[]},[r,o]=(0,l.useState)(!1),[c,d]=(0,l.useState)([]),[m,u]=(0,l.useState)({}),x=async()=>{o(!0);try{let[e,t]=await Promise.all([fetch("/api/providers"),fetch("/api/models/alias")]);e.ok&&d((await e.json()).connections||[]),t.ok&&u((await t.json()).aliases||{})}catch(e){console.log("Error loading picker data:",e)}},h=e=>t({restricted:!0,allow:e}),p=e=>h(n.allow.filter(t=>t!==e));return(0,a.jsxs)("div",{className:"mt-2","data-testid":"key-access",children:[(0,a.jsx)(i.lM,{size:"sm",checked:n.restricted,label:"Restrict access",onChange:e=>e?s():t({restricted:!1,allow:n.allow})}),n.restricted&&(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[0===n.allow.length&&(0,a.jsx)("span",{className:"text-xs text-orange-500",children:"No combos or models allowed — this key can call nothing."}),n.allow.map(e=>(0,a.jsxs)("span",{className:"flex items-center gap-1 rounded-xl border border-primary/30 bg-primary/10 px-2 py-0.5 font-mono text-xs text-text-main",children:[e,(0,a.jsx)("button",{onClick:()=>p(e),className:"rounded text-text-muted hover:text-red-500",title:`Remove ${e}`,"aria-label":`Remove ${e}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},e)),(0,a.jsxs)("button",{onClick:x,className:"flex items-center gap-0.5 rounded-xl border border-dashed border-black/10 px-2 py-0.5 text-xs font-medium text-primary hover:border-primary/50 dark:border-white/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"14px"},children:"add"}),"Add combo or model"]})]}),r&&(0,a.jsx)(i.rq,{isOpen:r,onClose:()=>o(!1),onSelect:e=>{let t=e?.value;t&&!n.allow.some(e=>e.toLowerCase()===t.toLowerCase())&&h([...n.allow,t])},onDeselect:e=>p(n.allow.find(t=>t.toLowerCase()===String(e?.value).toLowerCase())),activeProviders:c,modelAliases:m,title:`Allowed for "${e.name}"`,addedModelValues:n.allow,closeOnSelect:!1})]})}function g({machineId:e}){let[t,s]=(0,l.useState)([]),[n,r]=(0,l.useState)(!0),[f,j]=(0,l.useState)(!1),[w,k]=(0,l.useState)(""),[v,N]=(0,l.useState)(null),[C,S]=(0,l.useState)(null),[T,P]=(0,l.useState)(!1),[E,_]=(0,l.useState)(!0),[$,A]=(0,l.useState)(!0),[R,I]=(0,l.useState)(!1),[O,U]=(0,l.useState)(!0),[D,F]=(0,l.useState)(!1),[L,q]=(0,l.useState)(!1),[W,K]=(0,l.useState)(""),[z,H]=(0,l.useState)(""),[J,M]=(0,l.useState)(!1),[B,Q]=(0,l.useState)(""),[V,X]=(0,l.useState)(null),[Z,G]=(0,l.useState)(!1),[Y,ee]=(0,l.useState)(!1),[et,es]=(0,l.useState)(!1),[ea,el]=(0,l.useState)(!1),[en,er]=(0,l.useState)(""),[ei,eo]=(0,l.useState)(!1),[ec,ed]=(0,l.useState)(""),[em,eu]=(0,l.useState)(null),[ex,eh]=(0,l.useState)(""),[ep,eb]=(0,l.useState)(""),[ey,eg]=(0,l.useState)(null),[ef,ej]=(0,l.useState)(!1),[ew,ek]=(0,l.useState)([]),[ev,eN]=(0,l.useState)(""),[eC,eS]=(0,l.useState)(!1),[eT,eP]=(0,l.useState)(!1),[eE,e_]=(0,l.useState)(!1),e$=(0,l.useRef)(null),eA=(0,l.useRef)(!0),eR=(0,l.useRef)(null);(0,l.useEffect)(()=>(eA.current=!0,()=>{eA.current=!1,eR.current?.abort()}),[]);let eI=(0,l.useRef)(0),eO=(0,l.useRef)(0),eU=(0,l.useRef)(!1),eD=(0,l.useRef)(!1),eF=(0,l.useRef)(!1),eL=(0,l.useRef)(!1),[eq,eW]=(0,l.useState)(!1),[eK,ez]=(0,l.useState)(!1),[eH,eJ]=(0,l.useState)(new Set),[eM,eB]=(0,l.useState)(!1);(0,l.useEffect)(()=>{eB(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]);let{copied:eQ,copy:eV}=(0,o.C)(),eX=!E||!$,eZ=E?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,l.useEffect)(()=>{e$.current&&(e$.current.scrollTop=e$.current.scrollHeight)},[ew]),(0,l.useEffect)(()=>{e2(),e0()},[]),(0,l.useEffect)(()=>{if(!(D||et))return;let e=!D||L,t=!et||ea,s=()=>{document.hidden||eY()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||eY()},c.fl);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[D,et,L,ea]),(0,l.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(D&&(W||z)){let e=await m(z,W);eU.current=e,e?(eI.current=0,q(!0),eF.current||(eF.current=!0,eW(!0))):(eI.current+=1,eI.current>=c.t6&&q(!1))}else eU.current=!1;if(et&&en){let e=await d(en);eD.current=e,e?(eO.current=0,el(!0),eL.current||(eL.current=!0,ez(!0))):(eO.current+=1,eO.current>=c.t6&&el(!1))}else eD.current=!1}};if(!(D&&(W||z)||et&&en))return;e();let t=!et||ea;if((!D||L)&&t)return;let s=setInterval(e,c.RL);return()=>clearInterval(s)},[D,W,z,et,en,L,ea]);let eG=(0,l.useCallback)((e,t,s,a,l,n)=>{t.current?(s.current=0,a(!0),l.current||(l.current=!0,n(!0))):(s.current+=1,s.current>=c.t6&&a(!1))},[]),eY=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";K(a),H(t.tunnel?.publicUrl||""),F(s),eG(null,eU,eI,q,eF,eW);let l=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,n=t.tailscale?.tunnelUrl||"";er(n),es(l),eG(null,eD,eO,el,eL,ez)}catch{}},e0=async()=>{U(!0);try{let[e,t]=await Promise.all([u.A.getState().fetchSettings(),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e&&(P(e.requireApiKey||!1),_(!1!==e.requireLogin),A(e.hasPassword||!1),I(e.tunnelDashboardAccess||!1)),t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";K(a),H(e.tunnel?.publicUrl||""),F(s),eG(null,eU,eI,q,eF,eW);let l=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,n=e.tailscale?.tunnelUrl||"";er(n),es(l),eG(null,eD,eO,el,eL,ez)}}catch(e){console.log("Error loading settings:",e)}finally{U(!1)}},e1=async e=>{try{await u.A.getState().patchSettings({tunnelDashboardAccess:e})&&I(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},e5=async e=>{try{await u.A.getState().patchSettings({requireApiKey:e})&&P(e)}catch(e){console.log("Error updating requireApiKey:",e)}},e2=async()=>{try{let e=async()=>{let e=await fetch("/api/keys");return e.ok&&(await e.json()).keys||[]},t=await e();if(0===t.length)try{(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok&&(t=await e())}catch{}s(t)}catch(e){console.log("Error fetching data:",e)}finally{r(!1)}},e4=async(...e)=>{if(!eA.current)return!1;M(!0),Q("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=new AbortController,{signal:a}=s,l=Date.now();for(;Date.now()-l<c.Cp&&eA.current&&(await new Promise(e=>setTimeout(e,c.Hx)),eA.current);){if(await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store",signal:a})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return F(!0),M(!1),Q(""),!0;if((Date.now()-l)%1e4<c.Hx)try{let e=await fetch("/api/tunnel/status",{signal:a});if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return X({type:"error",message:"Tunnel process stopped unexpectedly."}),M(!1),Q(""),!1}}catch{}}return s.abort(),!!eA.current&&(X({type:"error",message:"Tunnel created but not reachable. Please try again."}),M(!1),Q(""),!1)},e3=async()=>{G(!1),M(!0),X(null),Q("Creating tunnel...");let e=!0;(async()=>{let t=new AbortController;for(eR.current=t;e;){if(!eA.current){e=!1;break}try{let s=await fetch("/api/tunnel/status",{signal:t.signal});if(s.ok){let t=await s.json();t.download?.downloading?Q(`Downloading cloudflared... ${t.download.progress}%`):e&&Q("Creating tunnel...")}}catch{}if(!e||!eA.current)break;await new Promise(e=>setTimeout(e,1e3))}eR.current===t&&(eR.current=null)})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void X({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void X({type:"error",message:"No tunnel URL returned"});K(a),H(s.publicUrl||""),await e4(s.publicUrl,a)}catch(e){X({type:"error",message:e.message})}finally{e=!1,M(!1),Q("")}},e8=async()=>{M(!0),X(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(F(!1),K(""),ee(!1),X({type:"success",message:"Tunnel disabled"})):X({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){X({type:"error",message:e.message})}finally{M(!1)}},e6=async()=>{eg(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return eg(t.installed),t}}catch{}return eg(!1),{installed:!1}},e7=async()=>{ej(!0),eu(null),ek([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:ev})});eN("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:l}=await t.read();if(e)break;let n=(a+=s.decode(l,{stream:!0})).split("\n\n");for(let e of(a=n.pop()||"",n)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)ek(e=>[...e.slice(-50),a.message]);else if("done"===s){eg(!0),ej(!1),eP(!1),ts();return}else"error"===s&&eu({type:"error",message:a.error||"Install failed"})}}}catch(e){eu({type:"error",message:e.message})}finally{ej(!1)}},e9=async e=>{if(!eA.current)return!1;ed("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=new AbortController,{signal:a}=s,l=Date.now();for(;Date.now()-l<c.Cp&&eA.current&&(await new Promise(e=>setTimeout(e,c.Hx)),eA.current);)try{let e=await fetch(t,{mode:"no-cors",cache:"no-store",signal:a});if(e.ok||"opaque"===e.type)return!0}catch{}return s.abort(),!1},te=(e,t)=>{eh(e),eb(t)},tt=()=>{eh(""),eb("")},ts=async()=>{eP(!1),eS(!0),eo(!0),eu(null),ed("Connecting..."),tt();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){er(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);es(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){te(t.authUrl,"Open Login Page"),ed('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){tt(),ed("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){er(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);es(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await ta(t.enableUrl):eu({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}tt(),eu({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await ta(t.enableUrl);eu({type:"error",message:t.error||"Failed to connect"})}catch(e){eu({type:"error",message:e.message})}finally{eo(!1),eS(!1),ed(""),tt()}},ta=async e=>{te(e,"Open Funnel Settings"),ed('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){tt(),er(t.tunnelUrl||"");let e=await e9(t.tunnelUrl);es(!0),eu(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){tt(),eu({type:"error",message:t.error});return}}catch{}}tt(),eu({type:"error",message:"Timed out waiting for Funnel to be enabled."})},tl=async()=>{eo(!0),eu(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(es(!1),er(""),e_(!1),eu({type:"success",message:"Tailscale disabled"})):eu({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){eu({type:"error",message:e.message})}finally{eo(!1)}},tn=async()=>{eu(null),ek([]);let e=await e6();e?.installed&&e?.hasCachedPassword?ts():eP(!0)},tr=async()=>{if(w.trim())try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:w})}),t=await e.json();e.ok&&(N(t.key),await e2(),k(""),j(!1))}catch(e){console.log("Error creating key:",e)}},ti=async e=>{S({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{S(null);try{(await fetch(`/api/keys/${e}`,{method:"DELETE"})).ok&&(s(t.filter(t=>t.id!==e)),eJ(t=>{let s=new Set(t);return s.delete(e),s}))}catch(e){console.log("Error deleting key:",e)}}})},to=async(e,t)=>{try{(await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error toggling key:",e)}},tc=async(e,t)=>{try{let a=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({access:t})}),l=await a.json().catch(()=>({}));a.ok&&l.key?s(t=>t.map(t=>t.id===e?{...t,access:l.key.access}:t)):console.log("Error updating key access:",l.error||a.status)}catch(e){console.log("Error updating key access:",e)}},[td,tm]=(0,l.useState)("/v1");return((0,l.useEffect)(()=>{tm(`${window.location.origin}/v1`)},[]),n)?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(i.Qv,{}),(0,a.jsx)(i.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsxs)(i.Zp,{children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),"API Endpoint"]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)(x,{label:"Local",url:td,copyId:"local_url",copied:eQ,onCopy:eV}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${D?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),D&&!J&&L?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${z||W}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eV(`${z||W}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eQ?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>ee(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!D||J||L?J?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),B||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{eR.current?.abort(),eR.current=null,M(!1),Q("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):V?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),V.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>G(!0),children:"Enable"})]}):O?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>U(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{eX?X({type:"error",message:`Security required: ${eZ}`}):T?G(!0):X({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eq?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>ee(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${et?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),et&&!ei&&ea?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(i.pd,{value:`${en}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)("button",{onClick:()=>eV(`${en}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eQ?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>e_(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!et||ei||ea?ei||eC?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ec||"Connecting..."]}),ex&&(0,a.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(ex,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:ep||"Open"}),(0,a.jsx)("button",{onClick:()=>{eo(!1),eS(!1),ed(""),tt()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):em?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),em.message]}),(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:tn,children:"Enable"})]}):(0,a.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{eX?eu({type:"error",message:`Security required: ${eZ}`}):tn()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eK?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>e_(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),eX&&!D&&!et&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(b,{message:eZ,action:{label:"Open settings",href:"/dashboard/profile"}})}),(D||et)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!T&&(0,a.jsx)(b,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!E||!$)&&(0,a.jsx)(b,{message:E?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:E?"Change password":"Enable",href:"/dashboard/profile"}})]}),(D||et)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(i.lM,{checked:R,onChange:()=>e1(!R)}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("p",{className:"font-medium text-sm",children:"Allow dashboard access via tunnel"}),(0,a.jsx)(p,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsxs)(i.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),"API Keys"]}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>j(!0),children:"Create Key"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Requests without a valid key will be rejected"})]}),(0,a.jsx)(i.lM,{checked:T,onChange:()=>e5(!T)})]}),eM&&!T&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(b,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(i.$n,{icon:"add",onClick:()=>j(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"flex flex-col",children:t.map(e=>{var t;return(0,a.jsxs)("div",{className:`group flex items-start justify-between gap-3 py-3 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0 flex-wrap",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono break-all min-w-0",children:eH.has(e.id)?e.key:(t=e.key)&&!(t.length<=10)?t.slice(0,6)+"•".repeat(t.length-10)+t.slice(-4):t||""}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[(0,a.jsx)("button",{onClick:()=>{var t;return t=e.id,void eJ(e=>{let s=new Set(e);return s.has(t)?s.delete(t):s.add(t),s})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:eH.has(e.id)?"Hide key":"Show key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eH.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{onClick:()=>eV(e.key,e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eQ===e.id?"check":"content_copy"})})]})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,a.jsx)(y,{apiKey:e,onChange:t=>tc(e.id,t),onRequestRestrict:()=>S({title:"Restrict API Key",message:`Restrict API key "${e.name}"?
2
+
3
+ It will only be able to call the combos and models you add. Until you add one, it can call nothing.`,onConfirm:async()=>{S(null),tc(e.id,{restricted:!0,allow:e.access?.allow||[]})}})})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 shrink-0 pt-0.5",children:[(0,a.jsx)(i.lM,{size:"sm",checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?S({title:"Pause API Key",message:`Pause API key "${e.name}"?
4
+
5
+ This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{S(null),to(e.id,t)}}):to(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{onClick:()=>ti(e.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(i.aF,{isOpen:f,title:"Create API Key",onClose:()=>{j(!1),k("")},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(i.pd,{label:"Key Name",value:w,onChange:e=>k(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tr,fullWidth:!0,disabled:!w.trim(),children:"Create"}),(0,a.jsx)(i.$n,{onClick:()=>{j(!1),k("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:!!v,title:"API Key Created",onClose:()=>N(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.pd,{value:v||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(i.$n,{variant:"secondary",icon:"created_key"===eQ?"check":"content_copy",onClick:()=>eV(v,"created_key"),children:"created_key"===eQ?"Copied!":"Copy"})]}),(0,a.jsx)(i.$n,{onClick:()=>N(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(i.aF,{isOpen:Z,title:"Enable Tunnel",onClose:()=>G(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local OmniHilbras to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:c.oX.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e3,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(i.$n,{onClick:()=>G(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:Y,title:"Disable Tunnel",onClose:()=>!J&&ee(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e8,fullWidth:!0,disabled:J,variant:"danger",children:J?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>ee(!1),variant:"ghost",fullWidth:!0,disabled:J,children:"Cancel"})]})]})}),(0,a.jsx)(i.aF,{isOpen:eT,title:"Tailscale Funnel",onClose:()=>{ef||(eP(!1),eN(""),eu(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===ey&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===ey&&!ef&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:e7,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(i.$n,{onClick:()=>eP(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ef&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),ew.length>0&&(0,a.jsx)("div",{ref:e$,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:ew.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===ey&&!ef&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:()=>ts(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(i.$n,{onClick:()=>eP(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),em&&(0,a.jsx)(h,{status:em})]})}),(0,a.jsx)(i.aF,{isOpen:eE,title:"Disable Tailscale",onClose:()=>!ei&&e_(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(i.$n,{onClick:tl,fullWidth:!0,disabled:ei,variant:"danger",children:ei?"Disabling...":"Disable"}),(0,a.jsx)(i.$n,{onClick:()=>e_(!1),variant:"ghost",fullWidth:!0,disabled:ei,children:"Cancel"})]})]})}),(0,a.jsx)(i.uo,{isOpen:!!C,onClose:()=>S(null),onConfirm:C?.onConfirm,title:C?.title||"Confirm",message:C?.message,variant:"danger"})]})}y.propTypes={apiKey:r().shape({id:r().string.isRequired,name:r().string,access:r().shape({restricted:r().bool,allow:r().arrayOf(r().string)})}).isRequired,onChange:r().func.isRequired,onRequestRestrict:r().func.isRequired},g.propTypes={machineId:r().string.isRequired}},67958:(e,t,s)=>{Promise.resolve().then(s.bind(s,54856))}}]);