@nyte-ai/ai 0.0.0-stage → 0.0.18

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 (314) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +170 -2
  3. package/THIRD-PARTY-NOTICES.md +800 -0
  4. package/dist/chunks/account-limits-cache-031vfpt3.js +37 -0
  5. package/dist/chunks/account-limits-cache-09vs98g6.js +41 -0
  6. package/dist/chunks/account-limits-cache-0af5gqeg.js +15 -0
  7. package/dist/chunks/account-limits-cache-0yd6bde8.js +103 -0
  8. package/dist/chunks/account-limits-cache-1jv43fhh.js +22 -0
  9. package/dist/chunks/account-limits-cache-3ykqmnj5.js +88 -0
  10. package/dist/chunks/account-limits-cache-4b8ckwqw.js +293 -0
  11. package/dist/chunks/account-limits-cache-4fn5w63p.js +295 -0
  12. package/dist/chunks/account-limits-cache-4hptgd2h.js +49 -0
  13. package/dist/chunks/account-limits-cache-53e64mhx.js +417 -0
  14. package/dist/chunks/account-limits-cache-5jdhn0e1.js +562 -0
  15. package/dist/chunks/account-limits-cache-5rx2pfm5.js +8 -0
  16. package/dist/chunks/account-limits-cache-5ygxyyss.js +19 -0
  17. package/dist/chunks/account-limits-cache-6250ykn6.js +21 -0
  18. package/dist/chunks/account-limits-cache-6x05n06z.js +49 -0
  19. package/dist/chunks/account-limits-cache-736tdyme.js +6 -0
  20. package/dist/chunks/account-limits-cache-75smws02.js +213 -0
  21. package/dist/chunks/account-limits-cache-7z9s8j16.js +139 -0
  22. package/dist/chunks/account-limits-cache-8137j3zp.js +37 -0
  23. package/dist/chunks/account-limits-cache-8qzk56vj.js +160 -0
  24. package/dist/chunks/account-limits-cache-8s8bz4dr.js +36 -0
  25. package/dist/chunks/account-limits-cache-8vzx8k6r.js +166 -0
  26. package/dist/chunks/account-limits-cache-8wfqg73s.js +135 -0
  27. package/dist/chunks/account-limits-cache-90c9c2eb.js +50 -0
  28. package/dist/chunks/account-limits-cache-9wqk28n5.js +25 -0
  29. package/dist/chunks/account-limits-cache-a1jyaq00.js +56 -0
  30. package/dist/chunks/account-limits-cache-a558rjbg.js +138 -0
  31. package/dist/chunks/account-limits-cache-a55e14fr.js +70 -0
  32. package/dist/chunks/account-limits-cache-a6cgeagz.js +77 -0
  33. package/dist/chunks/account-limits-cache-ag5b8dja.js +38 -0
  34. package/dist/chunks/account-limits-cache-b0x2sfya.js +45 -0
  35. package/dist/chunks/account-limits-cache-b23sbrke.js +26 -0
  36. package/dist/chunks/account-limits-cache-b4edaybk.js +8 -0
  37. package/dist/chunks/account-limits-cache-bsknrh6t.js +74 -0
  38. package/dist/chunks/account-limits-cache-c7v93krb.js +235 -0
  39. package/dist/chunks/account-limits-cache-csbxvam7.js +12 -0
  40. package/dist/chunks/account-limits-cache-cw7q7vfy.js +293 -0
  41. package/dist/chunks/account-limits-cache-d1ypzqzp.js +27 -0
  42. package/dist/chunks/account-limits-cache-d2a51dka.js +17 -0
  43. package/dist/chunks/account-limits-cache-dejeygdt.js +114 -0
  44. package/dist/chunks/account-limits-cache-eejm0vth.js +11 -0
  45. package/dist/chunks/account-limits-cache-ehy0ze2b.js +33 -0
  46. package/dist/chunks/account-limits-cache-emg5b4hj.js +53 -0
  47. package/dist/chunks/account-limits-cache-eqwweapz.js +6 -0
  48. package/dist/chunks/account-limits-cache-eyx1jcxc.js +8 -0
  49. package/dist/chunks/account-limits-cache-f9z00x8c.js +36 -0
  50. package/dist/chunks/account-limits-cache-fbkaq46e.js +113 -0
  51. package/dist/chunks/account-limits-cache-fdwad56n.js +399 -0
  52. package/dist/chunks/account-limits-cache-fht68jp2.js +22 -0
  53. package/dist/chunks/account-limits-cache-fp03ztsw.js +17 -0
  54. package/dist/chunks/account-limits-cache-fsktnetm.js +69 -0
  55. package/dist/chunks/account-limits-cache-fvadc36m.js +110 -0
  56. package/dist/chunks/account-limits-cache-ghe9ne4j.js +69 -0
  57. package/dist/chunks/account-limits-cache-gknnm1kv.js +13 -0
  58. package/dist/chunks/account-limits-cache-gqsrbky9.js +40 -0
  59. package/dist/chunks/account-limits-cache-gr671dr2.js +0 -0
  60. package/dist/chunks/account-limits-cache-gs8a3fhw.js +32 -0
  61. package/dist/chunks/account-limits-cache-gsa5tzck.js +37 -0
  62. package/dist/chunks/account-limits-cache-h92bzz1j.js +235 -0
  63. package/dist/chunks/account-limits-cache-hemxtapd.js +142 -0
  64. package/dist/chunks/account-limits-cache-hj1h48sc.js +92 -0
  65. package/dist/chunks/account-limits-cache-hj3ek3ty.js +128 -0
  66. package/dist/chunks/account-limits-cache-hwehc67r.js +509 -0
  67. package/dist/chunks/account-limits-cache-hyzn1jmk.js +46 -0
  68. package/dist/chunks/account-limits-cache-j2bt392s.js +63 -0
  69. package/dist/chunks/account-limits-cache-k0pkzhbx.js +74 -0
  70. package/dist/chunks/account-limits-cache-kjx405q0.js +277 -0
  71. package/dist/chunks/account-limits-cache-ks1sjym9.js +37 -0
  72. package/dist/chunks/account-limits-cache-me1x57bs.js +89 -0
  73. package/dist/chunks/account-limits-cache-n3yk6g5c.js +314 -0
  74. package/dist/chunks/account-limits-cache-nbhht7xz.js +72 -0
  75. package/dist/chunks/account-limits-cache-nbkyhs6v.js +42 -0
  76. package/dist/chunks/account-limits-cache-nn9jebsj.js +26 -0
  77. package/dist/chunks/account-limits-cache-nxkprk3g.js +13 -0
  78. package/dist/chunks/account-limits-cache-nyy770yd.js +38 -0
  79. package/dist/chunks/account-limits-cache-pfa86y8e.js +45 -0
  80. package/dist/chunks/account-limits-cache-pfr14mcn.js +59 -0
  81. package/dist/chunks/account-limits-cache-q1ebtvet.js +8 -0
  82. package/dist/chunks/account-limits-cache-q63mc41j.js +51 -0
  83. package/dist/chunks/account-limits-cache-re8hpzwn.js +104 -0
  84. package/dist/chunks/account-limits-cache-rz8p1g5y.js +9 -0
  85. package/dist/chunks/account-limits-cache-skbfmzqe.js +7 -0
  86. package/dist/chunks/account-limits-cache-tc38g0ca.js +20 -0
  87. package/dist/chunks/account-limits-cache-v4n30az2.js +24 -0
  88. package/dist/chunks/account-limits-cache-vwgfz727.js +281 -0
  89. package/dist/chunks/account-limits-cache-x9fvb3s5.js +8 -0
  90. package/dist/chunks/account-limits-cache-xds88kxd.js +209 -0
  91. package/dist/chunks/account-limits-cache-xz65wyd1.js +428 -0
  92. package/dist/chunks/account-limits-cache-ydq8p8qp.js +39 -0
  93. package/dist/chunks/account-limits-cache-ykbqsvv6.js +134 -0
  94. package/dist/chunks/account-limits-cache-za42x8a3.js +25 -0
  95. package/dist/chunks/account-limits-cache-zcbkmrvy.js +79 -0
  96. package/dist/chunks/account-limits-cache-zgzptd0z.js +62 -0
  97. package/dist/chunks/account-limits-cache-zn01kscn.js +252 -0
  98. package/dist/chunks/account-limits-cache-zpjmeyt0.js +113 -0
  99. package/dist/chunks/account-limits-cache-zqdb4yh4.js +8 -0
  100. package/dist/src/account-limits-cache.d.ts +16 -0
  101. package/dist/src/account-limits-cache.js +7 -0
  102. package/dist/src/api/anthropic-client.d.ts +25 -0
  103. package/dist/src/api/anthropic-client.js +30 -0
  104. package/dist/src/api/anthropic-convert.d.ts +17 -0
  105. package/dist/src/api/anthropic-convert.js +14 -0
  106. package/dist/src/api/anthropic-events.d.ts +101 -0
  107. package/dist/src/api/anthropic-events.js +11 -0
  108. package/dist/src/api/anthropic-messages.d.ts +88 -0
  109. package/dist/src/api/anthropic-messages.js +578 -0
  110. package/dist/src/api/anthropic-messages.lazy.d.ts +2 -0
  111. package/dist/src/api/anthropic-messages.lazy.js +11 -0
  112. package/dist/src/api/assistant-stream.d.ts +23 -0
  113. package/dist/src/api/assistant-stream.js +15 -0
  114. package/dist/src/api/claude-code.d.ts +12 -0
  115. package/dist/src/api/claude-code.js +12 -0
  116. package/dist/src/api/cloudflare.d.ts +8 -0
  117. package/dist/src/api/cloudflare.js +11 -0
  118. package/dist/src/api/constrained-sampling.d.ts +24 -0
  119. package/dist/src/api/constrained-sampling.js +16 -0
  120. package/dist/src/api/deferred.d.ts +7 -0
  121. package/dist/src/api/deferred.js +10 -0
  122. package/dist/src/api/github-copilot-headers.d.ts +15 -0
  123. package/dist/src/api/github-copilot-headers.js +12 -0
  124. package/dist/src/api/google-generative-ai.d.ts +22 -0
  125. package/dist/src/api/google-generative-ai.js +583 -0
  126. package/dist/src/api/google-generative-ai.lazy.d.ts +2 -0
  127. package/dist/src/api/google-generative-ai.lazy.js +11 -0
  128. package/dist/src/api/lazy.d.ts +18 -0
  129. package/dist/src/api/lazy.js +12 -0
  130. package/dist/src/api/openai-codex-compact.d.ts +14 -0
  131. package/dist/src/api/openai-codex-compact.js +389 -0
  132. package/dist/src/api/openai-codex-compaction-error.d.ts +7 -0
  133. package/dist/src/api/openai-codex-compaction-error.js +6 -0
  134. package/dist/src/api/openai-codex-protocol.d.ts +125 -0
  135. package/dist/src/api/openai-codex-protocol.js +48 -0
  136. package/dist/src/api/openai-codex-responses.d.ts +4 -0
  137. package/dist/src/api/openai-codex-responses.js +175 -0
  138. package/dist/src/api/openai-codex-responses.lazy.d.ts +2 -0
  139. package/dist/src/api/openai-codex-responses.lazy.js +11 -0
  140. package/dist/src/api/openai-codex-websocket.d.ts +13 -0
  141. package/dist/src/api/openai-codex-websocket.js +37 -0
  142. package/dist/src/api/openai-codex-wire.d.ts +44 -0
  143. package/dist/src/api/openai-codex-wire.js +34 -0
  144. package/dist/src/api/openai-compact.d.ts +9 -0
  145. package/dist/src/api/openai-compact.js +12 -0
  146. package/dist/src/api/openai-completions-convert.d.ts +58 -0
  147. package/dist/src/api/openai-completions-convert.js +21 -0
  148. package/dist/src/api/openai-completions-params.d.ts +29 -0
  149. package/dist/src/api/openai-completions-params.js +20 -0
  150. package/dist/src/api/openai-completions-reasoning.d.ts +54 -0
  151. package/dist/src/api/openai-completions-reasoning.js +22 -0
  152. package/dist/src/api/openai-completions.d.ts +22 -0
  153. package/dist/src/api/openai-completions.js +484 -0
  154. package/dist/src/api/openai-completions.lazy.d.ts +5 -0
  155. package/dist/src/api/openai-completions.lazy.js +11 -0
  156. package/dist/src/api/openai-prompt-cache.d.ts +1 -0
  157. package/dist/src/api/openai-prompt-cache.js +6 -0
  158. package/dist/src/api/openai-responses-convert.d.ts +58 -0
  159. package/dist/src/api/openai-responses-convert.js +16 -0
  160. package/dist/src/api/openai-responses-events.d.ts +379 -0
  161. package/dist/src/api/openai-responses-events.js +12 -0
  162. package/dist/src/api/openai-responses-stream.d.ts +36 -0
  163. package/dist/src/api/openai-responses-stream.js +25 -0
  164. package/dist/src/api/openai-responses.d.ts +18 -0
  165. package/dist/src/api/openai-responses.js +276 -0
  166. package/dist/src/api/openai-responses.lazy.d.ts +2 -0
  167. package/dist/src/api/openai-responses.lazy.js +11 -0
  168. package/dist/src/api/simple-options.d.ts +17 -0
  169. package/dist/src/api/simple-options.js +18 -0
  170. package/dist/src/api/token-count.d.ts +5 -0
  171. package/dist/src/api/token-count.js +8 -0
  172. package/dist/src/api/transform-messages.d.ts +9 -0
  173. package/dist/src/api/transform-messages.js +6 -0
  174. package/dist/src/api-options.d.ts +27 -0
  175. package/dist/src/api-options.js +0 -0
  176. package/dist/src/auth/context.d.ts +11 -0
  177. package/dist/src/auth/context.js +6 -0
  178. package/dist/src/auth/credential-store.d.ts +17 -0
  179. package/dist/src/auth/credential-store.js +7 -0
  180. package/dist/src/auth/helpers.d.ts +24 -0
  181. package/dist/src/auth/helpers.js +8 -0
  182. package/dist/src/auth/oauth/anthropic.d.ts +7 -0
  183. package/dist/src/auth/oauth/anthropic.js +12 -0
  184. package/dist/src/auth/oauth/authorization-input.d.ts +14 -0
  185. package/dist/src/auth/oauth/authorization-input.js +6 -0
  186. package/dist/src/auth/oauth/device-code.d.ts +29 -0
  187. package/dist/src/auth/oauth/device-code.js +9 -0
  188. package/dist/src/auth/oauth/github-copilot.d.ts +23 -0
  189. package/dist/src/auth/oauth/github-copilot.js +12 -0
  190. package/dist/src/auth/oauth/load.d.ts +14 -0
  191. package/dist/src/auth/oauth/load.js +10 -0
  192. package/dist/src/auth/oauth/oauth-page.d.ts +13 -0
  193. package/dist/src/auth/oauth/oauth-page.js +8 -0
  194. package/dist/src/auth/oauth/openai-codex.d.ts +10 -0
  195. package/dist/src/auth/oauth/openai-codex.js +18 -0
  196. package/dist/src/auth/oauth/pkce.d.ts +12 -0
  197. package/dist/src/auth/oauth/pkce.js +6 -0
  198. package/dist/src/auth/resolve.d.ts +38 -0
  199. package/dist/src/auth/resolve.js +12 -0
  200. package/dist/src/auth/store.d.ts +29 -0
  201. package/dist/src/auth/store.js +10 -0
  202. package/dist/src/auth/types.d.ts +291 -0
  203. package/dist/src/auth/types.js +8 -0
  204. package/dist/src/auth/verify.d.ts +13 -0
  205. package/dist/src/auth/verify.js +7 -0
  206. package/dist/src/bun-oauth.d.ts +2 -0
  207. package/dist/src/bun-oauth.js +25 -0
  208. package/dist/src/env-api-keys.d.ts +32 -0
  209. package/dist/src/env-api-keys.js +27 -0
  210. package/dist/src/file-models-store.d.ts +18 -0
  211. package/dist/src/file-models-store.js +9 -0
  212. package/dist/src/index.d.ts +62 -0
  213. package/dist/src/index.js +372 -0
  214. package/dist/src/model-capabilities.d.ts +21 -0
  215. package/dist/src/model-capabilities.js +14 -0
  216. package/dist/src/model-pricing.d.ts +6 -0
  217. package/dist/src/model-pricing.js +10 -0
  218. package/dist/src/model-variants.d.ts +21 -0
  219. package/dist/src/model-variants.js +19 -0
  220. package/dist/src/models-refresh.d.ts +27 -0
  221. package/dist/src/models-refresh.js +9 -0
  222. package/dist/src/models-store.d.ts +31 -0
  223. package/dist/src/models-store.js +6 -0
  224. package/dist/src/models-types.d.ts +206 -0
  225. package/dist/src/models-types.js +0 -0
  226. package/dist/src/models.d.ts +7 -0
  227. package/dist/src/models.js +44 -0
  228. package/dist/src/prompt-cache.d.ts +5 -0
  229. package/dist/src/prompt-cache.js +9 -0
  230. package/dist/src/provider.d.ts +23 -0
  231. package/dist/src/provider.js +14 -0
  232. package/dist/src/providers/account-limits.d.ts +13 -0
  233. package/dist/src/providers/account-limits.js +8 -0
  234. package/dist/src/providers/anthropic-limits.d.ts +9 -0
  235. package/dist/src/providers/anthropic-limits.js +10 -0
  236. package/dist/src/providers/anthropic.d.ts +2 -0
  237. package/dist/src/providers/anthropic.js +25 -0
  238. package/dist/src/providers/github-copilot-catalog.d.ts +5 -0
  239. package/dist/src/providers/github-copilot-catalog.js +7 -0
  240. package/dist/src/providers/github-copilot.d.ts +2 -0
  241. package/dist/src/providers/github-copilot.js +23 -0
  242. package/dist/src/providers/nyte-catalog.d.ts +15 -0
  243. package/dist/src/providers/nyte-catalog.js +63 -0
  244. package/dist/src/providers/openai-codex-limits.d.ts +8 -0
  245. package/dist/src/providers/openai-codex-limits.js +14 -0
  246. package/dist/src/providers/openai-codex.d.ts +2 -0
  247. package/dist/src/providers/openai-codex.js +23 -0
  248. package/dist/src/providers/openai.d.ts +2 -0
  249. package/dist/src/providers/openai.js +19 -0
  250. package/dist/src/providers/opencode-go.d.ts +5 -0
  251. package/dist/src/providers/opencode-go.js +22 -0
  252. package/dist/src/providers/opencode-headers.d.ts +5 -0
  253. package/dist/src/providers/opencode-headers.js +6 -0
  254. package/dist/src/providers/opencode.d.ts +14 -0
  255. package/dist/src/providers/opencode.js +23 -0
  256. package/dist/src/providers/openrouter.d.ts +2 -0
  257. package/dist/src/providers/openrouter.js +19 -0
  258. package/dist/src/providers/vercel-ai-gateway.d.ts +3 -0
  259. package/dist/src/providers/vercel-ai-gateway.js +19 -0
  260. package/dist/src/session-resources.d.ts +9 -0
  261. package/dist/src/session-resources.js +10 -0
  262. package/dist/src/types.d.ts +210 -0
  263. package/dist/src/types.js +1 -0
  264. package/dist/src/utils/abort.d.ts +12 -0
  265. package/dist/src/utils/abort.js +10 -0
  266. package/dist/src/utils/deferred-tools.d.ts +11 -0
  267. package/dist/src/utils/deferred-tools.js +6 -0
  268. package/dist/src/utils/diagnostics.d.ts +11 -0
  269. package/dist/src/utils/diagnostics.js +12 -0
  270. package/dist/src/utils/error-body.d.ts +26 -0
  271. package/dist/src/utils/error-body.js +10 -0
  272. package/dist/src/utils/estimate.d.ts +20 -0
  273. package/dist/src/utils/estimate.js +14 -0
  274. package/dist/src/utils/event-stream.d.ts +22 -0
  275. package/dist/src/utils/event-stream.js +11 -0
  276. package/dist/src/utils/failure.d.ts +49 -0
  277. package/dist/src/utils/failure.js +10 -0
  278. package/dist/src/utils/fifo-queue.d.ts +11 -0
  279. package/dist/src/utils/fifo-queue.js +6 -0
  280. package/dist/src/utils/hash.d.ts +5 -0
  281. package/dist/src/utils/hash.js +6 -0
  282. package/dist/src/utils/headers.d.ts +12 -0
  283. package/dist/src/utils/headers.js +14 -0
  284. package/dist/src/utils/json-parse.d.ts +33 -0
  285. package/dist/src/utils/json-parse.js +12 -0
  286. package/dist/src/utils/node-http-proxy.d.ts +6 -0
  287. package/dist/src/utils/node-http-proxy.js +9 -0
  288. package/dist/src/utils/nyte-home.d.ts +2 -0
  289. package/dist/src/utils/nyte-home.js +6 -0
  290. package/dist/src/utils/nyte-user-agent.d.ts +1 -0
  291. package/dist/src/utils/nyte-user-agent.js +6 -0
  292. package/dist/src/utils/overflow.d.ts +18 -0
  293. package/dist/src/utils/overflow.js +9 -0
  294. package/dist/src/utils/provider-env.d.ts +9 -0
  295. package/dist/src/utils/provider-env.js +6 -0
  296. package/dist/src/utils/provider-retry.d.ts +22 -0
  297. package/dist/src/utils/provider-retry.js +9 -0
  298. package/dist/src/utils/retry.d.ts +66 -0
  299. package/dist/src/utils/retry.js +18 -0
  300. package/dist/src/utils/sanitize-unicode.d.ts +24 -0
  301. package/dist/src/utils/sanitize-unicode.js +6 -0
  302. package/dist/src/utils/sse.d.ts +21 -0
  303. package/dist/src/utils/sse.js +6 -0
  304. package/dist/src/utils/text.d.ts +5 -0
  305. package/dist/src/utils/text.js +10 -0
  306. package/dist/src/utils/transcript.d.ts +5 -0
  307. package/dist/src/utils/transcript.js +36 -0
  308. package/dist/src/utils/typebox-helpers.d.ts +19 -0
  309. package/dist/src/utils/typebox-helpers.js +6 -0
  310. package/dist/src/utils/uuid.d.ts +2 -0
  311. package/dist/src/utils/uuid.js +6 -0
  312. package/dist/src/utils/validation.d.ts +13 -0
  313. package/dist/src/utils/validation.js +8 -0
  314. package/package.json +152 -3
@@ -0,0 +1,206 @@
1
+ /**
2
+ * The provider and model registry contracts: what a provider implements and
3
+ * what `Models` offers its callers.
4
+ */
5
+ import { type AuthResolutionOverrides } from "./auth/resolve.ts";
6
+ import type { AuthCheck, AuthContext, AuthInteraction, AuthOperationOptions, AuthResult, AuthType, AuthVerification, Credential, CredentialInfo, CredentialStore, ModelAuth, ProviderAuth } from "./auth/types.ts";
7
+ import type { ModelCapabilities } from "@nyte-ai/schema";
8
+ import type { ApiStreamOptions } from "./api-options.ts";
9
+ import { type ModelsStore, type ModelsStoreEntry } from "./models-store.ts";
10
+ import type { AccountLimits, AccountLimitsResult, Api, AssistantMessage, AssistantMessageEventStream, Context, DeferredCancelOptions, DeferredFetchOptions, DeferredHandle, FetchFunction, Model, PromptCachePolicy, ProviderHeaders, SimpleStreamOptions, TranscriptContext } from "./types.ts";
11
+ export interface ModelsPublication {
12
+ /** Provider-selected persisted catalog. Omit to leave storage unchanged; null deletes it. */
13
+ persist?: ModelsStoreEntry | null;
14
+ /** Optional synchronous update of provider-private in-memory catalog state. */
15
+ update?: () => void;
16
+ }
17
+ export interface RefreshModelsContext {
18
+ /** Effective configured credential. OAuth credentials are refreshed before network access. */
19
+ credential?: Credential;
20
+ /** Immutable provider-scoped catalog snapshot captured before this refresh phase. */
21
+ stored?: Readonly<ModelsStoreEntry>;
22
+ /**
23
+ * Generation-checked publication. Persistence policy remains provider-owned;
24
+ * the update runs synchronously only after the selected persistence mutation.
25
+ */
26
+ publish(publication: ModelsPublication): Promise<boolean>;
27
+ /** False during offline/cache-only initialization. */
28
+ allowNetwork: boolean;
29
+ /** Bypass provider freshness checks and fetch immediately when network access is allowed. */
30
+ force?: boolean;
31
+ /** Hosted catalog transport shared by every provider in this collection. */
32
+ catalog: {
33
+ url: string;
34
+ fetch: FetchFunction;
35
+ };
36
+ /** Always present, including when the public refresh caller omits its optional signal. */
37
+ signal: AbortSignal;
38
+ }
39
+ export interface ModelsRefreshOptions {
40
+ allowNetwork?: boolean;
41
+ /** Restrict refresh to these provider IDs. Unknown and static providers are ignored. */
42
+ providers?: readonly string[];
43
+ /** Bypass provider freshness checks and fetch immediately when network access is allowed. */
44
+ force?: boolean;
45
+ signal?: AbortSignal;
46
+ }
47
+ export interface ModelsRefreshResult {
48
+ aborted: boolean;
49
+ errors: ReadonlyMap<string, Error>;
50
+ }
51
+ export interface ModelsRequestTransforms {
52
+ /** Transform fully assembled model/auth/request headers before provider dispatch. */
53
+ transformHeaders?: (headers: ProviderHeaders) => ProviderHeaders | Promise<ProviderHeaders>;
54
+ }
55
+ export type ModelsApiStreamOptions<TApi extends Api> = ApiStreamOptions<TApi> & ModelsRequestTransforms;
56
+ export type ModelsSimpleStreamOptions = SimpleStreamOptions & ModelsRequestTransforms;
57
+ export type ModelsDeferredFetchOptions = DeferredFetchOptions & ModelsRequestTransforms;
58
+ export type ModelsDeferredCancelOptions = DeferredCancelOptions & ModelsRequestTransforms;
59
+ /**
60
+ * A provider is the concrete runtime unit. It owns id/name/base metadata,
61
+ * auth methods, model listing, and stream behavior.
62
+ *
63
+ * `TApi` lets concrete provider factories declare which APIs their models
64
+ * use (e.g. `openaiProvider(): Provider<"openai-responses" | "openai-completions">`),
65
+ * giving typed model lists to direct factory users. Inside a `Models`
66
+ * collection providers are held as `Provider<Api>`.
67
+ */
68
+ export interface Provider<TApi extends Api = Api> {
69
+ readonly id: string;
70
+ readonly name: string;
71
+ readonly baseUrl?: string;
72
+ readonly headers?: ProviderHeaders;
73
+ /** Prompt-cache behavior published for hosts that present cache state. */
74
+ readonly promptCache?: PromptCachePolicy;
75
+ /** What this provider's models do around a turn; absent, what a model Nyte's own loop drives does: steers, stops a subagent alone, and leaves permissions to Nyte. */
76
+ readonly capabilities?: ModelCapabilities;
77
+ /** True when its models run only once the user picks one: a host choosing a default for the user passes over it, as for agents found installed rather than signed into. */
78
+ readonly explicitOnly?: boolean;
79
+ /**
80
+ * Required: at least one of `apiKey`/`oauth`. Every provider has auth
81
+ * semantics — even providers with only ambient credentials (env vars, AWS
82
+ * profiles, ADC files) and keyless local servers provide `apiKey` auth
83
+ * whose `resolve()` reports whether the provider is configured.
84
+ * `Models.getAuth()` returns undefined when the provider is unconfigured.
85
+ */
86
+ readonly auth: ProviderAuth;
87
+ /** Fetch subscription windows without generating model output. */
88
+ fetchAccountLimits?(input: {
89
+ readonly auth: ModelAuth;
90
+ readonly credential?: Credential;
91
+ readonly signal: AbortSignal;
92
+ }): Promise<AccountLimits | undefined>;
93
+ /**
94
+ * Current catalog, sync. Returns the list restored by the last `refreshModels()`
95
+ * call or fetched from the hosted feed. Empty before either succeeds. Must not
96
+ * throw; `Models` treats a throwing implementation as having no models.
97
+ */
98
+ getModels(): readonly Model<TApi>[];
99
+ /**
100
+ * Restore `context.stored` and optionally fetch a newer catalog. Implementations retain their
101
+ * previous list on failure, publish persistence and synchronous state changes through
102
+ * `context.publish()`, and honor the shared abort signal for blocking work.
103
+ */
104
+ refreshModels?(context: RefreshModelsContext): Promise<void>;
105
+ /**
106
+ * Optional provider policy for credential-specific model availability.
107
+ * `getModels()` remains the complete synchronous catalog; `Models.getAvailable()`
108
+ * applies this filter after confirming that provider auth is configured.
109
+ */
110
+ filterModels?(models: readonly Model<TApi>[], credential: Credential | undefined): readonly Model<TApi>[];
111
+ /** Stream a normalized transcript. `Models` normalizes the caller's `Context` before dispatching here. */
112
+ stream<T extends TApi>(model: Model<T>, context: TranscriptContext, options?: ApiStreamOptions<T>): AssistantMessageEventStream;
113
+ streamSimple(model: Model<TApi>, context: TranscriptContext, options?: SimpleStreamOptions): AssistantMessageEventStream;
114
+ fetchDeferred?(model: Model<TApi>, handle: DeferredHandle, options?: DeferredFetchOptions): AssistantMessageEventStream;
115
+ cancelDeferred?(model: Model<TApi>, handle: DeferredHandle, options?: DeferredCancelOptions): Promise<void>;
116
+ }
117
+ /**
118
+ * Runtime collection of providers plus auth application and stream
119
+ * convenience. Providers own stream behavior; `Models` resolves auth and
120
+ * delegates each request to the provider that owns the model.
121
+ */
122
+ export interface Models {
123
+ getProviders(): readonly Provider[];
124
+ getProvider(id: string): Provider | undefined;
125
+ /**
126
+ * Sync read of last-known models from one provider or all providers.
127
+ * Best-effort: a provider whose `getModels()` throws yields no models.
128
+ */
129
+ getModels(provider?: string): readonly Model<Api>[];
130
+ /**
131
+ * Sync runtime model lookup against last-known lists. Dynamic model lists
132
+ * are typed as `Model<Api>`; narrow with the `hasApi()` type guard.
133
+ */
134
+ getModel(provider: string, id: string): Model<Api> | undefined;
135
+ /**
136
+ * Refresh selected providers concurrently (all when `providers` is omitted). Provider errors
137
+ * and cancellation are returned without rejecting; static and unknown providers are skipped.
138
+ * With `allowNetwork: false` it restores the cached catalogs without reading any credential.
139
+ */
140
+ refresh(options?: ModelsRefreshOptions): Promise<ModelsRefreshResult>;
141
+ /**
142
+ * Check whether a provider has complete auth configuration without refreshing OAuth. A stored
143
+ * credential answers from `CredentialStore.list()`, so no secret is read unless the provider's
144
+ * `apiKey.check` needs it.
145
+ */
146
+ checkAuth(providerId: string, options?: AuthOperationOptions): Promise<AuthCheck | undefined>;
147
+ /**
148
+ * Resolve provider auth and prove it with the provider's `auth.verify` request.
149
+ * Providers without one report a present credential as unverified. Rejects
150
+ * only on abort or the auth resolution failures `getAuth()` rejects with.
151
+ */
152
+ verifyAuth(providerId: string, options?: AuthOperationOptions): Promise<AuthVerification>;
153
+ /**
154
+ * The account state a provider last reported on one of this collection's
155
+ * requests. Instant and never a network call; undefined until a request has
156
+ * run. Providers report their shared windows on every response, so this is
157
+ * as current as the last turn, though it may omit windows only a usage
158
+ * endpoint lists.
159
+ */
160
+ getAccountLimits(providerId: string, accountId?: string | null): AccountLimits | undefined;
161
+ /** Read cached subscription windows, joining a bounded fetch when they are stale. */
162
+ fetchAccountLimits(providerId: string, options?: AuthOperationOptions): Promise<AccountLimitsResult>;
163
+ /** List stored accounts without reading secrets or resolving auth. */
164
+ listAccounts(providerId?: string, options?: AuthOperationOptions): Promise<readonly CredentialInfo[]>;
165
+ /** Select the account used by new requests; already-started requests retain their account. */
166
+ selectAccount(providerId: string, accountId: string, options?: AuthOperationOptions): Promise<void>;
167
+ /** Return models whose providers have complete auth configuration. */
168
+ getAvailable(providerId?: string, options?: AuthOperationOptions): Promise<readonly Model<Api>[]>;
169
+ /**
170
+ * Resolve provider-scoped auth by provider id, or provider auth plus static
171
+ * model headers when passed a model. Includes a source label for status UI.
172
+ * Resolves `undefined` when the provider is unknown or unconfigured.
173
+ * Rejects with `ModelsError`: code "oauth" when a token refresh fails (the
174
+ * stored credential is preserved for retry; re-login fixes it), code "auth"
175
+ * when api-key resolution or the credential store fails. Request paths
176
+ * surface rejections as stream errors.
177
+ */
178
+ getAuth(providerId: string, overrides?: AuthResolutionOverrides): Promise<AuthResult | undefined>;
179
+ getAuth(model: Model<Api>, overrides?: AuthResolutionOverrides): Promise<AuthResult | undefined>;
180
+ login(providerId: string, type: AuthType, interaction: AuthInteraction, label?: string): Promise<Credential>;
181
+ /** Remove the active account, keeping other accounts without selecting a replacement. */
182
+ logout(providerId: string, options?: AuthOperationOptions): Promise<void>;
183
+ stream<TApi extends Api>(model: Model<TApi>, context: Context, options?: ModelsApiStreamOptions<TApi>): AssistantMessageEventStream;
184
+ complete<TApi extends Api>(model: Model<TApi>, context: Context, options?: ModelsApiStreamOptions<TApi>): Promise<AssistantMessage>;
185
+ streamSimple(model: Model<Api>, context: Context, options?: ModelsSimpleStreamOptions): AssistantMessageEventStream;
186
+ completeSimple(model: Model<Api>, context: Context, options?: ModelsSimpleStreamOptions): Promise<AssistantMessage>;
187
+ fetchDeferred(model: Model<Api>, handle: DeferredHandle, options?: ModelsDeferredFetchOptions): Promise<AssistantMessage>;
188
+ cancelDeferred(model: Model<Api>, handle: DeferredHandle, options?: ModelsDeferredCancelOptions): Promise<void>;
189
+ }
190
+ export interface MutableModels extends Models {
191
+ /** An independent provider registry sharing this catalog's credential and model stores. */
192
+ withProvider(provider: Provider): Models;
193
+ /** Upsert/replace by provider.id. Provider ids are unique. */
194
+ setProvider(provider: Provider): void;
195
+ deleteProvider(id: string): void;
196
+ clearProviders(): void;
197
+ }
198
+ export interface CreateModelsOptions {
199
+ credentials?: CredentialStore;
200
+ modelsStore?: ModelsStore;
201
+ authContext?: AuthContext;
202
+ catalog?: {
203
+ url?: string;
204
+ fetch?: FetchFunction;
205
+ };
206
+ }
File without changes
@@ -0,0 +1,7 @@
1
+ import type { CreateModelsOptions, MutableModels } from "./models-types.ts";
2
+ export { ModelsError, type ModelsErrorCode } from "./auth/resolve.ts";
3
+ export { calculateCost, clampThinkingLevel, getSupportedThinkingLevels, hasApi, modelsAreEqual, } from "./model-capabilities.ts";
4
+ export type { CreateModelsOptions, Models, ModelsApiStreamOptions, ModelsDeferredCancelOptions, ModelsDeferredFetchOptions, ModelsPublication, ModelsRefreshOptions, ModelsRefreshResult, ModelsRequestTransforms, ModelsSimpleStreamOptions, MutableModels, Provider, RefreshModelsContext, } from "./models-types.ts";
5
+ export { createProvider, type CreateProviderOptions } from "./provider.ts";
6
+ export declare const DEFAULT_MODELS_CATALOG_URL = "https://pub-426b80ba181f408387bc9361b2fcbe3f.r2.dev";
7
+ export declare function createModels(options?: CreateModelsOptions): MutableModels;
@@ -0,0 +1,44 @@
1
+ import {
2
+ DEFAULT_MODELS_CATALOG_URL2,
3
+ createModels2
4
+ } from "../chunks/account-limits-cache-5jdhn0e1.js";
5
+ import"../chunks/account-limits-cache-1jv43fhh.js";
6
+ import"../chunks/account-limits-cache-emg5b4hj.js";
7
+ import"../chunks/account-limits-cache-8137j3zp.js";
8
+ import"../chunks/account-limits-cache-ag5b8dja.js";
9
+ import"../chunks/account-limits-cache-031vfpt3.js";
10
+ import"../chunks/account-limits-cache-zpjmeyt0.js";
11
+ import"../chunks/account-limits-cache-5ygxyyss.js";
12
+ import {
13
+ createProvider2
14
+ } from "../chunks/account-limits-cache-ykbqsvv6.js";
15
+ import"../chunks/account-limits-cache-90c9c2eb.js";
16
+ import"../chunks/account-limits-cache-fsktnetm.js";
17
+ import"../chunks/account-limits-cache-zcbkmrvy.js";
18
+ import"../chunks/account-limits-cache-a6cgeagz.js";
19
+ import"../chunks/account-limits-cache-nn9jebsj.js";
20
+ import {
21
+ ModelsError2
22
+ } from "../chunks/account-limits-cache-7z9s8j16.js";
23
+ import"../chunks/account-limits-cache-9wqk28n5.js";
24
+ import"../chunks/account-limits-cache-hemxtapd.js";
25
+ import"../chunks/account-limits-cache-j2bt392s.js";
26
+ import {
27
+ hasApi2,
28
+ calculateCost2,
29
+ getSupportedThinkingLevels2,
30
+ clampThinkingLevel2,
31
+ modelsAreEqual2
32
+ } from "../chunks/account-limits-cache-zgzptd0z.js";
33
+ import"../chunks/account-limits-cache-f9z00x8c.js";
34
+ export {
35
+ DEFAULT_MODELS_CATALOG_URL2 as DEFAULT_MODELS_CATALOG_URL,
36
+ ModelsError2 as ModelsError,
37
+ calculateCost2 as calculateCost,
38
+ clampThinkingLevel2 as clampThinkingLevel,
39
+ createModels2 as createModels,
40
+ createProvider2 as createProvider,
41
+ getSupportedThinkingLevels2 as getSupportedThinkingLevels,
42
+ hasApi2 as hasApi,
43
+ modelsAreEqual2 as modelsAreEqual
44
+ };
@@ -0,0 +1,5 @@
1
+ import type { CacheRetention, PromptCachePolicy, ProviderEnv } from "./types.ts";
2
+ /** Resolve the request preference shared by cache-aware provider adapters and hosts. */
3
+ export declare function resolveCacheRetention(retention?: CacheRetention, env?: ProviderEnv): CacheRetention;
4
+ /** The provider's minimum warm window for the requested retention mode. */
5
+ export declare function promptCacheMinimumTtlMs(policy: PromptCachePolicy | undefined, retention: CacheRetention): number | undefined;
@@ -0,0 +1,9 @@
1
+ import {
2
+ resolveCacheRetention2,
3
+ promptCacheMinimumTtlMs2
4
+ } from "../chunks/account-limits-cache-d2a51dka.js";
5
+ import"../chunks/account-limits-cache-b23sbrke.js";
6
+ export {
7
+ promptCacheMinimumTtlMs2 as promptCacheMinimumTtlMs,
8
+ resolveCacheRetention2 as resolveCacheRetention
9
+ };
@@ -0,0 +1,23 @@
1
+ import type { Credential, ProviderAuth } from "./auth/types.ts";
2
+ import type { Api, Model, PromptCachePolicy, ProviderHeaders, ProviderStreams } from "./types.ts";
3
+ import { type Provider } from "./models-types.ts";
4
+ export interface CreateProviderOptions<TApi extends Api = Api> {
5
+ id: string;
6
+ /** Display name. Default: `id`. */
7
+ name?: string;
8
+ baseUrl?: string;
9
+ headers?: ProviderHeaders;
10
+ promptCache?: PromptCachePolicy;
11
+ /** Required — every provider has auth semantics, even ambient/keyless ones. */
12
+ auth: ProviderAuth;
13
+ fetchAccountLimits?: Provider<TApi>["fetchAccountLimits"];
14
+ filterModels?: (models: readonly Model<TApi>[], credential: Credential | undefined) => readonly Model<TApi>[];
15
+ /** Single implementation, or map keyed by `model.api` for mixed-API providers. */
16
+ api: ProviderStreams | Partial<Record<TApi, ProviderStreams>>;
17
+ }
18
+ /**
19
+ * Builds a provider from parts. Built-in and custom provider factories both go through this. A
20
+ * single `api` streams all models; an `api` map dispatches on `model.api`, and a model whose api
21
+ * has no entry is omitted from the catalog and produces a stream error if passed directly.
22
+ */
23
+ export declare function createProvider<TApi extends Api = Api>(input: CreateProviderOptions<TApi>): Provider<TApi>;
@@ -0,0 +1,14 @@
1
+ import {
2
+ createProvider2
3
+ } from "../chunks/account-limits-cache-ykbqsvv6.js";
4
+ import"../chunks/account-limits-cache-90c9c2eb.js";
5
+ import"../chunks/account-limits-cache-fsktnetm.js";
6
+ import"../chunks/account-limits-cache-zcbkmrvy.js";
7
+ import"../chunks/account-limits-cache-a6cgeagz.js";
8
+ import"../chunks/account-limits-cache-nn9jebsj.js";
9
+ import"../chunks/account-limits-cache-7z9s8j16.js";
10
+ import"../chunks/account-limits-cache-9wqk28n5.js";
11
+ import"../chunks/account-limits-cache-j2bt392s.js";
12
+ export {
13
+ createProvider2 as createProvider
14
+ };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * What every provider's subscription-window reader shares: the normalized window and the
3
+ * account usage request.
4
+ */
5
+ import type { Static, TSchema } from "typebox";
6
+ import type { AccountLimitWindow, AccountLimitsFetchOptions } from "../types.ts";
7
+ /** One window with its percent clamped to 0..100; absent reset and length stay absent. */
8
+ export declare function limitWindow(id: string, label: string, usedPercent: number, resetsAt: number | undefined, windowMinutes: number | undefined): AccountLimitWindow;
9
+ /**
10
+ * GETs a provider's account usage endpoint and decodes the body against `schema`. `label` names
11
+ * the provider in errors; a positive `timeoutMs` bounds the whole request.
12
+ */
13
+ export declare function fetchAccountUsage<T extends TSchema>(url: string, headers: Headers, options: AccountLimitsFetchOptions | undefined, schema: T, label: string): Promise<Static<T>>;
@@ -0,0 +1,8 @@
1
+ import {
2
+ limitWindow2,
3
+ fetchAccountUsage2
4
+ } from "../../chunks/account-limits-cache-ehy0ze2b.js";
5
+ export {
6
+ fetchAccountUsage2 as fetchAccountUsage,
7
+ limitWindow2 as limitWindow
8
+ };
@@ -0,0 +1,9 @@
1
+ import type { AccountLimits, AccountLimitsFetchOptions, AccountLimitsTarget } from "../types.ts";
2
+ /**
3
+ * Every OAuth response carries the shared windows as
4
+ * `anthropic-ratelimit-unified-{5h,7d}-{utilization,reset}`, so a turn that
5
+ * just ran is also the freshest read of the account.
6
+ */
7
+ export declare function claudeHeaderLimits(headers: Record<string, string>, providerId: string): AccountLimits | undefined;
8
+ /** Fetch Claude Code subscription windows from Anthropic's OAuth usage endpoint. */
9
+ export declare function fetchAnthropicAccountLimits(model: AccountLimitsTarget, options?: AccountLimitsFetchOptions): Promise<AccountLimits>;
@@ -0,0 +1,10 @@
1
+ import {
2
+ claudeHeaderLimits2,
3
+ fetchAnthropicAccountLimits2
4
+ } from "../../chunks/account-limits-cache-re8hpzwn.js";
5
+ import"../../chunks/account-limits-cache-ks1sjym9.js";
6
+ import"../../chunks/account-limits-cache-ehy0ze2b.js";
7
+ export {
8
+ claudeHeaderLimits2 as claudeHeaderLimits,
9
+ fetchAnthropicAccountLimits2 as fetchAnthropicAccountLimits
10
+ };
@@ -0,0 +1,2 @@
1
+ import type { Provider } from "../models-types.ts";
2
+ export declare function anthropicProvider(): Provider<"anthropic-messages">;
@@ -0,0 +1,25 @@
1
+ import {
2
+ anthropicProvider2
3
+ } from "../../chunks/account-limits-cache-8wfqg73s.js";
4
+ import"../../chunks/account-limits-cache-ydq8p8qp.js";
5
+ import"../../chunks/account-limits-cache-re8hpzwn.js";
6
+ import"../../chunks/account-limits-cache-ks1sjym9.js";
7
+ import"../../chunks/account-limits-cache-ehy0ze2b.js";
8
+ import"../../chunks/account-limits-cache-zqdb4yh4.js";
9
+ import"../../chunks/account-limits-cache-6x05n06z.js";
10
+ import"../../chunks/account-limits-cache-ag5b8dja.js";
11
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
12
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
13
+ import"../../chunks/account-limits-cache-fsktnetm.js";
14
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
15
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
16
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
17
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
18
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
19
+ import"../../chunks/account-limits-cache-v4n30az2.js";
20
+ import"../../chunks/account-limits-cache-j2bt392s.js";
21
+ import"../../chunks/account-limits-cache-hyzn1jmk.js";
22
+ import"../../chunks/account-limits-cache-b23sbrke.js";
23
+ export {
24
+ anthropicProvider2 as anthropicProvider
25
+ };
@@ -0,0 +1,5 @@
1
+ /** Parses Copilot's model list into the models the account may pick. Only Individual accounts fall back to explicit enabled policies when picker flags fail. */
2
+ export declare function parseGitHubCopilotCatalog(value: unknown, origin: string, knownModelIds: ReadonlySet<string>): {
3
+ availableModelIds: string[];
4
+ needsApproval: boolean;
5
+ };
@@ -0,0 +1,7 @@
1
+ import {
2
+ parseGitHubCopilotCatalog2
3
+ } from "../../chunks/account-limits-cache-gs8a3fhw.js";
4
+ import"../../chunks/account-limits-cache-za42x8a3.js";
5
+ export {
6
+ parseGitHubCopilotCatalog2 as parseGitHubCopilotCatalog
7
+ };
@@ -0,0 +1,2 @@
1
+ import { type GitHubCopilotOAuthOptions } from "../auth/oauth/github-copilot.ts";
2
+ export declare function githubCopilotProvider(options?: GitHubCopilotOAuthOptions): import("../models-types.ts").Provider<"openai-completions" | "openai-responses" | "anthropic-messages">;
@@ -0,0 +1,23 @@
1
+ import {
2
+ githubCopilotProvider2
3
+ } from "../../chunks/account-limits-cache-a1jyaq00.js";
4
+ import"../../chunks/account-limits-cache-cw7q7vfy.js";
5
+ import"../../chunks/account-limits-cache-q1ebtvet.js";
6
+ import"../../chunks/account-limits-cache-eyx1jcxc.js";
7
+ import"../../chunks/account-limits-cache-zqdb4yh4.js";
8
+ import"../../chunks/account-limits-cache-6x05n06z.js";
9
+ import"../../chunks/account-limits-cache-gs8a3fhw.js";
10
+ import"../../chunks/account-limits-cache-za42x8a3.js";
11
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
12
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
13
+ import"../../chunks/account-limits-cache-fsktnetm.js";
14
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
15
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
16
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
17
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
18
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
19
+ import"../../chunks/account-limits-cache-4hptgd2h.js";
20
+ import"../../chunks/account-limits-cache-j2bt392s.js";
21
+ export {
22
+ githubCopilotProvider2 as githubCopilotProvider
23
+ };
@@ -0,0 +1,15 @@
1
+ /**
2
+ * The catalog every Nyte client composes: the same providers over the same
3
+ * `~/.nyte` credential and model stores, so a login made in one client is a
4
+ * login in all of them.
5
+ */
6
+ import type { ProviderId } from "@nyte-ai/schema/model";
7
+ import type { MutableModels, Provider } from "../models-types.ts";
8
+ /**
9
+ * Explicit defaults for providers whose first choice should not depend on feed order.
10
+ * Providers without one use the first catalog entry.
11
+ */
12
+ export declare const defaultModelPerProvider: Readonly<Record<ProviderId, string>>;
13
+ export declare function createNyteModels(): MutableModels;
14
+ /** Returns a fresh instance of every provider a Nyte client composes, in fallback order: what `createNyteModels` registers, for a host that builds its own `Models` over other stores. */
15
+ export declare function nyteProviders(): readonly Provider[];
@@ -0,0 +1,63 @@
1
+ import {
2
+ defaultModelPerProvider2,
3
+ createNyteModels2,
4
+ nyteProviders2
5
+ } from "../../chunks/account-limits-cache-ghe9ne4j.js";
6
+ import"../../chunks/account-limits-cache-c7v93krb.js";
7
+ import"../../chunks/account-limits-cache-09vs98g6.js";
8
+ import"../../chunks/account-limits-cache-5rx2pfm5.js";
9
+ import"../../chunks/account-limits-cache-hj3ek3ty.js";
10
+ import"../../chunks/account-limits-cache-fvadc36m.js";
11
+ import"../../chunks/account-limits-cache-gsa5tzck.js";
12
+ import"../../chunks/account-limits-cache-nyy770yd.js";
13
+ import"../../chunks/account-limits-cache-nbkyhs6v.js";
14
+ import"../../chunks/account-limits-cache-x9fvb3s5.js";
15
+ import"../../chunks/account-limits-cache-fht68jp2.js";
16
+ import"../../chunks/account-limits-cache-pfa86y8e.js";
17
+ import"../../chunks/account-limits-cache-q63mc41j.js";
18
+ import"../../chunks/account-limits-cache-8wfqg73s.js";
19
+ import"../../chunks/account-limits-cache-ydq8p8qp.js";
20
+ import"../../chunks/account-limits-cache-re8hpzwn.js";
21
+ import"../../chunks/account-limits-cache-ks1sjym9.js";
22
+ import"../../chunks/account-limits-cache-ehy0ze2b.js";
23
+ import"../../chunks/account-limits-cache-a1jyaq00.js";
24
+ import"../../chunks/account-limits-cache-cw7q7vfy.js";
25
+ import"../../chunks/account-limits-cache-q1ebtvet.js";
26
+ import"../../chunks/account-limits-cache-eyx1jcxc.js";
27
+ import"../../chunks/account-limits-cache-zqdb4yh4.js";
28
+ import"../../chunks/account-limits-cache-6x05n06z.js";
29
+ import"../../chunks/account-limits-cache-gs8a3fhw.js";
30
+ import"../../chunks/account-limits-cache-za42x8a3.js";
31
+ import"../../chunks/account-limits-cache-gknnm1kv.js";
32
+ import"../../chunks/account-limits-cache-5jdhn0e1.js";
33
+ import"../../chunks/account-limits-cache-1jv43fhh.js";
34
+ import"../../chunks/account-limits-cache-emg5b4hj.js";
35
+ import"../../chunks/account-limits-cache-8137j3zp.js";
36
+ import"../../chunks/account-limits-cache-ag5b8dja.js";
37
+ import"../../chunks/account-limits-cache-031vfpt3.js";
38
+ import"../../chunks/account-limits-cache-zpjmeyt0.js";
39
+ import"../../chunks/account-limits-cache-5ygxyyss.js";
40
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
41
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
42
+ import"../../chunks/account-limits-cache-fsktnetm.js";
43
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
44
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
45
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
46
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
47
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
48
+ import"../../chunks/account-limits-cache-hemxtapd.js";
49
+ import"../../chunks/account-limits-cache-b0x2sfya.js";
50
+ import"../../chunks/account-limits-cache-v4n30az2.js";
51
+ import"../../chunks/account-limits-cache-4hptgd2h.js";
52
+ import"../../chunks/account-limits-cache-j2bt392s.js";
53
+ import"../../chunks/account-limits-cache-hyzn1jmk.js";
54
+ import"../../chunks/account-limits-cache-b23sbrke.js";
55
+ import"../../chunks/account-limits-cache-a55e14fr.js";
56
+ import"../../chunks/account-limits-cache-rz8p1g5y.js";
57
+ import"../../chunks/account-limits-cache-zgzptd0z.js";
58
+ import"../../chunks/account-limits-cache-f9z00x8c.js";
59
+ export {
60
+ createNyteModels2 as createNyteModels,
61
+ defaultModelPerProvider2 as defaultModelPerProvider,
62
+ nyteProviders2 as nyteProviders
63
+ };
@@ -0,0 +1,8 @@
1
+ import { type CodexFrame } from "../api/openai-codex-wire.ts";
2
+ import type { AccountLimits, AccountLimitsFetchOptions, AccountLimitsTarget } from "../types.ts";
3
+ /** Windows from a `codex.rate_limits` frame, or undefined for any other frame. */
4
+ export declare function codexFrameLimits(frame: CodexFrame, providerId: string): AccountLimits | undefined;
5
+ /** Every SSE response carries the same windows as `x-codex-{primary,secondary}-*` headers. */
6
+ export declare function codexHeaderLimits(headers: Record<string, string>, providerId: string): AccountLimits | undefined;
7
+ /** Fetch current ChatGPT subscription windows from `wham/usage`. */
8
+ export declare function fetchOpenAICodexAccountLimits(model: AccountLimitsTarget, options?: AccountLimitsFetchOptions): Promise<AccountLimits>;
@@ -0,0 +1,14 @@
1
+ import {
2
+ codexFrameLimits2,
3
+ codexHeaderLimits2,
4
+ fetchOpenAICodexAccountLimits2
5
+ } from "../../chunks/account-limits-cache-hj3ek3ty.js";
6
+ import"../../chunks/account-limits-cache-fvadc36m.js";
7
+ import"../../chunks/account-limits-cache-ehy0ze2b.js";
8
+ import"../../chunks/account-limits-cache-gknnm1kv.js";
9
+ import"../../chunks/account-limits-cache-ag5b8dja.js";
10
+ export {
11
+ codexFrameLimits2 as codexFrameLimits,
12
+ codexHeaderLimits2 as codexHeaderLimits,
13
+ fetchOpenAICodexAccountLimits2 as fetchOpenAICodexAccountLimits
14
+ };
@@ -0,0 +1,2 @@
1
+ import type { Provider } from "../models-types.ts";
2
+ export declare function openaiCodexProvider(): Provider<"openai-codex-responses">;
@@ -0,0 +1,23 @@
1
+ import {
2
+ openaiCodexProvider2
3
+ } from "../../chunks/account-limits-cache-09vs98g6.js";
4
+ import"../../chunks/account-limits-cache-5rx2pfm5.js";
5
+ import"../../chunks/account-limits-cache-hj3ek3ty.js";
6
+ import"../../chunks/account-limits-cache-fvadc36m.js";
7
+ import"../../chunks/account-limits-cache-ehy0ze2b.js";
8
+ import"../../chunks/account-limits-cache-6x05n06z.js";
9
+ import"../../chunks/account-limits-cache-gknnm1kv.js";
10
+ import"../../chunks/account-limits-cache-ag5b8dja.js";
11
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
12
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
13
+ import"../../chunks/account-limits-cache-fsktnetm.js";
14
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
15
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
16
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
17
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
18
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
19
+ import"../../chunks/account-limits-cache-v4n30az2.js";
20
+ import"../../chunks/account-limits-cache-j2bt392s.js";
21
+ export {
22
+ openaiCodexProvider2 as openaiCodexProvider
23
+ };
@@ -0,0 +1,2 @@
1
+ import type { Provider } from "../models-types.ts";
2
+ export declare function openaiProvider(): Provider<"openai-responses">;
@@ -0,0 +1,19 @@
1
+ import {
2
+ openaiProvider2
3
+ } from "../../chunks/account-limits-cache-gsa5tzck.js";
4
+ import"../../chunks/account-limits-cache-ydq8p8qp.js";
5
+ import"../../chunks/account-limits-cache-q1ebtvet.js";
6
+ import"../../chunks/account-limits-cache-6x05n06z.js";
7
+ import"../../chunks/account-limits-cache-ag5b8dja.js";
8
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
9
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
10
+ import"../../chunks/account-limits-cache-fsktnetm.js";
11
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
12
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
13
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
14
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
15
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
16
+ import"../../chunks/account-limits-cache-j2bt392s.js";
17
+ export {
18
+ openaiProvider2 as openaiProvider
19
+ };
@@ -0,0 +1,5 @@
1
+ import type { Provider } from "../models-types.ts";
2
+ import type { OpenCodeApi } from "./opencode.ts";
3
+ type OpenCodeGoApi = Exclude<OpenCodeApi, "google-generative-ai">;
4
+ export declare function opencodeGoProvider(): Provider<OpenCodeGoApi>;
5
+ export {};
@@ -0,0 +1,22 @@
1
+ import {
2
+ opencodeGoProvider2
3
+ } from "../../chunks/account-limits-cache-nyy770yd.js";
4
+ import"../../chunks/account-limits-cache-nbkyhs6v.js";
5
+ import"../../chunks/account-limits-cache-x9fvb3s5.js";
6
+ import"../../chunks/account-limits-cache-fht68jp2.js";
7
+ import"../../chunks/account-limits-cache-q1ebtvet.js";
8
+ import"../../chunks/account-limits-cache-eyx1jcxc.js";
9
+ import"../../chunks/account-limits-cache-zqdb4yh4.js";
10
+ import"../../chunks/account-limits-cache-6x05n06z.js";
11
+ import"../../chunks/account-limits-cache-ykbqsvv6.js";
12
+ import"../../chunks/account-limits-cache-90c9c2eb.js";
13
+ import"../../chunks/account-limits-cache-fsktnetm.js";
14
+ import"../../chunks/account-limits-cache-zcbkmrvy.js";
15
+ import"../../chunks/account-limits-cache-a6cgeagz.js";
16
+ import"../../chunks/account-limits-cache-nn9jebsj.js";
17
+ import"../../chunks/account-limits-cache-7z9s8j16.js";
18
+ import"../../chunks/account-limits-cache-9wqk28n5.js";
19
+ import"../../chunks/account-limits-cache-j2bt392s.js";
20
+ export {
21
+ opencodeGoProvider2 as opencodeGoProvider
22
+ };