opencode-quota-gui 0.0.0-stage → 1.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 (849) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +245 -2
  3. package/dist/bin/opencode-quota-gui.d.ts +4 -0
  4. package/dist/bin/opencode-quota-gui.d.ts.map +1 -0
  5. package/dist/bin/opencode-quota-gui.js +75 -0
  6. package/dist/bin/opencode-quota-gui.js.map +1 -0
  7. package/dist/contracts/build-identity.d.ts +8 -0
  8. package/dist/contracts/build-identity.d.ts.map +1 -0
  9. package/dist/contracts/build-identity.js +1 -0
  10. package/dist/contracts/dashboard.d.ts +358 -0
  11. package/dist/contracts/dashboard.d.ts.map +1 -0
  12. package/dist/contracts/dashboard.js +3 -0
  13. package/dist/contracts/dashboard.js.map +1 -0
  14. package/dist/contracts/guards.d.ts +14 -0
  15. package/dist/contracts/guards.d.ts.map +1 -0
  16. package/dist/contracts/guards.js +56 -0
  17. package/dist/contracts/guards.js.map +1 -0
  18. package/dist/contracts/identity.d.ts +41 -0
  19. package/dist/contracts/identity.d.ts.map +1 -0
  20. package/dist/contracts/identity.js +27 -0
  21. package/dist/contracts/identity.js.map +1 -0
  22. package/dist/contracts/openai-quota.d.ts +34 -0
  23. package/dist/contracts/openai-quota.d.ts.map +1 -0
  24. package/dist/contracts/openai-quota.js +19 -0
  25. package/dist/contracts/openai-quota.js.map +1 -0
  26. package/dist/contracts/ranges.d.ts +48 -0
  27. package/dist/contracts/ranges.d.ts.map +1 -0
  28. package/dist/contracts/ranges.js +84 -0
  29. package/dist/contracts/ranges.js.map +1 -0
  30. package/dist/contracts/settings.d.ts +4 -0
  31. package/dist/contracts/settings.d.ts.map +1 -0
  32. package/dist/contracts/settings.js +14 -0
  33. package/dist/contracts/settings.js.map +1 -0
  34. package/dist/contracts/time-zone.d.ts +33 -0
  35. package/dist/contracts/time-zone.d.ts.map +1 -0
  36. package/dist/contracts/time-zone.js +217 -0
  37. package/dist/contracts/time-zone.js.map +1 -0
  38. package/dist/data/modelsdev-pricing.min.json +1064 -0
  39. package/dist/gui/aggregation.d.ts +55 -0
  40. package/dist/gui/aggregation.d.ts.map +1 -0
  41. package/dist/gui/aggregation.js +792 -0
  42. package/dist/gui/aggregation.js.map +1 -0
  43. package/dist/gui/analytics-bridge.d.ts +50 -0
  44. package/dist/gui/analytics-bridge.d.ts.map +1 -0
  45. package/dist/gui/analytics-bridge.js +382 -0
  46. package/dist/gui/analytics-bridge.js.map +1 -0
  47. package/dist/gui/analytics-engine.d.ts +61 -0
  48. package/dist/gui/analytics-engine.d.ts.map +1 -0
  49. package/dist/gui/analytics-engine.js +2381 -0
  50. package/dist/gui/analytics-engine.js.map +1 -0
  51. package/dist/gui/analytics-indexes.d.ts +34 -0
  52. package/dist/gui/analytics-indexes.d.ts.map +1 -0
  53. package/dist/gui/analytics-indexes.js +142 -0
  54. package/dist/gui/analytics-indexes.js.map +1 -0
  55. package/dist/gui/analytics-model.d.ts +48 -0
  56. package/dist/gui/analytics-model.d.ts.map +1 -0
  57. package/dist/gui/analytics-model.js +824 -0
  58. package/dist/gui/analytics-model.js.map +1 -0
  59. package/dist/gui/analytics-protocol.d.ts +102 -0
  60. package/dist/gui/analytics-protocol.d.ts.map +1 -0
  61. package/dist/gui/analytics-protocol.js +11 -0
  62. package/dist/gui/analytics-protocol.js.map +1 -0
  63. package/dist/gui/analytics-reader.d.ts +14 -0
  64. package/dist/gui/analytics-reader.d.ts.map +1 -0
  65. package/dist/gui/analytics-reader.js +15 -0
  66. package/dist/gui/analytics-reader.js.map +1 -0
  67. package/dist/gui/analytics-service.d.ts +49 -0
  68. package/dist/gui/analytics-service.d.ts.map +1 -0
  69. package/dist/gui/analytics-service.js +187 -0
  70. package/dist/gui/analytics-service.js.map +1 -0
  71. package/dist/gui/analytics-state.d.ts +183 -0
  72. package/dist/gui/analytics-state.d.ts.map +1 -0
  73. package/dist/gui/analytics-state.js +692 -0
  74. package/dist/gui/analytics-state.js.map +1 -0
  75. package/dist/gui/analytics-worker-runtime.d.ts +11 -0
  76. package/dist/gui/analytics-worker-runtime.d.ts.map +1 -0
  77. package/dist/gui/analytics-worker-runtime.js +98 -0
  78. package/dist/gui/analytics-worker-runtime.js.map +1 -0
  79. package/dist/gui/analytics-worker.d.ts +2 -0
  80. package/dist/gui/analytics-worker.d.ts.map +1 -0
  81. package/dist/gui/analytics-worker.js +64 -0
  82. package/dist/gui/analytics-worker.js.map +1 -0
  83. package/dist/gui/config.d.ts +53 -0
  84. package/dist/gui/config.d.ts.map +1 -0
  85. package/dist/gui/config.js +679 -0
  86. package/dist/gui/config.js.map +1 -0
  87. package/dist/gui/identity.d.ts +23 -0
  88. package/dist/gui/identity.d.ts.map +1 -0
  89. package/dist/gui/identity.js +57 -0
  90. package/dist/gui/identity.js.map +1 -0
  91. package/dist/gui/lifecycle.d.ts +82 -0
  92. package/dist/gui/lifecycle.d.ts.map +1 -0
  93. package/dist/gui/lifecycle.js +402 -0
  94. package/dist/gui/lifecycle.js.map +1 -0
  95. package/dist/gui/log.d.ts +23 -0
  96. package/dist/gui/log.d.ts.map +1 -0
  97. package/dist/gui/log.js +37 -0
  98. package/dist/gui/log.js.map +1 -0
  99. package/dist/gui/provider-cards.d.ts +58 -0
  100. package/dist/gui/provider-cards.d.ts.map +1 -0
  101. package/dist/gui/provider-cards.js +413 -0
  102. package/dist/gui/provider-cards.js.map +1 -0
  103. package/dist/gui/server.d.ts +60 -0
  104. package/dist/gui/server.d.ts.map +1 -0
  105. package/dist/gui/server.js +815 -0
  106. package/dist/gui/server.js.map +1 -0
  107. package/dist/gui/settings-file-opener.d.ts +34 -0
  108. package/dist/gui/settings-file-opener.d.ts.map +1 -0
  109. package/dist/gui/settings-file-opener.js +110 -0
  110. package/dist/gui/settings-file-opener.js.map +1 -0
  111. package/dist/gui/snapshot-service.d.ts +128 -0
  112. package/dist/gui/snapshot-service.d.ts.map +1 -0
  113. package/dist/gui/snapshot-service.js +591 -0
  114. package/dist/gui/snapshot-service.js.map +1 -0
  115. package/dist/gui/sources.d.ts +94 -0
  116. package/dist/gui/sources.d.ts.map +1 -0
  117. package/dist/gui/sources.js +404 -0
  118. package/dist/gui/sources.js.map +1 -0
  119. package/dist/gui/sse.d.ts +32 -0
  120. package/dist/gui/sse.d.ts.map +1 -0
  121. package/dist/gui/sse.js +100 -0
  122. package/dist/gui/sse.js.map +1 -0
  123. package/dist/gui/time-zone.d.ts +10 -0
  124. package/dist/gui/time-zone.d.ts.map +1 -0
  125. package/dist/gui/time-zone.js +21 -0
  126. package/dist/gui/time-zone.js.map +1 -0
  127. package/dist/index.d.ts +13 -0
  128. package/dist/index.d.ts.map +1 -0
  129. package/dist/index.js +12 -0
  130. package/dist/index.js.map +1 -0
  131. package/dist/lib/accounting-format.d.ts +54 -0
  132. package/dist/lib/accounting-format.d.ts.map +1 -0
  133. package/dist/lib/accounting-format.js +271 -0
  134. package/dist/lib/accounting-format.js.map +1 -0
  135. package/dist/lib/alibaba-auth.d.ts +46 -0
  136. package/dist/lib/alibaba-auth.d.ts.map +1 -0
  137. package/dist/lib/alibaba-auth.js +193 -0
  138. package/dist/lib/alibaba-auth.js.map +1 -0
  139. package/dist/lib/alibaba-coding-plan-local-quota.d.ts +47 -0
  140. package/dist/lib/alibaba-coding-plan-local-quota.d.ts.map +1 -0
  141. package/dist/lib/alibaba-coding-plan-local-quota.js +146 -0
  142. package/dist/lib/alibaba-coding-plan-local-quota.js.map +1 -0
  143. package/dist/lib/alibaba-token-plan.d.ts +91 -0
  144. package/dist/lib/alibaba-token-plan.d.ts.map +1 -0
  145. package/dist/lib/alibaba-token-plan.js +527 -0
  146. package/dist/lib/alibaba-token-plan.js.map +1 -0
  147. package/dist/lib/anthropic-auth.d.ts +29 -0
  148. package/dist/lib/anthropic-auth.d.ts.map +1 -0
  149. package/dist/lib/anthropic-auth.js +37 -0
  150. package/dist/lib/anthropic-auth.js.map +1 -0
  151. package/dist/lib/anthropic.d.ts +104 -0
  152. package/dist/lib/anthropic.d.ts.map +1 -0
  153. package/dist/lib/anthropic.js +1134 -0
  154. package/dist/lib/anthropic.js.map +1 -0
  155. package/dist/lib/api-key-resolver.d.ts +227 -0
  156. package/dist/lib/api-key-resolver.d.ts.map +1 -0
  157. package/dist/lib/api-key-resolver.js +336 -0
  158. package/dist/lib/api-key-resolver.js.map +1 -0
  159. package/dist/lib/atomic-json.d.ts +11 -0
  160. package/dist/lib/atomic-json.d.ts.map +1 -0
  161. package/dist/lib/atomic-json.js +64 -0
  162. package/dist/lib/atomic-json.js.map +1 -0
  163. package/dist/lib/chutes-config.d.ts +15 -0
  164. package/dist/lib/chutes-config.d.ts.map +1 -0
  165. package/dist/lib/chutes-config.js +28 -0
  166. package/dist/lib/chutes-config.js.map +1 -0
  167. package/dist/lib/chutes.d.ts +12 -0
  168. package/dist/lib/chutes.d.ts.map +1 -0
  169. package/dist/lib/chutes.js +60 -0
  170. package/dist/lib/chutes.js.map +1 -0
  171. package/dist/lib/cli-reports.d.ts +30 -0
  172. package/dist/lib/cli-reports.d.ts.map +1 -0
  173. package/dist/lib/cli-reports.js +172 -0
  174. package/dist/lib/cli-reports.js.map +1 -0
  175. package/dist/lib/cli-show.d.ts +30 -0
  176. package/dist/lib/cli-show.d.ts.map +1 -0
  177. package/dist/lib/cli-show.js +213 -0
  178. package/dist/lib/cli-show.js.map +1 -0
  179. package/dist/lib/cli-status.d.ts +8 -0
  180. package/dist/lib/cli-status.d.ts.map +1 -0
  181. package/dist/lib/cli-status.js +98 -0
  182. package/dist/lib/cli-status.js.map +1 -0
  183. package/dist/lib/command-parsing.d.ts +43 -0
  184. package/dist/lib/command-parsing.d.ts.map +1 -0
  185. package/dist/lib/command-parsing.js +103 -0
  186. package/dist/lib/command-parsing.js.map +1 -0
  187. package/dist/lib/config-file-utils.d.ts +46 -0
  188. package/dist/lib/config-file-utils.d.ts.map +1 -0
  189. package/dist/lib/config-file-utils.js +194 -0
  190. package/dist/lib/config-file-utils.js.map +1 -0
  191. package/dist/lib/config-write-target.d.ts +28 -0
  192. package/dist/lib/config-write-target.d.ts.map +1 -0
  193. package/dist/lib/config-write-target.js +159 -0
  194. package/dist/lib/config-write-target.js.map +1 -0
  195. package/dist/lib/config.d.ts +119 -0
  196. package/dist/lib/config.d.ts.map +1 -0
  197. package/dist/lib/config.js +1327 -0
  198. package/dist/lib/config.js.map +1 -0
  199. package/dist/lib/copilot.d.ts +78 -0
  200. package/dist/lib/copilot.d.ts.map +1 -0
  201. package/dist/lib/copilot.js +1111 -0
  202. package/dist/lib/copilot.js.map +1 -0
  203. package/dist/lib/cursor-detection.d.ts +18 -0
  204. package/dist/lib/cursor-detection.d.ts.map +1 -0
  205. package/dist/lib/cursor-detection.js +189 -0
  206. package/dist/lib/cursor-detection.js.map +1 -0
  207. package/dist/lib/cursor-pricing.d.ts +34 -0
  208. package/dist/lib/cursor-pricing.d.ts.map +1 -0
  209. package/dist/lib/cursor-pricing.js +235 -0
  210. package/dist/lib/cursor-pricing.js.map +1 -0
  211. package/dist/lib/cursor-usage.d.ts +33 -0
  212. package/dist/lib/cursor-usage.d.ts.map +1 -0
  213. package/dist/lib/cursor-usage.js +109 -0
  214. package/dist/lib/cursor-usage.js.map +1 -0
  215. package/dist/lib/deepseek-auth.d.ts +15 -0
  216. package/dist/lib/deepseek-auth.d.ts.map +1 -0
  217. package/dist/lib/deepseek-auth.js +28 -0
  218. package/dist/lib/deepseek-auth.js.map +1 -0
  219. package/dist/lib/deepseek.d.ts +40 -0
  220. package/dist/lib/deepseek.d.ts.map +1 -0
  221. package/dist/lib/deepseek.js +118 -0
  222. package/dist/lib/deepseek.js.map +1 -0
  223. package/dist/lib/display-sanitize.d.ts +20 -0
  224. package/dist/lib/display-sanitize.d.ts.map +1 -0
  225. package/dist/lib/display-sanitize.js +178 -0
  226. package/dist/lib/display-sanitize.js.map +1 -0
  227. package/dist/lib/entries.d.ts +365 -0
  228. package/dist/lib/entries.d.ts.map +1 -0
  229. package/dist/lib/entries.js +69 -0
  230. package/dist/lib/entries.js.map +1 -0
  231. package/dist/lib/env-template.d.ts +26 -0
  232. package/dist/lib/env-template.d.ts.map +1 -0
  233. package/dist/lib/env-template.js +36 -0
  234. package/dist/lib/env-template.js.map +1 -0
  235. package/dist/lib/format-utils.d.ts +89 -0
  236. package/dist/lib/format-utils.d.ts.map +1 -0
  237. package/dist/lib/format-utils.js +206 -0
  238. package/dist/lib/format-utils.js.map +1 -0
  239. package/dist/lib/format.d.ts +25 -0
  240. package/dist/lib/format.d.ts.map +1 -0
  241. package/dist/lib/format.js +300 -0
  242. package/dist/lib/format.js.map +1 -0
  243. package/dist/lib/glm-coding-plan.d.ts +19 -0
  244. package/dist/lib/glm-coding-plan.d.ts.map +1 -0
  245. package/dist/lib/glm-coding-plan.js +81 -0
  246. package/dist/lib/glm-coding-plan.js.map +1 -0
  247. package/dist/lib/google-agy-companion.d.ts +8 -0
  248. package/dist/lib/google-agy-companion.d.ts.map +1 -0
  249. package/dist/lib/google-agy-companion.js +64 -0
  250. package/dist/lib/google-agy-companion.js.map +1 -0
  251. package/dist/lib/google-agy.d.ts +48 -0
  252. package/dist/lib/google-agy.d.ts.map +1 -0
  253. package/dist/lib/google-agy.js +572 -0
  254. package/dist/lib/google-agy.js.map +1 -0
  255. package/dist/lib/google-companion-credentials.d.ts +70 -0
  256. package/dist/lib/google-companion-credentials.d.ts.map +1 -0
  257. package/dist/lib/google-companion-credentials.js +315 -0
  258. package/dist/lib/google-companion-credentials.js.map +1 -0
  259. package/dist/lib/google-gemini-cli-companion.d.ts +8 -0
  260. package/dist/lib/google-gemini-cli-companion.d.ts.map +1 -0
  261. package/dist/lib/google-gemini-cli-companion.js +64 -0
  262. package/dist/lib/google-gemini-cli-companion.js.map +1 -0
  263. package/dist/lib/google-gemini-cli.d.ts +47 -0
  264. package/dist/lib/google-gemini-cli.d.ts.map +1 -0
  265. package/dist/lib/google-gemini-cli.js +481 -0
  266. package/dist/lib/google-gemini-cli.js.map +1 -0
  267. package/dist/lib/google-token-cache.d.ts +27 -0
  268. package/dist/lib/google-token-cache.d.ts.map +1 -0
  269. package/dist/lib/google-token-cache.js +52 -0
  270. package/dist/lib/google-token-cache.js.map +1 -0
  271. package/dist/lib/grouped-entry-normalization.d.ts +12 -0
  272. package/dist/lib/grouped-entry-normalization.d.ts.map +1 -0
  273. package/dist/lib/grouped-entry-normalization.js +124 -0
  274. package/dist/lib/grouped-entry-normalization.js.map +1 -0
  275. package/dist/lib/grouped-header-format.d.ts +5 -0
  276. package/dist/lib/grouped-header-format.d.ts.map +1 -0
  277. package/dist/lib/grouped-header-format.js +16 -0
  278. package/dist/lib/grouped-header-format.js.map +1 -0
  279. package/dist/lib/gui-config-target.d.ts +12 -0
  280. package/dist/lib/gui-config-target.d.ts.map +1 -0
  281. package/dist/lib/gui-config-target.js +88 -0
  282. package/dist/lib/gui-config-target.js.map +1 -0
  283. package/dist/lib/home-dir-display.d.ts +10 -0
  284. package/dist/lib/home-dir-display.d.ts.map +1 -0
  285. package/dist/lib/home-dir-display.js +108 -0
  286. package/dist/lib/home-dir-display.js.map +1 -0
  287. package/dist/lib/http.d.ts +19 -0
  288. package/dist/lib/http.d.ts.map +1 -0
  289. package/dist/lib/http.js +47 -0
  290. package/dist/lib/http.js.map +1 -0
  291. package/dist/lib/init-installer.d.ts +146 -0
  292. package/dist/lib/init-installer.d.ts.map +1 -0
  293. package/dist/lib/init-installer.js +1056 -0
  294. package/dist/lib/init-installer.js.map +1 -0
  295. package/dist/lib/jsonc.d.ts +17 -0
  296. package/dist/lib/jsonc.d.ts.map +1 -0
  297. package/dist/lib/jsonc.js +23 -0
  298. package/dist/lib/jsonc.js.map +1 -0
  299. package/dist/lib/kilo-config.d.ts +15 -0
  300. package/dist/lib/kilo-config.d.ts.map +1 -0
  301. package/dist/lib/kilo-config.js +27 -0
  302. package/dist/lib/kilo-config.js.map +1 -0
  303. package/dist/lib/kilo.d.ts +32 -0
  304. package/dist/lib/kilo.d.ts.map +1 -0
  305. package/dist/lib/kilo.js +265 -0
  306. package/dist/lib/kilo.js.map +1 -0
  307. package/dist/lib/kimi-auth.d.ts +49 -0
  308. package/dist/lib/kimi-auth.d.ts.map +1 -0
  309. package/dist/lib/kimi-auth.js +82 -0
  310. package/dist/lib/kimi-auth.js.map +1 -0
  311. package/dist/lib/kimi-endpoints.d.ts +10 -0
  312. package/dist/lib/kimi-endpoints.d.ts.map +1 -0
  313. package/dist/lib/kimi-endpoints.js +18 -0
  314. package/dist/lib/kimi-endpoints.js.map +1 -0
  315. package/dist/lib/kimi.d.ts +26 -0
  316. package/dist/lib/kimi.d.ts.map +1 -0
  317. package/dist/lib/kimi.js +230 -0
  318. package/dist/lib/kimi.js.map +1 -0
  319. package/dist/lib/maintainer-announcements.d.ts +46 -0
  320. package/dist/lib/maintainer-announcements.d.ts.map +1 -0
  321. package/dist/lib/maintainer-announcements.js +155 -0
  322. package/dist/lib/maintainer-announcements.js.map +1 -0
  323. package/dist/lib/map-with-concurrency.d.ts +2 -0
  324. package/dist/lib/map-with-concurrency.d.ts.map +1 -0
  325. package/dist/lib/map-with-concurrency.js +17 -0
  326. package/dist/lib/map-with-concurrency.js.map +1 -0
  327. package/dist/lib/markdown-table.d.ts +51 -0
  328. package/dist/lib/markdown-table.d.ts.map +1 -0
  329. package/dist/lib/markdown-table.js +179 -0
  330. package/dist/lib/markdown-table.js.map +1 -0
  331. package/dist/lib/mimo-config.d.ts +29 -0
  332. package/dist/lib/mimo-config.d.ts.map +1 -0
  333. package/dist/lib/mimo-config.js +146 -0
  334. package/dist/lib/mimo-config.js.map +1 -0
  335. package/dist/lib/mimo.d.ts +35 -0
  336. package/dist/lib/mimo.d.ts.map +1 -0
  337. package/dist/lib/mimo.js +236 -0
  338. package/dist/lib/mimo.js.map +1 -0
  339. package/dist/lib/minimax-auth.d.ts +62 -0
  340. package/dist/lib/minimax-auth.d.ts.map +1 -0
  341. package/dist/lib/minimax-auth.js +206 -0
  342. package/dist/lib/minimax-auth.js.map +1 -0
  343. package/dist/lib/minimax-endpoints.d.ts +10 -0
  344. package/dist/lib/minimax-endpoints.d.ts.map +1 -0
  345. package/dist/lib/minimax-endpoints.js +19 -0
  346. package/dist/lib/minimax-endpoints.js.map +1 -0
  347. package/dist/lib/modelsdev-pricing.d.ts +93 -0
  348. package/dist/lib/modelsdev-pricing.d.ts.map +1 -0
  349. package/dist/lib/modelsdev-pricing.js +674 -0
  350. package/dist/lib/modelsdev-pricing.js.map +1 -0
  351. package/dist/lib/nanogpt-config.d.ts +15 -0
  352. package/dist/lib/nanogpt-config.d.ts.map +1 -0
  353. package/dist/lib/nanogpt-config.js +31 -0
  354. package/dist/lib/nanogpt-config.js.map +1 -0
  355. package/dist/lib/nanogpt.d.ts +48 -0
  356. package/dist/lib/nanogpt.d.ts.map +1 -0
  357. package/dist/lib/nanogpt.js +251 -0
  358. package/dist/lib/nanogpt.js.map +1 -0
  359. package/dist/lib/ollama-cloud-config.d.ts +15 -0
  360. package/dist/lib/ollama-cloud-config.d.ts.map +1 -0
  361. package/dist/lib/ollama-cloud-config.js +27 -0
  362. package/dist/lib/ollama-cloud-config.js.map +1 -0
  363. package/dist/lib/ollama-cloud.d.ts +14 -0
  364. package/dist/lib/ollama-cloud.d.ts.map +1 -0
  365. package/dist/lib/ollama-cloud.js +186 -0
  366. package/dist/lib/ollama-cloud.js.map +1 -0
  367. package/dist/lib/openai.d.ts +68 -0
  368. package/dist/lib/openai.d.ts.map +1 -0
  369. package/dist/lib/openai.js +394 -0
  370. package/dist/lib/openai.js.map +1 -0
  371. package/dist/lib/opencode-auth-sqlite.d.ts +17 -0
  372. package/dist/lib/opencode-auth-sqlite.d.ts.map +1 -0
  373. package/dist/lib/opencode-auth-sqlite.js +105 -0
  374. package/dist/lib/opencode-auth-sqlite.js.map +1 -0
  375. package/dist/lib/opencode-auth.d.ts +146 -0
  376. package/dist/lib/opencode-auth.d.ts.map +1 -0
  377. package/dist/lib/opencode-auth.js +465 -0
  378. package/dist/lib/opencode-auth.js.map +1 -0
  379. package/dist/lib/opencode-config-editor.d.ts +62 -0
  380. package/dist/lib/opencode-config-editor.d.ts.map +1 -0
  381. package/dist/lib/opencode-config-editor.js +387 -0
  382. package/dist/lib/opencode-config-editor.js.map +1 -0
  383. package/dist/lib/opencode-config-providers.d.ts +24 -0
  384. package/dist/lib/opencode-config-providers.d.ts.map +1 -0
  385. package/dist/lib/opencode-config-providers.js +144 -0
  386. package/dist/lib/opencode-config-providers.js.map +1 -0
  387. package/dist/lib/opencode-config-read.d.ts +23 -0
  388. package/dist/lib/opencode-config-read.d.ts.map +1 -0
  389. package/dist/lib/opencode-config-read.js +30 -0
  390. package/dist/lib/opencode-config-read.js.map +1 -0
  391. package/dist/lib/opencode-console-auth.d.ts +47 -0
  392. package/dist/lib/opencode-console-auth.d.ts.map +1 -0
  393. package/dist/lib/opencode-console-auth.js +63 -0
  394. package/dist/lib/opencode-console-auth.js.map +1 -0
  395. package/dist/lib/opencode-db-path.d.ts +9 -0
  396. package/dist/lib/opencode-db-path.d.ts.map +1 -0
  397. package/dist/lib/opencode-db-path.js +16 -0
  398. package/dist/lib/opencode-db-path.js.map +1 -0
  399. package/dist/lib/opencode-go-auth.d.ts +16 -0
  400. package/dist/lib/opencode-go-auth.d.ts.map +1 -0
  401. package/dist/lib/opencode-go-auth.js +42 -0
  402. package/dist/lib/opencode-go-auth.js.map +1 -0
  403. package/dist/lib/opencode-go.d.ts +17 -0
  404. package/dist/lib/opencode-go.d.ts.map +1 -0
  405. package/dist/lib/opencode-go.js +278 -0
  406. package/dist/lib/opencode-go.js.map +1 -0
  407. package/dist/lib/opencode-runtime-paths.d.ts +17 -0
  408. package/dist/lib/opencode-runtime-paths.d.ts.map +1 -0
  409. package/dist/lib/opencode-runtime-paths.js +24 -0
  410. package/dist/lib/opencode-runtime-paths.js.map +1 -0
  411. package/dist/lib/opencode-sqlite.d.ts +11 -0
  412. package/dist/lib/opencode-sqlite.d.ts.map +1 -0
  413. package/dist/lib/opencode-sqlite.js +88 -0
  414. package/dist/lib/opencode-sqlite.js.map +1 -0
  415. package/dist/lib/opencode-storage.d.ts +306 -0
  416. package/dist/lib/opencode-storage.d.ts.map +1 -0
  417. package/dist/lib/opencode-storage.js +1269 -0
  418. package/dist/lib/opencode-storage.js.map +1 -0
  419. package/dist/lib/opencode-version.d.ts +6 -0
  420. package/dist/lib/opencode-version.d.ts.map +1 -0
  421. package/dist/lib/opencode-version.js +26 -0
  422. package/dist/lib/opencode-version.js.map +1 -0
  423. package/dist/lib/opencode-zen.d.ts +55 -0
  424. package/dist/lib/opencode-zen.d.ts.map +1 -0
  425. package/dist/lib/opencode-zen.js +348 -0
  426. package/dist/lib/opencode-zen.js.map +1 -0
  427. package/dist/lib/openrouter.d.ts +16 -0
  428. package/dist/lib/openrouter.d.ts.map +1 -0
  429. package/dist/lib/openrouter.js +50 -0
  430. package/dist/lib/openrouter.js.map +1 -0
  431. package/dist/lib/private-state-paths.d.ts +10 -0
  432. package/dist/lib/private-state-paths.d.ts.map +1 -0
  433. package/dist/lib/private-state-paths.js +28 -0
  434. package/dist/lib/private-state-paths.js.map +1 -0
  435. package/dist/lib/provider-add-command.d.ts +35 -0
  436. package/dist/lib/provider-add-command.d.ts.map +1 -0
  437. package/dist/lib/provider-add-command.js +204 -0
  438. package/dist/lib/provider-add-command.js.map +1 -0
  439. package/dist/lib/provider-add-json-v1-questionnaire.d.ts +32 -0
  440. package/dist/lib/provider-add-json-v1-questionnaire.d.ts.map +1 -0
  441. package/dist/lib/provider-add-json-v1-questionnaire.js +336 -0
  442. package/dist/lib/provider-add-json-v1-questionnaire.js.map +1 -0
  443. package/dist/lib/provider-add.d.ts +21 -0
  444. package/dist/lib/provider-add.d.ts.map +1 -0
  445. package/dist/lib/provider-add.js +219 -0
  446. package/dist/lib/provider-add.js.map +1 -0
  447. package/dist/lib/provider-availability.d.ts +13 -0
  448. package/dist/lib/provider-availability.d.ts.map +1 -0
  449. package/dist/lib/provider-availability.js +20 -0
  450. package/dist/lib/provider-availability.js.map +1 -0
  451. package/dist/lib/provider-metadata.d.ts +32 -0
  452. package/dist/lib/provider-metadata.d.ts.map +1 -0
  453. package/dist/lib/provider-metadata.js +90 -0
  454. package/dist/lib/provider-metadata.js.map +1 -0
  455. package/dist/lib/provider-model-matching.d.ts +12 -0
  456. package/dist/lib/provider-model-matching.d.ts.map +1 -0
  457. package/dist/lib/provider-model-matching.js +23 -0
  458. package/dist/lib/provider-model-matching.js.map +1 -0
  459. package/dist/lib/provider-registration.d.ts +321 -0
  460. package/dist/lib/provider-registration.d.ts.map +1 -0
  461. package/dist/lib/provider-registration.js +335 -0
  462. package/dist/lib/provider-registration.js.map +1 -0
  463. package/dist/lib/quota-accounting-projection.d.ts +9 -0
  464. package/dist/lib/quota-accounting-projection.d.ts.map +1 -0
  465. package/dist/lib/quota-accounting-projection.js +254 -0
  466. package/dist/lib/quota-accounting-projection.js.map +1 -0
  467. package/dist/lib/quota-columns.d.ts +38 -0
  468. package/dist/lib/quota-columns.d.ts.map +1 -0
  469. package/dist/lib/quota-columns.js +129 -0
  470. package/dist/lib/quota-columns.js.map +1 -0
  471. package/dist/lib/quota-command-format.d.ts +34 -0
  472. package/dist/lib/quota-command-format.d.ts.map +1 -0
  473. package/dist/lib/quota-command-format.js +240 -0
  474. package/dist/lib/quota-command-format.js.map +1 -0
  475. package/dist/lib/quota-dialog-command-specs.d.ts +63 -0
  476. package/dist/lib/quota-dialog-command-specs.d.ts.map +1 -0
  477. package/dist/lib/quota-dialog-command-specs.js +145 -0
  478. package/dist/lib/quota-dialog-command-specs.js.map +1 -0
  479. package/dist/lib/quota-dialog-commands.d.ts +75 -0
  480. package/dist/lib/quota-dialog-commands.d.ts.map +1 -0
  481. package/dist/lib/quota-dialog-commands.js +586 -0
  482. package/dist/lib/quota-dialog-commands.js.map +1 -0
  483. package/dist/lib/quota-entry-display.d.ts +7 -0
  484. package/dist/lib/quota-entry-display.d.ts.map +1 -0
  485. package/dist/lib/quota-entry-display.js +59 -0
  486. package/dist/lib/quota-entry-display.js.map +1 -0
  487. package/dist/lib/quota-exhaustion-projection.d.ts +11 -0
  488. package/dist/lib/quota-exhaustion-projection.d.ts.map +1 -0
  489. package/dist/lib/quota-exhaustion-projection.js +105 -0
  490. package/dist/lib/quota-exhaustion-projection.js.map +1 -0
  491. package/dist/lib/quota-export-types.d.ts +96 -0
  492. package/dist/lib/quota-export-types.d.ts.map +1 -0
  493. package/dist/lib/quota-export-types.js +2 -0
  494. package/dist/lib/quota-export-types.js.map +1 -0
  495. package/dist/lib/quota-export.d.ts +44 -0
  496. package/dist/lib/quota-export.d.ts.map +1 -0
  497. package/dist/lib/quota-export.js +221 -0
  498. package/dist/lib/quota-export.js.map +1 -0
  499. package/dist/lib/quota-format-style.d.ts +21 -0
  500. package/dist/lib/quota-format-style.d.ts.map +1 -0
  501. package/dist/lib/quota-format-style.js +38 -0
  502. package/dist/lib/quota-format-style.js.map +1 -0
  503. package/dist/lib/quota-providers-local.d.ts +55 -0
  504. package/dist/lib/quota-providers-local.d.ts.map +1 -0
  505. package/dist/lib/quota-providers-local.js +327 -0
  506. package/dist/lib/quota-providers-local.js.map +1 -0
  507. package/dist/lib/quota-providers-remote.d.ts +27 -0
  508. package/dist/lib/quota-providers-remote.d.ts.map +1 -0
  509. package/dist/lib/quota-providers-remote.js +678 -0
  510. package/dist/lib/quota-providers-remote.js.map +1 -0
  511. package/dist/lib/quota-providers.d.ts +158 -0
  512. package/dist/lib/quota-providers.d.ts.map +1 -0
  513. package/dist/lib/quota-providers.js +1160 -0
  514. package/dist/lib/quota-providers.js.map +1 -0
  515. package/dist/lib/quota-render-data.d.ts +135 -0
  516. package/dist/lib/quota-render-data.d.ts.map +1 -0
  517. package/dist/lib/quota-render-data.js +462 -0
  518. package/dist/lib/quota-render-data.js.map +1 -0
  519. package/dist/lib/quota-report-message.d.ts +22 -0
  520. package/dist/lib/quota-report-message.d.ts.map +1 -0
  521. package/dist/lib/quota-report-message.js +36 -0
  522. package/dist/lib/quota-report-message.js.map +1 -0
  523. package/dist/lib/quota-reset-notifications.d.ts +20 -0
  524. package/dist/lib/quota-reset-notifications.d.ts.map +1 -0
  525. package/dist/lib/quota-reset-notifications.js +331 -0
  526. package/dist/lib/quota-reset-notifications.js.map +1 -0
  527. package/dist/lib/quota-retry-wait.d.ts +36 -0
  528. package/dist/lib/quota-retry-wait.d.ts.map +1 -0
  529. package/dist/lib/quota-retry-wait.js +67 -0
  530. package/dist/lib/quota-retry-wait.js.map +1 -0
  531. package/dist/lib/quota-runtime-context.d.ts +56 -0
  532. package/dist/lib/quota-runtime-context.d.ts.map +1 -0
  533. package/dist/lib/quota-runtime-context.js +113 -0
  534. package/dist/lib/quota-runtime-context.js.map +1 -0
  535. package/dist/lib/quota-state-codec.d.ts +16 -0
  536. package/dist/lib/quota-state-codec.d.ts.map +1 -0
  537. package/dist/lib/quota-state-codec.js +475 -0
  538. package/dist/lib/quota-state-codec.js.map +1 -0
  539. package/dist/lib/quota-state.d.ts +28 -0
  540. package/dist/lib/quota-state.d.ts.map +1 -0
  541. package/dist/lib/quota-state.js +473 -0
  542. package/dist/lib/quota-state.js.map +1 -0
  543. package/dist/lib/quota-stats-format.d.ts +29 -0
  544. package/dist/lib/quota-stats-format.d.ts.map +1 -0
  545. package/dist/lib/quota-stats-format.js +459 -0
  546. package/dist/lib/quota-stats-format.js.map +1 -0
  547. package/dist/lib/quota-stats.d.ts +174 -0
  548. package/dist/lib/quota-stats.d.ts.map +1 -0
  549. package/dist/lib/quota-stats.js +713 -0
  550. package/dist/lib/quota-stats.js.map +1 -0
  551. package/dist/lib/quota-status.d.ts +58 -0
  552. package/dist/lib/quota-status.d.ts.map +1 -0
  553. package/dist/lib/quota-status.js +865 -0
  554. package/dist/lib/quota-status.js.map +1 -0
  555. package/dist/lib/quota-surface-data.d.ts +21 -0
  556. package/dist/lib/quota-surface-data.d.ts.map +1 -0
  557. package/dist/lib/quota-surface-data.js +361 -0
  558. package/dist/lib/quota-surface-data.js.map +1 -0
  559. package/dist/lib/quota-telemetry.d.ts +45 -0
  560. package/dist/lib/quota-telemetry.d.ts.map +1 -0
  561. package/dist/lib/quota-telemetry.js +304 -0
  562. package/dist/lib/quota-telemetry.js.map +1 -0
  563. package/dist/lib/report-document.d.ts +90 -0
  564. package/dist/lib/report-document.d.ts.map +1 -0
  565. package/dist/lib/report-document.js +190 -0
  566. package/dist/lib/report-document.js.map +1 -0
  567. package/dist/lib/resolved-auth-identity.d.ts +36 -0
  568. package/dist/lib/resolved-auth-identity.d.ts.map +1 -0
  569. package/dist/lib/resolved-auth-identity.js +192 -0
  570. package/dist/lib/resolved-auth-identity.js.map +1 -0
  571. package/dist/lib/runtime-provider-ids.d.ts +4 -0
  572. package/dist/lib/runtime-provider-ids.d.ts.map +1 -0
  573. package/dist/lib/runtime-provider-ids.js +10 -0
  574. package/dist/lib/runtime-provider-ids.js.map +1 -0
  575. package/dist/lib/scoped-update-migration.d.ts +103 -0
  576. package/dist/lib/scoped-update-migration.d.ts.map +1 -0
  577. package/dist/lib/scoped-update-migration.js +348 -0
  578. package/dist/lib/scoped-update-migration.js.map +1 -0
  579. package/dist/lib/scoped-update.d.ts +78 -0
  580. package/dist/lib/scoped-update.d.ts.map +1 -0
  581. package/dist/lib/scoped-update.js +640 -0
  582. package/dist/lib/scoped-update.js.map +1 -0
  583. package/dist/lib/session-tokens-format.d.ts +36 -0
  584. package/dist/lib/session-tokens-format.d.ts.map +1 -0
  585. package/dist/lib/session-tokens-format.js +111 -0
  586. package/dist/lib/session-tokens-format.js.map +1 -0
  587. package/dist/lib/session-tokens.d.ts +27 -0
  588. package/dist/lib/session-tokens.d.ts.map +1 -0
  589. package/dist/lib/session-tokens.js +55 -0
  590. package/dist/lib/session-tokens.js.map +1 -0
  591. package/dist/lib/synthetic-config.d.ts +15 -0
  592. package/dist/lib/synthetic-config.d.ts.map +1 -0
  593. package/dist/lib/synthetic-config.js +28 -0
  594. package/dist/lib/synthetic-config.js.map +1 -0
  595. package/dist/lib/synthetic.d.ts +12 -0
  596. package/dist/lib/synthetic.d.ts.map +1 -0
  597. package/dist/lib/synthetic.js +173 -0
  598. package/dist/lib/synthetic.js.map +1 -0
  599. package/dist/lib/toast-format-grouped.d.ts +25 -0
  600. package/dist/lib/toast-format-grouped.d.ts.map +1 -0
  601. package/dist/lib/toast-format-grouped.js +296 -0
  602. package/dist/lib/toast-format-grouped.js.map +1 -0
  603. package/dist/lib/token-buckets.d.ts +24 -0
  604. package/dist/lib/token-buckets.d.ts.map +1 -0
  605. package/dist/lib/token-buckets.js +28 -0
  606. package/dist/lib/token-buckets.js.map +1 -0
  607. package/dist/lib/token-cost.d.ts +10 -0
  608. package/dist/lib/token-cost.d.ts.map +1 -0
  609. package/dist/lib/token-cost.js +16 -0
  610. package/dist/lib/token-cost.js.map +1 -0
  611. package/dist/lib/tui-compact-format.d.ts +10 -0
  612. package/dist/lib/tui-compact-format.d.ts.map +1 -0
  613. package/dist/lib/tui-compact-format.js +460 -0
  614. package/dist/lib/tui-compact-format.js.map +1 -0
  615. package/dist/lib/tui-panel-state.d.ts +15 -0
  616. package/dist/lib/tui-panel-state.d.ts.map +1 -0
  617. package/dist/lib/tui-panel-state.js +2 -0
  618. package/dist/lib/tui-panel-state.js.map +1 -0
  619. package/dist/lib/tui-prompt-bar-format.d.ts +25 -0
  620. package/dist/lib/tui-prompt-bar-format.d.ts.map +1 -0
  621. package/dist/lib/tui-prompt-bar-format.js +206 -0
  622. package/dist/lib/tui-prompt-bar-format.js.map +1 -0
  623. package/dist/lib/tui-sidebar-format.d.ts +13 -0
  624. package/dist/lib/tui-sidebar-format.d.ts.map +1 -0
  625. package/dist/lib/tui-sidebar-format.js +34 -0
  626. package/dist/lib/tui-sidebar-format.js.map +1 -0
  627. package/dist/lib/types.d.ts +724 -0
  628. package/dist/lib/types.d.ts.map +1 -0
  629. package/dist/lib/types.js +83 -0
  630. package/dist/lib/types.js.map +1 -0
  631. package/dist/lib/usage-ownership.d.ts +47 -0
  632. package/dist/lib/usage-ownership.d.ts.map +1 -0
  633. package/dist/lib/usage-ownership.js +98 -0
  634. package/dist/lib/usage-ownership.js.map +1 -0
  635. package/dist/lib/version.d.ts +2 -0
  636. package/dist/lib/version.d.ts.map +1 -0
  637. package/dist/lib/version.js +33 -0
  638. package/dist/lib/version.js.map +1 -0
  639. package/dist/lib/xai.d.ts +52 -0
  640. package/dist/lib/xai.d.ts.map +1 -0
  641. package/dist/lib/xai.js +253 -0
  642. package/dist/lib/xai.js.map +1 -0
  643. package/dist/lib/zai-auth.d.ts +15 -0
  644. package/dist/lib/zai-auth.d.ts.map +1 -0
  645. package/dist/lib/zai-auth.js +37 -0
  646. package/dist/lib/zai-auth.js.map +1 -0
  647. package/dist/lib/zai.d.ts +5 -0
  648. package/dist/lib/zai.d.ts.map +1 -0
  649. package/dist/lib/zai.js +14 -0
  650. package/dist/lib/zai.js.map +1 -0
  651. package/dist/lib/zhipu-auth.d.ts +15 -0
  652. package/dist/lib/zhipu-auth.d.ts.map +1 -0
  653. package/dist/lib/zhipu-auth.js +42 -0
  654. package/dist/lib/zhipu-auth.js.map +1 -0
  655. package/dist/lib/zhipu.d.ts +5 -0
  656. package/dist/lib/zhipu.d.ts.map +1 -0
  657. package/dist/lib/zhipu.js +13 -0
  658. package/dist/lib/zhipu.js.map +1 -0
  659. package/dist/plugin.d.ts +10 -0
  660. package/dist/plugin.d.ts.map +1 -0
  661. package/dist/plugin.js +95 -0
  662. package/dist/plugin.js.map +1 -0
  663. package/dist/providers/accounting-decimal.d.ts +2 -0
  664. package/dist/providers/accounting-decimal.d.ts.map +1 -0
  665. package/dist/providers/accounting-decimal.js +23 -0
  666. package/dist/providers/accounting-decimal.js.map +1 -0
  667. package/dist/providers/alibaba-coding-plan.d.ts +3 -0
  668. package/dist/providers/alibaba-coding-plan.d.ts.map +1 -0
  669. package/dist/providers/alibaba-coding-plan.js +122 -0
  670. package/dist/providers/alibaba-coding-plan.js.map +1 -0
  671. package/dist/providers/alibaba-token-plan.d.ts +3 -0
  672. package/dist/providers/alibaba-token-plan.d.ts.map +1 -0
  673. package/dist/providers/alibaba-token-plan.js +90 -0
  674. package/dist/providers/alibaba-token-plan.js.map +1 -0
  675. package/dist/providers/anthropic.d.ts +9 -0
  676. package/dist/providers/anthropic.d.ts.map +1 -0
  677. package/dist/providers/anthropic.js +236 -0
  678. package/dist/providers/anthropic.js.map +1 -0
  679. package/dist/providers/cache-policies.d.ts +61 -0
  680. package/dist/providers/cache-policies.d.ts.map +1 -0
  681. package/dist/providers/cache-policies.js +210 -0
  682. package/dist/providers/cache-policies.js.map +1 -0
  683. package/dist/providers/chutes.d.ts +6 -0
  684. package/dist/providers/chutes.d.ts.map +1 -0
  685. package/dist/providers/chutes.js +50 -0
  686. package/dist/providers/chutes.js.map +1 -0
  687. package/dist/providers/copilot.d.ts +9 -0
  688. package/dist/providers/copilot.d.ts.map +1 -0
  689. package/dist/providers/copilot.js +323 -0
  690. package/dist/providers/copilot.js.map +1 -0
  691. package/dist/providers/cursor.d.ts +3 -0
  692. package/dist/providers/cursor.d.ts.map +1 -0
  693. package/dist/providers/cursor.js +182 -0
  694. package/dist/providers/cursor.js.map +1 -0
  695. package/dist/providers/deepseek.d.ts +9 -0
  696. package/dist/providers/deepseek.d.ts.map +1 -0
  697. package/dist/providers/deepseek.js +111 -0
  698. package/dist/providers/deepseek.js.map +1 -0
  699. package/dist/providers/glm-coding-plan-provider.d.ts +56 -0
  700. package/dist/providers/glm-coding-plan-provider.d.ts.map +1 -0
  701. package/dist/providers/glm-coding-plan-provider.js +146 -0
  702. package/dist/providers/glm-coding-plan-provider.js.map +1 -0
  703. package/dist/providers/google-account-format.d.ts +7 -0
  704. package/dist/providers/google-account-format.d.ts.map +1 -0
  705. package/dist/providers/google-account-format.js +52 -0
  706. package/dist/providers/google-account-format.js.map +1 -0
  707. package/dist/providers/google-agy.d.ts +17 -0
  708. package/dist/providers/google-agy.d.ts.map +1 -0
  709. package/dist/providers/google-agy.js +256 -0
  710. package/dist/providers/google-agy.js.map +1 -0
  711. package/dist/providers/google-gemini-cli.d.ts +17 -0
  712. package/dist/providers/google-gemini-cli.d.ts.map +1 -0
  713. package/dist/providers/google-gemini-cli.js +228 -0
  714. package/dist/providers/google-gemini-cli.js.map +1 -0
  715. package/dist/providers/kilo.d.ts +6 -0
  716. package/dist/providers/kilo.d.ts.map +1 -0
  717. package/dist/providers/kilo.js +145 -0
  718. package/dist/providers/kilo.js.map +1 -0
  719. package/dist/providers/kimi-code.d.ts +4 -0
  720. package/dist/providers/kimi-code.d.ts.map +1 -0
  721. package/dist/providers/kimi-code.js +175 -0
  722. package/dist/providers/kimi-code.js.map +1 -0
  723. package/dist/providers/mimo.d.ts +3 -0
  724. package/dist/providers/mimo.d.ts.map +1 -0
  725. package/dist/providers/mimo.js +149 -0
  726. package/dist/providers/mimo.js.map +1 -0
  727. package/dist/providers/minimax-coding-plan.d.ts +26 -0
  728. package/dist/providers/minimax-coding-plan.d.ts.map +1 -0
  729. package/dist/providers/minimax-coding-plan.js +391 -0
  730. package/dist/providers/minimax-coding-plan.js.map +1 -0
  731. package/dist/providers/nanogpt.d.ts +6 -0
  732. package/dist/providers/nanogpt.d.ts.map +1 -0
  733. package/dist/providers/nanogpt.js +160 -0
  734. package/dist/providers/nanogpt.js.map +1 -0
  735. package/dist/providers/ollama-cloud.d.ts +9 -0
  736. package/dist/providers/ollama-cloud.d.ts.map +1 -0
  737. package/dist/providers/ollama-cloud.js +129 -0
  738. package/dist/providers/ollama-cloud.js.map +1 -0
  739. package/dist/providers/openai.d.ts +6 -0
  740. package/dist/providers/openai.d.ts.map +1 -0
  741. package/dist/providers/openai.js +313 -0
  742. package/dist/providers/openai.js.map +1 -0
  743. package/dist/providers/opencode-go.d.ts +4 -0
  744. package/dist/providers/opencode-go.d.ts.map +1 -0
  745. package/dist/providers/opencode-go.js +294 -0
  746. package/dist/providers/opencode-go.js.map +1 -0
  747. package/dist/providers/opencode-zen.d.ts +3 -0
  748. package/dist/providers/opencode-zen.d.ts.map +1 -0
  749. package/dist/providers/opencode-zen.js +221 -0
  750. package/dist/providers/opencode-zen.js.map +1 -0
  751. package/dist/providers/openrouter.d.ts +6 -0
  752. package/dist/providers/openrouter.d.ts.map +1 -0
  753. package/dist/providers/openrouter.js +32 -0
  754. package/dist/providers/openrouter.js.map +1 -0
  755. package/dist/providers/quota-providers.d.ts +6 -0
  756. package/dist/providers/quota-providers.d.ts.map +1 -0
  757. package/dist/providers/quota-providers.js +287 -0
  758. package/dist/providers/quota-providers.js.map +1 -0
  759. package/dist/providers/registry.d.ts +9 -0
  760. package/dist/providers/registry.d.ts.map +1 -0
  761. package/dist/providers/registry.js +71 -0
  762. package/dist/providers/registry.js.map +1 -0
  763. package/dist/providers/result-helpers.d.ts +61 -0
  764. package/dist/providers/result-helpers.d.ts.map +1 -0
  765. package/dist/providers/result-helpers.js +117 -0
  766. package/dist/providers/result-helpers.js.map +1 -0
  767. package/dist/providers/synthetic.d.ts +6 -0
  768. package/dist/providers/synthetic.d.ts.map +1 -0
  769. package/dist/providers/synthetic.js +79 -0
  770. package/dist/providers/synthetic.js.map +1 -0
  771. package/dist/providers/xai.d.ts +6 -0
  772. package/dist/providers/xai.d.ts.map +1 -0
  773. package/dist/providers/xai.js +122 -0
  774. package/dist/providers/xai.js.map +1 -0
  775. package/dist/providers/zai.d.ts +2 -0
  776. package/dist/providers/zai.d.ts.map +1 -0
  777. package/dist/providers/zai.js +24 -0
  778. package/dist/providers/zai.js.map +1 -0
  779. package/dist/providers/zhipu.d.ts +2 -0
  780. package/dist/providers/zhipu.d.ts.map +1 -0
  781. package/dist/providers/zhipu.js +21 -0
  782. package/dist/providers/zhipu.js.map +1 -0
  783. package/dist/rpc.d.ts +72 -0
  784. package/dist/rpc.d.ts.map +1 -0
  785. package/dist/rpc.js +77 -0
  786. package/dist/rpc.js.map +1 -0
  787. package/dist/ui/assets/KaTeX_AMS-Regular-BQhdFMY1.woff2 +0 -0
  788. package/dist/ui/assets/KaTeX_AMS-Regular-DMm9YOAa.woff +0 -0
  789. package/dist/ui/assets/KaTeX_AMS-Regular-DRggAlZN.ttf +0 -0
  790. package/dist/ui/assets/KaTeX_Caligraphic-Bold-ATXxdsX0.ttf +0 -0
  791. package/dist/ui/assets/KaTeX_Caligraphic-Bold-BEiXGLvX.woff +0 -0
  792. package/dist/ui/assets/KaTeX_Caligraphic-Bold-Dq_IR9rO.woff2 +0 -0
  793. package/dist/ui/assets/KaTeX_Caligraphic-Regular-CTRA-rTL.woff +0 -0
  794. package/dist/ui/assets/KaTeX_Caligraphic-Regular-Di6jR-x-.woff2 +0 -0
  795. package/dist/ui/assets/KaTeX_Caligraphic-Regular-wX97UBjC.ttf +0 -0
  796. package/dist/ui/assets/KaTeX_Fraktur-Bold-BdnERNNW.ttf +0 -0
  797. package/dist/ui/assets/KaTeX_Fraktur-Bold-BsDP51OF.woff +0 -0
  798. package/dist/ui/assets/KaTeX_Fraktur-Bold-CL6g_b3V.woff2 +0 -0
  799. package/dist/ui/assets/KaTeX_Fraktur-Regular-CB_wures.ttf +0 -0
  800. package/dist/ui/assets/KaTeX_Fraktur-Regular-CTYiF6lA.woff2 +0 -0
  801. package/dist/ui/assets/KaTeX_Fraktur-Regular-Dxdc4cR9.woff +0 -0
  802. package/dist/ui/assets/KaTeX_Main-Bold-Cx986IdX.woff2 +0 -0
  803. package/dist/ui/assets/KaTeX_Main-Bold-Jm3AIy58.woff +0 -0
  804. package/dist/ui/assets/KaTeX_Main-Bold-waoOVXN0.ttf +0 -0
  805. package/dist/ui/assets/KaTeX_Main-BoldItalic-DxDJ3AOS.woff2 +0 -0
  806. package/dist/ui/assets/KaTeX_Main-BoldItalic-DzxPMmG6.ttf +0 -0
  807. package/dist/ui/assets/KaTeX_Main-BoldItalic-SpSLRI95.woff +0 -0
  808. package/dist/ui/assets/KaTeX_Main-Italic-3WenGoN9.ttf +0 -0
  809. package/dist/ui/assets/KaTeX_Main-Italic-BMLOBm91.woff +0 -0
  810. package/dist/ui/assets/KaTeX_Main-Italic-NWA7e6Wa.woff2 +0 -0
  811. package/dist/ui/assets/KaTeX_Main-Regular-B22Nviop.woff2 +0 -0
  812. package/dist/ui/assets/KaTeX_Main-Regular-Dr94JaBh.woff +0 -0
  813. package/dist/ui/assets/KaTeX_Main-Regular-ypZvNtVU.ttf +0 -0
  814. package/dist/ui/assets/KaTeX_Math-BoldItalic-B3XSjfu4.ttf +0 -0
  815. package/dist/ui/assets/KaTeX_Math-BoldItalic-CZnvNsCZ.woff2 +0 -0
  816. package/dist/ui/assets/KaTeX_Math-BoldItalic-iY-2wyZ7.woff +0 -0
  817. package/dist/ui/assets/KaTeX_Math-Italic-DA0__PXp.woff +0 -0
  818. package/dist/ui/assets/KaTeX_Math-Italic-flOr_0UB.ttf +0 -0
  819. package/dist/ui/assets/KaTeX_Math-Italic-t53AETM-.woff2 +0 -0
  820. package/dist/ui/assets/KaTeX_SansSerif-Bold-CFMepnvq.ttf +0 -0
  821. package/dist/ui/assets/KaTeX_SansSerif-Bold-D1sUS0GD.woff2 +0 -0
  822. package/dist/ui/assets/KaTeX_SansSerif-Bold-DbIhKOiC.woff +0 -0
  823. package/dist/ui/assets/KaTeX_SansSerif-Italic-C3H0VqGB.woff2 +0 -0
  824. package/dist/ui/assets/KaTeX_SansSerif-Italic-DN2j7dab.woff +0 -0
  825. package/dist/ui/assets/KaTeX_SansSerif-Italic-YYjJ1zSn.ttf +0 -0
  826. package/dist/ui/assets/KaTeX_SansSerif-Regular-BNo7hRIc.ttf +0 -0
  827. package/dist/ui/assets/KaTeX_SansSerif-Regular-CS6fqUqJ.woff +0 -0
  828. package/dist/ui/assets/KaTeX_SansSerif-Regular-DDBCnlJ7.woff2 +0 -0
  829. package/dist/ui/assets/KaTeX_Script-Regular-C5JkGWo-.ttf +0 -0
  830. package/dist/ui/assets/KaTeX_Script-Regular-D3wIWfF6.woff2 +0 -0
  831. package/dist/ui/assets/KaTeX_Script-Regular-D5yQViql.woff +0 -0
  832. package/dist/ui/assets/KaTeX_Size1-Regular-C195tn64.woff +0 -0
  833. package/dist/ui/assets/KaTeX_Size1-Regular-Dbsnue_I.ttf +0 -0
  834. package/dist/ui/assets/KaTeX_Size1-Regular-mCD8mA8B.woff2 +0 -0
  835. package/dist/ui/assets/KaTeX_Size2-Regular-B7gKUWhC.ttf +0 -0
  836. package/dist/ui/assets/KaTeX_Size2-Regular-Dy4dx90m.woff2 +0 -0
  837. package/dist/ui/assets/KaTeX_Size2-Regular-oD1tc_U0.woff +0 -0
  838. package/dist/ui/assets/KaTeX_Size3-Regular-CTq5MqoE.woff +0 -0
  839. package/dist/ui/assets/KaTeX_Size3-Regular-DgpXs0kz.ttf +0 -0
  840. package/dist/ui/assets/KaTeX_Size4-Regular-BF-4gkZK.woff +0 -0
  841. package/dist/ui/assets/KaTeX_Size4-Regular-DWFBv043.ttf +0 -0
  842. package/dist/ui/assets/KaTeX_Size4-Regular-Dl5lxZxV.woff2 +0 -0
  843. package/dist/ui/assets/KaTeX_Typewriter-Regular-C0xS9mPB.woff +0 -0
  844. package/dist/ui/assets/KaTeX_Typewriter-Regular-CO6r4hn1.woff2 +0 -0
  845. package/dist/ui/assets/KaTeX_Typewriter-Regular-D3Ib7_Hf.ttf +0 -0
  846. package/dist/ui/assets/index-BvKGj9wc.js +8 -0
  847. package/dist/ui/assets/index-wlxynmbV.css +1 -0
  848. package/dist/ui/index.html +13 -0
  849. package/package.json +123 -3
@@ -0,0 +1,1327 @@
1
+ /**
2
+ * Configuration loader for the opencode-quota-gui product.
3
+ *
4
+ * `loadConfig` is the runtime loader: canonical GUI config plus defaults only.
5
+ * `loadConfigLayered` retains the full precedence below for the explicit
6
+ * legacy settings import/preview:
7
+ * - Global/user config provides defaults.
8
+ * - Workspace config at the resolved config root overrides ordinary settings.
9
+ * - SDK config is used only as a fallback when no file-backed config exists.
10
+ */
11
+ import { existsSync, realpathSync } from "fs";
12
+ import { join } from "path";
13
+ import { isResetTimeDecimals } from "./format-utils.js";
14
+ import { buildOpenCodeConfigCandidates, readOpenCodeConfigCandidate, } from "./opencode-config-read.js";
15
+ import { getOpencodeRuntimeDirs } from "./opencode-runtime-paths.js";
16
+ import { getQuotaProviderShape, normalizeQuotaProviderId } from "./provider-metadata.js";
17
+ import { isQuotaFormatStyle, resolveQuotaFormatStyle } from "./quota-format-style.js";
18
+ import { cloneQuotaProviders, validateQuotaProviders } from "./quota-providers.js";
19
+ import { DASHBOARD_HIDDEN_ID_LIMIT, DEFAULT_CONFIG } from "./types.js";
20
+ export const QUOTA_TOAST_CONFIG_RELATIVE_PATHS = [
21
+ "opencode-quota/quota-toast.jsonc",
22
+ "opencode-quota/quota-toast.json",
23
+ ];
24
+ export const QUOTA_TOAST_CONFIG_RELATIVE_PATH = QUOTA_TOAST_CONFIG_RELATIVE_PATHS[1];
25
+ /**
26
+ * Global canonical dashboard config (spec §7): read/written only here, applied
27
+ * after every global legacy layer and before project layers, and never an
28
+ * authoritative sidecar root. The in-repo `opencode-quota-gui/config.jsonc`
29
+ * stays reserved but inactive.
30
+ */
31
+ export const GUI_CONFIG_RELATIVE_PATH = "opencode-quota-gui/config.jsonc";
32
+ export const GUI_CONFIG_SIBLING_JSON_RELATIVE_PATH = "opencode-quota-gui/config.json";
33
+ export function getGuiConfigPath(configDir) {
34
+ return join(configDir, GUI_CONFIG_RELATIVE_PATH);
35
+ }
36
+ export function getGuiConfigSiblingJsonPath(configDir) {
37
+ return join(configDir, GUI_CONFIG_SIBLING_JSON_RELATIVE_PATH);
38
+ }
39
+ export const QUOTA_TOAST_SETTING_SOURCE_KEYS = [
40
+ "enabled",
41
+ "enableToast",
42
+ "resetNotifications.enabled",
43
+ "resetNotifications.windows",
44
+ "tuiCommandDisplay",
45
+ "formatStyle",
46
+ "percentDisplayMode",
47
+ "quotaProjection",
48
+ "percentLabelStyle",
49
+ "accountingDetail",
50
+ "resetTimeDecimals",
51
+ "resetTimeSpaced",
52
+ "minIntervalMs",
53
+ "requestTimeoutMs",
54
+ "debug",
55
+ "enabledProviders",
56
+ "quotaProviders",
57
+ "anthropicBinaryPath",
58
+ "cursorPlan",
59
+ "cursorIncludedApiUsd",
60
+ "cursorBillingCycleStartDay",
61
+ "opencodeGoWindows",
62
+ "opencodeMonthlyLimit",
63
+ "pricingSnapshot.source",
64
+ "pricingSnapshot.autoRefresh",
65
+ "showOnIdle",
66
+ "showOnQuestion",
67
+ "showOnCompact",
68
+ "showOnBothFail",
69
+ "toastDurationMs",
70
+ "onlyCurrentModel",
71
+ "waitForQuotaReset",
72
+ "showSessionTokens",
73
+ "sessionTokenScope",
74
+ "tuiSidebarPanel.enabled",
75
+ "tuiSidebarPanel.formatStyle",
76
+ "tuiSidebarPanel.opencodeGoPreferredWindow",
77
+ "tuiCompactStatus.enabled",
78
+ "tuiCompactStatus.homeBottom",
79
+ "tuiCompactStatus.sessionPrompt",
80
+ "tuiCompactStatus.maxWidth",
81
+ "tuiCompactStatus.formatStyle",
82
+ "tuiPromptBar.enabled",
83
+ "maintainerAnnouncements.enabled",
84
+ "maintainerAnnouncements.home",
85
+ "maintainerAnnouncements.homeFrequency",
86
+ "layout.maxWidth",
87
+ "layout.narrowAt",
88
+ "layout.tinyAt",
89
+ "export.enabled",
90
+ "export.path",
91
+ "telemetry.enabled",
92
+ "dashboard.port",
93
+ "dashboard.hiddenCards",
94
+ "dashboard.hiddenRows",
95
+ "dashboard.providerOrder",
96
+ ];
97
+ export function createLoadConfigMeta() {
98
+ return {
99
+ source: "defaults",
100
+ paths: [],
101
+ globalConfigPaths: [],
102
+ workspaceConfigPaths: [],
103
+ settingSources: {},
104
+ settingSourceLayers: {},
105
+ networkSettingSources: {},
106
+ configIssues: [],
107
+ };
108
+ }
109
+ const NETWORK_SETTING_SOURCE_KEYS = [
110
+ "enabled",
111
+ "enabledProviders",
112
+ "quotaProviders",
113
+ "minIntervalMs",
114
+ "requestTimeoutMs",
115
+ "pricingSnapshot.source",
116
+ "pricingSnapshot.autoRefresh",
117
+ "showOnIdle",
118
+ "showOnQuestion",
119
+ "showOnCompact",
120
+ "showOnBothFail",
121
+ ];
122
+ export function getQuotaToastConfigPath(configRootDir, format = "json") {
123
+ return join(configRootDir, `opencode-quota/quota-toast.${format}`);
124
+ }
125
+ export function resolveQuotaToastConfigPath(configRootDir) {
126
+ return (QUOTA_TOAST_CONFIG_RELATIVE_PATHS.map((relativePath) => join(configRootDir, relativePath)).find((path) => existsSync(path)) ?? getQuotaToastConfigPath(configRootDir));
127
+ }
128
+ function hasOwnKey(value, key) {
129
+ return Object.hasOwn(value, key);
130
+ }
131
+ function isPlainObject(value) {
132
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
133
+ }
134
+ function isValidCursorQuotaPlan(plan) {
135
+ return typeof plan === "string" && ["none", "pro", "pro-plus", "ultra"].includes(plan);
136
+ }
137
+ function isValidPricingSnapshotSource(source) {
138
+ return typeof source === "string" && ["auto", "bundled", "runtime"].includes(source);
139
+ }
140
+ function isValidPricingSnapshotAutoRefresh(value) {
141
+ return typeof value === "number" && Number.isInteger(value) && value > 0;
142
+ }
143
+ function isValidPercentDisplayMode(value) {
144
+ return value === "remaining" || value === "used";
145
+ }
146
+ function isValidPercentLabelStyle(value) {
147
+ return value === "full" || value === "bare";
148
+ }
149
+ function isValidAccountingDetail(value) {
150
+ return value === "summary" || value === "detailed";
151
+ }
152
+ function isValidTuiCommandDisplay(value) {
153
+ return value === "inline" || value === "dialog";
154
+ }
155
+ function isValidSessionTokenScope(value) {
156
+ return value === "current" || value === "tree";
157
+ }
158
+ export function isPositiveNumber(value) {
159
+ return typeof value === "number" && Number.isFinite(value) && value > 0;
160
+ }
161
+ function isNonNegativeNumber(value) {
162
+ return typeof value === "number" && Number.isFinite(value) && value >= 0;
163
+ }
164
+ function isValidDashboardPort(value) {
165
+ return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 65535;
166
+ }
167
+ function isValidCursorBillingCycleStartDay(value) {
168
+ return typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 28;
169
+ }
170
+ const VALID_OPENCODE_GO_WINDOWS = ["rolling", "weekly", "monthly"];
171
+ function isValidOpenCodeGoWindow(value) {
172
+ return (typeof value === "string" &&
173
+ VALID_OPENCODE_GO_WINDOWS.includes(value));
174
+ }
175
+ export function isValidOpenCodeGoWindows(value) {
176
+ if (!Array.isArray(value))
177
+ return false;
178
+ if (value.length === 0)
179
+ return false;
180
+ return value.every(isValidOpenCodeGoWindow);
181
+ }
182
+ function normalizeOptionalString(value) {
183
+ if (typeof value !== "string") {
184
+ return undefined;
185
+ }
186
+ const trimmed = value.trim();
187
+ return trimmed ? trimmed : undefined;
188
+ }
189
+ function getExplicitFormatStyle(config) {
190
+ if (!config || !isQuotaFormatStyle(config.formatStyle)) {
191
+ return undefined;
192
+ }
193
+ return resolveQuotaFormatStyle(config.formatStyle);
194
+ }
195
+ function getConfiguredFormatStyle(quotaToastConfig) {
196
+ const formatStyle = getExplicitFormatStyle(quotaToastConfig);
197
+ if (formatStyle) {
198
+ return formatStyle;
199
+ }
200
+ const legacyFormatStyle = quotaToastConfig
201
+ ?.toastStyle;
202
+ if (isQuotaFormatStyle(legacyFormatStyle)) {
203
+ return resolveQuotaFormatStyle(legacyFormatStyle);
204
+ }
205
+ return undefined;
206
+ }
207
+ /**
208
+ * Remove duplicates from an array while preserving order
209
+ */
210
+ function dedupe(list) {
211
+ return [...new Set(list)];
212
+ }
213
+ function cloneDefaultConfig() {
214
+ return cloneConfig(DEFAULT_CONFIG);
215
+ }
216
+ function cloneConfig(config) {
217
+ return {
218
+ ...config,
219
+ enabledProviders: Array.isArray(config.enabledProviders)
220
+ ? [...config.enabledProviders]
221
+ : config.enabledProviders,
222
+ quotaProviders: cloneQuotaProviders(config.quotaProviders),
223
+ resetNotifications: {
224
+ ...config.resetNotifications,
225
+ windows: [...config.resetNotifications.windows],
226
+ },
227
+ opencodeGoWindows: [...config.opencodeGoWindows],
228
+ opencodeMonthlyLimit: config.opencodeMonthlyLimit,
229
+ pricingSnapshot: { ...config.pricingSnapshot },
230
+ tuiSidebarPanel: { ...config.tuiSidebarPanel },
231
+ tuiCompactStatus: { ...config.tuiCompactStatus },
232
+ tuiPromptBar: { ...config.tuiPromptBar },
233
+ maintainerAnnouncements: { ...config.maintainerAnnouncements },
234
+ layout: { ...config.layout },
235
+ export: { ...config.export },
236
+ telemetry: { ...config.telemetry },
237
+ dashboard: {
238
+ port: config.dashboard.port,
239
+ hiddenCards: [...config.dashboard.hiddenCards],
240
+ hiddenRows: [...config.dashboard.hiddenRows],
241
+ providerOrder: [...config.dashboard.providerOrder],
242
+ },
243
+ };
244
+ }
245
+ const QUOTA_RESET_WINDOWS = [
246
+ "fiveHour",
247
+ "hourly",
248
+ "daily",
249
+ "weekly",
250
+ "monthly",
251
+ "yearly",
252
+ ];
253
+ function extractQuotaResetNotificationsPatch(value, reportIssue) {
254
+ if (!isPlainObject(value))
255
+ return undefined;
256
+ const patch = {};
257
+ if (hasOwnKey(value, "enabled")) {
258
+ if (typeof value.enabled === "boolean")
259
+ patch.enabled = value.enabled;
260
+ else
261
+ reportIssue?.("resetNotifications.enabled", "expected boolean");
262
+ }
263
+ if (hasOwnKey(value, "windows")) {
264
+ if (Array.isArray(value.windows) &&
265
+ value.windows.length > 0 &&
266
+ value.windows.every((window) => QUOTA_RESET_WINDOWS.includes(window))) {
267
+ patch.windows = dedupe(value.windows);
268
+ }
269
+ else {
270
+ reportIssue?.("resetNotifications.windows", `expected a non-empty array of: ${QUOTA_RESET_WINDOWS.join(", ")}`);
271
+ }
272
+ }
273
+ return Object.keys(patch).length > 0 ? patch : undefined;
274
+ }
275
+ function describeInvalidProviderValue(value) {
276
+ return typeof value === "string" ? value : typeof value;
277
+ }
278
+ /** Shared `enabledProviders` normalization (loader + GUI settings writes). */
279
+ export function normalizeEnabledProviders(value) {
280
+ if (value === "auto") {
281
+ return { value: "auto", issues: [] };
282
+ }
283
+ if (!Array.isArray(value)) {
284
+ return {
285
+ value: [],
286
+ issues: ['expected "auto" or an array of provider ids'],
287
+ invalidEmpty: true,
288
+ };
289
+ }
290
+ if (value.length === 0) {
291
+ return { value: [], issues: [] };
292
+ }
293
+ const validProviders = [];
294
+ const invalidProviders = [];
295
+ for (const provider of value) {
296
+ if (typeof provider !== "string") {
297
+ invalidProviders.push(describeInvalidProviderValue(provider));
298
+ continue;
299
+ }
300
+ const normalized = normalizeQuotaProviderId(provider);
301
+ if (normalized && getQuotaProviderShape(normalized)) {
302
+ validProviders.push(normalized);
303
+ }
304
+ else {
305
+ invalidProviders.push(provider);
306
+ }
307
+ }
308
+ const issues = invalidProviders.length
309
+ ? [`unknown provider id(s): ${dedupe(invalidProviders).join(", ")}`]
310
+ : [];
311
+ const normalizedProviders = dedupe(validProviders);
312
+ return {
313
+ value: normalizedProviders,
314
+ issues,
315
+ invalidEmpty: normalizedProviders.length === 0 && invalidProviders.length > 0,
316
+ };
317
+ }
318
+ function extractPricingSnapshotPatch(value) {
319
+ if (!isPlainObject(value)) {
320
+ return undefined;
321
+ }
322
+ const patch = {};
323
+ if (hasOwnKey(value, "source") && isValidPricingSnapshotSource(value.source)) {
324
+ patch.source = value.source;
325
+ }
326
+ if (hasOwnKey(value, "autoRefresh") && isValidPricingSnapshotAutoRefresh(value.autoRefresh)) {
327
+ patch.autoRefresh = value.autoRefresh;
328
+ }
329
+ return Object.keys(patch).length > 0 ? patch : undefined;
330
+ }
331
+ function extractTuiSidebarPanelPatch(value) {
332
+ if (!isPlainObject(value)) {
333
+ return undefined;
334
+ }
335
+ const patch = {};
336
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
337
+ patch.enabled = value.enabled;
338
+ }
339
+ const sidebarFormatStyle = getExplicitFormatStyle(value);
340
+ if (sidebarFormatStyle) {
341
+ patch.formatStyle = sidebarFormatStyle;
342
+ }
343
+ if (hasOwnKey(value, "opencodeGoPreferredWindow") &&
344
+ isValidOpenCodeGoWindow(value.opencodeGoPreferredWindow)) {
345
+ patch.opencodeGoPreferredWindow = value.opencodeGoPreferredWindow;
346
+ }
347
+ return Object.keys(patch).length > 0 ? patch : undefined;
348
+ }
349
+ function extractTuiCompactStatusPatch(value) {
350
+ if (!isPlainObject(value)) {
351
+ return undefined;
352
+ }
353
+ const patch = {};
354
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
355
+ patch.enabled = value.enabled;
356
+ }
357
+ if (hasOwnKey(value, "homeBottom") && typeof value.homeBottom === "boolean") {
358
+ patch.homeBottom = value.homeBottom;
359
+ }
360
+ if (hasOwnKey(value, "sessionPrompt") && typeof value.sessionPrompt === "boolean") {
361
+ patch.sessionPrompt = value.sessionPrompt;
362
+ }
363
+ if (hasOwnKey(value, "maxWidth") && isPositiveNumber(value.maxWidth)) {
364
+ patch.maxWidth = value.maxWidth;
365
+ }
366
+ const compactFormatStyle = getExplicitFormatStyle(value);
367
+ if (compactFormatStyle) {
368
+ patch.formatStyle = compactFormatStyle;
369
+ }
370
+ return Object.keys(patch).length > 0 ? patch : undefined;
371
+ }
372
+ function extractTuiPromptBarPatch(value) {
373
+ if (!isPlainObject(value)) {
374
+ return undefined;
375
+ }
376
+ const patch = {};
377
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
378
+ patch.enabled = value.enabled;
379
+ }
380
+ return Object.keys(patch).length > 0 ? patch : undefined;
381
+ }
382
+ function extractMaintainerAnnouncementsPatch(value) {
383
+ if (!isPlainObject(value)) {
384
+ return undefined;
385
+ }
386
+ const patch = {};
387
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
388
+ patch.enabled = value.enabled;
389
+ }
390
+ if (hasOwnKey(value, "home") && typeof value.home === "boolean") {
391
+ patch.home = value.home;
392
+ }
393
+ if (hasOwnKey(value, "homeFrequency") &&
394
+ (value.homeFrequency === "daily" || value.homeFrequency === "always")) {
395
+ patch.homeFrequency = value.homeFrequency;
396
+ }
397
+ return Object.keys(patch).length > 0 ? patch : undefined;
398
+ }
399
+ function extractLayoutPatch(value) {
400
+ if (!isPlainObject(value)) {
401
+ return undefined;
402
+ }
403
+ const patch = {};
404
+ if (hasOwnKey(value, "maxWidth") && isPositiveNumber(value.maxWidth)) {
405
+ patch.maxWidth = value.maxWidth;
406
+ }
407
+ if (hasOwnKey(value, "narrowAt") && isPositiveNumber(value.narrowAt)) {
408
+ patch.narrowAt = value.narrowAt;
409
+ }
410
+ if (hasOwnKey(value, "tinyAt") && isPositiveNumber(value.tinyAt)) {
411
+ patch.tinyAt = value.tinyAt;
412
+ }
413
+ return Object.keys(patch).length > 0 ? patch : undefined;
414
+ }
415
+ function extractExportConfigPatch(value) {
416
+ if (!isPlainObject(value)) {
417
+ return undefined;
418
+ }
419
+ const patch = {};
420
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
421
+ patch.enabled = value.enabled;
422
+ }
423
+ if (hasOwnKey(value, "path") && typeof value.path === "string") {
424
+ patch.path = value.path;
425
+ }
426
+ return Object.keys(patch).length > 0 ? patch : undefined;
427
+ }
428
+ function extractTelemetryConfigPatch(value) {
429
+ if (!isPlainObject(value)) {
430
+ return undefined;
431
+ }
432
+ const patch = {};
433
+ if (hasOwnKey(value, "enabled") && typeof value.enabled === "boolean") {
434
+ patch.enabled = value.enabled;
435
+ }
436
+ return Object.keys(patch).length > 0 ? patch : undefined;
437
+ }
438
+ function normalizeHiddenIdList(value) {
439
+ if (!Array.isArray(value)) {
440
+ return undefined;
441
+ }
442
+ const ids = [];
443
+ for (const entry of value) {
444
+ if (typeof entry !== "string" || entry.length === 0 || entry.length > 512) {
445
+ return undefined;
446
+ }
447
+ ids.push(entry);
448
+ }
449
+ return dedupe(ids).slice(0, DASHBOARD_HIDDEN_ID_LIMIT);
450
+ }
451
+ function extractDashboardPatch(value, reportIssue) {
452
+ if (!isPlainObject(value)) {
453
+ return undefined;
454
+ }
455
+ const patch = {};
456
+ if (hasOwnKey(value, "port")) {
457
+ if (isValidDashboardPort(value.port)) {
458
+ patch.port = value.port;
459
+ }
460
+ else {
461
+ reportIssue?.("dashboard.port", "expected an integer between 1 and 65535");
462
+ }
463
+ }
464
+ for (const key of ["hiddenCards", "hiddenRows", "providerOrder"]) {
465
+ if (!hasOwnKey(value, key)) {
466
+ continue;
467
+ }
468
+ const ids = normalizeHiddenIdList(value[key]);
469
+ if (ids) {
470
+ patch[key] = ids;
471
+ }
472
+ else {
473
+ reportIssue?.(`dashboard.${key}`, "expected an array of id strings");
474
+ }
475
+ }
476
+ return Object.keys(patch).length > 0 ? patch : undefined;
477
+ }
478
+ function extractValidatedQuotaToastPatch(quotaToastConfig, reportIssue, options = {}) {
479
+ const patch = {};
480
+ if (hasOwnKey(quotaToastConfig, "enabled") && typeof quotaToastConfig.enabled === "boolean") {
481
+ patch.enabled = quotaToastConfig.enabled;
482
+ }
483
+ if (hasOwnKey(quotaToastConfig, "enableToast") &&
484
+ typeof quotaToastConfig.enableToast === "boolean") {
485
+ patch.enableToast = quotaToastConfig.enableToast;
486
+ }
487
+ if (hasOwnKey(quotaToastConfig, "resetNotifications")) {
488
+ const resetNotifications = extractQuotaResetNotificationsPatch(quotaToastConfig.resetNotifications, reportIssue);
489
+ if (resetNotifications)
490
+ patch.resetNotifications = resetNotifications;
491
+ }
492
+ if (hasOwnKey(quotaToastConfig, "tuiCommandDisplay")) {
493
+ if (isValidTuiCommandDisplay(quotaToastConfig.tuiCommandDisplay)) {
494
+ patch.tuiCommandDisplay = quotaToastConfig.tuiCommandDisplay;
495
+ }
496
+ else {
497
+ reportIssue?.("tuiCommandDisplay", 'expected "inline" or "dialog"');
498
+ }
499
+ }
500
+ const formatStyle = getConfiguredFormatStyle(quotaToastConfig);
501
+ if (formatStyle) {
502
+ patch.formatStyle = formatStyle;
503
+ }
504
+ if (hasOwnKey(quotaToastConfig, "percentDisplayMode") &&
505
+ isValidPercentDisplayMode(quotaToastConfig.percentDisplayMode)) {
506
+ patch.percentDisplayMode = quotaToastConfig.percentDisplayMode;
507
+ }
508
+ if (hasOwnKey(quotaToastConfig, "quotaProjection")) {
509
+ if (quotaToastConfig.quotaProjection === "runway") {
510
+ patch.quotaProjection = "runway";
511
+ }
512
+ else {
513
+ reportIssue?.("quotaProjection", 'expected "runway"');
514
+ }
515
+ }
516
+ if (hasOwnKey(quotaToastConfig, "percentLabelStyle") &&
517
+ isValidPercentLabelStyle(quotaToastConfig.percentLabelStyle)) {
518
+ patch.percentLabelStyle = quotaToastConfig.percentLabelStyle;
519
+ }
520
+ if (hasOwnKey(quotaToastConfig, "accountingDetail")) {
521
+ if (isValidAccountingDetail(quotaToastConfig.accountingDetail)) {
522
+ patch.accountingDetail = quotaToastConfig.accountingDetail;
523
+ }
524
+ else {
525
+ reportIssue?.("accountingDetail", 'expected "summary" or "detailed"');
526
+ }
527
+ }
528
+ if (hasOwnKey(quotaToastConfig, "resetTimeDecimals") &&
529
+ isResetTimeDecimals(quotaToastConfig.resetTimeDecimals)) {
530
+ patch.resetTimeDecimals = quotaToastConfig.resetTimeDecimals;
531
+ }
532
+ if (hasOwnKey(quotaToastConfig, "resetTimeSpaced") &&
533
+ typeof quotaToastConfig.resetTimeSpaced === "boolean") {
534
+ patch.resetTimeSpaced = quotaToastConfig.resetTimeSpaced;
535
+ }
536
+ if (hasOwnKey(quotaToastConfig, "minIntervalMs") &&
537
+ isPositiveNumber(quotaToastConfig.minIntervalMs)) {
538
+ patch.minIntervalMs = quotaToastConfig.minIntervalMs;
539
+ }
540
+ if (hasOwnKey(quotaToastConfig, "requestTimeoutMs") &&
541
+ isPositiveNumber(quotaToastConfig.requestTimeoutMs)) {
542
+ patch.requestTimeoutMs = quotaToastConfig.requestTimeoutMs;
543
+ }
544
+ if (hasOwnKey(quotaToastConfig, "debug") && typeof quotaToastConfig.debug === "boolean") {
545
+ patch.debug = quotaToastConfig.debug;
546
+ }
547
+ if (hasOwnKey(quotaToastConfig, "enabledProviders")) {
548
+ const enabledProviders = normalizeEnabledProviders(quotaToastConfig.enabledProviders);
549
+ for (const issue of enabledProviders.issues) {
550
+ reportIssue?.("enabledProviders", issue);
551
+ }
552
+ if (enabledProviders.value !== undefined) {
553
+ patch.enabledProviders = enabledProviders.value;
554
+ if (enabledProviders.invalidEmpty) {
555
+ patch.enabledProvidersInvalidEmpty = true;
556
+ }
557
+ }
558
+ }
559
+ if (hasOwnKey(quotaToastConfig, "anthropicBinaryPath")) {
560
+ const anthropicBinaryPath = normalizeOptionalString(quotaToastConfig.anthropicBinaryPath);
561
+ if (anthropicBinaryPath !== undefined) {
562
+ patch.anthropicBinaryPath = anthropicBinaryPath;
563
+ }
564
+ }
565
+ if (hasOwnKey(quotaToastConfig, "cursorPlan") &&
566
+ isValidCursorQuotaPlan(quotaToastConfig.cursorPlan)) {
567
+ patch.cursorPlan = quotaToastConfig.cursorPlan;
568
+ }
569
+ if (hasOwnKey(quotaToastConfig, "cursorIncludedApiUsd") &&
570
+ isPositiveNumber(quotaToastConfig.cursorIncludedApiUsd)) {
571
+ patch.cursorIncludedApiUsd = quotaToastConfig.cursorIncludedApiUsd;
572
+ }
573
+ if (hasOwnKey(quotaToastConfig, "cursorBillingCycleStartDay") &&
574
+ isValidCursorBillingCycleStartDay(quotaToastConfig.cursorBillingCycleStartDay)) {
575
+ patch.cursorBillingCycleStartDay = quotaToastConfig.cursorBillingCycleStartDay;
576
+ }
577
+ if (hasOwnKey(quotaToastConfig, "opencodeGoWindows") &&
578
+ isValidOpenCodeGoWindows(quotaToastConfig.opencodeGoWindows)) {
579
+ patch.opencodeGoWindows = quotaToastConfig.opencodeGoWindows;
580
+ }
581
+ if (hasOwnKey(quotaToastConfig, "opencodeMonthlyLimit")) {
582
+ const monthlyLimit = quotaToastConfig.opencodeMonthlyLimit;
583
+ // The GUI table accepts 0 as a real budget; legacy layers keep the strict form.
584
+ const monthlyLimitIsValid = options.allowZeroMonthlyLimit
585
+ ? isNonNegativeNumber(monthlyLimit)
586
+ : isPositiveNumber(monthlyLimit);
587
+ if (monthlyLimitIsValid && typeof monthlyLimit === "number") {
588
+ patch.opencodeMonthlyLimit = monthlyLimit;
589
+ }
590
+ }
591
+ if (hasOwnKey(quotaToastConfig, "opencodeZenDisplay")) {
592
+ reportIssue?.("opencodeZenDisplay", 'removed; use root "accountingDetail" ("summary" or "detailed")');
593
+ }
594
+ if (hasOwnKey(quotaToastConfig, "pricingSnapshot")) {
595
+ const pricingSnapshot = extractPricingSnapshotPatch(quotaToastConfig.pricingSnapshot);
596
+ if (pricingSnapshot) {
597
+ patch.pricingSnapshot = pricingSnapshot;
598
+ }
599
+ }
600
+ if (hasOwnKey(quotaToastConfig, "showOnIdle") &&
601
+ typeof quotaToastConfig.showOnIdle === "boolean") {
602
+ patch.showOnIdle = quotaToastConfig.showOnIdle;
603
+ }
604
+ if (hasOwnKey(quotaToastConfig, "showOnQuestion") &&
605
+ typeof quotaToastConfig.showOnQuestion === "boolean") {
606
+ patch.showOnQuestion = quotaToastConfig.showOnQuestion;
607
+ }
608
+ if (hasOwnKey(quotaToastConfig, "showOnCompact") &&
609
+ typeof quotaToastConfig.showOnCompact === "boolean") {
610
+ patch.showOnCompact = quotaToastConfig.showOnCompact;
611
+ }
612
+ if (hasOwnKey(quotaToastConfig, "showOnBothFail") &&
613
+ typeof quotaToastConfig.showOnBothFail === "boolean") {
614
+ patch.showOnBothFail = quotaToastConfig.showOnBothFail;
615
+ }
616
+ if (hasOwnKey(quotaToastConfig, "toastDurationMs") &&
617
+ isPositiveNumber(quotaToastConfig.toastDurationMs)) {
618
+ patch.toastDurationMs = quotaToastConfig.toastDurationMs;
619
+ }
620
+ if (hasOwnKey(quotaToastConfig, "onlyCurrentModel") &&
621
+ typeof quotaToastConfig.onlyCurrentModel === "boolean") {
622
+ patch.onlyCurrentModel = quotaToastConfig.onlyCurrentModel;
623
+ }
624
+ if (hasOwnKey(quotaToastConfig, "waitForQuotaReset") &&
625
+ typeof quotaToastConfig.waitForQuotaReset === "boolean") {
626
+ patch.waitForQuotaReset = quotaToastConfig.waitForQuotaReset;
627
+ }
628
+ if (hasOwnKey(quotaToastConfig, "showSessionTokens") &&
629
+ typeof quotaToastConfig.showSessionTokens === "boolean") {
630
+ patch.showSessionTokens = quotaToastConfig.showSessionTokens;
631
+ }
632
+ if (hasOwnKey(quotaToastConfig, "sessionTokenScope")) {
633
+ if (isValidSessionTokenScope(quotaToastConfig.sessionTokenScope)) {
634
+ patch.sessionTokenScope = quotaToastConfig.sessionTokenScope;
635
+ }
636
+ else {
637
+ reportIssue?.("sessionTokenScope", 'expected "current" or "tree"');
638
+ }
639
+ }
640
+ if (hasOwnKey(quotaToastConfig, "tuiSidebarPanel")) {
641
+ const tuiSidebarPanel = extractTuiSidebarPanelPatch(quotaToastConfig.tuiSidebarPanel);
642
+ if (tuiSidebarPanel) {
643
+ patch.tuiSidebarPanel = tuiSidebarPanel;
644
+ }
645
+ }
646
+ if (hasOwnKey(quotaToastConfig, "tuiCompactStatus")) {
647
+ const tuiCompactStatus = extractTuiCompactStatusPatch(quotaToastConfig.tuiCompactStatus);
648
+ if (tuiCompactStatus) {
649
+ patch.tuiCompactStatus = tuiCompactStatus;
650
+ }
651
+ }
652
+ if (hasOwnKey(quotaToastConfig, "tuiPromptBar")) {
653
+ const tuiPromptBar = extractTuiPromptBarPatch(quotaToastConfig.tuiPromptBar);
654
+ if (tuiPromptBar) {
655
+ patch.tuiPromptBar = tuiPromptBar;
656
+ }
657
+ }
658
+ if (hasOwnKey(quotaToastConfig, "maintainerAnnouncements")) {
659
+ const maintainerAnnouncements = extractMaintainerAnnouncementsPatch(quotaToastConfig.maintainerAnnouncements);
660
+ if (maintainerAnnouncements) {
661
+ patch.maintainerAnnouncements = maintainerAnnouncements;
662
+ }
663
+ }
664
+ if (hasOwnKey(quotaToastConfig, "layout")) {
665
+ const layout = extractLayoutPatch(quotaToastConfig.layout);
666
+ if (layout) {
667
+ patch.layout = layout;
668
+ }
669
+ }
670
+ if (hasOwnKey(quotaToastConfig, "export")) {
671
+ const exportConfig = extractExportConfigPatch(quotaToastConfig.export);
672
+ if (exportConfig) {
673
+ patch.export = exportConfig;
674
+ }
675
+ }
676
+ if (hasOwnKey(quotaToastConfig, "telemetry")) {
677
+ const telemetry = extractTelemetryConfigPatch(quotaToastConfig.telemetry);
678
+ if (telemetry) {
679
+ patch.telemetry = telemetry;
680
+ }
681
+ }
682
+ if (hasOwnKey(quotaToastConfig, "dashboard")) {
683
+ const dashboard = extractDashboardPatch(quotaToastConfig.dashboard, reportIssue);
684
+ if (dashboard) {
685
+ patch.dashboard = dashboard;
686
+ }
687
+ }
688
+ return patch;
689
+ }
690
+ function applySettingSource(settingSources, key, sourcePath) {
691
+ settingSources[key] = sourcePath;
692
+ }
693
+ function applyValidatedQuotaToastPatch(config, patch, sourcePath, settingSources) {
694
+ if (hasOwnKey(patch, "enabled")) {
695
+ config.enabled = patch.enabled;
696
+ applySettingSource(settingSources, "enabled", sourcePath);
697
+ }
698
+ if (hasOwnKey(patch, "enableToast")) {
699
+ config.enableToast = patch.enableToast;
700
+ applySettingSource(settingSources, "enableToast", sourcePath);
701
+ }
702
+ if (patch.resetNotifications) {
703
+ if (hasOwnKey(patch.resetNotifications, "enabled")) {
704
+ config.resetNotifications.enabled = patch.resetNotifications.enabled;
705
+ applySettingSource(settingSources, "resetNotifications.enabled", sourcePath);
706
+ }
707
+ if (hasOwnKey(patch.resetNotifications, "windows")) {
708
+ config.resetNotifications.windows = [...patch.resetNotifications.windows];
709
+ applySettingSource(settingSources, "resetNotifications.windows", sourcePath);
710
+ }
711
+ }
712
+ if (hasOwnKey(patch, "tuiCommandDisplay")) {
713
+ config.tuiCommandDisplay = patch.tuiCommandDisplay;
714
+ applySettingSource(settingSources, "tuiCommandDisplay", sourcePath);
715
+ }
716
+ if (hasOwnKey(patch, "formatStyle")) {
717
+ config.formatStyle = patch.formatStyle;
718
+ applySettingSource(settingSources, "formatStyle", sourcePath);
719
+ }
720
+ if (hasOwnKey(patch, "percentDisplayMode")) {
721
+ config.percentDisplayMode = patch.percentDisplayMode;
722
+ applySettingSource(settingSources, "percentDisplayMode", sourcePath);
723
+ }
724
+ if (hasOwnKey(patch, "quotaProjection")) {
725
+ config.quotaProjection = patch.quotaProjection;
726
+ applySettingSource(settingSources, "quotaProjection", sourcePath);
727
+ }
728
+ if (hasOwnKey(patch, "percentLabelStyle")) {
729
+ config.percentLabelStyle = patch.percentLabelStyle;
730
+ applySettingSource(settingSources, "percentLabelStyle", sourcePath);
731
+ }
732
+ if (hasOwnKey(patch, "accountingDetail")) {
733
+ config.accountingDetail = patch.accountingDetail;
734
+ applySettingSource(settingSources, "accountingDetail", sourcePath);
735
+ }
736
+ if (hasOwnKey(patch, "resetTimeDecimals")) {
737
+ config.resetTimeDecimals = patch.resetTimeDecimals;
738
+ applySettingSource(settingSources, "resetTimeDecimals", sourcePath);
739
+ }
740
+ if (hasOwnKey(patch, "resetTimeSpaced")) {
741
+ config.resetTimeSpaced = patch.resetTimeSpaced;
742
+ applySettingSource(settingSources, "resetTimeSpaced", sourcePath);
743
+ }
744
+ if (hasOwnKey(patch, "minIntervalMs")) {
745
+ config.minIntervalMs = patch.minIntervalMs;
746
+ applySettingSource(settingSources, "minIntervalMs", sourcePath);
747
+ }
748
+ if (hasOwnKey(patch, "requestTimeoutMs")) {
749
+ config.requestTimeoutMs = patch.requestTimeoutMs;
750
+ applySettingSource(settingSources, "requestTimeoutMs", sourcePath);
751
+ }
752
+ if (hasOwnKey(patch, "debug")) {
753
+ config.debug = patch.debug;
754
+ applySettingSource(settingSources, "debug", sourcePath);
755
+ }
756
+ if (hasOwnKey(patch, "enabledProviders")) {
757
+ if (!(patch.enabledProvidersInvalidEmpty && settingSources.enabledProviders)) {
758
+ config.enabledProviders =
759
+ patch.enabledProviders === "auto" ? "auto" : [...patch.enabledProviders];
760
+ applySettingSource(settingSources, "enabledProviders", sourcePath);
761
+ }
762
+ }
763
+ if (hasOwnKey(patch, "anthropicBinaryPath")) {
764
+ config.anthropicBinaryPath = patch.anthropicBinaryPath;
765
+ applySettingSource(settingSources, "anthropicBinaryPath", sourcePath);
766
+ }
767
+ if (hasOwnKey(patch, "cursorPlan")) {
768
+ config.cursorPlan = patch.cursorPlan;
769
+ applySettingSource(settingSources, "cursorPlan", sourcePath);
770
+ }
771
+ if (hasOwnKey(patch, "cursorIncludedApiUsd")) {
772
+ config.cursorIncludedApiUsd = patch.cursorIncludedApiUsd;
773
+ applySettingSource(settingSources, "cursorIncludedApiUsd", sourcePath);
774
+ }
775
+ if (hasOwnKey(patch, "cursorBillingCycleStartDay")) {
776
+ config.cursorBillingCycleStartDay = patch.cursorBillingCycleStartDay;
777
+ applySettingSource(settingSources, "cursorBillingCycleStartDay", sourcePath);
778
+ }
779
+ if (hasOwnKey(patch, "opencodeGoWindows")) {
780
+ config.opencodeGoWindows = [...patch.opencodeGoWindows];
781
+ applySettingSource(settingSources, "opencodeGoWindows", sourcePath);
782
+ }
783
+ if (hasOwnKey(patch, "opencodeMonthlyLimit")) {
784
+ config.opencodeMonthlyLimit = patch.opencodeMonthlyLimit;
785
+ applySettingSource(settingSources, "opencodeMonthlyLimit", sourcePath);
786
+ }
787
+ if (patch.pricingSnapshot) {
788
+ if (hasOwnKey(patch.pricingSnapshot, "source")) {
789
+ config.pricingSnapshot.source = patch.pricingSnapshot.source;
790
+ applySettingSource(settingSources, "pricingSnapshot.source", sourcePath);
791
+ }
792
+ if (hasOwnKey(patch.pricingSnapshot, "autoRefresh")) {
793
+ config.pricingSnapshot.autoRefresh = patch.pricingSnapshot.autoRefresh;
794
+ applySettingSource(settingSources, "pricingSnapshot.autoRefresh", sourcePath);
795
+ }
796
+ }
797
+ if (hasOwnKey(patch, "showOnIdle")) {
798
+ config.showOnIdle = patch.showOnIdle;
799
+ applySettingSource(settingSources, "showOnIdle", sourcePath);
800
+ }
801
+ if (hasOwnKey(patch, "showOnQuestion")) {
802
+ config.showOnQuestion = patch.showOnQuestion;
803
+ applySettingSource(settingSources, "showOnQuestion", sourcePath);
804
+ }
805
+ if (hasOwnKey(patch, "showOnCompact")) {
806
+ config.showOnCompact = patch.showOnCompact;
807
+ applySettingSource(settingSources, "showOnCompact", sourcePath);
808
+ }
809
+ if (hasOwnKey(patch, "showOnBothFail")) {
810
+ config.showOnBothFail = patch.showOnBothFail;
811
+ applySettingSource(settingSources, "showOnBothFail", sourcePath);
812
+ }
813
+ if (hasOwnKey(patch, "toastDurationMs")) {
814
+ config.toastDurationMs = patch.toastDurationMs;
815
+ applySettingSource(settingSources, "toastDurationMs", sourcePath);
816
+ }
817
+ if (hasOwnKey(patch, "onlyCurrentModel")) {
818
+ config.onlyCurrentModel = patch.onlyCurrentModel;
819
+ applySettingSource(settingSources, "onlyCurrentModel", sourcePath);
820
+ }
821
+ if (hasOwnKey(patch, "waitForQuotaReset")) {
822
+ config.waitForQuotaReset = patch.waitForQuotaReset;
823
+ applySettingSource(settingSources, "waitForQuotaReset", sourcePath);
824
+ }
825
+ if (hasOwnKey(patch, "showSessionTokens")) {
826
+ config.showSessionTokens = patch.showSessionTokens;
827
+ applySettingSource(settingSources, "showSessionTokens", sourcePath);
828
+ }
829
+ if (hasOwnKey(patch, "sessionTokenScope")) {
830
+ config.sessionTokenScope = patch.sessionTokenScope;
831
+ applySettingSource(settingSources, "sessionTokenScope", sourcePath);
832
+ }
833
+ if (patch.tuiSidebarPanel) {
834
+ if (hasOwnKey(patch.tuiSidebarPanel, "enabled")) {
835
+ config.tuiSidebarPanel.enabled = patch.tuiSidebarPanel.enabled;
836
+ applySettingSource(settingSources, "tuiSidebarPanel.enabled", sourcePath);
837
+ }
838
+ if (hasOwnKey(patch.tuiSidebarPanel, "formatStyle")) {
839
+ config.tuiSidebarPanel.formatStyle = patch.tuiSidebarPanel.formatStyle;
840
+ applySettingSource(settingSources, "tuiSidebarPanel.formatStyle", sourcePath);
841
+ }
842
+ if (hasOwnKey(patch.tuiSidebarPanel, "opencodeGoPreferredWindow")) {
843
+ config.tuiSidebarPanel.opencodeGoPreferredWindow =
844
+ patch.tuiSidebarPanel.opencodeGoPreferredWindow;
845
+ applySettingSource(settingSources, "tuiSidebarPanel.opencodeGoPreferredWindow", sourcePath);
846
+ }
847
+ }
848
+ if (patch.tuiCompactStatus) {
849
+ if (hasOwnKey(patch.tuiCompactStatus, "enabled")) {
850
+ config.tuiCompactStatus.enabled = patch.tuiCompactStatus.enabled;
851
+ applySettingSource(settingSources, "tuiCompactStatus.enabled", sourcePath);
852
+ }
853
+ if (hasOwnKey(patch.tuiCompactStatus, "homeBottom")) {
854
+ config.tuiCompactStatus.homeBottom = patch.tuiCompactStatus.homeBottom;
855
+ applySettingSource(settingSources, "tuiCompactStatus.homeBottom", sourcePath);
856
+ }
857
+ if (hasOwnKey(patch.tuiCompactStatus, "sessionPrompt")) {
858
+ config.tuiCompactStatus.sessionPrompt = patch.tuiCompactStatus.sessionPrompt;
859
+ applySettingSource(settingSources, "tuiCompactStatus.sessionPrompt", sourcePath);
860
+ }
861
+ if (hasOwnKey(patch.tuiCompactStatus, "maxWidth")) {
862
+ config.tuiCompactStatus.maxWidth = patch.tuiCompactStatus.maxWidth;
863
+ applySettingSource(settingSources, "tuiCompactStatus.maxWidth", sourcePath);
864
+ }
865
+ if (hasOwnKey(patch.tuiCompactStatus, "formatStyle")) {
866
+ config.tuiCompactStatus.formatStyle = patch.tuiCompactStatus.formatStyle;
867
+ applySettingSource(settingSources, "tuiCompactStatus.formatStyle", sourcePath);
868
+ }
869
+ }
870
+ if (patch.tuiPromptBar) {
871
+ if (hasOwnKey(patch.tuiPromptBar, "enabled")) {
872
+ config.tuiPromptBar.enabled = patch.tuiPromptBar.enabled;
873
+ applySettingSource(settingSources, "tuiPromptBar.enabled", sourcePath);
874
+ }
875
+ }
876
+ if (patch.maintainerAnnouncements) {
877
+ if (hasOwnKey(patch.maintainerAnnouncements, "enabled")) {
878
+ config.maintainerAnnouncements.enabled = patch.maintainerAnnouncements.enabled;
879
+ applySettingSource(settingSources, "maintainerAnnouncements.enabled", sourcePath);
880
+ }
881
+ if (hasOwnKey(patch.maintainerAnnouncements, "home")) {
882
+ config.maintainerAnnouncements.home = patch.maintainerAnnouncements.home;
883
+ applySettingSource(settingSources, "maintainerAnnouncements.home", sourcePath);
884
+ }
885
+ if (hasOwnKey(patch.maintainerAnnouncements, "homeFrequency")) {
886
+ config.maintainerAnnouncements.homeFrequency = patch.maintainerAnnouncements.homeFrequency;
887
+ applySettingSource(settingSources, "maintainerAnnouncements.homeFrequency", sourcePath);
888
+ }
889
+ }
890
+ if (patch.layout) {
891
+ if (hasOwnKey(patch.layout, "maxWidth")) {
892
+ config.layout.maxWidth = patch.layout.maxWidth;
893
+ applySettingSource(settingSources, "layout.maxWidth", sourcePath);
894
+ }
895
+ if (hasOwnKey(patch.layout, "narrowAt")) {
896
+ config.layout.narrowAt = patch.layout.narrowAt;
897
+ applySettingSource(settingSources, "layout.narrowAt", sourcePath);
898
+ }
899
+ if (hasOwnKey(patch.layout, "tinyAt")) {
900
+ config.layout.tinyAt = patch.layout.tinyAt;
901
+ applySettingSource(settingSources, "layout.tinyAt", sourcePath);
902
+ }
903
+ }
904
+ if (patch.export) {
905
+ if (hasOwnKey(patch.export, "enabled")) {
906
+ config.export.enabled = patch.export.enabled;
907
+ applySettingSource(settingSources, "export.enabled", sourcePath);
908
+ }
909
+ if (hasOwnKey(patch.export, "path")) {
910
+ config.export.path = patch.export.path;
911
+ applySettingSource(settingSources, "export.path", sourcePath);
912
+ }
913
+ }
914
+ if (patch.telemetry && hasOwnKey(patch.telemetry, "enabled")) {
915
+ config.telemetry.enabled = patch.telemetry.enabled;
916
+ applySettingSource(settingSources, "telemetry.enabled", sourcePath);
917
+ }
918
+ if (patch.dashboard) {
919
+ if (hasOwnKey(patch.dashboard, "port")) {
920
+ config.dashboard.port = patch.dashboard.port;
921
+ applySettingSource(settingSources, "dashboard.port", sourcePath);
922
+ }
923
+ if (hasOwnKey(patch.dashboard, "hiddenCards")) {
924
+ config.dashboard.hiddenCards = [...patch.dashboard.hiddenCards];
925
+ applySettingSource(settingSources, "dashboard.hiddenCards", sourcePath);
926
+ }
927
+ if (hasOwnKey(patch.dashboard, "hiddenRows")) {
928
+ config.dashboard.hiddenRows = [...patch.dashboard.hiddenRows];
929
+ applySettingSource(settingSources, "dashboard.hiddenRows", sourcePath);
930
+ }
931
+ if (patch.dashboard.providerOrder) {
932
+ config.dashboard.providerOrder = [...patch.dashboard.providerOrder];
933
+ applySettingSource(settingSources, "dashboard.providerOrder", sourcePath);
934
+ }
935
+ }
936
+ }
937
+ function projectNetworkSettingSources(settingSources) {
938
+ const projected = {};
939
+ for (const key of NETWORK_SETTING_SOURCE_KEYS) {
940
+ const source = settingSources[key];
941
+ if (typeof source === "string" && source.length > 0) {
942
+ projected[key] = source;
943
+ }
944
+ }
945
+ return projected;
946
+ }
947
+ function buildConfigLayerCandidatesForRoot(dir, scope) {
948
+ return [
949
+ ...QUOTA_TOAST_CONFIG_RELATIVE_PATHS.map((relativePath) => ({
950
+ path: join(dir, relativePath),
951
+ rootDir: dir,
952
+ scope,
953
+ kind: "plugin",
954
+ })),
955
+ ...buildOpenCodeConfigCandidates({
956
+ directories: [dir],
957
+ formatOrder: ["json", "jsonc"],
958
+ }).map((candidate) => ({
959
+ path: candidate.path,
960
+ rootDir: dir,
961
+ scope,
962
+ kind: "legacy",
963
+ })),
964
+ ];
965
+ }
966
+ /**
967
+ * Filesystem identity of a layer root: the same real directory can be named
968
+ * through different casing (Windows) or through a symlink/junction, so existing
969
+ * roots compare by their native real path; a missing root compares by its own
970
+ * path, with no case folding, keeping distinct case-sensitive roots distinct.
971
+ */
972
+ function configLayerRootIdentity(path) {
973
+ if (!existsSync(path)) {
974
+ return path;
975
+ }
976
+ try {
977
+ return realpathSync.native(path);
978
+ }
979
+ catch {
980
+ return path;
981
+ }
982
+ }
983
+ export function buildConfigLayerCandidates(globalConfigDir, configRootDir) {
984
+ const workspaceCandidates = buildConfigLayerCandidatesForRoot(configRootDir, "workspace");
985
+ const globalCandidates = buildConfigLayerCandidatesForRoot(globalConfigDir, "global");
986
+ const sameRealRoot = configLayerRootIdentity(globalConfigDir) === configLayerRootIdentity(configRootDir);
987
+ const globalPaths = new Set(globalCandidates.map((candidate) => candidate.path));
988
+ return [
989
+ ...globalCandidates,
990
+ // The canonical dashboard file is a global layer: it overrides global
991
+ // legacy values, but a project layer still wins for the same key.
992
+ {
993
+ path: getGuiConfigPath(globalConfigDir),
994
+ rootDir: globalConfigDir,
995
+ scope: "global",
996
+ kind: "canonical",
997
+ },
998
+ // When both roots name the same real directory, the workspace layer is the
999
+ // global layer reached through an alias: dropping every workspace candidate
1000
+ // keeps the canonical global layer on top instead of reapplying global
1001
+ // legacy values after it.
1002
+ ...workspaceCandidates.filter((candidate) => !sameRealRoot && !globalPaths.has(candidate.path)),
1003
+ ];
1004
+ }
1005
+ function getConfigLayerSourceLabel(candidate) {
1006
+ if (candidate.kind === "canonical") {
1007
+ return candidate.path;
1008
+ }
1009
+ const suffix = candidate.kind === "plugin"
1010
+ ? candidate.path.endsWith(".jsonc")
1011
+ ? QUOTA_TOAST_CONFIG_RELATIVE_PATHS[0]
1012
+ : QUOTA_TOAST_CONFIG_RELATIVE_PATHS[1]
1013
+ : "experimental.quotaToast";
1014
+ return `${candidate.path} (${suffix})`;
1015
+ }
1016
+ async function readConfigJsonFile(path) {
1017
+ const result = await readOpenCodeConfigCandidate({
1018
+ path,
1019
+ format: path.endsWith(".jsonc") ? "jsonc" : "json",
1020
+ });
1021
+ return result.state === "parsed" ? result.value : null;
1022
+ }
1023
+ /**
1024
+ * Load plugin configuration from OpenCode config
1025
+ *
1026
+ * Legacy-compatible layered read (`defaults → global legacy → global canonical
1027
+ * → project layers → SDK fallback`). Reserved for the explicit settings import
1028
+ * and its preview; runtime callers use the canonical-only `loadConfig`.
1029
+ *
1030
+ * @param client - Optional OpenCode SDK client fallback
1031
+ * @returns Merged configuration with defaults
1032
+ */
1033
+ export async function loadConfigLayered(client, meta, options) {
1034
+ async function readJson(path) {
1035
+ return readConfigJsonFile(path);
1036
+ }
1037
+ async function loadFromFiles() {
1038
+ const configRootDir = options?.configRootDir ?? options?.cwd ?? process.cwd();
1039
+ const configDir = options?.globalConfigDir ?? getOpencodeRuntimeDirs().configDir;
1040
+ const config = cloneDefaultConfig();
1041
+ const usedPaths = [];
1042
+ const globalConfigPaths = [];
1043
+ const workspaceConfigPaths = [];
1044
+ const settingSources = {};
1045
+ const settingSourceLayers = {};
1046
+ const configIssues = [];
1047
+ const authoritativeSidecarRoots = new Set();
1048
+ for (const candidate of buildConfigLayerCandidates(configDir, configRootDir)) {
1049
+ const rootKey = `${candidate.scope}:${candidate.rootDir}`;
1050
+ if (candidate.kind === "legacy" && authoritativeSidecarRoots.has(rootKey)) {
1051
+ continue;
1052
+ }
1053
+ if (candidate.kind === "plugin" && authoritativeSidecarRoots.has(rootKey)) {
1054
+ continue;
1055
+ }
1056
+ if (!existsSync(candidate.path)) {
1057
+ continue;
1058
+ }
1059
+ const parsed = await readJson(candidate.path);
1060
+ if (!isPlainObject(parsed)) {
1061
+ if (candidate.kind === "plugin" || candidate.kind === "canonical") {
1062
+ const sourcePath = getConfigLayerSourceLabel(candidate);
1063
+ usedPaths.push(sourcePath);
1064
+ if (candidate.scope === "global") {
1065
+ globalConfigPaths.push(sourcePath);
1066
+ }
1067
+ else {
1068
+ workspaceConfigPaths.push(sourcePath);
1069
+ }
1070
+ configIssues.push({
1071
+ path: sourcePath,
1072
+ key: "$root",
1073
+ message: candidate.kind === "canonical"
1074
+ ? "malformed JSONC; lower layers apply and writes are disabled"
1075
+ : "expected readable JSON object; this sidecar is not authoritative",
1076
+ });
1077
+ }
1078
+ continue;
1079
+ }
1080
+ if (candidate.kind === "plugin") {
1081
+ authoritativeSidecarRoots.add(rootKey);
1082
+ if (candidate.path.endsWith(".jsonc") &&
1083
+ existsSync(getQuotaToastConfigPath(candidate.rootDir, "json"))) {
1084
+ configIssues.push({
1085
+ path: getConfigLayerSourceLabel(candidate),
1086
+ key: "$file",
1087
+ message: "both quota-toast.jsonc and quota-toast.json exist; using quota-toast.jsonc",
1088
+ });
1089
+ }
1090
+ }
1091
+ const extractedQuotaToast = candidate.kind === "plugin" || candidate.kind === "canonical"
1092
+ ? parsed
1093
+ : isPlainObject(parsed.experimental)
1094
+ ? parsed.experimental.quotaToast
1095
+ : undefined;
1096
+ if (!isPlainObject(extractedQuotaToast)) {
1097
+ continue;
1098
+ }
1099
+ const sourcePath = getConfigLayerSourceLabel(candidate);
1100
+ usedPaths.push(sourcePath);
1101
+ if (candidate.scope === "global") {
1102
+ globalConfigPaths.push(sourcePath);
1103
+ }
1104
+ else {
1105
+ workspaceConfigPaths.push(sourcePath);
1106
+ }
1107
+ applyValidatedQuotaToastPatch(config, extractValidatedQuotaToastPatch(extractedQuotaToast, (key, message) => {
1108
+ configIssues.push({ path: sourcePath, key, message });
1109
+ }, { allowZeroMonthlyLimit: candidate.kind === "canonical" }), sourcePath, settingSources);
1110
+ if (hasOwnKey(extractedQuotaToast, "alibabaCodingPlanTier")) {
1111
+ configIssues.push({
1112
+ path: sourcePath,
1113
+ key: "alibabaCodingPlanTier",
1114
+ message: 'removed in v4; tune Alibaba through "quotaProviders"',
1115
+ });
1116
+ }
1117
+ if (hasOwnKey(extractedQuotaToast, "customSources")) {
1118
+ configIssues.push({
1119
+ path: sourcePath,
1120
+ key: "customSources",
1121
+ message: 'removed in v4; use the global-only "quotaProviders" property',
1122
+ });
1123
+ }
1124
+ if (hasOwnKey(extractedQuotaToast, "quotaProviders")) {
1125
+ if (candidate.scope === "global") {
1126
+ const validation = validateQuotaProviders(extractedQuotaToast.quotaProviders);
1127
+ for (const issue of validation.issues) {
1128
+ configIssues.push({ path: sourcePath, key: issue.key, message: issue.message });
1129
+ }
1130
+ if (validation.value) {
1131
+ config.quotaProviders = cloneQuotaProviders(validation.value);
1132
+ applySettingSource(settingSources, "quotaProviders", sourcePath);
1133
+ }
1134
+ }
1135
+ else {
1136
+ configIssues.push({
1137
+ path: sourcePath,
1138
+ key: "quotaProviders",
1139
+ message: "allowed only in global OpenCode or global opencode-quota config",
1140
+ });
1141
+ }
1142
+ }
1143
+ // Only keys actually applied from this layer acquire its structured scope.
1144
+ for (const key of QUOTA_TOAST_SETTING_SOURCE_KEYS) {
1145
+ if (settingSources[key] === sourcePath) {
1146
+ settingSourceLayers[key] = { scope: candidate.scope, kind: candidate.kind };
1147
+ }
1148
+ }
1149
+ }
1150
+ if (usedPaths.length === 0) {
1151
+ return {
1152
+ config: null,
1153
+ usedPaths: [],
1154
+ globalConfigPaths: [],
1155
+ workspaceConfigPaths: [],
1156
+ settingSources: {},
1157
+ settingSourceLayers: {},
1158
+ networkSettingSources: {},
1159
+ configIssues: [],
1160
+ };
1161
+ }
1162
+ return {
1163
+ config,
1164
+ usedPaths,
1165
+ globalConfigPaths,
1166
+ workspaceConfigPaths,
1167
+ settingSources,
1168
+ settingSourceLayers,
1169
+ networkSettingSources: projectNetworkSettingSources(settingSources),
1170
+ configIssues,
1171
+ };
1172
+ }
1173
+ const fileConfig = await loadFromFiles();
1174
+ if (fileConfig.config) {
1175
+ if (meta) {
1176
+ meta.source = "files";
1177
+ meta.paths = fileConfig.usedPaths;
1178
+ meta.globalConfigPaths = fileConfig.globalConfigPaths;
1179
+ meta.workspaceConfigPaths = fileConfig.workspaceConfigPaths;
1180
+ meta.settingSources = fileConfig.settingSources;
1181
+ meta.settingSourceLayers = fileConfig.settingSourceLayers;
1182
+ meta.networkSettingSources = fileConfig.networkSettingSources;
1183
+ meta.configIssues = fileConfig.configIssues;
1184
+ }
1185
+ return fileConfig.config;
1186
+ }
1187
+ if (client) {
1188
+ try {
1189
+ const response = await client.config.get();
1190
+ // OpenCode config schema is strict; plugin-specific config must live under
1191
+ // experimental.* to avoid "unrecognized key" validation errors.
1192
+ const quotaToastConfig = response.data?.experimental?.quotaToast;
1193
+ if (isPlainObject(quotaToastConfig)) {
1194
+ const config = cloneDefaultConfig();
1195
+ const settingSources = {};
1196
+ const configIssues = [];
1197
+ applyValidatedQuotaToastPatch(config, extractValidatedQuotaToastPatch(quotaToastConfig, (key, message) => {
1198
+ configIssues.push({ path: "client.config.get", key, message });
1199
+ }), "client.config.get", settingSources);
1200
+ if (hasOwnKey(quotaToastConfig, "alibabaCodingPlanTier")) {
1201
+ configIssues.push({
1202
+ path: "client.config.get",
1203
+ key: "alibabaCodingPlanTier",
1204
+ message: 'removed in v4; tune Alibaba through "quotaProviders"',
1205
+ });
1206
+ }
1207
+ if (hasOwnKey(quotaToastConfig, "customSources")) {
1208
+ configIssues.push({
1209
+ path: "client.config.get",
1210
+ key: "customSources",
1211
+ message: 'removed in v4; use the global-only "quotaProviders" property',
1212
+ });
1213
+ }
1214
+ if (hasOwnKey(quotaToastConfig, "quotaProviders")) {
1215
+ configIssues.push({
1216
+ path: "client.config.get",
1217
+ key: "quotaProviders",
1218
+ message: "file provenance is required; define quotaProviders in global config",
1219
+ });
1220
+ }
1221
+ if (meta) {
1222
+ meta.source = "sdk";
1223
+ meta.paths = ["client.config.get"];
1224
+ meta.globalConfigPaths = [];
1225
+ meta.workspaceConfigPaths = [];
1226
+ meta.settingSources = settingSources;
1227
+ meta.settingSourceLayers = {};
1228
+ meta.networkSettingSources = projectNetworkSettingSources(settingSources);
1229
+ meta.configIssues = configIssues;
1230
+ }
1231
+ return config;
1232
+ }
1233
+ }
1234
+ catch {
1235
+ // ignore; fall back to defaults below
1236
+ }
1237
+ }
1238
+ if (meta) {
1239
+ meta.source = "defaults";
1240
+ meta.paths = [];
1241
+ meta.globalConfigPaths = [];
1242
+ meta.workspaceConfigPaths = [];
1243
+ meta.settingSources = {};
1244
+ meta.settingSourceLayers = {};
1245
+ meta.networkSettingSources = {};
1246
+ meta.configIssues = [];
1247
+ }
1248
+ return cloneDefaultConfig();
1249
+ }
1250
+ /**
1251
+ * Effective runtime configuration: canonical GUI config plus defaults only.
1252
+ *
1253
+ * OpenCode SDK settings, workspace layers and legacy `experimental.quotaToast` /
1254
+ * `opencode-quota` sidecars are deliberately not read here. They remain available
1255
+ * through `loadConfigLayered` for the explicit settings import, and only become
1256
+ * effective once the user applies that import to the canonical file. The client
1257
+ * parameter stays in the signature for runtime callers that share one contract.
1258
+ */
1259
+ export async function loadConfig(_client, meta, options) {
1260
+ const configDir = options?.globalConfigDir ?? getOpencodeRuntimeDirs().configDir;
1261
+ const canonicalPath = getGuiConfigPath(configDir);
1262
+ const config = cloneDefaultConfig();
1263
+ const settingSources = {};
1264
+ const settingSourceLayers = {};
1265
+ const configIssues = [];
1266
+ let usedPaths = [];
1267
+ let source = "defaults";
1268
+ if (existsSync(canonicalPath)) {
1269
+ const parsed = await readConfigJsonFile(canonicalPath);
1270
+ if (!isPlainObject(parsed)) {
1271
+ configIssues.push({
1272
+ path: canonicalPath,
1273
+ key: "$root",
1274
+ message: "malformed JSONC; defaults apply",
1275
+ });
1276
+ }
1277
+ else {
1278
+ source = "files";
1279
+ usedPaths = [canonicalPath];
1280
+ applyValidatedQuotaToastPatch(config, extractValidatedQuotaToastPatch(parsed, (key, message) => {
1281
+ configIssues.push({ path: canonicalPath, key, message });
1282
+ }, { allowZeroMonthlyLimit: true }), canonicalPath, settingSources);
1283
+ if (hasOwnKey(parsed, "alibabaCodingPlanTier")) {
1284
+ configIssues.push({
1285
+ path: canonicalPath,
1286
+ key: "alibabaCodingPlanTier",
1287
+ message: 'removed in v4; tune Alibaba through "quotaProviders"',
1288
+ });
1289
+ }
1290
+ if (hasOwnKey(parsed, "customSources")) {
1291
+ configIssues.push({
1292
+ path: canonicalPath,
1293
+ key: "customSources",
1294
+ message: 'removed in v4; use the global-only "quotaProviders" property',
1295
+ });
1296
+ }
1297
+ if (hasOwnKey(parsed, "quotaProviders")) {
1298
+ const validation = validateQuotaProviders(parsed.quotaProviders);
1299
+ for (const issue of validation.issues) {
1300
+ configIssues.push({ path: canonicalPath, key: issue.key, message: issue.message });
1301
+ }
1302
+ if (validation.value) {
1303
+ config.quotaProviders = cloneQuotaProviders(validation.value);
1304
+ applySettingSource(settingSources, "quotaProviders", canonicalPath);
1305
+ }
1306
+ }
1307
+ // Only keys actually applied from the canonical layer acquire its structured scope.
1308
+ for (const key of QUOTA_TOAST_SETTING_SOURCE_KEYS) {
1309
+ if (settingSources[key] === canonicalPath) {
1310
+ settingSourceLayers[key] = { scope: "global", kind: "canonical" };
1311
+ }
1312
+ }
1313
+ }
1314
+ }
1315
+ if (meta) {
1316
+ meta.source = source;
1317
+ meta.paths = usedPaths;
1318
+ meta.globalConfigPaths = usedPaths;
1319
+ meta.workspaceConfigPaths = [];
1320
+ meta.settingSources = settingSources;
1321
+ meta.settingSourceLayers = settingSourceLayers;
1322
+ meta.networkSettingSources = projectNetworkSettingSources(settingSources);
1323
+ meta.configIssues = configIssues;
1324
+ }
1325
+ return config;
1326
+ }
1327
+ //# sourceMappingURL=config.js.map