orient-cli 0.1.0-alpha.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (936) hide show
  1. package/LICENSE +0 -0
  2. package/NOTICE.md +0 -0
  3. package/README.md +0 -0
  4. package/dist/cli.d.ts +0 -0
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/extensions/orient-core.d.ts +0 -0
  8. package/dist/extensions/orient-core.js +0 -0
  9. package/dist/extensions/orient-core.js.map +0 -0
  10. package/dist/extensions/orient-notebooklm.d.ts +0 -0
  11. package/dist/extensions/orient-notebooklm.js +0 -0
  12. package/dist/extensions/orient-notebooklm.js.map +0 -0
  13. package/dist/index.d.ts +1 -1
  14. package/dist/index.js +1 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/integrations/notebooklm/bridge.d.ts +0 -0
  17. package/dist/integrations/notebooklm/bridge.js +0 -0
  18. package/dist/integrations/notebooklm/bridge.js.map +0 -0
  19. package/dist/integrations/notebooklm/notebooklm-extension.d.ts +1 -1
  20. package/dist/integrations/notebooklm/notebooklm-extension.js +1 -1
  21. package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
  22. package/dist/orient/artifact-graph.d.ts +0 -0
  23. package/dist/orient/artifact-graph.js +0 -0
  24. package/dist/orient/artifact-graph.js.map +0 -0
  25. package/dist/orient/change-packet.d.ts +2 -1
  26. package/dist/orient/change-packet.js +25 -8
  27. package/dist/orient/change-packet.js.map +1 -1
  28. package/dist/orient/clarify.d.ts +114 -0
  29. package/dist/orient/clarify.js +186 -0
  30. package/dist/orient/clarify.js.map +1 -0
  31. package/dist/orient/clear-command.d.ts +79 -0
  32. package/dist/orient/clear-command.js +117 -0
  33. package/dist/orient/clear-command.js.map +1 -0
  34. package/dist/orient/mode.d.ts +70 -0
  35. package/dist/orient/mode.js +124 -0
  36. package/dist/orient/mode.js.map +1 -0
  37. package/dist/orient/orient-extension.d.ts +1 -1
  38. package/dist/orient/orient-extension.js +306 -17
  39. package/dist/orient/orient-extension.js.map +1 -1
  40. package/dist/orient/phases.d.ts +0 -0
  41. package/dist/orient/phases.js +0 -0
  42. package/dist/orient/phases.js.map +0 -0
  43. package/dist/orient/plan-execute.d.ts +137 -0
  44. package/dist/orient/plan-execute.js +333 -0
  45. package/dist/orient/plan-execute.js.map +1 -0
  46. package/dist/orient/state-machine.d.ts +0 -0
  47. package/dist/orient/state-machine.js +0 -0
  48. package/dist/orient/state-machine.js.map +0 -0
  49. package/dist/orient/tiers.d.ts +109 -0
  50. package/dist/orient/tiers.js +162 -0
  51. package/dist/orient/tiers.js.map +1 -0
  52. package/dist/orient/types.d.ts +0 -0
  53. package/dist/orient/types.js +0 -0
  54. package/dist/orient/types.js.map +0 -0
  55. package/dist/orient/wizard.d.ts +108 -0
  56. package/dist/orient/wizard.js +183 -0
  57. package/dist/orient/wizard.js.map +1 -0
  58. package/dist/package-paths.d.ts +0 -0
  59. package/dist/package-paths.js +0 -0
  60. package/dist/package-paths.js.map +0 -0
  61. package/docs/architecture.md +0 -0
  62. package/docs/artifacts.md +0 -0
  63. package/docs/commands.md +0 -0
  64. package/docs/configuration.md +0 -0
  65. package/docs/getting-started.md +0 -0
  66. package/docs/open-source-resources.md +1 -1
  67. package/docs/phases.md +0 -0
  68. package/docs/research-integration.md +0 -0
  69. package/docs/workflows.md +0 -0
  70. package/node_modules/@orient-cli/agent-core/README.md +456 -0
  71. package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts +24 -0
  72. package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts.map +1 -0
  73. package/node_modules/@orient-cli/agent-core/dist/agent-loop.js +404 -0
  74. package/node_modules/@orient-cli/agent-core/dist/agent-loop.js.map +1 -0
  75. package/node_modules/@orient-cli/agent-core/dist/agent.d.ts +115 -0
  76. package/node_modules/@orient-cli/agent-core/dist/agent.d.ts.map +1 -0
  77. package/node_modules/@orient-cli/agent-core/dist/agent.js +395 -0
  78. package/node_modules/@orient-cli/agent-core/dist/agent.js.map +1 -0
  79. package/node_modules/@orient-cli/agent-core/dist/index.d.ts +5 -0
  80. package/node_modules/@orient-cli/agent-core/dist/index.d.ts.map +1 -0
  81. package/node_modules/@orient-cli/agent-core/dist/index.js +9 -0
  82. package/node_modules/@orient-cli/agent-core/dist/index.js.map +1 -0
  83. package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts +85 -0
  84. package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts.map +1 -0
  85. package/node_modules/@orient-cli/agent-core/dist/proxy.js +268 -0
  86. package/node_modules/@orient-cli/agent-core/dist/proxy.js.map +1 -0
  87. package/node_modules/@orient-cli/agent-core/dist/types.d.ts +323 -0
  88. package/node_modules/@orient-cli/agent-core/dist/types.d.ts.map +1 -0
  89. package/node_modules/@orient-cli/agent-core/dist/types.js +2 -0
  90. package/node_modules/@orient-cli/agent-core/dist/types.js.map +1 -0
  91. package/node_modules/@orient-cli/agent-core/package.json +44 -0
  92. package/node_modules/@orient-cli/ai/README.md +1315 -0
  93. package/node_modules/@orient-cli/ai/dist/api-registry.d.ts +20 -0
  94. package/node_modules/@orient-cli/ai/dist/api-registry.d.ts.map +1 -0
  95. package/node_modules/@orient-cli/ai/dist/api-registry.js +44 -0
  96. package/node_modules/@orient-cli/ai/dist/api-registry.js.map +1 -0
  97. package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts +5 -0
  98. package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts.map +1 -0
  99. package/node_modules/@orient-cli/ai/dist/bedrock-provider.js +6 -0
  100. package/node_modules/@orient-cli/ai/dist/bedrock-provider.js.map +1 -0
  101. package/node_modules/@orient-cli/ai/dist/cli.d.ts +3 -0
  102. package/node_modules/@orient-cli/ai/dist/cli.d.ts.map +1 -0
  103. package/node_modules/@orient-cli/ai/dist/cli.js +116 -0
  104. package/node_modules/@orient-cli/ai/dist/cli.js.map +1 -0
  105. package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts +9 -0
  106. package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts.map +1 -0
  107. package/node_modules/@orient-cli/ai/dist/env-api-keys.js +107 -0
  108. package/node_modules/@orient-cli/ai/dist/env-api-keys.js.map +1 -0
  109. package/node_modules/@orient-cli/ai/dist/index.d.ts +26 -0
  110. package/node_modules/@orient-cli/ai/dist/index.d.ts.map +1 -0
  111. package/node_modules/@orient-cli/ai/dist/index.js +14 -0
  112. package/node_modules/@orient-cli/ai/dist/index.js.map +1 -0
  113. package/node_modules/@orient-cli/ai/dist/models.d.ts +24 -0
  114. package/node_modules/@orient-cli/ai/dist/models.d.ts.map +1 -0
  115. package/node_modules/@orient-cli/ai/dist/models.generated.d.ts +14473 -0
  116. package/node_modules/@orient-cli/ai/dist/models.generated.d.ts.map +1 -0
  117. package/node_modules/@orient-cli/ai/dist/models.generated.js +14241 -0
  118. package/node_modules/@orient-cli/ai/dist/models.generated.js.map +1 -0
  119. package/node_modules/@orient-cli/ai/dist/models.js +55 -0
  120. package/node_modules/@orient-cli/ai/dist/models.js.map +1 -0
  121. package/node_modules/@orient-cli/ai/dist/oauth.d.ts +2 -0
  122. package/node_modules/@orient-cli/ai/dist/oauth.d.ts.map +1 -0
  123. package/node_modules/@orient-cli/ai/dist/oauth.js +2 -0
  124. package/node_modules/@orient-cli/ai/dist/oauth.js.map +1 -0
  125. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts +20 -0
  126. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
  127. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js +651 -0
  128. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js.map +1 -0
  129. package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts +40 -0
  130. package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts.map +1 -0
  131. package/node_modules/@orient-cli/ai/dist/providers/anthropic.js +749 -0
  132. package/node_modules/@orient-cli/ai/dist/providers/anthropic.js.map +1 -0
  133. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts +15 -0
  134. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
  135. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js +176 -0
  136. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js.map +1 -0
  137. package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts +56 -0
  138. package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts.map +1 -0
  139. package/node_modules/@orient-cli/ai/dist/providers/faux.js +367 -0
  140. package/node_modules/@orient-cli/ai/dist/providers/faux.js.map +1 -0
  141. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts +8 -0
  142. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
  143. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js +29 -0
  144. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js.map +1 -0
  145. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts +74 -0
  146. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
  147. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js +776 -0
  148. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js.map +1 -0
  149. package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts +65 -0
  150. package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts.map +1 -0
  151. package/node_modules/@orient-cli/ai/dist/providers/google-shared.js +312 -0
  152. package/node_modules/@orient-cli/ai/dist/providers/google-shared.js.map +1 -0
  153. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts +15 -0
  154. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts.map +1 -0
  155. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js +419 -0
  156. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js.map +1 -0
  157. package/node_modules/@orient-cli/ai/dist/providers/google.d.ts +13 -0
  158. package/node_modules/@orient-cli/ai/dist/providers/google.d.ts.map +1 -0
  159. package/node_modules/@orient-cli/ai/dist/providers/google.js +399 -0
  160. package/node_modules/@orient-cli/ai/dist/providers/google.js.map +1 -0
  161. package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts +22 -0
  162. package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts.map +1 -0
  163. package/node_modules/@orient-cli/ai/dist/providers/mistral.js +501 -0
  164. package/node_modules/@orient-cli/ai/dist/providers/mistral.js.map +1 -0
  165. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts +9 -0
  166. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
  167. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js +741 -0
  168. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js.map +1 -0
  169. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts +15 -0
  170. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts.map +1 -0
  171. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js +753 -0
  172. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js.map +1 -0
  173. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts +17 -0
  174. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
  175. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js +470 -0
  176. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js.map +1 -0
  177. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts +13 -0
  178. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts.map +1 -0
  179. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js +190 -0
  180. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js.map +1 -0
  181. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts +38 -0
  182. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts.map +1 -0
  183. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js +261 -0
  184. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js.map +1 -0
  185. package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts +8 -0
  186. package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts.map +1 -0
  187. package/node_modules/@orient-cli/ai/dist/providers/simple-options.js +35 -0
  188. package/node_modules/@orient-cli/ai/dist/providers/simple-options.js.map +1 -0
  189. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts +8 -0
  190. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts.map +1 -0
  191. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js +155 -0
  192. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js.map +1 -0
  193. package/node_modules/@orient-cli/ai/dist/stream.d.ts +8 -0
  194. package/node_modules/@orient-cli/ai/dist/stream.d.ts.map +1 -0
  195. package/node_modules/@orient-cli/ai/dist/stream.js +27 -0
  196. package/node_modules/@orient-cli/ai/dist/stream.js.map +1 -0
  197. package/node_modules/@orient-cli/ai/dist/types.d.ts +353 -0
  198. package/node_modules/@orient-cli/ai/dist/types.d.ts.map +1 -0
  199. package/node_modules/@orient-cli/ai/dist/types.js +2 -0
  200. package/node_modules/@orient-cli/ai/dist/types.js.map +1 -0
  201. package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts +21 -0
  202. package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts.map +1 -0
  203. package/node_modules/@orient-cli/ai/dist/utils/event-stream.js +81 -0
  204. package/node_modules/@orient-cli/ai/dist/utils/event-stream.js.map +1 -0
  205. package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts +3 -0
  206. package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts.map +1 -0
  207. package/node_modules/@orient-cli/ai/dist/utils/hash.js +14 -0
  208. package/node_modules/@orient-cli/ai/dist/utils/hash.js.map +1 -0
  209. package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts +9 -0
  210. package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts.map +1 -0
  211. package/node_modules/@orient-cli/ai/dist/utils/json-parse.js +29 -0
  212. package/node_modules/@orient-cli/ai/dist/utils/json-parse.js.map +1 -0
  213. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts +25 -0
  214. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
  215. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js +335 -0
  216. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js.map +1 -0
  217. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts +30 -0
  218. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
  219. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js +292 -0
  220. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js.map +1 -0
  221. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
  222. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
  223. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js +376 -0
  224. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js.map +1 -0
  225. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
  226. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
  227. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js +481 -0
  228. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
  229. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts +61 -0
  230. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts.map +1 -0
  231. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js +131 -0
  232. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js.map +1 -0
  233. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts +3 -0
  234. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
  235. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js +105 -0
  236. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js.map +1 -0
  237. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts +34 -0
  238. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
  239. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js +373 -0
  240. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js.map +1 -0
  241. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts +13 -0
  242. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts.map +1 -0
  243. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js +31 -0
  244. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js.map +1 -0
  245. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts +47 -0
  246. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts.map +1 -0
  247. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js +2 -0
  248. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js.map +1 -0
  249. package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts +53 -0
  250. package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts.map +1 -0
  251. package/node_modules/@orient-cli/ai/dist/utils/overflow.js +132 -0
  252. package/node_modules/@orient-cli/ai/dist/utils/overflow.js.map +1 -0
  253. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts +22 -0
  254. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
  255. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js +26 -0
  256. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js.map +1 -0
  257. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts +17 -0
  258. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts.map +1 -0
  259. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js +21 -0
  260. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js.map +1 -0
  261. package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts +18 -0
  262. package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts.map +1 -0
  263. package/node_modules/@orient-cli/ai/dist/utils/validation.js +80 -0
  264. package/node_modules/@orient-cli/ai/dist/utils/validation.js.map +1 -0
  265. package/node_modules/@orient-cli/ai/package.json +114 -0
  266. package/node_modules/@orient-cli/coding-agent/README.md +618 -0
  267. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts +3 -0
  268. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -0
  269. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js +7 -0
  270. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -0
  271. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts +2 -0
  272. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -0
  273. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js +4 -0
  274. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js.map +1 -0
  275. package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts +52 -0
  276. package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -0
  277. package/node_modules/@orient-cli/coding-agent/dist/cli/args.js +326 -0
  278. package/node_modules/@orient-cli/coding-agent/dist/cli/args.js.map +1 -0
  279. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts +14 -0
  280. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -0
  281. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js +31 -0
  282. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -0
  283. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts +15 -0
  284. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -0
  285. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js +83 -0
  286. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -0
  287. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +18 -0
  288. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -0
  289. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js +22 -0
  290. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -0
  291. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts +9 -0
  292. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -0
  293. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js +92 -0
  294. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -0
  295. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts +9 -0
  296. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -0
  297. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js +35 -0
  298. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -0
  299. package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts +3 -0
  300. package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -0
  301. package/node_modules/@orient-cli/coding-agent/dist/cli.js +15 -0
  302. package/node_modules/@orient-cli/coding-agent/dist/cli.js.map +1 -0
  303. package/node_modules/@orient-cli/coding-agent/dist/config.d.ts +77 -0
  304. package/node_modules/@orient-cli/coding-agent/dist/config.d.ts.map +1 -0
  305. package/node_modules/@orient-cli/coding-agent/dist/config.js +229 -0
  306. package/node_modules/@orient-cli/coding-agent/dist/config.js.map +1 -0
  307. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts +83 -0
  308. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -0
  309. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +236 -0
  310. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -0
  311. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts +86 -0
  312. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -0
  313. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js +116 -0
  314. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -0
  315. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts +585 -0
  316. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -0
  317. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js +2497 -0
  318. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -0
  319. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +132 -0
  320. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -0
  321. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js +422 -0
  322. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -0
  323. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts +46 -0
  324. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -0
  325. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js +125 -0
  326. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -0
  327. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts +88 -0
  328. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  329. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js +243 -0
  330. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
  331. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts +121 -0
  332. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
  333. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js +613 -0
  334. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -0
  335. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts +7 -0
  336. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -0
  337. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js +7 -0
  338. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js.map +1 -0
  339. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts +38 -0
  340. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
  341. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js +153 -0
  342. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -0
  343. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts +3 -0
  344. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -0
  345. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js +2 -0
  346. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js.map +1 -0
  347. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts +15 -0
  348. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -0
  349. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js +2 -0
  350. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js.map +1 -0
  351. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts +9 -0
  352. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -0
  353. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js +25 -0
  354. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -0
  355. package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts +29 -0
  356. package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -0
  357. package/node_modules/@orient-cli/coding-agent/dist/core/exec.js +75 -0
  358. package/node_modules/@orient-cli/coding-agent/dist/core/exec.js.map +1 -0
  359. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
  360. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  361. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
  362. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
  363. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts +37 -0
  364. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -0
  365. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js +224 -0
  366. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -0
  367. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.css +1001 -0
  368. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.html +55 -0
  369. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.js +1690 -0
  370. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts +40 -0
  371. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  372. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js +95 -0
  373. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
  374. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +1213 -0
  375. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +6 -0
  376. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts +12 -0
  377. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -0
  378. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js +9 -0
  379. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js.map +1 -0
  380. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts +25 -0
  381. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
  382. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js +438 -0
  383. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -0
  384. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts +148 -0
  385. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
  386. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js +700 -0
  387. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -0
  388. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts +1073 -0
  389. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -0
  390. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js +45 -0
  391. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -0
  392. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts +20 -0
  393. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
  394. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js +22 -0
  395. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -0
  396. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts +48 -0
  397. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
  398. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js +314 -0
  399. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -0
  400. package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts +12 -0
  401. package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -0
  402. package/node_modules/@orient-cli/coding-agent/dist/core/index.js +12 -0
  403. package/node_modules/@orient-cli/coding-agent/dist/core/index.js.map +1 -0
  404. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts +288 -0
  405. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -0
  406. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js +240 -0
  407. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -0
  408. package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts +77 -0
  409. package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -0
  410. package/node_modules/@orient-cli/coding-agent/dist/core/messages.js +123 -0
  411. package/node_modules/@orient-cli/coding-agent/dist/core/messages.js.map +1 -0
  412. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts +132 -0
  413. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -0
  414. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js +612 -0
  415. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -0
  416. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts +110 -0
  417. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -0
  418. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js +486 -0
  419. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -0
  420. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts +6 -0
  421. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -0
  422. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js +59 -0
  423. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -0
  424. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts +192 -0
  425. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -0
  426. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js +1829 -0
  427. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -0
  428. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts +51 -0
  429. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
  430. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js +249 -0
  431. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -0
  432. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts +23 -0
  433. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
  434. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js +126 -0
  435. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -0
  436. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts +185 -0
  437. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -0
  438. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js +720 -0
  439. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -0
  440. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts +93 -0
  441. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -0
  442. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js +236 -0
  443. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -0
  444. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts +19 -0
  445. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -0
  446. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js +38 -0
  447. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -0
  448. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts +333 -0
  449. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -0
  450. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js +1105 -0
  451. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -0
  452. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts +237 -0
  453. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -0
  454. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js +708 -0
  455. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -0
  456. package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts +60 -0
  457. package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -0
  458. package/node_modules/@orient-cli/coding-agent/dist/core/skills.js +409 -0
  459. package/node_modules/@orient-cli/coding-agent/dist/core/skills.js.map +1 -0
  460. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts +14 -0
  461. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -0
  462. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js +23 -0
  463. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js.map +1 -0
  464. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts +18 -0
  465. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -0
  466. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js +19 -0
  467. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -0
  468. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts +28 -0
  469. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -0
  470. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js +116 -0
  471. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -0
  472. package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts +8 -0
  473. package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -0
  474. package/node_modules/@orient-cli/coding-agent/dist/core/timings.js +31 -0
  475. package/node_modules/@orient-cli/coding-agent/dist/core/timings.js.map +1 -0
  476. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts +73 -0
  477. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -0
  478. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js +352 -0
  479. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -0
  480. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts +85 -0
  481. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
  482. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js +337 -0
  483. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -0
  484. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts +53 -0
  485. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -0
  486. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js +196 -0
  487. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -0
  488. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts +6 -0
  489. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  490. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js +37 -0
  491. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -0
  492. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts +46 -0
  493. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -0
  494. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js +258 -0
  495. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -0
  496. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts +56 -0
  497. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -0
  498. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js +293 -0
  499. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -0
  500. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts +115 -0
  501. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -0
  502. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js +86 -0
  503. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -0
  504. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts +46 -0
  505. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -0
  506. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js +172 -0
  507. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -0
  508. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts +8 -0
  509. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
  510. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js +81 -0
  511. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -0
  512. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts +46 -0
  513. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -0
  514. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js +225 -0
  515. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -0
  516. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts +21 -0
  517. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -0
  518. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js +49 -0
  519. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -0
  520. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  521. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  522. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js +32 -0
  523. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  524. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts +70 -0
  525. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
  526. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js +205 -0
  527. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -0
  528. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts +35 -0
  529. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -0
  530. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js +216 -0
  531. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -0
  532. package/node_modules/@orient-cli/coding-agent/dist/index.d.ts +28 -0
  533. package/node_modules/@orient-cli/coding-agent/dist/index.d.ts.map +1 -0
  534. package/node_modules/@orient-cli/coding-agent/dist/index.js +43 -0
  535. package/node_modules/@orient-cli/coding-agent/dist/index.js.map +1 -0
  536. package/node_modules/@orient-cli/coding-agent/dist/main.d.ts +8 -0
  537. package/node_modules/@orient-cli/coding-agent/dist/main.d.ts.map +1 -0
  538. package/node_modules/@orient-cli/coding-agent/dist/main.js +593 -0
  539. package/node_modules/@orient-cli/coding-agent/dist/main.js.map +1 -0
  540. package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts +33 -0
  541. package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -0
  542. package/node_modules/@orient-cli/coding-agent/dist/migrations.js +281 -0
  543. package/node_modules/@orient-cli/coding-agent/dist/migrations.js.map +1 -0
  544. package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts +9 -0
  545. package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -0
  546. package/node_modules/@orient-cli/coding-agent/dist/modes/index.js +8 -0
  547. package/node_modules/@orient-cli/coding-agent/dist/modes/index.js.map +1 -0
  548. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts +18 -0
  549. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  550. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +107 -0
  551. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
  552. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts +34 -0
  553. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  554. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +175 -0
  555. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
  556. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  557. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  558. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +51 -0
  559. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  560. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  561. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  562. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +44 -0
  563. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  564. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  565. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  566. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  567. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  568. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
  569. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  570. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +479 -0
  571. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
  572. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  573. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  574. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +33 -0
  575. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  576. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  577. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  578. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +70 -0
  579. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
  580. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
  581. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  582. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +79 -0
  583. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
  584. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
  585. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
  586. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js +133 -0
  587. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
  588. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  589. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  590. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +21 -0
  591. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  592. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  593. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  594. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +111 -0
  595. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
  596. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
  597. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  598. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +61 -0
  599. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
  600. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  601. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  602. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +78 -0
  603. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
  604. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts +27 -0
  605. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
  606. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +201 -0
  607. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
  608. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts +31 -0
  609. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
  610. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js +34 -0
  611. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -0
  612. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +8 -0
  613. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  614. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js +22 -0
  615. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  616. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
  617. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  618. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +145 -0
  619. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
  620. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
  621. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  622. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +275 -0
  623. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
  624. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  625. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  626. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +97 -0
  627. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  628. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts +53 -0
  629. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -0
  630. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js +204 -0
  631. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -0
  632. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  633. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  634. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +275 -0
  635. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  636. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  637. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  638. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
  639. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  640. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
  641. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  642. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +848 -0
  643. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
  644. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
  645. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  646. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +301 -0
  647. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
  648. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  649. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  650. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +39 -0
  651. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  652. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  653. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  654. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  655. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  656. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  657. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  658. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +50 -0
  659. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
  660. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  661. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  662. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +51 -0
  663. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  664. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts +58 -0
  665. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  666. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +274 -0
  667. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
  668. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts +89 -0
  669. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  670. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +1084 -0
  671. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
  672. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  673. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  674. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +113 -0
  675. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  676. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
  677. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  678. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js +28 -0
  679. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
  680. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  681. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  682. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
  683. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  684. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +321 -0
  685. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  686. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +4000 -0
  687. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
  688. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/dark.json +85 -0
  689. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/light.json +84 -0
  690. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
  691. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts +81 -0
  692. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  693. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +979 -0
  694. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
  695. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts +28 -0
  696. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -0
  697. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js +112 -0
  698. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -0
  699. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
  700. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
  701. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js +49 -0
  702. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
  703. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
  704. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  705. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +402 -0
  706. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
  707. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
  708. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  709. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js +550 -0
  710. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
  711. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts +408 -0
  712. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  713. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js +8 -0
  714. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
  715. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts +4 -0
  716. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -0
  717. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js +234 -0
  718. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -0
  719. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts +21 -0
  720. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -0
  721. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js +87 -0
  722. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -0
  723. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts +11 -0
  724. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -0
  725. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js +78 -0
  726. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -0
  727. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts +11 -0
  728. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
  729. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js +245 -0
  730. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -0
  731. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts +8 -0
  732. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
  733. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js +14 -0
  734. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -0
  735. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts +2 -0
  736. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -0
  737. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js +78 -0
  738. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -0
  739. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts +5 -0
  740. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -0
  741. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js +158 -0
  742. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -0
  743. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts +8 -0
  744. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
  745. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js +26 -0
  746. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -0
  747. package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts +26 -0
  748. package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -0
  749. package/node_modules/@orient-cli/coding-agent/dist/utils/git.js +163 -0
  750. package/node_modules/@orient-cli/coding-agent/dist/utils/git.js.map +1 -0
  751. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts +9 -0
  752. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -0
  753. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js +39 -0
  754. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -0
  755. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts +36 -0
  756. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -0
  757. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js +137 -0
  758. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -0
  759. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts +2 -0
  760. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -0
  761. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js +26 -0
  762. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -0
  763. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts +7 -0
  764. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -0
  765. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js +19 -0
  766. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -0
  767. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts +21 -0
  768. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -0
  769. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js +121 -0
  770. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -0
  771. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts +26 -0
  772. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -0
  773. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js +186 -0
  774. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -0
  775. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts +5 -0
  776. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -0
  777. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js +17 -0
  778. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -0
  779. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts +3 -0
  780. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
  781. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js +252 -0
  782. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -0
  783. package/node_modules/@orient-cli/coding-agent/package.json +104 -0
  784. package/node_modules/@orient-cli/tui/README.md +767 -0
  785. package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts +52 -0
  786. package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts.map +1 -0
  787. package/node_modules/@orient-cli/tui/dist/autocomplete.js +623 -0
  788. package/node_modules/@orient-cli/tui/dist/autocomplete.js.map +1 -0
  789. package/node_modules/@orient-cli/tui/dist/components/box.d.ts +22 -0
  790. package/node_modules/@orient-cli/tui/dist/components/box.d.ts.map +1 -0
  791. package/node_modules/@orient-cli/tui/dist/components/box.js +104 -0
  792. package/node_modules/@orient-cli/tui/dist/components/box.js.map +1 -0
  793. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts +22 -0
  794. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts.map +1 -0
  795. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js +35 -0
  796. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js.map +1 -0
  797. package/node_modules/@orient-cli/tui/dist/components/editor.d.ts +244 -0
  798. package/node_modules/@orient-cli/tui/dist/components/editor.d.ts.map +1 -0
  799. package/node_modules/@orient-cli/tui/dist/components/editor.js +1861 -0
  800. package/node_modules/@orient-cli/tui/dist/components/editor.js.map +1 -0
  801. package/node_modules/@orient-cli/tui/dist/components/image.d.ts +28 -0
  802. package/node_modules/@orient-cli/tui/dist/components/image.d.ts.map +1 -0
  803. package/node_modules/@orient-cli/tui/dist/components/image.js +69 -0
  804. package/node_modules/@orient-cli/tui/dist/components/image.js.map +1 -0
  805. package/node_modules/@orient-cli/tui/dist/components/input.d.ts +37 -0
  806. package/node_modules/@orient-cli/tui/dist/components/input.d.ts.map +1 -0
  807. package/node_modules/@orient-cli/tui/dist/components/input.js +426 -0
  808. package/node_modules/@orient-cli/tui/dist/components/input.js.map +1 -0
  809. package/node_modules/@orient-cli/tui/dist/components/loader.d.ts +21 -0
  810. package/node_modules/@orient-cli/tui/dist/components/loader.d.ts.map +1 -0
  811. package/node_modules/@orient-cli/tui/dist/components/loader.js +49 -0
  812. package/node_modules/@orient-cli/tui/dist/components/loader.js.map +1 -0
  813. package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts +95 -0
  814. package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts.map +1 -0
  815. package/node_modules/@orient-cli/tui/dist/components/markdown.js +663 -0
  816. package/node_modules/@orient-cli/tui/dist/components/markdown.js.map +1 -0
  817. package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts +50 -0
  818. package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts.map +1 -0
  819. package/node_modules/@orient-cli/tui/dist/components/select-list.js +159 -0
  820. package/node_modules/@orient-cli/tui/dist/components/select-list.js.map +1 -0
  821. package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts +50 -0
  822. package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts.map +1 -0
  823. package/node_modules/@orient-cli/tui/dist/components/settings-list.js +185 -0
  824. package/node_modules/@orient-cli/tui/dist/components/settings-list.js.map +1 -0
  825. package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts +12 -0
  826. package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts.map +1 -0
  827. package/node_modules/@orient-cli/tui/dist/components/spacer.js +23 -0
  828. package/node_modules/@orient-cli/tui/dist/components/spacer.js.map +1 -0
  829. package/node_modules/@orient-cli/tui/dist/components/text.d.ts +19 -0
  830. package/node_modules/@orient-cli/tui/dist/components/text.d.ts.map +1 -0
  831. package/node_modules/@orient-cli/tui/dist/components/text.js +89 -0
  832. package/node_modules/@orient-cli/tui/dist/components/text.js.map +1 -0
  833. package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts +13 -0
  834. package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts.map +1 -0
  835. package/node_modules/@orient-cli/tui/dist/components/truncated-text.js +51 -0
  836. package/node_modules/@orient-cli/tui/dist/components/truncated-text.js.map +1 -0
  837. package/node_modules/@orient-cli/tui/dist/editor-component.d.ts +39 -0
  838. package/node_modules/@orient-cli/tui/dist/editor-component.d.ts.map +1 -0
  839. package/node_modules/@orient-cli/tui/dist/editor-component.js +2 -0
  840. package/node_modules/@orient-cli/tui/dist/editor-component.js.map +1 -0
  841. package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts +16 -0
  842. package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts.map +1 -0
  843. package/node_modules/@orient-cli/tui/dist/fuzzy.js +107 -0
  844. package/node_modules/@orient-cli/tui/dist/fuzzy.js.map +1 -0
  845. package/node_modules/@orient-cli/tui/dist/index.d.ts +23 -0
  846. package/node_modules/@orient-cli/tui/dist/index.d.ts.map +1 -0
  847. package/node_modules/@orient-cli/tui/dist/index.js +32 -0
  848. package/node_modules/@orient-cli/tui/dist/index.js.map +1 -0
  849. package/node_modules/@orient-cli/tui/dist/keybindings.d.ts +193 -0
  850. package/node_modules/@orient-cli/tui/dist/keybindings.d.ts.map +1 -0
  851. package/node_modules/@orient-cli/tui/dist/keybindings.js +174 -0
  852. package/node_modules/@orient-cli/tui/dist/keybindings.js.map +1 -0
  853. package/node_modules/@orient-cli/tui/dist/keys.d.ts +170 -0
  854. package/node_modules/@orient-cli/tui/dist/keys.d.ts.map +1 -0
  855. package/node_modules/@orient-cli/tui/dist/keys.js +1124 -0
  856. package/node_modules/@orient-cli/tui/dist/keys.js.map +1 -0
  857. package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts +28 -0
  858. package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts.map +1 -0
  859. package/node_modules/@orient-cli/tui/dist/kill-ring.js +44 -0
  860. package/node_modules/@orient-cli/tui/dist/kill-ring.js.map +1 -0
  861. package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts +48 -0
  862. package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts.map +1 -0
  863. package/node_modules/@orient-cli/tui/dist/stdin-buffer.js +317 -0
  864. package/node_modules/@orient-cli/tui/dist/stdin-buffer.js.map +1 -0
  865. package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts +68 -0
  866. package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts.map +1 -0
  867. package/node_modules/@orient-cli/tui/dist/terminal-image.js +288 -0
  868. package/node_modules/@orient-cli/tui/dist/terminal-image.js.map +1 -0
  869. package/node_modules/@orient-cli/tui/dist/terminal.d.ts +84 -0
  870. package/node_modules/@orient-cli/tui/dist/terminal.d.ts.map +1 -0
  871. package/node_modules/@orient-cli/tui/dist/terminal.js +285 -0
  872. package/node_modules/@orient-cli/tui/dist/terminal.js.map +1 -0
  873. package/node_modules/@orient-cli/tui/dist/tui.d.ts +222 -0
  874. package/node_modules/@orient-cli/tui/dist/tui.d.ts.map +1 -0
  875. package/node_modules/@orient-cli/tui/dist/tui.js +1008 -0
  876. package/node_modules/@orient-cli/tui/dist/tui.js.map +1 -0
  877. package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts +17 -0
  878. package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts.map +1 -0
  879. package/node_modules/@orient-cli/tui/dist/undo-stack.js +25 -0
  880. package/node_modules/@orient-cli/tui/dist/undo-stack.js.map +1 -0
  881. package/node_modules/@orient-cli/tui/dist/utils.d.ts +78 -0
  882. package/node_modules/@orient-cli/tui/dist/utils.d.ts.map +1 -0
  883. package/node_modules/@orient-cli/tui/dist/utils.js +960 -0
  884. package/node_modules/@orient-cli/tui/dist/utils.js.map +1 -0
  885. package/node_modules/@orient-cli/tui/package.json +52 -0
  886. package/package.json +47 -8
  887. package/prompts/orient-blockers.md +0 -0
  888. package/prompts/orient-handoff.md +0 -0
  889. package/prompts/orient-recap.md +0 -0
  890. package/schemas/orient-full/schema.yaml +0 -0
  891. package/schemas/orient-minimal/schema.yaml +0 -0
  892. package/schemas/orient-standard/schema.yaml +0 -0
  893. package/schemas/orient-standard/templates/archive-summary.md +0 -0
  894. package/schemas/orient-standard/templates/brief.md +0 -0
  895. package/schemas/orient-standard/templates/constitution.md +0 -0
  896. package/schemas/orient-standard/templates/current-system-audit.md +0 -0
  897. package/schemas/orient-standard/templates/current-truth-sync.md +0 -0
  898. package/schemas/orient-standard/templates/decisions.md +0 -0
  899. package/schemas/orient-standard/templates/normalize-checklist.md +0 -0
  900. package/schemas/orient-standard/templates/plan.md +0 -0
  901. package/schemas/orient-standard/templates/qa-checklist.md +0 -0
  902. package/schemas/orient-standard/templates/research.md +0 -0
  903. package/schemas/orient-standard/templates/sources.md +0 -0
  904. package/schemas/orient-standard/templates/spec.md +0 -0
  905. package/schemas/orient-standard/templates/state.md +0 -0
  906. package/schemas/orient-standard/templates/tasks.md +0 -0
  907. package/schemas/orient-standard/templates/traceability-matrix.md +0 -0
  908. package/schemas/orient-standard/templates/verify.md +0 -0
  909. package/schemas/orient-standard/templates/work-log.md +0 -0
  910. package/schemas/orient-standard/templates-tier-1/brief.md +22 -0
  911. package/schemas/orient-standard/templates-tier-1/plan.md +17 -0
  912. package/schemas/orient-standard/templates-tier-1/spec.md +23 -0
  913. package/schemas/orient-standard/templates-tier-1/tasks.md +14 -0
  914. package/schemas/orient-standard/templates-tier-2/brief.md +32 -0
  915. package/schemas/orient-standard/templates-tier-2/plan.md +44 -0
  916. package/schemas/orient-standard/templates-tier-2/spec.md +46 -0
  917. package/schemas/orient-standard/templates-tier-2/tasks.md +34 -0
  918. package/schemas/orient-standard/templates-tier-3/brief.md +54 -0
  919. package/schemas/orient-standard/templates-tier-3/plan.md +67 -0
  920. package/schemas/orient-standard/templates-tier-3/spec.md +65 -0
  921. package/schemas/orient-standard/templates-tier-3/tasks.md +79 -0
  922. package/skills/orient-analyze/SKILL.md +0 -0
  923. package/skills/orient-archive/SKILL.md +0 -0
  924. package/skills/orient-clarify/SKILL.md +0 -0
  925. package/skills/orient-constitution/SKILL.md +0 -0
  926. package/skills/orient-decide/SKILL.md +0 -0
  927. package/skills/orient-execute/SKILL.md +0 -0
  928. package/skills/orient-integrate/SKILL.md +0 -0
  929. package/skills/orient-normalize/SKILL.md +0 -0
  930. package/skills/orient-orient/SKILL.md +0 -0
  931. package/skills/orient-plan/SKILL.md +0 -0
  932. package/skills/orient-research/SKILL.md +0 -0
  933. package/skills/orient-state/SKILL.md +0 -0
  934. package/skills/orient-tasks/SKILL.md +0 -0
  935. package/skills/orient-test/SKILL.md +0 -0
  936. package/skills/orient-verify/SKILL.md +0 -0
@@ -0,0 +1,190 @@
1
+ import OpenAI from "openai";
2
+ import { getEnvApiKey } from "../env-api-keys.js";
3
+ import { supportsXhigh } from "../models.js";
4
+ import { AssistantMessageEventStream } from "../utils/event-stream.js";
5
+ import { buildCopilotDynamicHeaders, hasCopilotVisionInput } from "./github-copilot-headers.js";
6
+ import { convertResponsesMessages, convertResponsesTools, processResponsesStream } from "./openai-responses-shared.js";
7
+ import { buildBaseOptions, clampReasoning } from "./simple-options.js";
8
+ const OPENAI_TOOL_CALL_PROVIDERS = new Set(["openai", "openai-codex", "opencode"]);
9
+ /**
10
+ * Resolve cache retention preference.
11
+ * Defaults to "short" and uses PI_CACHE_RETENTION for backward compatibility.
12
+ */
13
+ function resolveCacheRetention(cacheRetention) {
14
+ if (cacheRetention) {
15
+ return cacheRetention;
16
+ }
17
+ if (typeof process !== "undefined" && process.env.PI_CACHE_RETENTION === "long") {
18
+ return "long";
19
+ }
20
+ return "short";
21
+ }
22
+ /**
23
+ * Get prompt cache retention based on cacheRetention and base URL.
24
+ * Only applies to direct OpenAI API calls (api.openai.com).
25
+ */
26
+ function getPromptCacheRetention(baseUrl, cacheRetention) {
27
+ if (cacheRetention !== "long") {
28
+ return undefined;
29
+ }
30
+ if (baseUrl.includes("api.openai.com")) {
31
+ return "24h";
32
+ }
33
+ return undefined;
34
+ }
35
+ /**
36
+ * Generate function for OpenAI Responses API
37
+ */
38
+ export const streamOpenAIResponses = (model, context, options) => {
39
+ const stream = new AssistantMessageEventStream();
40
+ // Start async processing
41
+ (async () => {
42
+ const output = {
43
+ role: "assistant",
44
+ content: [],
45
+ api: model.api,
46
+ provider: model.provider,
47
+ model: model.id,
48
+ usage: {
49
+ input: 0,
50
+ output: 0,
51
+ cacheRead: 0,
52
+ cacheWrite: 0,
53
+ totalTokens: 0,
54
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
55
+ },
56
+ stopReason: "stop",
57
+ timestamp: Date.now(),
58
+ };
59
+ try {
60
+ // Create OpenAI client
61
+ const apiKey = options?.apiKey || getEnvApiKey(model.provider) || "";
62
+ const client = createClient(model, context, apiKey, options?.headers);
63
+ let params = buildParams(model, context, options);
64
+ const nextParams = await options?.onPayload?.(params, model);
65
+ if (nextParams !== undefined) {
66
+ params = nextParams;
67
+ }
68
+ const openaiStream = await client.responses.create(params, options?.signal ? { signal: options.signal } : undefined);
69
+ stream.push({ type: "start", partial: output });
70
+ await processResponsesStream(openaiStream, output, stream, model, {
71
+ serviceTier: options?.serviceTier,
72
+ applyServiceTierPricing,
73
+ });
74
+ if (options?.signal?.aborted) {
75
+ throw new Error("Request was aborted");
76
+ }
77
+ if (output.stopReason === "aborted" || output.stopReason === "error") {
78
+ throw new Error("An unknown error occurred");
79
+ }
80
+ stream.push({ type: "done", reason: output.stopReason, message: output });
81
+ stream.end();
82
+ }
83
+ catch (error) {
84
+ for (const block of output.content)
85
+ delete block.index;
86
+ output.stopReason = options?.signal?.aborted ? "aborted" : "error";
87
+ output.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);
88
+ stream.push({ type: "error", reason: output.stopReason, error: output });
89
+ stream.end();
90
+ }
91
+ })();
92
+ return stream;
93
+ };
94
+ export const streamSimpleOpenAIResponses = (model, context, options) => {
95
+ const apiKey = options?.apiKey || getEnvApiKey(model.provider);
96
+ if (!apiKey) {
97
+ throw new Error(`No API key for provider: ${model.provider}`);
98
+ }
99
+ const base = buildBaseOptions(model, options, apiKey);
100
+ const reasoningEffort = supportsXhigh(model) ? options?.reasoning : clampReasoning(options?.reasoning);
101
+ return streamOpenAIResponses(model, context, {
102
+ ...base,
103
+ reasoningEffort,
104
+ });
105
+ };
106
+ function createClient(model, context, apiKey, optionsHeaders) {
107
+ if (!apiKey) {
108
+ if (!process.env.OPENAI_API_KEY) {
109
+ throw new Error("OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.");
110
+ }
111
+ apiKey = process.env.OPENAI_API_KEY;
112
+ }
113
+ const headers = { ...model.headers };
114
+ if (model.provider === "github-copilot") {
115
+ const hasImages = hasCopilotVisionInput(context.messages);
116
+ const copilotHeaders = buildCopilotDynamicHeaders({
117
+ messages: context.messages,
118
+ hasImages,
119
+ });
120
+ Object.assign(headers, copilotHeaders);
121
+ }
122
+ // Merge options headers last so they can override defaults
123
+ if (optionsHeaders) {
124
+ Object.assign(headers, optionsHeaders);
125
+ }
126
+ return new OpenAI({
127
+ apiKey,
128
+ baseURL: model.baseUrl,
129
+ dangerouslyAllowBrowser: true,
130
+ defaultHeaders: headers,
131
+ });
132
+ }
133
+ function buildParams(model, context, options) {
134
+ const messages = convertResponsesMessages(model, context, OPENAI_TOOL_CALL_PROVIDERS);
135
+ const cacheRetention = resolveCacheRetention(options?.cacheRetention);
136
+ const params = {
137
+ model: model.id,
138
+ input: messages,
139
+ stream: true,
140
+ prompt_cache_key: cacheRetention === "none" ? undefined : options?.sessionId,
141
+ prompt_cache_retention: getPromptCacheRetention(model.baseUrl, cacheRetention),
142
+ store: false,
143
+ };
144
+ if (options?.maxTokens) {
145
+ params.max_output_tokens = options?.maxTokens;
146
+ }
147
+ if (options?.temperature !== undefined) {
148
+ params.temperature = options?.temperature;
149
+ }
150
+ if (options?.serviceTier !== undefined) {
151
+ params.service_tier = options.serviceTier;
152
+ }
153
+ if (context.tools) {
154
+ params.tools = convertResponsesTools(context.tools);
155
+ }
156
+ if (model.reasoning) {
157
+ if (options?.reasoningEffort || options?.reasoningSummary) {
158
+ params.reasoning = {
159
+ effort: options?.reasoningEffort || "medium",
160
+ summary: options?.reasoningSummary || "auto",
161
+ };
162
+ params.include = ["reasoning.encrypted_content"];
163
+ }
164
+ else if (model.provider !== "github-copilot") {
165
+ params.reasoning = { effort: "none" };
166
+ }
167
+ }
168
+ return params;
169
+ }
170
+ function getServiceTierCostMultiplier(serviceTier) {
171
+ switch (serviceTier) {
172
+ case "flex":
173
+ return 0.5;
174
+ case "priority":
175
+ return 2;
176
+ default:
177
+ return 1;
178
+ }
179
+ }
180
+ function applyServiceTierPricing(usage, serviceTier) {
181
+ const multiplier = getServiceTierCostMultiplier(serviceTier);
182
+ if (multiplier === 1)
183
+ return;
184
+ usage.cost.input *= multiplier;
185
+ usage.cost.output *= multiplier;
186
+ usage.cost.cacheRead *= multiplier;
187
+ usage.cost.cacheWrite *= multiplier;
188
+ usage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;
189
+ }
190
+ //# sourceMappingURL=openai-responses.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openai-responses.js","sourceRoot":"","sources":["../../src/providers/openai-responses.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAE5B,OAAO,EAAE,YAAY,EAAE,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CAAC;IACnC,KAAK,CAAC,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC;IACpC,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC;AAAA,CACvG","sourcesContent":["import OpenAI from \"openai\";\nimport type { ResponseCreateParamsStreaming } from \"openai/resources/responses/responses.js\";\nimport { getEnvApiKey } from \"../env-api-keys.js\";\nimport { supportsXhigh } from \"../models.js\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tCacheRetention,\n\tContext,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tStreamOptions,\n\tUsage,\n} from \"../types.js\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.js\";\nimport { buildCopilotDynamicHeaders, hasCopilotVisionInput } from \"./github-copilot-headers.js\";\nimport { convertResponsesMessages, convertResponsesTools, processResponsesStream } from \"./openai-responses-shared.js\";\nimport { buildBaseOptions, clampReasoning } from \"./simple-options.js\";\n\nconst OPENAI_TOOL_CALL_PROVIDERS = new Set([\"openai\", \"openai-codex\", \"opencode\"]);\n\n/**\n * Resolve cache retention preference.\n * Defaults to \"short\" and uses PI_CACHE_RETENTION for backward compatibility.\n */\nfunction resolveCacheRetention(cacheRetention?: CacheRetention): CacheRetention {\n\tif (cacheRetention) {\n\t\treturn cacheRetention;\n\t}\n\tif (typeof process !== \"undefined\" && process.env.PI_CACHE_RETENTION === \"long\") {\n\t\treturn \"long\";\n\t}\n\treturn \"short\";\n}\n\n/**\n * Get prompt cache retention based on cacheRetention and base URL.\n * Only applies to direct OpenAI API calls (api.openai.com).\n */\nfunction getPromptCacheRetention(baseUrl: string, cacheRetention: CacheRetention): \"24h\" | undefined {\n\tif (cacheRetention !== \"long\") {\n\t\treturn undefined;\n\t}\n\tif (baseUrl.includes(\"api.openai.com\")) {\n\t\treturn \"24h\";\n\t}\n\treturn undefined;\n}\n\n// OpenAI Responses-specific options\nexport interface OpenAIResponsesOptions extends StreamOptions {\n\treasoningEffort?: \"minimal\" | \"low\" | \"medium\" | \"high\" | \"xhigh\";\n\treasoningSummary?: \"auto\" | \"detailed\" | \"concise\" | null;\n\tserviceTier?: ResponseCreateParamsStreaming[\"service_tier\"];\n}\n\n/**\n * Generate function for OpenAI Responses API\n */\nexport const streamOpenAIResponses: StreamFunction<\"openai-responses\", OpenAIResponsesOptions> = (\n\tmodel: Model<\"openai-responses\">,\n\tcontext: Context,\n\toptions?: OpenAIResponsesOptions,\n): AssistantMessageEventStream => {\n\tconst stream = new AssistantMessageEventStream();\n\n\t// Start async processing\n\t(async () => {\n\t\tconst output: AssistantMessage = {\n\t\t\trole: \"assistant\",\n\t\t\tcontent: [],\n\t\t\tapi: model.api as Api,\n\t\t\tprovider: model.provider,\n\t\t\tmodel: model.id,\n\t\t\tusage: {\n\t\t\t\tinput: 0,\n\t\t\t\toutput: 0,\n\t\t\t\tcacheRead: 0,\n\t\t\t\tcacheWrite: 0,\n\t\t\t\ttotalTokens: 0,\n\t\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t\t},\n\t\t\tstopReason: \"stop\",\n\t\t\ttimestamp: Date.now(),\n\t\t};\n\n\t\ttry {\n\t\t\t// Create OpenAI client\n\t\t\tconst apiKey = options?.apiKey || getEnvApiKey(model.provider) || \"\";\n\t\t\tconst client = createClient(model, context, apiKey, options?.headers);\n\t\t\tlet params = buildParams(model, context, options);\n\t\t\tconst nextParams = await options?.onPayload?.(params, model);\n\t\t\tif (nextParams !== undefined) {\n\t\t\t\tparams = nextParams as ResponseCreateParamsStreaming;\n\t\t\t}\n\t\t\tconst openaiStream = await client.responses.create(\n\t\t\t\tparams,\n\t\t\t\toptions?.signal ? { signal: options.signal } : undefined,\n\t\t\t);\n\t\t\tstream.push({ type: \"start\", partial: output });\n\n\t\t\tawait processResponsesStream(openaiStream, output, stream, model, {\n\t\t\t\tserviceTier: options?.serviceTier,\n\t\t\t\tapplyServiceTierPricing,\n\t\t\t});\n\n\t\t\tif (options?.signal?.aborted) {\n\t\t\t\tthrow new Error(\"Request was aborted\");\n\t\t\t}\n\n\t\t\tif (output.stopReason === \"aborted\" || output.stopReason === \"error\") {\n\t\t\t\tthrow new Error(\"An unknown error occurred\");\n\t\t\t}\n\n\t\t\tstream.push({ type: \"done\", reason: output.stopReason, message: output });\n\t\t\tstream.end();\n\t\t} catch (error) {\n\t\t\tfor (const block of output.content) delete (block as { index?: number }).index;\n\t\t\toutput.stopReason = options?.signal?.aborted ? \"aborted\" : \"error\";\n\t\t\toutput.errorMessage = error instanceof Error ? error.message : JSON.stringify(error);\n\t\t\tstream.push({ type: \"error\", reason: output.stopReason, error: output });\n\t\t\tstream.end();\n\t\t}\n\t})();\n\n\treturn stream;\n};\n\nexport const streamSimpleOpenAIResponses: StreamFunction<\"openai-responses\", SimpleStreamOptions> = (\n\tmodel: Model<\"openai-responses\">,\n\tcontext: Context,\n\toptions?: SimpleStreamOptions,\n): AssistantMessageEventStream => {\n\tconst apiKey = options?.apiKey || getEnvApiKey(model.provider);\n\tif (!apiKey) {\n\t\tthrow new Error(`No API key for provider: ${model.provider}`);\n\t}\n\n\tconst base = buildBaseOptions(model, options, apiKey);\n\tconst reasoningEffort = supportsXhigh(model) ? options?.reasoning : clampReasoning(options?.reasoning);\n\n\treturn streamOpenAIResponses(model, context, {\n\t\t...base,\n\t\treasoningEffort,\n\t} satisfies OpenAIResponsesOptions);\n};\n\nfunction createClient(\n\tmodel: Model<\"openai-responses\">,\n\tcontext: Context,\n\tapiKey?: string,\n\toptionsHeaders?: Record<string, string>,\n) {\n\tif (!apiKey) {\n\t\tif (!process.env.OPENAI_API_KEY) {\n\t\t\tthrow new Error(\n\t\t\t\t\"OpenAI API key is required. Set OPENAI_API_KEY environment variable or pass it as an argument.\",\n\t\t\t);\n\t\t}\n\t\tapiKey = process.env.OPENAI_API_KEY;\n\t}\n\n\tconst headers = { ...model.headers };\n\tif (model.provider === \"github-copilot\") {\n\t\tconst hasImages = hasCopilotVisionInput(context.messages);\n\t\tconst copilotHeaders = buildCopilotDynamicHeaders({\n\t\t\tmessages: context.messages,\n\t\t\thasImages,\n\t\t});\n\t\tObject.assign(headers, copilotHeaders);\n\t}\n\n\t// Merge options headers last so they can override defaults\n\tif (optionsHeaders) {\n\t\tObject.assign(headers, optionsHeaders);\n\t}\n\n\treturn new OpenAI({\n\t\tapiKey,\n\t\tbaseURL: model.baseUrl,\n\t\tdangerouslyAllowBrowser: true,\n\t\tdefaultHeaders: headers,\n\t});\n}\n\nfunction buildParams(model: Model<\"openai-responses\">, context: Context, options?: OpenAIResponsesOptions) {\n\tconst messages = convertResponsesMessages(model, context, OPENAI_TOOL_CALL_PROVIDERS);\n\n\tconst cacheRetention = resolveCacheRetention(options?.cacheRetention);\n\tconst params: ResponseCreateParamsStreaming = {\n\t\tmodel: model.id,\n\t\tinput: messages,\n\t\tstream: true,\n\t\tprompt_cache_key: cacheRetention === \"none\" ? undefined : options?.sessionId,\n\t\tprompt_cache_retention: getPromptCacheRetention(model.baseUrl, cacheRetention),\n\t\tstore: false,\n\t};\n\n\tif (options?.maxTokens) {\n\t\tparams.max_output_tokens = options?.maxTokens;\n\t}\n\n\tif (options?.temperature !== undefined) {\n\t\tparams.temperature = options?.temperature;\n\t}\n\n\tif (options?.serviceTier !== undefined) {\n\t\tparams.service_tier = options.serviceTier;\n\t}\n\n\tif (context.tools) {\n\t\tparams.tools = convertResponsesTools(context.tools);\n\t}\n\n\tif (model.reasoning) {\n\t\tif (options?.reasoningEffort || options?.reasoningSummary) {\n\t\t\tparams.reasoning = {\n\t\t\t\teffort: options?.reasoningEffort || \"medium\",\n\t\t\t\tsummary: options?.reasoningSummary || \"auto\",\n\t\t\t};\n\t\t\tparams.include = [\"reasoning.encrypted_content\"];\n\t\t} else if (model.provider !== \"github-copilot\") {\n\t\t\tparams.reasoning = { effort: \"none\" };\n\t\t}\n\t}\n\n\treturn params;\n}\n\nfunction getServiceTierCostMultiplier(serviceTier: ResponseCreateParamsStreaming[\"service_tier\"] | undefined): number {\n\tswitch (serviceTier) {\n\t\tcase \"flex\":\n\t\t\treturn 0.5;\n\t\tcase \"priority\":\n\t\t\treturn 2;\n\t\tdefault:\n\t\t\treturn 1;\n\t}\n}\n\nfunction applyServiceTierPricing(usage: Usage, serviceTier: ResponseCreateParamsStreaming[\"service_tier\"] | undefined) {\n\tconst multiplier = getServiceTierCostMultiplier(serviceTier);\n\tif (multiplier === 1) return;\n\n\tusage.cost.input *= multiplier;\n\tusage.cost.output *= multiplier;\n\tusage.cost.cacheRead *= multiplier;\n\tusage.cost.cacheWrite *= multiplier;\n\tusage.cost.total = usage.cost.input + usage.cost.output + usage.cost.cacheRead + usage.cost.cacheWrite;\n}\n"]}
@@ -0,0 +1,38 @@
1
+ import type { AssistantMessageEvent, Context, Model, SimpleStreamOptions, StreamFunction } from "../types.js";
2
+ import type { BedrockOptions } from "./amazon-bedrock.js";
3
+ import type { AnthropicOptions } from "./anthropic.js";
4
+ import type { AzureOpenAIResponsesOptions } from "./azure-openai-responses.js";
5
+ import type { GoogleOptions } from "./google.js";
6
+ import type { GoogleGeminiCliOptions } from "./google-gemini-cli.js";
7
+ import type { GoogleVertexOptions } from "./google-vertex.js";
8
+ import type { MistralOptions } from "./mistral.js";
9
+ import type { OpenAICodexResponsesOptions } from "./openai-codex-responses.js";
10
+ import type { OpenAICompletionsOptions } from "./openai-completions.js";
11
+ import type { OpenAIResponsesOptions } from "./openai-responses.js";
12
+ interface BedrockProviderModule {
13
+ streamBedrock: (model: Model<"bedrock-converse-stream">, context: Context, options?: BedrockOptions) => AsyncIterable<AssistantMessageEvent>;
14
+ streamSimpleBedrock: (model: Model<"bedrock-converse-stream">, context: Context, options?: SimpleStreamOptions) => AsyncIterable<AssistantMessageEvent>;
15
+ }
16
+ export declare function setBedrockProviderModule(module: BedrockProviderModule): void;
17
+ export declare const streamAnthropic: StreamFunction<"anthropic-messages", AnthropicOptions>;
18
+ export declare const streamSimpleAnthropic: StreamFunction<"anthropic-messages", SimpleStreamOptions>;
19
+ export declare const streamAzureOpenAIResponses: StreamFunction<"azure-openai-responses", AzureOpenAIResponsesOptions>;
20
+ export declare const streamSimpleAzureOpenAIResponses: StreamFunction<"azure-openai-responses", SimpleStreamOptions>;
21
+ export declare const streamGoogle: StreamFunction<"google-generative-ai", GoogleOptions>;
22
+ export declare const streamSimpleGoogle: StreamFunction<"google-generative-ai", SimpleStreamOptions>;
23
+ export declare const streamGoogleGeminiCli: StreamFunction<"google-gemini-cli", GoogleGeminiCliOptions>;
24
+ export declare const streamSimpleGoogleGeminiCli: StreamFunction<"google-gemini-cli", SimpleStreamOptions>;
25
+ export declare const streamGoogleVertex: StreamFunction<"google-vertex", GoogleVertexOptions>;
26
+ export declare const streamSimpleGoogleVertex: StreamFunction<"google-vertex", SimpleStreamOptions>;
27
+ export declare const streamMistral: StreamFunction<"mistral-conversations", MistralOptions>;
28
+ export declare const streamSimpleMistral: StreamFunction<"mistral-conversations", SimpleStreamOptions>;
29
+ export declare const streamOpenAICodexResponses: StreamFunction<"openai-codex-responses", OpenAICodexResponsesOptions>;
30
+ export declare const streamSimpleOpenAICodexResponses: StreamFunction<"openai-codex-responses", SimpleStreamOptions>;
31
+ export declare const streamOpenAICompletions: StreamFunction<"openai-completions", OpenAICompletionsOptions>;
32
+ export declare const streamSimpleOpenAICompletions: StreamFunction<"openai-completions", SimpleStreamOptions>;
33
+ export declare const streamOpenAIResponses: StreamFunction<"openai-responses", OpenAIResponsesOptions>;
34
+ export declare const streamSimpleOpenAIResponses: StreamFunction<"openai-responses", SimpleStreamOptions>;
35
+ export declare function registerBuiltInApiProviders(): void;
36
+ export declare function resetApiProviders(): void;
37
+ export {};
38
+ //# sourceMappingURL=register-builtins.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-builtins.d.ts","sourceR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,eAAO,MAAM,0BAA0B,uEAA2D,CAAC;AACnG,eAAO,MAAM,gCAAgC,+DAAiE,CAAC;AAC/G,eAAO,MAAM,YAAY,uDAA6C,CAAC;AACvE,eAAO,MAAM,kBAAkB,6DAAmD,CAAC;AACnF,eAAO,MAAM,qBAAqB,6DAAsD,CAAC;AACzF,eAAO,MAAM,2BAA2B,0DAA4D,CAAC;AACrG,eAAO,MAAM,kBAAkB,sDAAmD,CAAC;AACnF,eAAO,MAAM,wBAAwB,sDAAyD,CAAC;AAC/F,eAAO,MAAM,aAAa,yDAA8C,CAAC;AACzE,eAAO,MAAM,mBAAmB,8DAAoD,CAAC;AACrF,eAAO,MAAM,0BAA0B,uEAA2D,CAAC;AACnG,eAAO,MAAM,gCAAgC,+DAAiE,CAAC;AAC/G,eAAO,MAAM,uBAAuB,gEAAwD,CAAC;AAC7F,eAAO,MAAM,6BAA6B,2DAA8D,CAAC;AACzG,eAAO,MAAM,qBAAqB,4DAAsD,CAAC;AACzF,eAAO,MAAM,2BAA2B,yDAA4D,CAAC;AAIrG,wBAAgB,2BAA2B,IAAI,IAAI,CA4DlD;AAED,wBAAgB,iBAAiB,IAAI,IAAI,CAGxC","sourcesContent":["import { clearApiProviders, registerApiProvider } from \"../api-registry.js\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tAssistantMessageEvent,\n\tContext,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tStreamOptions,\n} from \"../types.js\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.js\";\nimport type { BedrockOptions } from \"./amazon-bedrock.js\";\nimport type { AnthropicOptions } from \"./anthropic.js\";\nimport type { AzureOpenAIResponsesOptions } from \"./azure-openai-responses.js\";\nimport type { GoogleOptions } from \"./google.js\";\nimport type { GoogleGeminiCliOptions } from \"./google-gemini-cli.js\";\nimport type { GoogleVertexOptions } from \"./google-vertex.js\";\nimport type { MistralOptions } from \"./mistral.js\";\nimport type { OpenAICodexResponsesOptions } from \"./openai-codex-responses.js\";\nimport type { OpenAICompletionsOptions } from \"./openai-completions.js\";\nimport type { OpenAIResponsesOptions } from \"./openai-responses.js\";\n\ninterface LazyProviderModule<\n\tTApi extends Api,\n\tTOptions extends StreamOptions,\n\tTSimpleOptions extends SimpleStreamOptions,\n> {\n\tstream: (model: Model<TApi>, context: Context, options?: TOptions) => AsyncIterable<AssistantMessageEvent>;\n\tstreamSimple: (\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: TSimpleOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n}\n\ninterface AnthropicProviderModule {\n\tstreamAnthropic: StreamFunction<\"anthropic-messages\", AnthropicOptions>;\n\tstreamSimpleAnthropic: StreamFunction<\"anthropic-messages\", SimpleStreamOptions>;\n}\n\ninterface AzureOpenAIResponsesProviderModule {\n\tstreamAzureOpenAIResponses: StreamFunction<\"azure-openai-responses\", AzureOpenAIResponsesOptions>;\n\tstreamSimpleAzureOpenAIResponses: StreamFunction<\"azure-openai-responses\", SimpleStreamOptions>;\n}\n\ninterface GoogleProviderModule {\n\tstreamGoogle: StreamFunction<\"google-generative-ai\", GoogleOptions>;\n\tstreamSimpleGoogle: StreamFunction<\"google-generative-ai\", SimpleStreamOptions>;\n}\n\ninterface GoogleGeminiCliProviderModule {\n\tstreamGoogleGeminiCli: StreamFunction<\"google-gemini-cli\", GoogleGeminiCliOptions>;\n\tstreamSimpleGoogleGeminiCli: StreamFunction<\"google-gemini-cli\", SimpleStreamOptions>;\n}\n\ninterface GoogleVertexProviderModule {\n\tstreamGoogleVertex: StreamFunction<\"google-vertex\", GoogleVertexOptions>;\n\tstreamSimpleGoogleVertex: StreamFunction<\"google-vertex\", SimpleStreamOptions>;\n}\n\ninterface MistralProviderModule {\n\tstreamMistral: StreamFunction<\"mistral-conversations\", MistralOptions>;\n\tstreamSimpleMistral: StreamFunction<\"mistral-conversations\", SimpleStreamOptions>;\n}\n\ninterface OpenAICodexResponsesProviderModule {\n\tstreamOpenAICodexResponses: StreamFunction<\"openai-codex-responses\", OpenAICodexResponsesOptions>;\n\tstreamSimpleOpenAICodexResponses: StreamFunction<\"openai-codex-responses\", SimpleStreamOptions>;\n}\n\ninterface OpenAICompletionsProviderModule {\n\tstreamOpenAICompletions: StreamFunction<\"openai-completions\", OpenAICompletionsOptions>;\n\tstreamSimpleOpenAICompletions: StreamFunction<\"openai-completions\", SimpleStreamOptions>;\n}\n\ninterface OpenAIResponsesProviderModule {\n\tstreamOpenAIResponses: StreamFunction<\"openai-responses\", OpenAIResponsesOptions>;\n\tstreamSimpleOpenAIResponses: StreamFunction<\"openai-responses\", SimpleStreamOptions>;\n}\n\ninterface BedrockProviderModule {\n\tstreamBedrock: (\n\t\tmodel: Model<\"bedrock-converse-stream\">,\n\t\tcontext: Context,\n\t\toptions?: BedrockOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n\tstreamSimpleBedrock: (\n\t\tmodel: Model<\"bedrock-converse-stream\">,\n\t\tcontext: Context,\n\t\toptions?: SimpleStreamOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n}\n\nconst importNodeOnlyProvider = (specifier: string): Promise<unknown> => import(specifier);\n\nlet anthropicProviderModulePromise:\n\t| Promise<LazyProviderModule<\"anthropic-messages\", AnthropicOptions, SimpleStreamOptions>>\n\t| undefined;\nlet azureOpenAIResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"azure-openai-responses\", AzureOpenAIResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-generative-ai\", GoogleOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleGeminiCliProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-gemini-cli\", GoogleGeminiCliOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleVertexProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-vertex\", GoogleVertexOptions, SimpleStreamOptions>>\n\t| undefined;\nlet mistralProviderModulePromise:\n\t| Promise<LazyProviderModule<\"mistral-conversations\", MistralOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAICodexResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-codex-responses\", OpenAICodexResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAICompletionsProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-completions\", OpenAICompletionsOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAIResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-responses\", OpenAIResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet bedrockProviderModuleOverride:\n\t| LazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>\n\t| undefined;\nlet bedrockProviderModulePromise:\n\t| Promise<LazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>>\n\t| undefined;\n\nexport function setBedrockProviderModule(module: BedrockProviderModule): void {\n\tbedrockProviderModuleOverride = {\n\t\tstream: module.streamBedrock,\n\t\tstreamSimple: module.streamSimpleBedrock,\n\t};\n}\n\nfunction forwardStream(target: AssistantMessageEventStream, source: AsyncIterable<AssistantMessageEvent>): void {\n\t(async () => {\n\t\tfor await (const event of source) {\n\t\t\ttarget.push(event);\n\t\t}\n\t\ttarget.end();\n\t})();\n}\n\nfunction createLazyLoadErrorMessage<TApi extends Api>(model: Model<TApi>, error: unknown): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\tusage: {\n\t\t\tinput: 0,\n\t\t\toutput: 0,\n\t\t\tcacheRead: 0,\n\t\t\tcacheWrite: 0,\n\t\t\ttotalTokens: 0,\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t},\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createLazyStream<TApi extends Api, TOptions extends StreamOptions, TSimpleOptions extends SimpleStreamOptions>(\n\tloadModule: () => Promise<LazyProviderModule<TApi, TOptions, TSimpleOptions>>,\n): StreamFunction<TApi, TOptions> {\n\treturn (model, context, options) => {\n\t\tconst outer = new AssistantMessageEventStream();\n\n\t\tloadModule()\n\t\t\t.then((module) => {\n\t\t\t\tconst inner = module.stream(model, context, options);\n\t\t\t\tforwardStream(outer, inner);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconst message = createLazyLoadErrorMessage(model, error);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t});\n\n\t\treturn outer;\n\t};\n}\n\nfunction createLazySimpleStream<\n\tTApi extends Api,\n\tTOptions extends StreamOptions,\n\tTSimpleOptions extends SimpleStreamOptions,\n>(loadModule: () => Promise<LazyProviderModule<TApi, TOptions, TSimpleOptions>>): StreamFunction<TApi, TSimpleOptions> {\n\treturn (model, context, options) => {\n\t\tconst outer = new AssistantMessageEventStream();\n\n\t\tloadModule()\n\t\t\t.then((module) => {\n\t\t\t\tconst inner = module.streamSimple(model, context, options);\n\t\t\t\tforwardStream(outer, inner);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconst message = createLazyLoadErrorMessage(model, error);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t});\n\n\t\treturn outer;\n\t};\n}\n\nfunction loadAnthropicProviderModule(): Promise<\n\tLazyProviderModule<\"anthropic-messages\", AnthropicOptions, SimpleStreamOptions>\n> {\n\tanthropicProviderModulePromise ||= import(\"./anthropic.js\").then((module) => {\n\t\tconst provider = module as AnthropicProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamAnthropic,\n\t\t\tstreamSimple: provider.streamSimpleAnthropic,\n\t\t};\n\t});\n\treturn anthropicProviderModulePromise;\n}\n\nfunction loadAzureOpenAIResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"azure-openai-responses\", AzureOpenAIResponsesOptions, SimpleStreamOptions>\n> {\n\tazureOpenAIResponsesProviderModulePromise ||= import(\"./azure-openai-responses.js\").then((module) => {\n\t\tconst provider = module as AzureOpenAIResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamAzureOpenAIResponses,\n\t\t\tstreamSimple: provider.streamSimpleAzureOpenAIResponses,\n\t\t};\n\t});\n\treturn azureOpenAIResponsesProviderModulePromise;\n}\n\nfunction loadGoogleProviderModule(): Promise<\n\tLazyProviderModule<\"google-generative-ai\", GoogleOptions, SimpleStreamOptions>\n> {\n\tgoogleProviderModulePromise ||= import(\"./google.js\").then((module) => {\n\t\tconst provider = module as GoogleProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogle,\n\t\t\tstreamSimple: provider.streamSimpleGoogle,\n\t\t};\n\t});\n\treturn googleProviderModulePromise;\n}\n\nfunction loadGoogleGeminiCliProviderModule(): Promise<\n\tLazyProviderModule<\"google-gemini-cli\", GoogleGeminiCliOptions, SimpleStreamOptions>\n> {\n\tgoogleGeminiCliProviderModulePromise ||= import(\"./google-gemini-cli.js\").then((module) => {\n\t\tconst provider = module as GoogleGeminiCliProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogleGeminiCli,\n\t\t\tstreamSimple: provider.streamSimpleGoogleGeminiCli,\n\t\t};\n\t});\n\treturn googleGeminiCliProviderModulePromise;\n}\n\nfunction loadGoogleVertexProviderModule(): Promise<\n\tLazyProviderModule<\"google-vertex\", GoogleVertexOptions, SimpleStreamOptions>\n> {\n\tgoogleVertexProviderModulePromise ||= import(\"./google-vertex.js\").then((module) => {\n\t\tconst provider = module as GoogleVertexProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogleVertex,\n\t\t\tstreamSimple: provider.streamSimpleGoogleVertex,\n\t\t};\n\t});\n\treturn googleVertexProviderModulePromise;\n}\n\nfunction loadMistralProviderModule(): Promise<\n\tLazyProviderModule<\"mistral-conversations\", MistralOptions, SimpleStreamOptions>\n> {\n\tmistralProviderModulePromise ||= import(\"./mistral.js\").then((module) => {\n\t\tconst provider = module as MistralProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamMistral,\n\t\t\tstreamSimple: provider.streamSimpleMistral,\n\t\t};\n\t});\n\treturn mistralProviderModulePromise;\n}\n\nfunction loadOpenAICodexResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"openai-codex-responses\", OpenAICodexResponsesOptions, SimpleStreamOptions>\n> {\n\topenAICodexResponsesProviderModulePromise ||= import(\"./openai-codex-responses.js\").then((module) => {\n\t\tconst provider = module as OpenAICodexResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAICodexResponses,\n\t\t\tstreamSimple: provider.streamSimpleOpenAICodexResponses,\n\t\t};\n\t});\n\treturn openAICodexResponsesProviderModulePromise;\n}\n\nfunction loadOpenAICompletionsProviderModule(): Promise<\n\tLazyProviderModule<\"openai-completions\", OpenAICompletionsOptions, SimpleStreamOptions>\n> {\n\topenAICompletionsProviderModulePromise ||= import(\"./openai-completions.js\").then((module) => {\n\t\tconst provider = module as OpenAICompletionsProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAICompletions,\n\t\t\tstreamSimple: provider.streamSimpleOpenAICompletions,\n\t\t};\n\t});\n\treturn openAICompletionsProviderModulePromise;\n}\n\nfunction loadOpenAIResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"openai-responses\", OpenAIResponsesOptions, SimpleStreamOptions>\n> {\n\topenAIResponsesProviderModulePromise ||= import(\"./openai-responses.js\").then((module) => {\n\t\tconst provider = module as OpenAIResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAIResponses,\n\t\t\tstreamSimple: provider.streamSimpleOpenAIResponses,\n\t\t};\n\t});\n\treturn openAIResponsesProviderModulePromise;\n}\n\nfunction loadBedrockProviderModule(): Promise<\n\tLazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>\n> {\n\tif (bedrockProviderModuleOverride) {\n\t\treturn Promise.resolve(bedrockProviderModuleOverride);\n\t}\n\tbedrockProviderModulePromise ||= importNodeOnlyProvider(\"./amazon-bedrock.js\").then((module) => {\n\t\tconst provider = module as BedrockProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamBedrock,\n\t\t\tstreamSimple: provider.streamSimpleBedrock,\n\t\t};\n\t});\n\treturn bedrockProviderModulePromise;\n}\n\nexport const streamAnthropic = createLazyStream(loadAnthropicProviderModule);\nexport const streamSimpleAnthropic = createLazySimpleStream(loadAnthropicProviderModule);\nexport const streamAzureOpenAIResponses = createLazyStream(loadAzureOpenAIResponsesProviderModule);\nexport const streamSimpleAzureOpenAIResponses = createLazySimpleStream(loadAzureOpenAIResponsesProviderModule);\nexport const streamGoogle = createLazyStream(loadGoogleProviderModule);\nexport const streamSimpleGoogle = createLazySimpleStream(loadGoogleProviderModule);\nexport const streamGoogleGeminiCli = createLazyStream(loadGoogleGeminiCliProviderModule);\nexport const streamSimpleGoogleGeminiCli = createLazySimpleStream(loadGoogleGeminiCliProviderModule);\nexport const streamGoogleVertex = createLazyStream(loadGoogleVertexProviderModule);\nexport const streamSimpleGoogleVertex = createLazySimpleStream(loadGoogleVertexProviderModule);\nexport const streamMistral = createLazyStream(loadMistralProviderModule);\nexport const streamSimpleMistral = createLazySimpleStream(loadMistralProviderModule);\nexport const streamOpenAICodexResponses = createLazyStream(loadOpenAICodexResponsesProviderModule);\nexport const streamSimpleOpenAICodexResponses = createLazySimpleStream(loadOpenAICodexResponsesProviderModule);\nexport const streamOpenAICompletions = createLazyStream(loadOpenAICompletionsProviderModule);\nexport const streamSimpleOpenAICompletions = createLazySimpleStream(loadOpenAICompletionsProviderModule);\nexport const streamOpenAIResponses = createLazyStream(loadOpenAIResponsesProviderModule);\nexport const streamSimpleOpenAIResponses = createLazySimpleStream(loadOpenAIResponsesProviderModule);\nconst streamBedrockLazy = createLazyStream(loadBedrockProviderModule);\nconst streamSimpleBedrockLazy = createLazySimpleStream(loadBedrockProviderModule);\n\nexport function registerBuiltInApiProviders(): void {\n\tregisterApiProvider({\n\t\tapi: \"anthropic-messages\",\n\t\tstream: streamAnthropic,\n\t\tstreamSimple: streamSimpleAnthropic,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-completions\",\n\t\tstream: streamOpenAICompletions,\n\t\tstreamSimple: streamSimpleOpenAICompletions,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"mistral-conversations\",\n\t\tstream: streamMistral,\n\t\tstreamSimple: streamSimpleMistral,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-responses\",\n\t\tstream: streamOpenAIResponses,\n\t\tstreamSimple: streamSimpleOpenAIResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"azure-openai-responses\",\n\t\tstream: streamAzureOpenAIResponses,\n\t\tstreamSimple: streamSimpleAzureOpenAIResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-codex-responses\",\n\t\tstream: streamOpenAICodexResponses,\n\t\tstreamSimple: streamSimpleOpenAICodexResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-generative-ai\",\n\t\tstream: streamGoogle,\n\t\tstreamSimple: streamSimpleGoogle,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-gemini-cli\",\n\t\tstream: streamGoogleGeminiCli,\n\t\tstreamSimple: streamSimpleGoogleGeminiCli,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-vertex\",\n\t\tstream: streamGoogleVertex,\n\t\tstreamSimple: streamSimpleGoogleVertex,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"bedrock-converse-stream\",\n\t\tstream: streamBedrockLazy,\n\t\tstreamSimple: streamSimpleBedrockLazy,\n\t});\n}\n\nexport function resetApiProviders(): void {\n\tclearApiProviders();\n\tregisterBuiltInApiProviders();\n}\n\nregisterBuiltInApiProviders();\n"]}
@@ -0,0 +1,261 @@
1
+ import { clearApiProviders, registerApiProvider } from "../api-registry.js";
2
+ import { AssistantMessageEventStream } from "../utils/event-stream.js";
3
+ const importNodeOnlyProvider = (specifier) => import(specifier);
4
+ let anthropicProviderModulePromise;
5
+ let azureOpenAIResponsesProviderModulePromise;
6
+ let googleProviderModulePromise;
7
+ let googleGeminiCliProviderModulePromise;
8
+ let googleVertexProviderModulePromise;
9
+ let mistralProviderModulePromise;
10
+ let openAICodexResponsesProviderModulePromise;
11
+ let openAICompletionsProviderModulePromise;
12
+ let openAIResponsesProviderModulePromise;
13
+ let bedrockProviderModuleOverride;
14
+ let bedrockProviderModulePromise;
15
+ export function setBedrockProviderModule(module) {
16
+ bedrockProviderModuleOverride = {
17
+ stream: module.streamBedrock,
18
+ streamSimple: module.streamSimpleBedrock,
19
+ };
20
+ }
21
+ function forwardStream(target, source) {
22
+ (async () => {
23
+ for await (const event of source) {
24
+ target.push(event);
25
+ }
26
+ target.end();
27
+ })();
28
+ }
29
+ function createLazyLoadErrorMessage(model, error) {
30
+ return {
31
+ role: "assistant",
32
+ content: [],
33
+ api: model.api,
34
+ provider: model.provider,
35
+ model: model.id,
36
+ usage: {
37
+ input: 0,
38
+ output: 0,
39
+ cacheRead: 0,
40
+ cacheWrite: 0,
41
+ totalTokens: 0,
42
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
43
+ },
44
+ stopReason: "error",
45
+ errorMessage: error instanceof Error ? error.message : String(error),
46
+ timestamp: Date.now(),
47
+ };
48
+ }
49
+ function createLazyStream(loadModule) {
50
+ return (model, context, options) => {
51
+ const outer = new AssistantMessageEventStream();
52
+ loadModule()
53
+ .then((module) => {
54
+ const inner = module.stream(model, context, options);
55
+ forwardStream(outer, inner);
56
+ })
57
+ .catch((error) => {
58
+ const message = createLazyLoadErrorMessage(model, error);
59
+ outer.push({ type: "error", reason: "error", error: message });
60
+ outer.end(message);
61
+ });
62
+ return outer;
63
+ };
64
+ }
65
+ function createLazySimpleStream(loadModule) {
66
+ return (model, context, options) => {
67
+ const outer = new AssistantMessageEventStream();
68
+ loadModule()
69
+ .then((module) => {
70
+ const inner = module.streamSimple(model, context, options);
71
+ forwardStream(outer, inner);
72
+ })
73
+ .catch((error) => {
74
+ const message = createLazyLoadErrorMessage(model, error);
75
+ outer.push({ type: "error", reason: "error", error: message });
76
+ outer.end(message);
77
+ });
78
+ return outer;
79
+ };
80
+ }
81
+ function loadAnthropicProviderModule() {
82
+ anthropicProviderModulePromise ||= import("./anthropic.js").then((module) => {
83
+ const provider = module;
84
+ return {
85
+ stream: provider.streamAnthropic,
86
+ streamSimple: provider.streamSimpleAnthropic,
87
+ };
88
+ });
89
+ return anthropicProviderModulePromise;
90
+ }
91
+ function loadAzureOpenAIResponsesProviderModule() {
92
+ azureOpenAIResponsesProviderModulePromise ||= import("./azure-openai-responses.js").then((module) => {
93
+ const provider = module;
94
+ return {
95
+ stream: provider.streamAzureOpenAIResponses,
96
+ streamSimple: provider.streamSimpleAzureOpenAIResponses,
97
+ };
98
+ });
99
+ return azureOpenAIResponsesProviderModulePromise;
100
+ }
101
+ function loadGoogleProviderModule() {
102
+ googleProviderModulePromise ||= import("./google.js").then((module) => {
103
+ const provider = module;
104
+ return {
105
+ stream: provider.streamGoogle,
106
+ streamSimple: provider.streamSimpleGoogle,
107
+ };
108
+ });
109
+ return googleProviderModulePromise;
110
+ }
111
+ function loadGoogleGeminiCliProviderModule() {
112
+ googleGeminiCliProviderModulePromise ||= import("./google-gemini-cli.js").then((module) => {
113
+ const provider = module;
114
+ return {
115
+ stream: provider.streamGoogleGeminiCli,
116
+ streamSimple: provider.streamSimpleGoogleGeminiCli,
117
+ };
118
+ });
119
+ return googleGeminiCliProviderModulePromise;
120
+ }
121
+ function loadGoogleVertexProviderModule() {
122
+ googleVertexProviderModulePromise ||= import("./google-vertex.js").then((module) => {
123
+ const provider = module;
124
+ return {
125
+ stream: provider.streamGoogleVertex,
126
+ streamSimple: provider.streamSimpleGoogleVertex,
127
+ };
128
+ });
129
+ return googleVertexProviderModulePromise;
130
+ }
131
+ function loadMistralProviderModule() {
132
+ mistralProviderModulePromise ||= import("./mistral.js").then((module) => {
133
+ const provider = module;
134
+ return {
135
+ stream: provider.streamMistral,
136
+ streamSimple: provider.streamSimpleMistral,
137
+ };
138
+ });
139
+ return mistralProviderModulePromise;
140
+ }
141
+ function loadOpenAICodexResponsesProviderModule() {
142
+ openAICodexResponsesProviderModulePromise ||= import("./openai-codex-responses.js").then((module) => {
143
+ const provider = module;
144
+ return {
145
+ stream: provider.streamOpenAICodexResponses,
146
+ streamSimple: provider.streamSimpleOpenAICodexResponses,
147
+ };
148
+ });
149
+ return openAICodexResponsesProviderModulePromise;
150
+ }
151
+ function loadOpenAICompletionsProviderModule() {
152
+ openAICompletionsProviderModulePromise ||= import("./openai-completions.js").then((module) => {
153
+ const provider = module;
154
+ return {
155
+ stream: provider.streamOpenAICompletions,
156
+ streamSimple: provider.streamSimpleOpenAICompletions,
157
+ };
158
+ });
159
+ return openAICompletionsProviderModulePromise;
160
+ }
161
+ function loadOpenAIResponsesProviderModule() {
162
+ openAIResponsesProviderModulePromise ||= import("./openai-responses.js").then((module) => {
163
+ const provider = module;
164
+ return {
165
+ stream: provider.streamOpenAIResponses,
166
+ streamSimple: provider.streamSimpleOpenAIResponses,
167
+ };
168
+ });
169
+ return openAIResponsesProviderModulePromise;
170
+ }
171
+ function loadBedrockProviderModule() {
172
+ if (bedrockProviderModuleOverride) {
173
+ return Promise.resolve(bedrockProviderModuleOverride);
174
+ }
175
+ bedrockProviderModulePromise ||= importNodeOnlyProvider("./amazon-bedrock.js").then((module) => {
176
+ const provider = module;
177
+ return {
178
+ stream: provider.streamBedrock,
179
+ streamSimple: provider.streamSimpleBedrock,
180
+ };
181
+ });
182
+ return bedrockProviderModulePromise;
183
+ }
184
+ export const streamAnthropic = createLazyStream(loadAnthropicProviderModule);
185
+ export const streamSimpleAnthropic = createLazySimpleStream(loadAnthropicProviderModule);
186
+ export const streamAzureOpenAIResponses = createLazyStream(loadAzureOpenAIResponsesProviderModule);
187
+ export const streamSimpleAzureOpenAIResponses = createLazySimpleStream(loadAzureOpenAIResponsesProviderModule);
188
+ export const streamGoogle = createLazyStream(loadGoogleProviderModule);
189
+ export const streamSimpleGoogle = createLazySimpleStream(loadGoogleProviderModule);
190
+ export const streamGoogleGeminiCli = createLazyStream(loadGoogleGeminiCliProviderModule);
191
+ export const streamSimpleGoogleGeminiCli = createLazySimpleStream(loadGoogleGeminiCliProviderModule);
192
+ export const streamGoogleVertex = createLazyStream(loadGoogleVertexProviderModule);
193
+ export const streamSimpleGoogleVertex = createLazySimpleStream(loadGoogleVertexProviderModule);
194
+ export const streamMistral = createLazyStream(loadMistralProviderModule);
195
+ export const streamSimpleMistral = createLazySimpleStream(loadMistralProviderModule);
196
+ export const streamOpenAICodexResponses = createLazyStream(loadOpenAICodexResponsesProviderModule);
197
+ export const streamSimpleOpenAICodexResponses = createLazySimpleStream(loadOpenAICodexResponsesProviderModule);
198
+ export const streamOpenAICompletions = createLazyStream(loadOpenAICompletionsProviderModule);
199
+ export const streamSimpleOpenAICompletions = createLazySimpleStream(loadOpenAICompletionsProviderModule);
200
+ export const streamOpenAIResponses = createLazyStream(loadOpenAIResponsesProviderModule);
201
+ export const streamSimpleOpenAIResponses = createLazySimpleStream(loadOpenAIResponsesProviderModule);
202
+ const streamBedrockLazy = createLazyStream(loadBedrockProviderModule);
203
+ const streamSimpleBedrockLazy = createLazySimpleStream(loadBedrockProviderModule);
204
+ export function registerBuiltInApiProviders() {
205
+ registerApiProvider({
206
+ api: "anthropic-messages",
207
+ stream: streamAnthropic,
208
+ streamSimple: streamSimpleAnthropic,
209
+ });
210
+ registerApiProvider({
211
+ api: "openai-completions",
212
+ stream: streamOpenAICompletions,
213
+ streamSimple: streamSimpleOpenAICompletions,
214
+ });
215
+ registerApiProvider({
216
+ api: "mistral-conversations",
217
+ stream: streamMistral,
218
+ streamSimple: streamSimpleMistral,
219
+ });
220
+ registerApiProvider({
221
+ api: "openai-responses",
222
+ stream: streamOpenAIResponses,
223
+ streamSimple: streamSimpleOpenAIResponses,
224
+ });
225
+ registerApiProvider({
226
+ api: "azure-openai-responses",
227
+ stream: streamAzureOpenAIResponses,
228
+ streamSimple: streamSimpleAzureOpenAIResponses,
229
+ });
230
+ registerApiProvider({
231
+ api: "openai-codex-responses",
232
+ stream: streamOpenAICodexResponses,
233
+ streamSimple: streamSimpleOpenAICodexResponses,
234
+ });
235
+ registerApiProvider({
236
+ api: "google-generative-ai",
237
+ stream: streamGoogle,
238
+ streamSimple: streamSimpleGoogle,
239
+ });
240
+ registerApiProvider({
241
+ api: "google-gemini-cli",
242
+ stream: streamGoogleGeminiCli,
243
+ streamSimple: streamSimpleGoogleGeminiCli,
244
+ });
245
+ registerApiProvider({
246
+ api: "google-vertex",
247
+ stream: streamGoogleVertex,
248
+ streamSimple: streamSimpleGoogleVertex,
249
+ });
250
+ registerApiProvider({
251
+ api: "bedrock-converse-stream",
252
+ stream: streamBedrockLazy,
253
+ streamSimple: streamSimpleBedrockLazy,
254
+ });
255
+ }
256
+ export function resetApiProviders() {
257
+ clearApiProviders();
258
+ registerBuiltInApiProviders();
259
+ }
260
+ registerBuiltInApiProviders();
261
+ //# sourceMappingURL=register-builtins.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register-builtins.js","sourceRoot":"","sources":["../../src/providers/register-builtins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAW5E,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAmFvE,MAAM,sBAAsB,GAAG,CAAC,SAAiB,EAAoB,EAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;AAE1F,IAAI,8BAEQ,CAAC;AACb,IAAI,yCAEQ,CAAC;AACb,IAAI,2BAEQ,CAAC;AACb,IAAI,oCAEQ,CAAC;AACb,IAAI,iCAEQ,CAAC;AACb,IAAI,4BAEQ,CAAC;AACb,IAA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mBAAmB,CAAC;QACnB,GAAG,EAAE,yBAAyB;QAC9B,MAAM,EAAE,iBAAiB;QACzB,YAAY,EAAE,uBAAuB;KACrC,CAAC,CAAC;AAAA,CACH;AAED,MAAM,UAAU,iBAAiB,GAAS;IACzC,iBAAiB,EAAE,CAAC;IACpB,2BAA2B,EAAE,CAAC;AAAA,CAC9B;AAED,2BAA2B,EAAE,CAAC","sourcesContent":["import { clearApiProviders, registerApiProvider } from \"../api-registry.js\";\nimport type {\n\tApi,\n\tAssistantMessage,\n\tAssistantMessageEvent,\n\tContext,\n\tModel,\n\tSimpleStreamOptions,\n\tStreamFunction,\n\tStreamOptions,\n} from \"../types.js\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.js\";\nimport type { BedrockOptions } from \"./amazon-bedrock.js\";\nimport type { AnthropicOptions } from \"./anthropic.js\";\nimport type { AzureOpenAIResponsesOptions } from \"./azure-openai-responses.js\";\nimport type { GoogleOptions } from \"./google.js\";\nimport type { GoogleGeminiCliOptions } from \"./google-gemini-cli.js\";\nimport type { GoogleVertexOptions } from \"./google-vertex.js\";\nimport type { MistralOptions } from \"./mistral.js\";\nimport type { OpenAICodexResponsesOptions } from \"./openai-codex-responses.js\";\nimport type { OpenAICompletionsOptions } from \"./openai-completions.js\";\nimport type { OpenAIResponsesOptions } from \"./openai-responses.js\";\n\ninterface LazyProviderModule<\n\tTApi extends Api,\n\tTOptions extends StreamOptions,\n\tTSimpleOptions extends SimpleStreamOptions,\n> {\n\tstream: (model: Model<TApi>, context: Context, options?: TOptions) => AsyncIterable<AssistantMessageEvent>;\n\tstreamSimple: (\n\t\tmodel: Model<TApi>,\n\t\tcontext: Context,\n\t\toptions?: TSimpleOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n}\n\ninterface AnthropicProviderModule {\n\tstreamAnthropic: StreamFunction<\"anthropic-messages\", AnthropicOptions>;\n\tstreamSimpleAnthropic: StreamFunction<\"anthropic-messages\", SimpleStreamOptions>;\n}\n\ninterface AzureOpenAIResponsesProviderModule {\n\tstreamAzureOpenAIResponses: StreamFunction<\"azure-openai-responses\", AzureOpenAIResponsesOptions>;\n\tstreamSimpleAzureOpenAIResponses: StreamFunction<\"azure-openai-responses\", SimpleStreamOptions>;\n}\n\ninterface GoogleProviderModule {\n\tstreamGoogle: StreamFunction<\"google-generative-ai\", GoogleOptions>;\n\tstreamSimpleGoogle: StreamFunction<\"google-generative-ai\", SimpleStreamOptions>;\n}\n\ninterface GoogleGeminiCliProviderModule {\n\tstreamGoogleGeminiCli: StreamFunction<\"google-gemini-cli\", GoogleGeminiCliOptions>;\n\tstreamSimpleGoogleGeminiCli: StreamFunction<\"google-gemini-cli\", SimpleStreamOptions>;\n}\n\ninterface GoogleVertexProviderModule {\n\tstreamGoogleVertex: StreamFunction<\"google-vertex\", GoogleVertexOptions>;\n\tstreamSimpleGoogleVertex: StreamFunction<\"google-vertex\", SimpleStreamOptions>;\n}\n\ninterface MistralProviderModule {\n\tstreamMistral: StreamFunction<\"mistral-conversations\", MistralOptions>;\n\tstreamSimpleMistral: StreamFunction<\"mistral-conversations\", SimpleStreamOptions>;\n}\n\ninterface OpenAICodexResponsesProviderModule {\n\tstreamOpenAICodexResponses: StreamFunction<\"openai-codex-responses\", OpenAICodexResponsesOptions>;\n\tstreamSimpleOpenAICodexResponses: StreamFunction<\"openai-codex-responses\", SimpleStreamOptions>;\n}\n\ninterface OpenAICompletionsProviderModule {\n\tstreamOpenAICompletions: StreamFunction<\"openai-completions\", OpenAICompletionsOptions>;\n\tstreamSimpleOpenAICompletions: StreamFunction<\"openai-completions\", SimpleStreamOptions>;\n}\n\ninterface OpenAIResponsesProviderModule {\n\tstreamOpenAIResponses: StreamFunction<\"openai-responses\", OpenAIResponsesOptions>;\n\tstreamSimpleOpenAIResponses: StreamFunction<\"openai-responses\", SimpleStreamOptions>;\n}\n\ninterface BedrockProviderModule {\n\tstreamBedrock: (\n\t\tmodel: Model<\"bedrock-converse-stream\">,\n\t\tcontext: Context,\n\t\toptions?: BedrockOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n\tstreamSimpleBedrock: (\n\t\tmodel: Model<\"bedrock-converse-stream\">,\n\t\tcontext: Context,\n\t\toptions?: SimpleStreamOptions,\n\t) => AsyncIterable<AssistantMessageEvent>;\n}\n\nconst importNodeOnlyProvider = (specifier: string): Promise<unknown> => import(specifier);\n\nlet anthropicProviderModulePromise:\n\t| Promise<LazyProviderModule<\"anthropic-messages\", AnthropicOptions, SimpleStreamOptions>>\n\t| undefined;\nlet azureOpenAIResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"azure-openai-responses\", AzureOpenAIResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-generative-ai\", GoogleOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleGeminiCliProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-gemini-cli\", GoogleGeminiCliOptions, SimpleStreamOptions>>\n\t| undefined;\nlet googleVertexProviderModulePromise:\n\t| Promise<LazyProviderModule<\"google-vertex\", GoogleVertexOptions, SimpleStreamOptions>>\n\t| undefined;\nlet mistralProviderModulePromise:\n\t| Promise<LazyProviderModule<\"mistral-conversations\", MistralOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAICodexResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-codex-responses\", OpenAICodexResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAICompletionsProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-completions\", OpenAICompletionsOptions, SimpleStreamOptions>>\n\t| undefined;\nlet openAIResponsesProviderModulePromise:\n\t| Promise<LazyProviderModule<\"openai-responses\", OpenAIResponsesOptions, SimpleStreamOptions>>\n\t| undefined;\nlet bedrockProviderModuleOverride:\n\t| LazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>\n\t| undefined;\nlet bedrockProviderModulePromise:\n\t| Promise<LazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>>\n\t| undefined;\n\nexport function setBedrockProviderModule(module: BedrockProviderModule): void {\n\tbedrockProviderModuleOverride = {\n\t\tstream: module.streamBedrock,\n\t\tstreamSimple: module.streamSimpleBedrock,\n\t};\n}\n\nfunction forwardStream(target: AssistantMessageEventStream, source: AsyncIterable<AssistantMessageEvent>): void {\n\t(async () => {\n\t\tfor await (const event of source) {\n\t\t\ttarget.push(event);\n\t\t}\n\t\ttarget.end();\n\t})();\n}\n\nfunction createLazyLoadErrorMessage<TApi extends Api>(model: Model<TApi>, error: unknown): AssistantMessage {\n\treturn {\n\t\trole: \"assistant\",\n\t\tcontent: [],\n\t\tapi: model.api,\n\t\tprovider: model.provider,\n\t\tmodel: model.id,\n\t\tusage: {\n\t\t\tinput: 0,\n\t\t\toutput: 0,\n\t\t\tcacheRead: 0,\n\t\t\tcacheWrite: 0,\n\t\t\ttotalTokens: 0,\n\t\t\tcost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },\n\t\t},\n\t\tstopReason: \"error\",\n\t\terrorMessage: error instanceof Error ? error.message : String(error),\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createLazyStream<TApi extends Api, TOptions extends StreamOptions, TSimpleOptions extends SimpleStreamOptions>(\n\tloadModule: () => Promise<LazyProviderModule<TApi, TOptions, TSimpleOptions>>,\n): StreamFunction<TApi, TOptions> {\n\treturn (model, context, options) => {\n\t\tconst outer = new AssistantMessageEventStream();\n\n\t\tloadModule()\n\t\t\t.then((module) => {\n\t\t\t\tconst inner = module.stream(model, context, options);\n\t\t\t\tforwardStream(outer, inner);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconst message = createLazyLoadErrorMessage(model, error);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t});\n\n\t\treturn outer;\n\t};\n}\n\nfunction createLazySimpleStream<\n\tTApi extends Api,\n\tTOptions extends StreamOptions,\n\tTSimpleOptions extends SimpleStreamOptions,\n>(loadModule: () => Promise<LazyProviderModule<TApi, TOptions, TSimpleOptions>>): StreamFunction<TApi, TSimpleOptions> {\n\treturn (model, context, options) => {\n\t\tconst outer = new AssistantMessageEventStream();\n\n\t\tloadModule()\n\t\t\t.then((module) => {\n\t\t\t\tconst inner = module.streamSimple(model, context, options);\n\t\t\t\tforwardStream(outer, inner);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconst message = createLazyLoadErrorMessage(model, error);\n\t\t\t\touter.push({ type: \"error\", reason: \"error\", error: message });\n\t\t\t\touter.end(message);\n\t\t\t});\n\n\t\treturn outer;\n\t};\n}\n\nfunction loadAnthropicProviderModule(): Promise<\n\tLazyProviderModule<\"anthropic-messages\", AnthropicOptions, SimpleStreamOptions>\n> {\n\tanthropicProviderModulePromise ||= import(\"./anthropic.js\").then((module) => {\n\t\tconst provider = module as AnthropicProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamAnthropic,\n\t\t\tstreamSimple: provider.streamSimpleAnthropic,\n\t\t};\n\t});\n\treturn anthropicProviderModulePromise;\n}\n\nfunction loadAzureOpenAIResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"azure-openai-responses\", AzureOpenAIResponsesOptions, SimpleStreamOptions>\n> {\n\tazureOpenAIResponsesProviderModulePromise ||= import(\"./azure-openai-responses.js\").then((module) => {\n\t\tconst provider = module as AzureOpenAIResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamAzureOpenAIResponses,\n\t\t\tstreamSimple: provider.streamSimpleAzureOpenAIResponses,\n\t\t};\n\t});\n\treturn azureOpenAIResponsesProviderModulePromise;\n}\n\nfunction loadGoogleProviderModule(): Promise<\n\tLazyProviderModule<\"google-generative-ai\", GoogleOptions, SimpleStreamOptions>\n> {\n\tgoogleProviderModulePromise ||= import(\"./google.js\").then((module) => {\n\t\tconst provider = module as GoogleProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogle,\n\t\t\tstreamSimple: provider.streamSimpleGoogle,\n\t\t};\n\t});\n\treturn googleProviderModulePromise;\n}\n\nfunction loadGoogleGeminiCliProviderModule(): Promise<\n\tLazyProviderModule<\"google-gemini-cli\", GoogleGeminiCliOptions, SimpleStreamOptions>\n> {\n\tgoogleGeminiCliProviderModulePromise ||= import(\"./google-gemini-cli.js\").then((module) => {\n\t\tconst provider = module as GoogleGeminiCliProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogleGeminiCli,\n\t\t\tstreamSimple: provider.streamSimpleGoogleGeminiCli,\n\t\t};\n\t});\n\treturn googleGeminiCliProviderModulePromise;\n}\n\nfunction loadGoogleVertexProviderModule(): Promise<\n\tLazyProviderModule<\"google-vertex\", GoogleVertexOptions, SimpleStreamOptions>\n> {\n\tgoogleVertexProviderModulePromise ||= import(\"./google-vertex.js\").then((module) => {\n\t\tconst provider = module as GoogleVertexProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamGoogleVertex,\n\t\t\tstreamSimple: provider.streamSimpleGoogleVertex,\n\t\t};\n\t});\n\treturn googleVertexProviderModulePromise;\n}\n\nfunction loadMistralProviderModule(): Promise<\n\tLazyProviderModule<\"mistral-conversations\", MistralOptions, SimpleStreamOptions>\n> {\n\tmistralProviderModulePromise ||= import(\"./mistral.js\").then((module) => {\n\t\tconst provider = module as MistralProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamMistral,\n\t\t\tstreamSimple: provider.streamSimpleMistral,\n\t\t};\n\t});\n\treturn mistralProviderModulePromise;\n}\n\nfunction loadOpenAICodexResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"openai-codex-responses\", OpenAICodexResponsesOptions, SimpleStreamOptions>\n> {\n\topenAICodexResponsesProviderModulePromise ||= import(\"./openai-codex-responses.js\").then((module) => {\n\t\tconst provider = module as OpenAICodexResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAICodexResponses,\n\t\t\tstreamSimple: provider.streamSimpleOpenAICodexResponses,\n\t\t};\n\t});\n\treturn openAICodexResponsesProviderModulePromise;\n}\n\nfunction loadOpenAICompletionsProviderModule(): Promise<\n\tLazyProviderModule<\"openai-completions\", OpenAICompletionsOptions, SimpleStreamOptions>\n> {\n\topenAICompletionsProviderModulePromise ||= import(\"./openai-completions.js\").then((module) => {\n\t\tconst provider = module as OpenAICompletionsProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAICompletions,\n\t\t\tstreamSimple: provider.streamSimpleOpenAICompletions,\n\t\t};\n\t});\n\treturn openAICompletionsProviderModulePromise;\n}\n\nfunction loadOpenAIResponsesProviderModule(): Promise<\n\tLazyProviderModule<\"openai-responses\", OpenAIResponsesOptions, SimpleStreamOptions>\n> {\n\topenAIResponsesProviderModulePromise ||= import(\"./openai-responses.js\").then((module) => {\n\t\tconst provider = module as OpenAIResponsesProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamOpenAIResponses,\n\t\t\tstreamSimple: provider.streamSimpleOpenAIResponses,\n\t\t};\n\t});\n\treturn openAIResponsesProviderModulePromise;\n}\n\nfunction loadBedrockProviderModule(): Promise<\n\tLazyProviderModule<\"bedrock-converse-stream\", BedrockOptions, SimpleStreamOptions>\n> {\n\tif (bedrockProviderModuleOverride) {\n\t\treturn Promise.resolve(bedrockProviderModuleOverride);\n\t}\n\tbedrockProviderModulePromise ||= importNodeOnlyProvider(\"./amazon-bedrock.js\").then((module) => {\n\t\tconst provider = module as BedrockProviderModule;\n\t\treturn {\n\t\t\tstream: provider.streamBedrock,\n\t\t\tstreamSimple: provider.streamSimpleBedrock,\n\t\t};\n\t});\n\treturn bedrockProviderModulePromise;\n}\n\nexport const streamAnthropic = createLazyStream(loadAnthropicProviderModule);\nexport const streamSimpleAnthropic = createLazySimpleStream(loadAnthropicProviderModule);\nexport const streamAzureOpenAIResponses = createLazyStream(loadAzureOpenAIResponsesProviderModule);\nexport const streamSimpleAzureOpenAIResponses = createLazySimpleStream(loadAzureOpenAIResponsesProviderModule);\nexport const streamGoogle = createLazyStream(loadGoogleProviderModule);\nexport const streamSimpleGoogle = createLazySimpleStream(loadGoogleProviderModule);\nexport const streamGoogleGeminiCli = createLazyStream(loadGoogleGeminiCliProviderModule);\nexport const streamSimpleGoogleGeminiCli = createLazySimpleStream(loadGoogleGeminiCliProviderModule);\nexport const streamGoogleVertex = createLazyStream(loadGoogleVertexProviderModule);\nexport const streamSimpleGoogleVertex = createLazySimpleStream(loadGoogleVertexProviderModule);\nexport const streamMistral = createLazyStream(loadMistralProviderModule);\nexport const streamSimpleMistral = createLazySimpleStream(loadMistralProviderModule);\nexport const streamOpenAICodexResponses = createLazyStream(loadOpenAICodexResponsesProviderModule);\nexport const streamSimpleOpenAICodexResponses = createLazySimpleStream(loadOpenAICodexResponsesProviderModule);\nexport const streamOpenAICompletions = createLazyStream(loadOpenAICompletionsProviderModule);\nexport const streamSimpleOpenAICompletions = createLazySimpleStream(loadOpenAICompletionsProviderModule);\nexport const streamOpenAIResponses = createLazyStream(loadOpenAIResponsesProviderModule);\nexport const streamSimpleOpenAIResponses = createLazySimpleStream(loadOpenAIResponsesProviderModule);\nconst streamBedrockLazy = createLazyStream(loadBedrockProviderModule);\nconst streamSimpleBedrockLazy = createLazySimpleStream(loadBedrockProviderModule);\n\nexport function registerBuiltInApiProviders(): void {\n\tregisterApiProvider({\n\t\tapi: \"anthropic-messages\",\n\t\tstream: streamAnthropic,\n\t\tstreamSimple: streamSimpleAnthropic,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-completions\",\n\t\tstream: streamOpenAICompletions,\n\t\tstreamSimple: streamSimpleOpenAICompletions,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"mistral-conversations\",\n\t\tstream: streamMistral,\n\t\tstreamSimple: streamSimpleMistral,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-responses\",\n\t\tstream: streamOpenAIResponses,\n\t\tstreamSimple: streamSimpleOpenAIResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"azure-openai-responses\",\n\t\tstream: streamAzureOpenAIResponses,\n\t\tstreamSimple: streamSimpleAzureOpenAIResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"openai-codex-responses\",\n\t\tstream: streamOpenAICodexResponses,\n\t\tstreamSimple: streamSimpleOpenAICodexResponses,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-generative-ai\",\n\t\tstream: streamGoogle,\n\t\tstreamSimple: streamSimpleGoogle,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-gemini-cli\",\n\t\tstream: streamGoogleGeminiCli,\n\t\tstreamSimple: streamSimpleGoogleGeminiCli,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"google-vertex\",\n\t\tstream: streamGoogleVertex,\n\t\tstreamSimple: streamSimpleGoogleVertex,\n\t});\n\n\tregisterApiProvider({\n\t\tapi: \"bedrock-converse-stream\",\n\t\tstream: streamBedrockLazy,\n\t\tstreamSimple: streamSimpleBedrockLazy,\n\t});\n}\n\nexport function resetApiProviders(): void {\n\tclearApiProviders();\n\tregisterBuiltInApiProviders();\n}\n\nregisterBuiltInApiProviders();\n"]}
@@ -0,0 +1,8 @@
1
+ import type { Api, Model, SimpleStreamOptions, StreamOptions, ThinkingBudgets, ThinkingLevel } from "../types.js";
2
+ export declare function buildBaseOptions(model: Model<Api>, options?: SimpleStreamOptions, apiKey?: string): StreamOptions;
3
+ export declare function clampReasoning(effort: ThinkingLevel | undefined): Exclude<ThinkingLevel, "xhigh"> | undefined;
4
+ export declare function adjustMaxTokensForThinking(baseMaxTokens: number, modelMaxTokens: number, reasoningLevel: ThinkingLevel, customBudgets?: ThinkingBudgets): {
5
+ maxTokens: number;
6
+ thinkingBudget: number;
7
+ };
8
+ //# sourceMappingURL=simple-options.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"simple-options.d.ts","sourceRoot":"","sources":["../../src/providers/simple-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAElH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,aAAa,CAajH;AAED,wBAAgB,cAAc,CAAC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,GAAG,SAAS,CAE7G;AAED,wBAAgB,0BAA0B,CACzC,aAAa,EAAE,MAAM,EACrB,cAAc,EAAE,MAAM,EACtB,cAAc,EAAE,aAAa,EAC7B,aAAa,CAAC,EAAE,eAAe,GAC7B;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAmB/C","sourcesContent":["import type { Api, Model, SimpleStreamOptions, StreamOptions, ThinkingBudgets, ThinkingLevel } from \"../types.js\";\n\nexport function buildBaseOptions(model: Model<Api>, options?: SimpleStreamOptions, apiKey?: string): StreamOptions {\n\treturn {\n\t\ttemperature: options?.temperature,\n\t\tmaxTokens: options?.maxTokens || Math.min(model.maxTokens, 32000),\n\t\tsignal: options?.signal,\n\t\tapiKey: apiKey || options?.apiKey,\n\t\tcacheRetention: options?.cacheRetention,\n\t\tsessionId: options?.sessionId,\n\t\theaders: options?.headers,\n\t\tonPayload: options?.onPayload,\n\t\tmaxRetryDelayMs: options?.maxRetryDelayMs,\n\t\tmetadata: options?.metadata,\n\t};\n}\n\nexport function clampReasoning(effort: ThinkingLevel | undefined): Exclude<ThinkingLevel, \"xhigh\"> | undefined {\n\treturn effort === \"xhigh\" ? \"high\" : effort;\n}\n\nexport function adjustMaxTokensForThinking(\n\tbaseMaxTokens: number,\n\tmodelMaxTokens: number,\n\treasoningLevel: ThinkingLevel,\n\tcustomBudgets?: ThinkingBudgets,\n): { maxTokens: number; thinkingBudget: number } {\n\tconst defaultBudgets: ThinkingBudgets = {\n\t\tminimal: 1024,\n\t\tlow: 2048,\n\t\tmedium: 8192,\n\t\thigh: 16384,\n\t};\n\tconst budgets = { ...defaultBudgets, ...customBudgets };\n\n\tconst minOutputTokens = 1024;\n\tconst level = clampReasoning(reasoningLevel)!;\n\tlet thinkingBudget = budgets[level]!;\n\tconst maxTokens = Math.min(baseMaxTokens + thinkingBudget, modelMaxTokens);\n\n\tif (maxTokens <= thinkingBudget) {\n\t\tthinkingBudget = Math.max(0, maxTokens - minOutputTokens);\n\t}\n\n\treturn { maxTokens, thinkingBudget };\n}\n"]}