@georgedong32/ccs 7.67.1 → 8.0.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 (1890) hide show
  1. package/.claude/commands/opsx/apply.md +152 -0
  2. package/.claude/commands/opsx/archive.md +157 -0
  3. package/.claude/commands/opsx/continue.md +114 -0
  4. package/.claude/commands/opsx/explore.md +173 -0
  5. package/.claude/commands/opsx/ff.md +97 -0
  6. package/.claude/commands/opsx/new.md +69 -0
  7. package/.claude/commands/opsx/propose.md +106 -0
  8. package/.claude/commands/opsx/sync.md +134 -0
  9. package/.claude/commands/opsx/verify.md +164 -0
  10. package/.claude/settings.local.json +47 -1
  11. package/README.md +49 -4
  12. package/config/base-claude.settings.json +1 -1
  13. package/config/base-codebuddy.settings.json +10 -0
  14. package/config/base-codex.settings.json +4 -4
  15. package/config/base-cursor.settings.json +10 -0
  16. package/config/base-gitlab.settings.json +10 -0
  17. package/config/base-kilo.settings.json +10 -0
  18. package/dist/api/services/cliproxy-profile-bridge.d.ts.map +1 -1
  19. package/dist/api/services/cliproxy-profile-bridge.js +9 -10
  20. package/dist/api/services/cliproxy-profile-bridge.js.map +1 -1
  21. package/dist/api/services/index.d.ts +1 -0
  22. package/dist/api/services/index.d.ts.map +1 -1
  23. package/dist/api/services/index.js +3 -1
  24. package/dist/api/services/index.js.map +1 -1
  25. package/dist/api/services/local-runtime-readiness.d.ts +14 -0
  26. package/dist/api/services/local-runtime-readiness.d.ts.map +1 -0
  27. package/dist/api/services/local-runtime-readiness.js +89 -0
  28. package/dist/api/services/local-runtime-readiness.js.map +1 -0
  29. package/dist/api/services/openrouter-catalog.js +2 -2
  30. package/dist/api/services/openrouter-catalog.js.map +1 -1
  31. package/dist/api/services/profile-lifecycle-service.d.ts.map +1 -1
  32. package/dist/api/services/profile-lifecycle-service.js +6 -6
  33. package/dist/api/services/profile-lifecycle-service.js.map +1 -1
  34. package/dist/api/services/profile-lifecycle-validation.js +1 -1
  35. package/dist/api/services/profile-lifecycle-validation.js.map +1 -1
  36. package/dist/api/services/profile-reader.d.ts.map +1 -1
  37. package/dist/api/services/profile-reader.js +14 -15
  38. package/dist/api/services/profile-reader.js.map +1 -1
  39. package/dist/api/services/profile-writer.d.ts +1 -1
  40. package/dist/api/services/profile-writer.d.ts.map +1 -1
  41. package/dist/api/services/profile-writer.js +25 -19
  42. package/dist/api/services/profile-writer.js.map +1 -1
  43. package/dist/auth/account-profile-diagnostics.d.ts +21 -0
  44. package/dist/auth/account-profile-diagnostics.d.ts.map +1 -0
  45. package/dist/auth/account-profile-diagnostics.js +130 -0
  46. package/dist/auth/account-profile-diagnostics.js.map +1 -0
  47. package/dist/auth/auth-commands.d.ts +2 -1
  48. package/dist/auth/auth-commands.d.ts.map +1 -1
  49. package/dist/auth/auth-commands.js +30 -12
  50. package/dist/auth/auth-commands.js.map +1 -1
  51. package/dist/auth/commands/backup-command.d.ts.map +1 -1
  52. package/dist/auth/commands/backup-command.js +7 -2
  53. package/dist/auth/commands/backup-command.js.map +1 -1
  54. package/dist/auth/commands/create-command-env.d.ts +1 -0
  55. package/dist/auth/commands/create-command-env.d.ts.map +1 -1
  56. package/dist/auth/commands/create-command.d.ts.map +1 -1
  57. package/dist/auth/commands/create-command.js +23 -19
  58. package/dist/auth/commands/create-command.js.map +1 -1
  59. package/dist/auth/commands/default-command.d.ts +1 -1
  60. package/dist/auth/commands/default-command.d.ts.map +1 -1
  61. package/dist/auth/commands/default-command.js +13 -5
  62. package/dist/auth/commands/default-command.js.map +1 -1
  63. package/dist/auth/commands/index.d.ts +1 -0
  64. package/dist/auth/commands/index.d.ts.map +1 -1
  65. package/dist/auth/commands/index.js +3 -1
  66. package/dist/auth/commands/index.js.map +1 -1
  67. package/dist/auth/commands/list-command.d.ts.map +1 -1
  68. package/dist/auth/commands/list-command.js +16 -3
  69. package/dist/auth/commands/list-command.js.map +1 -1
  70. package/dist/auth/commands/remove-command.d.ts.map +1 -1
  71. package/dist/auth/commands/remove-command.js +7 -3
  72. package/dist/auth/commands/remove-command.js.map +1 -1
  73. package/dist/auth/commands/resources-command.d.ts +3 -0
  74. package/dist/auth/commands/resources-command.d.ts.map +1 -0
  75. package/dist/auth/commands/resources-command.js +115 -0
  76. package/dist/auth/commands/resources-command.js.map +1 -0
  77. package/dist/auth/commands/show-command.d.ts.map +1 -1
  78. package/dist/auth/commands/show-command.js +54 -3
  79. package/dist/auth/commands/show-command.js.map +1 -1
  80. package/dist/auth/commands/types.d.ts +31 -1
  81. package/dist/auth/commands/types.d.ts.map +1 -1
  82. package/dist/auth/commands/types.js +41 -2
  83. package/dist/auth/commands/types.js.map +1 -1
  84. package/dist/auth/profile-continuity-inheritance.d.ts.map +1 -1
  85. package/dist/auth/profile-continuity-inheritance.js +6 -5
  86. package/dist/auth/profile-continuity-inheritance.js.map +1 -1
  87. package/dist/auth/profile-detector.d.ts +2 -3
  88. package/dist/auth/profile-detector.d.ts.map +1 -1
  89. package/dist/auth/profile-detector.js +25 -25
  90. package/dist/auth/profile-detector.js.map +1 -1
  91. package/dist/auth/profile-registry.d.ts +2 -0
  92. package/dist/auth/profile-registry.d.ts.map +1 -1
  93. package/dist/auth/profile-registry.js +29 -17
  94. package/dist/auth/profile-registry.js.map +1 -1
  95. package/dist/auth/resume-lane-diagnostics.d.ts.map +1 -1
  96. package/dist/auth/resume-lane-diagnostics.js +2 -2
  97. package/dist/auth/resume-lane-diagnostics.js.map +1 -1
  98. package/dist/auth/shared-resource-policy.d.ts +20 -0
  99. package/dist/auth/shared-resource-policy.d.ts.map +1 -0
  100. package/dist/auth/shared-resource-policy.js +69 -0
  101. package/dist/auth/shared-resource-policy.js.map +1 -0
  102. package/dist/bin/ccsxp-runtime.d.ts +9 -0
  103. package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
  104. package/dist/bin/ccsxp-runtime.js +62 -3
  105. package/dist/bin/ccsxp-runtime.js.map +1 -1
  106. package/dist/ccs.js +65 -1024
  107. package/dist/ccs.js.map +1 -1
  108. package/dist/channels/official-channels-ids.d.ts +21 -0
  109. package/dist/channels/official-channels-ids.d.ts.map +1 -0
  110. package/dist/channels/official-channels-ids.js +46 -0
  111. package/dist/channels/official-channels-ids.js.map +1 -0
  112. package/dist/channels/official-channels-runtime.d.ts +3 -5
  113. package/dist/channels/official-channels-runtime.d.ts.map +1 -1
  114. package/dist/channels/official-channels-runtime.js +25 -29
  115. package/dist/channels/official-channels-runtime.js.map +1 -1
  116. package/dist/channels/official-channels-store.d.ts +1 -0
  117. package/dist/channels/official-channels-store.d.ts.map +1 -1
  118. package/dist/channels/official-channels-store.js +5 -6
  119. package/dist/channels/official-channels-store.js.map +1 -1
  120. package/dist/cliproxy/accounts/account-manager.d.ts +16 -0
  121. package/dist/cliproxy/accounts/account-manager.d.ts.map +1 -0
  122. package/dist/cliproxy/accounts/account-manager.js +51 -0
  123. package/dist/cliproxy/accounts/account-manager.js.map +1 -0
  124. package/dist/cliproxy/accounts/account-safety.d.ts +103 -0
  125. package/dist/cliproxy/accounts/account-safety.d.ts.map +1 -0
  126. package/dist/cliproxy/accounts/account-safety.js +614 -0
  127. package/dist/cliproxy/accounts/account-safety.js.map +1 -0
  128. package/dist/cliproxy/accounts/account-stats-key.d.ts.map +1 -0
  129. package/dist/cliproxy/accounts/account-stats-key.js.map +1 -0
  130. package/dist/cliproxy/accounts/email-account-identity.d.ts.map +1 -1
  131. package/dist/cliproxy/accounts/email-account-identity.js +22 -2
  132. package/dist/cliproxy/accounts/email-account-identity.js.map +1 -1
  133. package/dist/cliproxy/accounts/registry.js +1 -1
  134. package/dist/cliproxy/accounts/registry.js.map +1 -1
  135. package/dist/cliproxy/accounts/token-file-ops.js +1 -1
  136. package/dist/cliproxy/accounts/token-file-ops.js.map +1 -1
  137. package/dist/cliproxy/accounts/types.d.ts +1 -1
  138. package/dist/cliproxy/accounts/types.d.ts.map +1 -1
  139. package/dist/cliproxy/ai-providers/codex-plan-compatibility.d.ts +38 -0
  140. package/dist/cliproxy/ai-providers/codex-plan-compatibility.d.ts.map +1 -0
  141. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js +131 -0
  142. package/dist/cliproxy/ai-providers/codex-plan-compatibility.js.map +1 -0
  143. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts +71 -0
  144. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.d.ts.map +1 -0
  145. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js +565 -0
  146. package/dist/cliproxy/ai-providers/codex-reasoning-proxy.js.map +1 -0
  147. package/dist/cliproxy/ai-providers/config-store.js +3 -3
  148. package/dist/cliproxy/ai-providers/config-store.js.map +1 -1
  149. package/dist/cliproxy/ai-providers/managed-model-prefixes.d.ts +7 -0
  150. package/dist/cliproxy/ai-providers/managed-model-prefixes.d.ts.map +1 -0
  151. package/dist/cliproxy/ai-providers/managed-model-prefixes.js +116 -0
  152. package/dist/cliproxy/ai-providers/managed-model-prefixes.js.map +1 -0
  153. package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts +108 -0
  154. package/dist/cliproxy/ai-providers/model-id-normalizer.d.ts.map +1 -0
  155. package/dist/cliproxy/ai-providers/model-id-normalizer.js +293 -0
  156. package/dist/cliproxy/ai-providers/model-id-normalizer.js.map +1 -0
  157. package/dist/cliproxy/ai-providers/openai-compat-manager.d.ts.map +1 -0
  158. package/dist/cliproxy/ai-providers/openai-compat-manager.js +203 -0
  159. package/dist/cliproxy/ai-providers/openai-compat-manager.js.map +1 -0
  160. package/dist/cliproxy/ai-providers/schema-sanitizer.d.ts.map +1 -0
  161. package/dist/cliproxy/ai-providers/schema-sanitizer.js.map +1 -0
  162. package/dist/cliproxy/ai-providers/service.d.ts.map +1 -1
  163. package/dist/cliproxy/ai-providers/service.js +10 -3
  164. package/dist/cliproxy/ai-providers/service.js.map +1 -1
  165. package/dist/cliproxy/ai-providers/tool-name-mapper.d.ts +108 -0
  166. package/dist/cliproxy/ai-providers/tool-name-mapper.d.ts.map +1 -0
  167. package/dist/cliproxy/ai-providers/tool-name-mapper.js +163 -0
  168. package/dist/cliproxy/ai-providers/tool-name-mapper.js.map +1 -0
  169. package/dist/cliproxy/ai-providers/tool-name-sanitizer.d.ts +66 -0
  170. package/dist/cliproxy/ai-providers/tool-name-sanitizer.d.ts.map +1 -0
  171. package/dist/cliproxy/ai-providers/tool-name-sanitizer.js +138 -0
  172. package/dist/cliproxy/ai-providers/tool-name-sanitizer.js.map +1 -0
  173. package/dist/cliproxy/auth/antigravity-responsibility.d.ts.map +1 -0
  174. package/dist/cliproxy/auth/antigravity-responsibility.js +171 -0
  175. package/dist/cliproxy/auth/antigravity-responsibility.js.map +1 -0
  176. package/dist/cliproxy/auth/auth-handler.d.ts +31 -0
  177. package/dist/cliproxy/auth/auth-handler.d.ts.map +1 -0
  178. package/dist/cliproxy/auth/auth-handler.js +60 -0
  179. package/dist/cliproxy/auth/auth-handler.js.map +1 -0
  180. package/dist/cliproxy/auth/auth-session-manager.d.ts +51 -0
  181. package/dist/cliproxy/auth/auth-session-manager.d.ts.map +1 -0
  182. package/dist/cliproxy/auth/auth-session-manager.js +141 -0
  183. package/dist/cliproxy/auth/auth-session-manager.js.map +1 -0
  184. package/dist/cliproxy/auth/auth-token-manager.d.ts.map +1 -0
  185. package/dist/cliproxy/auth/auth-token-manager.js +184 -0
  186. package/dist/cliproxy/auth/auth-token-manager.js.map +1 -0
  187. package/dist/cliproxy/auth/auth-types.d.ts +40 -7
  188. package/dist/cliproxy/auth/auth-types.d.ts.map +1 -1
  189. package/dist/cliproxy/auth/auth-types.js +90 -10
  190. package/dist/cliproxy/auth/auth-types.js.map +1 -1
  191. package/dist/cliproxy/auth/auth-utils.d.ts +17 -0
  192. package/dist/cliproxy/auth/auth-utils.d.ts.map +1 -0
  193. package/dist/cliproxy/auth/auth-utils.js +58 -0
  194. package/dist/cliproxy/auth/auth-utils.js.map +1 -0
  195. package/dist/cliproxy/auth/device-code-handler.d.ts.map +1 -0
  196. package/dist/cliproxy/auth/device-code-handler.js.map +1 -0
  197. package/dist/cliproxy/auth/gitlab-pat-response.d.ts +9 -0
  198. package/dist/cliproxy/auth/gitlab-pat-response.d.ts.map +1 -0
  199. package/dist/cliproxy/auth/gitlab-pat-response.js +64 -0
  200. package/dist/cliproxy/auth/gitlab-pat-response.js.map +1 -0
  201. package/dist/cliproxy/auth/kiro-import.js +2 -2
  202. package/dist/cliproxy/auth/kiro-import.js.map +1 -1
  203. package/dist/cliproxy/auth/oauth-handler.d.ts +50 -4
  204. package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
  205. package/dist/cliproxy/auth/oauth-handler.js +443 -51
  206. package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
  207. package/dist/cliproxy/auth/oauth-process.d.ts +27 -2
  208. package/dist/cliproxy/auth/oauth-process.d.ts.map +1 -1
  209. package/dist/cliproxy/auth/oauth-process.js +409 -53
  210. package/dist/cliproxy/auth/oauth-process.js.map +1 -1
  211. package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts +22 -0
  212. package/dist/cliproxy/auth/oauth-start-failure-guidance.d.ts.map +1 -0
  213. package/dist/cliproxy/auth/oauth-start-failure-guidance.js +82 -0
  214. package/dist/cliproxy/auth/oauth-start-failure-guidance.js.map +1 -0
  215. package/dist/cliproxy/auth/oauth-trace/diagnose-failure.d.ts +24 -0
  216. package/dist/cliproxy/auth/oauth-trace/diagnose-failure.d.ts.map +1 -0
  217. package/dist/cliproxy/auth/oauth-trace/diagnose-failure.js +159 -0
  218. package/dist/cliproxy/auth/oauth-trace/diagnose-failure.js.map +1 -0
  219. package/dist/cliproxy/auth/oauth-trace/index.d.ts +4 -0
  220. package/dist/cliproxy/auth/oauth-trace/index.d.ts.map +1 -0
  221. package/dist/cliproxy/auth/oauth-trace/index.js +14 -0
  222. package/dist/cliproxy/auth/oauth-trace/index.js.map +1 -0
  223. package/dist/cliproxy/auth/oauth-trace/redactor.d.ts +22 -0
  224. package/dist/cliproxy/auth/oauth-trace/redactor.d.ts.map +1 -0
  225. package/dist/cliproxy/auth/oauth-trace/redactor.js +120 -0
  226. package/dist/cliproxy/auth/oauth-trace/redactor.js.map +1 -0
  227. package/dist/cliproxy/auth/oauth-trace/sink-file.d.ts +18 -0
  228. package/dist/cliproxy/auth/oauth-trace/sink-file.d.ts.map +1 -0
  229. package/dist/cliproxy/auth/oauth-trace/sink-file.js +90 -0
  230. package/dist/cliproxy/auth/oauth-trace/sink-file.js.map +1 -0
  231. package/dist/cliproxy/auth/oauth-trace/sink-memory.d.ts +13 -0
  232. package/dist/cliproxy/auth/oauth-trace/sink-memory.d.ts.map +1 -0
  233. package/dist/cliproxy/auth/oauth-trace/sink-memory.js +31 -0
  234. package/dist/cliproxy/auth/oauth-trace/sink-memory.js.map +1 -0
  235. package/dist/cliproxy/auth/oauth-trace/sink-verbose-stdout.d.ts +11 -0
  236. package/dist/cliproxy/auth/oauth-trace/sink-verbose-stdout.d.ts.map +1 -0
  237. package/dist/cliproxy/auth/oauth-trace/sink-verbose-stdout.js +47 -0
  238. package/dist/cliproxy/auth/oauth-trace/sink-verbose-stdout.js.map +1 -0
  239. package/dist/cliproxy/auth/oauth-trace/trace-events.d.ts +51 -0
  240. package/dist/cliproxy/auth/oauth-trace/trace-events.d.ts.map +1 -0
  241. package/dist/cliproxy/auth/oauth-trace/trace-events.js +44 -0
  242. package/dist/cliproxy/auth/oauth-trace/trace-events.js.map +1 -0
  243. package/dist/cliproxy/auth/oauth-trace/trace-recorder.d.ts +34 -0
  244. package/dist/cliproxy/auth/oauth-trace/trace-recorder.d.ts.map +1 -0
  245. package/dist/cliproxy/auth/oauth-trace/trace-recorder.js +83 -0
  246. package/dist/cliproxy/auth/oauth-trace/trace-recorder.js.map +1 -0
  247. package/dist/cliproxy/auth/project-selection-handler.d.ts.map +1 -0
  248. package/dist/cliproxy/auth/project-selection-handler.js.map +1 -0
  249. package/dist/cliproxy/auth/provider-entitlement-evidence.d.ts +17 -0
  250. package/dist/cliproxy/auth/provider-entitlement-evidence.d.ts.map +1 -0
  251. package/dist/cliproxy/auth/provider-entitlement-evidence.js +55 -0
  252. package/dist/cliproxy/auth/provider-entitlement-evidence.js.map +1 -0
  253. package/dist/cliproxy/auth/provider-entitlement-types.d.ts +16 -0
  254. package/dist/cliproxy/auth/provider-entitlement-types.d.ts.map +1 -0
  255. package/dist/cliproxy/auth/provider-entitlement-types.js +3 -0
  256. package/dist/cliproxy/auth/provider-entitlement-types.js.map +1 -0
  257. package/dist/cliproxy/auth/provider-refreshers/index.d.ts +1 -2
  258. package/dist/cliproxy/auth/provider-refreshers/index.d.ts.map +1 -1
  259. package/dist/cliproxy/auth/provider-refreshers/index.js +7 -26
  260. package/dist/cliproxy/auth/provider-refreshers/index.js.map +1 -1
  261. package/dist/cliproxy/auth/token-expiry-checker.js +1 -1
  262. package/dist/cliproxy/auth/token-expiry-checker.js.map +1 -1
  263. package/dist/cliproxy/auth/token-manager.d.ts +11 -2
  264. package/dist/cliproxy/auth/token-manager.d.ts.map +1 -1
  265. package/dist/cliproxy/auth/token-manager.js +117 -68
  266. package/dist/cliproxy/auth/token-manager.js.map +1 -1
  267. package/dist/cliproxy/auth/token-refresh-config.d.ts.map +1 -1
  268. package/dist/cliproxy/auth/token-refresh-config.js +2 -2
  269. package/dist/cliproxy/auth/token-refresh-config.js.map +1 -1
  270. package/dist/cliproxy/binary/extractor.js +1 -1
  271. package/dist/cliproxy/binary/extractor.js.map +1 -1
  272. package/dist/cliproxy/binary/installer.d.ts +1 -1
  273. package/dist/cliproxy/binary/installer.d.ts.map +1 -1
  274. package/dist/cliproxy/binary/installer.js +1 -1
  275. package/dist/cliproxy/binary/installer.js.map +1 -1
  276. package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -1
  277. package/dist/cliproxy/binary/lifecycle.js +18 -6
  278. package/dist/cliproxy/binary/lifecycle.js.map +1 -1
  279. package/dist/cliproxy/binary/platform-detector.d.ts +106 -0
  280. package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -0
  281. package/dist/cliproxy/binary/platform-detector.js +191 -0
  282. package/dist/cliproxy/binary/platform-detector.js.map +1 -0
  283. package/dist/cliproxy/binary/tar-extractor.d.ts.map +1 -1
  284. package/dist/cliproxy/binary/tar-extractor.js +1 -1
  285. package/dist/cliproxy/binary/tar-extractor.js.map +1 -1
  286. package/dist/cliproxy/binary/types.d.ts +3 -3
  287. package/dist/cliproxy/binary/types.d.ts.map +1 -1
  288. package/dist/cliproxy/binary/types.js +3 -3
  289. package/dist/cliproxy/binary/types.js.map +1 -1
  290. package/dist/cliproxy/binary/version-cache.d.ts +10 -0
  291. package/dist/cliproxy/binary/version-cache.d.ts.map +1 -1
  292. package/dist/cliproxy/binary/version-cache.js +31 -9
  293. package/dist/cliproxy/binary/version-cache.js.map +1 -1
  294. package/dist/cliproxy/binary/version-checker.d.ts +14 -3
  295. package/dist/cliproxy/binary/version-checker.d.ts.map +1 -1
  296. package/dist/cliproxy/binary/version-checker.js +66 -37
  297. package/dist/cliproxy/binary/version-checker.js.map +1 -1
  298. package/dist/cliproxy/binary/zip-extractor.d.ts.map +1 -1
  299. package/dist/cliproxy/binary/zip-extractor.js +1 -1
  300. package/dist/cliproxy/binary/zip-extractor.js.map +1 -1
  301. package/dist/cliproxy/binary-manager.d.ts +22 -1
  302. package/dist/cliproxy/binary-manager.d.ts.map +1 -1
  303. package/dist/cliproxy/binary-manager.js +126 -19
  304. package/dist/cliproxy/binary-manager.js.map +1 -1
  305. package/dist/cliproxy/config/base-config-loader.d.ts +43 -0
  306. package/dist/cliproxy/config/base-config-loader.d.ts.map +1 -0
  307. package/dist/cliproxy/config/base-config-loader.js +123 -0
  308. package/dist/cliproxy/config/base-config-loader.js.map +1 -0
  309. package/dist/cliproxy/config/composite-validator.d.ts.map +1 -0
  310. package/dist/cliproxy/config/composite-validator.js +94 -0
  311. package/dist/cliproxy/config/composite-validator.js.map +1 -0
  312. package/dist/cliproxy/config/config-generator.d.ts +15 -0
  313. package/dist/cliproxy/config/config-generator.d.ts.map +1 -0
  314. package/dist/cliproxy/config/config-generator.js +32 -0
  315. package/dist/cliproxy/config/config-generator.js.map +1 -0
  316. package/dist/cliproxy/config/env-builder.d.ts +6 -0
  317. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  318. package/dist/cliproxy/config/env-builder.js +60 -65
  319. package/dist/cliproxy/config/env-builder.js.map +1 -1
  320. package/dist/cliproxy/config/extended-context-config.d.ts +1 -0
  321. package/dist/cliproxy/config/extended-context-config.d.ts.map +1 -1
  322. package/dist/cliproxy/config/generator.d.ts +14 -3
  323. package/dist/cliproxy/config/generator.d.ts.map +1 -1
  324. package/dist/cliproxy/config/generator.js +96 -19
  325. package/dist/cliproxy/config/generator.js.map +1 -1
  326. package/dist/cliproxy/config/model-config.d.ts +31 -0
  327. package/dist/cliproxy/config/model-config.d.ts.map +1 -0
  328. package/dist/cliproxy/config/model-config.js +264 -0
  329. package/dist/cliproxy/config/model-config.js.map +1 -0
  330. package/dist/cliproxy/config/path-resolver.d.ts +21 -0
  331. package/dist/cliproxy/config/path-resolver.d.ts.map +1 -1
  332. package/dist/cliproxy/config/path-resolver.js +45 -5
  333. package/dist/cliproxy/config/path-resolver.js.map +1 -1
  334. package/dist/cliproxy/config/port-manager.d.ts +6 -0
  335. package/dist/cliproxy/config/port-manager.d.ts.map +1 -1
  336. package/dist/cliproxy/config/port-manager.js +19 -1
  337. package/dist/cliproxy/config/port-manager.js.map +1 -1
  338. package/dist/cliproxy/config/thinking-config.d.ts +1 -0
  339. package/dist/cliproxy/config/thinking-config.d.ts.map +1 -1
  340. package/dist/cliproxy/config/thinking-config.js +21 -12
  341. package/dist/cliproxy/config/thinking-config.js.map +1 -1
  342. package/dist/cliproxy/executor/account-resolution.d.ts +52 -0
  343. package/dist/cliproxy/executor/account-resolution.d.ts.map +1 -0
  344. package/dist/cliproxy/executor/account-resolution.js +154 -0
  345. package/dist/cliproxy/executor/account-resolution.js.map +1 -0
  346. package/dist/cliproxy/executor/arg-parser.d.ts +96 -0
  347. package/dist/cliproxy/executor/arg-parser.d.ts.map +1 -0
  348. package/dist/cliproxy/executor/arg-parser.js +529 -0
  349. package/dist/cliproxy/executor/arg-parser.js.map +1 -0
  350. package/dist/cliproxy/executor/auth-coordinator.d.ts +96 -0
  351. package/dist/cliproxy/executor/auth-coordinator.d.ts.map +1 -0
  352. package/dist/cliproxy/executor/auth-coordinator.js +342 -0
  353. package/dist/cliproxy/executor/auth-coordinator.js.map +1 -0
  354. package/dist/cliproxy/executor/browser-launch-setup.d.ts +36 -0
  355. package/dist/cliproxy/executor/browser-launch-setup.d.ts.map +1 -0
  356. package/dist/cliproxy/executor/browser-launch-setup.js +80 -0
  357. package/dist/cliproxy/executor/browser-launch-setup.js.map +1 -0
  358. package/dist/cliproxy/executor/claude-launcher.d.ts +55 -0
  359. package/dist/cliproxy/executor/claude-launcher.d.ts.map +1 -0
  360. package/dist/cliproxy/executor/claude-launcher.js +125 -0
  361. package/dist/cliproxy/executor/claude-launcher.js.map +1 -0
  362. package/dist/cliproxy/executor/cliproxy-executor.d.ts +16 -0
  363. package/dist/cliproxy/executor/cliproxy-executor.d.ts.map +1 -0
  364. package/dist/cliproxy/executor/cliproxy-executor.js +27 -0
  365. package/dist/cliproxy/executor/cliproxy-executor.js.map +1 -0
  366. package/dist/cliproxy/executor/env-resolver.d.ts +7 -5
  367. package/dist/cliproxy/executor/env-resolver.d.ts.map +1 -1
  368. package/dist/cliproxy/executor/env-resolver.js +7 -6
  369. package/dist/cliproxy/executor/env-resolver.js.map +1 -1
  370. package/dist/cliproxy/executor/https-tunnel-policy.d.ts +17 -0
  371. package/dist/cliproxy/executor/https-tunnel-policy.d.ts.map +1 -0
  372. package/dist/cliproxy/executor/https-tunnel-policy.js +20 -0
  373. package/dist/cliproxy/executor/https-tunnel-policy.js.map +1 -0
  374. package/dist/cliproxy/executor/index.d.ts +6 -0
  375. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  376. package/dist/cliproxy/executor/index.js +144 -693
  377. package/dist/cliproxy/executor/index.js.map +1 -1
  378. package/dist/cliproxy/executor/lifecycle-manager.js +1 -1
  379. package/dist/cliproxy/executor/lifecycle-manager.js.map +1 -1
  380. package/dist/cliproxy/executor/model-warnings.d.ts +22 -0
  381. package/dist/cliproxy/executor/model-warnings.d.ts.map +1 -0
  382. package/dist/cliproxy/executor/model-warnings.js +67 -0
  383. package/dist/cliproxy/executor/model-warnings.js.map +1 -0
  384. package/dist/cliproxy/executor/proxy-chain-builder.d.ts +71 -0
  385. package/dist/cliproxy/executor/proxy-chain-builder.d.ts.map +1 -0
  386. package/dist/cliproxy/executor/proxy-chain-builder.js +143 -0
  387. package/dist/cliproxy/executor/proxy-chain-builder.js.map +1 -0
  388. package/dist/cliproxy/executor/proxy-resolver.d.ts +44 -0
  389. package/dist/cliproxy/executor/proxy-resolver.d.ts.map +1 -0
  390. package/dist/cliproxy/executor/proxy-resolver.js +173 -0
  391. package/dist/cliproxy/executor/proxy-resolver.js.map +1 -0
  392. package/dist/cliproxy/executor/retry-handler.js +4 -4
  393. package/dist/cliproxy/executor/retry-handler.js.map +1 -1
  394. package/dist/cliproxy/executor/session-bridge.d.ts +16 -1
  395. package/dist/cliproxy/executor/session-bridge.d.ts.map +1 -1
  396. package/dist/cliproxy/executor/session-bridge.js +92 -57
  397. package/dist/cliproxy/executor/session-bridge.js.map +1 -1
  398. package/dist/cliproxy/index.d.ts +32 -32
  399. package/dist/cliproxy/index.d.ts.map +1 -1
  400. package/dist/cliproxy/index.js +20 -20
  401. package/dist/cliproxy/index.js.map +1 -1
  402. package/dist/cliproxy/management/management-api-client.d.ts +90 -0
  403. package/dist/cliproxy/management/management-api-client.d.ts.map +1 -0
  404. package/dist/cliproxy/management/management-api-client.js +396 -0
  405. package/dist/cliproxy/management/management-api-client.js.map +1 -0
  406. package/dist/cliproxy/management/management-api-types.d.ts.map +1 -0
  407. package/dist/cliproxy/management/management-api-types.js.map +1 -0
  408. package/dist/cliproxy/management/remote-token-uploader.d.ts.map +1 -0
  409. package/dist/cliproxy/management/remote-token-uploader.js +178 -0
  410. package/dist/cliproxy/management/remote-token-uploader.js.map +1 -0
  411. package/dist/cliproxy/model-catalog.d.ts +3 -1
  412. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  413. package/dist/cliproxy/model-catalog.js +60 -59
  414. package/dist/cliproxy/model-catalog.js.map +1 -1
  415. package/dist/cliproxy/provider-capabilities.d.ts +3 -0
  416. package/dist/cliproxy/provider-capabilities.d.ts.map +1 -1
  417. package/dist/cliproxy/provider-capabilities.js +63 -3
  418. package/dist/cliproxy/provider-capabilities.js.map +1 -1
  419. package/dist/cliproxy/proxy/https-tunnel-proxy.d.ts.map +1 -0
  420. package/dist/cliproxy/proxy/https-tunnel-proxy.js +229 -0
  421. package/dist/cliproxy/proxy/https-tunnel-proxy.js.map +1 -0
  422. package/dist/cliproxy/proxy/proxy-config-resolver.d.ts +87 -0
  423. package/dist/cliproxy/proxy/proxy-config-resolver.d.ts.map +1 -0
  424. package/dist/cliproxy/proxy/proxy-config-resolver.js +254 -0
  425. package/dist/cliproxy/proxy/proxy-config-resolver.js.map +1 -0
  426. package/dist/cliproxy/proxy/proxy-detector.d.ts +72 -0
  427. package/dist/cliproxy/proxy/proxy-detector.d.ts.map +1 -0
  428. package/dist/cliproxy/proxy/proxy-detector.js +200 -0
  429. package/dist/cliproxy/proxy/proxy-detector.js.map +1 -0
  430. package/dist/cliproxy/proxy/proxy-target-resolver.d.ts.map +1 -0
  431. package/dist/cliproxy/proxy/proxy-target-resolver.js +108 -0
  432. package/dist/cliproxy/proxy/proxy-target-resolver.js.map +1 -0
  433. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts +82 -0
  434. package/dist/cliproxy/proxy/tool-sanitization-proxy.d.ts.map +1 -0
  435. package/dist/cliproxy/proxy/tool-sanitization-proxy.js +668 -0
  436. package/dist/cliproxy/proxy/tool-sanitization-proxy.js.map +1 -0
  437. package/dist/cliproxy/quota/gemini-cli-quota-normalizer.d.ts.map +1 -0
  438. package/dist/cliproxy/quota/gemini-cli-quota-normalizer.js +122 -0
  439. package/dist/cliproxy/quota/gemini-cli-quota-normalizer.js.map +1 -0
  440. package/dist/cliproxy/quota/quota-fetcher-claude-normalizer.d.ts +14 -0
  441. package/dist/cliproxy/quota/quota-fetcher-claude-normalizer.d.ts.map +1 -0
  442. package/dist/cliproxy/quota/quota-fetcher-claude-normalizer.js +322 -0
  443. package/dist/cliproxy/quota/quota-fetcher-claude-normalizer.js.map +1 -0
  444. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts +21 -0
  445. package/dist/cliproxy/quota/quota-fetcher-claude.d.ts.map +1 -0
  446. package/dist/cliproxy/quota/quota-fetcher-claude.js +292 -0
  447. package/dist/cliproxy/quota/quota-fetcher-claude.js.map +1 -0
  448. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts +84 -0
  449. package/dist/cliproxy/quota/quota-fetcher-codex.d.ts.map +1 -0
  450. package/dist/cliproxy/quota/quota-fetcher-codex.js +651 -0
  451. package/dist/cliproxy/quota/quota-fetcher-codex.js.map +1 -0
  452. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.d.ts.map +1 -0
  453. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js +828 -0
  454. package/dist/cliproxy/quota/quota-fetcher-gemini-cli.js.map +1 -0
  455. package/dist/cliproxy/quota/quota-fetcher-ghcp.d.ts.map +1 -0
  456. package/dist/cliproxy/quota/quota-fetcher-ghcp.js +218 -0
  457. package/dist/cliproxy/quota/quota-fetcher-ghcp.js.map +1 -0
  458. package/dist/cliproxy/quota/quota-fetcher.d.ts +117 -0
  459. package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -0
  460. package/dist/cliproxy/quota/quota-fetcher.js +771 -0
  461. package/dist/cliproxy/quota/quota-fetcher.js.map +1 -0
  462. package/dist/cliproxy/quota/quota-manager.d.ts +109 -0
  463. package/dist/cliproxy/quota/quota-manager.d.ts.map +1 -0
  464. package/dist/cliproxy/quota/quota-manager.js +672 -0
  465. package/dist/cliproxy/quota/quota-manager.js.map +1 -0
  466. package/dist/cliproxy/quota/quota-response-cache.d.ts.map +1 -0
  467. package/dist/cliproxy/quota/quota-response-cache.js.map +1 -0
  468. package/dist/cliproxy/quota/quota-types.d.ts +262 -0
  469. package/dist/cliproxy/quota/quota-types.d.ts.map +1 -0
  470. package/dist/cliproxy/quota/quota-types.js.map +1 -0
  471. package/dist/cliproxy/routing/routing-strategy-http.d.ts +8 -0
  472. package/dist/cliproxy/routing/routing-strategy-http.d.ts.map +1 -0
  473. package/dist/cliproxy/routing/routing-strategy-http.js +120 -0
  474. package/dist/cliproxy/routing/routing-strategy-http.js.map +1 -0
  475. package/dist/cliproxy/routing/routing-strategy.d.ts +41 -0
  476. package/dist/cliproxy/routing/routing-strategy.d.ts.map +1 -0
  477. package/dist/cliproxy/routing/routing-strategy.js +272 -0
  478. package/dist/cliproxy/routing/routing-strategy.js.map +1 -0
  479. package/dist/cliproxy/service-manager.d.ts +17 -1
  480. package/dist/cliproxy/service-manager.d.ts.map +1 -1
  481. package/dist/cliproxy/service-manager.js +19 -11
  482. package/dist/cliproxy/service-manager.js.map +1 -1
  483. package/dist/cliproxy/services/binary-service.d.ts.map +1 -1
  484. package/dist/cliproxy/services/binary-service.js +16 -9
  485. package/dist/cliproxy/services/binary-service.js.map +1 -1
  486. package/dist/cliproxy/services/catalog-cache.d.ts +47 -0
  487. package/dist/cliproxy/services/catalog-cache.d.ts.map +1 -0
  488. package/dist/cliproxy/services/catalog-cache.js +347 -0
  489. package/dist/cliproxy/services/catalog-cache.js.map +1 -0
  490. package/dist/cliproxy/services/catalog-routing.d.ts +12 -0
  491. package/dist/cliproxy/services/catalog-routing.d.ts.map +1 -0
  492. package/dist/cliproxy/services/catalog-routing.js +19 -0
  493. package/dist/cliproxy/services/catalog-routing.js.map +1 -0
  494. package/dist/cliproxy/services/oauth-usage-log-transformer.d.ts +4 -0
  495. package/dist/cliproxy/services/oauth-usage-log-transformer.d.ts.map +1 -0
  496. package/dist/cliproxy/services/oauth-usage-log-transformer.js +162 -0
  497. package/dist/cliproxy/services/oauth-usage-log-transformer.js.map +1 -0
  498. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts +1 -0
  499. package/dist/cliproxy/services/proxy-lifecycle-service.d.ts.map +1 -1
  500. package/dist/cliproxy/services/proxy-lifecycle-service.js +6 -6
  501. package/dist/cliproxy/services/proxy-lifecycle-service.js.map +1 -1
  502. package/dist/cliproxy/services/remote-auth-fetcher.d.ts +30 -0
  503. package/dist/cliproxy/services/remote-auth-fetcher.d.ts.map +1 -0
  504. package/dist/cliproxy/services/remote-auth-fetcher.js +177 -0
  505. package/dist/cliproxy/services/remote-auth-fetcher.js.map +1 -0
  506. package/dist/cliproxy/services/remote-proxy-client.d.ts.map +1 -0
  507. package/dist/cliproxy/services/remote-proxy-client.js +281 -0
  508. package/dist/cliproxy/services/remote-proxy-client.js.map +1 -0
  509. package/dist/cliproxy/services/startup-lock.d.ts.map +1 -0
  510. package/dist/cliproxy/services/startup-lock.js +220 -0
  511. package/dist/cliproxy/services/startup-lock.js.map +1 -0
  512. package/dist/cliproxy/services/stats-fetcher.d.ts +162 -0
  513. package/dist/cliproxy/services/stats-fetcher.d.ts.map +1 -0
  514. package/dist/cliproxy/services/stats-fetcher.js +354 -0
  515. package/dist/cliproxy/services/stats-fetcher.js.map +1 -0
  516. package/dist/cliproxy/services/stats-transformer.d.ts.map +1 -0
  517. package/dist/cliproxy/services/stats-transformer.js +224 -0
  518. package/dist/cliproxy/services/stats-transformer.js.map +1 -0
  519. package/dist/cliproxy/services/usage-compatibility-transformer.d.ts +12 -0
  520. package/dist/cliproxy/services/usage-compatibility-transformer.d.ts.map +1 -0
  521. package/dist/cliproxy/services/usage-compatibility-transformer.js +458 -0
  522. package/dist/cliproxy/services/usage-compatibility-transformer.js.map +1 -0
  523. package/dist/cliproxy/services/variant-config-adapter.d.ts.map +1 -1
  524. package/dist/cliproxy/services/variant-config-adapter.js +11 -11
  525. package/dist/cliproxy/services/variant-config-adapter.js.map +1 -1
  526. package/dist/cliproxy/services/variant-service.d.ts +2 -1
  527. package/dist/cliproxy/services/variant-service.d.ts.map +1 -1
  528. package/dist/cliproxy/services/variant-service.js +21 -24
  529. package/dist/cliproxy/services/variant-service.js.map +1 -1
  530. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -1
  531. package/dist/cliproxy/services/variant-settings.js +53 -42
  532. package/dist/cliproxy/services/variant-settings.js.map +1 -1
  533. package/dist/cliproxy/session-tracker.js +2 -2
  534. package/dist/cliproxy/session-tracker.js.map +1 -1
  535. package/dist/cliproxy/sync/auto-sync-watcher.js +3 -4
  536. package/dist/cliproxy/sync/auto-sync-watcher.js.map +1 -1
  537. package/dist/cliproxy/sync/local-config-sync.js +1 -1
  538. package/dist/cliproxy/sync/local-config-sync.js.map +1 -1
  539. package/dist/cliproxy/sync/profile-mapper.d.ts +1 -1
  540. package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
  541. package/dist/cliproxy/sync/profile-mapper.js +23 -2
  542. package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
  543. package/dist/cliproxy/thinking-validator.d.ts +6 -1
  544. package/dist/cliproxy/thinking-validator.d.ts.map +1 -1
  545. package/dist/cliproxy/thinking-validator.js +22 -2
  546. package/dist/cliproxy/thinking-validator.js.map +1 -1
  547. package/dist/cliproxy/types/binary-types.d.ts +48 -0
  548. package/dist/cliproxy/types/binary-types.d.ts.map +1 -0
  549. package/dist/cliproxy/types/binary-types.js +6 -0
  550. package/dist/cliproxy/types/binary-types.js.map +1 -0
  551. package/dist/cliproxy/types/config-types.d.ts +89 -0
  552. package/dist/cliproxy/types/config-types.d.ts.map +1 -0
  553. package/dist/cliproxy/types/config-types.js +6 -0
  554. package/dist/cliproxy/types/config-types.js.map +1 -0
  555. package/dist/cliproxy/types/index.d.ts +5 -0
  556. package/dist/cliproxy/types/index.d.ts.map +1 -0
  557. package/dist/cliproxy/types/index.js +21 -0
  558. package/dist/cliproxy/types/index.js.map +1 -0
  559. package/dist/cliproxy/types/platform-types.d.ts +17 -0
  560. package/dist/cliproxy/types/platform-types.d.ts.map +1 -0
  561. package/dist/cliproxy/types/platform-types.js +6 -0
  562. package/dist/cliproxy/types/platform-types.js.map +1 -0
  563. package/dist/cliproxy/types/provider-types.d.ts +27 -0
  564. package/dist/cliproxy/types/provider-types.d.ts.map +1 -0
  565. package/dist/cliproxy/types/provider-types.js +16 -0
  566. package/dist/cliproxy/types/provider-types.js.map +1 -0
  567. package/dist/cliproxy/types.d.ts +4 -255
  568. package/dist/cliproxy/types.d.ts.map +1 -1
  569. package/dist/cliproxy/types.js +18 -7
  570. package/dist/cliproxy/types.js.map +1 -1
  571. package/dist/commands/api-command/create-command.d.ts +3 -0
  572. package/dist/commands/api-command/create-command.d.ts.map +1 -1
  573. package/dist/commands/api-command/create-command.js +24 -7
  574. package/dist/commands/api-command/create-command.js.map +1 -1
  575. package/dist/commands/api-command/help.d.ts.map +1 -1
  576. package/dist/commands/api-command/help.js +5 -0
  577. package/dist/commands/api-command/help.js.map +1 -1
  578. package/dist/commands/api-command/shared.d.ts +2 -1
  579. package/dist/commands/api-command/shared.d.ts.map +1 -1
  580. package/dist/commands/api-command/shared.js +9 -0
  581. package/dist/commands/api-command/shared.js.map +1 -1
  582. package/dist/commands/browser-command.d.ts +5 -0
  583. package/dist/commands/browser-command.d.ts.map +1 -0
  584. package/dist/commands/browser-command.js +349 -0
  585. package/dist/commands/browser-command.js.map +1 -0
  586. package/dist/commands/cleanup-command.d.ts +1 -1
  587. package/dist/commands/cleanup-command.d.ts.map +1 -1
  588. package/dist/commands/cleanup-command.js +58 -35
  589. package/dist/commands/cleanup-command.js.map +1 -1
  590. package/dist/commands/cliproxy/auth-subcommand.js +1 -1
  591. package/dist/commands/cliproxy/auth-subcommand.js.map +1 -1
  592. package/dist/commands/cliproxy/catalog-subcommand.d.ts +6 -0
  593. package/dist/commands/cliproxy/catalog-subcommand.d.ts.map +1 -1
  594. package/dist/commands/cliproxy/catalog-subcommand.js +112 -46
  595. package/dist/commands/cliproxy/catalog-subcommand.js.map +1 -1
  596. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  597. package/dist/commands/cliproxy/help-subcommand.js +15 -4
  598. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  599. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  600. package/dist/commands/cliproxy/index.js +35 -7
  601. package/dist/commands/cliproxy/index.js.map +1 -1
  602. package/dist/commands/cliproxy/install-subcommand.js +2 -2
  603. package/dist/commands/cliproxy/install-subcommand.js.map +1 -1
  604. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.js +6 -6
  605. package/dist/commands/cliproxy/proxy-lifecycle-subcommand.js.map +1 -1
  606. package/dist/commands/cliproxy/quota-subcommand.d.ts +3 -1
  607. package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
  608. package/dist/commands/cliproxy/quota-subcommand.js +95 -32
  609. package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
  610. package/dist/commands/cliproxy/routing-subcommand.d.ts +7 -0
  611. package/dist/commands/cliproxy/routing-subcommand.d.ts.map +1 -0
  612. package/dist/commands/cliproxy/routing-subcommand.js +193 -0
  613. package/dist/commands/cliproxy/routing-subcommand.js.map +1 -0
  614. package/dist/commands/cliproxy/variant-subcommand.d.ts.map +1 -1
  615. package/dist/commands/cliproxy/variant-subcommand.js +86 -13
  616. package/dist/commands/cliproxy/variant-subcommand.js.map +1 -1
  617. package/dist/commands/command-catalog.d.ts +6 -5
  618. package/dist/commands/command-catalog.d.ts.map +1 -1
  619. package/dist/commands/command-catalog.js +45 -8
  620. package/dist/commands/command-catalog.js.map +1 -1
  621. package/dist/commands/completion-backend.d.ts.map +1 -1
  622. package/dist/commands/completion-backend.js +62 -1
  623. package/dist/commands/completion-backend.js.map +1 -1
  624. package/dist/commands/config-auth/disable-command.d.ts.map +1 -1
  625. package/dist/commands/config-auth/disable-command.js +3 -3
  626. package/dist/commands/config-auth/disable-command.js.map +1 -1
  627. package/dist/commands/config-auth/setup-command.d.ts.map +1 -1
  628. package/dist/commands/config-auth/setup-command.js +2 -2
  629. package/dist/commands/config-auth/setup-command.js.map +1 -1
  630. package/dist/commands/config-auth/show-command.js +2 -2
  631. package/dist/commands/config-auth/show-command.js.map +1 -1
  632. package/dist/commands/config-channels-command.d.ts.map +1 -1
  633. package/dist/commands/config-channels-command.js +4 -4
  634. package/dist/commands/config-channels-command.js.map +1 -1
  635. package/dist/commands/config-command-options.d.ts.map +1 -1
  636. package/dist/commands/config-command-options.js +4 -2
  637. package/dist/commands/config-command-options.js.map +1 -1
  638. package/dist/commands/config-command.d.ts +1 -1
  639. package/dist/commands/config-command.d.ts.map +1 -1
  640. package/dist/commands/config-command.js +28 -5
  641. package/dist/commands/config-command.js.map +1 -1
  642. package/dist/commands/config-dashboard-host.d.ts +1 -0
  643. package/dist/commands/config-dashboard-host.d.ts.map +1 -1
  644. package/dist/commands/config-dashboard-host.js +16 -3
  645. package/dist/commands/config-dashboard-host.js.map +1 -1
  646. package/dist/commands/config-image-analysis-command.d.ts.map +1 -1
  647. package/dist/commands/config-image-analysis-command.js +4 -4
  648. package/dist/commands/config-image-analysis-command.js.map +1 -1
  649. package/dist/commands/config-thinking-command.d.ts.map +1 -1
  650. package/dist/commands/config-thinking-command.js +5 -5
  651. package/dist/commands/config-thinking-command.js.map +1 -1
  652. package/dist/commands/copilot-command.d.ts.map +1 -1
  653. package/dist/commands/copilot-command.js +7 -5
  654. package/dist/commands/copilot-command.js.map +1 -1
  655. package/dist/commands/cursor-command-display.d.ts +2 -0
  656. package/dist/commands/cursor-command-display.d.ts.map +1 -1
  657. package/dist/commands/cursor-command-display.js +63 -30
  658. package/dist/commands/cursor-command-display.js.map +1 -1
  659. package/dist/commands/cursor-command.d.ts.map +1 -1
  660. package/dist/commands/cursor-command.js +67 -61
  661. package/dist/commands/cursor-command.js.map +1 -1
  662. package/dist/commands/docker/up-subcommand.js +1 -1
  663. package/dist/commands/docker/up-subcommand.js.map +1 -1
  664. package/dist/commands/doctor-command.d.ts.map +1 -1
  665. package/dist/commands/doctor-command.js +9 -0
  666. package/dist/commands/doctor-command.js.map +1 -1
  667. package/dist/commands/env-command.d.ts.map +1 -1
  668. package/dist/commands/env-command.js +2 -2
  669. package/dist/commands/env-command.js.map +1 -1
  670. package/dist/commands/help-command.d.ts +2 -0
  671. package/dist/commands/help-command.d.ts.map +1 -1
  672. package/dist/commands/help-command.js +126 -5
  673. package/dist/commands/help-command.js.map +1 -1
  674. package/dist/commands/index.d.ts +1 -0
  675. package/dist/commands/index.d.ts.map +1 -1
  676. package/dist/commands/index.js +3 -1
  677. package/dist/commands/index.js.map +1 -1
  678. package/dist/commands/migrate-command.d.ts.map +1 -1
  679. package/dist/commands/migrate-command.js +2 -2
  680. package/dist/commands/migrate-command.js.map +1 -1
  681. package/dist/commands/proxy-command.d.ts +3 -0
  682. package/dist/commands/proxy-command.d.ts.map +1 -0
  683. package/dist/commands/proxy-command.js +237 -0
  684. package/dist/commands/proxy-command.js.map +1 -0
  685. package/dist/commands/root-command-router.d.ts.map +1 -1
  686. package/dist/commands/root-command-router.js +14 -0
  687. package/dist/commands/root-command-router.js.map +1 -1
  688. package/dist/commands/setup-command.d.ts.map +1 -1
  689. package/dist/commands/setup-command.js +6 -7
  690. package/dist/commands/setup-command.js.map +1 -1
  691. package/dist/commands/sync-command.d.ts.map +1 -1
  692. package/dist/commands/sync-command.js +3 -2
  693. package/dist/commands/sync-command.js.map +1 -1
  694. package/dist/commands/tokens-command.d.ts.map +1 -1
  695. package/dist/commands/tokens-command.js +27 -38
  696. package/dist/commands/tokens-command.js.map +1 -1
  697. package/dist/commands/update-command.d.ts +22 -5
  698. package/dist/commands/update-command.d.ts.map +1 -1
  699. package/dist/commands/update-command.js +211 -159
  700. package/dist/commands/update-command.js.map +1 -1
  701. package/dist/commands/version-command.d.ts.map +1 -1
  702. package/dist/commands/version-command.js +2 -1
  703. package/dist/commands/version-command.js.map +1 -1
  704. package/dist/config/config-loader-facade.d.ts +57 -0
  705. package/dist/config/config-loader-facade.d.ts.map +1 -0
  706. package/dist/config/config-loader-facade.js +131 -0
  707. package/dist/config/config-loader-facade.js.map +1 -0
  708. package/dist/config/loader/config-getters.d.ts +121 -0
  709. package/dist/config/loader/config-getters.d.ts.map +1 -0
  710. package/dist/config/loader/config-getters.js +260 -0
  711. package/dist/config/loader/config-getters.js.map +1 -0
  712. package/dist/config/loader/defaults-merger.d.ts +21 -0
  713. package/dist/config/loader/defaults-merger.d.ts.map +1 -0
  714. package/dist/config/loader/defaults-merger.js +278 -0
  715. package/dist/config/loader/defaults-merger.js.map +1 -0
  716. package/dist/config/loader/io-locks.d.ts +76 -0
  717. package/dist/config/loader/io-locks.d.ts.map +1 -0
  718. package/dist/config/loader/io-locks.js +297 -0
  719. package/dist/config/loader/io-locks.js.map +1 -0
  720. package/dist/config/loader/normalizers.d.ts +40 -0
  721. package/dist/config/loader/normalizers.d.ts.map +1 -0
  722. package/dist/config/loader/normalizers.js +172 -0
  723. package/dist/config/loader/normalizers.js.map +1 -0
  724. package/dist/config/loader/yaml-serializer.d.ts +19 -0
  725. package/dist/config/loader/yaml-serializer.d.ts.map +1 -0
  726. package/dist/config/loader/yaml-serializer.js +301 -0
  727. package/dist/config/loader/yaml-serializer.js.map +1 -0
  728. package/dist/config/migration-manager.d.ts.map +1 -1
  729. package/dist/config/migration-manager.js +14 -1
  730. package/dist/config/migration-manager.js.map +1 -1
  731. package/dist/config/reserved-names.d.ts +1 -1
  732. package/dist/config/reserved-names.d.ts.map +1 -1
  733. package/dist/config/reserved-names.js +10 -0
  734. package/dist/config/reserved-names.js.map +1 -1
  735. package/dist/config/schemas/auth.d.ts +99 -0
  736. package/dist/config/schemas/auth.d.ts.map +1 -0
  737. package/dist/config/schemas/auth.js +25 -0
  738. package/dist/config/schemas/auth.js.map +1 -0
  739. package/dist/config/schemas/browser.d.ts +53 -0
  740. package/dist/config/schemas/browser.d.ts.map +1 -0
  741. package/dist/config/schemas/browser.js +27 -0
  742. package/dist/config/schemas/browser.js.map +1 -0
  743. package/dist/config/schemas/channels.d.ts +27 -0
  744. package/dist/config/schemas/channels.d.ts.map +1 -0
  745. package/dist/config/schemas/channels.js +19 -0
  746. package/dist/config/schemas/channels.js.map +1 -0
  747. package/dist/config/schemas/cliproxy.d.ts +142 -0
  748. package/dist/config/schemas/cliproxy.d.ts.map +1 -0
  749. package/dist/config/schemas/cliproxy.js +18 -0
  750. package/dist/config/schemas/cliproxy.js.map +1 -0
  751. package/dist/config/schemas/copilot-cursor.d.ts +75 -0
  752. package/dist/config/schemas/copilot-cursor.d.ts.map +1 -0
  753. package/dist/config/schemas/copilot-cursor.js +36 -0
  754. package/dist/config/schemas/copilot-cursor.js.map +1 -0
  755. package/dist/config/schemas/index.d.ts +28 -0
  756. package/dist/config/schemas/index.d.ts.map +1 -0
  757. package/dist/config/schemas/index.js +51 -0
  758. package/dist/config/schemas/index.js.map +1 -0
  759. package/dist/config/schemas/logging.d.ts +43 -0
  760. package/dist/config/schemas/logging.d.ts.map +1 -0
  761. package/dist/config/schemas/logging.js +23 -0
  762. package/dist/config/schemas/logging.js.map +1 -0
  763. package/dist/config/schemas/providers.d.ts +14 -0
  764. package/dist/config/schemas/providers.d.ts.map +1 -0
  765. package/dist/config/schemas/providers.js +21 -0
  766. package/dist/config/schemas/providers.js.map +1 -0
  767. package/dist/config/schemas/proxy-server.d.ts +141 -0
  768. package/dist/config/schemas/proxy-server.d.ts.map +1 -0
  769. package/dist/config/schemas/proxy-server.js +71 -0
  770. package/dist/config/schemas/proxy-server.js.map +1 -0
  771. package/dist/config/schemas/quota.d.ts +88 -0
  772. package/dist/config/schemas/quota.d.ts.map +1 -0
  773. package/dist/config/schemas/quota.js +47 -0
  774. package/dist/config/schemas/quota.js.map +1 -0
  775. package/dist/config/schemas/thinking.d.ts +50 -0
  776. package/dist/config/schemas/thinking.d.ts.map +1 -0
  777. package/dist/config/schemas/thinking.js +26 -0
  778. package/dist/config/schemas/thinking.js.map +1 -0
  779. package/dist/config/schemas/unified-config.d.ts +74 -0
  780. package/dist/config/schemas/unified-config.d.ts.map +1 -0
  781. package/dist/config/schemas/unified-config.js +131 -0
  782. package/dist/config/schemas/unified-config.js.map +1 -0
  783. package/dist/config/schemas/version.d.ts +23 -0
  784. package/dist/config/schemas/version.d.ts.map +1 -0
  785. package/dist/config/schemas/version.js +26 -0
  786. package/dist/config/schemas/version.js.map +1 -0
  787. package/dist/config/schemas/websearch.d.ts +138 -0
  788. package/dist/config/schemas/websearch.d.ts.map +1 -0
  789. package/dist/config/schemas/websearch.js +12 -0
  790. package/dist/config/schemas/websearch.js.map +1 -0
  791. package/dist/config/unified-config-loader.d.ts +21 -113
  792. package/dist/config/unified-config-loader.d.ts.map +1 -1
  793. package/dist/config/unified-config-loader.js +104 -935
  794. package/dist/config/unified-config-loader.js.map +1 -1
  795. package/dist/config/unified-config-types.d.ts +3 -723
  796. package/dist/config/unified-config-types.d.ts.map +1 -1
  797. package/dist/config/unified-config-types.js +19 -268
  798. package/dist/config/unified-config-types.js.map +1 -1
  799. package/dist/copilot/copilot-auth.d.ts.map +1 -1
  800. package/dist/copilot/copilot-auth.js +22 -0
  801. package/dist/copilot/copilot-auth.js.map +1 -1
  802. package/dist/copilot/copilot-daemon.d.ts.map +1 -1
  803. package/dist/copilot/copilot-daemon.js +28 -2
  804. package/dist/copilot/copilot-daemon.js.map +1 -1
  805. package/dist/copilot/copilot-executor.d.ts +1 -1
  806. package/dist/copilot/copilot-executor.d.ts.map +1 -1
  807. package/dist/copilot/copilot-executor.js +31 -12
  808. package/dist/copilot/copilot-executor.js.map +1 -1
  809. package/dist/copilot/copilot-package-manager.js +2 -2
  810. package/dist/copilot/copilot-package-manager.js.map +1 -1
  811. package/dist/cursor/constants.d.ts +4 -1
  812. package/dist/cursor/constants.d.ts.map +1 -1
  813. package/dist/cursor/constants.js +27 -1
  814. package/dist/cursor/constants.js.map +1 -1
  815. package/dist/cursor/cursor-anthropic-response.d.ts +1 -5
  816. package/dist/cursor/cursor-anthropic-response.d.ts.map +1 -1
  817. package/dist/cursor/cursor-anthropic-response.js +3 -186
  818. package/dist/cursor/cursor-anthropic-response.js.map +1 -1
  819. package/dist/cursor/cursor-anthropic-translator.d.ts.map +1 -1
  820. package/dist/cursor/cursor-anthropic-translator.js +17 -3
  821. package/dist/cursor/cursor-anthropic-translator.js.map +1 -1
  822. package/dist/cursor/cursor-anthropic-types.d.ts +3 -0
  823. package/dist/cursor/cursor-anthropic-types.d.ts.map +1 -1
  824. package/dist/cursor/cursor-auth.d.ts +1 -0
  825. package/dist/cursor/cursor-auth.d.ts.map +1 -1
  826. package/dist/cursor/cursor-auth.js +156 -34
  827. package/dist/cursor/cursor-auth.js.map +1 -1
  828. package/dist/cursor/cursor-daemon-entry.js +2 -2
  829. package/dist/cursor/cursor-daemon-entry.js.map +1 -1
  830. package/dist/cursor/cursor-daemon-pid.js +2 -2
  831. package/dist/cursor/cursor-daemon-pid.js.map +1 -1
  832. package/dist/cursor/cursor-daemon.d.ts.map +1 -1
  833. package/dist/cursor/cursor-daemon.js +28 -1
  834. package/dist/cursor/cursor-daemon.js.map +1 -1
  835. package/dist/cursor/cursor-default-models.d.ts +1 -1
  836. package/dist/cursor/cursor-default-models.d.ts.map +1 -1
  837. package/dist/cursor/cursor-default-models.js +11 -1
  838. package/dist/cursor/cursor-default-models.js.map +1 -1
  839. package/dist/cursor/cursor-executor.d.ts +2 -1
  840. package/dist/cursor/cursor-executor.d.ts.map +1 -1
  841. package/dist/cursor/cursor-executor.js +312 -161
  842. package/dist/cursor/cursor-executor.js.map +1 -1
  843. package/dist/cursor/cursor-models.d.ts.map +1 -1
  844. package/dist/cursor/cursor-models.js +26 -4
  845. package/dist/cursor/cursor-models.js.map +1 -1
  846. package/dist/cursor/cursor-profile-executor.d.ts +10 -1
  847. package/dist/cursor/cursor-profile-executor.d.ts.map +1 -1
  848. package/dist/cursor/cursor-profile-executor.js +14 -10
  849. package/dist/cursor/cursor-profile-executor.js.map +1 -1
  850. package/dist/cursor/cursor-protobuf-decoder.d.ts.map +1 -1
  851. package/dist/cursor/cursor-protobuf-decoder.js +1 -3
  852. package/dist/cursor/cursor-protobuf-decoder.js.map +1 -1
  853. package/dist/cursor/cursor-protobuf-schema.d.ts +12 -3
  854. package/dist/cursor/cursor-protobuf-schema.d.ts.map +1 -1
  855. package/dist/cursor/cursor-protobuf-schema.js +23 -5
  856. package/dist/cursor/cursor-protobuf-schema.js.map +1 -1
  857. package/dist/cursor/cursor-protobuf.d.ts +1 -1
  858. package/dist/cursor/cursor-protobuf.d.ts.map +1 -1
  859. package/dist/cursor/cursor-protobuf.js +2 -4
  860. package/dist/cursor/cursor-protobuf.js.map +1 -1
  861. package/dist/cursor/cursor-runtime-probe.d.ts +12 -0
  862. package/dist/cursor/cursor-runtime-probe.d.ts.map +1 -0
  863. package/dist/cursor/cursor-runtime-probe.js +220 -0
  864. package/dist/cursor/cursor-runtime-probe.js.map +1 -0
  865. package/dist/cursor/cursor-stream-parser.d.ts +10 -0
  866. package/dist/cursor/cursor-stream-parser.d.ts.map +1 -1
  867. package/dist/cursor/cursor-stream-parser.js +106 -10
  868. package/dist/cursor/cursor-stream-parser.js.map +1 -1
  869. package/dist/cursor/index.d.ts +1 -0
  870. package/dist/cursor/index.d.ts.map +1 -1
  871. package/dist/cursor/index.js +3 -1
  872. package/dist/cursor/index.js.map +1 -1
  873. package/dist/cursor/types.d.ts +6 -0
  874. package/dist/cursor/types.d.ts.map +1 -1
  875. package/dist/delegation/delegation-handler.d.ts.map +1 -1
  876. package/dist/delegation/delegation-handler.js +113 -36
  877. package/dist/delegation/delegation-handler.js.map +1 -1
  878. package/dist/delegation/headless-executor.d.ts.map +1 -1
  879. package/dist/delegation/headless-executor.js +67 -22
  880. package/dist/delegation/headless-executor.js.map +1 -1
  881. package/dist/delegation/session-manager.js +2 -2
  882. package/dist/delegation/session-manager.js.map +1 -1
  883. package/dist/dispatcher/cli-argument-parser.d.ts +70 -0
  884. package/dist/dispatcher/cli-argument-parser.d.ts.map +1 -0
  885. package/dist/dispatcher/cli-argument-parser.js +285 -0
  886. package/dist/dispatcher/cli-argument-parser.js.map +1 -0
  887. package/dist/dispatcher/dispatcher-context.d.ts +24 -0
  888. package/dist/dispatcher/dispatcher-context.d.ts.map +1 -0
  889. package/dist/dispatcher/dispatcher-context.js +11 -0
  890. package/dist/dispatcher/dispatcher-context.js.map +1 -0
  891. package/dist/dispatcher/environment-builder.d.ts +20 -0
  892. package/dist/dispatcher/environment-builder.d.ts.map +1 -0
  893. package/dist/dispatcher/environment-builder.js +95 -0
  894. package/dist/dispatcher/environment-builder.js.map +1 -0
  895. package/dist/dispatcher/flows/account-flow.d.ts +9 -0
  896. package/dist/dispatcher/flows/account-flow.d.ts.map +1 -0
  897. package/dist/dispatcher/flows/account-flow.js +50 -0
  898. package/dist/dispatcher/flows/account-flow.js.map +1 -0
  899. package/dist/dispatcher/flows/cliproxy-flow.d.ts +8 -0
  900. package/dist/dispatcher/flows/cliproxy-flow.d.ts.map +1 -0
  901. package/dist/dispatcher/flows/cliproxy-flow.js +165 -0
  902. package/dist/dispatcher/flows/cliproxy-flow.js.map +1 -0
  903. package/dist/dispatcher/flows/copilot-flow.d.ts +8 -0
  904. package/dist/dispatcher/flows/copilot-flow.d.ts.map +1 -0
  905. package/dist/dispatcher/flows/copilot-flow.js +72 -0
  906. package/dist/dispatcher/flows/copilot-flow.js.map +1 -0
  907. package/dist/dispatcher/flows/cursor-flow.d.ts +8 -0
  908. package/dist/dispatcher/flows/cursor-flow.d.ts.map +1 -0
  909. package/dist/dispatcher/flows/cursor-flow.js +62 -0
  910. package/dist/dispatcher/flows/cursor-flow.js.map +1 -0
  911. package/dist/dispatcher/flows/default-flow.d.ts +10 -0
  912. package/dist/dispatcher/flows/default-flow.d.ts.map +1 -0
  913. package/dist/dispatcher/flows/default-flow.js +99 -0
  914. package/dist/dispatcher/flows/default-flow.js.map +1 -0
  915. package/dist/dispatcher/flows/settings-flow.d.ts +9 -0
  916. package/dist/dispatcher/flows/settings-flow.d.ts.map +1 -0
  917. package/dist/dispatcher/flows/settings-flow.js +329 -0
  918. package/dist/dispatcher/flows/settings-flow.js.map +1 -0
  919. package/dist/dispatcher/flows/settings-image-analysis-prep.d.ts +28 -0
  920. package/dist/dispatcher/flows/settings-image-analysis-prep.d.ts.map +1 -0
  921. package/dist/dispatcher/flows/settings-image-analysis-prep.js +81 -0
  922. package/dist/dispatcher/flows/settings-image-analysis-prep.js.map +1 -0
  923. package/dist/dispatcher/pre-dispatch.d.ts +23 -0
  924. package/dist/dispatcher/pre-dispatch.d.ts.map +1 -0
  925. package/dist/dispatcher/pre-dispatch.js +156 -0
  926. package/dist/dispatcher/pre-dispatch.js.map +1 -0
  927. package/dist/dispatcher/profile-resolver.d.ts +65 -0
  928. package/dist/dispatcher/profile-resolver.d.ts.map +1 -0
  929. package/dist/dispatcher/profile-resolver.js +303 -0
  930. package/dist/dispatcher/profile-resolver.js.map +1 -0
  931. package/dist/dispatcher/target-executor.d.ts +26 -0
  932. package/dist/dispatcher/target-executor.d.ts.map +1 -0
  933. package/dist/dispatcher/target-executor.js +81 -0
  934. package/dist/dispatcher/target-executor.js.map +1 -0
  935. package/dist/docker/docker-assets.d.ts.map +1 -1
  936. package/dist/docker/docker-assets.js +2 -2
  937. package/dist/docker/docker-assets.js.map +1 -1
  938. package/dist/docker/docker-bootstrap.js +1 -1
  939. package/dist/docker/docker-bootstrap.js.map +1 -1
  940. package/dist/docker/docker-executor.d.ts +1 -0
  941. package/dist/docker/docker-executor.d.ts.map +1 -1
  942. package/dist/docker/supervisord-lifecycle.d.ts +17 -0
  943. package/dist/docker/supervisord-lifecycle.d.ts.map +1 -0
  944. package/dist/docker/supervisord-lifecycle.js +58 -0
  945. package/dist/docker/supervisord-lifecycle.js.map +1 -0
  946. package/dist/errors/error-handler.d.ts.map +1 -1
  947. package/dist/errors/error-handler.js +13 -0
  948. package/dist/errors/error-handler.js.map +1 -1
  949. package/dist/errors/error-types.d.ts +9 -0
  950. package/dist/errors/error-types.d.ts.map +1 -1
  951. package/dist/errors/error-types.js +15 -1
  952. package/dist/errors/error-types.js.map +1 -1
  953. package/dist/errors/index.d.ts +1 -1
  954. package/dist/errors/index.d.ts.map +1 -1
  955. package/dist/errors/index.js +3 -1
  956. package/dist/errors/index.js.map +1 -1
  957. package/dist/glmt/delta-accumulator.d.ts +4 -0
  958. package/dist/glmt/delta-accumulator.d.ts.map +1 -1
  959. package/dist/glmt/delta-accumulator.js +17 -5
  960. package/dist/glmt/delta-accumulator.js.map +1 -1
  961. package/dist/glmt/glmt-proxy.d.ts.map +1 -1
  962. package/dist/glmt/glmt-proxy.js +7 -0
  963. package/dist/glmt/glmt-proxy.js.map +1 -1
  964. package/dist/glmt/glmt-transformer.d.ts +1 -0
  965. package/dist/glmt/glmt-transformer.d.ts.map +1 -1
  966. package/dist/glmt/glmt-transformer.js +9 -2
  967. package/dist/glmt/glmt-transformer.js.map +1 -1
  968. package/dist/glmt/pipeline/stream-parser.d.ts +0 -3
  969. package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
  970. package/dist/glmt/pipeline/stream-parser.js +20 -27
  971. package/dist/glmt/pipeline/stream-parser.js.map +1 -1
  972. package/dist/glmt/pipeline/tool-call-handler.d.ts +0 -7
  973. package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
  974. package/dist/glmt/pipeline/tool-call-handler.js +15 -24
  975. package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
  976. package/dist/glmt/sse-parser.d.ts.map +1 -1
  977. package/dist/glmt/sse-parser.js +46 -41
  978. package/dist/glmt/sse-parser.js.map +1 -1
  979. package/dist/management/checks/config-check.d.ts.map +1 -1
  980. package/dist/management/checks/config-check.js +2 -2
  981. package/dist/management/checks/config-check.js.map +1 -1
  982. package/dist/management/checks/env-check.d.ts.map +1 -1
  983. package/dist/management/checks/env-check.js +2 -1
  984. package/dist/management/checks/env-check.js.map +1 -1
  985. package/dist/management/checks/image-analysis-check.d.ts.map +1 -1
  986. package/dist/management/checks/image-analysis-check.js +25 -7
  987. package/dist/management/checks/image-analysis-check.js.map +1 -1
  988. package/dist/management/checks/profile-check.d.ts.map +1 -1
  989. package/dist/management/checks/profile-check.js +6 -7
  990. package/dist/management/checks/profile-check.js.map +1 -1
  991. package/dist/management/checks/symlink-check.d.ts.map +1 -1
  992. package/dist/management/checks/symlink-check.js +4 -5
  993. package/dist/management/checks/symlink-check.js.map +1 -1
  994. package/dist/management/checks/system-check.d.ts.map +1 -1
  995. package/dist/management/checks/system-check.js +3 -3
  996. package/dist/management/checks/system-check.js.map +1 -1
  997. package/dist/management/instance-directory.d.ts +4 -0
  998. package/dist/management/instance-directory.d.ts.map +1 -0
  999. package/dist/management/instance-directory.js +54 -0
  1000. package/dist/management/instance-directory.js.map +1 -0
  1001. package/dist/management/instance-manager.d.ts.map +1 -1
  1002. package/dist/management/instance-manager.js +18 -13
  1003. package/dist/management/instance-manager.js.map +1 -1
  1004. package/dist/management/plugin-path-normalizer.d.ts +7 -0
  1005. package/dist/management/plugin-path-normalizer.d.ts.map +1 -0
  1006. package/dist/management/plugin-path-normalizer.js +82 -0
  1007. package/dist/management/plugin-path-normalizer.js.map +1 -0
  1008. package/dist/management/recovery-manager.d.ts +6 -0
  1009. package/dist/management/recovery-manager.d.ts.map +1 -1
  1010. package/dist/management/recovery-manager.js +77 -7
  1011. package/dist/management/recovery-manager.js.map +1 -1
  1012. package/dist/management/repair/auto-repair.d.ts.map +1 -1
  1013. package/dist/management/repair/auto-repair.js +2 -2
  1014. package/dist/management/repair/auto-repair.js.map +1 -1
  1015. package/dist/management/shared-manager.d.ts +3 -2
  1016. package/dist/management/shared-manager.d.ts.map +1 -1
  1017. package/dist/management/shared-manager.js +41 -84
  1018. package/dist/management/shared-manager.js.map +1 -1
  1019. package/dist/proxy/index.d.ts +9 -0
  1020. package/dist/proxy/index.d.ts.map +1 -0
  1021. package/dist/proxy/index.js +25 -0
  1022. package/dist/proxy/index.js.map +1 -0
  1023. package/dist/proxy/profile-router.d.ts +28 -0
  1024. package/dist/proxy/profile-router.d.ts.map +1 -0
  1025. package/dist/proxy/profile-router.js +43 -0
  1026. package/dist/proxy/profile-router.js.map +1 -0
  1027. package/dist/proxy/proxy-daemon-entry.d.ts +2 -0
  1028. package/dist/proxy/proxy-daemon-entry.d.ts.map +1 -0
  1029. package/dist/proxy/proxy-daemon-entry.js +112 -0
  1030. package/dist/proxy/proxy-daemon-entry.js.map +1 -0
  1031. package/dist/proxy/proxy-daemon-paths.d.ts +12 -0
  1032. package/dist/proxy/proxy-daemon-paths.d.ts.map +1 -0
  1033. package/dist/proxy/proxy-daemon-paths.js +58 -0
  1034. package/dist/proxy/proxy-daemon-paths.js.map +1 -0
  1035. package/dist/proxy/proxy-daemon-state.d.ts +25 -0
  1036. package/dist/proxy/proxy-daemon-state.d.ts.map +1 -0
  1037. package/dist/proxy/proxy-daemon-state.js +199 -0
  1038. package/dist/proxy/proxy-daemon-state.js.map +1 -0
  1039. package/dist/proxy/proxy-daemon.d.ts +27 -0
  1040. package/dist/proxy/proxy-daemon.d.ts.map +1 -0
  1041. package/dist/proxy/proxy-daemon.js +614 -0
  1042. package/dist/proxy/proxy-daemon.js.map +1 -0
  1043. package/dist/proxy/proxy-env.d.ts +3 -0
  1044. package/dist/proxy/proxy-env.d.ts.map +1 -0
  1045. package/dist/proxy/proxy-env.js +26 -0
  1046. package/dist/proxy/proxy-env.js.map +1 -0
  1047. package/dist/proxy/proxy-port-resolver.d.ts +9 -0
  1048. package/dist/proxy/proxy-port-resolver.d.ts.map +1 -0
  1049. package/dist/proxy/proxy-port-resolver.js +62 -0
  1050. package/dist/proxy/proxy-port-resolver.js.map +1 -0
  1051. package/dist/proxy/request-router.d.ts +12 -0
  1052. package/dist/proxy/request-router.d.ts.map +1 -0
  1053. package/dist/proxy/request-router.js +163 -0
  1054. package/dist/proxy/request-router.js.map +1 -0
  1055. package/dist/proxy/routing-config.d.ts +10 -0
  1056. package/dist/proxy/routing-config.d.ts.map +1 -0
  1057. package/dist/proxy/routing-config.js +79 -0
  1058. package/dist/proxy/routing-config.js.map +1 -0
  1059. package/dist/proxy/server/http-helpers.d.ts +8 -0
  1060. package/dist/proxy/server/http-helpers.d.ts.map +1 -0
  1061. package/dist/proxy/server/http-helpers.js +73 -0
  1062. package/dist/proxy/server/http-helpers.js.map +1 -0
  1063. package/dist/proxy/server/messages-route.d.ts +12 -0
  1064. package/dist/proxy/server/messages-route.d.ts.map +1 -0
  1065. package/dist/proxy/server/messages-route.js +244 -0
  1066. package/dist/proxy/server/messages-route.js.map +1 -0
  1067. package/dist/proxy/server/proxy-server.d.ts +12 -0
  1068. package/dist/proxy/server/proxy-server.d.ts.map +1 -0
  1069. package/dist/proxy/server/proxy-server.js +140 -0
  1070. package/dist/proxy/server/proxy-server.js.map +1 -0
  1071. package/dist/proxy/transformers/request-transformer.d.ts +60 -0
  1072. package/dist/proxy/transformers/request-transformer.d.ts.map +1 -0
  1073. package/dist/proxy/transformers/request-transformer.js +452 -0
  1074. package/dist/proxy/transformers/request-transformer.js.map +1 -0
  1075. package/dist/proxy/transformers/sse-stream-transformer.d.ts +11 -0
  1076. package/dist/proxy/transformers/sse-stream-transformer.d.ts.map +1 -0
  1077. package/dist/proxy/transformers/sse-stream-transformer.js +200 -0
  1078. package/dist/proxy/transformers/sse-stream-transformer.js.map +1 -0
  1079. package/dist/proxy/upstream-url.d.ts +3 -0
  1080. package/dist/proxy/upstream-url.d.ts.map +1 -0
  1081. package/dist/proxy/upstream-url.js +43 -0
  1082. package/dist/proxy/upstream-url.js.map +1 -0
  1083. package/dist/services/logging/index.d.ts +12 -0
  1084. package/dist/services/logging/index.d.ts.map +1 -0
  1085. package/dist/services/logging/index.js +37 -0
  1086. package/dist/services/logging/index.js.map +1 -0
  1087. package/dist/services/logging/log-buffer.d.ts +5 -0
  1088. package/dist/services/logging/log-buffer.d.ts.map +1 -0
  1089. package/dist/services/logging/log-buffer.js +20 -0
  1090. package/dist/services/logging/log-buffer.js.map +1 -0
  1091. package/dist/services/logging/log-config.d.ts +4 -0
  1092. package/dist/services/logging/log-config.d.ts.map +1 -0
  1093. package/dist/services/logging/log-config.js +68 -0
  1094. package/dist/services/logging/log-config.js.map +1 -0
  1095. package/dist/services/logging/log-context.d.ts +41 -0
  1096. package/dist/services/logging/log-context.d.ts.map +1 -0
  1097. package/dist/services/logging/log-context.js +51 -0
  1098. package/dist/services/logging/log-context.js.map +1 -0
  1099. package/dist/services/logging/log-paths.d.ts +8 -0
  1100. package/dist/services/logging/log-paths.d.ts.map +1 -0
  1101. package/dist/services/logging/log-paths.js +66 -0
  1102. package/dist/services/logging/log-paths.js.map +1 -0
  1103. package/dist/services/logging/log-reader.d.ts +5 -0
  1104. package/dist/services/logging/log-reader.d.ts.map +1 -0
  1105. package/dist/services/logging/log-reader.js +124 -0
  1106. package/dist/services/logging/log-reader.js.map +1 -0
  1107. package/dist/services/logging/log-redaction.d.ts +10 -0
  1108. package/dist/services/logging/log-redaction.d.ts.map +1 -0
  1109. package/dist/services/logging/log-redaction.js +90 -0
  1110. package/dist/services/logging/log-redaction.js.map +1 -0
  1111. package/dist/services/logging/log-storage.d.ts +4 -0
  1112. package/dist/services/logging/log-storage.d.ts.map +1 -0
  1113. package/dist/services/logging/log-storage.js +109 -0
  1114. package/dist/services/logging/log-storage.js.map +1 -0
  1115. package/dist/services/logging/log-types.d.ts +60 -0
  1116. package/dist/services/logging/log-types.d.ts.map +1 -0
  1117. package/dist/services/logging/log-types.js +33 -0
  1118. package/dist/services/logging/log-types.js.map +1 -0
  1119. package/dist/services/logging/logger.d.ts +26 -0
  1120. package/dist/services/logging/logger.d.ts.map +1 -0
  1121. package/dist/services/logging/logger.js +65 -0
  1122. package/dist/services/logging/logger.js.map +1 -0
  1123. package/dist/shared/agy-gemini-pro-compatibility.d.ts +15 -0
  1124. package/dist/shared/agy-gemini-pro-compatibility.d.ts.map +1 -0
  1125. package/dist/shared/agy-gemini-pro-compatibility.js +18 -0
  1126. package/dist/shared/agy-gemini-pro-compatibility.js.map +1 -0
  1127. package/dist/shared/claude-extension-setup.d.ts.map +1 -1
  1128. package/dist/shared/claude-extension-setup.js +7 -3
  1129. package/dist/shared/claude-extension-setup.js.map +1 -1
  1130. package/dist/shared/cliproxy-model-routing.d.ts +45 -0
  1131. package/dist/shared/cliproxy-model-routing.d.ts.map +1 -0
  1132. package/dist/shared/cliproxy-model-routing.js +144 -0
  1133. package/dist/shared/cliproxy-model-routing.js.map +1 -0
  1134. package/dist/shared/provider-preset-catalog.d.ts +4 -2
  1135. package/dist/shared/provider-preset-catalog.d.ts.map +1 -1
  1136. package/dist/shared/provider-preset-catalog.js +17 -1
  1137. package/dist/shared/provider-preset-catalog.js.map +1 -1
  1138. package/dist/shared/toml-object.d.ts.map +1 -1
  1139. package/dist/shared/toml-object.js +6 -2
  1140. package/dist/shared/toml-object.js.map +1 -1
  1141. package/dist/targets/claude-adapter.d.ts +6 -1
  1142. package/dist/targets/claude-adapter.d.ts.map +1 -1
  1143. package/dist/targets/claude-adapter.js +20 -5
  1144. package/dist/targets/claude-adapter.js.map +1 -1
  1145. package/dist/targets/codex-adapter.d.ts +2 -0
  1146. package/dist/targets/codex-adapter.d.ts.map +1 -1
  1147. package/dist/targets/codex-adapter.js +43 -11
  1148. package/dist/targets/codex-adapter.js.map +1 -1
  1149. package/dist/targets/codex-cliproxy-provider-config.d.ts +16 -0
  1150. package/dist/targets/codex-cliproxy-provider-config.d.ts.map +1 -0
  1151. package/dist/targets/codex-cliproxy-provider-config.js +156 -0
  1152. package/dist/targets/codex-cliproxy-provider-config.js.map +1 -0
  1153. package/dist/targets/codex-detector.d.ts.map +1 -1
  1154. package/dist/targets/codex-detector.js +20 -9
  1155. package/dist/targets/codex-detector.js.map +1 -1
  1156. package/dist/targets/droid-adapter.d.ts +3 -2
  1157. package/dist/targets/droid-adapter.d.ts.map +1 -1
  1158. package/dist/targets/droid-adapter.js +15 -10
  1159. package/dist/targets/droid-adapter.js.map +1 -1
  1160. package/dist/targets/droid-config-manager.d.ts.map +1 -1
  1161. package/dist/targets/droid-config-manager.js +40 -0
  1162. package/dist/targets/droid-config-manager.js.map +1 -1
  1163. package/dist/targets/droid-provider.d.ts.map +1 -1
  1164. package/dist/targets/droid-provider.js +10 -5
  1165. package/dist/targets/droid-provider.js.map +1 -1
  1166. package/dist/targets/target-adapter.d.ts +5 -0
  1167. package/dist/targets/target-adapter.d.ts.map +1 -1
  1168. package/dist/targets/target-metadata.js +1 -1
  1169. package/dist/targets/target-metadata.js.map +1 -1
  1170. package/dist/targets/target-resolver.d.ts.map +1 -1
  1171. package/dist/targets/target-resolver.js +15 -0
  1172. package/dist/targets/target-resolver.js.map +1 -1
  1173. package/dist/targets/target-runtime-compatibility.js +1 -1
  1174. package/dist/targets/target-runtime-compatibility.js.map +1 -1
  1175. package/dist/types/cli.d.ts +1 -0
  1176. package/dist/types/cli.d.ts.map +1 -1
  1177. package/dist/types/config.d.ts +15 -0
  1178. package/dist/types/config.d.ts.map +1 -1
  1179. package/dist/types/config.js.map +1 -1
  1180. package/dist/types/index.d.ts +1 -1
  1181. package/dist/types/index.d.ts.map +1 -1
  1182. package/dist/types/index.js.map +1 -1
  1183. package/dist/ui/assets/accounts-biinrjBy.js +1 -0
  1184. package/dist/ui/assets/alert-dialog-B9kuXS_B.js +1 -0
  1185. package/dist/ui/assets/api-BYTesAyV.js +4 -0
  1186. package/dist/ui/assets/auth-section-BH7Y0zzE.js +1 -0
  1187. package/dist/ui/assets/backups-section-JTiku4fB.js +1 -0
  1188. package/dist/ui/assets/channels-BweRUtu-.js +1 -0
  1189. package/dist/ui/assets/charts-eIPy2oG6.js +64 -0
  1190. package/dist/ui/assets/checkbox-CsTXDim7.js +1 -0
  1191. package/dist/ui/assets/claude-extension-BE4B2NkS.js +1 -0
  1192. package/dist/ui/assets/cliproxy-Fl6HWxZ0.js +4 -0
  1193. package/dist/ui/assets/cliproxy-ai-providers-NMOopK4K.js +15 -0
  1194. package/dist/ui/assets/cliproxy-control-panel-BgiBcyzb.js +1 -0
  1195. package/dist/ui/assets/code-highlight-ClSMkeL5.js +1 -0
  1196. package/dist/ui/assets/codex-BsxF_eKF.js +30 -0
  1197. package/dist/ui/assets/confirm-dialog-iyu6jSnb.js +1 -0
  1198. package/dist/ui/assets/copilot-BSCdzbOk.js +3 -0
  1199. package/dist/ui/assets/cursor-CjGT-EsR.js +1 -0
  1200. package/dist/ui/assets/droid-MR-k0fbU.js +2 -0
  1201. package/dist/ui/assets/form-utils-CuHzLhJZ.js +20 -0
  1202. package/dist/ui/assets/globalenv-section-BGPR-lJN.js +1 -0
  1203. package/dist/ui/assets/health-C7wQUXVn.js +1 -0
  1204. package/dist/ui/assets/icons-bxdfpJdB.js +1 -0
  1205. package/dist/ui/assets/index-7dfuc3Cf.js +56 -0
  1206. package/dist/ui/assets/index-7rknm4m0.js +1 -0
  1207. package/dist/ui/assets/index-BeLNgVQ9.js +1 -0
  1208. package/dist/ui/assets/index-BvMWFZiH.js +1 -0
  1209. package/dist/ui/assets/index-DrEPnpI3.css +1 -0
  1210. package/dist/ui/assets/index-MAUysHQF.js +1 -0
  1211. package/dist/ui/assets/index-nzImYtUK.js +1 -0
  1212. package/dist/ui/assets/index-w9DZ42zc.js +1 -0
  1213. package/dist/ui/assets/logs-Qr4G0AdK.js +1 -0
  1214. package/dist/ui/assets/masked-input-Bl5OoUEZ.js +1 -0
  1215. package/dist/ui/assets/notifications-B4_o8bcr.js +1 -0
  1216. package/dist/ui/assets/providers/codebuddy.png +0 -0
  1217. package/dist/ui/assets/providers/cursor.svg +5 -0
  1218. package/dist/ui/assets/providers/gitlab.svg +22 -0
  1219. package/dist/ui/assets/providers/kilo.png +0 -0
  1220. package/dist/ui/assets/proxy-Br5aAkn0.js +9 -0
  1221. package/dist/ui/assets/proxy-status-widget-703_vH2t.js +1 -0
  1222. package/dist/ui/assets/radix-ui-DvRtHWGI.js +51 -0
  1223. package/dist/ui/assets/raw-json-settings-editor-panel-DWTJY3og.js +1 -0
  1224. package/dist/ui/assets/react-vendor-Bjx91N7w.js +3 -0
  1225. package/dist/ui/assets/searchable-select-C8BA2Q6i.js +1 -0
  1226. package/dist/ui/assets/separator-avUMnKG4.js +1 -0
  1227. package/dist/ui/assets/shared-DsOKYLqq.js +8 -0
  1228. package/dist/ui/assets/table-C6r_OOul.js +1 -0
  1229. package/dist/ui/assets/tanstack-Dg84L5cM.js +4 -0
  1230. package/dist/ui/assets/updates-K6jy3VXq.js +1 -0
  1231. package/dist/ui/assets/use-accounts-ZouK2A2J.js +1 -0
  1232. package/dist/ui/index.html +9 -9
  1233. package/dist/utils/browser/browser-policy.d.ts +22 -0
  1234. package/dist/utils/browser/browser-policy.d.ts.map +1 -0
  1235. package/dist/utils/browser/browser-policy.js +65 -0
  1236. package/dist/utils/browser/browser-policy.js.map +1 -0
  1237. package/dist/utils/browser/browser-settings.d.ts +52 -0
  1238. package/dist/utils/browser/browser-settings.d.ts.map +1 -0
  1239. package/dist/utils/browser/browser-settings.js +257 -0
  1240. package/dist/utils/browser/browser-settings.js.map +1 -0
  1241. package/dist/utils/browser/browser-setup.d.ts +21 -0
  1242. package/dist/utils/browser/browser-setup.d.ts.map +1 -0
  1243. package/dist/utils/browser/browser-setup.js +68 -0
  1244. package/dist/utils/browser/browser-setup.js.map +1 -0
  1245. package/dist/utils/browser/browser-status.d.ts +42 -0
  1246. package/dist/utils/browser/browser-status.d.ts.map +1 -0
  1247. package/dist/utils/browser/browser-status.js +251 -0
  1248. package/dist/utils/browser/browser-status.js.map +1 -0
  1249. package/dist/utils/browser/chrome-reuse.d.ts +18 -0
  1250. package/dist/utils/browser/chrome-reuse.d.ts.map +1 -0
  1251. package/dist/utils/browser/chrome-reuse.js +194 -0
  1252. package/dist/utils/browser/chrome-reuse.js.map +1 -0
  1253. package/dist/utils/browser/claude-tool-args.d.ts +2 -0
  1254. package/dist/utils/browser/claude-tool-args.d.ts.map +1 -0
  1255. package/dist/utils/browser/claude-tool-args.js +22 -0
  1256. package/dist/utils/browser/claude-tool-args.js.map +1 -0
  1257. package/dist/utils/browser/index.d.ts +16 -0
  1258. package/dist/utils/browser/index.d.ts.map +1 -0
  1259. package/dist/utils/browser/index.js +45 -0
  1260. package/dist/utils/browser/index.js.map +1 -0
  1261. package/dist/utils/browser/mcp-installer.d.ts +14 -0
  1262. package/dist/utils/browser/mcp-installer.d.ts.map +1 -0
  1263. package/dist/utils/browser/mcp-installer.js +356 -0
  1264. package/dist/utils/browser/mcp-installer.js.map +1 -0
  1265. package/dist/utils/browser/platform.d.ts +4 -0
  1266. package/dist/utils/browser/platform.d.ts.map +1 -0
  1267. package/dist/utils/browser/platform.js +12 -0
  1268. package/dist/utils/browser/platform.js.map +1 -0
  1269. package/dist/utils/browser-codex-overrides.d.ts +3 -0
  1270. package/dist/utils/browser-codex-overrides.d.ts.map +1 -0
  1271. package/dist/utils/browser-codex-overrides.js +29 -0
  1272. package/dist/utils/browser-codex-overrides.js.map +1 -0
  1273. package/dist/utils/claude-detector.d.ts +1 -0
  1274. package/dist/utils/claude-detector.d.ts.map +1 -1
  1275. package/dist/utils/claude-detector.js +2 -1
  1276. package/dist/utils/claude-detector.js.map +1 -1
  1277. package/dist/utils/claude-spawner.d.ts +1 -0
  1278. package/dist/utils/claude-spawner.d.ts.map +1 -1
  1279. package/dist/utils/claude-spawner.js +1 -1
  1280. package/dist/utils/claude-spawner.js.map +1 -1
  1281. package/dist/utils/claude-subcommand-detector.d.ts +45 -0
  1282. package/dist/utils/claude-subcommand-detector.d.ts.map +1 -0
  1283. package/dist/utils/claude-subcommand-detector.js +179 -0
  1284. package/dist/utils/claude-subcommand-detector.js.map +1 -0
  1285. package/dist/utils/claude-tool-args.d.ts +7 -0
  1286. package/dist/utils/claude-tool-args.d.ts.map +1 -0
  1287. package/dist/utils/claude-tool-args.js +43 -0
  1288. package/dist/utils/claude-tool-args.js.map +1 -0
  1289. package/dist/utils/config-manager.d.ts +5 -0
  1290. package/dist/utils/config-manager.d.ts.map +1 -1
  1291. package/dist/utils/config-manager.js +16 -3
  1292. package/dist/utils/config-manager.js.map +1 -1
  1293. package/dist/utils/hooks/get-image-analysis-hook-env.d.ts +1 -1
  1294. package/dist/utils/hooks/get-image-analysis-hook-env.d.ts.map +1 -1
  1295. package/dist/utils/hooks/get-image-analysis-hook-env.js +11 -7
  1296. package/dist/utils/hooks/get-image-analysis-hook-env.js.map +1 -1
  1297. package/dist/utils/hooks/image-analysis-backend-resolver.js +2 -2
  1298. package/dist/utils/hooks/image-analysis-backend-resolver.js.map +1 -1
  1299. package/dist/utils/hooks/image-analysis-runtime-status.d.ts +4 -4
  1300. package/dist/utils/hooks/image-analysis-runtime-status.d.ts.map +1 -1
  1301. package/dist/utils/hooks/image-analysis-runtime-status.js +15 -11
  1302. package/dist/utils/hooks/image-analysis-runtime-status.js.map +1 -1
  1303. package/dist/utils/hooks/image-analyzer-hook-configuration.d.ts.map +1 -1
  1304. package/dist/utils/hooks/image-analyzer-hook-configuration.js +2 -2
  1305. package/dist/utils/hooks/image-analyzer-hook-configuration.js.map +1 -1
  1306. package/dist/utils/hooks/image-analyzer-hook-installer.d.ts.map +1 -1
  1307. package/dist/utils/hooks/image-analyzer-hook-installer.js +2 -2
  1308. package/dist/utils/hooks/image-analyzer-hook-installer.js.map +1 -1
  1309. package/dist/utils/hooks/image-analyzer-hook-utils.d.ts +21 -0
  1310. package/dist/utils/hooks/image-analyzer-hook-utils.d.ts.map +1 -0
  1311. package/dist/utils/hooks/image-analyzer-hook-utils.js +81 -0
  1312. package/dist/utils/hooks/image-analyzer-hook-utils.js.map +1 -0
  1313. package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts +1 -0
  1314. package/dist/utils/hooks/image-analyzer-profile-hook-injector.d.ts.map +1 -1
  1315. package/dist/utils/hooks/image-analyzer-profile-hook-injector.js +35 -14
  1316. package/dist/utils/hooks/image-analyzer-profile-hook-injector.js.map +1 -1
  1317. package/dist/utils/hooks/index.d.ts +1 -0
  1318. package/dist/utils/hooks/index.d.ts.map +1 -1
  1319. package/dist/utils/hooks/index.js +3 -1
  1320. package/dist/utils/hooks/index.js.map +1 -1
  1321. package/dist/utils/image-analysis/claude-tool-args.d.ts +3 -0
  1322. package/dist/utils/image-analysis/claude-tool-args.d.ts.map +1 -1
  1323. package/dist/utils/image-analysis/claude-tool-args.js +25 -47
  1324. package/dist/utils/image-analysis/claude-tool-args.js.map +1 -1
  1325. package/dist/utils/image-analysis/index.d.ts +1 -0
  1326. package/dist/utils/image-analysis/index.d.ts.map +1 -1
  1327. package/dist/utils/image-analysis/index.js +6 -1
  1328. package/dist/utils/image-analysis/index.js.map +1 -1
  1329. package/dist/utils/image-analysis/mcp-installer.d.ts.map +1 -1
  1330. package/dist/utils/image-analysis/mcp-installer.js +5 -5
  1331. package/dist/utils/image-analysis/mcp-installer.js.map +1 -1
  1332. package/dist/utils/image-analysis/repair.d.ts +12 -0
  1333. package/dist/utils/image-analysis/repair.d.ts.map +1 -0
  1334. package/dist/utils/image-analysis/repair.js +105 -0
  1335. package/dist/utils/image-analysis/repair.js.map +1 -0
  1336. package/dist/utils/openai-compat-launch-settings.d.ts +7 -0
  1337. package/dist/utils/openai-compat-launch-settings.d.ts.map +1 -0
  1338. package/dist/utils/openai-compat-launch-settings.js +61 -0
  1339. package/dist/utils/openai-compat-launch-settings.js.map +1 -0
  1340. package/dist/utils/package-manager-detector.d.ts +31 -4
  1341. package/dist/utils/package-manager-detector.d.ts.map +1 -1
  1342. package/dist/utils/package-manager-detector.js +249 -60
  1343. package/dist/utils/package-manager-detector.js.map +1 -1
  1344. package/dist/utils/prompt-injection-strategy.d.ts +54 -0
  1345. package/dist/utils/prompt-injection-strategy.d.ts.map +1 -0
  1346. package/dist/utils/prompt-injection-strategy.js +128 -0
  1347. package/dist/utils/prompt-injection-strategy.js.map +1 -0
  1348. package/dist/utils/retry-strategy.d.ts +37 -0
  1349. package/dist/utils/retry-strategy.d.ts.map +1 -0
  1350. package/dist/utils/retry-strategy.js +99 -0
  1351. package/dist/utils/retry-strategy.js.map +1 -0
  1352. package/dist/utils/shell-executor.d.ts +32 -1
  1353. package/dist/utils/shell-executor.d.ts.map +1 -1
  1354. package/dist/utils/shell-executor.js +193 -30
  1355. package/dist/utils/shell-executor.js.map +1 -1
  1356. package/dist/utils/update-checker.d.ts +1 -1
  1357. package/dist/utils/update-checker.d.ts.map +1 -1
  1358. package/dist/utils/websearch/claude-tool-args.d.ts +7 -0
  1359. package/dist/utils/websearch/claude-tool-args.d.ts.map +1 -1
  1360. package/dist/utils/websearch/claude-tool-args.js +32 -50
  1361. package/dist/utils/websearch/claude-tool-args.js.map +1 -1
  1362. package/dist/utils/websearch/hook-config.d.ts.map +1 -1
  1363. package/dist/utils/websearch/hook-config.js +3 -3
  1364. package/dist/utils/websearch/hook-config.js.map +1 -1
  1365. package/dist/utils/websearch/hook-env.d.ts.map +1 -1
  1366. package/dist/utils/websearch/hook-env.js +21 -3
  1367. package/dist/utils/websearch/hook-env.js.map +1 -1
  1368. package/dist/utils/websearch/hook-installer.d.ts.map +1 -1
  1369. package/dist/utils/websearch/hook-installer.js +2 -2
  1370. package/dist/utils/websearch/hook-installer.js.map +1 -1
  1371. package/dist/utils/websearch/mcp-installer.d.ts.map +1 -1
  1372. package/dist/utils/websearch/mcp-installer.js +5 -5
  1373. package/dist/utils/websearch/mcp-installer.js.map +1 -1
  1374. package/dist/utils/websearch/profile-hook-injector.d.ts.map +1 -1
  1375. package/dist/utils/websearch/profile-hook-injector.js +3 -3
  1376. package/dist/utils/websearch/profile-hook-injector.js.map +1 -1
  1377. package/dist/utils/websearch/provider-secrets.js +2 -2
  1378. package/dist/utils/websearch/provider-secrets.js.map +1 -1
  1379. package/dist/utils/websearch/status.d.ts +1 -1
  1380. package/dist/utils/websearch/status.d.ts.map +1 -1
  1381. package/dist/utils/websearch/status.js +37 -16
  1382. package/dist/utils/websearch/status.js.map +1 -1
  1383. package/dist/utils/websearch/trace.d.ts +1 -0
  1384. package/dist/utils/websearch/trace.d.ts.map +1 -1
  1385. package/dist/utils/websearch/trace.js +27 -5
  1386. package/dist/utils/websearch/trace.js.map +1 -1
  1387. package/dist/utils/websearch/types.d.ts +12 -2
  1388. package/dist/utils/websearch/types.d.ts.map +1 -1
  1389. package/dist/utils/websearch/types.js +38 -0
  1390. package/dist/utils/websearch/types.js.map +1 -1
  1391. package/dist/web-server/file-watcher.js +2 -2
  1392. package/dist/web-server/file-watcher.js.map +1 -1
  1393. package/dist/web-server/health/cliproxy-checks.js +2 -2
  1394. package/dist/web-server/health/cliproxy-checks.js.map +1 -1
  1395. package/dist/web-server/health/config-checks.d.ts.map +1 -1
  1396. package/dist/web-server/health/config-checks.js +3 -3
  1397. package/dist/web-server/health/config-checks.js.map +1 -1
  1398. package/dist/web-server/health/profile-checks.d.ts.map +1 -1
  1399. package/dist/web-server/health/profile-checks.js +5 -6
  1400. package/dist/web-server/health/profile-checks.js.map +1 -1
  1401. package/dist/web-server/health/symlink-checks.d.ts.map +1 -1
  1402. package/dist/web-server/health/symlink-checks.js +2 -3
  1403. package/dist/web-server/health/symlink-checks.js.map +1 -1
  1404. package/dist/web-server/health/websearch-checks.js +1 -1
  1405. package/dist/web-server/health/websearch-checks.js.map +1 -1
  1406. package/dist/web-server/health-service.d.ts.map +1 -1
  1407. package/dist/web-server/health-service.js +7 -6
  1408. package/dist/web-server/health-service.js.map +1 -1
  1409. package/dist/web-server/index.d.ts.map +1 -1
  1410. package/dist/web-server/index.js +102 -18
  1411. package/dist/web-server/index.js.map +1 -1
  1412. package/dist/web-server/jsonl-parser.d.ts.map +1 -1
  1413. package/dist/web-server/jsonl-parser.js +22 -4
  1414. package/dist/web-server/jsonl-parser.js.map +1 -1
  1415. package/dist/web-server/middleware/auth-middleware.d.ts +7 -3
  1416. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  1417. package/dist/web-server/middleware/auth-middleware.js +103 -8
  1418. package/dist/web-server/middleware/auth-middleware.js.map +1 -1
  1419. package/dist/web-server/middleware/request-logging-middleware.d.ts +3 -0
  1420. package/dist/web-server/middleware/request-logging-middleware.d.ts.map +1 -0
  1421. package/dist/web-server/middleware/request-logging-middleware.js +30 -0
  1422. package/dist/web-server/middleware/request-logging-middleware.js.map +1 -0
  1423. package/dist/web-server/model-pricing.d.ts +8 -6
  1424. package/dist/web-server/model-pricing.d.ts.map +1 -1
  1425. package/dist/web-server/model-pricing.js +184 -54
  1426. package/dist/web-server/model-pricing.js.map +1 -1
  1427. package/dist/web-server/models-dev/pricing-resolver.d.ts +18 -0
  1428. package/dist/web-server/models-dev/pricing-resolver.d.ts.map +1 -0
  1429. package/dist/web-server/models-dev/pricing-resolver.js +160 -0
  1430. package/dist/web-server/models-dev/pricing-resolver.js.map +1 -0
  1431. package/dist/web-server/models-dev/registry-cache.d.ts +19 -0
  1432. package/dist/web-server/models-dev/registry-cache.d.ts.map +1 -0
  1433. package/dist/web-server/models-dev/registry-cache.js +165 -0
  1434. package/dist/web-server/models-dev/registry-cache.js.map +1 -0
  1435. package/dist/web-server/models-dev/types.d.ts +39 -0
  1436. package/dist/web-server/models-dev/types.d.ts.map +1 -0
  1437. package/dist/web-server/models-dev/types.js +3 -0
  1438. package/dist/web-server/models-dev/types.js.map +1 -0
  1439. package/dist/web-server/overview-routes.d.ts.map +1 -1
  1440. package/dist/web-server/overview-routes.js +3 -3
  1441. package/dist/web-server/overview-routes.js.map +1 -1
  1442. package/dist/web-server/routes/account-route-helpers.d.ts +3 -0
  1443. package/dist/web-server/routes/account-route-helpers.d.ts.map +1 -1
  1444. package/dist/web-server/routes/account-route-helpers.js.map +1 -1
  1445. package/dist/web-server/routes/account-routes.d.ts.map +1 -1
  1446. package/dist/web-server/routes/account-routes.js +105 -12
  1447. package/dist/web-server/routes/account-routes.js.map +1 -1
  1448. package/dist/web-server/routes/auth-routes.d.ts +10 -0
  1449. package/dist/web-server/routes/auth-routes.d.ts.map +1 -1
  1450. package/dist/web-server/routes/auth-routes.js +37 -10
  1451. package/dist/web-server/routes/auth-routes.js.map +1 -1
  1452. package/dist/web-server/routes/browser-routes.d.ts +3 -0
  1453. package/dist/web-server/routes/browser-routes.d.ts.map +1 -0
  1454. package/dist/web-server/routes/browser-routes.js +182 -0
  1455. package/dist/web-server/routes/browser-routes.js.map +1 -0
  1456. package/dist/web-server/routes/catalog-routes.d.ts.map +1 -1
  1457. package/dist/web-server/routes/catalog-routes.js +9 -8
  1458. package/dist/web-server/routes/catalog-routes.js.map +1 -1
  1459. package/dist/web-server/routes/channels-routes.d.ts.map +1 -1
  1460. package/dist/web-server/routes/channels-routes.js +4 -4
  1461. package/dist/web-server/routes/channels-routes.js.map +1 -1
  1462. package/dist/web-server/routes/claude-extension-routes.d.ts.map +1 -1
  1463. package/dist/web-server/routes/claude-extension-routes.js +5 -0
  1464. package/dist/web-server/routes/claude-extension-routes.js.map +1 -1
  1465. package/dist/web-server/routes/cliproxy-auth-routes.d.ts +8 -0
  1466. package/dist/web-server/routes/cliproxy-auth-routes.d.ts.map +1 -1
  1467. package/dist/web-server/routes/cliproxy-auth-routes.js +281 -89
  1468. package/dist/web-server/routes/cliproxy-auth-routes.js.map +1 -1
  1469. package/dist/web-server/routes/cliproxy-local-proxy.d.ts.map +1 -1
  1470. package/dist/web-server/routes/cliproxy-local-proxy.js +27 -17
  1471. package/dist/web-server/routes/cliproxy-local-proxy.js.map +1 -1
  1472. package/dist/web-server/routes/cliproxy-routing-routes.d.ts +3 -0
  1473. package/dist/web-server/routes/cliproxy-routing-routes.d.ts.map +1 -0
  1474. package/dist/web-server/routes/cliproxy-routing-routes.js +69 -0
  1475. package/dist/web-server/routes/cliproxy-routing-routes.js.map +1 -0
  1476. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +35 -0
  1477. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  1478. package/dist/web-server/routes/cliproxy-stats-routes.js +86 -42
  1479. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  1480. package/dist/web-server/routes/cliproxy-sync-routes.d.ts.map +1 -1
  1481. package/dist/web-server/routes/cliproxy-sync-routes.js +2 -2
  1482. package/dist/web-server/routes/cliproxy-sync-routes.js.map +1 -1
  1483. package/dist/web-server/routes/codex-routes.d.ts.map +1 -1
  1484. package/dist/web-server/routes/codex-routes.js +7 -0
  1485. package/dist/web-server/routes/codex-routes.js.map +1 -1
  1486. package/dist/web-server/routes/config-routes.d.ts.map +1 -1
  1487. package/dist/web-server/routes/config-routes.js +9 -6
  1488. package/dist/web-server/routes/config-routes.js.map +1 -1
  1489. package/dist/web-server/routes/copilot-routes.d.ts.map +1 -1
  1490. package/dist/web-server/routes/copilot-routes.js +3 -3
  1491. package/dist/web-server/routes/copilot-routes.js.map +1 -1
  1492. package/dist/web-server/routes/copilot-settings-routes.d.ts.map +1 -1
  1493. package/dist/web-server/routes/copilot-settings-routes.js +6 -7
  1494. package/dist/web-server/routes/copilot-settings-routes.js.map +1 -1
  1495. package/dist/web-server/routes/cursor-routes.d.ts +2 -0
  1496. package/dist/web-server/routes/cursor-routes.d.ts.map +1 -1
  1497. package/dist/web-server/routes/cursor-routes.js +48 -6
  1498. package/dist/web-server/routes/cursor-routes.js.map +1 -1
  1499. package/dist/web-server/routes/cursor-settings-routes.d.ts.map +1 -1
  1500. package/dist/web-server/routes/cursor-settings-routes.js +8 -9
  1501. package/dist/web-server/routes/cursor-settings-routes.js.map +1 -1
  1502. package/dist/web-server/routes/image-analysis-routes.d.ts.map +1 -1
  1503. package/dist/web-server/routes/image-analysis-routes.js +7 -17
  1504. package/dist/web-server/routes/image-analysis-routes.js.map +1 -1
  1505. package/dist/web-server/routes/index.d.ts.map +1 -1
  1506. package/dist/web-server/routes/index.js +25 -0
  1507. package/dist/web-server/routes/index.js.map +1 -1
  1508. package/dist/web-server/routes/logs-routes.d.ts +3 -0
  1509. package/dist/web-server/routes/logs-routes.d.ts.map +1 -0
  1510. package/dist/web-server/routes/logs-routes.js +75 -0
  1511. package/dist/web-server/routes/logs-routes.js.map +1 -0
  1512. package/dist/web-server/routes/misc-routes.d.ts.map +1 -1
  1513. package/dist/web-server/routes/misc-routes.js +10 -11
  1514. package/dist/web-server/routes/misc-routes.js.map +1 -1
  1515. package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
  1516. package/dist/web-server/routes/profile-routes.js +21 -3
  1517. package/dist/web-server/routes/profile-routes.js.map +1 -1
  1518. package/dist/web-server/routes/provider-routes.js +1 -1
  1519. package/dist/web-server/routes/provider-routes.js.map +1 -1
  1520. package/dist/web-server/routes/proxy-routes.d.ts.map +1 -1
  1521. package/dist/web-server/routes/proxy-routes.js +42 -12
  1522. package/dist/web-server/routes/proxy-routes.js.map +1 -1
  1523. package/dist/web-server/routes/route-helpers.d.ts +1 -0
  1524. package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
  1525. package/dist/web-server/routes/route-helpers.js +19 -7
  1526. package/dist/web-server/routes/route-helpers.js.map +1 -1
  1527. package/dist/web-server/routes/settings-routes.d.ts.map +1 -1
  1528. package/dist/web-server/routes/settings-routes.js +110 -23
  1529. package/dist/web-server/routes/settings-routes.js.map +1 -1
  1530. package/dist/web-server/routes/variant-routes.js +1 -1
  1531. package/dist/web-server/routes/variant-routes.js.map +1 -1
  1532. package/dist/web-server/routes/websearch-routes.d.ts.map +1 -1
  1533. package/dist/web-server/routes/websearch-routes.js +41 -4
  1534. package/dist/web-server/routes/websearch-routes.js.map +1 -1
  1535. package/dist/web-server/services/claude-extension-binding-service.js +2 -2
  1536. package/dist/web-server/services/claude-extension-binding-service.js.map +1 -1
  1537. package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts.map +1 -1
  1538. package/dist/web-server/services/cliproxy-dashboard-install-service.js +22 -6
  1539. package/dist/web-server/services/cliproxy-dashboard-install-service.js.map +1 -1
  1540. package/dist/web-server/services/codex-dashboard-service.d.ts +1 -0
  1541. package/dist/web-server/services/codex-dashboard-service.d.ts.map +1 -1
  1542. package/dist/web-server/services/compatible-cli-docs-registry.d.ts.map +1 -1
  1543. package/dist/web-server/services/compatible-cli-docs-registry.js +1 -0
  1544. package/dist/web-server/services/compatible-cli-docs-registry.js.map +1 -1
  1545. package/dist/web-server/services/droid-dashboard-service.d.ts +1 -0
  1546. package/dist/web-server/services/droid-dashboard-service.d.ts.map +1 -1
  1547. package/dist/web-server/services/logs-dashboard-service.d.ts +7 -0
  1548. package/dist/web-server/services/logs-dashboard-service.d.ts.map +1 -0
  1549. package/dist/web-server/services/logs-dashboard-service.js +33 -0
  1550. package/dist/web-server/services/logs-dashboard-service.js.map +1 -0
  1551. package/dist/web-server/shared-routes-collections.d.ts +13 -0
  1552. package/dist/web-server/shared-routes-collections.d.ts.map +1 -0
  1553. package/dist/web-server/shared-routes-collections.js +170 -0
  1554. package/dist/web-server/shared-routes-collections.js.map +1 -0
  1555. package/dist/web-server/shared-routes-content.d.ts +16 -0
  1556. package/dist/web-server/shared-routes-content.d.ts.map +1 -0
  1557. package/dist/web-server/shared-routes-content.js +152 -0
  1558. package/dist/web-server/shared-routes-content.js.map +1 -0
  1559. package/dist/web-server/shared-routes-markdown-walker.d.ts +12 -0
  1560. package/dist/web-server/shared-routes-markdown-walker.d.ts.map +1 -0
  1561. package/dist/web-server/shared-routes-markdown-walker.js +97 -0
  1562. package/dist/web-server/shared-routes-markdown-walker.js.map +1 -0
  1563. package/dist/web-server/shared-routes-markdown.d.ts +18 -0
  1564. package/dist/web-server/shared-routes-markdown.d.ts.map +1 -0
  1565. package/dist/web-server/shared-routes-markdown.js +167 -0
  1566. package/dist/web-server/shared-routes-markdown.js.map +1 -0
  1567. package/dist/web-server/shared-routes-path-guards.d.ts +16 -0
  1568. package/dist/web-server/shared-routes-path-guards.d.ts.map +1 -0
  1569. package/dist/web-server/shared-routes-path-guards.js +93 -0
  1570. package/dist/web-server/shared-routes-path-guards.js.map +1 -0
  1571. package/dist/web-server/shared-routes-plugin-registry-content.d.ts +12 -0
  1572. package/dist/web-server/shared-routes-plugin-registry-content.d.ts.map +1 -0
  1573. package/dist/web-server/shared-routes-plugin-registry-content.js +93 -0
  1574. package/dist/web-server/shared-routes-plugin-registry-content.js.map +1 -0
  1575. package/dist/web-server/shared-routes-plugins.d.ts +21 -0
  1576. package/dist/web-server/shared-routes-plugins.d.ts.map +1 -0
  1577. package/dist/web-server/shared-routes-plugins.js +197 -0
  1578. package/dist/web-server/shared-routes-plugins.js.map +1 -0
  1579. package/dist/web-server/shared-routes-symlink-status.d.ts +27 -0
  1580. package/dist/web-server/shared-routes-symlink-status.d.ts.map +1 -0
  1581. package/dist/web-server/shared-routes-symlink-status.js +135 -0
  1582. package/dist/web-server/shared-routes-symlink-status.js.map +1 -0
  1583. package/dist/web-server/shared-routes-types.d.ts +23 -0
  1584. package/dist/web-server/shared-routes-types.d.ts.map +1 -0
  1585. package/dist/web-server/shared-routes-types.js +15 -0
  1586. package/dist/web-server/shared-routes-types.js.map +1 -0
  1587. package/dist/web-server/shared-routes.d.ts +2 -1
  1588. package/dist/web-server/shared-routes.d.ts.map +1 -1
  1589. package/dist/web-server/shared-routes.js +50 -456
  1590. package/dist/web-server/shared-routes.js.map +1 -1
  1591. package/dist/web-server/usage/aggregator.d.ts +14 -7
  1592. package/dist/web-server/usage/aggregator.d.ts.map +1 -1
  1593. package/dist/web-server/usage/aggregator.js +164 -55
  1594. package/dist/web-server/usage/aggregator.js.map +1 -1
  1595. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +1 -16
  1596. package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -1
  1597. package/dist/web-server/usage/cliproxy-usage-syncer.js +186 -61
  1598. package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -1
  1599. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +22 -7
  1600. package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
  1601. package/dist/web-server/usage/cliproxy-usage-transformer.js +278 -28
  1602. package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
  1603. package/dist/web-server/usage/codex-native-usage-collector.d.ts +13 -0
  1604. package/dist/web-server/usage/codex-native-usage-collector.d.ts.map +1 -0
  1605. package/dist/web-server/usage/codex-native-usage-collector.js +291 -0
  1606. package/dist/web-server/usage/codex-native-usage-collector.js.map +1 -0
  1607. package/dist/web-server/usage/data-aggregator.d.ts.map +1 -1
  1608. package/dist/web-server/usage/data-aggregator.js +45 -46
  1609. package/dist/web-server/usage/data-aggregator.js.map +1 -1
  1610. package/dist/web-server/usage/disk-cache.js +2 -2
  1611. package/dist/web-server/usage/disk-cache.js.map +1 -1
  1612. package/dist/web-server/usage/droid-native-usage-collector.d.ts +14 -0
  1613. package/dist/web-server/usage/droid-native-usage-collector.d.ts.map +1 -0
  1614. package/dist/web-server/usage/droid-native-usage-collector.js +201 -0
  1615. package/dist/web-server/usage/droid-native-usage-collector.js.map +1 -0
  1616. package/dist/web-server/usage/handlers.d.ts +11 -8
  1617. package/dist/web-server/usage/handlers.d.ts.map +1 -1
  1618. package/dist/web-server/usage/handlers.js +197 -74
  1619. package/dist/web-server/usage/handlers.js.map +1 -1
  1620. package/dist/web-server/usage/model-identity.d.ts +16 -0
  1621. package/dist/web-server/usage/model-identity.d.ts.map +1 -0
  1622. package/dist/web-server/usage/model-identity.js +70 -0
  1623. package/dist/web-server/usage/model-identity.js.map +1 -0
  1624. package/dist/web-server/usage/profile-filter.d.ts +13 -0
  1625. package/dist/web-server/usage/profile-filter.d.ts.map +1 -0
  1626. package/dist/web-server/usage/profile-filter.js +35 -0
  1627. package/dist/web-server/usage/profile-filter.js.map +1 -0
  1628. package/dist/web-server/usage/routes.d.ts.map +1 -1
  1629. package/dist/web-server/usage/routes.js +19 -6
  1630. package/dist/web-server/usage/routes.js.map +1 -1
  1631. package/dist/web-server/usage/sqlite-cli.d.ts +27 -0
  1632. package/dist/web-server/usage/sqlite-cli.d.ts.map +1 -0
  1633. package/dist/web-server/usage/sqlite-cli.js +186 -0
  1634. package/dist/web-server/usage/sqlite-cli.js.map +1 -0
  1635. package/dist/web-server/usage/types.d.ts +14 -0
  1636. package/dist/web-server/usage/types.d.ts.map +1 -1
  1637. package/dist/web-server/websocket.d.ts.map +1 -1
  1638. package/dist/web-server/websocket.js +25 -16
  1639. package/dist/web-server/websocket.js.map +1 -1
  1640. package/lib/hooks/image-analyzer-transformer.cjs +54 -3
  1641. package/lib/hooks/websearch-transformer.cjs +136 -0
  1642. package/lib/mcp/ccs-browser-server.cjs +6769 -0
  1643. package/lib/mcp/ccs-websearch-server.cjs +1 -1
  1644. package/package.json +6 -6
  1645. package/scripts/ci-parity-gate.sh +22 -3
  1646. package/scripts/dev-release.sh +4 -2
  1647. package/scripts/ensure-deps.sh +18 -0
  1648. package/scripts/run-test-bucket.js +188 -0
  1649. package/scripts/verify-bundle.js +4 -1
  1650. package/dist/cliproxy/account-manager.d.ts +0 -16
  1651. package/dist/cliproxy/account-manager.d.ts.map +0 -1
  1652. package/dist/cliproxy/account-manager.js +0 -51
  1653. package/dist/cliproxy/account-manager.js.map +0 -1
  1654. package/dist/cliproxy/account-safety.d.ts +0 -92
  1655. package/dist/cliproxy/account-safety.d.ts.map +0 -1
  1656. package/dist/cliproxy/account-safety.js +0 -496
  1657. package/dist/cliproxy/account-safety.js.map +0 -1
  1658. package/dist/cliproxy/account-stats-key.d.ts.map +0 -1
  1659. package/dist/cliproxy/account-stats-key.js.map +0 -1
  1660. package/dist/cliproxy/antigravity-responsibility.d.ts.map +0 -1
  1661. package/dist/cliproxy/antigravity-responsibility.js +0 -171
  1662. package/dist/cliproxy/antigravity-responsibility.js.map +0 -1
  1663. package/dist/cliproxy/auth/gemini-token-refresh.d.ts +0 -40
  1664. package/dist/cliproxy/auth/gemini-token-refresh.d.ts.map +0 -1
  1665. package/dist/cliproxy/auth/gemini-token-refresh.js +0 -371
  1666. package/dist/cliproxy/auth/gemini-token-refresh.js.map +0 -1
  1667. package/dist/cliproxy/auth-handler.d.ts +0 -31
  1668. package/dist/cliproxy/auth-handler.d.ts.map +0 -1
  1669. package/dist/cliproxy/auth-handler.js +0 -60
  1670. package/dist/cliproxy/auth-handler.js.map +0 -1
  1671. package/dist/cliproxy/auth-session-manager.d.ts +0 -51
  1672. package/dist/cliproxy/auth-session-manager.d.ts.map +0 -1
  1673. package/dist/cliproxy/auth-session-manager.js +0 -134
  1674. package/dist/cliproxy/auth-session-manager.js.map +0 -1
  1675. package/dist/cliproxy/auth-token-manager.d.ts.map +0 -1
  1676. package/dist/cliproxy/auth-token-manager.js +0 -184
  1677. package/dist/cliproxy/auth-token-manager.js.map +0 -1
  1678. package/dist/cliproxy/auth-utils.d.ts +0 -16
  1679. package/dist/cliproxy/auth-utils.d.ts.map +0 -1
  1680. package/dist/cliproxy/auth-utils.js +0 -33
  1681. package/dist/cliproxy/auth-utils.js.map +0 -1
  1682. package/dist/cliproxy/base-config-loader.d.ts +0 -42
  1683. package/dist/cliproxy/base-config-loader.d.ts.map +0 -1
  1684. package/dist/cliproxy/base-config-loader.js +0 -123
  1685. package/dist/cliproxy/base-config-loader.js.map +0 -1
  1686. package/dist/cliproxy/catalog-cache.d.ts +0 -39
  1687. package/dist/cliproxy/catalog-cache.d.ts.map +0 -1
  1688. package/dist/cliproxy/catalog-cache.js +0 -254
  1689. package/dist/cliproxy/catalog-cache.js.map +0 -1
  1690. package/dist/cliproxy/cliproxy-executor.d.ts +0 -16
  1691. package/dist/cliproxy/cliproxy-executor.d.ts.map +0 -1
  1692. package/dist/cliproxy/cliproxy-executor.js +0 -27
  1693. package/dist/cliproxy/cliproxy-executor.js.map +0 -1
  1694. package/dist/cliproxy/codex-plan-compatibility.d.ts +0 -39
  1695. package/dist/cliproxy/codex-plan-compatibility.d.ts.map +0 -1
  1696. package/dist/cliproxy/codex-plan-compatibility.js +0 -134
  1697. package/dist/cliproxy/codex-plan-compatibility.js.map +0 -1
  1698. package/dist/cliproxy/codex-reasoning-proxy.d.ts +0 -61
  1699. package/dist/cliproxy/codex-reasoning-proxy.d.ts.map +0 -1
  1700. package/dist/cliproxy/codex-reasoning-proxy.js +0 -495
  1701. package/dist/cliproxy/codex-reasoning-proxy.js.map +0 -1
  1702. package/dist/cliproxy/composite-validator.d.ts.map +0 -1
  1703. package/dist/cliproxy/composite-validator.js +0 -94
  1704. package/dist/cliproxy/composite-validator.js.map +0 -1
  1705. package/dist/cliproxy/config-generator.d.ts +0 -15
  1706. package/dist/cliproxy/config-generator.d.ts.map +0 -1
  1707. package/dist/cliproxy/config-generator.js +0 -32
  1708. package/dist/cliproxy/config-generator.js.map +0 -1
  1709. package/dist/cliproxy/device-code-handler.d.ts.map +0 -1
  1710. package/dist/cliproxy/device-code-handler.js.map +0 -1
  1711. package/dist/cliproxy/gemini-cli-quota-normalizer.d.ts.map +0 -1
  1712. package/dist/cliproxy/gemini-cli-quota-normalizer.js +0 -122
  1713. package/dist/cliproxy/gemini-cli-quota-normalizer.js.map +0 -1
  1714. package/dist/cliproxy/https-tunnel-proxy.d.ts.map +0 -1
  1715. package/dist/cliproxy/https-tunnel-proxy.js +0 -224
  1716. package/dist/cliproxy/https-tunnel-proxy.js.map +0 -1
  1717. package/dist/cliproxy/management-api-client.d.ts +0 -81
  1718. package/dist/cliproxy/management-api-client.d.ts.map +0 -1
  1719. package/dist/cliproxy/management-api-client.js +0 -381
  1720. package/dist/cliproxy/management-api-client.js.map +0 -1
  1721. package/dist/cliproxy/management-api-types.d.ts.map +0 -1
  1722. package/dist/cliproxy/management-api-types.js.map +0 -1
  1723. package/dist/cliproxy/model-config.d.ts +0 -31
  1724. package/dist/cliproxy/model-config.d.ts.map +0 -1
  1725. package/dist/cliproxy/model-config.js +0 -271
  1726. package/dist/cliproxy/model-config.js.map +0 -1
  1727. package/dist/cliproxy/model-id-normalizer.d.ts +0 -105
  1728. package/dist/cliproxy/model-id-normalizer.d.ts.map +0 -1
  1729. package/dist/cliproxy/model-id-normalizer.js +0 -241
  1730. package/dist/cliproxy/model-id-normalizer.js.map +0 -1
  1731. package/dist/cliproxy/openai-compat-manager.d.ts.map +0 -1
  1732. package/dist/cliproxy/openai-compat-manager.js +0 -191
  1733. package/dist/cliproxy/openai-compat-manager.js.map +0 -1
  1734. package/dist/cliproxy/platform-detector.d.ts +0 -99
  1735. package/dist/cliproxy/platform-detector.d.ts.map +0 -1
  1736. package/dist/cliproxy/platform-detector.js +0 -174
  1737. package/dist/cliproxy/platform-detector.js.map +0 -1
  1738. package/dist/cliproxy/project-selection-handler.d.ts.map +0 -1
  1739. package/dist/cliproxy/project-selection-handler.js.map +0 -1
  1740. package/dist/cliproxy/proxy-config-resolver.d.ts +0 -87
  1741. package/dist/cliproxy/proxy-config-resolver.d.ts.map +0 -1
  1742. package/dist/cliproxy/proxy-config-resolver.js +0 -254
  1743. package/dist/cliproxy/proxy-config-resolver.js.map +0 -1
  1744. package/dist/cliproxy/proxy-detector.d.ts +0 -72
  1745. package/dist/cliproxy/proxy-detector.d.ts.map +0 -1
  1746. package/dist/cliproxy/proxy-detector.js +0 -196
  1747. package/dist/cliproxy/proxy-detector.js.map +0 -1
  1748. package/dist/cliproxy/proxy-target-resolver.d.ts.map +0 -1
  1749. package/dist/cliproxy/proxy-target-resolver.js +0 -108
  1750. package/dist/cliproxy/proxy-target-resolver.js.map +0 -1
  1751. package/dist/cliproxy/quota-fetcher-claude-normalizer.d.ts +0 -18
  1752. package/dist/cliproxy/quota-fetcher-claude-normalizer.d.ts.map +0 -1
  1753. package/dist/cliproxy/quota-fetcher-claude-normalizer.js +0 -291
  1754. package/dist/cliproxy/quota-fetcher-claude-normalizer.js.map +0 -1
  1755. package/dist/cliproxy/quota-fetcher-claude.d.ts +0 -21
  1756. package/dist/cliproxy/quota-fetcher-claude.d.ts.map +0 -1
  1757. package/dist/cliproxy/quota-fetcher-claude.js +0 -306
  1758. package/dist/cliproxy/quota-fetcher-claude.js.map +0 -1
  1759. package/dist/cliproxy/quota-fetcher-codex.d.ts +0 -69
  1760. package/dist/cliproxy/quota-fetcher-codex.d.ts.map +0 -1
  1761. package/dist/cliproxy/quota-fetcher-codex.js +0 -599
  1762. package/dist/cliproxy/quota-fetcher-codex.js.map +0 -1
  1763. package/dist/cliproxy/quota-fetcher-gemini-cli.d.ts.map +0 -1
  1764. package/dist/cliproxy/quota-fetcher-gemini-cli.js +0 -661
  1765. package/dist/cliproxy/quota-fetcher-gemini-cli.js.map +0 -1
  1766. package/dist/cliproxy/quota-fetcher-ghcp.d.ts.map +0 -1
  1767. package/dist/cliproxy/quota-fetcher-ghcp.js +0 -207
  1768. package/dist/cliproxy/quota-fetcher-ghcp.js.map +0 -1
  1769. package/dist/cliproxy/quota-fetcher.d.ts +0 -107
  1770. package/dist/cliproxy/quota-fetcher.d.ts.map +0 -1
  1771. package/dist/cliproxy/quota-fetcher.js +0 -657
  1772. package/dist/cliproxy/quota-fetcher.js.map +0 -1
  1773. package/dist/cliproxy/quota-manager.d.ts +0 -105
  1774. package/dist/cliproxy/quota-manager.d.ts.map +0 -1
  1775. package/dist/cliproxy/quota-manager.js +0 -485
  1776. package/dist/cliproxy/quota-manager.js.map +0 -1
  1777. package/dist/cliproxy/quota-response-cache.d.ts.map +0 -1
  1778. package/dist/cliproxy/quota-response-cache.js.map +0 -1
  1779. package/dist/cliproxy/quota-types.d.ts +0 -245
  1780. package/dist/cliproxy/quota-types.d.ts.map +0 -1
  1781. package/dist/cliproxy/quota-types.js.map +0 -1
  1782. package/dist/cliproxy/remote-auth-fetcher.d.ts +0 -30
  1783. package/dist/cliproxy/remote-auth-fetcher.d.ts.map +0 -1
  1784. package/dist/cliproxy/remote-auth-fetcher.js +0 -177
  1785. package/dist/cliproxy/remote-auth-fetcher.js.map +0 -1
  1786. package/dist/cliproxy/remote-proxy-client.d.ts.map +0 -1
  1787. package/dist/cliproxy/remote-proxy-client.js +0 -281
  1788. package/dist/cliproxy/remote-proxy-client.js.map +0 -1
  1789. package/dist/cliproxy/remote-token-uploader.d.ts.map +0 -1
  1790. package/dist/cliproxy/remote-token-uploader.js +0 -178
  1791. package/dist/cliproxy/remote-token-uploader.js.map +0 -1
  1792. package/dist/cliproxy/schema-sanitizer.d.ts.map +0 -1
  1793. package/dist/cliproxy/schema-sanitizer.js.map +0 -1
  1794. package/dist/cliproxy/startup-lock.d.ts.map +0 -1
  1795. package/dist/cliproxy/startup-lock.js +0 -216
  1796. package/dist/cliproxy/startup-lock.js.map +0 -1
  1797. package/dist/cliproxy/stats-fetcher.d.ts +0 -158
  1798. package/dist/cliproxy/stats-fetcher.d.ts.map +0 -1
  1799. package/dist/cliproxy/stats-fetcher.js +0 -246
  1800. package/dist/cliproxy/stats-fetcher.js.map +0 -1
  1801. package/dist/cliproxy/stats-transformer.d.ts.map +0 -1
  1802. package/dist/cliproxy/stats-transformer.js +0 -152
  1803. package/dist/cliproxy/stats-transformer.js.map +0 -1
  1804. package/dist/cliproxy/tool-name-mapper.d.ts +0 -103
  1805. package/dist/cliproxy/tool-name-mapper.d.ts.map +0 -1
  1806. package/dist/cliproxy/tool-name-mapper.js +0 -149
  1807. package/dist/cliproxy/tool-name-mapper.js.map +0 -1
  1808. package/dist/cliproxy/tool-name-sanitizer.d.ts +0 -65
  1809. package/dist/cliproxy/tool-name-sanitizer.d.ts.map +0 -1
  1810. package/dist/cliproxy/tool-name-sanitizer.js +0 -118
  1811. package/dist/cliproxy/tool-name-sanitizer.js.map +0 -1
  1812. package/dist/cliproxy/tool-sanitization-proxy.d.ts +0 -77
  1813. package/dist/cliproxy/tool-sanitization-proxy.d.ts.map +0 -1
  1814. package/dist/cliproxy/tool-sanitization-proxy.js +0 -643
  1815. package/dist/cliproxy/tool-sanitization-proxy.js.map +0 -1
  1816. package/dist/commands/cliproxy/resolve-lifecycle-port.d.ts +0 -9
  1817. package/dist/commands/cliproxy/resolve-lifecycle-port.d.ts.map +0 -1
  1818. package/dist/commands/cliproxy/resolve-lifecycle-port.js +0 -14
  1819. package/dist/commands/cliproxy/resolve-lifecycle-port.js.map +0 -1
  1820. package/dist/ui/assets/accounts-DhtktAIG.js +0 -1
  1821. package/dist/ui/assets/alert-dialog-DQK2Jxfk.js +0 -1
  1822. package/dist/ui/assets/api-Den1YY2d.js +0 -4
  1823. package/dist/ui/assets/auth-section-BQitOLMK.js +0 -1
  1824. package/dist/ui/assets/backups-section-BLGK5re-.js +0 -1
  1825. package/dist/ui/assets/channels-Dop1axTi.js +0 -1
  1826. package/dist/ui/assets/charts-BBPXh0Ar.js +0 -64
  1827. package/dist/ui/assets/checkbox-DDrDuGxi.js +0 -1
  1828. package/dist/ui/assets/claude-extension-6WjTc0o8.js +0 -1
  1829. package/dist/ui/assets/cliproxy-Ch7RdSMG.js +0 -3
  1830. package/dist/ui/assets/cliproxy-ai-providers-DjybBlb5.js +0 -21
  1831. package/dist/ui/assets/cliproxy-control-panel-DDif_QAT.js +0 -1
  1832. package/dist/ui/assets/code-highlight-BRUf_pqB.js +0 -3
  1833. package/dist/ui/assets/codex-DFAV50Ee.js +0 -27
  1834. package/dist/ui/assets/confirm-dialog-CP26_Zko.js +0 -1
  1835. package/dist/ui/assets/copilot-uZuyhqwv.js +0 -3
  1836. package/dist/ui/assets/cursor-CuaM2FmN.js +0 -1
  1837. package/dist/ui/assets/droid-DdjXJ2lF.js +0 -2
  1838. package/dist/ui/assets/form-utils-Bcoyqxpq.js +0 -20
  1839. package/dist/ui/assets/globalenv-section-D5_-EIlf.js +0 -1
  1840. package/dist/ui/assets/health-BHhVKLNR.js +0 -1
  1841. package/dist/ui/assets/icons-CQ3MLSan.js +0 -1
  1842. package/dist/ui/assets/index-B8bAYHAs.js +0 -1
  1843. package/dist/ui/assets/index-Ba-43jCS.js +0 -1
  1844. package/dist/ui/assets/index-Bb2CPQik.css +0 -1
  1845. package/dist/ui/assets/index-Bm09kGOw.js +0 -1
  1846. package/dist/ui/assets/index-DHY37v8a.js +0 -1
  1847. package/dist/ui/assets/index-DLCFe4s3.js +0 -1
  1848. package/dist/ui/assets/index-TSYtCr3K.js +0 -69
  1849. package/dist/ui/assets/masked-input-CTkIqCMg.js +0 -1
  1850. package/dist/ui/assets/notifications-B2HqRBj7.js +0 -1
  1851. package/dist/ui/assets/proxy-status-widget-DPhKjJFl.js +0 -1
  1852. package/dist/ui/assets/radix-ui-BlliRfHq.js +0 -51
  1853. package/dist/ui/assets/raw-json-settings-editor-panel-DQr_y0E4.js +0 -1
  1854. package/dist/ui/assets/react-vendor-CNOkPC89.js +0 -3
  1855. package/dist/ui/assets/searchable-select-C2sP7JW5.js +0 -1
  1856. package/dist/ui/assets/separator-2lt47Sla.js +0 -1
  1857. package/dist/ui/assets/shared-DPKtsiFQ.js +0 -8
  1858. package/dist/ui/assets/table-DbsFACgT.js +0 -1
  1859. package/dist/ui/assets/tanstack-BjiH4QZq.js +0 -4
  1860. package/dist/ui/assets/updates-C5iL4KNn.js +0 -1
  1861. package/scripts/github/build-ai-review-packet.mjs +0 -242
  1862. package/scripts/github/normalize-ai-review-output.mjs +0 -934
  1863. package/scripts/github/prepare-ai-review-scope.mjs +0 -324
  1864. package/scripts/github/run-ai-review-direct.mjs +0 -349
  1865. /package/dist/cliproxy/{account-stats-key.d.ts → accounts/account-stats-key.d.ts} +0 -0
  1866. /package/dist/cliproxy/{account-stats-key.js → accounts/account-stats-key.js} +0 -0
  1867. /package/dist/cliproxy/{openai-compat-manager.d.ts → ai-providers/openai-compat-manager.d.ts} +0 -0
  1868. /package/dist/cliproxy/{schema-sanitizer.d.ts → ai-providers/schema-sanitizer.d.ts} +0 -0
  1869. /package/dist/cliproxy/{schema-sanitizer.js → ai-providers/schema-sanitizer.js} +0 -0
  1870. /package/dist/cliproxy/{antigravity-responsibility.d.ts → auth/antigravity-responsibility.d.ts} +0 -0
  1871. /package/dist/cliproxy/{auth-token-manager.d.ts → auth/auth-token-manager.d.ts} +0 -0
  1872. /package/dist/cliproxy/{device-code-handler.d.ts → auth/device-code-handler.d.ts} +0 -0
  1873. /package/dist/cliproxy/{device-code-handler.js → auth/device-code-handler.js} +0 -0
  1874. /package/dist/cliproxy/{project-selection-handler.d.ts → auth/project-selection-handler.d.ts} +0 -0
  1875. /package/dist/cliproxy/{project-selection-handler.js → auth/project-selection-handler.js} +0 -0
  1876. /package/dist/cliproxy/{composite-validator.d.ts → config/composite-validator.d.ts} +0 -0
  1877. /package/dist/cliproxy/{management-api-types.d.ts → management/management-api-types.d.ts} +0 -0
  1878. /package/dist/cliproxy/{management-api-types.js → management/management-api-types.js} +0 -0
  1879. /package/dist/cliproxy/{remote-token-uploader.d.ts → management/remote-token-uploader.d.ts} +0 -0
  1880. /package/dist/cliproxy/{https-tunnel-proxy.d.ts → proxy/https-tunnel-proxy.d.ts} +0 -0
  1881. /package/dist/cliproxy/{proxy-target-resolver.d.ts → proxy/proxy-target-resolver.d.ts} +0 -0
  1882. /package/dist/cliproxy/{gemini-cli-quota-normalizer.d.ts → quota/gemini-cli-quota-normalizer.d.ts} +0 -0
  1883. /package/dist/cliproxy/{quota-fetcher-gemini-cli.d.ts → quota/quota-fetcher-gemini-cli.d.ts} +0 -0
  1884. /package/dist/cliproxy/{quota-fetcher-ghcp.d.ts → quota/quota-fetcher-ghcp.d.ts} +0 -0
  1885. /package/dist/cliproxy/{quota-response-cache.d.ts → quota/quota-response-cache.d.ts} +0 -0
  1886. /package/dist/cliproxy/{quota-response-cache.js → quota/quota-response-cache.js} +0 -0
  1887. /package/dist/cliproxy/{quota-types.js → quota/quota-types.js} +0 -0
  1888. /package/dist/cliproxy/{remote-proxy-client.d.ts → services/remote-proxy-client.d.ts} +0 -0
  1889. /package/dist/cliproxy/{startup-lock.d.ts → services/startup-lock.d.ts} +0 -0
  1890. /package/dist/cliproxy/{stats-transformer.d.ts → services/stats-transformer.d.ts} +0 -0
@@ -0,0 +1,30 @@
1
+ import{j as e}from"./radix-ui-DvRtHWGI.js";import{r as N}from"./react-vendor-Bjx91N7w.js";import{t as U}from"./notifications-B4_o8bcr.js";import{C as I,v as F,w as W,B as _,b as K,a as E,e as y,aH as J,o as P,p as D,q as O,r as L,s as b,I as S,E as fe,a0 as C,bf as se,bg as Pe,c as De,bm as He,bn as ve,bo as Qe,Y as Je,Z as Ze,_ as ae,$ as oe,bh as be}from"./index-7dfuc3Cf.js";import{a9 as es,aS as ss,aq as re,L as z,m as rs,aT as ts,aU as ns,aD as as,v as os,a6 as ls,aV as is,aW as cs,aX as ds,ah as me,o as we,_ as xs,l as us,n as ms,Y as ps,S as hs,aN as Ne,aY as fs,w as gs,D as js,T as vs,J as bs}from"./icons-bxdfpJdB.js";import{S as ee}from"./separator-avUMnKG4.js";import{a as ws,u as Ce,b as ye}from"./tanstack-Dg84L5cM.js";import{T as Ns,a as Cs,b as Se,c as le,d as ys,e as ie}from"./table-C6r_OOul.js";import{R as Ss}from"./raw-json-settings-editor-panel-DWTJY3og.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";function Z({title:s,icon:r,badge:t,description:l,disabledReason:o,children:n}){return e.jsxs(I,{children:[e.jsxs(F,{className:"pb-2",children:[e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[r,s,t?e.jsx(_,{variant:"outline",className:"text-[10px] font-normal",children:t}):null]}),l?e.jsx("p",{className:"text-xs text-muted-foreground",children:l}):null]}),e.jsxs(K,{className:"space-y-3",children:[o?e.jsx("p",{className:"text-xs text-amber-600",children:o}):null,n]})]})}function _s({catalog:s,state:r,disabled:t=!1,disabledReason:l,onToggle:o}){const{t:n}=E(),a=new Set(s.map(i=>i.name)),c=Object.entries(r).filter(([i])=>!a.has(i)).sort(([i],[d])=>i.localeCompare(d));return e.jsxs(Z,{title:n("codex.features"),badge:"features",icon:e.jsx(es,{className:"h-4 w-4"}),description:n("codex.featuresDesc"),disabledReason:l,children:[e.jsx("div",{className:"space-y-2",children:s.map(i=>{const d=r[i.name]??null;return e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i.label}),e.jsx(_,{variant:"outline",className:"font-mono text-[10px]",children:i.name})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i.description})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[d!==null?e.jsx(y,{variant:"outline",size:"sm",onClick:()=>o(i.name,null),disabled:t,children:n("codex.useDefault")}):null,e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i.name,m),disabled:t})]})]},i.name)})}),c.length>0?e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium uppercase tracking-wide text-muted-foreground",children:n("codex.configOnlyFlags")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n("codex.configOnlyFlagsDesc")})]}),c.map(([i,d])=>e.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-md border border-dashed px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("p",{className:"text-sm font-medium",children:i}),e.jsx(_,{variant:"secondary",className:"text-[10px]",children:n("codex.existing")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n(d===null?"codex.nonBooleanForm":"codex.discoveredFromFile")})]}),d===null?e.jsx(_,{variant:"outline",children:n("codex.rawOnly")}):e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"outline",size:"sm",onClick:()=>o(i,null),disabled:t,children:n("codex.useDefault")}),e.jsx(J,{checked:d===!0,onCheckedChange:m=>o(i,m),disabled:t})]})]},i))]}):null]})}const ks={name:"",transport:"stdio",command:null,args:[],url:null,enabled:!0,required:!1,startupTimeoutSec:null,toolTimeoutSec:null,enabledTools:[],disabledTools:[],isCcsManaged:!1,managementSurface:null};function ce(s){return s.join(", ")}function de(s){return s.split(",").map(r=>r.trim()).filter(Boolean)}function Ts({initialDraft:s,isNew:r,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(s),m=r&&i.name.trim()==="ccs_browser";return e.jsxs(e.Fragment,{children:[m?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:"ccs_browser"})," is reserved for the CCS-managed browser tooling path. Configure it from ",e.jsx("code",{children:"Settings > Browser"})," instead of creating it here."]}):null,e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:p=>d(x=>({...x,name:p.target.value})),placeholder:"playwright",disabled:t||!r}),e.jsxs(P,{value:i.transport,onValueChange:p=>d(x=>({...x,transport:p})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"stdio",children:c("codex.stdio")}),e.jsx(b,{value:"streamable-http",children:c("codex.streamableHttp")})]})]}),i.transport==="stdio"?e.jsxs(e.Fragment,{children:[e.jsx(S,{value:i.command??"",onChange:p=>d(x=>({...x,command:p.target.value||null})),placeholder:"npx",disabled:t}),e.jsx(S,{value:ce(i.args),onChange:p=>d(x=>({...x,args:de(p.target.value)})),placeholder:"@playwright/mcp@latest, --flag",disabled:t})]}):e.jsx(S,{className:"sm:col-span-2",value:i.url??"",onChange:p=>d(x=>({...x,url:p.target.value||null})),placeholder:"https://example.test/mcp",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.startupTimeoutSec??"",onChange:p=>d(x=>({...x,startupTimeoutSec:p.target.value?Number(p.target.value):null})),placeholder:"Startup timeout (sec)",disabled:t}),e.jsx(S,{type:"number",min:1,value:i.toolTimeoutSec??"",onChange:p=>d(x=>({...x,toolTimeoutSec:p.target.value?Number(p.target.value):null})),placeholder:"Tool timeout (sec)",disabled:t}),e.jsx(S,{value:ce(i.enabledTools),onChange:p=>d(x=>({...x,enabledTools:de(p.target.value)})),placeholder:"enabled_tools",disabled:t}),e.jsx(S,{value:ce(i.disabledTools),onChange:p=>d(x=>({...x,disabledTools:de(p.target.value)})),placeholder:"disabled_tools",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Enabled",e.jsx(J,{checked:i.enabled,onCheckedChange:p=>d(x=>({...x,enabled:p})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Required",e.jsx(J,{checked:i.required,onCheckedChange:p=>d(x=>({...x,required:p})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(y,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(y,{onClick:()=>n(i.name,{transport:i.transport,command:i.command,args:i.args,url:i.url,enabled:i.enabled,required:i.required,startupTimeoutSec:i.startupTimeoutSec,toolTimeoutSec:i.toolTimeoutSec,enabledTools:i.enabledTools,disabledTools:i.disabledTools}),disabled:t||l||i.name.trim().length===0||m,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save MCP server"]})]})]})}function Es({entries:s,disabled:r=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>s.find(j=>j.name===c)??null,[s,c]),m=d??ks,p=JSON.stringify(m),x=d?.isCcsManaged&&d.managementSurface==="browser-settings";return e.jsxs(Z,{title:"MCP servers",badge:"mcp_servers",icon:e.jsx(ss,{className:"h-4 w-4"}),description:"Manage the safe MCP transport fields. Keep auth headers and bearer tokens in raw TOML.",disabledReason:t,children:[x?e.jsxs("div",{className:"rounded-md border border-amber-500/30 bg-amber-500/10 px-3 py-2 text-sm text-amber-900 dark:text-amber-200",children:[e.jsx("strong",{children:d?.name})," is CCS-managed. Configure browser tooling from"," ",e.jsx("code",{children:"Settings > Browser"}),"; the generic MCP editor is read-only for this entry."]}):null,e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select MCP server"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewMcpServer")}),s.map(j=>e.jsx(b,{value:j.name,children:j.isCcsManaged?`${j.name} (CCS managed)`:j.name},j.name))]})]}),e.jsx(Ts,{initialDraft:m,isNew:c==="new",disabled:r||!!x,saving:l,canDelete:d!==null&&!x,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(j,h)=>{await o(j,h),i(j)}},p)]})}const Ps={name:"",displayName:null,baseUrl:null,envKey:null,wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1},Ds={name:"cliproxy",displayName:"CLIProxy Codex",baseUrl:"http://127.0.0.1:8317/api/provider/codex",envKey:"CLIPROXY_API_KEY",wireApi:"responses",requiresOpenaiAuth:!1,supportsWebsockets:!1};function Os({initialDraft:s,isNew:r,disabled:t,saving:l,canDelete:o,onSave:n,onDelete:a}){const{t:c}=E(),[i,d]=N.useState(s);return e.jsxs(e.Fragment,{children:[r&&e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-dashed px-3 py-2 text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Quick start: apply the CLIProxy Codex preset here, then set"," ",e.jsx("strong",{children:c("codex.defaultProvider")})," to ",e.jsx("code",{children:"cliproxy"})," in Top-level settings."]}),e.jsx(y,{variant:"outline",size:"sm",onClick:()=>d(Ds),disabled:t,children:"Use CLIProxy Codex preset"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:i.name,onChange:m=>d(p=>({...p,name:m.target.value})),placeholder:"Provider id",disabled:t||!r}),e.jsx(S,{value:i.displayName??"",onChange:m=>d(p=>({...p,displayName:m.target.value||null})),placeholder:"Display name",disabled:t}),e.jsx(S,{value:i.baseUrl??"",onChange:m=>d(p=>({...p,baseUrl:m.target.value||null})),placeholder:"http://127.0.0.1:8317/api/provider/codex",disabled:t}),e.jsx(S,{value:i.envKey??"",onChange:m=>d(p=>({...p,envKey:m.target.value||null})),placeholder:"CLIPROXY_API_KEY",disabled:t})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-3",children:[e.jsxs(P,{value:i.wireApi??"responses",onValueChange:m=>d(p=>({...p,wireApi:m})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsx(L,{children:e.jsx(b,{value:"responses",children:c("codex.responses")})})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Requires OpenAI auth",e.jsx(J,{checked:i.requiresOpenaiAuth,onCheckedChange:m=>d(p=>({...p,requiresOpenaiAuth:m})),disabled:t})]}),e.jsxs("label",{className:"flex items-center justify-between rounded-md border px-3 py-2 text-sm",children:["Supports websockets",e.jsx(J,{checked:i.supportsWebsockets,onCheckedChange:m=>d(p=>({...p,supportsWebsockets:m})),disabled:t})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs(y,{variant:"outline",onClick:a,disabled:t||l||!o,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsxs(y,{onClick:()=>n(i.name,{displayName:i.displayName,baseUrl:i.baseUrl,envKey:i.envKey,wireApi:i.wireApi,requiresOpenaiAuth:i.requiresOpenaiAuth,supportsWebsockets:i.supportsWebsockets}),disabled:t||l||i.name.trim().length===0,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save provider"]})]}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["If you want plain native ",e.jsx("code",{children:"codex"})," to default to CLIProxy, save a provider named"," ",e.jsx("code",{children:"cliproxy"})," with ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," here, then pick"," ",e.jsx("code",{children:"cliproxy"})," in the ",e.jsx("strong",{children:c("codex.defaultProvider")})," control above."]})]})}function Ls({entries:s,disabled:r=!1,disabledReason:t,saving:l=!1,onSave:o,onDelete:n}){const{t:a}=E(),[c,i]=N.useState("new"),d=N.useMemo(()=>s.find(x=>x.name===c)??null,[s,c]),m=d??Ps,p=JSON.stringify(m);return e.jsxs(Z,{title:"Model providers",badge:"model_providers",icon:e.jsx(rs,{className:"h-4 w-4"}),description:"Edit the common provider fields CCS can support safely. Keep secret migration and inline bearer tokens in raw TOML.",disabledReason:t,children:[e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select provider"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:a("codex.createNewProvider")}),s.map(x=>e.jsx(b,{value:x.name,children:x.name},x.name))]})]}),e.jsx(Os,{initialDraft:m,isNew:c==="new",disabled:r,saving:l,canDelete:d!==null,onDelete:async()=>{d&&(await n(d.name),i("new"))},onSave:async(x,j)=>{await o(x,j),i(x)}},p)]})}function As({initialName:s,initialModel:r,initialProvider:t,initialEffort:l,providerNames:o,activeProfile:n,selectedEntryName:a,disabled:c,saving:i,onSave:d,onDelete:m,onSetActive:p}){const{t:x}=E(),[j,h]=N.useState(s),[w,M]=N.useState(r),[q,u]=N.useState(t),[v,G]=N.useState(l);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsx(S,{value:j,onChange:g=>h(g.target.value),placeholder:"deep-review",disabled:c||a!==null}),e.jsx(S,{value:w??"",onChange:g=>M(g.target.value||null),placeholder:"gpt-5.4",disabled:c}),e.jsxs(P,{value:q??"__unset__",onValueChange:g=>u(g==="__unset__"?null:g),disabled:c,children:[e.jsx(D,{children:e.jsx(O,{placeholder:x("codex.useGlobalProvider")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalProvider")}),o.map(g=>e.jsx(b,{value:g,children:g},g))]})]}),e.jsxs(P,{value:v??"__unset__",onValueChange:g=>G(g==="__unset__"?null:g),disabled:c,children:[e.jsx(D,{children:e.jsx(O,{placeholder:x("codex.useGlobalEffort")})}),e.jsxs(L,{children:[e.jsx(b,{value:"__unset__",children:x("codex.useGlobalEffort")}),["minimal","low","medium","high","xhigh"].map(g=>e.jsx(b,{value:g,children:g},g))]})]})]}),e.jsxs("div",{className:"flex justify-between gap-2",children:[e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:m,disabled:c||i||!a,children:[e.jsx(re,{className:"mr-2 h-4 w-4"}),"Delete"]}),e.jsx(y,{variant:"outline",onClick:p,disabled:c||i||!a||a===n,children:"Set active"})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(y,{variant:"outline",onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!1),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save profile"]}),e.jsxs(y,{onClick:()=>d(j,{model:w,modelProvider:q,modelReasoningEffort:v},!0),disabled:c||i||j.trim().length===0,children:[i?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save + activate"]})]})]})]})}function Ms({activeProfile:s,entries:r,providerNames:t,disabled:l=!1,disabledReason:o,saving:n=!1,onSave:a,onDelete:c,onSetActive:i}){const{t:d}=E(),[m,p]=N.useState("new"),x=N.useMemo(()=>r.find(h=>h.name===m)??null,[r,m]),j=JSON.stringify(x??{name:"",values:{}});return e.jsxs(Z,{title:d("codex.profiles"),badge:"profiles",icon:e.jsx(ts,{className:"h-4 w-4"}),description:"Create reusable Codex overlays and set the active default profile.",disabledReason:o,children:[e.jsxs(P,{value:m,onValueChange:p,disabled:l,children:[e.jsx(D,{children:e.jsx(O,{placeholder:"Select profile"})}),e.jsxs(L,{children:[e.jsx(b,{value:"new",children:d("codex.createNewProfile")}),r.map(h=>e.jsxs(b,{value:h.name,children:[h.name,h.name===s?" (active)":""]},h.name))]})]}),e.jsx(As,{initialName:x?.name??"",initialModel:x?.values.model??null,initialProvider:x?.values.modelProvider??null,initialEffort:x?.values.modelReasoningEffort??null,providerNames:t,activeProfile:s,selectedEntryName:x?.name??null,disabled:l,saving:n,onDelete:async()=>{x&&(await c(x.name),p("new"))},onSetActive:async()=>{x&&await i(x.name)},onSave:async(h,w,M)=>{await a(h,w,M),p(h)}},j)]})}function Rs({workspacePath:s,disabled:r,saving:t,onSave:l}){const{t:o}=E(),[n,a]=N.useState(s),[c,i]=N.useState("trusted");return e.jsxs("div",{className:"grid gap-2 sm:grid-cols-[1fr_160px_auto]",children:[e.jsx(S,{value:n,onChange:d=>a(d.target.value),placeholder:"~/repo or /absolute/path",disabled:r}),e.jsxs(P,{value:c,onValueChange:i,disabled:r,children:[e.jsx(D,{children:e.jsx(O,{})}),e.jsxs(L,{children:[e.jsx(b,{value:"trusted",children:o("codex.trusted")}),e.jsx(b,{value:"untrusted",children:o("codex.untrusted")})]})]}),e.jsxs(y,{onClick:()=>l(n,c),disabled:r||t,children:[t?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save trust"]})]})}function Is({workspacePath:s,entries:r,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){const{t:a}=E();return e.jsxs(Z,{title:"Project trust",badge:"projects",icon:e.jsx(ns,{className:"h-4 w-4"}),description:"Trust current workspaces or remove stale trust entries without opening raw TOML.",disabledReason:l,children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Paths must be absolute or start with ",e.jsx("code",{children:"~/"}),". Relative paths are rejected so CCS does not trust the wrong folder."]}),e.jsx(Rs,{workspacePath:s,disabled:t,saving:o,onSave:n},s),e.jsx(y,{variant:"outline",className:"w-full justify-start",onClick:()=>n(s,"trusted"),disabled:t||o,children:"Trust current workspace"}),e.jsx("div",{className:"space-y-2",children:r.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:a("codex.noProjectTrustEntries")}):r.map(c=>e.jsxs("div",{className:"flex items-center justify-between gap-2 rounded-md border px-3 py-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:c.path}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["trust_level = ",c.trustLevel]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(y,{variant:"ghost",size:"sm",onClick:()=>n(c.path,c.trustLevel==="trusted"?"untrusted":"trusted"),disabled:t||o,children:"Toggle"}),e.jsx(y,{variant:"ghost",size:"icon",onClick:()=>n(c.path,null),disabled:t||o,children:e.jsx(re,{className:"h-4 w-4"})})]})]},c.path))})]})}const A="__unset__",Fs=105e4,Ws=272e3,_e=8e5,ke=7e5,Ks=new Intl.NumberFormat("en-US");function X(s){return s??A}function Y(s,r){return r&&!s.includes(r)?[r,...s]:s}function xe(s){return Ks.format(s)}function qs(s){return s?.trim().toLowerCase().startsWith("gpt-5.4")??!1}function Us(s,r){const t={};return r.model!==s.model&&(t.model=r.model),r.modelReasoningEffort!==s.modelReasoningEffort&&(t.modelReasoningEffort=r.modelReasoningEffort),r.modelContextWindow!==s.modelContextWindow&&(t.modelContextWindow=r.modelContextWindow),r.modelAutoCompactTokenLimit!==s.modelAutoCompactTokenLimit&&(t.modelAutoCompactTokenLimit=r.modelAutoCompactTokenLimit),r.modelProvider!==s.modelProvider&&(t.modelProvider=r.modelProvider),r.approvalPolicy!==s.approvalPolicy&&(t.approvalPolicy=r.approvalPolicy),r.sandboxMode!==s.sandboxMode&&(t.sandboxMode=r.sandboxMode),r.webSearch!==s.webSearch&&(t.webSearch=r.webSearch),r.toolOutputTokenLimit!==s.toolOutputTokenLimit&&(t.toolOutputTokenLimit=r.toolOutputTokenLimit),r.personality!==s.personality&&(t.personality=r.personality),t}function Bs({initialValues:s,providerNames:r,disabled:t,saving:l,onSave:o}){const{t:n}=E(),[a,c]=N.useState(s),i=Y(["minimal","low","medium","high","xhigh"],a.modelReasoningEffort),d=Y(r,a.modelProvider),m=Y(["on-request","never","untrusted"],a.approvalPolicy),p=Y(["read-only","workspace-write","danger-full-access"],a.sandboxMode),x=Y(["cached","live","disabled"],a.webSearch),j=Y(["none","friendly","pragmatic"],a.personality),h=Us(s,a),w=Object.keys(h).length>0,M=qs(a.model),q=u=>{const v=u.trim();return v.length>0?Number(v):null};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.model")}),e.jsx(S,{value:a.model??"",onChange:u=>c(v=>({...v,model:u.target.value||null})),placeholder:"gpt-5.5",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.reasoningEffort")}),e.jsxs(P,{value:X(a.modelReasoningEffort),onValueChange:u=>c(v=>({...v,modelReasoningEffort:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),i.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.defaultProvider")}),e.jsxs(P,{value:X(a.modelProvider),onValueChange:u=>c(v=>({...v,modelProvider:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useCodexDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useCodexDefault")}),d.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.approvalPolicy")}),e.jsxs(P,{value:X(a.approvalPolicy),onValueChange:u=>c(v=>({...v,approvalPolicy:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),m.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.sandboxMode")}),e.jsxs(P,{value:X(a.sandboxMode),onValueChange:u=>c(v=>({...v,sandboxMode:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),p.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.webSearch")}),e.jsxs(P,{value:X(a.webSearch),onValueChange:u=>c(v=>({...v,webSearch:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),x.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.toolOutputTokenLimit")}),e.jsx(S,{type:"number",min:1,value:a.toolOutputTokenLimit??"",onChange:u=>c(v=>({...v,toolOutputTokenLimit:u.target.value?Number(u.target.value):null})),placeholder:"25000",disabled:t})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.personality")}),e.jsxs(P,{value:X(a.personality),onValueChange:u=>c(v=>({...v,personality:u===A?null:u})),disabled:t,children:[e.jsx(D,{children:e.jsx(O,{placeholder:n("codex.useDefault")})}),e.jsxs(L,{children:[e.jsx(b,{value:A,children:n("codex.useDefault")}),j.map(u=>e.jsx(b,{value:u,children:u},u))]})]})]})]}),e.jsxs("div",{className:"space-y-4 rounded-xl border border-amber-500/30 bg-amber-500/5 p-4 shadow-sm dark:bg-amber-400/5",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(os,{className:"h-4 w-4 text-amber-600 dark:text-amber-300"}),e.jsx("p",{className:"text-sm font-semibold",children:n("codex.longContextOverride")}),e.jsx(_,{variant:"outline",className:"border-amber-500/40 bg-background/80 text-[10px] uppercase tracking-[0.16em] text-amber-700 dark:text-amber-300",children:"Manual opt-in only"}),e.jsx(_,{variant:"secondary",className:"text-[10px] uppercase tracking-[0.16em] text-muted-foreground",children:M?"GPT-5.4 long-context selected":"GPT-5.4 long-context reference"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Draft values only. Nothing applies until Save."})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(y,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:_e,modelAutoCompactTokenLimit:ke})),children:"Fill cautious pair"}),e.jsx(y,{type:"button",variant:"outline",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:Fs})),children:"Set official max window"}),e.jsx(y,{type:"button",variant:"ghost",size:"sm",disabled:t,onClick:()=>c(u=>({...u,modelContextWindow:null,modelAutoCompactTokenLimit:null})),children:"Clear"})]})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Official max"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:"1.05M / 1M"}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.gptContextCap")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Standard window"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:xe(Ws)}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.normalUsageWindow")})]}),e.jsxs("div",{className:"rounded-lg border bg-background/85 px-3 py-3 shadow-sm shadow-black/5",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"Above 272K"}),e.jsx("p",{className:"mt-1 font-mono text-base font-semibold text-foreground",children:n("codex.counts2x")}),e.jsx("p",{className:"mt-1 text-[11px] text-muted-foreground",children:n("codex.usageLimitCost")})]})]}),e.jsxs("div",{className:"space-y-3 rounded-lg border bg-background/75 px-3 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("p",{className:"text-[10px] font-medium uppercase tracking-wide text-muted-foreground",children:"One cautious pair"}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Context ",xe(_e)]}),e.jsxs("div",{className:"rounded-full border bg-background px-2.5 py-1 font-mono text-[11px] font-medium",children:["Auto-compact ",xe(ke)]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Not official"}),e.jsx(_,{variant:"outline",className:"border-border/70 bg-background/80 text-[10px] uppercase tracking-[0.14em] text-muted-foreground",children:"Draft only"})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{children:n("codex.quickFillWarning")}),!M&&a.model?e.jsxs("span",{children:[e.jsx("code",{children:a.model})," should be checked separately."]}):null]})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.modelContextWindow")}),e.jsx(S,{"aria-label":n("codex.modelContextWindow"),type:"number",min:1,value:a.modelContextWindow??"",onChange:u=>c(v=>({...v,modelContextWindow:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_context_window"}),". Leave unset to keep Codex defaults."]})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:n("codex.autoCompactTokenLimit")}),e.jsx(S,{"aria-label":n("codex.autoCompactTokenLimit"),type:"number",min:1,value:a.modelAutoCompactTokenLimit??"",onChange:u=>c(v=>({...v,modelAutoCompactTokenLimit:q(u.target.value)})),placeholder:"Unset",disabled:t}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Writes ",e.jsx("code",{children:"model_auto_compact_token_limit"}),". Leave unset to keep model defaults."]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[11px] text-muted-foreground",children:[e.jsx("span",{className:"text-[10px] uppercase tracking-[0.14em]",children:"Docs"}),e.jsx("a",{href:"https://platform.openai.com/docs/models",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"GPT-5 model guide"}),e.jsx("a",{href:"https://openai.com/index/introducing-gpt-5-5/",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Release notes"}),e.jsx("a",{href:"https://developers.openai.com/codex/config-reference",target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:"Config reference"})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(y,{onClick:()=>o(h),disabled:t||l||!w,children:[l?e.jsx(z,{className:"mr-2 h-4 w-4 animate-spin"}):null,"Save top-level settings"]})})]})}function Vs({values:s,providerNames:r,disabled:t=!1,disabledReason:l,saving:o=!1,onSave:n}){return e.jsx(Z,{title:"Top-level controls",badge:"config.toml",icon:e.jsx(as,{className:"h-4 w-4"}),description:"Structured controls for the stable top-level Codex settings users touch most often. Unsupported upstream shapes stay untouched and should be edited in raw TOML.",disabledReason:l,children:e.jsx(Bs,{initialValues:s,providerNames:r,disabled:t,saving:o,onSave:n},JSON.stringify(s))})}function Gs({workspacePath:s,activeProfile:r,topLevelSettings:t,projectTrustEntries:l,profileEntries:o,modelProviderEntries:n,mcpServerEntries:a,featureCatalog:c,featureState:i,disabled:d,disabledReason:m,saving:p,onPatch:x}){const{t:j}=E();return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-6 pr-1 pb-6",children:[e.jsxs("div",{className:"group relative overflow-hidden rounded-xl border border-border/80 bg-background/50 p-5 shadow-sm transition-all hover:bg-background hover:shadow-md dark:border-border/60",children:[e.jsx("div",{className:"absolute inset-x-0 -top-px h-px bg-gradient-to-r from-transparent via-foreground/15 to-transparent transition-opacity group-hover:via-foreground/30"}),e.jsxs("div",{className:"flex flex-col gap-6 lg:flex-row lg:items-start lg:justify-between",children:[e.jsxs("div",{className:"flex-1 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg border border-primary/20 bg-primary/10 text-primary transition-colors group-hover:border-primary/30",children:e.jsx(ls,{className:"h-4 w-4"})}),e.jsx("div",{children:e.jsx("h2",{className:"text-base font-semibold tracking-tight text-foreground",children:j("codex.controlCenter")})})]}),e.jsxs("ul",{className:"grid gap-3 sm:grid-cols-2 text-sm text-muted-foreground",children:[e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(is,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsxs("span",{className:"leading-relaxed",children:["Writes exclusively to user-layer"," ",e.jsx("code",{className:"text-[11px] bg-muted/70 px-1.5 py-0.5 rounded border border-border/50",children:"config.toml"})]})]}),e.jsxs("li",{className:"flex items-start gap-2.5",children:[e.jsx(cs,{className:"h-4 w-4 shrink-0 text-muted-foreground/60 mt-0.5"}),e.jsx("span",{className:"leading-relaxed",children:"Does not reflect repo trust layers or CLI overrides"})]})]})]}),e.jsx("div",{className:"shrink-0 lg:w-[280px]",children:e.jsx("div",{className:"relative overflow-hidden rounded-lg border border-amber-500/20 bg-amber-500/5 p-4 transition-colors group-hover:border-amber-500/30 group-hover:bg-amber-500/10 dark:border-amber-400/10 dark:bg-amber-400/5",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx(ds,{className:"mt-0.5 h-4 w-4 shrink-0 text-amber-600 dark:text-amber-400"}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-bold text-amber-700 dark:text-amber-300 uppercase tracking-wider",children:"Formatting Note"}),e.jsx("p",{className:"text-[13px] leading-relaxed text-amber-800/80 dark:text-amber-200/70",children:"Saves normalize TOML formatting and strip comments. Switch to the raw editor if exact layout matters."})]})]})})})]})]}),e.jsx(Vs,{values:t,providerNames:n.map(h=>h.name),disabled:d,disabledReason:m,saving:p,onSave:h=>x({kind:"top-level",values:h},j("toasts.codexSaved"))}),e.jsx(Is,{workspacePath:s,entries:l,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"project-trust",path:h,trustLevel:w},w?"Saved project trust entry.":"Removed project trust entry.")}),e.jsx(Ms,{activeProfile:r,entries:o,providerNames:n.map(h=>h.name),disabled:d,disabledReason:m,saving:p,onSave:(h,w,M)=>x({kind:"profile",action:"upsert",name:h,values:w,setAsActive:M},"Saved profile."),onDelete:h=>x({kind:"profile",action:"delete",name:h},"Deleted profile."),onSetActive:h=>x({kind:"profile",action:"set-active",name:h},"Set active profile.")}),e.jsx(Ls,{entries:n,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"model-provider",action:"upsert",name:h,values:w},"Saved model provider."),onDelete:h=>x({kind:"model-provider",action:"delete",name:h},"Deleted model provider.")}),e.jsx(Es,{entries:a,disabled:d,disabledReason:m,saving:p,onSave:(h,w)=>x({kind:"mcp-server",action:"upsert",name:h,values:w},"Saved MCP server."),onDelete:h=>x({kind:"mcp-server",action:"delete",name:h},"Deleted MCP server.")}),e.jsx(_s,{catalog:c,state:i,disabled:d,disabledReason:m,onToggle:(h,w)=>x({kind:"feature",feature:h,enabled:w},"Saved feature toggle.")})]})})}const Oe=`model_provider = "cliproxy"
2
+
3
+ [model_providers.cliproxy]
4
+ name = "CLIProxy Codex"
5
+ base_url = "http://127.0.0.1:8317/api/provider/codex"
6
+ env_key = "CLIPROXY_API_KEY"
7
+ wire_api = "responses"
8
+ requires_openai_auth = false
9
+ supports_websockets = false`,$s=["multi_agent","unified_exec","shell_snapshot","apply_patch_freeform","js_repl","runtime_metrics","prevent_idle_sleep","fast_mode","apps","smart_approvals"];function zs(){return[{name:"multi_agent",label:C.t("codex.featureMultiAgentLabel"),description:C.t("codex.featureMultiAgentDesc")},{name:"unified_exec",label:C.t("codex.featureUnifiedExecLabel"),description:C.t("codex.featureUnifiedExecDesc")},{name:"shell_snapshot",label:C.t("codex.featureShellSnapshotLabel"),description:C.t("codex.featureShellSnapshotDesc")},{name:"apply_patch_freeform",label:C.t("codex.featureApplyPatchLabel"),description:C.t("codex.featureApplyPatchDesc")},{name:"js_repl",label:C.t("codex.featureJsReplLabel"),description:C.t("codex.featureJsReplDesc")},{name:"runtime_metrics",label:C.t("codex.featureRuntimeMetricsLabel"),description:C.t("codex.featureRuntimeMetricsDesc")},{name:"prevent_idle_sleep",label:C.t("codex.featurePreventIdleSleepLabel"),description:C.t("codex.featurePreventIdleSleepDesc")},{name:"fast_mode",label:C.t("codex.featureFastModeLabel"),description:C.t("codex.featureFastModeDesc")},{name:"apps",label:C.t("codex.featureAppsLabel"),description:C.t("codex.featureAppsDesc")},{name:"smart_approvals",label:C.t("codex.featureSmartApprovalsLabel"),description:C.t("codex.featureSmartApprovalsDesc")}]}function V(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)?s:null}function T(s){return typeof s=="string"&&s.trim().length>0?s.trim():null}function Q(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function ue(s){return Array.isArray(s)?s.filter(r=>typeof r=="string").map(r=>r.trim()):[]}function Le(s){return{model:T(s?.model),modelReasoningEffort:T(s?.model_reasoning_effort),modelContextWindow:Q(s?.model_context_window),modelAutoCompactTokenLimit:Q(s?.model_auto_compact_token_limit),modelProvider:T(s?.model_provider),approvalPolicy:T(s?.approval_policy),sandboxMode:T(s?.sandbox_mode),webSearch:T(s?.web_search),toolOutputTokenLimit:Q(s?.tool_output_token_limit),personality:T(s?.personality)}}function Xs(s){const r=V(s?.projects);return r?Object.entries(r).map(([t,l])=>{const o=T(V(l)?.trust_level);return o?{path:t,trustLevel:o}:null}).filter(t=>t!==null).sort((t,l)=>t.path.localeCompare(l.path)):[]}function Ys(s){const r=V(s?.profiles);return r?Object.entries(r).map(([t,l])=>({name:t,values:Le(V(l))})).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Hs(s){const r=V(s?.model_providers);return r?Object.entries(r).map(([t,l])=>{const o=V(l);return o?{name:t,displayName:T(o.name),baseUrl:T(o.base_url),envKey:T(o.env_key),wireApi:T(o.wire_api),requiresOpenaiAuth:o.requires_openai_auth===!0,supportsWebsockets:o.supports_websockets===!0}:null}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Qs(s){const r=V(s?.mcp_servers);return r?Object.entries(r).map(([t,l])=>{const o=V(l);if(!o)return null;const n=T(o.command)?"stdio":"streamable-http",a=Q(o.startup_timeout_ms);return{name:t,transport:n,command:T(o.command),args:ue(o.args),url:T(o.url),enabled:o.enabled!==!1,required:o.required===!0,startupTimeoutSec:Q(o.startup_timeout_sec)??(a!==null?a/1e3:null),toolTimeoutSec:Q(o.tool_timeout_sec),enabledTools:ue(o.enabled_tools),disabledTools:ue(o.disabled_tools),isCcsManaged:t==="ccs_browser",managementSurface:t==="ccs_browser"?"browser-settings":null}}).filter(t=>t!==null).sort((t,l)=>t.name.localeCompare(l.name)):[]}function Js(s){const r=V(s?.features),t={};for(const l of $s){const o=r?.[l];t[l]=typeof o=="boolean"?o:null}if(r)for(const[l,o]of Object.entries(r))l in t||(t[l]=typeof o=="boolean"?o:null);return t}const Zs=[{id:"codex-config-basic",label:"Codex Config Basics",url:"https://developers.openai.com/codex/config-basic",description:"Official user-layer setup, config location, and baseline configuration behavior."},{id:"codex-config-advanced",label:"Codex Config Advanced",url:"https://developers.openai.com/codex/config-advanced",description:"Layering, trust, profiles, and advanced config behavior."},{id:"codex-config-reference",label:"Codex Config Reference",url:"https://developers.openai.com/codex/config-reference",description:"Canonical upstream config surface for providers, MCP, features, and trust."},{id:"codex-releases",label:"Codex GitHub Releases",url:"https://github.com/openai/codex/releases",description:"Track upstream release notes and fast-moving CLI changes."}],er=[{provider:"openai",label:"OpenAI Responses API",apiFormat:"Responses API",url:"https://platform.openai.com/docs/api-reference/responses"}];function sr(s){const r=/https?:\/\/[^\s)]+/g,t=[];let l=0,o;for(;(o=r.exec(s))!==null;){const[n]=o,a=o.index;a>l&&t.push(s.slice(l,a)),t.push(e.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:n},`${n}-${a}`)),l=a+n.length}return l<s.length&&t.push(s.slice(l)),t.length>0?t:[s]}function rr({diagnostics:s}){const{t:r}=E(),t=s.docsReference??{notes:[],links:[],providerDocs:[],providerValues:[],settingsHierarchy:[]},l=t.links.length>0?t.links:Zs,o=t.providerDocs.length>0?t.providerDocs:er;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"CCS bridge recipe"]})}),e.jsxs(K,{className:"space-y-3 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("p",{children:[e.jsx("strong",{children:r("codex.builtInLabel")})," ",r("codex.builtInCcsxpDesc")]}),e.jsxs("p",{children:[e.jsx("strong",{children:r("codex.nativeRecipeLabel")})," ",r("codex.nativeRecipeDesc")]}),e.jsxs("p",{children:[e.jsx("strong",{children:r("codex.managedBridgeLabel")})," ",r("codex.managedBridgeDesc")]})]}),e.jsx("pre",{className:"overflow-x-auto rounded-md border bg-muted/20 p-3 text-xs text-foreground",children:Oe}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsxs("li",{children:["Save the ",e.jsx("code",{children:"cliproxy"})," provider in your user config."]}),e.jsxs("li",{children:["Set top-level ",e.jsx("code",{children:"model_provider"})," to ",e.jsx("code",{children:"cliproxy"}),"."]}),e.jsxs("li",{children:["Export ",e.jsx("code",{children:"CLIPROXY_API_KEY"})," before launching native Codex."]})]}),e.jsxs("p",{children:["CCS-managed browser tooling belongs to ",e.jsx("code",{children:"Settings > Browser"}),". Do not edit the ",e.jsx("code",{children:"ccs_browser"})," entry from the generic MCP card unless you are intentionally overriding the managed path in raw TOML."]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),"Upstream notes"]})}),e.jsxs(K,{className:"space-y-2 text-sm",children:[t.notes.length>0&&e.jsx("ul",{className:"ml-4 list-disc space-y-1.5 text-muted-foreground [&>li]:pl-1",children:t.notes.map((n,a)=>e.jsx("li",{children:sr(n)},`${a}-${n}`))}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r("codex.codexDocs")}),e.jsx("div",{className:"space-y-1.5",children:l.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:n.description}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},n.id))})]}),e.jsx(ee,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:"Provider / bridge reference"}),e.jsx("div",{className:"space-y-1.5",children:o.map(n=>e.jsxs("a",{href:n.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:n.label}),e.jsx(we,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["provider: ",n.provider," | format: ",n.apiFormat]}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:n.url})]},`${n.provider}-${n.url}`))})]}),t.providerValues.length>0&&e.jsxs(e.Fragment,{children:[e.jsx(ee,{}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Provider values: ",t.providerValues.join(", ")]})]}),t.settingsHierarchy.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Settings hierarchy: ",t.settingsHierarchy.join(" -> ")]})]})]})]})})}function tr(s,r){let t=s.slice(0,r).split(/\r\n|\n|\r/g);return[t.length,t.pop().length+1]}function nr(s,r,t){let l=s.split(/\r\n|\n|\r/g),o="",n=(Math.log10(r+1)|0)+1;for(let a=r-1;a<=r+1;a++){let c=l[a-1];c&&(o+=a.toString().padEnd(n," "),o+=": ",o+=c,o+=`
10
+ `,a===r&&(o+=" ".repeat(n+t+2),o+=`^
11
+ `))}return o}class f extends Error{line;column;codeblock;constructor(r,t){const[l,o]=tr(t.toml,t.ptr),n=nr(t.toml,l,o);super(`Invalid TOML document: ${r}
12
+
13
+ ${n}`,t),this.line=l,this.column=o,this.codeblock=n}}function ar(s,r){let t=0;for(;s[r-++t]==="\\";);return--t&&t%2}function pe(s,r=0,t=s.length){let l=s.indexOf(`
14
+ `,r);return s[l-1]==="\r"&&l--,l<=t?l:-1}function te(s,r){for(let t=r;t<s.length;t++){let l=s[t];if(l===`
15
+ `)return t;if(l==="\r"&&s[t+1]===`
16
+ `)return t+1;if(l<" "&&l!==" "||l==="")throw new f("control characters are not allowed in comments",{toml:s,ptr:r})}return s.length}function B(s,r,t,l){let o;for(;;){for(;(o=s[r])===" "||o===" "||!t&&(o===`
17
+ `||o==="\r"&&s[r+1]===`
18
+ `);)r++;if(l||o!=="#")break;r=te(s,r)}return r}function or(s,r,t,l,o=!1){if(!l)return r=pe(s,r),r<0?s.length:r;for(let n=r;n<s.length;n++){let a=s[n];if(a==="#")n=pe(s,n);else{if(a===t)return n+1;if(a===l||o&&(a===`
19
+ `||a==="\r"&&s[n+1]===`
20
+ `))return n}}throw new f("cannot find end of structure",{toml:s,ptr:r})}function Ae(s,r){let t=s[r],l=t===s[r+1]&&s[r+1]===s[r+2]?s.slice(r,r+3):t;r+=l.length-1;do r=s.indexOf(l,++r);while(r>-1&&t!=="'"&&ar(s,r));return r>-1&&(r+=l.length,l.length>1&&(s[r]===t&&r++,s[r]===t&&r++)),r}let lr=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class H extends Date{#s=!1;#r=!1;#e=null;constructor(r){let t=!0,l=!0,o="Z";if(typeof r=="string"){let n=r.match(lr);n?(n[1]||(t=!1,r=`0000-01-01T${r}`),l=!!n[2],l&&r[10]===" "&&(r=r.replace(" ","T")),n[2]&&+n[2]>23?r="":(o=n[3]||null,r=r.toUpperCase(),!o&&l&&(r+="Z"))):r=""}super(r),isNaN(this.getTime())||(this.#s=t,this.#r=l,this.#e=o)}isDateTime(){return this.#s&&this.#r}isLocal(){return!this.#s||!this.#r||!this.#e}isDate(){return this.#s&&!this.#r}isTime(){return this.#r&&!this.#s}isValid(){return this.#s||this.#r}toISOString(){let r=super.toISOString();if(this.isDate())return r.slice(0,10);if(this.isTime())return r.slice(11,23);if(this.#e===null)return r.slice(0,-1);if(this.#e==="Z")return r;let t=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return t=this.#e[0]==="-"?t:-t,new Date(this.getTime()-t*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(r,t="Z"){let l=new H(r);return l.#e=t,l}static wrapAsLocalDateTime(r){let t=new H(r);return t.#e=null,t}static wrapAsLocalDate(r){let t=new H(r);return t.#r=!1,t.#e=null,t}static wrapAsLocalTime(r){let t=new H(r);return t.#s=!1,t.#e=null,t}}let ir=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,cr=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,dr=/^[+-]?0[0-9_]/,xr=/^[0-9a-f]{2,8}$/i,Te={b:"\b",t:" ",n:`
21
+ `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Me(s,r=0,t=s.length){let l=s[r]==="'",o=s[r++]===s[r]&&s[r]===s[r+1];o&&(t-=2,s[r+=2]==="\r"&&r++,s[r]===`
22
+ `&&r++);let n=0,a,c="",i=r;for(;r<t-1;){let d=s[r++];if(d===`
23
+ `||d==="\r"&&s[r]===`
24
+ `){if(!o)throw new f("newlines are not allowed in strings",{toml:s,ptr:r-1})}else if(d<" "&&d!==" "||d==="")throw new f("control characters are not allowed in strings",{toml:s,ptr:r-1});if(a){if(a=!1,d==="x"||d==="u"||d==="U"){let m=s.slice(r,r+=d==="x"?2:d==="u"?4:8);if(!xr.test(m))throw new f("invalid unicode escape",{toml:s,ptr:n});try{c+=String.fromCodePoint(parseInt(m,16))}catch{throw new f("invalid unicode escape",{toml:s,ptr:n})}}else if(o&&(d===`
25
+ `||d===" "||d===" "||d==="\r")){if(r=B(s,r-1,!0),s[r]!==`
26
+ `&&s[r]!=="\r")throw new f("invalid escape: only line-ending whitespace may be escaped",{toml:s,ptr:n});r=B(s,r)}else if(d in Te)c+=Te[d];else throw new f("unrecognized escape sequence",{toml:s,ptr:n});i=r}else!l&&d==="\\"&&(n=r-1,a=!0,c+=s.slice(i,n))}return c+s.slice(i,t-1)}function ur(s,r,t,l){if(s==="true")return!0;if(s==="false")return!1;if(s==="-inf")return-1/0;if(s==="inf"||s==="+inf")return 1/0;if(s==="nan"||s==="+nan"||s==="-nan")return NaN;if(s==="-0")return l?0n:0;let o=ir.test(s);if(o||cr.test(s)){if(dr.test(s))throw new f("leading zeroes are not allowed",{toml:r,ptr:t});s=s.replace(/_/g,"");let a=+s;if(isNaN(a))throw new f("invalid number",{toml:r,ptr:t});if(o){if((o=!Number.isSafeInteger(a))&&!l)throw new f("integer value cannot be represented losslessly",{toml:r,ptr:t});(o||l===!0)&&(a=BigInt(s))}return a}const n=new H(s);if(!n.isValid())throw new f("invalid value",{toml:r,ptr:t});return n}function mr(s,r,t){let l=s.slice(r,t),o=l.indexOf("#");return o>-1&&(te(s,o),l=l.slice(0,o)),[l.trimEnd(),o]}function ge(s,r,t,l,o){if(l===0)throw new f("document contains excessively nested structures. aborting.",{toml:s,ptr:r});let n=s[r];if(n==="["||n==="{"){let[i,d]=n==="["?fr(s,r,l,o):hr(s,r,l,o);if(t){if(d=B(s,d),s[d]===",")d++;else if(s[d]!==t)throw new f("expected comma or end of structure",{toml:s,ptr:d})}return[i,d]}let a;if(n==='"'||n==="'"){a=Ae(s,r);let i=Me(s,r,a);if(t){if(a=B(s,a),s[a]&&s[a]!==","&&s[a]!==t&&s[a]!==`
27
+ `&&s[a]!=="\r")throw new f("unexpected character encountered",{toml:s,ptr:a});a+=+(s[a]===",")}return[i,a]}a=or(s,r,",",t);let c=mr(s,r,a-+(s[a-1]===","));if(!c[0])throw new f("incomplete key-value declaration: no value specified",{toml:s,ptr:r});return t&&c[1]>-1&&(a=B(s,r+c[1]),a+=+(s[a]===",")),[ur(c[0],s,r,o),a]}let pr=/^[a-zA-Z0-9-_]+[ \t]*$/;function he(s,r,t="="){let l=r-1,o=[],n=s.indexOf(t,r);if(n<0)throw new f("incomplete key-value: cannot find end of key",{toml:s,ptr:r});do{let a=s[r=++l];if(a!==" "&&a!==" ")if(a==='"'||a==="'"){if(a===s[r+1]&&a===s[r+2])throw new f("multiline strings are not allowed in keys",{toml:s,ptr:r});let c=Ae(s,r);if(c<0)throw new f("unfinished string encountered",{toml:s,ptr:r});l=s.indexOf(".",c);let i=s.slice(c,l<0||l>n?n:l),d=pe(i);if(d>-1)throw new f("newlines are not allowed in keys",{toml:s,ptr:r+l+d});if(i.trimStart())throw new f("found extra tokens after the string part",{toml:s,ptr:c});if(n<c&&(n=s.indexOf(t,c),n<0))throw new f("incomplete key-value: cannot find end of key",{toml:s,ptr:r});o.push(Me(s,r,c))}else{l=s.indexOf(".",r);let c=s.slice(r,l<0||l>n?n:l);if(!pr.test(c))throw new f("only letter, numbers, dashes and underscores are allowed in keys",{toml:s,ptr:r});o.push(c.trimEnd())}}while(l+1&&l<n);return[o,B(s,n+1,!0,!0)]}function hr(s,r,t,l){let o={},n=new Set,a;for(r++;(a=s[r++])!=="}"&&a;){if(a===",")throw new f("expected value, found comma",{toml:s,ptr:r-1});if(a==="#")r=te(s,r);else if(a!==" "&&a!==" "&&a!==`
28
+ `&&a!=="\r"){let c,i=o,d=!1,[m,p]=he(s,r-1);for(let h=0;h<m.length;h++){if(h&&(i=d?i[c]:i[c]={}),c=m[h],(d=Object.hasOwn(i,c))&&(typeof i[c]!="object"||n.has(i[c])))throw new f("trying to redefine an already defined value",{toml:s,ptr:r});!d&&c==="__proto__"&&Object.defineProperty(i,c,{enumerable:!0,configurable:!0,writable:!0})}if(d)throw new f("trying to redefine an already defined value",{toml:s,ptr:r});let[x,j]=ge(s,p,"}",t-1,l);n.add(x),i[c]=x,r=j}}if(!a)throw new f("unfinished table encountered",{toml:s,ptr:r});return[o,r]}function fr(s,r,t,l){let o=[],n;for(r++;(n=s[r++])!=="]"&&n;){if(n===",")throw new f("expected value, found comma",{toml:s,ptr:r-1});if(n==="#")r=te(s,r);else if(n!==" "&&n!==" "&&n!==`
29
+ `&&n!=="\r"){let a=ge(s,r-1,"]",t-1,l);o.push(a[0]),r=a[1]}}if(!n)throw new f("unfinished array encountered",{toml:s,ptr:r});return[o,r]}function Ee(s,r,t,l){let o=r,n=t,a,c=!1,i;for(let d=0;d<s.length;d++){if(d){if(o=c?o[a]:o[a]={},n=(i=n[a]).c,l===0&&(i.t===1||i.t===2))return null;if(i.t===2){let m=o.length-1;o=o[m],n=n[m].c}}if(a=s[d],(c=Object.hasOwn(o,a))&&n[a]?.t===0&&n[a]?.d)return null;c||(a==="__proto__"&&(Object.defineProperty(o,a,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(n,a,{enumerable:!0,configurable:!0,writable:!0})),n[a]={t:d<s.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(i=n[a],i.t!==l&&!(l===1&&i.t===3)||(l===2&&(i.d||(i.d=!0,o[a]=[]),o[a].push(o={}),i.c[i.i++]=i={t:1,d:!1,i:0,c:{}}),i.d))return null;if(i.d=!0,l===1)o=c?o[a]:o[a]={};else if(l===0&&c)return null;return[a,o,i.c]}function gr(s,{maxDepth:r=1e3,integersAsBigInt:t}={}){let l={},o={},n=l,a=o;for(let c=B(s,0);c<s.length;){if(s[c]==="["){let i=s[++c]==="[",d=he(s,c+=+i,"]");if(i){if(s[d[1]-1]!=="]")throw new f("expected end of table declaration",{toml:s,ptr:d[1]-1});d[1]++}let m=Ee(d[0],l,o,i?2:1);if(!m)throw new f("trying to redefine an already defined table or value",{toml:s,ptr:c});a=m[2],n=m[1],c=d[1]}else{let i=he(s,c),d=Ee(i[0],n,a,0);if(!d)throw new f("trying to redefine an already defined table or value",{toml:s,ptr:c});let m=ge(s,i[1],void 0,r,t);d[1][d[0]]=m[0],c=m[1]}if(c=B(s,c,!0),s[c]&&s[c]!==`
30
+ `&&s[c]!=="\r")throw new f("each key-value declaration must be followed by an end-of-line",{toml:s,ptr:c});c=B(s,c)}return l}function jr(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function vr(s){return s.charCodeAt(0)===65279?s.slice(1):s}function br(s){const r=vr(s);if(!r.trim())return{};const l=gr(r);if(!jr(l))throw new Error("TOML root must be a table.");return l}function Re(s){try{return{config:br(s),parseError:null}}catch(r){return{config:null,parseError:r.message}}}async function wr(){const s=await fetch(se("/codex/diagnostics"));if(!s.ok)throw new Error("Failed to fetch Codex diagnostics");return s.json()}async function Nr(){const s=await fetch(se("/codex/config/raw"));if(!s.ok)throw new Error("Failed to fetch Codex raw config");return s.json()}async function Cr(s){const r=await fetch(se("/codex/config/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===409)throw new Pe("Codex raw config changed externally");if(!r.ok){const t=await r.json().catch(()=>null);throw new Error(t?.error||"Failed to save Codex raw config")}return r.json()}async function yr(s){const r=await fetch(se("/codex/config/patch"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===409)throw new Pe("Codex config changed externally");if(!r.ok){const t=await r.json().catch(()=>null);throw new Error(t?.error||"Failed to patch Codex config")}return r.json()}function Sr(){const s=ws(),r=Ce({queryKey:["codex-diagnostics"],queryFn:wr,refetchInterval:1e4}),t=Ce({queryKey:["codex-raw-config"],queryFn:Nr}),l=ye({mutationFn:Cr,onSuccess:(n,a)=>{s.setQueryData(["codex-raw-config"],c=>{const i=c?.path??"$CODEX_HOME/config.toml",d=c?.resolvedPath??i,m=Re(a.rawText);return{path:i,resolvedPath:d,exists:!0,mtime:n.mtime,rawText:a.rawText,config:m.config,parseError:m.parseError,readError:null}}),s.invalidateQueries({queryKey:["codex-diagnostics"]})}}),o=ye({mutationFn:yr,onSuccess:n=>{s.setQueryData(["codex-raw-config"],n),s.invalidateQueries({queryKey:["codex-diagnostics"]})}});return N.useMemo(()=>({diagnostics:r.data,diagnosticsLoading:r.isLoading,diagnosticsError:r.error,refetchDiagnostics:r.refetch,rawConfig:t.data,rawConfigLoading:t.isLoading,rawConfigError:t.error,refetchRawConfig:t.refetch,saveRawConfig:l.mutate,saveRawConfigAsync:l.mutateAsync,isSavingRawConfig:l.isPending,patchConfig:o.mutate,patchConfigAsync:o.mutateAsync,isPatchingConfig:o.isPending}),[r.data,r.isLoading,r.error,r.refetch,t.data,t.isLoading,t.error,t.refetch,l.mutate,l.mutateAsync,l.isPending,o.mutate,o.mutateAsync,o.isPending])}const _r=[{label:"Start Default",command:"ccs",description:"Launch Claude with default profile"},{label:"GLM Profile",command:"ccs glm",description:"Switch to GLM model"},{label:"Health Check",command:"ccs doctor",description:"Run system diagnostics"},{label:"Delegate Task",command:'ccs glm -p "your task"',description:"Delegate to GLM profile"}];function kr({snippets:s=_r}){const[r,t]=N.useState(null),{t:l}=E(),o=async(n,a)=>{await navigator.clipboard.writeText(n),t(a),setTimeout(()=>t(null),2e3)};return e.jsxs(I,{children:[e.jsx(F,{className:"pb-3",children:e.jsxs(W,{className:"text-lg flex items-center gap-2",children:[e.jsx(xs,{className:"w-5 h-5 text-muted-foreground"}),l("quickCommands.title")]})}),e.jsx(K,{children:e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:s.map((n,a)=>e.jsxs("div",{className:De("group flex items-center justify-between gap-2 px-3 py-2","rounded-lg border bg-muted/30 hover:bg-muted/50 transition-colors"),children:[e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:n.label}),e.jsx("code",{className:"text-sm font-mono font-medium truncate block",children:n.command})]}),e.jsx(y,{variant:"ghost",size:"sm",className:"h-8 w-8 p-0 opacity-0 group-hover:opacity-100 transition-opacity",onClick:()=>o(n.command,a),title:n.description,children:r===a?e.jsx(us,{className:"h-4 w-4 text-green-600"}):e.jsx(ms,{className:"h-4 w-4"})})]},a))})})]})}function Tr(s){return!s||!Number.isFinite(s)?"N/A":new Date(s).toLocaleString()}function Er(s){return!s||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(2)} MB`}function k({label:s,value:r,mono:t=!1}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-muted-foreground shrink-0",children:s}),e.jsx("span",{className:De("text-right break-all",t&&"font-mono text-xs"),children:r})]})}function Pr({diagnostics:s}){const{t:r}=E(),t=s.config.activeProfile?`codex --profile ${s.config.activeProfile}`:"codex",l=s.binary.supportsConfigOverrides;return e.jsx(fe,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(ps,{className:"h-4 w-4"}),r("codex.howCodexWorks")]})}),e.jsx(K,{className:"text-sm text-muted-foreground",children:e.jsxs("ul",{className:"ml-4 list-disc space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:r("codex.nativeDesc")}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.nativeConfigLabel")})," ",r("codex.nativeConfigDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.transientOverridesLabel")})," ",r("codex.transientOverridesDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.cliproxyDefaultLabel")})," ",r("codex.cliproxyDefaultDesc")]}),e.jsx("li",{children:r("codex.apiProfilesDefault")})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(hs,{className:"h-4 w-4"}),r("codex.runtimeInstall")]})}),e.jsxs(K,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:r("codex.status")}),e.jsx(_,{variant:s.binary.installed?"default":"secondary",children:s.binary.installed?r("codex.detected"):r("codex.notFound")})]}),e.jsx(k,{label:r("codex.detectionSource"),value:s.binary.source,mono:!0}),e.jsx(k,{label:r("codex.binaryPath"),value:s.binary.path||r("codex.notFound"),mono:!0}),e.jsx(k,{label:r("codex.installDirectory"),value:s.binary.installDir||"N/A",mono:!0}),e.jsx(k,{label:r("codex.versionLabel"),value:s.binary.version||"Unknown",mono:!0}),e.jsx(k,{label:r("codex.nativeAliases"),value:"ccs-codex, ccsx",mono:!0}),e.jsx(k,{label:r("codex.ccsProviderShortcut"),value:"ccsxp",mono:!0}),e.jsxs("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:r("codex.configOverrideSupport")}),e.jsx(_,{variant:s.binary.supportsConfigOverrides?"default":"secondary",children:s.binary.supportsConfigOverrides?r("codex.available"):r("codex.missing")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),r("codex.cliproxyNativeCodex")]})}),e.jsx(K,{className:"space-y-3 text-sm text-muted-foreground",children:l?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx("p",{children:e.jsx("strong",{children:r("codex.twoSupportedPaths")})}),e.jsxs("ul",{className:"ml-4 list-disc space-y-1 [&>li]:pl-1",children:[e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.builtInLabel")})," ",r("codex.builtInCcsxpDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:r("codex.nativeRecipeLabel")})," ",r("codex.nativeRecipeDesc")]})]})]}),e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.codexNativeRecipe")}),e.jsx("pre",{className:"mt-2 overflow-x-auto rounded-md bg-background p-3 text-xs text-foreground",children:Oe})]}),e.jsxs("ol",{className:"ml-4 list-decimal space-y-1.5 [&>li]:pl-1",children:[e.jsx("li",{children:r("codex.saveProviderNamedCliproxy")}),e.jsx("li",{children:r("codex.inTopLevelSetDefault")}),e.jsx("li",{children:r("codex.exportCliproxyApiKey")})]})]}):e.jsx("p",{children:r("codex.noConfigOverrides")})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(fs,{className:"h-4 w-4"}),r("codex.configFile")]})}),e.jsx(K,{className:"space-y-3",children:e.jsxs("div",{className:"rounded-md border p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-sm",children:r("codex.userConfig")}),s.file.exists?e.jsx(gs,{className:"h-4 w-4 text-green-600"}):e.jsx(js,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(k,{label:r("codex.path"),value:s.file.path,mono:!0}),e.jsx(k,{label:r("codex.resolved"),value:s.file.resolvedPath,mono:!0}),e.jsx(k,{label:r("codex.size"),value:Er(s.file.sizeBytes)}),e.jsx(k,{label:r("codex.lastModified"),value:Tr(s.file.mtimeMs)}),s.file.parseError&&e.jsxs("p",{className:"text-xs text-amber-600",children:[r("codex.tomlWarning"),": ",s.file.parseError]}),s.file.readError&&e.jsxs("p",{className:"text-xs text-destructive",children:[r("codex.readWarning"),": ",s.file.readError]})]})})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(me,{className:"h-4 w-4"}),r("codex.currentUserLayerSummary")]})}),e.jsxs(K,{className:"space-y-3",children:[e.jsx(k,{label:r("codex.model"),value:s.config.model||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.defaultProvider"),value:s.config.modelProvider||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.activeProfile"),value:s.config.activeProfile||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.approvalPolicy"),value:s.config.approvalPolicy||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.sandboxMode"),value:s.config.sandboxMode||r("codex.notSet"),mono:!0}),e.jsx(k,{label:r("codex.webSearch"),value:s.config.webSearch||r("codex.notSet"),mono:!0}),e.jsx(ee,{}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.providersCount",{count:s.config.modelProviderCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.profilesCount",{count:s.config.profileCount})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.enabledFeaturesCount",{count:s.config.enabledFeatures.length})}),e.jsx(_,{variant:"outline",className:"justify-center",children:r("codex.mcpServersCount",{count:s.config.mcpServerCount})})]}),s.config.topLevelKeys.length>0&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs uppercase tracking-wide text-muted-foreground",children:r("codex.userLayerKeysPresent")}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:s.config.topLevelKeys.map(o=>e.jsx(_,{variant:"secondary",className:"font-mono text-[10px]",children:o},o))})]})]})]}),e.jsx(kr,{snippets:[{label:r("codex.nativeShortAlias"),command:"ccsx",description:"Launch the short native Codex runtime alias."},{label:r("codex.ccsCodexShortcut"),command:'ccsxp "your prompt"',description:l?r("codex.runBuiltInCodex"):"Requires a Codex build that exposes --config overrides."},{label:r("codex.explicitProviderRoute"),command:'ccs codex --target codex "your prompt"',description:l?r("codex.runBuiltInCodexExplicit"):"Requires a Codex build that exposes --config overrides."},{label:s.config.activeProfile?"Inspect active profile":r("codex.openNativeCodex"),command:t,description:s.config.activeProfile?"Inspect the active named profile directly in native Codex.":"Open native Codex without forcing a named profile overlay."}]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(Ne,{className:"h-4 w-4"}),r("codex.runtimeVsProvider")]})}),e.jsxs(K,{className:"grid gap-3 md:grid-cols-2",children:[e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.nativeCodexRuntime")}),e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccs-codex"})}),e.jsx("li",{children:e.jsx("code",{children:"ccsx"})}),e.jsx("li",{children:e.jsx("code",{children:"--target codex"})})]}),e.jsx(_,{variant:"secondary",className:"mt-4 w-fit justify-center font-normal",children:r("codex.honorsSavedNativeConfig")})]}),e.jsxs("div",{className:"flex flex-col rounded-md border p-3 text-sm",children:[e.jsx("p",{className:"font-medium text-foreground",children:r("codex.ccsCodexProvider")}),l?e.jsxs(e.Fragment,{children:[e.jsxs("ul",{className:"mt-2 flex-grow list-disc space-y-1.5 pl-4 text-muted-foreground [&>li]:pl-1",children:[e.jsx("li",{children:e.jsx("code",{children:"ccsxp"})}),e.jsx("li",{children:e.jsx("code",{children:"ccs codex --target codex"})})]}),e.jsx("p",{className:"mt-4 text-muted-foreground",children:r("codex.transientOverridesDesc")})]}):e.jsx("p",{className:"mt-2 text-muted-foreground",children:r("codex.unavailableNoConfig")})]})]})]}),e.jsxs(I,{children:[e.jsx(F,{className:"pb-2",children:e.jsx(W,{className:"text-base",children:r("codex.supportedFlows")})}),e.jsx(K,{children:e.jsxs(Ns,{children:[e.jsx(Cs,{children:e.jsxs(Se,{children:[e.jsx(le,{children:r("codex.flow")}),e.jsx(le,{children:r("codex.status")}),e.jsx(le,{children:r("codex.notes")})]})}),e.jsx(ys,{children:s.supportMatrix.map(o=>e.jsxs(Se,{children:[e.jsx(ie,{className:"font-mono text-xs",children:o.label}),e.jsx(ie,{children:e.jsx(_,{variant:o.supported?"default":"secondary",children:o.supported?r("codex.yes"):r("codex.no")})}),e.jsx(ie,{className:"text-xs text-muted-foreground",children:o.notes})]},o.id))})]})})]}),s.warnings.length>0&&e.jsxs(I,{className:"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20",children:[e.jsx(F,{className:"pb-2",children:e.jsxs(W,{className:"flex items-center gap-2 text-base",children:[e.jsx(vs,{className:"h-4 w-4 text-amber-600"}),r("codex.warningsTitle")]})}),e.jsx(K,{className:"space-y-1.5",children:s.warnings.map(o=>e.jsxs("p",{className:"text-sm text-amber-800 dark:text-amber-300",children:["- ",o]},o))})]})]})})}function Br(){const{t:s}=E(),r=zs(),{diagnostics:t,diagnosticsLoading:l,diagnosticsError:o,refetchDiagnostics:n,rawConfig:a,rawConfigLoading:c,rawConfigError:i,refetchRawConfig:d,saveRawConfigAsync:m,isSavingRawConfig:p,patchConfigAsync:x,isPatchingConfig:j}=Sr(),[h,w]=N.useState(null),M=a?.rawText??"",q=h??M,u=h!==null&&h!==M,v=Re(q),G=v.parseError?{valid:!1,error:v.parseError}:{valid:!0},g=a?.config??null,Ie=c||!a||u||a?.parseError!==null||a?.readError!==null,Fe=i?"Structured controls unavailable: failed to load the current config.toml.":a?.readError?`Structured controls unavailable: ${a.readError}`:u?G.valid?"Save or discard raw TOML edits before using structured controls.":"Fix or discard raw TOML edits before using structured controls.":a?.parseError?`Structured controls disabled: ${a.parseError}`:null,We=N.useMemo(()=>Le(g),[g]),Ke=N.useMemo(()=>Xs(g),[g]),qe=N.useMemo(()=>Ys(g),[g]),Ue=N.useMemo(()=>Hs(g),[g]),Be=N.useMemo(()=>Qs(g),[g]),Ve=N.useMemo(()=>Js(g),[g]),Ge=R=>{if(R===M){w(null);return}w(R)},$e=async()=>{try{if((await Promise.all([n(),d()])).some($=>!$||$.status==="error"||$.isError||$.error)){U.error(s("toasts.codexRefreshFailed"));return}w(null)}catch(R){U.error(R.message||s("toasts.codexRefreshError"))}},ze=async()=>{if(!G.valid){U.error(s("toasts.codexFixToml"));return}try{await m({rawText:q,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(s("toasts.codexSaved")),await n()}catch(R){be(R)?U.error(s("toasts.codexChangedExternally")):U.error(R.message||s("toasts.codexSaveFailed"))}},Xe=async(R,je)=>{try{await x({...R,expectedMtime:a?.exists?a.mtime:void 0}),w(null),U.success(je)}catch($){be($)?U.error(s("toasts.codexChangedExternally")):U.error($.message||s("toasts.codexUpdateFailed"))}},ne="mt-0 h-full border-0 p-0 data-[state=inactive]:hidden",Ye=()=>l?e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(z,{className:"mr-2 h-5 w-5 animate-spin"}),"Loading Codex diagnostics..."]}):o||!t?e.jsx("div",{className:"flex h-full items-center justify-center px-6 text-center text-destructive",children:"Failed to load Codex diagnostics."}):e.jsxs(Je,{defaultValue:"overview",className:"flex h-full flex-col",children:[e.jsx("div",{className:"shrink-0 px-4 pt-4",children:e.jsxs(Ze,{className:"grid w-full grid-cols-3",children:[e.jsx(ae,{value:"overview",children:s("codexPage.overview")}),e.jsx(ae,{value:"controls",children:s("codexPage.controlCenter")}),e.jsx(ae,{value:"docs",children:s("codexPage.docs")})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden px-4 pb-4 pt-3",children:[e.jsx(oe,{value:"overview",className:ne,children:e.jsx(Pr,{diagnostics:t})}),e.jsx(oe,{value:"controls",className:ne,children:e.jsx(Gs,{workspacePath:t.workspacePath,activeProfile:t.config.activeProfile,topLevelSettings:We,projectTrustEntries:Ke,profileEntries:qe,modelProviderEntries:Ue,mcpServerEntries:Be,featureCatalog:r,featureState:Ve,disabled:Ie,disabledReason:Fe,saving:j,onPatch:Xe})}),e.jsx(oe,{value:"docs",className:ne,children:e.jsx(rr,{diagnostics:t})})]})]});return e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsxs(He,{direction:"horizontal",className:"h-full",children:[e.jsx(ve,{defaultSize:45,minSize:35,children:e.jsx("div",{className:"h-full border-r bg-muted/20",children:Ye()})}),e.jsx(Qe,{className:"group flex w-2 cursor-col-resize items-center justify-center bg-border transition-colors hover:bg-primary/20",children:e.jsx(bs,{className:"h-3 w-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ve,{defaultSize:55,minSize:35,children:e.jsx(Ss,{title:"Codex config.toml",pathLabel:a?.path||t?.file.path||"$CODEX_HOME/config.toml",loading:c,parseWarning:G.valid?a?.parseError:G.error,readWarning:a?.readError,value:q,dirty:u,readOnly:!!a?.readError,saving:p,saveDisabled:!u||p||c||!G.valid||!!a?.readError,onChange:R=>{Ge(R)},onSave:ze,onRefresh:$e,onDiscard:()=>w(null),language:"toml",exactText:!0,loadingLabel:"Loading config.toml...",parseWarningLabel:"TOML warning",ownershipNotice:e.jsxs("div",{className:"rounded-md border border-amber-200 bg-amber-50/60 px-3 py-2 text-sm text-amber-900 dark:bg-amber-950/20 dark:text-amber-300",children:[e.jsx("p",{className:"font-medium",children:"This file is upstream-owned by Codex CLI."}),e.jsxs("p",{children:["CCS does not keep ",e.jsx("code",{children:"~/.codex/config.toml"})," in sync for you."]}),e.jsxs("p",{children:["CCS-backed Codex launches may apply transient ",e.jsx("code",{children:"-c"})," overrides and",e.jsx("code",{children:" CCS_CODEX_API_KEY"}),"; those effective values may not appear here."]})]})})})]})})}export{Br as CodexPage};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-DvRtHWGI.js";import{A as g,a as d,b as m,c as x,d as D,e as h,f,g as j}from"./alert-dialog-B9kuXS_B.js";import{a as A}from"./index-7dfuc3Cf.js";function b({open:l,onConfirm:o,onCancel:r,title:a,description:s,confirmText:t,variant:n="default"}){const{t:i}=A();return e.jsx(g,{open:l,onOpenChange:c=>!c&&r(),children:e.jsxs(d,{children:[e.jsxs(m,{children:[e.jsx(x,{children:a}),e.jsx(D,{children:s})]}),e.jsxs(h,{children:[e.jsx(f,{onClick:r,children:i("confirmDialog.cancel")}),e.jsx(j,{onClick:o,className:n==="destructive"?"bg-red-600 hover:bg-red-700 text-white":"",children:t??i("confirmDialog.confirm")})]})]})})}export{b as C};
@@ -0,0 +1,3 @@
1
+ import{j as e}from"./radix-ui-DvRtHWGI.js";import{bf as w,bg as ke,a as S,B as P,e as N,$ as le,E as V,L,aH as X,I as me,o as Fe,p as Te,q as Me,r as Le,s as ee,F as fe,bh as Re,S as y,bi as Ae,bj as Ee,bk as Oe,Y as qe,Z as _e,_ as te,bl as De,c as ie}from"./index-7dfuc3Cf.js";import{r as b}from"./react-vendor-Bjx91N7w.js";import{a as Ie,u as D,b as R}from"./tanstack-Dg84L5cM.js";import{C as Ke}from"./confirm-dialog-iyu6jSnb.js";import{R as je,L as ve,av as Ue,a9 as Qe,Z as ue,Y as $e,T as ne,ay as Je,c as ze,ad as Be,aF as He,aP as pe,K as Ge,V as We,aQ as Ve,w as be,D as we}from"./icons-bxdfpJdB.js";import{S as oe}from"./separator-avUMnKG4.js";import{S as Ye}from"./searchable-select-C8BA2Q6i.js";import{t as I}from"./notifications-B4_o8bcr.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";import"./alert-dialog-B9kuXS_B.js";async function Ze(){const t=await fetch(w("/copilot/status"));if(!t.ok)throw new Error("Failed to fetch copilot status");return t.json()}async function Xe(){const t=await fetch(w("/copilot/config"));if(!t.ok)throw new Error("Failed to fetch copilot config");return t.json()}async function et(){const t=await fetch(w("/copilot/models"));if(!t.ok)throw new Error("Failed to fetch copilot models");return t.json()}async function tt(){const t=await fetch(w("/copilot/settings/raw"));if(!t.ok)throw new Error("Failed to fetch copilot raw settings");return t.json()}async function st(t){const s=await fetch(w("/copilot/config"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!s.ok)throw new Error("Failed to update copilot config");return s.json()}async function at(t){const s=await fetch(w("/copilot/settings/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(s.status===409)throw new ke("Copilot raw settings changed externally");if(!s.ok)throw new Error("Failed to save copilot raw settings");return s.json()}async function it(){const t=await fetch(w("/copilot/auth/start"),{method:"POST"});if(!t.ok)throw new Error("Failed to start auth");return t.json()}async function nt(){const t=await fetch(w("/copilot/daemon/start"),{method:"POST"});if(!t.ok)throw new Error("Failed to start daemon");return t.json()}async function ot(){const t=await fetch(w("/copilot/daemon/stop"),{method:"POST"});if(!t.ok)throw new Error("Failed to stop daemon");return t.json()}async function lt(){const t=await fetch(w("/copilot/info"));if(!t.ok)throw new Error("Failed to fetch copilot info");return t.json()}async function rt(t){const s=await fetch(w("/copilot/install"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?{version:t}:{})});if(!s.ok)throw new Error("Failed to install copilot-api");return s.json()}function Ne(){const t=Ie(),s=D({queryKey:["copilot-status"],queryFn:Ze,refetchInterval:5e3}),o=D({queryKey:["copilot-config"],queryFn:Xe}),d=D({queryKey:["copilot-models"],queryFn:et}),r=D({queryKey:["copilot-raw-settings"],queryFn:tt}),i=D({queryKey:["copilot-info"],queryFn:lt}),c=R({mutationFn:st,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]}),t.invalidateQueries({queryKey:["copilot-config"]}),t.invalidateQueries({queryKey:["copilot-raw-settings"]})}}),a=R({mutationFn:at,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]}),t.invalidateQueries({queryKey:["copilot-config"]}),t.invalidateQueries({queryKey:["copilot-raw-settings"]})}}),p=R({mutationFn:it,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]})}}),h=R({mutationFn:nt,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]})}}),f=R({mutationFn:ot,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]})}}),u=R({mutationFn:rt,onSuccess:()=>{t.invalidateQueries({queryKey:["copilot-status"]}),t.invalidateQueries({queryKey:["copilot-info"]})}});return b.useMemo(()=>({status:s.data,statusLoading:s.isLoading,statusError:s.error,refetchStatus:s.refetch,config:o.data,configLoading:o.isLoading,models:d.data?.models??[],currentModel:d.data?.current,modelsLoading:d.isLoading,rawSettings:r.data,rawSettingsLoading:r.isLoading,refetchRawSettings:r.refetch,updateConfig:c.mutate,updateConfigAsync:c.mutateAsync,isUpdating:c.isPending,saveRawSettings:a.mutate,saveRawSettingsAsync:a.mutateAsync,isSavingRawSettings:a.isPending,startAuth:p.mutate,startAuthAsync:p.mutateAsync,isAuthenticating:p.isPending,authResult:p.data,startDaemon:h.mutate,isStartingDaemon:h.isPending,stopDaemon:f.mutate,isStoppingDaemon:f.isPending,info:i.data,infoLoading:i.isLoading,refetchInfo:i.refetch,install:u.mutate,installAsync:u.mutateAsync,isInstalling:u.isPending}),[s.data,s.isLoading,s.error,s.refetch,o.data,o.isLoading,d.data,d.isLoading,r.data,r.isLoading,r.refetch,c.mutate,c.mutateAsync,c.isPending,a.mutate,a.mutateAsync,a.isPending,p.mutate,p.mutateAsync,p.isPending,p.data,h.mutate,h.isPending,f.mutate,f.isPending,i.data,i.isLoading,i.refetch,u.mutate,u.mutateAsync,u.isPending])}function ct({rawSettings:t,rawSettingsLoading:s,isUpdating:o,isSavingRawSettings:d,hasChanges:r,isRawJsonValid:i,onRefresh:c,onSave:a}){const{t:p}=S();return e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:p("copilotConfigForm.copilotConfiguration")}),t&&e.jsx(P,{variant:"outline",className:"text-xs",children:"copilot.settings.json"})]}),t&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:["Last modified: ",t.exists?new Date(t.mtime).toLocaleString():"Never saved"]})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{variant:"ghost",size:"sm",onClick:c,disabled:s,children:e.jsx(je,{className:`w-4 h-4 ${s?"animate-spin":""}`})}),e.jsx(N,{size:"sm",onClick:a,disabled:o||d||!r||!i,children:o||d?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"w-4 h-4 mr-1 animate-spin"}),"Saving..."]}):e.jsxs(e.Fragment,{children:[e.jsx(Ue,{className:"w-4 h-4 mr-1"}),"Save"]})})]})]})}const dt=[{name:"GPT-4.1 (Free)",description:"Free tier - no premium usage",default:"gpt-4.1",opus:"gpt-4.1",sonnet:"gpt-4.1",haiku:"gpt-4.1"},{name:"GPT-5 Mini (Free)",description:"Free tier - lightweight model",default:"gpt-5-mini",opus:"gpt-5-mini",sonnet:"gpt-5-mini",haiku:"gpt-5-mini"}],mt=[{name:"Claude Opus 4.5",description:"Pro+ (3x) - Most capable reasoning",default:"claude-opus-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"},{name:"Claude Sonnet 4.5",description:"Pro+ (1x) - Balanced performance",default:"claude-sonnet-4.5",opus:"claude-opus-4.5",sonnet:"claude-sonnet-4.5",haiku:"claude-haiku-4.5"},{name:"GPT-5.2",description:"Pro+ (1x) - Latest OpenAI (Preview)",default:"gpt-5.2",opus:"gpt-5.2",sonnet:"gpt-5.1",haiku:"gpt-5-mini"},{name:"GPT-5.1 Codex Max",description:"Pro+ (1x) - Best for coding",default:"gpt-5.1-codex-max",opus:"gpt-5.1-codex-max",sonnet:"gpt-5.1-codex",haiku:"gpt-5.1-codex-mini"},{name:"Gemini 2.5 Pro",description:"Pro+ (1x) - Google latest",default:"gemini-2.5-pro",opus:"gemini-2.5-pro",sonnet:"gemini-2.5-pro",haiku:"gemini-3-flash"}];function xe(t){switch(t){case"free":return"bg-green-100 text-green-700 border-green-200";case"pro":return"bg-blue-100 text-blue-700 border-blue-200";case"pro+":return"bg-purple-100 text-purple-700 border-purple-200";case"business":return"bg-orange-100 text-orange-700 border-orange-200";case"enterprise":return"bg-red-100 text-red-700 border-red-200";default:return"bg-muted text-muted-foreground"}}function ut(t){return t==null?null:t===0?"Free":t<1?`${t}x`:t===1?"1x":`${t}x`}function H({label:t,description:s,value:o,onChange:d,models:r,disabled:i}){const{t:c}=S();return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-xs font-medium",children:t}),s&&e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s})]}),e.jsx(Ye,{value:o||void 0,onChange:d,disabled:i,placeholder:c("componentModelSelector.selectModel"),searchPlaceholder:c("searchableSelect.searchModels"),emptyText:c("searchableSelect.noResults"),triggerClassName:"h-9",groups:[{key:"models",label:c("componentModelSelector.availableModelsCount",{count:r.length})}],options:r.map(a=>({value:a.id,groupKey:"models",searchText:`${a.name||a.id} ${a.id}`,keywords:[a.minPlan??"",a.preview?"preview":""],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:a.id}),a.minPlan&&e.jsx(P,{variant:"outline",className:`text-[9px] px-1 py-0 h-4 ${xe(a.minPlan)}`,children:a.minPlan})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:a.name||a.id}),a.minPlan&&e.jsx(P,{variant:"outline",className:`text-[9px] px-1 py-0 h-4 ${xe(a.minPlan)}`,children:a.minPlan}),a.multiplier!==void 0&&e.jsx("span",{className:"text-[9px] text-muted-foreground",children:ut(a.multiplier)}),a.preview&&e.jsx(P,{variant:"secondary",className:"text-[9px] px-1 py-0 h-4",children:c("componentModelSelector.preview")})]})}))})]})}function se(t){if(t>=1e6){const s=t/1e6;return s%1===0?`${s}M`:`${s.toFixed(1)}M`}if(t>=1e3){const s=t/1e3;return s%1===0?`${s}K`:`${s.toFixed(1)}K`}return`${t}`}function pt(t){if(!t?.limits)return null;const s=[];return t.limits.maxPromptTokens&&s.push(`prompt ${se(t.limits.maxPromptTokens)}`),t.limits.maxContextWindowTokens&&s.push(`context ${se(t.limits.maxContextWindowTokens)}`),t.limits.maxOutputTokens&&s.push(`output ${se(t.limits.maxOutputTokens)}`),s.length>0?s.join(" | "):null}function xt({currentModel:t,opusModel:s,sonnetModel:o,haikuModel:d,models:r,modelsLoading:i,onApplyPreset:c,onUpdateModel:a,onUpdateOpusModel:p,onUpdateSonnetModel:h,onUpdateHaikuModel:f}){const{t:u}=S(),n=[{label:"Default",id:t},{label:"Opus",id:s||t},{label:"Sonnet",id:o||t},{label:"Haiku",id:d||t}].map(({label:l,id:x})=>{const C=r.find(F=>F.id===x),k=pt(C);return k?{label:l,id:x,limits:k}:null}).filter(l=>l!==null);return e.jsx(le,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(V,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(Qe,{className:"w-4 h-4"}),u("providerEditor.presets")]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:u("copilotConfigForm.modelMapping")}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(P,{variant:"outline",className:"text-[10px] bg-green-100 text-green-700 border-green-200",children:"Free Tier"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:u("copilotConfigForm.noPremiumUsage")})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:dt.map(l=>e.jsxs(N,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>c(l),title:l.description,children:[e.jsx(ue,{className:"w-3 h-3 text-green-600"}),l.name]},l.name))})]}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(P,{variant:"outline",className:"text-[10px] bg-blue-100 text-blue-700 border-blue-200",children:"Pro+ Required"}),e.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Uses premium request quota"})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:mt.map(l=>e.jsxs(N,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>c(l),title:l.description,children:[e.jsx(ue,{className:"w-3 h-3"}),l.name]},l.name))})]})]}),e.jsx(oe,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:u("copilotConfigForm.modelMapping")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"Configure which models to use for each tier"}),e.jsxs("div",{className:"mb-4 rounded-lg border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-900 dark:text-amber-200",children:[e.jsx("p",{className:"font-medium",children:u("copilotConfigForm.githubCopilotControls")}),e.jsx("p",{className:"mt-1",children:"CCS can switch Copilot models, but it cannot increase the provider's max prompt or context window."}),n.length>0?e.jsx("div",{className:"mt-2 space-y-1 text-[11px] font-mono",children:n.map(l=>e.jsxs("p",{children:[l.label,": ",l.id," (",l.limits,")"]},`${l.label}-${l.id}`))}):e.jsx("p",{className:"mt-2 text-[11px] font-mono",children:"Start the daemon to inspect live model limits from GitHub Copilot metadata."})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(H,{label:"Default Model",description:"Used when no specific tier is requested",value:t,onChange:a,models:r,disabled:i}),e.jsx(H,{label:"Opus (Most capable)",description:"For complex reasoning tasks",value:s||t,onChange:p,models:r,disabled:i}),e.jsx(H,{label:"Sonnet (Balanced)",description:"Balance of speed and capability",value:o||t,onChange:h,models:r,disabled:i}),e.jsx(H,{label:"Haiku (Fast)",description:"Quick responses for simple tasks",value:d||t,onChange:f,models:r,disabled:i})]})]})]})})})}function ht({enabled:t,autoStart:s,port:o,accountType:d,rateLimit:r,waitOnLimit:i,onUpdateEnabled:c,onUpdateAutoStart:a,onUpdatePort:p,onUpdateAccountType:h,onUpdateRateLimit:f,onUpdateWaitOnLimit:u}){const{t:n}=S();return e.jsx(le,{value:"settings",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx(V,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-4",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(L,{htmlFor:"enabled",className:"text-sm font-medium",children:n("copilotSettings.enableCopilot")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:n("copilotSettings.enableCopilotDesc")})]}),e.jsx(X,{id:"enabled",checked:t,onCheckedChange:c})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:n("copilotSettings.basicSettings")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"port",className:"text-xs",children:n("copilotPage.port")}),e.jsx(me,{id:"port",type:"number",value:o,onChange:l=>p(parseInt(l.target.value,10)),min:1024,max:65535,className:"max-w-[150px] h-8"})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"account-type",className:"text-xs",children:n("copilotSettings.accountType")}),e.jsxs(Fe,{value:d,onValueChange:h,children:[e.jsx(Te,{id:"account-type",className:"max-w-[150px] h-8",children:e.jsx(Me,{})}),e.jsxs(Le,{children:[e.jsx(ee,{value:"individual",children:n("copilotSettings.accountTypeIndividual")}),e.jsx(ee,{value:"business",children:n("copilotSettings.accountTypeBusiness")}),e.jsx(ee,{value:"enterprise",children:n("copilotSettings.accountTypeEnterprise")})]})]})]})]}),e.jsx(oe,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:n("copilotSettings.rateLimiting")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"rate-limit",className:"text-xs",children:n("copilotSettings.rateLimitSeconds")}),e.jsx(me,{id:"rate-limit",type:"number",value:r,onChange:l=>f(l.target.value),placeholder:n("copilotSettings.noLimit"),min:0,className:"max-w-[150px] h-8"})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(L,{htmlFor:"wait-on-limit",className:"text-xs",children:n("copilotSettings.waitOnRateLimit")}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("copilotSettings.waitOnRateLimitDesc")})]}),e.jsx(X,{id:"wait-on-limit",checked:i,onCheckedChange:u})]})]}),e.jsx(oe,{}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:n("copilotSettings.daemonSettings")}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(L,{htmlFor:"auto-start",className:"text-xs",children:n("copilotSettings.autoStartDaemon")}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:n("copilotSettings.autoStartDaemonDesc")})]}),e.jsx(X,{id:"auto-start",checked:s,onCheckedChange:a})]})]})]})})})}function G({label:t,command:s}){return e.jsxs("div",{children:[e.jsx("label",{className:"text-xs text-muted-foreground",children:t}),e.jsxs("div",{className:"mt-1 flex gap-2",children:[e.jsx("code",{className:"flex-1 px-2 py-1.5 bg-muted rounded text-xs font-mono truncate",children:s}),e.jsx(fe,{value:s,size:"icon",className:"h-6 w-6"})]})]})}function gt({rawSettings:t}){const{t:s}=S();return e.jsx(le,{value:"info",className:"h-full mt-0 border-0 p-0 data-[state=inactive]:hidden",children:e.jsx(V,{className:"h-full",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium flex items-center gap-2 mb-3",children:[e.jsx($e,{className:"w-4 h-4"}),"Configuration Info"]}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:s("copilotConfigForm.provider")}),e.jsx("span",{className:"font-mono",children:"GitHub Copilot"})]}),t&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:s("copilotConfigForm.filePath")}),e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:t.path}),e.jsx(fe,{value:t.path,size:"icon",className:"h-5 w-5"})]})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:s("copilotConfigForm.status")}),e.jsx(P,{variant:"outline",className:t.exists?"w-fit text-green-600 border-green-200 bg-green-50":"w-fit text-muted-foreground",children:t.exists?"File exists":"Using defaults"})]})]})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:s("copilotConfigForm.quickUsage")}),e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsx(G,{label:"Run with Copilot",command:"ccs copilot"}),e.jsx(G,{label:"Authenticate",command:"ccs copilot auth"}),e.jsx(G,{label:"Start daemon",command:"ccs copilot --start"}),e.jsx(G,{label:"Stop daemon",command:"ccs copilot --stop"})]})]})]})})})}const ft=["ANTHROPIC_BASE_URL","ANTHROPIC_AUTH_TOKEN"];function he(t){const s=t?.env||{};return ft.filter(o=>!s[o]?.trim())}function ge(t){if(!t||t.length===0)return[];const s=new Map;return t.forEach(o=>{s.set(o.message,o)}),[...s.values()]}function jt(){const{t}=S(),{config:s,configLoading:o,models:d,modelsLoading:r,rawSettings:i,rawSettingsLoading:c,updateConfigAsync:a,isUpdating:p,saveRawSettingsAsync:h,isSavingRawSettings:f,refetchRawSettings:u}=Ne(),[n,l]=b.useState({}),[x,C]=b.useState(null),[k,F]=b.useState(!1),K=n.enabled??s?.enabled??!1,U=n.autoStart??s?.auto_start??!1,A=n.port??s?.port??4141,Q=n.accountType??s?.account_type??"individual",E=n.model??s?.model??"claude-sonnet-4-6",O=n.rateLimit??s?.rate_limit?.toString()??"",j=n.waitOnLimit??s?.wait_on_limit??!0,$=n.opusModel??s?.opus_model??"",J=n.sonnetModel??s?.sonnet_model??"",z=n.haikuModel??s?.haiku_model??"",B=(g,v)=>{l(q=>({...q,[g]:v}))},Y=g=>{l(v=>({...v,model:g.default,opusModel:g.opus,sonnetModel:g.sonnet,haikuModel:g.haiku})),I.success(t("toasts.presetApplied",{name:g.name}))},T=b.useMemo(()=>x!==null?x:i?.settings?JSON.stringify(i.settings,null,2):`{
2
+ "env": {}
3
+ }`,[x,i]),m=b.useCallback(g=>{C(g)},[]),re=b.useMemo(()=>{try{return JSON.parse(T),!0}catch{return!1}},[T]),ye=b.useMemo(()=>{const g=Object.keys(n).length>0,v=x!==null&&x!==JSON.stringify(i?.settings,null,2);return g||v},[n,x,i]),ce=b.useMemo(()=>{if(x!==null)try{return JSON.parse(x)}catch{return i?.settings}return i?.settings},[x,i?.settings]),Se=b.useMemo(()=>he(ce),[ce]),Ce=b.useMemo(()=>ge([...s?.warnings??[],...i?.warnings??[]]),[s?.warnings,i?.warnings]),de=async({overwriteRawSettings:g=!1}={})=>{try{const v=[];if(Object.keys(n).length>0){const M=await a({enabled:K,auto_start:U,port:A,account_type:Q,model:E,rate_limit:O?parseInt(O,10):null,wait_on_limit:j,opus_model:$||void 0,sonnet_model:J||void 0,haiku_model:z||void 0});v.push(...M.warnings??[])}let q=[];if(x!==null&&re){const M=JSON.parse(T);q=he(M);const Pe=await h({settings:M,expectedMtime:g?void 0:i?.mtime});v.push(...Pe.warnings??[])}const Z=ge(v),_=[];Z.length>0&&_.push(Z.map(M=>M.message).join(" ")),q.length>0&&_.push(`Missing fields will use defaults: ${q.join(", ")}`),Z.length>0?I.warning(t("toasts.settingsSavedWithAdjustments"),{description:_.join(" ")}):_.length>0?I.success(t("toasts.settingsSaved"),{description:_.join(" ")}):I.success(t("toasts.settingsSaved")),l({}),C(null)}catch(v){Re(v)?F(!0):I.error(t("toasts.failedSaveSettings"))}};return{configLoading:o,rawSettingsLoading:c,modelsLoading:r,isUpdating:p,isSavingRawSettings:f,models:d,rawSettings:i,rawJsonContent:T,rawJsonEdits:x,enabled:K,autoStart:U,port:A,accountType:Q,currentModel:E,rateLimit:O,waitOnLimit:j,opusModel:$,sonnetModel:J,haikuModel:z,isRawJsonValid:re,hasChanges:ye,normalizationWarnings:Ce,conflictDialog:k,updateField:B,applyPreset:Y,handleRawJsonChange:m,handleSave:de,handleConflictResolve:async g=>{F(!1),g?await de({overwriteRawSettings:!0}):C(null)},refetchRawSettings:u,missingRequiredFields:Se}}function vt(){const{t}=S(),{configLoading:s,rawSettingsLoading:o,modelsLoading:d,isUpdating:r,isSavingRawSettings:i,models:c,rawSettings:a,rawJsonContent:p,rawJsonEdits:h,enabled:f,autoStart:u,port:n,accountType:l,currentModel:x,rateLimit:C,waitOnLimit:k,opusModel:F,sonnetModel:K,haikuModel:U,isRawJsonValid:A,hasChanges:Q,normalizationWarnings:E,conflictDialog:O,updateField:j,applyPreset:$,handleRawJsonChange:J,handleSave:z,handleConflictResolve:B,refetchRawSettings:Y,missingRequiredFields:T}=jt();return s||o?e.jsxs("div",{className:"space-y-6",children:[e.jsx(y,{className:"h-10 w-full"}),e.jsx(y,{className:"h-10 w-full"}),e.jsx(y,{className:"h-10 w-full"}),e.jsx(y,{className:"h-10 w-full"})]}):e.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[e.jsx(ct,{rawSettings:a,rawSettingsLoading:o,isUpdating:r,isSavingRawSettings:i,hasChanges:Q,isRawJsonValid:A,onRefresh:()=>Y(),onSave:z}),E.length>0&&e.jsx("div",{className:"px-6 pt-4 shrink-0",children:e.jsxs(Ae,{variant:"warning",children:[e.jsx(ne,{className:"h-4 w-4"}),e.jsx(Ee,{children:t("copilotConfigForm.deprecatedModels")}),e.jsxs(Oe,{className:"space-y-2",children:[e.jsx("p",{children:"Loading this page did not rewrite your files. Save the Copilot configuration to persist these replacements."}),e.jsx("div",{className:"space-y-1",children:E.map(m=>e.jsx("p",{children:m.message},m.message))})]})]})}),e.jsxs("div",{className:"flex-1 flex divide-x overflow-hidden",children:[e.jsx("div",{className:"w-[540px] shrink-0 flex flex-col overflow-hidden bg-muted/5",children:e.jsx("div",{className:"h-full flex flex-col",children:e.jsxs(qe,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(_e,{className:"w-full",children:[e.jsx(te,{value:"config",className:"flex-1",children:"Model Config"}),e.jsx(te,{value:"settings",className:"flex-1",children:"Settings"}),e.jsx(te,{value:"info",className:"flex-1",children:"Info"})]})}),e.jsxs("div",{className:"flex-1 overflow-hidden flex flex-col",children:[e.jsx(xt,{currentModel:x,opusModel:F,sonnetModel:K,haikuModel:U,models:c,modelsLoading:d,onApplyPreset:$,onUpdateModel:m=>j("model",m),onUpdateOpusModel:m=>j("opusModel",m),onUpdateSonnetModel:m=>j("sonnetModel",m),onUpdateHaikuModel:m=>j("haikuModel",m)}),e.jsx(ht,{enabled:f,autoStart:u,port:n,accountType:l,rateLimit:C,waitOnLimit:k,onUpdateEnabled:m=>j("enabled",m),onUpdateAutoStart:m=>j("autoStart",m),onUpdatePort:m=>j("port",m),onUpdateAccountType:m=>j("accountType",m),onUpdateRateLimit:m=>j("rateLimit",m),onUpdateWaitOnLimit:m=>j("waitOnLimit",m)}),e.jsx(gt,{rawSettings:a})]})]})})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(Je,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"Raw Configuration (JSON)"})]}),e.jsx(De,{rawJsonContent:p,isRawJsonValid:A,rawJsonEdits:h,rawSettingsEnv:a?.settings?.env,onChange:J,missingRequiredFields:T})]})]}),e.jsx(Ke,{open:O,title:"File Modified Externally",description:"This settings file was modified by another process. Overwrite with your changes or discard?",confirmText:"Overwrite",variant:"destructive",onConfirm:()=>B(!0),onCancel:()=>B(!1)})]})}function ae({title:t,children:s}){return e.jsxs("div",{className:"space-y-2",children:[e.jsx("div",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide px-3",children:t}),e.jsx("div",{className:"space-y-1",children:s})]})}function W({icon:t,label:s,status:o,statusText:d,variant:r="default"}){return e.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 rounded-lg bg-muted/50",children:[e.jsx(t,{className:"w-4 h-4 text-muted-foreground shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("span",{className:"text-sm",children:s})}),e.jsx("div",{className:"flex items-center gap-1.5",children:o?e.jsxs(e.Fragment,{children:[e.jsx(be,{className:ie("w-4 h-4",r==="warning"?"text-yellow-500":"text-green-500")}),e.jsx("span",{className:ie("text-xs",r==="warning"?"text-yellow-500":"text-green-500"),children:d||"Yes"})]}):e.jsxs(e.Fragment,{children:[e.jsx(we,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-xs text-muted-foreground",children:d||"No"})]})})]})}function bt(){return e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsx(y,{className:"h-8 w-full"}),e.jsx(y,{className:"h-12 w-full"}),e.jsx(y,{className:"h-12 w-full"}),e.jsx(y,{className:"h-12 w-full"})]})}function Ot(){const{t}=S(),{status:s,statusLoading:o,refetchStatus:d,startAuth:r,isAuthenticating:i,startDaemon:c,isStartingDaemon:a,stopDaemon:p,isStoppingDaemon:h,install:f,isInstalling:u}=Ne();return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ze,{className:"w-5 h-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:t("copilotPage.title")}),e.jsx("span",{className:"rounded border border-amber-300 bg-amber-100 px-1.5 py-0.5 text-[10px] font-medium uppercase tracking-wide text-amber-800 dark:border-amber-900/60 dark:bg-amber-950/40 dark:text-amber-200",children:t("copilotPage.deprecatedBadge")})]}),e.jsx(N,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>d(),disabled:o,children:e.jsx(je,{className:ie("w-4 h-4",o&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("copilotPage.subtitle")})]}),e.jsx(V,{className:"flex-1",children:o?e.jsx(bt,{}):e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-amber-500/50 bg-amber-500/15 p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-4 w-4 text-amber-600 dark:text-amber-400 shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-amber-800 dark:text-amber-200",children:t("copilotPage.deprecationTitle")})]}),e.jsxs("ul",{className:"text-[11px] text-amber-700 dark:text-amber-300 space-y-0.5 pl-6 list-disc",children:[e.jsx("li",{children:t("copilotPage.deprecationItem1")}),e.jsx("li",{children:t("copilotPage.deprecationItem2")}),e.jsx("li",{children:t("copilotPage.deprecationItem3")})]})]}),e.jsxs("div",{className:"rounded-md border border-yellow-500/50 bg-yellow-500/15 p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(ne,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400 shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-yellow-800 dark:text-yellow-200",children:t("copilotPage.unofficialTitle")})]}),e.jsxs("ul",{className:"text-[11px] text-yellow-700 dark:text-yellow-300 space-y-0.5 pl-6 list-disc",children:[e.jsx("li",{children:t("copilotPage.unofficialItem1")}),e.jsx("li",{children:t("copilotPage.unofficialItem2")}),e.jsx("li",{children:t("copilotPage.unofficialItem3")})]})]}),e.jsxs(ae,{title:t("copilotPage.setup"),children:[e.jsx(W,{icon:Be,label:"copilot-api",status:s?.installed??!1,statusText:s?.installed?s.version?`v${s.version}`:t("copilotPage.installed"):t("copilotPage.missing")}),!s?.installed&&e.jsx(N,{size:"sm",className:"w-full mt-2",onClick:()=>f(void 0),disabled:u,children:u?e.jsxs(e.Fragment,{children:[e.jsx(ve,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}),t("copilotPage.installing")]}):e.jsxs(e.Fragment,{children:[e.jsx(He,{className:"w-3.5 h-3.5 mr-1.5"}),t("copilotPage.installCopilotApi")]})}),s?.installed&&e.jsx(W,{icon:pe,label:t("copilotPage.integration"),status:s?.enabled??!1,statusText:s?.enabled?t("copilotPage.enabled"):t("copilotPage.disabled")})]}),s?.installed&&e.jsxs(ae,{title:t("copilotPage.auth"),children:[e.jsx(W,{icon:Ge,label:t("copilotPage.github"),status:s?.authenticated??!1,statusText:s?.authenticated?t("copilotPage.connected"):t("copilotPage.notConnected")}),!s?.authenticated&&e.jsx(N,{size:"sm",className:"w-full mt-2",onClick:()=>r(),disabled:i,children:t(i?"copilotPage.authenticating":"copilotPage.authenticate")})]}),s?.authenticated&&e.jsxs(ae,{title:t("copilotPage.daemon"),children:[e.jsx(W,{icon:We,label:t("copilotPage.status"),status:s?.daemon_running??!1,statusText:s?.daemon_running?t("copilotPage.running"):t("copilotPage.stopped")}),e.jsxs("div",{className:"px-3 py-1 text-xs text-muted-foreground",children:[t("copilotPage.port"),": ",s?.port??4141]}),e.jsx("div",{className:"px-1",children:s?.daemon_running?e.jsxs(N,{size:"sm",variant:"outline",className:"w-full",onClick:()=>p(),disabled:h,children:[e.jsx(Ve,{className:"w-3.5 h-3.5 mr-1.5"}),t(h?"copilotPage.stopping":"copilotPage.stop")]}):e.jsxs(N,{size:"sm",variant:"outline",className:"w-full",onClick:()=>c(),disabled:a,children:[e.jsx(pe,{className:"w-3.5 h-3.5 mr-1.5"}),t(a?"copilotPage.starting":"copilotPage.start")]})})]})]})}),e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:t("copilotPage.proxy")}),s?.daemon_running?e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(be,{className:"w-3 h-3 text-green-500"}),t("copilotPage.active")]}):e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(we,{className:"w-3 h-3 text-muted-foreground"}),t("copilotPage.inactive")]})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:e.jsx(vt,{})})]})}export{Ot as CopilotPage};
@@ -0,0 +1 @@
1
+ import{j as e}from"./radix-ui-DvRtHWGI.js";import{r as y,e as gs}from"./react-vendor-Bjx91N7w.js";import{t as i}from"./notifications-B4_o8bcr.js";import{bf as b,bg as xs,a as Ee,B as M,e as h,c as V,E as $,Y as hs,Z as fs,_ as ue,$ as me,L,I as ge,aH as Fe,bl as ps,D as js,k as Ps,l as ys,m as bs,n as Ns,aC as vs,bh as ws}from"./index-7dfuc3Cf.js";import{a as Cs,u as B,b as R}from"./tanstack-Dg84L5cM.js";import{D as Oe}from"./default-ports-1QQSffYX.js";import{S as Ss}from"./separator-avUMnKG4.js";import{S as ks}from"./searchable-select-C8BA2Q6i.js";import{R as Le,T as _s,K as z,Z as H,ah as As,ad as Ds,ay as xe,aQ as Ie,aP as Ms,L as F,I as Ts,av as Rs,a9 as Fs,w as Ls,D as Is}from"./icons-bxdfpJdB.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";const N="/legacy/cursor";function Es(s){if(!s||typeof s!="object")return!1;const t=s;return typeof t.message=="string"&&typeof t.stage=="string"&&typeof t.status=="number"&&typeof t.duration_ms=="number"&&typeof t.ok=="boolean"}function Os(s){if(!s||typeof s!="object"||!("error"in s))return null;const t=s;return typeof t.error=="string"?t.error:null}async function zs(){const s=await fetch(b(`${N}/status`));if(!s.ok)throw new Error("Failed to fetch cursor status");return s.json()}async function Ks(){const s=await fetch(b(`${N}/settings`));if(!s.ok)throw new Error("Failed to fetch cursor config");return s.json()}async function qs(){const s=await fetch(b(`${N}/models`));if(!s.ok)throw new Error("Failed to fetch cursor models");return s.json()}async function Gs(){const s=await fetch(b(`${N}/settings/raw`));if(!s.ok)throw new Error("Failed to fetch cursor raw settings");return s.json()}async function Qs(s){const t=await fetch(b(`${N}/settings`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!t.ok)throw new Error("Failed to update cursor config");return t.json()}async function $s(s){const t=await fetch(b(`${N}/settings/raw`),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(t.status===409)throw new xs("Cursor raw settings changed externally");if(!t.ok)throw new Error("Failed to save cursor raw settings");return t.json()}async function Bs(){const s=await fetch(b(`${N}/auth/auto-detect`),{method:"POST"});if(!s.ok){const t=await s.json().catch(()=>({error:"Auto-detect failed"}));throw new Error(t.error||"Auto-detect failed")}return s.json()}async function Hs(s){const t=await fetch(b(`${N}/auth/import`),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(!t.ok){const r=await t.json().catch(()=>({error:"Manual import failed"}));throw new Error(r.error||"Manual import failed")}return t.json()}async function Us(){const s=await fetch(b(`${N}/daemon/start`),{method:"POST"});if(!s.ok)throw new Error("Failed to start cursor daemon");return s.json()}async function Js(){const s=await fetch(b(`${N}/daemon/stop`),{method:"POST"});if(!s.ok)throw new Error("Failed to stop cursor daemon");return s.json()}async function Vs(){const s=await fetch(b(`${N}/probe`),{method:"POST"}),t=await s.json().catch(()=>null);return Es(t)?t:{ok:!1,stage:"runtime",status:s.status,duration_ms:0,error_type:"runtime_error",message:Os(t)??"Failed to run live probe"}}function Zs(){const s=Cs(),t=B({queryKey:["cursor-status"],queryFn:zs,refetchInterval:5e3}),r=B({queryKey:["cursor-config"],queryFn:Ks}),u=B({queryKey:["cursor-models"],queryFn:qs}),x=B({queryKey:["cursor-raw-settings"],queryFn:Gs}),c=()=>{s.invalidateQueries({queryKey:["cursor-status"]}),s.invalidateQueries({queryKey:["cursor-config"]}),s.invalidateQueries({queryKey:["cursor-models"]}),s.invalidateQueries({queryKey:["cursor-raw-settings"]})},f=R({mutationFn:Qs,onSuccess:c}),g=R({mutationFn:$s,onSuccess:c}),p=R({mutationFn:Bs,onSuccess:c}),n=R({mutationFn:Hs,onSuccess:c}),l=R({mutationFn:Us,onSuccess:c}),d=R({mutationFn:Js,onSuccess:c}),m=R({mutationFn:Vs,onSettled:()=>{s.invalidateQueries({queryKey:["cursor-status"]}),s.invalidateQueries({queryKey:["cursor-models"]})}});return y.useMemo(()=>({status:t.data,statusLoading:t.isLoading,statusError:t.error,refetchStatus:t.refetch,config:r.data,configLoading:r.isLoading,refetchConfig:r.refetch,models:u.data?.models??[],currentModel:u.data?.current??null,modelsLoading:u.isLoading,rawSettings:x.data,rawSettingsLoading:x.isLoading,refetchRawSettings:x.refetch,updateConfig:f.mutate,updateConfigAsync:f.mutateAsync,isUpdatingConfig:f.isPending,saveRawSettings:g.mutate,saveRawSettingsAsync:g.mutateAsync,isSavingRawSettings:g.isPending,autoDetectAuth:p.mutate,autoDetectAuthAsync:p.mutateAsync,isAutoDetectingAuth:p.isPending,autoDetectAuthResult:p.data,importManualAuth:n.mutate,importManualAuthAsync:n.mutateAsync,isImportingManualAuth:n.isPending,manualAuthResult:n.data,startDaemon:l.mutate,startDaemonAsync:l.mutateAsync,isStartingDaemon:l.isPending,stopDaemon:d.mutate,stopDaemonAsync:d.mutateAsync,isStoppingDaemon:d.isPending,runProbe:m.mutate,runProbeAsync:m.mutateAsync,isRunningProbe:m.isPending,probeResult:m.data,resetProbe:m.reset}),[t.data,t.isLoading,t.error,t.refetch,r.data,r.isLoading,r.refetch,u.data,u.isLoading,x.data,x.isLoading,x.refetch,f.mutate,f.mutateAsync,f.isPending,g.mutate,g.mutateAsync,g.isPending,p.mutate,p.mutateAsync,p.isPending,p.data,n.mutate,n.mutateAsync,n.isPending,n.data,l.mutate,l.mutateAsync,l.isPending,d.mutate,d.mutateAsync,d.isPending,m.mutate,m.mutateAsync,m.isPending,m.data,m.reset])}function he(s,t){return JSON.stringify({enabled:s?.enabled??null,authenticated:s?.authenticated??null,token_expired:s?.token_expired??null,daemon_running:s?.daemon_running??null,port:s?.port??null,ghost_mode:s?.ghost_mode??null,auto_start:t?.auto_start??null,model:t?.model??null})}function U(s){return{port:String(s?.port??Oe),auto_start:s?.auto_start??!1,ghost_mode:s?.ghost_mode??!0,model:s?.model?.trim()||"gpt-5.3-codex",opus_model:s?.opus_model?.trim()||"",sonnet_model:s?.sonnet_model?.trim()||"",haiku_model:s?.haiku_model?.trim()||""}}function S(s,t,r){return s.find(x=>t.some(c=>c.test(x.id)))?.id??r}function fe(s){return s.toLowerCase().replace(/[^a-z0-9]/g,"")}function k(s,t,r){const u=new Set(t.map(fe)),x=s.find(f=>u.has(fe(f.id)));if(x)return x.id;const c=s.find(f=>u.has(fe(f.name)));return c?c.id:r}function Ws(s){try{const t=JSON.parse(s||"{}");return!t||typeof t!="object"||Array.isArray(t)?{isValid:!1,error:"Raw settings must be a JSON object"}:{isValid:!0,settings:t}}catch(t){return{isValid:!1,error:t.message||"Invalid JSON"}}}function J({label:s,description:t,value:r,models:u,disabled:x,allowDefaultFallback:c=!1,onChange:f}){const{t:g}=Ee(),p=r||(c?"__default":""),n=y.useMemo(()=>{const l=u.map(d=>({value:d.id,groupKey:"models",searchText:`${d.name||d.id} ${d.id}`,keywords:[d.provider],triggerContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate font-mono text-xs",children:d.name||d.id}),d.provider&&e.jsx(M,{variant:"outline",className:"text-[9px] h-4 px-1 capitalize",children:d.provider})]}),itemContent:e.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[e.jsx("span",{className:"truncate text-xs font-mono",children:d.name||d.id}),e.jsx(M,{variant:"outline",className:"text-[9px] h-4 px-1 capitalize",children:d.provider})]})}));return c?[{value:"__default",groupKey:"models",searchText:g("cursorPage.useDefaultModel"),triggerContent:e.jsx("span",{className:"truncate font-mono text-xs",children:g("cursorPage.useDefaultModel")}),itemContent:e.jsx("span",{children:g("cursorPage.useDefaultModel")})},...l]:l},[c,u,g]);return e.jsxs("div",{className:"space-y-1.5",children:[e.jsxs("div",{children:[e.jsx(L,{className:"text-xs font-medium",children:s}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:t})]}),e.jsx(ks,{value:p||void 0,onChange:l=>{if(c&&l==="__default"){f("");return}f(l)},disabled:x,placeholder:g("cursorPage.selectModel"),searchPlaceholder:g("searchableSelect.searchModels"),emptyText:g("searchableSelect.noResults"),triggerClassName:"h-9",groups:[{key:"models",label:g("cursorPage.availableModelCount",{count:u.length})}],options:n})]})}function pe({icon:s,label:t,ok:r,detail:u}){return e.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-muted/50 px-3 py-2",children:[e.jsx(s,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("div",{className:"flex-1 min-w-0",children:e.jsx("p",{className:"text-sm",children:t})}),e.jsxs("div",{className:"flex items-center gap-1.5",children:[r?e.jsx(Ls,{className:"h-4 w-4 text-green-500"}):e.jsx(Is,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:V("text-xs",r?"text-green-500":"text-muted-foreground"),title:u,children:u})]})]})}function da(){const{t:s}=Ee(),t=gs(),{status:r,statusLoading:u,refetchStatus:x,config:c,refetchConfig:f,updateConfigAsync:g,isUpdatingConfig:p,models:n,modelsLoading:l,currentModel:d,rawSettings:m,rawSettingsLoading:je,refetchRawSettings:ze,saveRawSettingsAsync:Ke,isSavingRawSettings:Pe,autoDetectAuthAsync:qe,isAutoDetectingAuth:ye,importManualAuthAsync:Ge,isImportingManualAuth:be,startDaemonAsync:Qe,isStartingDaemon:$e,stopDaemonAsync:Be,isStoppingDaemon:Ne,runProbeAsync:He,isRunningProbe:Z,probeResult:W,resetProbe:Ue}=Zs(),[T,X]=y.useState(()=>U()),[v,Y]=y.useState(!1),[ve,Je]=y.useState("{}"),[I,ee]=y.useState(!1),[Ve,K]=y.useState(!1),[se,we]=y.useState(""),[ae,Ce]=y.useState(""),[Se,ke]=y.useState(()=>W?he(r,c):null),_=U(c),_e=v?T.port:_.port,te=v?T.auto_start:_.auto_start,re=v?T.ghost_mode:_.ghost_mode,w=v?T.model:_.model,ne=v?T.opus_model:_.opus_model,oe=v?T.sonnet_model:_.sonnet_model,ie=v?T.haiku_model:_.haiku_model,ce=I?ve:JSON.stringify(m?.settings??{},null,2),Ae=!!m,E=y.useMemo(()=>Ws(ce),[ce]),De=E.isValid,q=v||I,Ze=!I||Ae&&De,We=he(r,c),P=W&&!q&&Se!==null&&Se===We?W:null,G=y.useMemo(()=>{const a=new Set,o=[...n].sort((D,de)=>D.name.localeCompare(de.name)),j=o.filter(D=>a.has(D.id)?!1:(a.add(D.id),!0));return w&&!o.some(D=>D.id===w)?[{id:w,name:w,provider:"custom"},...j]:j},[n,w]),C=a=>{X(o=>a(v?o:_)),Y(!0)},A=()=>{Ue(),ke(null)},Xe=(a=c)=>{X(U(a)),Y(!1)},Ye=!!(r?.enabled&&r?.authenticated&&!r?.token_expired),es=y.useMemo(()=>r?.enabled?e.jsx(M,{children:s("cursorPage.enabled")}):e.jsx(M,{variant:"secondary",children:s("cursorPage.disabled")}),[r?.enabled,s]),ss=async({suppressSuccessToast:a=!1}={})=>{const o=Number(_e);if(!Number.isInteger(o)||o<1||o>65535)return i.error(s("cursorPage.invalidPort")),!1;if(!w.trim())return i.error(s("cursorPage.defaultModelRequired")),!1;try{return await g({port:o,auto_start:te,ghost_mode:re,model:w,opus_model:ne||void 0,sonnet_model:oe||void 0,haiku_model:ie||void 0}),Y(!1),X(U({port:o,auto_start:te,ghost_mode:re,model:w,opus_model:ne||void 0,sonnet_model:oe||void 0,haiku_model:ie||void 0})),A(),a||i.success(s("cursorPage.savedConfig")),!0}catch(j){return i.error(j.message||s("cursorPage.failedSaveConfig")),!1}},le=a=>{if(l){i.error(s("cursorPage.modelsLoadingWait"));return}if(n.length===0){i.error(s("cursorPage.noModelsAvailable"));return}const o=w||d||n[0]?.id||"gpt-5.3-codex",j=k(n,["gpt-5.3-codex","gpt53codex","GPT-5.3 Codex"],S(n,[/gpt[-.]?5.*codex/i],o)),D=k(n,["gpt-5.1-codex-max","gpt51codexmax","GPT-5.1 Codex Max"],S(n,[/gpt[-.]?5.*codex.*max/i],j)),de=k(n,["gpt-5-fast","gpt5fast","GPT-5 Fast"],S(n,[/gpt[-.]?5.*fast/i],j)),ds=k(n,["gpt-5-mini","gpt5mini","GPT-5 Mini"],S(n,[/gpt[-.]?5.*mini/i],de)),Te=k(n,["claude-4.6-opus","claude46opus","Claude 4.6 Opus"],S(n,[/claude[-.]?4\.?6.*opus/i,/claude.*opus/i],j)),Re=k(n,["claude-4.5-sonnet","claude45sonnet","Claude 4.5 Sonnet"],S(n,[/claude[-.]?4\.?5.*sonnet/i,/claude.*sonnet/i],j)),us=k(n,["claude-4.5-haiku","claude45haiku","Claude 4.5 Haiku"],S(n,[/claude[-.]?4\.?5.*haiku/i,/haiku/i],Re)),Q=k(n,["gemini-3-pro","gemini3pro","Gemini 3 Pro"],S(n,[/gemini[-.]?3.*pro/i],j)),ms=k(n,["gemini-3-flash","gemini3flash","Gemini 3 Flash"],S(n,[/gemini[-.]?3.*flash/i,/gemini[-.]?2\.?5.*flash/i],Q));if(a==="codex53"){C(O=>({...O,model:j,opus_model:D,sonnet_model:j,haiku_model:ds})),i.success(s("cursorPage.appliedCodexPreset"));return}if(a==="claude46"){C(O=>({...O,model:Te,opus_model:Te,sonnet_model:Re,haiku_model:us})),i.success(s("cursorPage.appliedClaudePreset"));return}C(O=>({...O,model:Q,opus_model:Q,sonnet_model:Q,haiku_model:ms})),i.success(s("cursorPage.appliedGeminiPreset"))},Me=async a=>{try{await g({enabled:a}),A(),i.success(s(a?"cursorPage.integrationEnabled":"cursorPage.integrationDisabled"))}catch(o){i.error(o.message||s("cursorPage.failedUpdateIntegration"))}},as=async()=>{try{await qe(),A(),i.success(s("cursorPage.credentialsImported"))}catch(a){i.error(a.message||s("cursorPage.autoDetectFailed"))}},ts=async()=>{if(!se.trim()||!ae.trim()){i.error(s("cursorPage.manualRequired"));return}try{await Ge({accessToken:se.trim(),machineId:ae.trim()}),A(),i.success(s("cursorPage.credentialsImported")),K(!1),we(""),Ce("")}catch(a){i.error(a.message||s("cursorPage.manualImportFailed"))}},rs=async()=>{try{const a=await Qe();if(!a.success){i.error(a.error||s("cursorPage.failedStartDaemon"));return}A(),i.success(a.pid?s("cursorPage.daemonStartedWithPid",{pid:a.pid}):s("cursorPage.daemonStarted"))}catch(a){i.error(a.message||s("cursorPage.failedStartDaemon"))}},ns=async()=>{try{const a=await Be();if(!a.success){i.error(a.error||s("cursorPage.failedStopDaemon"));return}A(),i.success(s("cursorPage.daemonStopped"))}catch(a){i.error(a.message||s("cursorPage.failedStopDaemon"))}},os=async()=>{if(q){i.error(s("cursorPage.probeSaveFirst"));return}try{const a=await He(),o=await x();if(ke(he(o.data??r,c)),a.ok){i.success(s("cursorPage.probeSucceeded"));return}i.error(a.message||s("cursorPage.probeFailed"))}catch(a){i.error(a.message||s("cursorPage.probeFailed"))}},is=async({suppressSuccessToast:a=!1}={})=>{if(!Ae)return i.error(s("cursorPage.rawLoading")),!1;if(!E.isValid||!E.settings)return i.error(E.error||s("cursorPage.invalidJson")),!1;try{return await Ke({settings:E.settings,expectedMtime:m?.mtime}),ee(!1),A(),a||i.success(s("cursorPage.rawSaved")),!0}catch(o){return ws(o)?i.error(s("cursorPage.rawChanged")):i.error(o.message||s("cursorPage.failedSaveRaw")),!1}},cs=async()=>{if(!q)return;const a=v,o=I;a&&!await ss({suppressSuccessToast:o})||o&&!await is({suppressSuccessToast:a})||a&&o&&i.success(s("cursorPage.savedAll"))},ls=async()=>{ee(!1),A();const[,a]=await Promise.all([x(),f(),ze()]);Xe(a.data??c)};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r flex flex-col bg-muted/30 shrink-0",children:[e.jsxs("div",{className:"p-4 border-b bg-background",children:[e.jsxs("div",{className:"flex items-center justify-between mb-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("img",{src:"/assets/sidebar/cursor.svg",alt:"",className:"w-5 h-5 object-contain shrink-0"}),e.jsx("h1",{className:"font-semibold",children:s("cursorPage.title")}),e.jsx(M,{variant:"outline",className:"h-5 border-red-500/50 bg-red-500/10 px-1.5 text-[10px] font-semibold uppercase tracking-wide text-red-700 dark:text-red-300",children:s("cursorPage.deprecated")}),es]}),e.jsx(h,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>x(),disabled:u,"aria-label":s("cursorPage.refreshStatus"),title:s("cursorPage.refreshStatus"),children:e.jsx(Le,{className:V("w-4 h-4",u&&"animate-spin")})})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("cursorPage.subtitle")})]}),e.jsx($,{className:"flex-1",children:e.jsxs("div",{className:"p-3 space-y-4",children:[e.jsxs("div",{className:"rounded-md border border-yellow-500/50 bg-yellow-500/15 p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(_s,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-400 shrink-0"}),e.jsx("span",{className:"text-xs font-semibold text-yellow-800 dark:text-yellow-200",children:s("cursorPage.unofficialTitle")})]}),e.jsxs("ul",{className:"text-[11px] text-yellow-700 dark:text-yellow-300 space-y-0.5 pl-6 list-disc",children:[e.jsx("li",{children:s("cursorPage.unofficialItem1")}),e.jsx("li",{children:s("cursorPage.unofficialItem2")}),e.jsx("li",{children:s("cursorPage.unofficialItem3")})]})]}),e.jsxs("div",{className:"rounded-md border border-border/70 bg-background/90 p-3 space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("cursorPage.supportedPathTitle")}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("cursorPage.supportedPathDesc")})]}),e.jsxs("div",{className:"grid gap-2",children:[e.jsxs(h,{size:"sm",className:"w-full",onClick:()=>t("/cliproxy?provider=cursor&action=auth"),children:[e.jsx(z,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.startCliproxyAuth")]}),e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:()=>t("/cliproxy?provider=cursor"),children:[e.jsx(H,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.openCliproxyCursor")]})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(pe,{icon:As,label:s("cursorPage.integration"),ok:!!r?.enabled,detail:r?.enabled?s("cursorPage.enabled"):s("cursorPage.disabled")}),e.jsx(pe,{icon:z,label:s("cursorPage.authentication"),ok:!!(r?.authenticated&&!r?.token_expired),detail:r?.authenticated?r?.token_expired?s("cursorPage.expired"):r.auth_method??s("cursorPage.connected"):s("cursorPage.notConnected")}),e.jsx(pe,{icon:Ds,label:s("cursorPage.daemon"),ok:!!r?.daemon_running,detail:r?.daemon_running?s("cursorPage.running"):s("cursorPage.stopped")})]}),e.jsxs("div",{className:"rounded-md border bg-background/80 p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(xe,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-muted-foreground",children:s("cursorPage.liveProbe")})]}),e.jsx(M,{variant:P?"outline":"secondary",className:V(P?.ok&&"border-green-500/40 text-green-600 dark:text-green-300",P&&!P.ok&&"border-red-500/40 text-red-600 dark:text-red-300"),children:P?P.ok?s("cursorPage.probeSucceeded"):s("cursorPage.probeFailed"):s("cursorPage.probeNotRun")})]}),P?e.jsxs("div",{className:"space-y-1 text-xs",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:s("cursorPage.probeStage")}),e.jsx("span",{className:"font-mono uppercase",children:P.stage})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:s("cursorPage.probeHttpStatus")}),e.jsx("span",{className:"font-mono",children:P.status})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:s("cursorPage.probeDuration")}),e.jsxs("span",{className:"font-mono",children:[P.duration_ms," ms"]})]}),P.model?e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("span",{className:"text-muted-foreground",children:s("cursorPage.probeModel")}),e.jsx("span",{className:"font-mono text-[11px] text-right break-all",children:P.model})]}):null,e.jsxs("div",{className:"space-y-1 pt-1",children:[e.jsx("span",{className:"text-muted-foreground",children:s("cursorPage.probeMessage")}),e.jsx("p",{className:"text-[11px] leading-relaxed break-words",children:P.message})]})]}):e.jsx("p",{className:"text-xs text-muted-foreground",children:s("cursorPage.probeNotRun")}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:s("cursorPage.probeLocalReadinessHint")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs font-medium text-muted-foreground uppercase tracking-wide",children:s("cursorPage.actions")}),r?.enabled?e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:()=>Me(!1),disabled:p,children:[e.jsx(Ie,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.disableIntegration")]}):e.jsxs(h,{size:"sm",className:"w-full",onClick:()=>Me(!0),disabled:p,children:[e.jsx(Ms,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.enableIntegration")]}),e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:as,disabled:ye,children:[ye?e.jsx(F,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}):e.jsx(z,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.autoDetectAuth")]}),e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:()=>K(!0),children:[e.jsx(z,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.manualAuthImport")]}),e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:os,disabled:Z,children:[Z?e.jsx(F,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}):e.jsx(xe,{className:"w-3.5 h-3.5 mr-1.5"}),s(Z?"cursorPage.probing":P?"cursorPage.rerunLiveProbe":"cursorPage.runLiveProbe")]}),r?.daemon_running?e.jsxs(h,{variant:"outline",size:"sm",className:"w-full",onClick:ns,disabled:Ne,children:[Ne?e.jsx(F,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}):e.jsx(Ie,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.stopDaemon")]}):e.jsxs(h,{size:"sm",className:"w-full",onClick:rs,disabled:!Ye,children:[$e?e.jsx(F,{className:"w-3.5 h-3.5 mr-1.5 animate-spin"}):e.jsx(Ts,{className:"w-3.5 h-3.5 mr-1.5"}),s("cursorPage.startDaemon")]})]})]})}),e.jsx("div",{className:"p-3 border-t bg-background text-xs text-muted-foreground",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{children:s("cursorPage.port")}),e.jsx("span",{children:r?.port??c?.port??Oe})]})})]}),e.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-background overflow-hidden",children:e.jsxs("div",{className:"flex-1 min-h-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-4 border-b bg-background flex items-center justify-between shrink-0",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-lg font-semibold",children:s("cursorPage.configuration")}),m&&e.jsx(M,{variant:"outline",className:"text-xs",children:"cursor.settings.json"})]}),m&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-0.5",children:[s("cursorPage.lastModified")," ",m.exists?new Date(m.mtime).toLocaleString():s("cursorPage.neverSaved")]})]})}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(h,{variant:"ghost",size:"sm",onClick:ls,disabled:u||je,"aria-label":s("cursorPage.refreshConfiguration"),title:s("cursorPage.refreshConfiguration"),children:e.jsx(Le,{className:V("w-4 h-4",(u||je)&&"animate-spin")})}),e.jsx(h,{size:"sm",onClick:cs,disabled:p||Pe||!q||!Ze,children:p||Pe?e.jsxs(e.Fragment,{children:[e.jsx(F,{className:"w-4 h-4 mr-1 animate-spin"}),s("cursorPage.saving")]}):e.jsxs(e.Fragment,{children:[e.jsx(Rs,{className:"w-4 h-4 mr-1"}),s("cursorPage.save")]})})]})]}),e.jsxs("div",{className:"flex-1 min-h-0 flex divide-x overflow-hidden",children:[e.jsx("div",{className:"w-[540px] shrink-0 flex flex-col min-h-0 overflow-hidden bg-muted/5",children:e.jsxs(hs,{defaultValue:"config",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(fs,{className:"w-full",children:[e.jsx(ue,{value:"config",className:"flex-1",children:s("cursorPage.modelConfig")}),e.jsx(ue,{value:"settings",className:"flex-1",children:s("cursorPage.settings")}),e.jsx(ue,{value:"info",className:"flex-1",children:s("cursorPage.info")})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col",children:[e.jsx(me,{value:"config",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx($,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{children:[e.jsxs("h3",{className:"text-sm font-medium mb-2 flex items-center gap-2",children:[e.jsx(Fs,{className:"w-4 h-4"}),s("cursorPage.presets")]}),e.jsx("p",{className:"text-xs text-muted-foreground mb-3",children:s("cursorPage.presetsDesc")}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsxs(h,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>le("codex53"),disabled:l||n.length===0,title:"OpenAI-only mapping: GPT-5.3 Codex / Codex Max / GPT-5 Mini",children:[e.jsx(H,{className:"w-3 h-3"}),"GPT-5.3 Codex"]}),e.jsxs(h,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>le("claude46"),disabled:l||n.length===0,title:"Claude-first mapping: Opus 4.6 / Sonnet 4.5 / Haiku 4.5",children:[e.jsx(H,{className:"w-3 h-3"}),"Claude 4.6"]}),e.jsxs(h,{variant:"outline",size:"sm",className:"text-xs h-7 gap-1",onClick:()=>le("gemini3"),disabled:l||n.length===0,title:"Gemini-first mapping: Gemini 3 Pro + Gemini 3 Flash",children:[e.jsx(H,{className:"w-3 h-3"}),"Gemini 3 Pro"]})]})]}),e.jsx(Ss,{}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-2",children:s("cursorPage.modelMapping")}),e.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:s("cursorPage.modelMappingDesc")}),e.jsxs("div",{className:"space-y-4",children:[e.jsx(J,{label:s("cursorPage.defaultModel"),description:s("cursorPage.defaultModelDesc"),value:w,models:G,disabled:l,onChange:a=>{C(o=>({...o,model:a}))}}),e.jsx(J,{label:s("cursorPage.opusModel"),description:s("cursorPage.opusModelDesc"),value:ne,models:G,disabled:l,allowDefaultFallback:!0,onChange:a=>{C(o=>({...o,opus_model:a}))}}),e.jsx(J,{label:s("cursorPage.sonnetModel"),description:s("cursorPage.sonnetModelDesc"),value:oe,models:G,disabled:l,allowDefaultFallback:!0,onChange:a=>{C(o=>({...o,sonnet_model:a}))}}),e.jsx(J,{label:s("cursorPage.haikuModel"),description:s("cursorPage.haikuModelDesc"),value:ie,models:G,disabled:l,allowDefaultFallback:!0,onChange:a=>{C(o=>({...o,haiku_model:a}))}})]})]})]})})}),e.jsx(me,{value:"settings",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx($,{className:"flex-1",children:e.jsx("div",{className:"p-4 space-y-6",children:e.jsxs("div",{className:"space-y-4",children:[e.jsx("h3",{className:"text-sm font-medium",children:s("cursorPage.runtimeSettings")}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(L,{htmlFor:"cursor-port",className:"text-xs",children:s("cursorPage.port")}),e.jsx(ge,{id:"cursor-port",type:"number",min:1,max:65535,className:"max-w-[150px] h-8",value:_e,onChange:a=>{C(o=>({...o,port:a.target.value}))}})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(L,{htmlFor:"cursor-auto-start",className:"text-xs",children:s("cursorPage.autoStartDaemon")}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s("cursorPage.autoStartDesc")})]}),e.jsx(Fe,{id:"cursor-auto-start",checked:te,onCheckedChange:a=>{C(o=>({...o,auto_start:a}))}})]}),e.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(L,{htmlFor:"cursor-ghost-mode",className:"text-xs",children:s("cursorPage.ghostMode")}),e.jsx("p",{className:"text-[10px] text-muted-foreground",children:s("cursorPage.ghostModeDesc")})]}),e.jsx(Fe,{id:"cursor-ghost-mode",checked:re,onCheckedChange:a=>{C(o=>({...o,ghost_mode:a}))}})]})]})})})}),e.jsx(me,{value:"info",className:"flex-1 mt-0 border-0 p-0 data-[state=inactive]:hidden flex flex-col overflow-hidden",children:e.jsx($,{className:"flex-1",children:e.jsxs("div",{className:"p-4 space-y-6",children:[e.jsxs("div",{className:"space-y-3 bg-card rounded-lg border p-4 shadow-sm",children:[e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:s("cursorPage.provider")}),e.jsx("span",{className:"font-mono",children:"Cursor IDE (Legacy)"})]}),e.jsxs("div",{className:"grid grid-cols-[100px_1fr] gap-2 text-sm items-center",children:[e.jsx("span",{className:"font-medium text-muted-foreground",children:s("cursorPage.filePath")}),e.jsx("code",{className:"bg-muted px-1.5 py-0.5 rounded text-xs break-all",children:m?.path??"~/.ccs/cursor.settings.json"})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Legacy bridge model mapping writes `ANTHROPIC_MODEL`, `ANTHROPIC_DEFAULT_OPUS_MODEL`, `ANTHROPIC_DEFAULT_SONNET_MODEL`, and `ANTHROPIC_DEFAULT_HAIKU_MODEL` in `cursor.settings.json`."})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-sm font-medium mb-3",children:s("cursorPage.availableModels")}),l?e.jsxs("div",{className:"flex items-center gap-2 text-muted-foreground",children:[e.jsx(F,{className:"w-4 h-4 animate-spin"}),s("cursorPage.loadingModels")]}):n.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("cursorPage.noModels")}):e.jsx("div",{className:"space-y-2",children:n.map(a=>e.jsxs("div",{className:"rounded-lg border px-3 py-2 flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:a.id}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[a.name," • ",a.provider]})]}),a.id===d&&e.jsx(M,{children:s("cursorPage.default")})]},a.id))})]})]})})})]})]})}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"px-6 py-2 bg-muted/30 border-b flex items-center gap-2 shrink-0 h-[45px]",children:[e.jsx(xe,{className:"w-4 h-4 text-muted-foreground"}),e.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:s("cursorPage.rawConfiguration")})]}),e.jsx(ps,{rawJsonContent:ce,isRawJsonValid:De,rawJsonEdits:I?ve:null,rawSettingsEnv:m?.settings?.env,onChange:a=>{ee(!0),Je(a)}})]})]})]})})]}),e.jsx(js,{open:Ve,onOpenChange:K,children:e.jsxs(Ps,{children:[e.jsxs(ys,{children:[e.jsx(bs,{children:s("cursorPage.manualImportTitle")}),e.jsx(Ns,{children:s("cursorPage.manualImportDesc")})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(L,{htmlFor:"cursor-manual-token",children:s("cursorPage.accessToken")}),e.jsx(ge,{id:"cursor-manual-token",value:se,onChange:a=>we(a.target.value),placeholder:s("cursorPage.accessTokenPlaceholder")})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(L,{htmlFor:"cursor-manual-machine-id",children:s("cursorPage.machineId")}),e.jsx(ge,{id:"cursor-manual-machine-id",value:ae,onChange:a=>Ce(a.target.value),placeholder:s("cursorPage.machineIdPlaceholder")})]})]}),e.jsxs(vs,{children:[e.jsx(h,{variant:"outline",onClick:()=>K(!1),children:s("cursorPage.cancel")}),e.jsxs(h,{onClick:ts,disabled:be,children:[be?e.jsx(F,{className:"w-4 h-4 mr-2 animate-spin"}):e.jsx(z,{className:"w-4 h-4 mr-2"}),s("cursorPage.import")]})]})]})})]})}export{da as CursorPage};
@@ -0,0 +1,2 @@
1
+ import{j as e}from"./radix-ui-DvRtHWGI.js";import{r as q}from"./react-vendor-Bjx91N7w.js";import{t as j}from"./notifications-B4_o8bcr.js";import{bf as X,bg as Ne,a as Z,C as v,v as y,w as b,B as P,b as N,o as H,p as Q,q as Y,r as W,s as k,I as le,bm as we,bn as ae,bo as ke,Y as Se,Z as Ee,_ as U,$ as V,E as A,bh as Pe,c as Ce}from"./index-7dfuc3Cf.js";import{a as Te,u as ie,b as Ae}from"./tanstack-Dg84L5cM.js";import{a as Re}from"./raw-json-settings-editor-panel-DWTJY3og.js";import{az as _e,aD as De,J as Oe,L as Me,S as Be,aY as Fe,w as Le,D as Ie,T as Ke,ad as Ue,ah as Ve,o as oe}from"./icons-bxdfpJdB.js";import{S as R}from"./separator-avUMnKG4.js";import"./utils-CzKF5WmX.js";import"./form-utils-CuHzLhJZ.js";import"./charts-eIPy2oG6.js";function $e(s){try{const r=JSON.parse(s);return!r||typeof r!="object"||Array.isArray(r)?{settings:null,parseError:"JSON root must be an object."}:{settings:r,parseError:null}}catch(r){return{settings:null,parseError:r.message}}}async function ze(){const s=await fetch(X("/droid/diagnostics"));if(!s.ok)throw new Error("Failed to fetch Droid diagnostics");return s.json()}async function Je(){const s=await fetch(X("/droid/settings/raw"));if(!s.ok)throw new Error("Failed to fetch Droid raw settings");return s.json()}async function qe(s){const r=await fetch(X("/droid/settings/raw"),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(s)});if(r.status===409)throw new Ne("Droid raw settings changed externally");if(!r.ok){const n=await r.json().catch(()=>null);throw new Error(n?.error||"Failed to save Droid raw settings")}return r.json()}function He(){const s=Te(),r=ie({queryKey:["droid-diagnostics"],queryFn:ze,refetchInterval:1e4}),n=ie({queryKey:["droid-raw-settings"],queryFn:Je}),i=Ae({mutationFn:qe,onSuccess:(l,d)=>{s.setQueryData(["droid-raw-settings"],o=>{const t=o?.path??"~/.factory/settings.json",c=o?.resolvedPath??t,m=$e(d.rawText);return{path:t,resolvedPath:c,exists:!0,mtime:l.mtime,rawText:d.rawText,settings:m.settings,parseError:m.parseError}}),s.invalidateQueries({queryKey:["droid-diagnostics"]})}});return q.useMemo(()=>({diagnostics:r.data,diagnosticsLoading:r.isLoading,diagnosticsError:r.error,refetchDiagnostics:r.refetch,rawSettings:n.data,rawSettingsLoading:n.isLoading,rawSettingsError:n.error,refetchRawSettings:n.refetch,saveRawSettings:i.mutate,saveRawSettingsAsync:i.mutateAsync,isSavingRawSettings:i.isPending}),[r.data,r.isLoading,r.error,r.refetch,n.data,n.isLoading,n.error,n.refetch,i.mutate,i.mutateAsync,i.isPending])}const Qe=["customModels","custom_models"],Ye={low:4e3,medium:12e3,high:3e4,max:5e4,xhigh:64e3},We=["low","medium","high","max","xhigh"];function h(s){return typeof s=="object"&&s!==null&&!Array.isArray(s)}function p(s){return typeof s=="string"&&s.trim()?s.trim():null}function D(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function G(s){if(!s)return"unknown";const r=s.toLowerCase();return r==="anthropic"?"anthropic":r==="openai"?"openai":r==="generic-chat-completion-api"?"generic-chat-completion-api":"unknown"}function Ge(s,r,n){return`${s}:${r}:${encodeURIComponent(String(n))}`}function Xe(s){const r=s.indexOf(":"),n=s.indexOf(":",r+1);if(r<=0||n<=r+1)return null;const i=s.slice(0,r),l=s.slice(r+1,n),d=s.slice(n+1);if(i!=="customModels"&&i!=="custom_models"||l!=="array"&&l!=="object")return null;const o=decodeURIComponent(d);if(l==="array"){const t=Number.parseInt(o,10);return!Number.isInteger(t)||t<0?null:{rootKey:i,locationType:l,locationKey:t}}return{rootKey:i,locationType:l,locationKey:o}}function Ze(s){return!s||s<=0?null:s<=4e3?"low":s<=12e3?"medium":s<=3e4?"high":s<=5e4?"max":"xhigh"}function es(s){return Object.prototype.hasOwnProperty.call(s,"extraArgs")?"extraArgs":Object.prototype.hasOwnProperty.call(s,"extra_args")?"extra_args":"extraArgs"}function de(s){return JSON.parse(JSON.stringify(s))}function ss(s){const r=[];for(const n of Qe){const i=s[n];if(Array.isArray(i)){i.forEach((l,d)=>{h(l)&&r.push({rootKey:n,locationType:"array",locationKey:d,entry:l})});continue}if(h(i))for(const[l,d]of Object.entries(i))h(d)&&r.push({rootKey:n,locationType:"object",locationKey:l,entry:d})}return r}function ce(s,r){const n=Xe(r);if(!n)return null;const i=s[n.rootKey];if(n.locationType==="array"){if(!Array.isArray(i))return null;const o=i[n.locationKey];if(!h(o))return null;const t=p(o.provider);return{entry:o,providerKind:G(t)}}if(!h(i))return null;const l=i[n.locationKey];if(!h(l))return null;const d=p(l.provider);return{entry:l,providerKind:G(d)}}function rs(s,r){const n=r.extraArgs??r.extra_args,i=h(n)?n:null;if(!i)return{effort:null,anthropicBudgetTokens:null};const l=p(i.reasoning_effort)??p(i.reasoningEffort),d=h(i.reasoning)?i.reasoning:null,o=d?p(d.effort):null,t=h(i.thinking)?i.thinking:null,c=t?p(t.type):null,m=t?D(t.budget_tokens)??D(t.budgetTokens):null;return s==="openai"?{effort:o??l,anthropicBudgetTokens:null}:s==="anthropic"?c==="enabled"?{effort:Ze(m)??"high",anthropicBudgetTokens:m}:{effort:o??l,anthropicBudgetTokens:m}:{effort:l??o,anthropicBudgetTokens:null}}function ts(s){if(!s)return null;const r=s.trim().toLowerCase();return!r||r==="default"||r==="unset"||r==="off"||r==="none"||r==="disabled"?null:r}function ue(s){const r=es(s),n=s[r],i=h(n)?{...n}:{};return{extraArgsKey:r,extraArgs:i}}function me(s,r,n){if(Object.keys(n).length===0){delete s[r];return}s[r]=n}function ns(s){return ss(s).map(({rootKey:r,locationType:n,locationKey:i,entry:l})=>{const d=p(l.displayName)??p(l.model_display_name)??"Unnamed model",o=p(l.model)??"",t=p(l.provider)??"unknown",c=G(t),m=rs(c,l);return{id:Ge(r,n,i),rootKey:r,locationType:n,locationKey:i,displayName:d,model:o,provider:t,providerKind:c,effort:m.effort,anthropicBudgetTokens:m.anthropicBudgetTokens}})}function as(s,r,n){const i=de(s),l=ce(i,r);if(!l)return null;const d=ts(n),{extraArgsKey:o,extraArgs:t}=ue(l.entry);if(l.providerKind==="openai")if(delete t.reasoning_effort,delete t.reasoningEffort,!d)delete t.reasoning;else{const c=h(t.reasoning)?t.reasoning:{};t.reasoning={...c,effort:d}}else if(l.providerKind==="anthropic")if(delete t.reasoning_effort,delete t.reasoningEffort,delete t.reasoning,!d)delete t.thinking;else{const c=h(t.thinking)?{...t.thinking}:{},m=D(c.budget_tokens)??D(c.budgetTokens);delete c.budgetTokens,t.thinking={...c,type:"enabled",budget_tokens:m??Ye[d]??3e4}}else delete t.reasoning,delete t.reasoningEffort,d?t.reasoning_effort=d:delete t.reasoning_effort;return me(l.entry,o,t),i}function is(s,r,n){const i=de(s),l=ce(i,r);if(!l||l.providerKind!=="anthropic")return null;const{extraArgsKey:d,extraArgs:o}=ue(l.entry),t=h(o.thinking)?{...o.thinking}:{};if(t.type="enabled",n===null)delete t.budget_tokens,delete t.budgetTokens;else{const c=Math.max(1024,Math.floor(n));t.budget_tokens=c,delete t.budgetTokens}return o.thinking=t,me(l.entry,d,o),i}const $="__unset__";function os(s){return s.providerKind==="openai"?"Writes: extraArgs.reasoning.effort":s.providerKind==="anthropic"?"Writes: extraArgs.thinking.{type,budget_tokens}":"Writes: extraArgs.reasoning_effort"}function ls({models:s,disabled:r,disabledReason:n,onEffortChange:i,onAnthropicBudgetChange:l}){const{t:d}=Z();return e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(_e,{className:"h-4 w-4"}),d("droidSettings.reasoningControls"),e.jsx(P,{variant:"outline",className:"text-[10px] font-normal",children:"customModels"})]})}),e.jsxs(N,{className:"space-y-3",children:[n&&e.jsx("p",{className:"text-xs text-amber-600",children:n}),s.length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"No BYOK custom models found in settings.json (`customModels` or `custom_models`)."}):e.jsx("div",{className:"space-y-2",children:s.map(o=>e.jsxs("div",{className:"rounded-md border p-3 space-y-2",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-xs font-medium truncate",children:o.displayName}),e.jsx("p",{className:"text-[11px] font-mono text-muted-foreground truncate",children:o.model||"(missing model id)"})]}),e.jsx(P,{variant:"outline",className:"font-mono text-[10px] shrink-0",children:o.provider})]}),e.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-medium",children:d("codex.reasoningEffortCapitalized")}),e.jsxs(H,{value:o.effort??$,onValueChange:t=>i(o.id,t===$?null:t),disabled:r,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(Y,{placeholder:"Use provider default"})}),e.jsxs(W,{children:[e.jsx(k,{value:$,children:"Use provider default"}),We.map(t=>e.jsx(k,{value:t,children:t},t))]})]})]}),o.providerKind==="anthropic"&&e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-[11px] font-medium",children:d("codex.thinkingBudgetTokens")}),e.jsx(le,{type:"number",min:1024,step:1024,value:o.anthropicBudgetTokens??"",placeholder:"auto",className:"h-8 text-xs",disabled:r,onChange:t=>{const c=t.target.value.trim();if(!c){l(o.id,null);return}const m=Number.parseInt(c,10);Number.isFinite(m)&&l(o.id,Math.max(1024,m))}})]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:os(o)})]},o.id))})]})]})}const T="__unset__",ds=[{key:"reasoningEffort",label:"Reasoning Effort",description:"none | medium | high | max",options:[{value:"none",label:"none"},{value:"medium",label:"medium"},{value:"high",label:"high"},{value:"max",label:"max"}]},{key:"autonomyLevel",label:"Autonomy Level",description:"suggest | aggressive | full",options:[{value:"suggest",label:"suggest"},{value:"aggressive",label:"aggressive"},{value:"full",label:"full"}]},{key:"diffMode",label:"Diff Mode",description:"auto | none | inline | split",options:[{value:"auto",label:"auto"},{value:"none",label:"none"},{value:"inline",label:"inline"},{value:"split",label:"split"}]}],cs=[{key:"todoEnabled",label:"Todo Enabled"},{key:"todoAutoRefresh",label:"Todo Auto Refresh"},{key:"autoCompactEnabled",label:"Auto Compact Enabled"},{key:"soundEnabled",label:"Sound Enabled"}],us=[{key:"maxTurns",label:"Max Turns",min:1,step:1},{key:"maxToolCalls",label:"Max Tool Calls",min:1,step:1},{key:"autoCompactThreshold",label:"Auto Compact Threshold",min:1e3,step:1e3}];function ms(s){return s===!0?"true":s===!1?"false":T}function xs(s){return s==="true"?!0:s==="false"?!1:null}function gs({values:s,disabled:r,disabledReason:n,onEnumSettingChange:i,onBooleanSettingChange:l,onNumberSettingChange:d}){const{t:o}=Z();return e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(De,{className:"h-4 w-4"}),o("droidSettings.quickControls"),e.jsx(P,{variant:"outline",className:"text-[10px] font-normal",children:"settings.json"})]})}),e.jsxs(N,{className:"space-y-4",children:[n&&e.jsx("p",{className:"text-xs text-amber-600",children:n}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[ds.map(t=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:t.label}),e.jsxs(H,{value:s[t.key]??T,onValueChange:c=>i(t.key,c===T?null:c),disabled:r,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(Y,{placeholder:o("codex.useDefault")})}),e.jsxs(W,{children:[e.jsx(k,{value:T,children:o("codex.useDefault")}),t.options.map(c=>e.jsx(k,{value:c.value,children:c.label},c.value))]})]}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:t.description})]},t.key)),us.map(t=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:t.label}),e.jsx(le,{type:"number",min:t.min,step:t.step,value:s[t.key]??"",onChange:c=>{const m=c.target.value.trim();if(!m){d(t.key,null);return}const S=Number.parseInt(m,10);Number.isFinite(S)&&d(t.key,Math.max(t.min,S))},className:"h-8 text-xs",disabled:r})]},t.key)),cs.map(t=>e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-medium",children:t.label}),e.jsxs(H,{value:ms(s[t.key]),onValueChange:c=>l(t.key,xs(c)),disabled:r,children:[e.jsx(Q,{className:"h-8 text-xs",children:e.jsx(Y,{placeholder:o("codex.useDefault")})}),e.jsxs(W,{children:[e.jsx(k,{value:T,children:o("codex.useDefault")}),e.jsx(k,{value:"true",children:"true"}),e.jsx(k,{value:"false",children:"false"})]})]})]},t.key))]})]})]})}const fs=[{id:"droid-cli-overview",label:"Droid CLI Overview",url:"https://docs.factory.ai/cli/",description:"Primary entry docs for setup, auth, and core CLI usage."},{id:"droid-byok-overview",label:"BYOK Overview",url:"https://docs.factory.ai/cli/byok/overview/",description:"BYOK model/provider shape, provider values, and migration notes."},{id:"droid-settings-reference",label:"settings.json Reference",url:"https://docs.factory.ai/cli/configuration/settings/",description:"Supported settings keys, defaults, and allowed values."}],hs=[{provider:"anthropic",label:"Anthropic Messages API",apiFormat:"Messages API",url:"https://docs.anthropic.com/en/api/messages"},{provider:"openai",label:"OpenAI Responses API",apiFormat:"Responses API",url:"https://platform.openai.com/docs/api-reference/responses"},{provider:"generic-chat-completion-api",label:"OpenAI Chat Completions Spec",apiFormat:"Chat Completions API",url:"https://platform.openai.com/docs/api-reference/chat"}];function ps(s){const r=/https?:\/\/[^\s)]+/g,n=[];let i=0,l;for(;(l=r.exec(s))!==null;){const[d]=l,o=l.index;o>i&&n.push(s.slice(i,o)),n.push(e.jsx("a",{href:d,target:"_blank",rel:"noreferrer",className:"underline underline-offset-2 hover:text-foreground",children:d},`${d}-${o}`)),i=o+d.length}return i<s.length&&n.push(s.slice(i)),n.length>0?n:[s]}function js(s){return!s||!Number.isFinite(s)?"N/A":new Date(s).toLocaleString()}function vs(s){return!s||s<=0?"0 B":s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} KB`:`${(s/(1024*1024)).toFixed(2)} MB`}function ys(s){try{const r=JSON.parse(s);return!r||typeof r!="object"||Array.isArray(r)?{valid:!1,error:"JSON root must be an object."}:{valid:!0,value:r}}catch(r){return{valid:!1,error:r.message}}}function z(s){return typeof s=="string"?s:null}function J(s){return typeof s=="number"&&Number.isFinite(s)?s:null}function _(s){return typeof s=="boolean"?s:null}function g({label:s,value:r,mono:n=!1}){return e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-muted-foreground shrink-0",children:s}),e.jsx("span",{className:Ce("text-right break-all",n&&"font-mono text-xs"),children:r})]})}function _s(){const{t:s}=Z(),{diagnostics:r,diagnosticsLoading:n,diagnosticsError:i,refetchDiagnostics:l,rawSettings:d,rawSettingsLoading:o,refetchRawSettings:t,saveRawSettingsAsync:c,isSavingRawSettings:m}=He(),[S,O]=q.useState(null),M=d?.rawText??"{}",B=S??M,ee=S!==null&&S!==M,u=ys(B),F=u.valid?{valid:!0}:{valid:!1,error:u.error},se=x=>{if(x===M){O(null);return}O(x)},L=x=>{se(JSON.stringify(x,null,2)+`
2
+ `)},I=(x,w)=>{if(!u.valid){j.error(s("droidPage.fixJsonBeforeQuickSettings"));return}const E={...u.value};w==null?delete E[x]:E[x]=w,L(E)},xe=u.valid?{reasoningEffort:z(u.value.reasoningEffort),autonomyLevel:z(u.value.autonomyLevel),diffMode:z(u.value.diffMode),maxTurns:J(u.value.maxTurns),maxToolCalls:J(u.value.maxToolCalls),autoCompactThreshold:J(u.value.autoCompactThreshold),todoEnabled:_(u.value.todoEnabled),todoAutoRefresh:_(u.value.todoAutoRefresh),autoCompactEnabled:_(u.value.autoCompactEnabled),soundEnabled:_(u.value.soundEnabled)}:{reasoningEffort:null,autonomyLevel:null,diffMode:null,maxTurns:null,maxToolCalls:null,autoCompactThreshold:null,todoEnabled:null,todoAutoRefresh:null,autoCompactEnabled:null,soundEnabled:null},ge=u.valid?ns(u.value):[],fe=async()=>{await Promise.all([l(),t()])},he=async()=>{if(!F.valid){j.error(s("droidPage.invalidJson",{value:F.error}));return}try{await c({rawText:B,expectedMtime:d?.exists?d.mtime:void 0}),O(null),j.success(s("droidPage.saved"))}catch(x){Pe(x)?j.error(s("droidPage.changedExternally")):j.error(x.message||s("droidPage.failedSave"))}},re=r?.byok.customModels??[],te=q.useMemo(()=>Object.entries(r?.byok.providerBreakdown??{}).sort((x,w)=>w[1]-x[1]),[r?.byok.providerBreakdown]),pe=()=>{if(n)return e.jsxs("div",{className:"flex h-full items-center justify-center text-muted-foreground",children:[e.jsx(Me,{className:"h-5 w-5 animate-spin mr-2"}),s("droidPage.loadingDiagnostics")]});if(i||!r)return e.jsx("div",{className:"flex h-full items-center justify-center text-destructive px-6 text-center",children:s("droidPage.failedDiagnostics")});const x=r.docsReference??{notes:[],links:[],providerDocs:[],providerValues:[],settingsHierarchy:[]},w=x.notes??[],E=x.links??[],ne=x.providerDocs??[],je=E.length>0?E:fs,ve=ne.length>0?ne:hs,ye=x.providerValues??[],be=x.settingsHierarchy??[],K="mt-0 h-full border-0 p-0 data-[state=inactive]:hidden";return e.jsxs(Se,{defaultValue:"byok",className:"h-full flex flex-col",children:[e.jsx("div",{className:"px-4 pt-4 shrink-0",children:e.jsxs(Ee,{className:"grid w-full grid-cols-3",children:[e.jsx(U,{value:"overview",children:s("droidPage.overview")}),e.jsx(U,{value:"byok",children:s("droidPage.byok")}),e.jsx(U,{value:"docs",children:s("droidPage.docs")})]})}),e.jsxs("div",{className:"flex-1 min-h-0 overflow-hidden px-4 pb-4 pt-3",children:[e.jsx(V,{value:"overview",className:K,children:e.jsx(A,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(Be,{className:"h-4 w-4"}),s("droidPage.runtimeInstall")]})}),e.jsxs(N,{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-sm text-muted-foreground",children:s("droidPage.status")}),e.jsx(P,{variant:r.binary.installed?"default":"secondary",children:r.binary.installed?s("droidPage.detected"):s("droidPage.notFound")})]}),e.jsx(g,{label:s("droidPage.detectionSource"),value:r.binary.source,mono:!0}),e.jsx(g,{label:s("droidPage.binaryPath"),value:r.binary.path||s("droidPage.notFound"),mono:!0}),e.jsx(g,{label:s("droidPage.installDirectory"),value:r.binary.installDir||"N/A",mono:!0}),e.jsx(g,{label:s("droidPage.version"),value:r.binary.version||"Unknown",mono:!0}),e.jsx(g,{label:s("droidPage.overridePath"),value:r.binary.overridePath||"Not set",mono:!0})]})]}),e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(Fe,{className:"h-4 w-4"}),s("droidPage.configFiles")]})}),e.jsx(N,{className:"space-y-3",children:[r.files.settings,r.files.legacyConfig].map(a=>e.jsxs("div",{className:"rounded-md border p-3 space-y-1.5",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"font-medium text-sm",children:a.label}),a.exists?e.jsx(Le,{className:"h-4 w-4 text-green-600"}):e.jsx(Ie,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(g,{label:s("droidPage.path"),value:a.path,mono:!0}),e.jsx(g,{label:s("droidPage.resolved"),value:a.resolvedPath,mono:!0}),e.jsx(g,{label:s("droidPage.size"),value:vs(a.sizeBytes)}),e.jsx(g,{label:s("droidPage.lastModified"),value:js(a.mtimeMs)}),a.parseError&&e.jsx("p",{className:"text-xs text-amber-600",children:s("droidPage.parseWarning",{value:a.parseError})}),a.readError&&e.jsx("p",{className:"text-xs text-destructive",children:s("droidPage.readWarning",{value:a.readError})})]},a.label))})]}),r.warnings.length>0&&e.jsxs(v,{className:"border-amber-200 bg-amber-50/50 dark:bg-amber-950/20",children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(Ke,{className:"h-4 w-4 text-amber-600"}),s("droidPage.warnings")]})}),e.jsx(N,{className:"space-y-1.5",children:r.warnings.map(a=>e.jsxs("p",{className:"text-sm text-amber-800 dark:text-amber-300",children:["- ",a]},a))})]})]})})}),e.jsx(V,{value:"byok",className:K,children:e.jsx(A,{className:"h-full",children:e.jsxs("div",{className:"space-y-4 pr-1",children:[e.jsx(gs,{values:xe,disabled:o||!u.valid,disabledReason:u.valid?null:`Quick settings disabled: ${u.error}`,onEnumSettingChange:(a,f)=>{I(a,f)},onBooleanSettingChange:(a,f)=>{I(a,f)},onNumberSettingChange:(a,f)=>{I(a,f)}}),e.jsx(ls,{models:ge,disabled:o||!u.valid,disabledReason:u.valid?null:`${s("droidPage.byok")}: ${u.error}`,onEffortChange:(a,f)=>{if(!u.valid){j.error(s("droidPage.fixJsonBeforeReasoning"));return}const C=as(u.value,a,f);if(!C){j.error(s("droidPage.unableUpdateReasoning"));return}L(C)},onAnthropicBudgetChange:(a,f)=>{if(!u.valid){j.error(s("droidPage.fixJsonBeforeBudget"));return}const C=is(u.value,a,f);if(!C){j.error(s("droidPage.anthropicOnlyBudget"));return}L(C)}}),e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(Ue,{className:"h-4 w-4"}),s("droidPage.byokSummary")]})}),e.jsxs(N,{className:"space-y-2",children:[e.jsx(g,{label:s("droidPage.activeModelSelector"),value:r.byok.activeModelSelector||"Not set",mono:!0}),e.jsx(g,{label:s("droidPage.customModels"),value:String(r.byok.customModelCount)}),e.jsx(g,{label:s("droidPage.ccsManaged"),value:String(r.byok.ccsManagedCount)}),e.jsx(g,{label:s("droidPage.userManaged"),value:String(r.byok.userManagedCount)}),e.jsx(g,{label:s("droidPage.malformedEntries"),value:String(r.byok.invalidModelEntryCount)}),e.jsx(R,{}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs text-muted-foreground",children:s("droidPage.providers")}),e.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[te.length===0&&e.jsx(P,{variant:"secondary",className:"font-mono",children:s("droidPage.none")}),te.map(([a,f])=>e.jsxs(P,{variant:"outline",className:"font-mono text-xs",children:[a,": ",f]},a))]})]})]})]}),e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsx(b,{className:"text-base",children:s("droidPage.customModelsTitle")})}),e.jsx(N,{children:e.jsxs("div",{className:"rounded-md border overflow-hidden",children:[e.jsxs("div",{className:"grid grid-cols-[2fr_1fr_2fr] bg-muted/40 px-3 py-2 text-xs font-medium",children:[e.jsx("span",{children:s("droidPage.modelName")}),e.jsx("span",{children:s("droidPage.provider")}),e.jsx("span",{children:s("droidPage.baseUrl")})]}),e.jsx(A,{className:"h-52",children:e.jsxs("div",{className:"divide-y",children:[re.length===0&&e.jsx("div",{className:"px-3 py-4 text-xs text-muted-foreground",children:s("droidPage.noCustomModels")}),re.map(a=>e.jsxs("div",{className:"grid grid-cols-[2fr_1fr_2fr] gap-2 px-3 py-2 text-xs",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium truncate",children:a.displayName}),e.jsx("p",{className:"text-muted-foreground font-mono truncate",children:a.model})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate",children:a.provider}),e.jsx("p",{className:"text-muted-foreground",children:a.apiKeyPreview||"no-key"})]}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate",title:a.baseUrl,children:a.host||a.baseUrl}),e.jsx("p",{className:"text-muted-foreground font-mono truncate",children:a.baseUrl})]})]},`${a.displayName}-${a.model}-${a.baseUrl}`))]})})]})})]})]})})}),e.jsx(V,{value:"docs",className:K,children:e.jsx(A,{className:"h-full",children:e.jsx("div",{className:"space-y-4 pr-1",children:e.jsxs(v,{children:[e.jsx(y,{className:"pb-2",children:e.jsxs(b,{className:"text-base flex items-center gap-2",children:[e.jsx(Ve,{className:"h-4 w-4"}),s("droidPage.docsAlignedNotes")]})}),e.jsxs(N,{className:"space-y-2 text-sm",children:[w.map((a,f)=>e.jsxs("p",{className:"text-muted-foreground",children:["- ",ps(a)]},`${f}-${a}`)),e.jsx(R,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:s("droidPage.factoryDocs")}),e.jsx("div",{className:"space-y-1.5",children:je.map(a=>e.jsxs("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:a.label}),e.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsx("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:a.description}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:a.url})]},a.id))})]}),e.jsx(R,{}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-xs text-muted-foreground uppercase tracking-wide",children:s("droidPage.providerFactCheckDocs")}),e.jsx("div",{className:"space-y-1.5",children:ve.map(a=>e.jsxs("a",{href:a.url,target:"_blank",rel:"noreferrer",className:"block rounded-md border px-2.5 py-2 transition-colors hover:bg-muted/50",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-xs font-medium",children:a.label}),e.jsx(oe,{className:"h-3.5 w-3.5 text-muted-foreground"})]}),e.jsxs("p",{className:"mt-0.5 text-[11px] text-muted-foreground",children:["provider: ",a.provider," | format: ",a.apiFormat]}),e.jsx("p",{className:"mt-1 break-all font-mono text-[11px] text-muted-foreground/90 underline underline-offset-2",children:a.url})]},`${a.provider}-${a.url}`))})]}),e.jsx(R,{}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("droidPage.providerValues",{value:ye.join(", ")})}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("droidPage.settingsHierarchy",{value:be.join(" -> ")})})]})]})})})})]})]})};return e.jsx("div",{className:"h-full min-h-0 overflow-hidden",children:e.jsxs(we,{direction:"horizontal",className:"h-full",children:[e.jsx(ae,{defaultSize:45,minSize:35,children:e.jsx("div",{className:"h-full border-r bg-muted/20",children:pe()})}),e.jsx(ke,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:e.jsx(Oe,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),e.jsx(ae,{defaultSize:55,minSize:35,children:e.jsx(Re,{title:s("droidPage.settingsTitle"),pathLabel:d?.path||"~/.factory/settings.json",loading:o,parseWarning:d?.parseError,value:B,dirty:ee,saving:m,saveDisabled:!ee||m||o||!F.valid,onChange:x=>{se(x)},onSave:he,onRefresh:fe})})]})})}export{_s as DroidPage};