orient-cli 0.1.0 → 0.2.1

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 (862) hide show
  1. package/dist/cli.js +1 -1
  2. package/dist/cli.js.map +1 -1
  3. package/dist/index.d.ts +1 -1
  4. package/dist/index.js +1 -1
  5. package/dist/index.js.map +1 -1
  6. package/dist/integrations/notebooklm/notebooklm-extension.d.ts +1 -1
  7. package/dist/integrations/notebooklm/notebooklm-extension.js +1 -1
  8. package/dist/integrations/notebooklm/notebooklm-extension.js.map +1 -1
  9. package/dist/orient/change-packet.d.ts +2 -1
  10. package/dist/orient/change-packet.js +25 -8
  11. package/dist/orient/change-packet.js.map +1 -1
  12. package/dist/orient/clarify.d.ts +114 -0
  13. package/dist/orient/clarify.js +186 -0
  14. package/dist/orient/clarify.js.map +1 -0
  15. package/dist/orient/clear-command.d.ts +79 -0
  16. package/dist/orient/clear-command.js +117 -0
  17. package/dist/orient/clear-command.js.map +1 -0
  18. package/dist/orient/mode.d.ts +70 -0
  19. package/dist/orient/mode.js +124 -0
  20. package/dist/orient/mode.js.map +1 -0
  21. package/dist/orient/orient-extension.d.ts +1 -1
  22. package/dist/orient/orient-extension.js +306 -17
  23. package/dist/orient/orient-extension.js.map +1 -1
  24. package/dist/orient/plan-execute.d.ts +137 -0
  25. package/dist/orient/plan-execute.js +333 -0
  26. package/dist/orient/plan-execute.js.map +1 -0
  27. package/dist/orient/tiers.d.ts +109 -0
  28. package/dist/orient/tiers.js +162 -0
  29. package/dist/orient/tiers.js.map +1 -0
  30. package/dist/orient/wizard.d.ts +108 -0
  31. package/dist/orient/wizard.js +183 -0
  32. package/dist/orient/wizard.js.map +1 -0
  33. package/docs/open-source-resources.md +1 -1
  34. package/node_modules/@orient-cli/agent-core/README.md +456 -0
  35. package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts +24 -0
  36. package/node_modules/@orient-cli/agent-core/dist/agent-loop.d.ts.map +1 -0
  37. package/node_modules/@orient-cli/agent-core/dist/agent-loop.js +404 -0
  38. package/node_modules/@orient-cli/agent-core/dist/agent-loop.js.map +1 -0
  39. package/node_modules/@orient-cli/agent-core/dist/agent.d.ts +115 -0
  40. package/node_modules/@orient-cli/agent-core/dist/agent.d.ts.map +1 -0
  41. package/node_modules/@orient-cli/agent-core/dist/agent.js +395 -0
  42. package/node_modules/@orient-cli/agent-core/dist/agent.js.map +1 -0
  43. package/node_modules/@orient-cli/agent-core/dist/index.d.ts +5 -0
  44. package/node_modules/@orient-cli/agent-core/dist/index.d.ts.map +1 -0
  45. package/node_modules/@orient-cli/agent-core/dist/index.js +9 -0
  46. package/node_modules/@orient-cli/agent-core/dist/index.js.map +1 -0
  47. package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts +85 -0
  48. package/node_modules/@orient-cli/agent-core/dist/proxy.d.ts.map +1 -0
  49. package/node_modules/@orient-cli/agent-core/dist/proxy.js +268 -0
  50. package/node_modules/@orient-cli/agent-core/dist/proxy.js.map +1 -0
  51. package/node_modules/@orient-cli/agent-core/dist/types.d.ts +323 -0
  52. package/node_modules/@orient-cli/agent-core/dist/types.d.ts.map +1 -0
  53. package/node_modules/@orient-cli/agent-core/dist/types.js +2 -0
  54. package/node_modules/@orient-cli/agent-core/dist/types.js.map +1 -0
  55. package/node_modules/@orient-cli/agent-core/package.json +44 -0
  56. package/node_modules/@orient-cli/ai/README.md +1315 -0
  57. package/node_modules/@orient-cli/ai/dist/api-registry.d.ts +20 -0
  58. package/node_modules/@orient-cli/ai/dist/api-registry.d.ts.map +1 -0
  59. package/node_modules/@orient-cli/ai/dist/api-registry.js +44 -0
  60. package/node_modules/@orient-cli/ai/dist/api-registry.js.map +1 -0
  61. package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts +5 -0
  62. package/node_modules/@orient-cli/ai/dist/bedrock-provider.d.ts.map +1 -0
  63. package/node_modules/@orient-cli/ai/dist/bedrock-provider.js +6 -0
  64. package/node_modules/@orient-cli/ai/dist/bedrock-provider.js.map +1 -0
  65. package/node_modules/@orient-cli/ai/dist/cli.d.ts +3 -0
  66. package/node_modules/@orient-cli/ai/dist/cli.d.ts.map +1 -0
  67. package/node_modules/@orient-cli/ai/dist/cli.js +116 -0
  68. package/node_modules/@orient-cli/ai/dist/cli.js.map +1 -0
  69. package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts +9 -0
  70. package/node_modules/@orient-cli/ai/dist/env-api-keys.d.ts.map +1 -0
  71. package/node_modules/@orient-cli/ai/dist/env-api-keys.js +107 -0
  72. package/node_modules/@orient-cli/ai/dist/env-api-keys.js.map +1 -0
  73. package/node_modules/@orient-cli/ai/dist/index.d.ts +26 -0
  74. package/node_modules/@orient-cli/ai/dist/index.d.ts.map +1 -0
  75. package/node_modules/@orient-cli/ai/dist/index.js +14 -0
  76. package/node_modules/@orient-cli/ai/dist/index.js.map +1 -0
  77. package/node_modules/@orient-cli/ai/dist/models.d.ts +24 -0
  78. package/node_modules/@orient-cli/ai/dist/models.d.ts.map +1 -0
  79. package/node_modules/@orient-cli/ai/dist/models.generated.d.ts +14473 -0
  80. package/node_modules/@orient-cli/ai/dist/models.generated.d.ts.map +1 -0
  81. package/node_modules/@orient-cli/ai/dist/models.generated.js +14241 -0
  82. package/node_modules/@orient-cli/ai/dist/models.generated.js.map +1 -0
  83. package/node_modules/@orient-cli/ai/dist/models.js +55 -0
  84. package/node_modules/@orient-cli/ai/dist/models.js.map +1 -0
  85. package/node_modules/@orient-cli/ai/dist/oauth.d.ts +2 -0
  86. package/node_modules/@orient-cli/ai/dist/oauth.d.ts.map +1 -0
  87. package/node_modules/@orient-cli/ai/dist/oauth.js +2 -0
  88. package/node_modules/@orient-cli/ai/dist/oauth.js.map +1 -0
  89. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts +20 -0
  90. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.d.ts.map +1 -0
  91. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js +651 -0
  92. package/node_modules/@orient-cli/ai/dist/providers/amazon-bedrock.js.map +1 -0
  93. package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts +40 -0
  94. package/node_modules/@orient-cli/ai/dist/providers/anthropic.d.ts.map +1 -0
  95. package/node_modules/@orient-cli/ai/dist/providers/anthropic.js +749 -0
  96. package/node_modules/@orient-cli/ai/dist/providers/anthropic.js.map +1 -0
  97. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts +15 -0
  98. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.d.ts.map +1 -0
  99. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js +176 -0
  100. package/node_modules/@orient-cli/ai/dist/providers/azure-openai-responses.js.map +1 -0
  101. package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts +56 -0
  102. package/node_modules/@orient-cli/ai/dist/providers/faux.d.ts.map +1 -0
  103. package/node_modules/@orient-cli/ai/dist/providers/faux.js +367 -0
  104. package/node_modules/@orient-cli/ai/dist/providers/faux.js.map +1 -0
  105. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts +8 -0
  106. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.d.ts.map +1 -0
  107. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js +29 -0
  108. package/node_modules/@orient-cli/ai/dist/providers/github-copilot-headers.js.map +1 -0
  109. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts +74 -0
  110. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.d.ts.map +1 -0
  111. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js +776 -0
  112. package/node_modules/@orient-cli/ai/dist/providers/google-gemini-cli.js.map +1 -0
  113. package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts +65 -0
  114. package/node_modules/@orient-cli/ai/dist/providers/google-shared.d.ts.map +1 -0
  115. package/node_modules/@orient-cli/ai/dist/providers/google-shared.js +312 -0
  116. package/node_modules/@orient-cli/ai/dist/providers/google-shared.js.map +1 -0
  117. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts +15 -0
  118. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.d.ts.map +1 -0
  119. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js +419 -0
  120. package/node_modules/@orient-cli/ai/dist/providers/google-vertex.js.map +1 -0
  121. package/node_modules/@orient-cli/ai/dist/providers/google.d.ts +13 -0
  122. package/node_modules/@orient-cli/ai/dist/providers/google.d.ts.map +1 -0
  123. package/node_modules/@orient-cli/ai/dist/providers/google.js +399 -0
  124. package/node_modules/@orient-cli/ai/dist/providers/google.js.map +1 -0
  125. package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts +22 -0
  126. package/node_modules/@orient-cli/ai/dist/providers/mistral.d.ts.map +1 -0
  127. package/node_modules/@orient-cli/ai/dist/providers/mistral.js +501 -0
  128. package/node_modules/@orient-cli/ai/dist/providers/mistral.js.map +1 -0
  129. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts +9 -0
  130. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.d.ts.map +1 -0
  131. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js +741 -0
  132. package/node_modules/@orient-cli/ai/dist/providers/openai-codex-responses.js.map +1 -0
  133. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts +15 -0
  134. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.d.ts.map +1 -0
  135. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js +753 -0
  136. package/node_modules/@orient-cli/ai/dist/providers/openai-completions.js.map +1 -0
  137. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts +17 -0
  138. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.d.ts.map +1 -0
  139. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js +470 -0
  140. package/node_modules/@orient-cli/ai/dist/providers/openai-responses-shared.js.map +1 -0
  141. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts +13 -0
  142. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.d.ts.map +1 -0
  143. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js +190 -0
  144. package/node_modules/@orient-cli/ai/dist/providers/openai-responses.js.map +1 -0
  145. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts +38 -0
  146. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.d.ts.map +1 -0
  147. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js +261 -0
  148. package/node_modules/@orient-cli/ai/dist/providers/register-builtins.js.map +1 -0
  149. package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts +8 -0
  150. package/node_modules/@orient-cli/ai/dist/providers/simple-options.d.ts.map +1 -0
  151. package/node_modules/@orient-cli/ai/dist/providers/simple-options.js +35 -0
  152. package/node_modules/@orient-cli/ai/dist/providers/simple-options.js.map +1 -0
  153. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts +8 -0
  154. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.d.ts.map +1 -0
  155. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js +155 -0
  156. package/node_modules/@orient-cli/ai/dist/providers/transform-messages.js.map +1 -0
  157. package/node_modules/@orient-cli/ai/dist/stream.d.ts +8 -0
  158. package/node_modules/@orient-cli/ai/dist/stream.d.ts.map +1 -0
  159. package/node_modules/@orient-cli/ai/dist/stream.js +27 -0
  160. package/node_modules/@orient-cli/ai/dist/stream.js.map +1 -0
  161. package/node_modules/@orient-cli/ai/dist/types.d.ts +353 -0
  162. package/node_modules/@orient-cli/ai/dist/types.d.ts.map +1 -0
  163. package/node_modules/@orient-cli/ai/dist/types.js +2 -0
  164. package/node_modules/@orient-cli/ai/dist/types.js.map +1 -0
  165. package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts +21 -0
  166. package/node_modules/@orient-cli/ai/dist/utils/event-stream.d.ts.map +1 -0
  167. package/node_modules/@orient-cli/ai/dist/utils/event-stream.js +81 -0
  168. package/node_modules/@orient-cli/ai/dist/utils/event-stream.js.map +1 -0
  169. package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts +3 -0
  170. package/node_modules/@orient-cli/ai/dist/utils/hash.d.ts.map +1 -0
  171. package/node_modules/@orient-cli/ai/dist/utils/hash.js +14 -0
  172. package/node_modules/@orient-cli/ai/dist/utils/hash.js.map +1 -0
  173. package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts +9 -0
  174. package/node_modules/@orient-cli/ai/dist/utils/json-parse.d.ts.map +1 -0
  175. package/node_modules/@orient-cli/ai/dist/utils/json-parse.js +29 -0
  176. package/node_modules/@orient-cli/ai/dist/utils/json-parse.js.map +1 -0
  177. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts +25 -0
  178. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.d.ts.map +1 -0
  179. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js +335 -0
  180. package/node_modules/@orient-cli/ai/dist/utils/oauth/anthropic.js.map +1 -0
  181. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts +30 -0
  182. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.d.ts.map +1 -0
  183. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js +292 -0
  184. package/node_modules/@orient-cli/ai/dist/utils/oauth/github-copilot.js.map +1 -0
  185. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts +26 -0
  186. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.d.ts.map +1 -0
  187. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js +376 -0
  188. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-antigravity.js.map +1 -0
  189. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts +26 -0
  190. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.d.ts.map +1 -0
  191. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js +481 -0
  192. package/node_modules/@orient-cli/ai/dist/utils/oauth/google-gemini-cli.js.map +1 -0
  193. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts +61 -0
  194. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.d.ts.map +1 -0
  195. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js +131 -0
  196. package/node_modules/@orient-cli/ai/dist/utils/oauth/index.js.map +1 -0
  197. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts +3 -0
  198. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.d.ts.map +1 -0
  199. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js +105 -0
  200. package/node_modules/@orient-cli/ai/dist/utils/oauth/oauth-page.js.map +1 -0
  201. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts +34 -0
  202. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.d.ts.map +1 -0
  203. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js +373 -0
  204. package/node_modules/@orient-cli/ai/dist/utils/oauth/openai-codex.js.map +1 -0
  205. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts +13 -0
  206. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.d.ts.map +1 -0
  207. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js +31 -0
  208. package/node_modules/@orient-cli/ai/dist/utils/oauth/pkce.js.map +1 -0
  209. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts +47 -0
  210. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.d.ts.map +1 -0
  211. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js +2 -0
  212. package/node_modules/@orient-cli/ai/dist/utils/oauth/types.js.map +1 -0
  213. package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts +53 -0
  214. package/node_modules/@orient-cli/ai/dist/utils/overflow.d.ts.map +1 -0
  215. package/node_modules/@orient-cli/ai/dist/utils/overflow.js +132 -0
  216. package/node_modules/@orient-cli/ai/dist/utils/overflow.js.map +1 -0
  217. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts +22 -0
  218. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.d.ts.map +1 -0
  219. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js +26 -0
  220. package/node_modules/@orient-cli/ai/dist/utils/sanitize-unicode.js.map +1 -0
  221. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts +17 -0
  222. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.d.ts.map +1 -0
  223. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js +21 -0
  224. package/node_modules/@orient-cli/ai/dist/utils/typebox-helpers.js.map +1 -0
  225. package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts +18 -0
  226. package/node_modules/@orient-cli/ai/dist/utils/validation.d.ts.map +1 -0
  227. package/node_modules/@orient-cli/ai/dist/utils/validation.js +80 -0
  228. package/node_modules/@orient-cli/ai/dist/utils/validation.js.map +1 -0
  229. package/node_modules/@orient-cli/ai/package.json +114 -0
  230. package/node_modules/@orient-cli/coding-agent/README.md +618 -0
  231. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts +3 -0
  232. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.d.ts.map +1 -0
  233. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js +7 -0
  234. package/node_modules/@orient-cli/coding-agent/dist/bun/cli.js.map +1 -0
  235. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts +2 -0
  236. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.d.ts.map +1 -0
  237. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js +4 -0
  238. package/node_modules/@orient-cli/coding-agent/dist/bun/register-bedrock.js.map +1 -0
  239. package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts +52 -0
  240. package/node_modules/@orient-cli/coding-agent/dist/cli/args.d.ts.map +1 -0
  241. package/node_modules/@orient-cli/coding-agent/dist/cli/args.js +326 -0
  242. package/node_modules/@orient-cli/coding-agent/dist/cli/args.js.map +1 -0
  243. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts +14 -0
  244. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.d.ts.map +1 -0
  245. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js +31 -0
  246. package/node_modules/@orient-cli/coding-agent/dist/cli/config-selector.js.map +1 -0
  247. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts +15 -0
  248. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.d.ts.map +1 -0
  249. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js +83 -0
  250. package/node_modules/@orient-cli/coding-agent/dist/cli/file-processor.js.map +1 -0
  251. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts +18 -0
  252. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.d.ts.map +1 -0
  253. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js +22 -0
  254. package/node_modules/@orient-cli/coding-agent/dist/cli/initial-message.js.map +1 -0
  255. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts +9 -0
  256. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.d.ts.map +1 -0
  257. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js +92 -0
  258. package/node_modules/@orient-cli/coding-agent/dist/cli/list-models.js.map +1 -0
  259. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts +9 -0
  260. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.d.ts.map +1 -0
  261. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js +35 -0
  262. package/node_modules/@orient-cli/coding-agent/dist/cli/session-picker.js.map +1 -0
  263. package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts +3 -0
  264. package/node_modules/@orient-cli/coding-agent/dist/cli.d.ts.map +1 -0
  265. package/node_modules/@orient-cli/coding-agent/dist/cli.js +15 -0
  266. package/node_modules/@orient-cli/coding-agent/dist/cli.js.map +1 -0
  267. package/node_modules/@orient-cli/coding-agent/dist/config.d.ts +77 -0
  268. package/node_modules/@orient-cli/coding-agent/dist/config.d.ts.map +1 -0
  269. package/node_modules/@orient-cli/coding-agent/dist/config.js +229 -0
  270. package/node_modules/@orient-cli/coding-agent/dist/config.js.map +1 -0
  271. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts +83 -0
  272. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.d.ts.map +1 -0
  273. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js +236 -0
  274. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-runtime.js.map +1 -0
  275. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts +86 -0
  276. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.d.ts.map +1 -0
  277. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js +116 -0
  278. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session-services.js.map +1 -0
  279. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts +585 -0
  280. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.d.ts.map +1 -0
  281. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js +2497 -0
  282. package/node_modules/@orient-cli/coding-agent/dist/core/agent-session.js.map +1 -0
  283. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts +132 -0
  284. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.d.ts.map +1 -0
  285. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js +422 -0
  286. package/node_modules/@orient-cli/coding-agent/dist/core/auth-storage.js.map +1 -0
  287. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts +46 -0
  288. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.d.ts.map +1 -0
  289. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js +125 -0
  290. package/node_modules/@orient-cli/coding-agent/dist/core/bash-executor.js.map +1 -0
  291. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts +88 -0
  292. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.d.ts.map +1 -0
  293. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js +243 -0
  294. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/branch-summarization.js.map +1 -0
  295. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts +121 -0
  296. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.d.ts.map +1 -0
  297. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js +613 -0
  298. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/compaction.js.map +1 -0
  299. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts +7 -0
  300. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.d.ts.map +1 -0
  301. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js +7 -0
  302. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/index.js.map +1 -0
  303. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts +38 -0
  304. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.d.ts.map +1 -0
  305. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js +153 -0
  306. package/node_modules/@orient-cli/coding-agent/dist/core/compaction/utils.js.map +1 -0
  307. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts +3 -0
  308. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.d.ts.map +1 -0
  309. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js +2 -0
  310. package/node_modules/@orient-cli/coding-agent/dist/core/defaults.js.map +1 -0
  311. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts +15 -0
  312. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.d.ts.map +1 -0
  313. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js +2 -0
  314. package/node_modules/@orient-cli/coding-agent/dist/core/diagnostics.js.map +1 -0
  315. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts +9 -0
  316. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.d.ts.map +1 -0
  317. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js +25 -0
  318. package/node_modules/@orient-cli/coding-agent/dist/core/event-bus.js.map +1 -0
  319. package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts +29 -0
  320. package/node_modules/@orient-cli/coding-agent/dist/core/exec.d.ts.map +1 -0
  321. package/node_modules/@orient-cli/coding-agent/dist/core/exec.js +75 -0
  322. package/node_modules/@orient-cli/coding-agent/dist/core/exec.js.map +1 -0
  323. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts +22 -0
  324. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.d.ts.map +1 -0
  325. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js +249 -0
  326. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/ansi-to-html.js.map +1 -0
  327. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts +37 -0
  328. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.d.ts.map +1 -0
  329. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js +224 -0
  330. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/index.js.map +1 -0
  331. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.css +1001 -0
  332. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.html +55 -0
  333. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/template.js +1690 -0
  334. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts +40 -0
  335. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.d.ts.map +1 -0
  336. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js +95 -0
  337. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/tool-renderer.js.map +1 -0
  338. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/highlight.min.js +1213 -0
  339. package/node_modules/@orient-cli/coding-agent/dist/core/export-html/vendor/marked.min.js +6 -0
  340. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts +12 -0
  341. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.d.ts.map +1 -0
  342. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js +9 -0
  343. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/index.js.map +1 -0
  344. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts +25 -0
  345. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.d.ts.map +1 -0
  346. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js +438 -0
  347. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/loader.js.map +1 -0
  348. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts +148 -0
  349. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.d.ts.map +1 -0
  350. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js +701 -0
  351. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/runner.js.map +1 -0
  352. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts +1073 -0
  353. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.d.ts.map +1 -0
  354. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js +45 -0
  355. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/types.js.map +1 -0
  356. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts +20 -0
  357. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.d.ts.map +1 -0
  358. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js +22 -0
  359. package/node_modules/@orient-cli/coding-agent/dist/core/extensions/wrapper.js.map +1 -0
  360. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts +48 -0
  361. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.d.ts.map +1 -0
  362. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js +314 -0
  363. package/node_modules/@orient-cli/coding-agent/dist/core/footer-data-provider.js.map +1 -0
  364. package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts +12 -0
  365. package/node_modules/@orient-cli/coding-agent/dist/core/index.d.ts.map +1 -0
  366. package/node_modules/@orient-cli/coding-agent/dist/core/index.js +12 -0
  367. package/node_modules/@orient-cli/coding-agent/dist/core/index.js.map +1 -0
  368. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts +293 -0
  369. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.d.ts.map +1 -0
  370. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js +248 -0
  371. package/node_modules/@orient-cli/coding-agent/dist/core/keybindings.js.map +1 -0
  372. package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts +77 -0
  373. package/node_modules/@orient-cli/coding-agent/dist/core/messages.d.ts.map +1 -0
  374. package/node_modules/@orient-cli/coding-agent/dist/core/messages.js +123 -0
  375. package/node_modules/@orient-cli/coding-agent/dist/core/messages.js.map +1 -0
  376. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts +132 -0
  377. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.d.ts.map +1 -0
  378. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js +612 -0
  379. package/node_modules/@orient-cli/coding-agent/dist/core/model-registry.js.map +1 -0
  380. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts +110 -0
  381. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.d.ts.map +1 -0
  382. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js +486 -0
  383. package/node_modules/@orient-cli/coding-agent/dist/core/model-resolver.js.map +1 -0
  384. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts +6 -0
  385. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.d.ts.map +1 -0
  386. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js +59 -0
  387. package/node_modules/@orient-cli/coding-agent/dist/core/output-guard.js.map +1 -0
  388. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts +192 -0
  389. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.d.ts.map +1 -0
  390. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js +1829 -0
  391. package/node_modules/@orient-cli/coding-agent/dist/core/package-manager.js.map +1 -0
  392. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts +51 -0
  393. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.d.ts.map +1 -0
  394. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js +249 -0
  395. package/node_modules/@orient-cli/coding-agent/dist/core/prompt-templates.js.map +1 -0
  396. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts +23 -0
  397. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.d.ts.map +1 -0
  398. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js +126 -0
  399. package/node_modules/@orient-cli/coding-agent/dist/core/resolve-config-value.js.map +1 -0
  400. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts +185 -0
  401. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.d.ts.map +1 -0
  402. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js +720 -0
  403. package/node_modules/@orient-cli/coding-agent/dist/core/resource-loader.js.map +1 -0
  404. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts +93 -0
  405. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.d.ts.map +1 -0
  406. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js +236 -0
  407. package/node_modules/@orient-cli/coding-agent/dist/core/sdk.js.map +1 -0
  408. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts +19 -0
  409. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.d.ts.map +1 -0
  410. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js +38 -0
  411. package/node_modules/@orient-cli/coding-agent/dist/core/session-cwd.js.map +1 -0
  412. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts +333 -0
  413. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.d.ts.map +1 -0
  414. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js +1105 -0
  415. package/node_modules/@orient-cli/coding-agent/dist/core/session-manager.js.map +1 -0
  416. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts +237 -0
  417. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.d.ts.map +1 -0
  418. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js +708 -0
  419. package/node_modules/@orient-cli/coding-agent/dist/core/settings-manager.js.map +1 -0
  420. package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts +60 -0
  421. package/node_modules/@orient-cli/coding-agent/dist/core/skills.d.ts.map +1 -0
  422. package/node_modules/@orient-cli/coding-agent/dist/core/skills.js +409 -0
  423. package/node_modules/@orient-cli/coding-agent/dist/core/skills.js.map +1 -0
  424. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts +14 -0
  425. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.d.ts.map +1 -0
  426. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js +23 -0
  427. package/node_modules/@orient-cli/coding-agent/dist/core/slash-commands.js.map +1 -0
  428. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts +18 -0
  429. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.d.ts.map +1 -0
  430. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js +19 -0
  431. package/node_modules/@orient-cli/coding-agent/dist/core/source-info.js.map +1 -0
  432. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts +28 -0
  433. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.d.ts.map +1 -0
  434. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js +116 -0
  435. package/node_modules/@orient-cli/coding-agent/dist/core/system-prompt.js.map +1 -0
  436. package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts +8 -0
  437. package/node_modules/@orient-cli/coding-agent/dist/core/timings.d.ts.map +1 -0
  438. package/node_modules/@orient-cli/coding-agent/dist/core/timings.js +31 -0
  439. package/node_modules/@orient-cli/coding-agent/dist/core/timings.js.map +1 -0
  440. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts +73 -0
  441. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.d.ts.map +1 -0
  442. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js +352 -0
  443. package/node_modules/@orient-cli/coding-agent/dist/core/tools/bash.js.map +1 -0
  444. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts +85 -0
  445. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.d.ts.map +1 -0
  446. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js +337 -0
  447. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit-diff.js.map +1 -0
  448. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts +53 -0
  449. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.d.ts.map +1 -0
  450. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js +196 -0
  451. package/node_modules/@orient-cli/coding-agent/dist/core/tools/edit.js.map +1 -0
  452. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts +6 -0
  453. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.d.ts.map +1 -0
  454. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js +37 -0
  455. package/node_modules/@orient-cli/coding-agent/dist/core/tools/file-mutation-queue.js.map +1 -0
  456. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts +46 -0
  457. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.d.ts.map +1 -0
  458. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js +258 -0
  459. package/node_modules/@orient-cli/coding-agent/dist/core/tools/find.js.map +1 -0
  460. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts +56 -0
  461. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.d.ts.map +1 -0
  462. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js +293 -0
  463. package/node_modules/@orient-cli/coding-agent/dist/core/tools/grep.js.map +1 -0
  464. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts +115 -0
  465. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.d.ts.map +1 -0
  466. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js +86 -0
  467. package/node_modules/@orient-cli/coding-agent/dist/core/tools/index.js.map +1 -0
  468. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts +46 -0
  469. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.d.ts.map +1 -0
  470. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js +172 -0
  471. package/node_modules/@orient-cli/coding-agent/dist/core/tools/ls.js.map +1 -0
  472. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts +8 -0
  473. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.d.ts.map +1 -0
  474. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js +81 -0
  475. package/node_modules/@orient-cli/coding-agent/dist/core/tools/path-utils.js.map +1 -0
  476. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts +46 -0
  477. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.d.ts.map +1 -0
  478. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js +225 -0
  479. package/node_modules/@orient-cli/coding-agent/dist/core/tools/read.js.map +1 -0
  480. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts +21 -0
  481. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.d.ts.map +1 -0
  482. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js +49 -0
  483. package/node_modules/@orient-cli/coding-agent/dist/core/tools/render-utils.js.map +1 -0
  484. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
  485. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
  486. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js +32 -0
  487. package/node_modules/@orient-cli/coding-agent/dist/core/tools/tool-definition-wrapper.js.map +1 -0
  488. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts +70 -0
  489. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.d.ts.map +1 -0
  490. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js +205 -0
  491. package/node_modules/@orient-cli/coding-agent/dist/core/tools/truncate.js.map +1 -0
  492. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts +35 -0
  493. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.d.ts.map +1 -0
  494. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js +216 -0
  495. package/node_modules/@orient-cli/coding-agent/dist/core/tools/write.js.map +1 -0
  496. package/node_modules/@orient-cli/coding-agent/dist/index.d.ts +28 -0
  497. package/node_modules/@orient-cli/coding-agent/dist/index.d.ts.map +1 -0
  498. package/node_modules/@orient-cli/coding-agent/dist/index.js +43 -0
  499. package/node_modules/@orient-cli/coding-agent/dist/index.js.map +1 -0
  500. package/node_modules/@orient-cli/coding-agent/dist/main.d.ts +8 -0
  501. package/node_modules/@orient-cli/coding-agent/dist/main.d.ts.map +1 -0
  502. package/node_modules/@orient-cli/coding-agent/dist/main.js +593 -0
  503. package/node_modules/@orient-cli/coding-agent/dist/main.js.map +1 -0
  504. package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts +33 -0
  505. package/node_modules/@orient-cli/coding-agent/dist/migrations.d.ts.map +1 -0
  506. package/node_modules/@orient-cli/coding-agent/dist/migrations.js +281 -0
  507. package/node_modules/@orient-cli/coding-agent/dist/migrations.js.map +1 -0
  508. package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts +9 -0
  509. package/node_modules/@orient-cli/coding-agent/dist/modes/index.d.ts.map +1 -0
  510. package/node_modules/@orient-cli/coding-agent/dist/modes/index.js +8 -0
  511. package/node_modules/@orient-cli/coding-agent/dist/modes/index.js.map +1 -0
  512. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts +18 -0
  513. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.d.ts.map +1 -0
  514. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js +107 -0
  515. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/assistant-message.js.map +1 -0
  516. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts +34 -0
  517. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.d.ts.map +1 -0
  518. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js +175 -0
  519. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bash-execution.js.map +1 -0
  520. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts +16 -0
  521. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -0
  522. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js +51 -0
  523. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/bordered-loader.js.map +1 -0
  524. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts +16 -0
  525. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -0
  526. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js +44 -0
  527. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/branch-summary-message.js.map +1 -0
  528. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts +16 -0
  529. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -0
  530. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js +45 -0
  531. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/compaction-summary-message.js.map +1 -0
  532. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts +71 -0
  533. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.d.ts.map +1 -0
  534. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js +479 -0
  535. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/config-selector.js.map +1 -0
  536. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts +14 -0
  537. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -0
  538. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js +33 -0
  539. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/countdown-timer.js.map +1 -0
  540. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts +21 -0
  541. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.d.ts.map +1 -0
  542. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js +70 -0
  543. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-editor.js.map +1 -0
  544. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts +20 -0
  545. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.d.ts.map +1 -0
  546. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js +79 -0
  547. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/custom-message.js.map +1 -0
  548. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts +12 -0
  549. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.d.ts.map +1 -0
  550. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js +133 -0
  551. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/diff.js.map +1 -0
  552. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts +15 -0
  553. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -0
  554. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js +21 -0
  555. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/dynamic-border.js.map +1 -0
  556. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts +20 -0
  557. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.d.ts.map +1 -0
  558. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js +111 -0
  559. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-editor.js.map +1 -0
  560. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts +23 -0
  561. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.d.ts.map +1 -0
  562. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js +61 -0
  563. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-input.js.map +1 -0
  564. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts +24 -0
  565. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.d.ts.map +1 -0
  566. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js +78 -0
  567. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/extension-selector.js.map +1 -0
  568. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts +27 -0
  569. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.d.ts.map +1 -0
  570. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js +201 -0
  571. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/footer.js.map +1 -0
  572. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts +31 -0
  573. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.d.ts.map +1 -0
  574. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js +34 -0
  575. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/index.js.map +1 -0
  576. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts +8 -0
  577. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -0
  578. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js +22 -0
  579. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/keybinding-hints.js.map +1 -0
  580. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts +42 -0
  581. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.d.ts.map +1 -0
  582. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js +145 -0
  583. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/login-dialog.js.map +1 -0
  584. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts +47 -0
  585. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.d.ts.map +1 -0
  586. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js +275 -0
  587. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/model-selector.js.map +1 -0
  588. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts +19 -0
  589. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -0
  590. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js +97 -0
  591. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/oauth-selector.js.map +1 -0
  592. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts +53 -0
  593. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.d.ts.map +1 -0
  594. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js +204 -0
  595. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/orient-banner.js.map +1 -0
  596. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts +49 -0
  597. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -0
  598. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js +275 -0
  599. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/scoped-models-selector.js.map +1 -0
  600. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts +23 -0
  601. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -0
  602. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js +155 -0
  603. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector-search.js.map +1 -0
  604. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts +95 -0
  605. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.d.ts.map +1 -0
  606. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js +848 -0
  607. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/session-selector.js.map +1 -0
  608. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts +58 -0
  609. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.d.ts.map +1 -0
  610. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js +301 -0
  611. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/settings-selector.js.map +1 -0
  612. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts +10 -0
  613. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -0
  614. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js +39 -0
  615. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/show-images-selector.js.map +1 -0
  616. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts +17 -0
  617. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -0
  618. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js +47 -0
  619. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/skill-invocation-message.js.map +1 -0
  620. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts +11 -0
  621. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.d.ts.map +1 -0
  622. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js +50 -0
  623. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/theme-selector.js.map +1 -0
  624. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts +11 -0
  625. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -0
  626. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js +51 -0
  627. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/thinking-selector.js.map +1 -0
  628. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts +58 -0
  629. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.d.ts.map +1 -0
  630. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js +274 -0
  631. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tool-execution.js.map +1 -0
  632. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts +89 -0
  633. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.d.ts.map +1 -0
  634. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js +1084 -0
  635. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/tree-selector.js.map +1 -0
  636. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts +30 -0
  637. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -0
  638. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js +113 -0
  639. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message-selector.js.map +1 -0
  640. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts +9 -0
  641. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.d.ts.map +1 -0
  642. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js +28 -0
  643. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/user-message.js.map +1 -0
  644. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts +24 -0
  645. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -0
  646. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js +33 -0
  647. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/components/visual-truncate.js.map +1 -0
  648. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts +345 -0
  649. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.d.ts.map +1 -0
  650. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js +4106 -0
  651. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/interactive-mode.js.map +1 -0
  652. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/dark.json +85 -0
  653. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/light.json +84 -0
  654. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme-schema.json +335 -0
  655. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts +81 -0
  656. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.d.ts.map +1 -0
  657. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js +979 -0
  658. package/node_modules/@orient-cli/coding-agent/dist/modes/interactive/theme/theme.js.map +1 -0
  659. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts +28 -0
  660. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.d.ts.map +1 -0
  661. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js +112 -0
  662. package/node_modules/@orient-cli/coding-agent/dist/modes/print-mode.js.map +1 -0
  663. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts +17 -0
  664. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.d.ts.map +1 -0
  665. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js +49 -0
  666. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/jsonl.js.map +1 -0
  667. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts +217 -0
  668. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.d.ts.map +1 -0
  669. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js +402 -0
  670. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-client.js.map +1 -0
  671. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts +20 -0
  672. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.d.ts.map +1 -0
  673. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js +550 -0
  674. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-mode.js.map +1 -0
  675. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts +408 -0
  676. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.d.ts.map +1 -0
  677. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js +8 -0
  678. package/node_modules/@orient-cli/coding-agent/dist/modes/rpc/rpc-types.js.map +1 -0
  679. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts +4 -0
  680. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.d.ts.map +1 -0
  681. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js +234 -0
  682. package/node_modules/@orient-cli/coding-agent/dist/package-manager-cli.js.map +1 -0
  683. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts +21 -0
  684. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.d.ts.map +1 -0
  685. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js +87 -0
  686. package/node_modules/@orient-cli/coding-agent/dist/utils/changelog.js.map +1 -0
  687. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts +11 -0
  688. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.d.ts.map +1 -0
  689. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js +78 -0
  690. package/node_modules/@orient-cli/coding-agent/dist/utils/child-process.js.map +1 -0
  691. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts +11 -0
  692. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.d.ts.map +1 -0
  693. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js +245 -0
  694. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-image.js.map +1 -0
  695. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts +8 -0
  696. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.d.ts.map +1 -0
  697. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js +14 -0
  698. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard-native.js.map +1 -0
  699. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts +2 -0
  700. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.d.ts.map +1 -0
  701. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js +78 -0
  702. package/node_modules/@orient-cli/coding-agent/dist/utils/clipboard.js.map +1 -0
  703. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts +5 -0
  704. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.d.ts.map +1 -0
  705. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js +158 -0
  706. package/node_modules/@orient-cli/coding-agent/dist/utils/exif-orientation.js.map +1 -0
  707. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts +8 -0
  708. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.d.ts.map +1 -0
  709. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js +26 -0
  710. package/node_modules/@orient-cli/coding-agent/dist/utils/frontmatter.js.map +1 -0
  711. package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts +26 -0
  712. package/node_modules/@orient-cli/coding-agent/dist/utils/git.d.ts.map +1 -0
  713. package/node_modules/@orient-cli/coding-agent/dist/utils/git.js +163 -0
  714. package/node_modules/@orient-cli/coding-agent/dist/utils/git.js.map +1 -0
  715. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts +9 -0
  716. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.d.ts.map +1 -0
  717. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js +39 -0
  718. package/node_modules/@orient-cli/coding-agent/dist/utils/image-convert.js.map +1 -0
  719. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts +36 -0
  720. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.d.ts.map +1 -0
  721. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js +137 -0
  722. package/node_modules/@orient-cli/coding-agent/dist/utils/image-resize.js.map +1 -0
  723. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts +2 -0
  724. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.d.ts.map +1 -0
  725. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js +26 -0
  726. package/node_modules/@orient-cli/coding-agent/dist/utils/mime.js.map +1 -0
  727. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts +7 -0
  728. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.d.ts.map +1 -0
  729. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js +19 -0
  730. package/node_modules/@orient-cli/coding-agent/dist/utils/paths.js.map +1 -0
  731. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts +21 -0
  732. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.d.ts.map +1 -0
  733. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js +121 -0
  734. package/node_modules/@orient-cli/coding-agent/dist/utils/photon.js.map +1 -0
  735. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts +26 -0
  736. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.d.ts.map +1 -0
  737. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js +186 -0
  738. package/node_modules/@orient-cli/coding-agent/dist/utils/shell.js.map +1 -0
  739. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts +5 -0
  740. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.d.ts.map +1 -0
  741. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js +17 -0
  742. package/node_modules/@orient-cli/coding-agent/dist/utils/sleep.js.map +1 -0
  743. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts +3 -0
  744. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.d.ts.map +1 -0
  745. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js +252 -0
  746. package/node_modules/@orient-cli/coding-agent/dist/utils/tools-manager.js.map +1 -0
  747. package/node_modules/@orient-cli/coding-agent/package.json +104 -0
  748. package/node_modules/@orient-cli/tui/README.md +767 -0
  749. package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts +52 -0
  750. package/node_modules/@orient-cli/tui/dist/autocomplete.d.ts.map +1 -0
  751. package/node_modules/@orient-cli/tui/dist/autocomplete.js +623 -0
  752. package/node_modules/@orient-cli/tui/dist/autocomplete.js.map +1 -0
  753. package/node_modules/@orient-cli/tui/dist/components/box.d.ts +22 -0
  754. package/node_modules/@orient-cli/tui/dist/components/box.d.ts.map +1 -0
  755. package/node_modules/@orient-cli/tui/dist/components/box.js +104 -0
  756. package/node_modules/@orient-cli/tui/dist/components/box.js.map +1 -0
  757. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts +22 -0
  758. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.d.ts.map +1 -0
  759. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js +35 -0
  760. package/node_modules/@orient-cli/tui/dist/components/cancellable-loader.js.map +1 -0
  761. package/node_modules/@orient-cli/tui/dist/components/editor.d.ts +244 -0
  762. package/node_modules/@orient-cli/tui/dist/components/editor.d.ts.map +1 -0
  763. package/node_modules/@orient-cli/tui/dist/components/editor.js +1861 -0
  764. package/node_modules/@orient-cli/tui/dist/components/editor.js.map +1 -0
  765. package/node_modules/@orient-cli/tui/dist/components/image.d.ts +28 -0
  766. package/node_modules/@orient-cli/tui/dist/components/image.d.ts.map +1 -0
  767. package/node_modules/@orient-cli/tui/dist/components/image.js +69 -0
  768. package/node_modules/@orient-cli/tui/dist/components/image.js.map +1 -0
  769. package/node_modules/@orient-cli/tui/dist/components/input.d.ts +37 -0
  770. package/node_modules/@orient-cli/tui/dist/components/input.d.ts.map +1 -0
  771. package/node_modules/@orient-cli/tui/dist/components/input.js +426 -0
  772. package/node_modules/@orient-cli/tui/dist/components/input.js.map +1 -0
  773. package/node_modules/@orient-cli/tui/dist/components/loader.d.ts +21 -0
  774. package/node_modules/@orient-cli/tui/dist/components/loader.d.ts.map +1 -0
  775. package/node_modules/@orient-cli/tui/dist/components/loader.js +49 -0
  776. package/node_modules/@orient-cli/tui/dist/components/loader.js.map +1 -0
  777. package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts +95 -0
  778. package/node_modules/@orient-cli/tui/dist/components/markdown.d.ts.map +1 -0
  779. package/node_modules/@orient-cli/tui/dist/components/markdown.js +663 -0
  780. package/node_modules/@orient-cli/tui/dist/components/markdown.js.map +1 -0
  781. package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts +50 -0
  782. package/node_modules/@orient-cli/tui/dist/components/select-list.d.ts.map +1 -0
  783. package/node_modules/@orient-cli/tui/dist/components/select-list.js +159 -0
  784. package/node_modules/@orient-cli/tui/dist/components/select-list.js.map +1 -0
  785. package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts +50 -0
  786. package/node_modules/@orient-cli/tui/dist/components/settings-list.d.ts.map +1 -0
  787. package/node_modules/@orient-cli/tui/dist/components/settings-list.js +185 -0
  788. package/node_modules/@orient-cli/tui/dist/components/settings-list.js.map +1 -0
  789. package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts +12 -0
  790. package/node_modules/@orient-cli/tui/dist/components/spacer.d.ts.map +1 -0
  791. package/node_modules/@orient-cli/tui/dist/components/spacer.js +23 -0
  792. package/node_modules/@orient-cli/tui/dist/components/spacer.js.map +1 -0
  793. package/node_modules/@orient-cli/tui/dist/components/text.d.ts +19 -0
  794. package/node_modules/@orient-cli/tui/dist/components/text.d.ts.map +1 -0
  795. package/node_modules/@orient-cli/tui/dist/components/text.js +89 -0
  796. package/node_modules/@orient-cli/tui/dist/components/text.js.map +1 -0
  797. package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts +13 -0
  798. package/node_modules/@orient-cli/tui/dist/components/truncated-text.d.ts.map +1 -0
  799. package/node_modules/@orient-cli/tui/dist/components/truncated-text.js +51 -0
  800. package/node_modules/@orient-cli/tui/dist/components/truncated-text.js.map +1 -0
  801. package/node_modules/@orient-cli/tui/dist/editor-component.d.ts +39 -0
  802. package/node_modules/@orient-cli/tui/dist/editor-component.d.ts.map +1 -0
  803. package/node_modules/@orient-cli/tui/dist/editor-component.js +2 -0
  804. package/node_modules/@orient-cli/tui/dist/editor-component.js.map +1 -0
  805. package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts +16 -0
  806. package/node_modules/@orient-cli/tui/dist/fuzzy.d.ts.map +1 -0
  807. package/node_modules/@orient-cli/tui/dist/fuzzy.js +107 -0
  808. package/node_modules/@orient-cli/tui/dist/fuzzy.js.map +1 -0
  809. package/node_modules/@orient-cli/tui/dist/index.d.ts +23 -0
  810. package/node_modules/@orient-cli/tui/dist/index.d.ts.map +1 -0
  811. package/node_modules/@orient-cli/tui/dist/index.js +32 -0
  812. package/node_modules/@orient-cli/tui/dist/index.js.map +1 -0
  813. package/node_modules/@orient-cli/tui/dist/keybindings.d.ts +193 -0
  814. package/node_modules/@orient-cli/tui/dist/keybindings.d.ts.map +1 -0
  815. package/node_modules/@orient-cli/tui/dist/keybindings.js +174 -0
  816. package/node_modules/@orient-cli/tui/dist/keybindings.js.map +1 -0
  817. package/node_modules/@orient-cli/tui/dist/keys.d.ts +170 -0
  818. package/node_modules/@orient-cli/tui/dist/keys.d.ts.map +1 -0
  819. package/node_modules/@orient-cli/tui/dist/keys.js +1124 -0
  820. package/node_modules/@orient-cli/tui/dist/keys.js.map +1 -0
  821. package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts +28 -0
  822. package/node_modules/@orient-cli/tui/dist/kill-ring.d.ts.map +1 -0
  823. package/node_modules/@orient-cli/tui/dist/kill-ring.js +44 -0
  824. package/node_modules/@orient-cli/tui/dist/kill-ring.js.map +1 -0
  825. package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts +48 -0
  826. package/node_modules/@orient-cli/tui/dist/stdin-buffer.d.ts.map +1 -0
  827. package/node_modules/@orient-cli/tui/dist/stdin-buffer.js +317 -0
  828. package/node_modules/@orient-cli/tui/dist/stdin-buffer.js.map +1 -0
  829. package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts +68 -0
  830. package/node_modules/@orient-cli/tui/dist/terminal-image.d.ts.map +1 -0
  831. package/node_modules/@orient-cli/tui/dist/terminal-image.js +288 -0
  832. package/node_modules/@orient-cli/tui/dist/terminal-image.js.map +1 -0
  833. package/node_modules/@orient-cli/tui/dist/terminal.d.ts +84 -0
  834. package/node_modules/@orient-cli/tui/dist/terminal.d.ts.map +1 -0
  835. package/node_modules/@orient-cli/tui/dist/terminal.js +285 -0
  836. package/node_modules/@orient-cli/tui/dist/terminal.js.map +1 -0
  837. package/node_modules/@orient-cli/tui/dist/tui.d.ts +222 -0
  838. package/node_modules/@orient-cli/tui/dist/tui.d.ts.map +1 -0
  839. package/node_modules/@orient-cli/tui/dist/tui.js +1008 -0
  840. package/node_modules/@orient-cli/tui/dist/tui.js.map +1 -0
  841. package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts +17 -0
  842. package/node_modules/@orient-cli/tui/dist/undo-stack.d.ts.map +1 -0
  843. package/node_modules/@orient-cli/tui/dist/undo-stack.js +25 -0
  844. package/node_modules/@orient-cli/tui/dist/undo-stack.js.map +1 -0
  845. package/node_modules/@orient-cli/tui/dist/utils.d.ts +78 -0
  846. package/node_modules/@orient-cli/tui/dist/utils.d.ts.map +1 -0
  847. package/node_modules/@orient-cli/tui/dist/utils.js +960 -0
  848. package/node_modules/@orient-cli/tui/dist/utils.js.map +1 -0
  849. package/node_modules/@orient-cli/tui/package.json +52 -0
  850. package/package.json +47 -8
  851. package/schemas/orient-standard/templates-tier-1/brief.md +22 -0
  852. package/schemas/orient-standard/templates-tier-1/plan.md +17 -0
  853. package/schemas/orient-standard/templates-tier-1/spec.md +23 -0
  854. package/schemas/orient-standard/templates-tier-1/tasks.md +14 -0
  855. package/schemas/orient-standard/templates-tier-2/brief.md +32 -0
  856. package/schemas/orient-standard/templates-tier-2/plan.md +44 -0
  857. package/schemas/orient-standard/templates-tier-2/spec.md +46 -0
  858. package/schemas/orient-standard/templates-tier-2/tasks.md +34 -0
  859. package/schemas/orient-standard/templates-tier-3/brief.md +54 -0
  860. package/schemas/orient-standard/templates-tier-3/plan.md +67 -0
  861. package/schemas/orient-standard/templates-tier-3/spec.md +65 -0
  862. package/schemas/orient-standard/templates-tier-3/tasks.md +79 -0
@@ -0,0 +1,501 @@
1
+ import { Mistral } from "@mistralai/mistralai";
2
+ import { getEnvApiKey } from "../env-api-keys.js";
3
+ import { calculateCost } from "../models.js";
4
+ import { AssistantMessageEventStream } from "../utils/event-stream.js";
5
+ import { shortHash } from "../utils/hash.js";
6
+ import { parseStreamingJson } from "../utils/json-parse.js";
7
+ import { sanitizeSurrogates } from "../utils/sanitize-unicode.js";
8
+ import { buildBaseOptions, clampReasoning } from "./simple-options.js";
9
+ import { transformMessages } from "./transform-messages.js";
10
+ const MISTRAL_TOOL_CALL_ID_LENGTH = 9;
11
+ const MAX_MISTRAL_ERROR_BODY_CHARS = 4000;
12
+ /**
13
+ * Stream responses from Mistral using `chat.stream`.
14
+ */
15
+ export const streamMistral = (model, context, options) => {
16
+ const stream = new AssistantMessageEventStream();
17
+ (async () => {
18
+ const output = createOutput(model);
19
+ try {
20
+ const apiKey = options?.apiKey || getEnvApiKey(model.provider);
21
+ if (!apiKey) {
22
+ throw new Error(`No API key for provider: ${model.provider}`);
23
+ }
24
+ // Intentionally per-request: avoids shared SDK mutable state across concurrent consumers.
25
+ const mistral = new Mistral({
26
+ apiKey,
27
+ serverURL: model.baseUrl,
28
+ });
29
+ const normalizeMistralToolCallId = createMistralToolCallIdNormalizer();
30
+ const transformedMessages = transformMessages(context.messages, model, (id) => normalizeMistralToolCallId(id));
31
+ let payload = buildChatPayload(model, context, transformedMessages, options);
32
+ const nextPayload = await options?.onPayload?.(payload, model);
33
+ if (nextPayload !== undefined) {
34
+ payload = nextPayload;
35
+ }
36
+ const mistralStream = await mistral.chat.stream(payload, buildRequestOptions(model, options));
37
+ stream.push({ type: "start", partial: output });
38
+ await consumeChatStream(model, output, stream, mistralStream);
39
+ if (options?.signal?.aborted) {
40
+ throw new Error("Request was aborted");
41
+ }
42
+ if (output.stopReason === "aborted" || output.stopReason === "error") {
43
+ throw new Error("An unknown error occurred");
44
+ }
45
+ stream.push({ type: "done", reason: output.stopReason, message: output });
46
+ stream.end();
47
+ }
48
+ catch (error) {
49
+ output.stopReason = options?.signal?.aborted ? "aborted" : "error";
50
+ output.errorMessage = formatMistralError(error);
51
+ stream.push({ type: "error", reason: output.stopReason, error: output });
52
+ stream.end();
53
+ }
54
+ })();
55
+ return stream;
56
+ };
57
+ /**
58
+ * Maps provider-agnostic `SimpleStreamOptions` to Mistral options.
59
+ */
60
+ export const streamSimpleMistral = (model, context, options) => {
61
+ const apiKey = options?.apiKey || getEnvApiKey(model.provider);
62
+ if (!apiKey) {
63
+ throw new Error(`No API key for provider: ${model.provider}`);
64
+ }
65
+ const base = buildBaseOptions(model, options, apiKey);
66
+ const reasoning = clampReasoning(options?.reasoning);
67
+ return streamMistral(model, context, {
68
+ ...base,
69
+ promptMode: model.reasoning && reasoning ? "reasoning" : undefined,
70
+ });
71
+ };
72
+ function createOutput(model) {
73
+ return {
74
+ role: "assistant",
75
+ content: [],
76
+ api: model.api,
77
+ provider: model.provider,
78
+ model: model.id,
79
+ usage: {
80
+ input: 0,
81
+ output: 0,
82
+ cacheRead: 0,
83
+ cacheWrite: 0,
84
+ totalTokens: 0,
85
+ cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0, total: 0 },
86
+ },
87
+ stopReason: "stop",
88
+ timestamp: Date.now(),
89
+ };
90
+ }
91
+ function createMistralToolCallIdNormalizer() {
92
+ const idMap = new Map();
93
+ const reverseMap = new Map();
94
+ return (id) => {
95
+ const existing = idMap.get(id);
96
+ if (existing)
97
+ return existing;
98
+ let attempt = 0;
99
+ while (true) {
100
+ const candidate = deriveMistralToolCallId(id, attempt);
101
+ const owner = reverseMap.get(candidate);
102
+ if (!owner || owner === id) {
103
+ idMap.set(id, candidate);
104
+ reverseMap.set(candidate, id);
105
+ return candidate;
106
+ }
107
+ attempt++;
108
+ }
109
+ };
110
+ }
111
+ function deriveMistralToolCallId(id, attempt) {
112
+ const normalized = id.replace(/[^a-zA-Z0-9]/g, "");
113
+ if (attempt === 0 && normalized.length === MISTRAL_TOOL_CALL_ID_LENGTH)
114
+ return normalized;
115
+ const seedBase = normalized || id;
116
+ const seed = attempt === 0 ? seedBase : `${seedBase}:${attempt}`;
117
+ return shortHash(seed)
118
+ .replace(/[^a-zA-Z0-9]/g, "")
119
+ .slice(0, MISTRAL_TOOL_CALL_ID_LENGTH);
120
+ }
121
+ function formatMistralError(error) {
122
+ if (error instanceof Error) {
123
+ const sdkError = error;
124
+ const statusCode = typeof sdkError.statusCode === "number" ? sdkError.statusCode : undefined;
125
+ const bodyText = typeof sdkError.body === "string" ? sdkError.body.trim() : undefined;
126
+ if (statusCode !== undefined && bodyText) {
127
+ return `Mistral API error (${statusCode}): ${truncateErrorText(bodyText, MAX_MISTRAL_ERROR_BODY_CHARS)}`;
128
+ }
129
+ if (statusCode !== undefined)
130
+ return `Mistral API error (${statusCode}): ${error.message}`;
131
+ return error.message;
132
+ }
133
+ return safeJsonStringify(error);
134
+ }
135
+ function truncateErrorText(text, maxChars) {
136
+ if (text.length <= maxChars)
137
+ return text;
138
+ return `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;
139
+ }
140
+ function safeJsonStringify(value) {
141
+ try {
142
+ const serialized = JSON.stringify(value);
143
+ return serialized === undefined ? String(value) : serialized;
144
+ }
145
+ catch {
146
+ return String(value);
147
+ }
148
+ }
149
+ function buildRequestOptions(model, options) {
150
+ const requestOptions = {};
151
+ if (options?.signal)
152
+ requestOptions.signal = options.signal;
153
+ requestOptions.retries = { strategy: "none" };
154
+ const headers = {};
155
+ if (model.headers)
156
+ Object.assign(headers, model.headers);
157
+ if (options?.headers)
158
+ Object.assign(headers, options.headers);
159
+ // Mistral infrastructure uses `x-affinity` for KV-cache reuse (prefix caching).
160
+ // Respect explicit caller-provided header values.
161
+ if (options?.sessionId && !headers["x-affinity"]) {
162
+ headers["x-affinity"] = options.sessionId;
163
+ }
164
+ if (Object.keys(headers).length > 0) {
165
+ requestOptions.headers = headers;
166
+ }
167
+ return requestOptions;
168
+ }
169
+ function buildChatPayload(model, context, messages, options) {
170
+ const payload = {
171
+ model: model.id,
172
+ stream: true,
173
+ messages: toChatMessages(messages, model.input.includes("image")),
174
+ };
175
+ if (context.tools?.length)
176
+ payload.tools = toFunctionTools(context.tools);
177
+ if (options?.temperature !== undefined)
178
+ payload.temperature = options.temperature;
179
+ if (options?.maxTokens !== undefined)
180
+ payload.maxTokens = options.maxTokens;
181
+ if (options?.toolChoice)
182
+ payload.toolChoice = mapToolChoice(options.toolChoice);
183
+ if (options?.promptMode)
184
+ payload.promptMode = options.promptMode;
185
+ if (context.systemPrompt) {
186
+ payload.messages.unshift({
187
+ role: "system",
188
+ content: sanitizeSurrogates(context.systemPrompt),
189
+ });
190
+ }
191
+ return payload;
192
+ }
193
+ async function consumeChatStream(model, output, stream, mistralStream) {
194
+ let currentBlock = null;
195
+ const blocks = output.content;
196
+ const blockIndex = () => blocks.length - 1;
197
+ const toolBlocksByKey = new Map();
198
+ const finishCurrentBlock = (block) => {
199
+ if (!block)
200
+ return;
201
+ if (block.type === "text") {
202
+ stream.push({
203
+ type: "text_end",
204
+ contentIndex: blockIndex(),
205
+ content: block.text,
206
+ partial: output,
207
+ });
208
+ return;
209
+ }
210
+ if (block.type === "thinking") {
211
+ stream.push({
212
+ type: "thinking_end",
213
+ contentIndex: blockIndex(),
214
+ content: block.thinking,
215
+ partial: output,
216
+ });
217
+ }
218
+ };
219
+ for await (const event of mistralStream) {
220
+ const chunk = event.data;
221
+ // Mistral's streamed CompletionChunk carries an id field. Keep the first non-empty one,
222
+ // mirroring how OpenAI-style streaming exposes a stable response identifier per stream.
223
+ output.responseId ||= chunk.id;
224
+ if (chunk.usage) {
225
+ output.usage.input = chunk.usage.promptTokens || 0;
226
+ output.usage.output = chunk.usage.completionTokens || 0;
227
+ output.usage.cacheRead = 0;
228
+ output.usage.cacheWrite = 0;
229
+ output.usage.totalTokens = chunk.usage.totalTokens || output.usage.input + output.usage.output;
230
+ calculateCost(model, output.usage);
231
+ }
232
+ const choice = chunk.choices[0];
233
+ if (!choice)
234
+ continue;
235
+ if (choice.finishReason) {
236
+ output.stopReason = mapChatStopReason(choice.finishReason);
237
+ }
238
+ const delta = choice.delta;
239
+ if (delta.content !== null && delta.content !== undefined) {
240
+ const contentItems = typeof delta.content === "string" ? [delta.content] : delta.content;
241
+ for (const item of contentItems) {
242
+ if (typeof item === "string") {
243
+ const textDelta = sanitizeSurrogates(item);
244
+ if (!currentBlock || currentBlock.type !== "text") {
245
+ finishCurrentBlock(currentBlock);
246
+ currentBlock = { type: "text", text: "" };
247
+ output.content.push(currentBlock);
248
+ stream.push({ type: "text_start", contentIndex: blockIndex(), partial: output });
249
+ }
250
+ currentBlock.text += textDelta;
251
+ stream.push({
252
+ type: "text_delta",
253
+ contentIndex: blockIndex(),
254
+ delta: textDelta,
255
+ partial: output,
256
+ });
257
+ continue;
258
+ }
259
+ if (item.type === "thinking") {
260
+ const deltaText = item.thinking
261
+ .map((part) => ("text" in part ? part.text : ""))
262
+ .filter((text) => text.length > 0)
263
+ .join("");
264
+ const thinkingDelta = sanitizeSurrogates(deltaText);
265
+ if (!thinkingDelta)
266
+ continue;
267
+ if (!currentBlock || currentBlock.type !== "thinking") {
268
+ finishCurrentBlock(currentBlock);
269
+ currentBlock = { type: "thinking", thinking: "" };
270
+ output.content.push(currentBlock);
271
+ stream.push({ type: "thinking_start", contentIndex: blockIndex(), partial: output });
272
+ }
273
+ currentBlock.thinking += thinkingDelta;
274
+ stream.push({
275
+ type: "thinking_delta",
276
+ contentIndex: blockIndex(),
277
+ delta: thinkingDelta,
278
+ partial: output,
279
+ });
280
+ continue;
281
+ }
282
+ if (item.type === "text") {
283
+ const textDelta = sanitizeSurrogates(item.text);
284
+ if (!currentBlock || currentBlock.type !== "text") {
285
+ finishCurrentBlock(currentBlock);
286
+ currentBlock = { type: "text", text: "" };
287
+ output.content.push(currentBlock);
288
+ stream.push({ type: "text_start", contentIndex: blockIndex(), partial: output });
289
+ }
290
+ currentBlock.text += textDelta;
291
+ stream.push({
292
+ type: "text_delta",
293
+ contentIndex: blockIndex(),
294
+ delta: textDelta,
295
+ partial: output,
296
+ });
297
+ }
298
+ }
299
+ }
300
+ const toolCalls = delta.toolCalls || [];
301
+ for (const toolCall of toolCalls) {
302
+ if (currentBlock) {
303
+ finishCurrentBlock(currentBlock);
304
+ currentBlock = null;
305
+ }
306
+ const callId = toolCall.id && toolCall.id !== "null"
307
+ ? toolCall.id
308
+ : deriveMistralToolCallId(`toolcall:${toolCall.index ?? 0}`, 0);
309
+ const key = `${callId}:${toolCall.index || 0}`;
310
+ const existingIndex = toolBlocksByKey.get(key);
311
+ let block;
312
+ if (existingIndex !== undefined) {
313
+ const existing = output.content[existingIndex];
314
+ if (existing?.type === "toolCall") {
315
+ block = existing;
316
+ }
317
+ }
318
+ if (!block) {
319
+ block = {
320
+ type: "toolCall",
321
+ id: callId,
322
+ name: toolCall.function.name,
323
+ arguments: {},
324
+ partialArgs: "",
325
+ };
326
+ output.content.push(block);
327
+ toolBlocksByKey.set(key, output.content.length - 1);
328
+ stream.push({ type: "toolcall_start", contentIndex: output.content.length - 1, partial: output });
329
+ }
330
+ const argsDelta = typeof toolCall.function.arguments === "string"
331
+ ? toolCall.function.arguments
332
+ : JSON.stringify(toolCall.function.arguments || {});
333
+ block.partialArgs = (block.partialArgs || "") + argsDelta;
334
+ block.arguments = parseStreamingJson(block.partialArgs);
335
+ stream.push({
336
+ type: "toolcall_delta",
337
+ contentIndex: toolBlocksByKey.get(key),
338
+ delta: argsDelta,
339
+ partial: output,
340
+ });
341
+ }
342
+ }
343
+ finishCurrentBlock(currentBlock);
344
+ for (const index of toolBlocksByKey.values()) {
345
+ const block = output.content[index];
346
+ if (block.type !== "toolCall")
347
+ continue;
348
+ const toolBlock = block;
349
+ toolBlock.arguments = parseStreamingJson(toolBlock.partialArgs);
350
+ delete toolBlock.partialArgs;
351
+ stream.push({
352
+ type: "toolcall_end",
353
+ contentIndex: index,
354
+ toolCall: toolBlock,
355
+ partial: output,
356
+ });
357
+ }
358
+ }
359
+ function toFunctionTools(tools) {
360
+ return tools.map((tool) => ({
361
+ type: "function",
362
+ function: {
363
+ name: tool.name,
364
+ description: tool.description,
365
+ parameters: tool.parameters,
366
+ strict: false,
367
+ },
368
+ }));
369
+ }
370
+ function toChatMessages(messages, supportsImages) {
371
+ const result = [];
372
+ for (const msg of messages) {
373
+ if (msg.role === "user") {
374
+ if (typeof msg.content === "string") {
375
+ result.push({ role: "user", content: sanitizeSurrogates(msg.content) });
376
+ continue;
377
+ }
378
+ const hadImages = msg.content.some((item) => item.type === "image");
379
+ const content = msg.content
380
+ .filter((item) => item.type === "text" || supportsImages)
381
+ .map((item) => {
382
+ if (item.type === "text")
383
+ return { type: "text", text: sanitizeSurrogates(item.text) };
384
+ return { type: "image_url", imageUrl: `data:${item.mimeType};base64,${item.data}` };
385
+ });
386
+ if (content.length > 0) {
387
+ result.push({ role: "user", content });
388
+ continue;
389
+ }
390
+ if (hadImages && !supportsImages) {
391
+ result.push({ role: "user", content: "(image omitted: model does not support images)" });
392
+ }
393
+ continue;
394
+ }
395
+ if (msg.role === "assistant") {
396
+ const contentParts = [];
397
+ const toolCalls = [];
398
+ for (const block of msg.content) {
399
+ if (block.type === "text") {
400
+ if (block.text.trim().length > 0) {
401
+ contentParts.push({ type: "text", text: sanitizeSurrogates(block.text) });
402
+ }
403
+ continue;
404
+ }
405
+ if (block.type === "thinking") {
406
+ if (block.thinking.trim().length > 0) {
407
+ contentParts.push({
408
+ type: "thinking",
409
+ thinking: [{ type: "text", text: sanitizeSurrogates(block.thinking) }],
410
+ });
411
+ }
412
+ continue;
413
+ }
414
+ toolCalls.push({
415
+ id: block.id,
416
+ type: "function",
417
+ function: { name: block.name, arguments: JSON.stringify(block.arguments || {}) },
418
+ });
419
+ }
420
+ const assistantMessage = { role: "assistant" };
421
+ if (contentParts.length > 0)
422
+ assistantMessage.content = contentParts;
423
+ if (toolCalls.length > 0)
424
+ assistantMessage.toolCalls = toolCalls;
425
+ if (contentParts.length > 0 || toolCalls.length > 0)
426
+ result.push(assistantMessage);
427
+ continue;
428
+ }
429
+ const toolContent = [];
430
+ const textResult = msg.content
431
+ .filter((part) => part.type === "text")
432
+ .map((part) => (part.type === "text" ? sanitizeSurrogates(part.text) : ""))
433
+ .join("\n");
434
+ const hasImages = msg.content.some((part) => part.type === "image");
435
+ const toolText = buildToolResultText(textResult, hasImages, supportsImages, msg.isError);
436
+ toolContent.push({ type: "text", text: toolText });
437
+ for (const part of msg.content) {
438
+ if (!supportsImages)
439
+ continue;
440
+ if (part.type !== "image")
441
+ continue;
442
+ toolContent.push({
443
+ type: "image_url",
444
+ imageUrl: `data:${part.mimeType};base64,${part.data}`,
445
+ });
446
+ }
447
+ result.push({
448
+ role: "tool",
449
+ toolCallId: msg.toolCallId,
450
+ name: msg.toolName,
451
+ content: toolContent,
452
+ });
453
+ }
454
+ return result;
455
+ }
456
+ function buildToolResultText(text, hasImages, supportsImages, isError) {
457
+ const trimmed = text.trim();
458
+ const errorPrefix = isError ? "[tool error] " : "";
459
+ if (trimmed.length > 0) {
460
+ const imageSuffix = hasImages && !supportsImages ? "\n[tool image omitted: model does not support images]" : "";
461
+ return `${errorPrefix}${trimmed}${imageSuffix}`;
462
+ }
463
+ if (hasImages) {
464
+ if (supportsImages) {
465
+ return isError ? "[tool error] (see attached image)" : "(see attached image)";
466
+ }
467
+ return isError
468
+ ? "[tool error] (image omitted: model does not support images)"
469
+ : "(image omitted: model does not support images)";
470
+ }
471
+ return isError ? "[tool error] (no tool output)" : "(no tool output)";
472
+ }
473
+ function mapToolChoice(choice) {
474
+ if (!choice)
475
+ return undefined;
476
+ if (choice === "auto" || choice === "none" || choice === "any" || choice === "required") {
477
+ return choice;
478
+ }
479
+ return {
480
+ type: "function",
481
+ function: { name: choice.function.name },
482
+ };
483
+ }
484
+ function mapChatStopReason(reason) {
485
+ if (reason === null)
486
+ return "stop";
487
+ switch (reason) {
488
+ case "stop":
489
+ return "stop";
490
+ case "length":
491
+ case "model_length":
492
+ return "length";
493
+ case "tool_calls":
494
+ return "toolUse";
495
+ case "error":
496
+ return "error";
497
+ default:
498
+ return "stop";
499
+ }
500
+ }
501
+ //# sourceMappingURL=mistral.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mistral.js","sourceRoot":"","sources":["../../src/providers/mistral.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAA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AC,6DAA6D;YAC/D,CAAC,CAAC,gDAAgD,CAAC;IACrD,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,kBAAkB,CAAC;AAAA,CACtE;AAED,SAAS,aAAa,CACrB,MAAoC,EACkE;IACtG,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,MAAM,IAAI,MAAM,KAAK,KAAK,IAAI,MAAM,KAAK,UAAU,EAAE,CAAC;QACzF,OAAO,MAAa,CAAC;IACtB,CAAC;IACD,OAAO;QACN,IAAI,EAAE,UAAU;QAChB,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE;KACxC,CAAC;AAAA,CACF;AAED,SAAS,iBAAiB,CAAC,MAAqB,EAAc;IAC7D,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,MAAM,CAAC;IACnC,QAAQ,MAAM,EAAE,CAAC;QAChB,KAAK,MAAM;YACV,OAAO,MAAM,CAAC;QACf,KAAK,QAAQ,CAAC;QACd,KAAK,cAAc;YAClB,OAAO,QAAQ,CAAC;QACjB,KAAK,YAAY;YAChB,OAAO,SAAS,CAAC;QAClB,KAAK,OAAO;YACX,OAAO,OAAO,CAAC;QAChB;YACC,OAAO,MAAM,CAAC;IAChB,CAAC;AAAA,CACD","sourcesContent":["import { Mistral } from \"@mistralai/mistralai\";\nimport type { RequestOptions } from \"@mistralai/mistralai/lib/sdks.js\";\nimport type {\n\tChatCompletionStreamRequest,\n\tChatCompletionStreamRequestMessages,\n\tCompletionEvent,\n\tContentChunk,\n\tFunctionTool,\n} from \"@mistralai/mistralai/models/components/index.js\";\nimport { getEnvApiKey } from \"../env-api-keys.js\";\nimport { calculateCost } from \"../models.js\";\nimport type {\n\tAssistantMessage,\n\tContext,\n\tMessage,\n\tModel,\n\tSimpleStreamOptions,\n\tStopReason,\n\tStreamFunction,\n\tStreamOptions,\n\tTextContent,\n\tThinkingContent,\n\tTool,\n\tToolCall,\n} from \"../types.js\";\nimport { AssistantMessageEventStream } from \"../utils/event-stream.js\";\nimport { shortHash } from \"../utils/hash.js\";\nimport { parseStreamingJson } from \"../utils/json-parse.js\";\nimport { sanitizeSurrogates } from \"../utils/sanitize-unicode.js\";\nimport { buildBaseOptions, clampReasoning } from \"./simple-options.js\";\nimport { transformMessages } from \"./transform-messages.js\";\n\nconst MISTRAL_TOOL_CALL_ID_LENGTH = 9;\nconst MAX_MISTRAL_ERROR_BODY_CHARS = 4000;\n\n/**\n * Provider-specific options for the Mistral API.\n */\nexport interface MistralOptions extends StreamOptions {\n\ttoolChoice?: \"auto\" | \"none\" | \"any\" | \"required\" | { type: \"function\"; function: { name: string } };\n\tpromptMode?: \"reasoning\";\n}\n\n/**\n * Stream responses from Mistral using `chat.stream`.\n */\nexport const streamMistral: StreamFunction<\"mistral-conversations\", MistralOptions> = (\n\tmodel: Model<\"mistral-conversations\">,\n\tcontext: Context,\n\toptions?: MistralOptions,\n): AssistantMessageEventStream => {\n\tconst stream = new AssistantMessageEventStream();\n\n\t(async () => {\n\t\tconst output = createOutput(model);\n\n\t\ttry {\n\t\t\tconst apiKey = options?.apiKey || getEnvApiKey(model.provider);\n\t\t\tif (!apiKey) {\n\t\t\t\tthrow new Error(`No API key for provider: ${model.provider}`);\n\t\t\t}\n\n\t\t\t// Intentionally per-request: avoids shared SDK mutable state across concurrent consumers.\n\t\t\tconst mistral = new Mistral({\n\t\t\t\tapiKey,\n\t\t\t\tserverURL: model.baseUrl,\n\t\t\t});\n\n\t\t\tconst normalizeMistralToolCallId = createMistralToolCallIdNormalizer();\n\t\t\tconst transformedMessages = transformMessages(context.messages, model, (id) => normalizeMistralToolCallId(id));\n\n\t\t\tlet payload = buildChatPayload(model, context, transformedMessages, options);\n\t\t\tconst nextPayload = await options?.onPayload?.(payload, model);\n\t\t\tif (nextPayload !== undefined) {\n\t\t\t\tpayload = nextPayload as ChatCompletionStreamRequest;\n\t\t\t}\n\t\t\tconst mistralStream = await mistral.chat.stream(payload, buildRequestOptions(model, options));\n\t\t\tstream.push({ type: \"start\", partial: output });\n\t\t\tawait consumeChatStream(model, output, stream, mistralStream);\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\toutput.stopReason = options?.signal?.aborted ? \"aborted\" : \"error\";\n\t\t\toutput.errorMessage = formatMistralError(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\n/**\n * Maps provider-agnostic `SimpleStreamOptions` to Mistral options.\n */\nexport const streamSimpleMistral: StreamFunction<\"mistral-conversations\", SimpleStreamOptions> = (\n\tmodel: Model<\"mistral-conversations\">,\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 reasoning = clampReasoning(options?.reasoning);\n\n\treturn streamMistral(model, context, {\n\t\t...base,\n\t\tpromptMode: model.reasoning && reasoning ? \"reasoning\" : undefined,\n\t} satisfies MistralOptions);\n};\n\nfunction createOutput(model: Model<\"mistral-conversations\">): 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: \"stop\",\n\t\ttimestamp: Date.now(),\n\t};\n}\n\nfunction createMistralToolCallIdNormalizer(): (id: string) => string {\n\tconst idMap = new Map<string, string>();\n\tconst reverseMap = new Map<string, string>();\n\n\treturn (id: string): string => {\n\t\tconst existing = idMap.get(id);\n\t\tif (existing) return existing;\n\n\t\tlet attempt = 0;\n\t\twhile (true) {\n\t\t\tconst candidate = deriveMistralToolCallId(id, attempt);\n\t\t\tconst owner = reverseMap.get(candidate);\n\t\t\tif (!owner || owner === id) {\n\t\t\t\tidMap.set(id, candidate);\n\t\t\t\treverseMap.set(candidate, id);\n\t\t\t\treturn candidate;\n\t\t\t}\n\t\t\tattempt++;\n\t\t}\n\t};\n}\n\nfunction deriveMistralToolCallId(id: string, attempt: number): string {\n\tconst normalized = id.replace(/[^a-zA-Z0-9]/g, \"\");\n\tif (attempt === 0 && normalized.length === MISTRAL_TOOL_CALL_ID_LENGTH) return normalized;\n\tconst seedBase = normalized || id;\n\tconst seed = attempt === 0 ? seedBase : `${seedBase}:${attempt}`;\n\treturn shortHash(seed)\n\t\t.replace(/[^a-zA-Z0-9]/g, \"\")\n\t\t.slice(0, MISTRAL_TOOL_CALL_ID_LENGTH);\n}\n\nfunction formatMistralError(error: unknown): string {\n\tif (error instanceof Error) {\n\t\tconst sdkError = error as Error & { statusCode?: unknown; body?: unknown };\n\t\tconst statusCode = typeof sdkError.statusCode === \"number\" ? sdkError.statusCode : undefined;\n\t\tconst bodyText = typeof sdkError.body === \"string\" ? sdkError.body.trim() : undefined;\n\t\tif (statusCode !== undefined && bodyText) {\n\t\t\treturn `Mistral API error (${statusCode}): ${truncateErrorText(bodyText, MAX_MISTRAL_ERROR_BODY_CHARS)}`;\n\t\t}\n\t\tif (statusCode !== undefined) return `Mistral API error (${statusCode}): ${error.message}`;\n\t\treturn error.message;\n\t}\n\treturn safeJsonStringify(error);\n}\n\nfunction truncateErrorText(text: string, maxChars: number): string {\n\tif (text.length <= maxChars) return text;\n\treturn `${text.slice(0, maxChars)}... [truncated ${text.length - maxChars} chars]`;\n}\n\nfunction safeJsonStringify(value: unknown): string {\n\ttry {\n\t\tconst serialized = JSON.stringify(value);\n\t\treturn serialized === undefined ? String(value) : serialized;\n\t} catch {\n\t\treturn String(value);\n\t}\n}\n\nfunction buildRequestOptions(model: Model<\"mistral-conversations\">, options?: MistralOptions): RequestOptions {\n\tconst requestOptions: RequestOptions = {};\n\tif (options?.signal) requestOptions.signal = options.signal;\n\trequestOptions.retries = { strategy: \"none\" };\n\n\tconst headers: Record<string, string> = {};\n\tif (model.headers) Object.assign(headers, model.headers);\n\tif (options?.headers) Object.assign(headers, options.headers);\n\n\t// Mistral infrastructure uses `x-affinity` for KV-cache reuse (prefix caching).\n\t// Respect explicit caller-provided header values.\n\tif (options?.sessionId && !headers[\"x-affinity\"]) {\n\t\theaders[\"x-affinity\"] = options.sessionId;\n\t}\n\n\tif (Object.keys(headers).length > 0) {\n\t\trequestOptions.headers = headers;\n\t}\n\n\treturn requestOptions;\n}\n\nfunction buildChatPayload(\n\tmodel: Model<\"mistral-conversations\">,\n\tcontext: Context,\n\tmessages: Message[],\n\toptions?: MistralOptions,\n): ChatCompletionStreamRequest {\n\tconst payload: ChatCompletionStreamRequest = {\n\t\tmodel: model.id,\n\t\tstream: true,\n\t\tmessages: toChatMessages(messages, model.input.includes(\"image\")),\n\t};\n\n\tif (context.tools?.length) payload.tools = toFunctionTools(context.tools);\n\tif (options?.temperature !== undefined) payload.temperature = options.temperature;\n\tif (options?.maxTokens !== undefined) payload.maxTokens = options.maxTokens;\n\tif (options?.toolChoice) payload.toolChoice = mapToolChoice(options.toolChoice);\n\tif (options?.promptMode) payload.promptMode = options.promptMode as any;\n\n\tif (context.systemPrompt) {\n\t\tpayload.messages.unshift({\n\t\t\trole: \"system\",\n\t\t\tcontent: sanitizeSurrogates(context.systemPrompt),\n\t\t});\n\t}\n\n\treturn payload;\n}\n\nasync function consumeChatStream(\n\tmodel: Model<\"mistral-conversations\">,\n\toutput: AssistantMessage,\n\tstream: AssistantMessageEventStream,\n\tmistralStream: AsyncIterable<CompletionEvent>,\n): Promise<void> {\n\tlet currentBlock: TextContent | ThinkingContent | null = null;\n\tconst blocks = output.content;\n\tconst blockIndex = () => blocks.length - 1;\n\tconst toolBlocksByKey = new Map<string, number>();\n\n\tconst finishCurrentBlock = (block?: typeof currentBlock) => {\n\t\tif (!block) return;\n\t\tif (block.type === \"text\") {\n\t\t\tstream.push({\n\t\t\t\ttype: \"text_end\",\n\t\t\t\tcontentIndex: blockIndex(),\n\t\t\t\tcontent: block.text,\n\t\t\t\tpartial: output,\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (block.type === \"thinking\") {\n\t\t\tstream.push({\n\t\t\t\ttype: \"thinking_end\",\n\t\t\t\tcontentIndex: blockIndex(),\n\t\t\t\tcontent: block.thinking,\n\t\t\t\tpartial: output,\n\t\t\t});\n\t\t}\n\t};\n\n\tfor await (const event of mistralStream) {\n\t\tconst chunk = event.data;\n\t\t// Mistral's streamed CompletionChunk carries an id field. Keep the first non-empty one,\n\t\t// mirroring how OpenAI-style streaming exposes a stable response identifier per stream.\n\t\toutput.responseId ||= chunk.id;\n\n\t\tif (chunk.usage) {\n\t\t\toutput.usage.input = chunk.usage.promptTokens || 0;\n\t\t\toutput.usage.output = chunk.usage.completionTokens || 0;\n\t\t\toutput.usage.cacheRead = 0;\n\t\t\toutput.usage.cacheWrite = 0;\n\t\t\toutput.usage.totalTokens = chunk.usage.totalTokens || output.usage.input + output.usage.output;\n\t\t\tcalculateCost(model, output.usage);\n\t\t}\n\n\t\tconst choice = chunk.choices[0];\n\t\tif (!choice) continue;\n\n\t\tif (choice.finishReason) {\n\t\t\toutput.stopReason = mapChatStopReason(choice.finishReason);\n\t\t}\n\n\t\tconst delta = choice.delta;\n\t\tif (delta.content !== null && delta.content !== undefined) {\n\t\t\tconst contentItems = typeof delta.content === \"string\" ? [delta.content] : delta.content;\n\t\t\tfor (const item of contentItems) {\n\t\t\t\tif (typeof item === \"string\") {\n\t\t\t\t\tconst textDelta = sanitizeSurrogates(item);\n\t\t\t\t\tif (!currentBlock || currentBlock.type !== \"text\") {\n\t\t\t\t\t\tfinishCurrentBlock(currentBlock);\n\t\t\t\t\t\tcurrentBlock = { type: \"text\", text: \"\" };\n\t\t\t\t\t\toutput.content.push(currentBlock);\n\t\t\t\t\t\tstream.push({ type: \"text_start\", contentIndex: blockIndex(), partial: output });\n\t\t\t\t\t}\n\t\t\t\t\tcurrentBlock.text += textDelta;\n\t\t\t\t\tstream.push({\n\t\t\t\t\t\ttype: \"text_delta\",\n\t\t\t\t\t\tcontentIndex: blockIndex(),\n\t\t\t\t\t\tdelta: textDelta,\n\t\t\t\t\t\tpartial: output,\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (item.type === \"thinking\") {\n\t\t\t\t\tconst deltaText = item.thinking\n\t\t\t\t\t\t.map((part) => (\"text\" in part ? part.text : \"\"))\n\t\t\t\t\t\t.filter((text) => text.length > 0)\n\t\t\t\t\t\t.join(\"\");\n\t\t\t\t\tconst thinkingDelta = sanitizeSurrogates(deltaText);\n\t\t\t\t\tif (!thinkingDelta) continue;\n\t\t\t\t\tif (!currentBlock || currentBlock.type !== \"thinking\") {\n\t\t\t\t\t\tfinishCurrentBlock(currentBlock);\n\t\t\t\t\t\tcurrentBlock = { type: \"thinking\", thinking: \"\" };\n\t\t\t\t\t\toutput.content.push(currentBlock);\n\t\t\t\t\t\tstream.push({ type: \"thinking_start\", contentIndex: blockIndex(), partial: output });\n\t\t\t\t\t}\n\t\t\t\t\tcurrentBlock.thinking += thinkingDelta;\n\t\t\t\t\tstream.push({\n\t\t\t\t\t\ttype: \"thinking_delta\",\n\t\t\t\t\t\tcontentIndex: blockIndex(),\n\t\t\t\t\t\tdelta: thinkingDelta,\n\t\t\t\t\t\tpartial: output,\n\t\t\t\t\t});\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tif (item.type === \"text\") {\n\t\t\t\t\tconst textDelta = sanitizeSurrogates(item.text);\n\t\t\t\t\tif (!currentBlock || currentBlock.type !== \"text\") {\n\t\t\t\t\t\tfinishCurrentBlock(currentBlock);\n\t\t\t\t\t\tcurrentBlock = { type: \"text\", text: \"\" };\n\t\t\t\t\t\toutput.content.push(currentBlock);\n\t\t\t\t\t\tstream.push({ type: \"text_start\", contentIndex: blockIndex(), partial: output });\n\t\t\t\t\t}\n\t\t\t\t\tcurrentBlock.text += textDelta;\n\t\t\t\t\tstream.push({\n\t\t\t\t\t\ttype: \"text_delta\",\n\t\t\t\t\t\tcontentIndex: blockIndex(),\n\t\t\t\t\t\tdelta: textDelta,\n\t\t\t\t\t\tpartial: output,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tconst toolCalls = delta.toolCalls || [];\n\t\tfor (const toolCall of toolCalls) {\n\t\t\tif (currentBlock) {\n\t\t\t\tfinishCurrentBlock(currentBlock);\n\t\t\t\tcurrentBlock = null;\n\t\t\t}\n\t\t\tconst callId =\n\t\t\t\ttoolCall.id && toolCall.id !== \"null\"\n\t\t\t\t\t? toolCall.id\n\t\t\t\t\t: deriveMistralToolCallId(`toolcall:${toolCall.index ?? 0}`, 0);\n\t\t\tconst key = `${callId}:${toolCall.index || 0}`;\n\t\t\tconst existingIndex = toolBlocksByKey.get(key);\n\t\t\tlet block: (ToolCall & { partialArgs?: string }) | undefined;\n\n\t\t\tif (existingIndex !== undefined) {\n\t\t\t\tconst existing = output.content[existingIndex];\n\t\t\t\tif (existing?.type === \"toolCall\") {\n\t\t\t\t\tblock = existing as ToolCall & { partialArgs?: string };\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (!block) {\n\t\t\t\tblock = {\n\t\t\t\t\ttype: \"toolCall\",\n\t\t\t\t\tid: callId,\n\t\t\t\t\tname: toolCall.function.name,\n\t\t\t\t\targuments: {},\n\t\t\t\t\tpartialArgs: \"\",\n\t\t\t\t};\n\t\t\t\toutput.content.push(block);\n\t\t\t\ttoolBlocksByKey.set(key, output.content.length - 1);\n\t\t\t\tstream.push({ type: \"toolcall_start\", contentIndex: output.content.length - 1, partial: output });\n\t\t\t}\n\n\t\t\tconst argsDelta =\n\t\t\t\ttypeof toolCall.function.arguments === \"string\"\n\t\t\t\t\t? toolCall.function.arguments\n\t\t\t\t\t: JSON.stringify(toolCall.function.arguments || {});\n\t\t\tblock.partialArgs = (block.partialArgs || \"\") + argsDelta;\n\t\t\tblock.arguments = parseStreamingJson<Record<string, unknown>>(block.partialArgs);\n\t\t\tstream.push({\n\t\t\t\ttype: \"toolcall_delta\",\n\t\t\t\tcontentIndex: toolBlocksByKey.get(key)!,\n\t\t\t\tdelta: argsDelta,\n\t\t\t\tpartial: output,\n\t\t\t});\n\t\t}\n\t}\n\n\tfinishCurrentBlock(currentBlock);\n\tfor (const index of toolBlocksByKey.values()) {\n\t\tconst block = output.content[index];\n\t\tif (block.type !== \"toolCall\") continue;\n\t\tconst toolBlock = block as ToolCall & { partialArgs?: string };\n\t\ttoolBlock.arguments = parseStreamingJson<Record<string, unknown>>(toolBlock.partialArgs);\n\t\tdelete toolBlock.partialArgs;\n\t\tstream.push({\n\t\t\ttype: \"toolcall_end\",\n\t\t\tcontentIndex: index,\n\t\t\ttoolCall: toolBlock,\n\t\t\tpartial: output,\n\t\t});\n\t}\n}\n\nfunction toFunctionTools(tools: Tool[]): Array<FunctionTool & { type: \"function\" }> {\n\treturn tools.map((tool) => ({\n\t\ttype: \"function\",\n\t\tfunction: {\n\t\t\tname: tool.name,\n\t\t\tdescription: tool.description,\n\t\t\tparameters: tool.parameters as unknown as Record<string, unknown>,\n\t\t\tstrict: false,\n\t\t},\n\t}));\n}\n\nfunction toChatMessages(messages: Message[], supportsImages: boolean): ChatCompletionStreamRequestMessages[] {\n\tconst result: ChatCompletionStreamRequestMessages[] = [];\n\n\tfor (const msg of messages) {\n\t\tif (msg.role === \"user\") {\n\t\t\tif (typeof msg.content === \"string\") {\n\t\t\t\tresult.push({ role: \"user\", content: sanitizeSurrogates(msg.content) });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst hadImages = msg.content.some((item) => item.type === \"image\");\n\t\t\tconst content: ContentChunk[] = msg.content\n\t\t\t\t.filter((item) => item.type === \"text\" || supportsImages)\n\t\t\t\t.map((item) => {\n\t\t\t\t\tif (item.type === \"text\") return { type: \"text\", text: sanitizeSurrogates(item.text) };\n\t\t\t\t\treturn { type: \"image_url\", imageUrl: `data:${item.mimeType};base64,${item.data}` };\n\t\t\t\t});\n\t\t\tif (content.length > 0) {\n\t\t\t\tresult.push({ role: \"user\", content });\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (hadImages && !supportsImages) {\n\t\t\t\tresult.push({ role: \"user\", content: \"(image omitted: model does not support images)\" });\n\t\t\t}\n\t\t\tcontinue;\n\t\t}\n\n\t\tif (msg.role === \"assistant\") {\n\t\t\tconst contentParts: ContentChunk[] = [];\n\t\t\tconst toolCalls: Array<{ id: string; type: \"function\"; function: { name: string; arguments: string } }> = [];\n\n\t\t\tfor (const block of msg.content) {\n\t\t\t\tif (block.type === \"text\") {\n\t\t\t\t\tif (block.text.trim().length > 0) {\n\t\t\t\t\t\tcontentParts.push({ type: \"text\", text: sanitizeSurrogates(block.text) });\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tif (block.type === \"thinking\") {\n\t\t\t\t\tif (block.thinking.trim().length > 0) {\n\t\t\t\t\t\tcontentParts.push({\n\t\t\t\t\t\t\ttype: \"thinking\",\n\t\t\t\t\t\t\tthinking: [{ type: \"text\", text: sanitizeSurrogates(block.thinking) }],\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\ttoolCalls.push({\n\t\t\t\t\tid: block.id,\n\t\t\t\t\ttype: \"function\",\n\t\t\t\t\tfunction: { name: block.name, arguments: JSON.stringify(block.arguments || {}) },\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst assistantMessage: ChatCompletionStreamRequestMessages = { role: \"assistant\" };\n\t\t\tif (contentParts.length > 0) assistantMessage.content = contentParts;\n\t\t\tif (toolCalls.length > 0) assistantMessage.toolCalls = toolCalls;\n\t\t\tif (contentParts.length > 0 || toolCalls.length > 0) result.push(assistantMessage);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst toolContent: ContentChunk[] = [];\n\t\tconst textResult = msg.content\n\t\t\t.filter((part) => part.type === \"text\")\n\t\t\t.map((part) => (part.type === \"text\" ? sanitizeSurrogates(part.text) : \"\"))\n\t\t\t.join(\"\\n\");\n\t\tconst hasImages = msg.content.some((part) => part.type === \"image\");\n\t\tconst toolText = buildToolResultText(textResult, hasImages, supportsImages, msg.isError);\n\t\ttoolContent.push({ type: \"text\", text: toolText });\n\t\tfor (const part of msg.content) {\n\t\t\tif (!supportsImages) continue;\n\t\t\tif (part.type !== \"image\") continue;\n\t\t\ttoolContent.push({\n\t\t\t\ttype: \"image_url\",\n\t\t\t\timageUrl: `data:${part.mimeType};base64,${part.data}`,\n\t\t\t});\n\t\t}\n\t\tresult.push({\n\t\t\trole: \"tool\",\n\t\t\ttoolCallId: msg.toolCallId,\n\t\t\tname: msg.toolName,\n\t\t\tcontent: toolContent,\n\t\t});\n\t}\n\n\treturn result;\n}\n\nfunction buildToolResultText(text: string, hasImages: boolean, supportsImages: boolean, isError: boolean): string {\n\tconst trimmed = text.trim();\n\tconst errorPrefix = isError ? \"[tool error] \" : \"\";\n\n\tif (trimmed.length > 0) {\n\t\tconst imageSuffix = hasImages && !supportsImages ? \"\\n[tool image omitted: model does not support images]\" : \"\";\n\t\treturn `${errorPrefix}${trimmed}${imageSuffix}`;\n\t}\n\n\tif (hasImages) {\n\t\tif (supportsImages) {\n\t\t\treturn isError ? \"[tool error] (see attached image)\" : \"(see attached image)\";\n\t\t}\n\t\treturn isError\n\t\t\t? \"[tool error] (image omitted: model does not support images)\"\n\t\t\t: \"(image omitted: model does not support images)\";\n\t}\n\n\treturn isError ? \"[tool error] (no tool output)\" : \"(no tool output)\";\n}\n\nfunction mapToolChoice(\n\tchoice: MistralOptions[\"toolChoice\"],\n): \"auto\" | \"none\" | \"any\" | \"required\" | { type: \"function\"; function: { name: string } } | undefined {\n\tif (!choice) return undefined;\n\tif (choice === \"auto\" || choice === \"none\" || choice === \"any\" || choice === \"required\") {\n\t\treturn choice as any;\n\t}\n\treturn {\n\t\ttype: \"function\",\n\t\tfunction: { name: choice.function.name },\n\t};\n}\n\nfunction mapChatStopReason(reason: string | null): StopReason {\n\tif (reason === null) return \"stop\";\n\tswitch (reason) {\n\t\tcase \"stop\":\n\t\t\treturn \"stop\";\n\t\tcase \"length\":\n\t\tcase \"model_length\":\n\t\t\treturn \"length\";\n\t\tcase \"tool_calls\":\n\t\t\treturn \"toolUse\";\n\t\tcase \"error\":\n\t\t\treturn \"error\";\n\t\tdefault:\n\t\t\treturn \"stop\";\n\t}\n}\n"]}
@@ -0,0 +1,9 @@
1
+ import type { SimpleStreamOptions, StreamFunction, StreamOptions } from "../types.js";
2
+ export interface OpenAICodexResponsesOptions extends StreamOptions {
3
+ reasoningEffort?: "none" | "minimal" | "low" | "medium" | "high" | "xhigh";
4
+ reasoningSummary?: "auto" | "concise" | "detailed" | "off" | "on" | null;
5
+ textVerbosity?: "low" | "medium" | "high";
6
+ }
7
+ export declare const streamOpenAICodexResponses: StreamFunction<"openai-codex-responses", OpenAICodexResponsesOptions>;
8
+ export declare const streamSimpleOpenAICodexResponses: StreamFunction<"openai-codex-responses", SimpleStreamOptions>;
9
+ //# sourceMappingURL=openai-codex-responses.d.ts.map