eve 0.5.4 → 0.6.0-beta.3

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 (1743) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/LICENSE +2 -2
  3. package/NOTICE +5 -0
  4. package/README.md +120 -108
  5. package/bin/eve.d.ts +66 -0
  6. package/bin/eve.js +285 -0
  7. package/dist/docs/public/README.md +89 -0
  8. package/dist/docs/public/advanced/auth-and-route-protection.md +270 -0
  9. package/dist/docs/public/advanced/context-control.md +109 -0
  10. package/dist/docs/public/advanced/default-harness.md +94 -0
  11. package/dist/docs/public/advanced/deployment.md +113 -0
  12. package/dist/docs/public/advanced/dev-tui.md +37 -0
  13. package/dist/docs/public/advanced/dynamic-capabilities.md +129 -0
  14. package/dist/docs/public/advanced/dynamic-workflows.md +55 -0
  15. package/dist/docs/public/advanced/evals.md +121 -0
  16. package/dist/docs/public/advanced/execution-model-and-durability.md +48 -0
  17. package/dist/docs/public/advanced/hooks.md +154 -0
  18. package/dist/docs/public/advanced/instrumentation.md +165 -0
  19. package/dist/docs/public/advanced/meta.json +21 -0
  20. package/dist/docs/public/advanced/remote-agents.md +60 -0
  21. package/dist/docs/public/advanced/security-model.md +79 -0
  22. package/dist/docs/public/advanced/session-context.md +149 -0
  23. package/dist/docs/public/advanced/sessions-runs-and-streaming.md +127 -0
  24. package/dist/docs/public/advanced/state.md +62 -0
  25. package/dist/docs/public/agent-config.md +80 -0
  26. package/dist/docs/public/channels/custom.mdx +275 -0
  27. package/dist/docs/public/channels/discord.mdx +74 -0
  28. package/dist/docs/public/channels/eve.mdx +82 -0
  29. package/dist/docs/public/channels/github.mdx +56 -0
  30. package/dist/docs/public/channels/linear.mdx +168 -0
  31. package/dist/docs/public/channels/meta.json +15 -0
  32. package/dist/docs/public/channels/overview.mdx +53 -0
  33. package/dist/docs/public/channels/slack.mdx +92 -0
  34. package/dist/docs/public/channels/teams.mdx +55 -0
  35. package/dist/docs/public/channels/telegram.mdx +56 -0
  36. package/dist/docs/public/channels/twilio.mdx +62 -0
  37. package/dist/docs/public/client/continuations.mdx +126 -0
  38. package/dist/docs/public/client/messages.mdx +152 -0
  39. package/dist/docs/public/client/meta.json +4 -0
  40. package/dist/docs/public/client/output-schema.mdx +135 -0
  41. package/dist/docs/public/client/overview.mdx +116 -0
  42. package/dist/docs/public/client/streaming.mdx +143 -0
  43. package/dist/docs/public/connections.mdx +196 -0
  44. package/dist/docs/public/frontend/meta.json +4 -0
  45. package/dist/docs/public/frontend/nextjs.mdx +79 -0
  46. package/dist/docs/public/frontend/nuxt.mdx +82 -0
  47. package/dist/docs/public/frontend/overview.mdx +234 -0
  48. package/dist/docs/public/frontend/sveltekit.mdx +94 -0
  49. package/dist/docs/public/frontend/use-eve-agent-svelte.mdx +111 -0
  50. package/dist/docs/public/frontend/use-eve-agent-vue.mdx +123 -0
  51. package/dist/docs/public/getting-started.mdx +176 -0
  52. package/dist/docs/public/instructions.mdx +58 -0
  53. package/dist/docs/public/introduction.md +102 -0
  54. package/dist/docs/public/meta.json +22 -0
  55. package/dist/docs/public/reference/cli.md +123 -0
  56. package/dist/docs/public/reference/faqs.md +48 -0
  57. package/dist/docs/public/reference/meta.json +4 -0
  58. package/dist/docs/public/reference/project-layout.md +111 -0
  59. package/dist/docs/public/reference/typescript-api.md +97 -0
  60. package/dist/docs/public/sandbox.mdx +198 -0
  61. package/dist/docs/public/schedules.mdx +104 -0
  62. package/dist/docs/public/skills.mdx +79 -0
  63. package/dist/docs/public/subagents.mdx +76 -0
  64. package/dist/docs/public/tools.mdx +111 -0
  65. package/dist/docs/public/tutorial/connect-a-warehouse.mdx +47 -0
  66. package/dist/docs/public/tutorial/first-agent.mdx +61 -0
  67. package/dist/docs/public/tutorial/guard-the-spend.mdx +59 -0
  68. package/dist/docs/public/tutorial/how-it-runs.mdx +24 -0
  69. package/dist/docs/public/tutorial/meta.json +14 -0
  70. package/dist/docs/public/tutorial/query-sample-data.mdx +81 -0
  71. package/dist/docs/public/tutorial/remember-definitions.mdx +72 -0
  72. package/dist/docs/public/tutorial/run-analysis.mdx +86 -0
  73. package/dist/docs/public/tutorial/ship-it.mdx +100 -0
  74. package/dist/docs/public/tutorial/team-playbooks.mdx +63 -0
  75. package/dist/src/_virtual/_rolldown/runtime.js +1 -0
  76. package/dist/src/channel/adapter-context.d.ts +11 -0
  77. package/dist/src/channel/adapter-context.js +1 -0
  78. package/dist/src/channel/adapter.d.ts +160 -0
  79. package/dist/src/channel/adapter.js +1 -0
  80. package/dist/src/channel/compiled-channel.d.ts +21 -0
  81. package/dist/src/channel/compiled-channel.js +1 -0
  82. package/dist/src/channel/cross-channel-receive.d.ts +70 -0
  83. package/dist/src/channel/cross-channel-receive.js +2 -0
  84. package/dist/src/channel/http.d.ts +29 -0
  85. package/dist/src/channel/http.js +1 -0
  86. package/dist/src/channel/instrumentation.d.ts +10 -0
  87. package/dist/src/channel/instrumentation.js +1 -0
  88. package/dist/src/channel/receive-target.d.ts +17 -0
  89. package/dist/src/channel/receive-target.js +1 -0
  90. package/dist/src/channel/resolve-text.d.ts +19 -0
  91. package/dist/src/channel/resolve-text.js +1 -0
  92. package/dist/src/channel/routes.d.ts +217 -0
  93. package/dist/src/channel/routes.js +1 -0
  94. package/dist/src/channel/schedule.d.ts +66 -0
  95. package/dist/src/channel/schedule.js +1 -0
  96. package/dist/src/channel/send.d.ts +4 -0
  97. package/dist/src/channel/send.js +1 -0
  98. package/dist/src/channel/session-callback.d.ts +10 -0
  99. package/dist/src/channel/session-callback.js +1 -0
  100. package/dist/src/channel/session.d.ts +46 -0
  101. package/dist/src/channel/session.js +1 -0
  102. package/dist/src/channel/types.d.ts +303 -0
  103. package/dist/src/channel/types.js +1 -0
  104. package/dist/src/channel/websocket-upgrade-server.d.ts +26 -0
  105. package/dist/src/channel/websocket-upgrade-server.js +1 -0
  106. package/dist/src/chunks/use-eve-agent-9vL56Fjy.js +1195 -0
  107. package/dist/src/chunks/use-eve-agent-DTWI5Lji.js +1225 -0
  108. package/dist/src/cli/commands/channel-add-conflicts.d.ts +21 -0
  109. package/dist/src/cli/commands/channel-add-conflicts.js +1 -0
  110. package/dist/src/cli/commands/channels.d.ts +26 -0
  111. package/dist/src/cli/commands/channels.js +1 -0
  112. package/dist/src/cli/commands/info.d.ts +53 -0
  113. package/dist/src/cli/commands/info.js +2 -0
  114. package/dist/src/cli/dev/environment.d.ts +20 -0
  115. package/dist/src/cli/dev/environment.js +1 -0
  116. package/dist/src/cli/dev/repl/input-requests.d.ts +38 -0
  117. package/dist/src/cli/dev/repl/input-requests.js +1 -0
  118. package/dist/src/cli/dev/repl/input.d.ts +19 -0
  119. package/dist/src/cli/dev/repl/input.js +1 -0
  120. package/dist/src/cli/dev/repl/repl.d.ts +62 -0
  121. package/dist/src/cli/dev/repl/repl.js +2 -0
  122. package/dist/src/cli/dev/repl/terminal.d.ts +21 -0
  123. package/dist/src/cli/dev/repl/terminal.js +5 -0
  124. package/dist/src/cli/dev/tui/layout.d.ts +24 -0
  125. package/dist/src/cli/dev/tui/layout.js +3 -0
  126. package/dist/src/cli/dev/tui/markdown.d.ts +14 -0
  127. package/dist/src/cli/dev/tui/markdown.js +3 -0
  128. package/dist/src/cli/dev/tui/runner.d.ts +211 -0
  129. package/dist/src/cli/dev/tui/runner.js +1 -0
  130. package/dist/src/cli/dev/tui/terminal-frame-buffer.d.ts +21 -0
  131. package/dist/src/cli/dev/tui/terminal-frame-buffer.js +2 -0
  132. package/dist/src/cli/dev/tui/terminal-renderer.d.ts +111 -0
  133. package/dist/src/cli/dev/tui/terminal-renderer.js +12 -0
  134. package/dist/src/cli/dev/tui/terminal-text.d.ts +6 -0
  135. package/dist/src/cli/dev/tui/terminal-text.js +1 -0
  136. package/dist/src/cli/dev/tui/test/index.d.ts +11 -0
  137. package/dist/src/cli/dev/tui/test/index.js +1 -0
  138. package/dist/src/cli/dev/tui/test/mock-terminal.d.ts +28 -0
  139. package/dist/src/cli/dev/tui/test/mock-terminal.js +3 -0
  140. package/dist/src/cli/dev/tui/tui.d.ts +32 -0
  141. package/dist/src/cli/dev/tui/tui.js +1 -0
  142. package/dist/src/cli/dev/tui/types.d.ts +68 -0
  143. package/dist/src/cli/dev/tui/types.js +1 -0
  144. package/dist/src/cli/dev/url.d.ts +4 -0
  145. package/dist/src/cli/dev/url.js +1 -0
  146. package/dist/src/cli/run.d.ts +112 -0
  147. package/dist/src/cli/run.js +3 -0
  148. package/dist/src/cli/ui/output.d.ts +62 -0
  149. package/dist/src/cli/ui/output.js +8 -0
  150. package/dist/src/client/client-error.d.ts +14 -0
  151. package/dist/src/client/client-error.js +1 -0
  152. package/dist/src/client/client.d.ts +28 -0
  153. package/dist/src/client/client.js +1 -0
  154. package/dist/src/client/eve-agent-store.d.ts +89 -0
  155. package/dist/src/client/eve-agent-store.js +2 -0
  156. package/dist/src/client/index.d.ts +15 -0
  157. package/dist/src/client/index.js +1 -0
  158. package/dist/src/client/message-reducer-types.d.ts +174 -0
  159. package/dist/src/client/message-reducer-types.js +1 -0
  160. package/dist/src/client/message-reducer.d.ts +14 -0
  161. package/dist/src/client/message-reducer.js +1 -0
  162. package/dist/src/client/message-response.d.ts +42 -0
  163. package/dist/src/client/message-response.js +1 -0
  164. package/dist/src/client/ndjson.d.ts +16 -0
  165. package/dist/src/client/ndjson.js +3 -0
  166. package/dist/src/client/open-stream.d.ts +18 -0
  167. package/dist/src/client/open-stream.js +1 -0
  168. package/dist/src/client/output-schema.d.ts +12 -0
  169. package/dist/src/client/output-schema.js +1 -0
  170. package/dist/src/client/reducer.d.ts +63 -0
  171. package/dist/src/client/reducer.js +1 -0
  172. package/dist/src/client/session-utils.d.ts +29 -0
  173. package/dist/src/client/session-utils.js +1 -0
  174. package/dist/src/client/session.d.ts +49 -0
  175. package/dist/src/client/session.js +1 -0
  176. package/dist/src/client/types.d.ts +165 -0
  177. package/dist/src/client/types.js +1 -0
  178. package/dist/src/client/url.d.ts +8 -0
  179. package/dist/src/client/url.js +1 -0
  180. package/dist/src/compiled/.vendor-stamp.json +32 -0
  181. package/dist/src/compiled/@ai-sdk/anthropic/LICENSE +13 -0
  182. package/dist/src/compiled/@ai-sdk/anthropic/_provider-utils.d.ts +15 -0
  183. package/dist/src/compiled/@ai-sdk/anthropic/index.d.ts +1262 -0
  184. package/dist/src/compiled/@ai-sdk/anthropic/index.js +2 -0
  185. package/dist/src/compiled/@ai-sdk/google/LICENSE +13 -0
  186. package/dist/src/compiled/@ai-sdk/google/_provider-utils.d.ts +11 -0
  187. package/dist/src/compiled/@ai-sdk/google/index.d.ts +627 -0
  188. package/dist/src/compiled/@ai-sdk/google/index.js +11 -0
  189. package/dist/src/compiled/@ai-sdk/mcp/LICENSE +13 -0
  190. package/dist/src/compiled/@ai-sdk/mcp/index.d.ts +37 -0
  191. package/dist/src/compiled/@ai-sdk/mcp/index.js +1 -0
  192. package/dist/src/compiled/@ai-sdk/openai/LICENSE +13 -0
  193. package/dist/src/compiled/@ai-sdk/openai/_provider-utils.d.ts +15 -0
  194. package/dist/src/compiled/@ai-sdk/openai/index.d.ts +1296 -0
  195. package/dist/src/compiled/@ai-sdk/openai/index.js +11 -0
  196. package/dist/src/compiled/@ai-sdk/otel/LICENSE +13 -0
  197. package/dist/src/compiled/@ai-sdk/otel/index.d.ts +32 -0
  198. package/dist/src/compiled/@ai-sdk/otel/index.js +3 -0
  199. package/dist/src/compiled/@ai-sdk/provider/LICENSE +13 -0
  200. package/dist/src/compiled/@ai-sdk/provider/_json-schema.d.ts +5 -0
  201. package/dist/src/compiled/@ai-sdk/provider/index.d.ts +7138 -0
  202. package/dist/src/compiled/@ai-sdk/provider/index.js +3 -0
  203. package/dist/src/compiled/@chat-adapter/slack/LICENSE +9 -0
  204. package/dist/src/compiled/@chat-adapter/slack/_chat-adapter-shared.d.ts +9 -0
  205. package/dist/src/compiled/@chat-adapter/slack/_slack-web-api.d.ts +7 -0
  206. package/dist/src/compiled/@chat-adapter/slack/index.d.ts +950 -0
  207. package/dist/src/compiled/@chat-adapter/slack/index.js +48 -0
  208. package/dist/src/compiled/@chat-adapter/state-memory/LICENSE +9 -0
  209. package/dist/src/compiled/@chat-adapter/state-memory/index.d.ts +50 -0
  210. package/dist/src/compiled/@chat-adapter/state-memory/index.js +1 -0
  211. package/dist/src/compiled/@opentelemetry/api/LICENSE +201 -0
  212. package/dist/src/compiled/@opentelemetry/api/index.d.ts +47 -0
  213. package/dist/src/compiled/@opentelemetry/api/index.js +1 -0
  214. package/dist/src/compiled/@standard-schema/spec/LICENSE +21 -0
  215. package/dist/src/compiled/@standard-schema/spec/index.d.ts +119 -0
  216. package/dist/src/compiled/@standard-schema/spec/index.js +1 -0
  217. package/dist/src/compiled/@vercel/oidc/LICENSE +202 -0
  218. package/dist/src/compiled/@vercel/oidc/index.d.ts +21 -0
  219. package/dist/src/compiled/@vercel/oidc/index.js +2 -0
  220. package/dist/src/compiled/@vercel/sandbox/LICENSE +201 -0
  221. package/dist/src/compiled/@vercel/sandbox/index.d.ts +128 -0
  222. package/dist/src/compiled/@vercel/sandbox/index.js +108 -0
  223. package/dist/src/compiled/@vercel/sandbox/network-policy.d.ts +161 -0
  224. package/dist/src/compiled/@workflow/core/LICENSE.md +201 -0
  225. package/dist/src/compiled/@workflow/core/_ms.d.ts +4 -0
  226. package/dist/src/compiled/@workflow/core/_workflow-serde.d.ts +5 -0
  227. package/dist/src/compiled/@workflow/core/_workflow-utils.d.ts +8 -0
  228. package/dist/src/compiled/@workflow/core/attribute-changes.d.ts +7 -0
  229. package/dist/src/compiled/@workflow/core/capabilities.d.ts +45 -0
  230. package/dist/src/compiled/@workflow/core/capture-stack.d.ts +16 -0
  231. package/dist/src/compiled/@workflow/core/class-serialization.d.ts +31 -0
  232. package/dist/src/compiled/@workflow/core/classify-error.d.ts +20 -0
  233. package/dist/src/compiled/@workflow/core/context-errors.d.ts +27 -0
  234. package/dist/src/compiled/@workflow/core/context-violation-error.d.ts +97 -0
  235. package/dist/src/compiled/@workflow/core/create-hook.d.ts +179 -0
  236. package/dist/src/compiled/@workflow/core/define-hook.d.ts +68 -0
  237. package/dist/src/compiled/@workflow/core/describe-error.d.ts +70 -0
  238. package/dist/src/compiled/@workflow/core/encryption.d.ts +66 -0
  239. package/dist/src/compiled/@workflow/core/events-consumer.d.ts +72 -0
  240. package/dist/src/compiled/@workflow/core/flushable-stream.d.ts +82 -0
  241. package/dist/src/compiled/@workflow/core/global.d.ts +48 -0
  242. package/dist/src/compiled/@workflow/core/index.d.ts +20 -0
  243. package/dist/src/compiled/@workflow/core/index.js +2 -0
  244. package/dist/src/compiled/@workflow/core/log-format.d.ts +25 -0
  245. package/dist/src/compiled/@workflow/core/logger.d.ts +29 -0
  246. package/dist/src/compiled/@workflow/core/private.d.ts +135 -0
  247. package/dist/src/compiled/@workflow/core/private.js +1 -0
  248. package/dist/src/compiled/@workflow/core/runtime/constants.d.ts +52 -0
  249. package/dist/src/compiled/@workflow/core/runtime/get-port-lazy.d.ts +10 -0
  250. package/dist/src/compiled/@workflow/core/runtime/get-world-lazy.d.ts +32 -0
  251. package/dist/src/compiled/@workflow/core/runtime/helpers.d.ts +105 -0
  252. package/dist/src/compiled/@workflow/core/runtime/replay-budget.d.ts +98 -0
  253. package/dist/src/compiled/@workflow/core/runtime/resume-hook.d.ts +77 -0
  254. package/dist/src/compiled/@workflow/core/runtime/run.d.ts +134 -0
  255. package/dist/src/compiled/@workflow/core/runtime/runs.d.ts +50 -0
  256. package/dist/src/compiled/@workflow/core/runtime/start.d.ts +59 -0
  257. package/dist/src/compiled/@workflow/core/runtime/step-executor.d.ts +42 -0
  258. package/dist/src/compiled/@workflow/core/runtime/step-handler.d.ts +2 -0
  259. package/dist/src/compiled/@workflow/core/runtime/suspension-handler.d.ts +42 -0
  260. package/dist/src/compiled/@workflow/core/runtime/world-init.d.ts +75 -0
  261. package/dist/src/compiled/@workflow/core/runtime/world.d.ts +32 -0
  262. package/dist/src/compiled/@workflow/core/runtime.d.ts +22 -0
  263. package/dist/src/compiled/@workflow/core/runtime.js +141 -0
  264. package/dist/src/compiled/@workflow/core/schemas.d.ts +15 -0
  265. package/dist/src/compiled/@workflow/core/serialization/client.d.ts +17 -0
  266. package/dist/src/compiled/@workflow/core/serialization/codec-devalue.d.ts +14 -0
  267. package/dist/src/compiled/@workflow/core/serialization/codec.d.ts +90 -0
  268. package/dist/src/compiled/@workflow/core/serialization/encryption.d.ts +33 -0
  269. package/dist/src/compiled/@workflow/core/serialization/errors.d.ts +34 -0
  270. package/dist/src/compiled/@workflow/core/serialization/format.d.ts +60 -0
  271. package/dist/src/compiled/@workflow/core/serialization/index.d.ts +18 -0
  272. package/dist/src/compiled/@workflow/core/serialization/reducers/class.d.ts +11 -0
  273. package/dist/src/compiled/@workflow/core/serialization/reducers/common.d.ts +16 -0
  274. package/dist/src/compiled/@workflow/core/serialization/reducers/step-function.d.ts +35 -0
  275. package/dist/src/compiled/@workflow/core/serialization/step.d.ts +17 -0
  276. package/dist/src/compiled/@workflow/core/serialization/types.d.ts +228 -0
  277. package/dist/src/compiled/@workflow/core/serialization/workflow.d.ts +29 -0
  278. package/dist/src/compiled/@workflow/core/serialization-format.d.ts +171 -0
  279. package/dist/src/compiled/@workflow/core/serialization.d.ts +344 -0
  280. package/dist/src/compiled/@workflow/core/set-attributes.d.ts +13 -0
  281. package/dist/src/compiled/@workflow/core/sleep.d.ts +33 -0
  282. package/dist/src/compiled/@workflow/core/source-map.d.ts +10 -0
  283. package/dist/src/compiled/@workflow/core/step/context-storage.d.ts +29 -0
  284. package/dist/src/compiled/@workflow/core/step/get-closure-vars.d.ts +9 -0
  285. package/dist/src/compiled/@workflow/core/step/get-step-metadata.d.ts +42 -0
  286. package/dist/src/compiled/@workflow/core/step/get-workflow-metadata.d.ts +7 -0
  287. package/dist/src/compiled/@workflow/core/step/writable-stream.d.ts +22 -0
  288. package/dist/src/compiled/@workflow/core/step.d.ts +4 -0
  289. package/dist/src/compiled/@workflow/core/symbols.d.ts +42 -0
  290. package/dist/src/compiled/@workflow/core/telemetry/semantic-conventions.d.ts +283 -0
  291. package/dist/src/compiled/@workflow/core/telemetry.d.ts +53 -0
  292. package/dist/src/compiled/@workflow/core/types.d.ts +20 -0
  293. package/dist/src/compiled/@workflow/core/util.d.ts +40 -0
  294. package/dist/src/compiled/@workflow/core/version.d.ts +2 -0
  295. package/dist/src/compiled/@workflow/core/vm/index.d.ts +17 -0
  296. package/dist/src/compiled/@workflow/core/vm/uint8array-base64.d.ts +21 -0
  297. package/dist/src/compiled/@workflow/core/vm/uuid.d.ts +10 -0
  298. package/dist/src/compiled/@workflow/core/workflow/abort-controller.d.ts +65 -0
  299. package/dist/src/compiled/@workflow/core/workflow/create-hook.d.ts +7 -0
  300. package/dist/src/compiled/@workflow/core/workflow/define-hook.d.ts +10 -0
  301. package/dist/src/compiled/@workflow/core/workflow/get-workflow-metadata.d.ts +32 -0
  302. package/dist/src/compiled/@workflow/core/workflow/hook.d.ts +4 -0
  303. package/dist/src/compiled/@workflow/core/workflow/index.d.ts +12 -0
  304. package/dist/src/compiled/@workflow/core/workflow/set-attributes.d.ts +74 -0
  305. package/dist/src/compiled/@workflow/core/workflow/sleep.d.ts +4 -0
  306. package/dist/src/compiled/@workflow/core/workflow/world-init-stub.d.ts +15 -0
  307. package/dist/src/compiled/@workflow/core/workflow/writable-stream.d.ts +3 -0
  308. package/dist/src/compiled/@workflow/core/workflow.d.ts +1 -0
  309. package/dist/src/compiled/@workflow/core/workflow.js +1 -0
  310. package/dist/src/compiled/@workflow/errors/LICENSE.md +201 -0
  311. package/dist/src/compiled/@workflow/errors/_ms.d.ts +4 -0
  312. package/dist/src/compiled/@workflow/errors/error-codes.d.ts +23 -0
  313. package/dist/src/compiled/@workflow/errors/index.d.ts +536 -0
  314. package/dist/src/compiled/@workflow/errors/index.js +1 -0
  315. package/dist/src/compiled/@workflow/world/LICENSE.md +201 -0
  316. package/dist/src/compiled/@workflow/world/attributes.d.ts +110 -0
  317. package/dist/src/compiled/@workflow/world/events.d.ts +415 -0
  318. package/dist/src/compiled/@workflow/world/hooks.d.ts +72 -0
  319. package/dist/src/compiled/@workflow/world/index.d.ts +25 -0
  320. package/dist/src/compiled/@workflow/world/index.js +1 -0
  321. package/dist/src/compiled/@workflow/world/interfaces.d.ts +264 -0
  322. package/dist/src/compiled/@workflow/world/queue.d.ts +128 -0
  323. package/dist/src/compiled/@workflow/world/recovery.d.ts +13 -0
  324. package/dist/src/compiled/@workflow/world/runs.d.ts +144 -0
  325. package/dist/src/compiled/@workflow/world/serialization.d.ts +25 -0
  326. package/dist/src/compiled/@workflow/world/shared.d.ts +83 -0
  327. package/dist/src/compiled/@workflow/world/spec-version.d.ts +46 -0
  328. package/dist/src/compiled/@workflow/world/steps.d.ts +70 -0
  329. package/dist/src/compiled/@workflow/world/ulid.d.ts +35 -0
  330. package/dist/src/compiled/@workflow/world/waits.d.ts +21 -0
  331. package/dist/src/compiled/_chunks/node/auth-BsyzphzW.js +2 -0
  332. package/dist/src/compiled/_chunks/node/dist-BQYUcBqu.js +90 -0
  333. package/dist/src/compiled/_chunks/node/dist-BdTs18CF.js +1 -0
  334. package/dist/src/compiled/_chunks/node/retry-DkR2H1Y0.js +1 -0
  335. package/dist/src/compiled/_chunks/node/token-ORseRyWn.js +1 -0
  336. package/dist/src/compiled/_chunks/node/version-BGue04qw.js +1 -0
  337. package/dist/src/compiled/_chunks/workflow/chunk-DSjMdhoD.js +1 -0
  338. package/dist/src/compiled/_chunks/workflow/coerce-BTuSKQr5.js +1 -0
  339. package/dist/src/compiled/_chunks/workflow/compat-CG1hDp-3.js +1 -0
  340. package/dist/src/compiled/_chunks/workflow/core-5Woff_dW.js +65 -0
  341. package/dist/src/compiled/_chunks/workflow/dist-6a3viBXZ.js +3 -0
  342. package/dist/src/compiled/_chunks/workflow/dist-D0jyrm7a.js +1 -0
  343. package/dist/src/compiled/_chunks/workflow/dist-gEXVSMPU.js +14 -0
  344. package/dist/src/compiled/_chunks/workflow/resume-hook-0Zk0zSvq.js +12 -0
  345. package/dist/src/compiled/_chunks/workflow/schemas-DWOIBELG.js +1 -0
  346. package/dist/src/compiled/_chunks/workflow/sleep-DXZr2BgM.js +1 -0
  347. package/dist/src/compiled/_chunks/workflow/src-B54rYDvB.js +1 -0
  348. package/dist/src/compiled/_chunks/workflow/symbols-BWCAoPHE.js +48 -0
  349. package/dist/src/compiled/_chunks/workflow/token-CcaAeZHd.js +1 -0
  350. package/dist/src/compiled/_chunks/workflow/token-nK4u-N7w.js +1 -0
  351. package/dist/src/compiled/chat/LICENSE +9 -0
  352. package/dist/src/compiled/chat/_mdast.d.ts +24 -0
  353. package/dist/src/compiled/chat/index.d.ts +714 -0
  354. package/dist/src/compiled/chat/index.js +1 -0
  355. package/dist/src/compiled/chat/jsx-runtime-CFq1K_Ve.d.ts +782 -0
  356. package/dist/src/compiled/chokidar/LICENSE +21 -0
  357. package/dist/src/compiled/chokidar/index.d.ts +33 -0
  358. package/dist/src/compiled/chokidar/index.js +1 -0
  359. package/dist/src/compiled/commander/LICENSE +22 -0
  360. package/dist/src/compiled/commander/index.d.ts +1113 -0
  361. package/dist/src/compiled/commander/index.js +19 -0
  362. package/dist/src/compiled/experimental-ai-sdk-code-mode/LICENSE +21 -0
  363. package/dist/src/compiled/experimental-ai-sdk-code-mode/approval-continuation.d.ts +71 -0
  364. package/dist/src/compiled/experimental-ai-sdk-code-mode/approval.d.ts +32 -0
  365. package/dist/src/compiled/experimental-ai-sdk-code-mode/code-mode-tool.d.ts +16 -0
  366. package/dist/src/compiled/experimental-ai-sdk-code-mode/continuation-capability.d.ts +33 -0
  367. package/dist/src/compiled/experimental-ai-sdk-code-mode/errors.d.ts +114 -0
  368. package/dist/src/compiled/experimental-ai-sdk-code-mode/fetch-policy.d.ts +21 -0
  369. package/dist/src/compiled/experimental-ai-sdk-code-mode/host-interrupt.d.ts +25 -0
  370. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.d.ts +11 -0
  371. package/dist/src/compiled/experimental-ai-sdk-code-mode/index.js +419 -0
  372. package/dist/src/compiled/experimental-ai-sdk-code-mode/interrupt-continuation.d.ts +32 -0
  373. package/dist/src/compiled/experimental-ai-sdk-code-mode/options.d.ts +3 -0
  374. package/dist/src/compiled/experimental-ai-sdk-code-mode/run-code-mode.d.ts +12 -0
  375. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/guest-sources.d.ts +3 -0
  376. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/manager.d.ts +22 -0
  377. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/max-workers.d.ts +20 -0
  378. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/protocol.d.ts +49 -0
  379. package/dist/src/compiled/experimental-ai-sdk-code-mode/runtime/worker-source.d.ts +11 -0
  380. package/dist/src/compiled/experimental-ai-sdk-code-mode/serialization.d.ts +5 -0
  381. package/dist/src/compiled/experimental-ai-sdk-code-mode/source-cache.d.ts +11 -0
  382. package/dist/src/compiled/experimental-ai-sdk-code-mode/telemetry.d.ts +20 -0
  383. package/dist/src/compiled/experimental-ai-sdk-code-mode/tool-invocation.d.ts +24 -0
  384. package/dist/src/compiled/experimental-ai-sdk-code-mode/tool-prompt.d.ts +3 -0
  385. package/dist/src/compiled/experimental-ai-sdk-code-mode/types.d.ts +802 -0
  386. package/dist/src/compiled/gray-matter/LICENSE +21 -0
  387. package/dist/src/compiled/gray-matter/index.d.ts +62 -0
  388. package/dist/src/compiled/gray-matter/index.js +48 -0
  389. package/dist/src/compiled/jose/LICENSE.md +21 -0
  390. package/dist/src/compiled/jose/index.d.ts +40 -0
  391. package/dist/src/compiled/jose/index.js +2 -0
  392. package/dist/src/compiled/jsonc-parser/LICENSE.md +21 -0
  393. package/dist/src/compiled/jsonc-parser/index.d.ts +13 -0
  394. package/dist/src/compiled/jsonc-parser/index.js +15 -0
  395. package/dist/src/compiled/just-bash/LICENSE +201 -0
  396. package/dist/src/compiled/just-bash/index.d.ts +116 -0
  397. package/dist/src/compiled/just-bash/index.js +2200 -0
  398. package/dist/src/compiled/just-bash/network/types.d.ts +155 -0
  399. package/dist/src/compiled/picocolors/LICENSE +15 -0
  400. package/dist/src/compiled/picocolors/index.d.ts +55 -0
  401. package/dist/src/compiled/picocolors/index.js +1 -0
  402. package/dist/src/compiled/turndown/LICENSE +21 -0
  403. package/dist/src/compiled/turndown/index.d.ts +13 -0
  404. package/dist/src/compiled/turndown/index.js +69 -0
  405. package/dist/src/compiled/zod/LICENSE +21 -0
  406. package/dist/src/compiled/zod/index.d.ts +5 -0
  407. package/dist/src/compiled/zod/index.js +1 -0
  408. package/dist/src/compiled/zod-validation-error/LICENSE +9 -0
  409. package/dist/src/compiled/zod-validation-error/index.d.ts +12 -0
  410. package/dist/src/compiled/zod-validation-error/index.js +1 -0
  411. package/dist/src/compiler/artifacts.d.ts +109 -0
  412. package/dist/src/compiler/artifacts.js +1 -0
  413. package/dist/src/compiler/channel-instrumentation-types.d.ts +8 -0
  414. package/dist/src/compiler/channel-instrumentation-types.js +2 -0
  415. package/dist/src/compiler/compile-agent.d.ts +41 -0
  416. package/dist/src/compiler/compile-agent.js +3 -0
  417. package/dist/src/compiler/compile-from-memory.d.ts +76 -0
  418. package/dist/src/compiler/compile-from-memory.js +1 -0
  419. package/dist/src/compiler/manifest.d.ts +504 -0
  420. package/dist/src/compiler/manifest.js +1 -0
  421. package/dist/src/compiler/model-catalog.d.ts +60 -0
  422. package/dist/src/compiler/model-catalog.js +1 -0
  423. package/dist/src/compiler/module-map.d.ts +48 -0
  424. package/dist/src/compiler/module-map.js +5 -0
  425. package/dist/src/compiler/normalize-agent-config.d.ts +18 -0
  426. package/dist/src/compiler/normalize-agent-config.js +1 -0
  427. package/dist/src/compiler/normalize-channel.d.ts +16 -0
  428. package/dist/src/compiler/normalize-channel.js +1 -0
  429. package/dist/src/compiler/normalize-connection.d.ts +21 -0
  430. package/dist/src/compiler/normalize-connection.js +1 -0
  431. package/dist/src/compiler/normalize-helpers.d.ts +28 -0
  432. package/dist/src/compiler/normalize-helpers.js +1 -0
  433. package/dist/src/compiler/normalize-hook.d.ts +12 -0
  434. package/dist/src/compiler/normalize-hook.js +1 -0
  435. package/dist/src/compiler/normalize-instructions.d.ts +35 -0
  436. package/dist/src/compiler/normalize-instructions.js +1 -0
  437. package/dist/src/compiler/normalize-manifest.d.ts +6 -0
  438. package/dist/src/compiler/normalize-manifest.js +3 -0
  439. package/dist/src/compiler/normalize-sandbox.d.ts +7 -0
  440. package/dist/src/compiler/normalize-sandbox.js +1 -0
  441. package/dist/src/compiler/normalize-schedule.d.ts +14 -0
  442. package/dist/src/compiler/normalize-schedule.js +1 -0
  443. package/dist/src/compiler/normalize-skill.d.ts +21 -0
  444. package/dist/src/compiler/normalize-skill.js +1 -0
  445. package/dist/src/compiler/normalize-subagent.d.ts +29 -0
  446. package/dist/src/compiler/normalize-subagent.js +1 -0
  447. package/dist/src/compiler/normalize-tool.d.ts +34 -0
  448. package/dist/src/compiler/normalize-tool.js +1 -0
  449. package/dist/src/compiler/remote-agent-node.d.ts +22 -0
  450. package/dist/src/compiler/remote-agent-node.js +1 -0
  451. package/dist/src/compiler/workspace-resources.d.ts +14 -0
  452. package/dist/src/compiler/workspace-resources.js +1 -0
  453. package/dist/src/context/accessors.d.ts +40 -0
  454. package/dist/src/context/accessors.js +1 -0
  455. package/dist/src/context/build-callback-context.d.ts +8 -0
  456. package/dist/src/context/build-callback-context.js +1 -0
  457. package/dist/src/context/build-dynamic-tools.d.ts +13 -0
  458. package/dist/src/context/build-dynamic-tools.js +1 -0
  459. package/dist/src/context/container.d.ts +60 -0
  460. package/dist/src/context/container.js +1 -0
  461. package/dist/src/context/dynamic-instruction-lifecycle.d.ts +26 -0
  462. package/dist/src/context/dynamic-instruction-lifecycle.js +1 -0
  463. package/dist/src/context/dynamic-resolve-context.d.ts +12 -0
  464. package/dist/src/context/dynamic-resolve-context.js +1 -0
  465. package/dist/src/context/dynamic-skill-lifecycle.d.ts +24 -0
  466. package/dist/src/context/dynamic-skill-lifecycle.js +1 -0
  467. package/dist/src/context/dynamic-tool-lifecycle.d.ts +25 -0
  468. package/dist/src/context/dynamic-tool-lifecycle.js +1 -0
  469. package/dist/src/context/hook-lifecycle.d.ts +14 -0
  470. package/dist/src/context/hook-lifecycle.js +1 -0
  471. package/dist/src/context/key.d.ts +47 -0
  472. package/dist/src/context/key.js +1 -0
  473. package/dist/src/context/keys.d.ts +105 -0
  474. package/dist/src/context/keys.js +1 -0
  475. package/dist/src/context/node.d.ts +7 -0
  476. package/dist/src/context/node.js +1 -0
  477. package/dist/src/context/provider.d.ts +27 -0
  478. package/dist/src/context/provider.js +1 -0
  479. package/dist/src/context/providers/connection.d.ts +12 -0
  480. package/dist/src/context/providers/connection.js +1 -0
  481. package/dist/src/context/providers/sandbox.d.ts +3 -0
  482. package/dist/src/context/providers/sandbox.js +1 -0
  483. package/dist/src/context/providers/session.d.ts +3 -0
  484. package/dist/src/context/providers/session.js +1 -0
  485. package/dist/src/context/run-step.d.ts +23 -0
  486. package/dist/src/context/run-step.js +1 -0
  487. package/dist/src/context/serialize.d.ts +15 -0
  488. package/dist/src/context/serialize.js +1 -0
  489. package/dist/src/discover/connections.d.ts +34 -0
  490. package/dist/src/discover/connections.js +1 -0
  491. package/dist/src/discover/diagnostics.d.ts +53 -0
  492. package/dist/src/discover/diagnostics.js +1 -0
  493. package/dist/src/discover/discover-agent.d.ts +30 -0
  494. package/dist/src/discover/discover-agent.js +1 -0
  495. package/dist/src/discover/discover-subagent.d.ts +36 -0
  496. package/dist/src/discover/discover-subagent.js +1 -0
  497. package/dist/src/discover/filesystem.d.ts +71 -0
  498. package/dist/src/discover/filesystem.js +1 -0
  499. package/dist/src/discover/grammar.d.ts +202 -0
  500. package/dist/src/discover/grammar.js +1 -0
  501. package/dist/src/discover/lib.d.ts +34 -0
  502. package/dist/src/discover/lib.js +1 -0
  503. package/dist/src/discover/manifest.d.ts +250 -0
  504. package/dist/src/discover/manifest.js +1 -0
  505. package/dist/src/discover/markdown.d.ts +19 -0
  506. package/dist/src/discover/markdown.js +1 -0
  507. package/dist/src/discover/named-source-directory.d.ts +97 -0
  508. package/dist/src/discover/named-source-directory.js +1 -0
  509. package/dist/src/discover/project-source.d.ts +107 -0
  510. package/dist/src/discover/project-source.js +1 -0
  511. package/dist/src/discover/project.d.ts +33 -0
  512. package/dist/src/discover/project.js +1 -0
  513. package/dist/src/discover/sandbox.d.ts +37 -0
  514. package/dist/src/discover/sandbox.js +1 -0
  515. package/dist/src/discover/schedules.d.ts +38 -0
  516. package/dist/src/discover/schedules.js +1 -0
  517. package/dist/src/discover/skills.d.ts +38 -0
  518. package/dist/src/discover/skills.js +1 -0
  519. package/dist/src/discover/slots.d.ts +30 -0
  520. package/dist/src/discover/slots.js +1 -0
  521. package/dist/src/evals/cli/eval.d.ts +18 -0
  522. package/dist/src/evals/cli/eval.js +1 -0
  523. package/dist/src/evals/define-eval-suite.d.ts +16 -0
  524. package/dist/src/evals/define-eval-suite.js +1 -0
  525. package/dist/src/evals/index.d.ts +3 -0
  526. package/dist/src/evals/index.js +1 -0
  527. package/dist/src/evals/loaders/index.d.ts +2 -0
  528. package/dist/src/evals/loaders/index.js +1 -0
  529. package/dist/src/evals/loaders/json.d.ts +12 -0
  530. package/dist/src/evals/loaders/json.js +1 -0
  531. package/dist/src/evals/loaders/yaml.d.ts +16 -0
  532. package/dist/src/evals/loaders/yaml.js +1 -0
  533. package/dist/src/evals/reporters/index.d.ts +2 -0
  534. package/dist/src/evals/reporters/index.js +1 -0
  535. package/dist/src/evals/runner/artifacts.d.ts +11 -0
  536. package/dist/src/evals/runner/artifacts.js +3 -0
  537. package/dist/src/evals/runner/derive-run-facts.d.ts +9 -0
  538. package/dist/src/evals/runner/derive-run-facts.js +1 -0
  539. package/dist/src/evals/runner/discover.d.ts +20 -0
  540. package/dist/src/evals/runner/discover.js +1 -0
  541. package/dist/src/evals/runner/execute-case.d.ts +23 -0
  542. package/dist/src/evals/runner/execute-case.js +1 -0
  543. package/dist/src/evals/runner/execute-suite.d.ts +24 -0
  544. package/dist/src/evals/runner/execute-suite.js +1 -0
  545. package/dist/src/evals/runner/reporters/braintrust.d.ts +27 -0
  546. package/dist/src/evals/runner/reporters/braintrust.js +2 -0
  547. package/dist/src/evals/runner/reporters/console.d.ts +15 -0
  548. package/dist/src/evals/runner/reporters/console.js +1 -0
  549. package/dist/src/evals/runner/reporters/types.d.ts +20 -0
  550. package/dist/src/evals/runner/reporters/types.js +1 -0
  551. package/dist/src/evals/runner/resolve-git-metadata.d.ts +16 -0
  552. package/dist/src/evals/runner/resolve-git-metadata.js +1 -0
  553. package/dist/src/evals/scorers/autoevals-client.d.ts +14 -0
  554. package/dist/src/evals/scorers/autoevals-client.js +2 -0
  555. package/dist/src/evals/scorers/autoevals.d.ts +58 -0
  556. package/dist/src/evals/scorers/autoevals.js +1 -0
  557. package/dist/src/evals/scorers/json.d.ts +10 -0
  558. package/dist/src/evals/scorers/json.js +1 -0
  559. package/dist/src/evals/scorers/run.d.ts +18 -0
  560. package/dist/src/evals/scorers/run.js +1 -0
  561. package/dist/src/evals/scorers/sql.d.ts +9 -0
  562. package/dist/src/evals/scorers/sql.js +1 -0
  563. package/dist/src/evals/scorers/text.d.ts +18 -0
  564. package/dist/src/evals/scorers/text.js +1 -0
  565. package/dist/src/evals/scores/index.d.ts +72 -0
  566. package/dist/src/evals/scores/index.js +1 -0
  567. package/dist/src/evals/types.d.ts +272 -0
  568. package/dist/src/evals/types.js +1 -0
  569. package/dist/src/execution/channel-context.d.ts +5 -0
  570. package/dist/src/execution/channel-context.js +1 -0
  571. package/dist/src/execution/connection-auth-tool-result.d.ts +2 -0
  572. package/dist/src/execution/connection-auth-tool-result.js +1 -0
  573. package/dist/src/execution/create-session-step.d.ts +43 -0
  574. package/dist/src/execution/create-session-step.js +1 -0
  575. package/dist/src/execution/delegated-parent-notification.d.ts +15 -0
  576. package/dist/src/execution/delegated-parent-notification.js +1 -0
  577. package/dist/src/execution/delegated-parent-result.d.ts +14 -0
  578. package/dist/src/execution/delegated-parent-result.js +1 -0
  579. package/dist/src/execution/dispatch-code-mode-runtime-actions-step.d.ts +21 -0
  580. package/dist/src/execution/dispatch-code-mode-runtime-actions-step.js +1 -0
  581. package/dist/src/execution/dispatch-runtime-actions-step.d.ts +19 -0
  582. package/dist/src/execution/dispatch-runtime-actions-step.js +1 -0
  583. package/dist/src/execution/durable-session-migrations/chain.d.ts +38 -0
  584. package/dist/src/execution/durable-session-migrations/chain.js +1 -0
  585. package/dist/src/execution/durable-session-migrations/snapshot.d.ts +22 -0
  586. package/dist/src/execution/durable-session-migrations/snapshot.js +1 -0
  587. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.d.ts +12 -0
  588. package/dist/src/execution/durable-session-migrations/turn-workflow-v0-to-v1.js +1 -0
  589. package/dist/src/execution/durable-session-migrations/turn-workflow.d.ts +40 -0
  590. package/dist/src/execution/durable-session-migrations/turn-workflow.js +1 -0
  591. package/dist/src/execution/durable-session-store.d.ts +113 -0
  592. package/dist/src/execution/durable-session-store.js +1 -0
  593. package/dist/src/execution/eve-workflow-attributes.d.ts +136 -0
  594. package/dist/src/execution/eve-workflow-attributes.js +1 -0
  595. package/dist/src/execution/next-driver-action.d.ts +37 -0
  596. package/dist/src/execution/next-driver-action.js +1 -0
  597. package/dist/src/execution/node-step.d.ts +52 -0
  598. package/dist/src/execution/node-step.js +1 -0
  599. package/dist/src/execution/remote-agent-dispatch.d.ts +15 -0
  600. package/dist/src/execution/remote-agent-dispatch.js +1 -0
  601. package/dist/src/execution/runtime-context.d.ts +10 -0
  602. package/dist/src/execution/runtime-context.js +1 -0
  603. package/dist/src/execution/runtime-errors.d.ts +13 -0
  604. package/dist/src/execution/runtime-errors.js +1 -0
  605. package/dist/src/execution/sandbox/bash-tool.d.ts +30 -0
  606. package/dist/src/execution/sandbox/bash-tool.js +1 -0
  607. package/dist/src/execution/sandbox/bindings/local.d.ts +22 -0
  608. package/dist/src/execution/sandbox/bindings/local.js +1 -0
  609. package/dist/src/execution/sandbox/bindings/vercel.d.ts +28 -0
  610. package/dist/src/execution/sandbox/bindings/vercel.js +1 -0
  611. package/dist/src/execution/sandbox/ensure.d.ts +27 -0
  612. package/dist/src/execution/sandbox/ensure.js +1 -0
  613. package/dist/src/execution/sandbox/glob-tool.d.ts +22 -0
  614. package/dist/src/execution/sandbox/glob-tool.js +3 -0
  615. package/dist/src/execution/sandbox/grep-tool.d.ts +26 -0
  616. package/dist/src/execution/sandbox/grep-tool.js +3 -0
  617. package/dist/src/execution/sandbox/lazy-backend.d.ts +15 -0
  618. package/dist/src/execution/sandbox/lazy-backend.js +1 -0
  619. package/dist/src/execution/sandbox/prewarm.d.ts +57 -0
  620. package/dist/src/execution/sandbox/prewarm.js +1 -0
  621. package/dist/src/execution/sandbox/read-file-tool.d.ts +28 -0
  622. package/dist/src/execution/sandbox/read-file-tool.js +3 -0
  623. package/dist/src/execution/sandbox/require-sandbox.d.ts +15 -0
  624. package/dist/src/execution/sandbox/require-sandbox.js +1 -0
  625. package/dist/src/execution/sandbox/ripgrep-probe.d.ts +9 -0
  626. package/dist/src/execution/sandbox/ripgrep-probe.js +1 -0
  627. package/dist/src/execution/sandbox/session.d.ts +17 -0
  628. package/dist/src/execution/sandbox/session.js +3 -0
  629. package/dist/src/execution/sandbox/shell-quote.d.ts +12 -0
  630. package/dist/src/execution/sandbox/shell-quote.js +1 -0
  631. package/dist/src/execution/sandbox/stream-utils.d.ts +9 -0
  632. package/dist/src/execution/sandbox/stream-utils.js +1 -0
  633. package/dist/src/execution/sandbox/truncate-output.d.ts +72 -0
  634. package/dist/src/execution/sandbox/truncate-output.js +3 -0
  635. package/dist/src/execution/sandbox/write-file-tool.d.ts +23 -0
  636. package/dist/src/execution/sandbox/write-file-tool.js +1 -0
  637. package/dist/src/execution/session-callback-step.d.ts +16 -0
  638. package/dist/src/execution/session-callback-step.js +1 -0
  639. package/dist/src/execution/session.d.ts +81 -0
  640. package/dist/src/execution/session.js +5 -0
  641. package/dist/src/execution/skills/instructions.d.ts +19 -0
  642. package/dist/src/execution/skills/instructions.js +2 -0
  643. package/dist/src/execution/skills/types.d.ts +22 -0
  644. package/dist/src/execution/skills/types.js +1 -0
  645. package/dist/src/execution/subagent-adapter.d.ts +43 -0
  646. package/dist/src/execution/subagent-adapter.js +1 -0
  647. package/dist/src/execution/subagent-hitl-proxy.d.ts +37 -0
  648. package/dist/src/execution/subagent-hitl-proxy.js +1 -0
  649. package/dist/src/execution/subagent-invocation.d.ts +16 -0
  650. package/dist/src/execution/subagent-invocation.js +2 -0
  651. package/dist/src/execution/subagent-tool.d.ts +39 -0
  652. package/dist/src/execution/subagent-tool.js +1 -0
  653. package/dist/src/execution/tool-auth.d.ts +42 -0
  654. package/dist/src/execution/tool-auth.js +1 -0
  655. package/dist/src/execution/tool-compaction.d.ts +9 -0
  656. package/dist/src/execution/tool-compaction.js +1 -0
  657. package/dist/src/execution/turn-workflow.d.ts +30 -0
  658. package/dist/src/execution/turn-workflow.js +1 -0
  659. package/dist/src/execution/web-fetch/html.d.ts +15 -0
  660. package/dist/src/execution/web-fetch/html.js +7 -0
  661. package/dist/src/execution/web-fetch/tool.d.ts +34 -0
  662. package/dist/src/execution/web-fetch/tool.js +1 -0
  663. package/dist/src/execution/workflow-callback-url.d.ts +12 -0
  664. package/dist/src/execution/workflow-callback-url.js +1 -0
  665. package/dist/src/execution/workflow-entry.d.ts +26 -0
  666. package/dist/src/execution/workflow-entry.js +1 -0
  667. package/dist/src/execution/workflow-errors.d.ts +14 -0
  668. package/dist/src/execution/workflow-errors.js +1 -0
  669. package/dist/src/execution/workflow-runtime.d.ts +48 -0
  670. package/dist/src/execution/workflow-runtime.js +3 -0
  671. package/dist/src/execution/workflow-steps.d.ts +103 -0
  672. package/dist/src/execution/workflow-steps.js +1 -0
  673. package/dist/src/harness/action-result-helpers.d.ts +40 -0
  674. package/dist/src/harness/action-result-helpers.js +1 -0
  675. package/dist/src/harness/attachment-staging.d.ts +30 -0
  676. package/dist/src/harness/attachment-staging.js +1 -0
  677. package/dist/src/harness/authorization.d.ts +116 -0
  678. package/dist/src/harness/authorization.js +1 -0
  679. package/dist/src/harness/code-mode-interrupt-state.d.ts +26 -0
  680. package/dist/src/harness/code-mode-interrupt-state.js +1 -0
  681. package/dist/src/harness/code-mode-lifecycle.d.ts +16 -0
  682. package/dist/src/harness/code-mode-lifecycle.js +1 -0
  683. package/dist/src/harness/code-mode-runtime-action-state.d.ts +6 -0
  684. package/dist/src/harness/code-mode-runtime-action-state.js +1 -0
  685. package/dist/src/harness/code-mode.d.ts +26 -0
  686. package/dist/src/harness/code-mode.js +1 -0
  687. package/dist/src/harness/compaction.d.ts +43 -0
  688. package/dist/src/harness/compaction.js +4 -0
  689. package/dist/src/harness/emission.d.ts +124 -0
  690. package/dist/src/harness/emission.js +1 -0
  691. package/dist/src/harness/execute-tool.d.ts +28 -0
  692. package/dist/src/harness/execute-tool.js +1 -0
  693. package/dist/src/harness/input-extraction.d.ts +17 -0
  694. package/dist/src/harness/input-extraction.js +1 -0
  695. package/dist/src/harness/input-requests.d.ts +75 -0
  696. package/dist/src/harness/input-requests.js +1 -0
  697. package/dist/src/harness/instrumentation-config.d.ts +18 -0
  698. package/dist/src/harness/instrumentation-config.js +1 -0
  699. package/dist/src/harness/instrumentation-runtime-context.d.ts +23 -0
  700. package/dist/src/harness/instrumentation-runtime-context.js +1 -0
  701. package/dist/src/harness/messages.d.ts +41 -0
  702. package/dist/src/harness/messages.js +1 -0
  703. package/dist/src/harness/model-call-error.d.ts +53 -0
  704. package/dist/src/harness/model-call-error.js +1 -0
  705. package/dist/src/harness/otel-integration.d.ts +9 -0
  706. package/dist/src/harness/otel-integration.js +1 -0
  707. package/dist/src/harness/prompt-cache.d.ts +83 -0
  708. package/dist/src/harness/prompt-cache.js +1 -0
  709. package/dist/src/harness/provider-tools.d.ts +62 -0
  710. package/dist/src/harness/provider-tools.js +1 -0
  711. package/dist/src/harness/proxy-input-requests.d.ts +32 -0
  712. package/dist/src/harness/proxy-input-requests.js +1 -0
  713. package/dist/src/harness/runtime-actions.d.ts +106 -0
  714. package/dist/src/harness/runtime-actions.js +1 -0
  715. package/dist/src/harness/sandbox-surface.d.ts +68 -0
  716. package/dist/src/harness/sandbox-surface.js +1 -0
  717. package/dist/src/harness/step-hooks.d.ts +109 -0
  718. package/dist/src/harness/step-hooks.js +1 -0
  719. package/dist/src/harness/tool-interrupts.d.ts +22 -0
  720. package/dist/src/harness/tool-interrupts.js +1 -0
  721. package/dist/src/harness/tool-loop.d.ts +2 -0
  722. package/dist/src/harness/tool-loop.js +1 -0
  723. package/dist/src/harness/tool-result-pruning.d.ts +8 -0
  724. package/dist/src/harness/tool-result-pruning.js +1 -0
  725. package/dist/src/harness/tools.d.ts +69 -0
  726. package/dist/src/harness/tools.js +1 -0
  727. package/dist/src/harness/turn-tag-state.d.ts +50 -0
  728. package/dist/src/harness/turn-tag-state.js +1 -0
  729. package/dist/src/harness/types.d.ts +229 -0
  730. package/dist/src/harness/types.js +1 -0
  731. package/dist/src/harness/workflow-stream-error.d.ts +29 -0
  732. package/dist/src/harness/workflow-stream-error.js +1 -0
  733. package/dist/src/harness/workflow-tool-description.d.ts +17 -0
  734. package/dist/src/harness/workflow-tool-description.js +23 -0
  735. package/dist/src/index.d.ts +1 -0
  736. package/dist/src/index.js +1 -0
  737. package/dist/src/internal/application/cache-metadata.d.ts +9 -0
  738. package/dist/src/internal/application/cache-metadata.js +1 -0
  739. package/dist/src/internal/application/compiled-artifacts.d.ts +33 -0
  740. package/dist/src/internal/application/compiled-artifacts.js +4 -0
  741. package/dist/src/internal/application/import-specifier.d.ts +17 -0
  742. package/dist/src/internal/application/import-specifier.js +1 -0
  743. package/dist/src/internal/application/package.d.ts +34 -0
  744. package/dist/src/internal/application/package.js +1 -0
  745. package/dist/src/internal/application/paths.d.ts +47 -0
  746. package/dist/src/internal/application/paths.js +1 -0
  747. package/dist/src/internal/application/runtime-compiled-artifacts-source.d.ts +6 -0
  748. package/dist/src/internal/application/runtime-compiled-artifacts-source.js +1 -0
  749. package/dist/src/internal/attachments/data.d.ts +18 -0
  750. package/dist/src/internal/attachments/data.js +1 -0
  751. package/dist/src/internal/attachments/errors.d.ts +38 -0
  752. package/dist/src/internal/attachments/errors.js +1 -0
  753. package/dist/src/internal/attachments/refs.d.ts +55 -0
  754. package/dist/src/internal/attachments/refs.js +1 -0
  755. package/dist/src/internal/attachments/sandbox-refs.d.ts +46 -0
  756. package/dist/src/internal/attachments/sandbox-refs.js +1 -0
  757. package/dist/src/internal/attachments/url-refs.d.ts +17 -0
  758. package/dist/src/internal/attachments/url-refs.js +1 -0
  759. package/dist/src/internal/authored-asset-import-plugin.d.ts +5 -0
  760. package/dist/src/internal/authored-asset-import-plugin.js +1 -0
  761. package/dist/src/internal/authored-definition/channel.d.ts +16 -0
  762. package/dist/src/internal/authored-definition/channel.js +1 -0
  763. package/dist/src/internal/authored-definition/connection.d.ts +18 -0
  764. package/dist/src/internal/authored-definition/connection.js +1 -0
  765. package/dist/src/internal/authored-definition/core.d.ts +46 -0
  766. package/dist/src/internal/authored-definition/core.js +1 -0
  767. package/dist/src/internal/authored-definition/sandbox.d.ts +17 -0
  768. package/dist/src/internal/authored-definition/sandbox.js +1 -0
  769. package/dist/src/internal/authored-definition/schema-backed.d.ts +36 -0
  770. package/dist/src/internal/authored-definition/schema-backed.js +1 -0
  771. package/dist/src/internal/authored-module-bundle.d.ts +4 -0
  772. package/dist/src/internal/authored-module-bundle.js +2 -0
  773. package/dist/src/internal/authored-module-loader.d.ts +6 -0
  774. package/dist/src/internal/authored-module-loader.js +2 -0
  775. package/dist/src/internal/authored-module-map-loader.d.ts +10 -0
  776. package/dist/src/internal/authored-module-map-loader.js +1 -0
  777. package/dist/src/internal/authored-module.d.ts +42 -0
  778. package/dist/src/internal/authored-module.js +1 -0
  779. package/dist/src/internal/authored-package-tsconfig-paths.d.ts +9 -0
  780. package/dist/src/internal/authored-package-tsconfig-paths.js +1 -0
  781. package/dist/src/internal/bundler/nitro-rolldown.d.ts +26 -0
  782. package/dist/src/internal/bundler/nitro-rolldown.js +1 -0
  783. package/dist/src/internal/helpers/markdown.d.ts +45 -0
  784. package/dist/src/internal/helpers/markdown.js +3 -0
  785. package/dist/src/internal/instrumentation.d.ts +40 -0
  786. package/dist/src/internal/instrumentation.js +1 -0
  787. package/dist/src/internal/json-schema.d.ts +1 -0
  788. package/dist/src/internal/json-schema.js +1 -0
  789. package/dist/src/internal/logging.d.ts +100 -0
  790. package/dist/src/internal/logging.js +1 -0
  791. package/dist/src/internal/nitro/dev-runtime-artifacts.d.ts +32 -0
  792. package/dist/src/internal/nitro/dev-runtime-artifacts.js +1 -0
  793. package/dist/src/internal/nitro/host/artifacts-config.d.ts +16 -0
  794. package/dist/src/internal/nitro/host/artifacts-config.js +1 -0
  795. package/dist/src/internal/nitro/host/build-application.d.ts +4 -0
  796. package/dist/src/internal/nitro/host/build-application.js +1 -0
  797. package/dist/src/internal/nitro/host/build-vercel-agent-summary.d.ts +40 -0
  798. package/dist/src/internal/nitro/host/build-vercel-agent-summary.js +1 -0
  799. package/dist/src/internal/nitro/host/channel-routes.d.ts +38 -0
  800. package/dist/src/internal/nitro/host/channel-routes.js +3 -0
  801. package/dist/src/internal/nitro/host/code-mode-runtime-dependency-plugin.d.ts +1 -0
  802. package/dist/src/internal/nitro/host/code-mode-runtime-dependency-plugin.js +1 -0
  803. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.d.ts +13 -0
  804. package/dist/src/internal/nitro/host/compiled-sandbox-backend-prune-plugin.js +2 -0
  805. package/dist/src/internal/nitro/host/configure-nitro-routes.d.ts +9 -0
  806. package/dist/src/internal/nitro/host/configure-nitro-routes.js +4 -0
  807. package/dist/src/internal/nitro/host/create-application-nitro.d.ts +14 -0
  808. package/dist/src/internal/nitro/host/create-application-nitro.js +1 -0
  809. package/dist/src/internal/nitro/host/cron-handler-route.d.ts +41 -0
  810. package/dist/src/internal/nitro/host/cron-handler-route.js +1 -0
  811. package/dist/src/internal/nitro/host/dev-authored-source-watcher.d.ts +29 -0
  812. package/dist/src/internal/nitro/host/dev-authored-source-watcher.js +1 -0
  813. package/dist/src/internal/nitro/host/dispatch-schedule-in-dev.d.ts +41 -0
  814. package/dist/src/internal/nitro/host/dispatch-schedule-in-dev.js +1 -0
  815. package/dist/src/internal/nitro/host/nitro-bundler-config.d.ts +5 -0
  816. package/dist/src/internal/nitro/host/nitro-bundler-config.js +1 -0
  817. package/dist/src/internal/nitro/host/nitro-routing-import-specifier-plugin.d.ts +6 -0
  818. package/dist/src/internal/nitro/host/nitro-routing-import-specifier-plugin.js +1 -0
  819. package/dist/src/internal/nitro/host/prepare-application-host.d.ts +8 -0
  820. package/dist/src/internal/nitro/host/prepare-application-host.js +1 -0
  821. package/dist/src/internal/nitro/host/schedule-task-routes.d.ts +60 -0
  822. package/dist/src/internal/nitro/host/schedule-task-routes.js +2 -0
  823. package/dist/src/internal/nitro/host/server-external-packages.d.ts +5 -0
  824. package/dist/src/internal/nitro/host/server-external-packages.js +1 -0
  825. package/dist/src/internal/nitro/host/start-development-server.d.ts +20 -0
  826. package/dist/src/internal/nitro/host/start-development-server.js +1 -0
  827. package/dist/src/internal/nitro/host/start-production-server.d.ts +8 -0
  828. package/dist/src/internal/nitro/host/start-production-server.js +3 -0
  829. package/dist/src/internal/nitro/host/types.d.ts +31 -0
  830. package/dist/src/internal/nitro/host/types.js +1 -0
  831. package/dist/src/internal/nitro/host/vercel-build-output-config.d.ts +8 -0
  832. package/dist/src/internal/nitro/host/vercel-build-output-config.js +1 -0
  833. package/dist/src/internal/nitro/host/vercel-build-prewarm.d.ts +19 -0
  834. package/dist/src/internal/nitro/host/vercel-build-prewarm.js +1 -0
  835. package/dist/src/internal/nitro/host.d.ts +4 -0
  836. package/dist/src/internal/nitro/host.js +1 -0
  837. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.d.ts +86 -0
  838. package/dist/src/internal/nitro/routes/agent-info/build-agent-info-response.js +6 -0
  839. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.d.ts +26 -0
  840. package/dist/src/internal/nitro/routes/agent-info/load-agent-info-data.js +1 -0
  841. package/dist/src/internal/nitro/routes/channel-dispatch.d.ts +22 -0
  842. package/dist/src/internal/nitro/routes/channel-dispatch.js +1 -0
  843. package/dist/src/internal/nitro/routes/dev-runtime-artifacts.d.ts +10 -0
  844. package/dist/src/internal/nitro/routes/dev-runtime-artifacts.js +1 -0
  845. package/dist/src/internal/nitro/routes/dev-schedule-dispatch.d.ts +15 -0
  846. package/dist/src/internal/nitro/routes/dev-schedule-dispatch.js +1 -0
  847. package/dist/src/internal/nitro/routes/health.d.ts +14 -0
  848. package/dist/src/internal/nitro/routes/health.js +1 -0
  849. package/dist/src/internal/nitro/routes/index.d.ts +12 -0
  850. package/dist/src/internal/nitro/routes/index.js +151 -0
  851. package/dist/src/internal/nitro/routes/info.d.ts +16 -0
  852. package/dist/src/internal/nitro/routes/info.js +1 -0
  853. package/dist/src/internal/nitro/routes/runtime-artifacts.d.ts +17 -0
  854. package/dist/src/internal/nitro/routes/runtime-artifacts.js +1 -0
  855. package/dist/src/internal/nitro/routes/runtime-stack.d.ts +26 -0
  856. package/dist/src/internal/nitro/routes/runtime-stack.js +1 -0
  857. package/dist/src/internal/nitro/routes/schedule-task.d.ts +12 -0
  858. package/dist/src/internal/nitro/routes/schedule-task.js +1 -0
  859. package/dist/src/internal/node-esm-compat-banner.d.ts +46 -0
  860. package/dist/src/internal/node-esm-compat-banner.js +4 -0
  861. package/dist/src/internal/package-name.d.ts +8 -0
  862. package/dist/src/internal/package-name.js +1 -0
  863. package/dist/src/internal/process/pnpm.d.ts +28 -0
  864. package/dist/src/internal/process/pnpm.js +1 -0
  865. package/dist/src/internal/runtime-model.d.ts +13 -0
  866. package/dist/src/internal/runtime-model.js +1 -0
  867. package/dist/src/internal/runtime-registry.d.ts +77 -0
  868. package/dist/src/internal/runtime-registry.js +1 -0
  869. package/dist/src/internal/vercel-agent-summary.d.ts +210 -0
  870. package/dist/src/internal/vercel-agent-summary.js +1 -0
  871. package/dist/src/internal/workflow/builtins.d.ts +41 -0
  872. package/dist/src/internal/workflow/builtins.js +1 -0
  873. package/dist/src/internal/workflow/index.d.ts +6 -0
  874. package/dist/src/internal/workflow/index.js +1 -0
  875. package/dist/src/internal/workflow-bundle/builder-support.d.ts +71 -0
  876. package/dist/src/internal/workflow-bundle/builder-support.js +9 -0
  877. package/dist/src/internal/workflow-bundle/builder.d.ts +36 -0
  878. package/dist/src/internal/workflow-bundle/builder.js +5 -0
  879. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.d.ts +39 -0
  880. package/dist/src/internal/workflow-bundle/dynamic-tool-transform.js +4 -0
  881. package/dist/src/internal/workflow-bundle/eve-service-route-output.d.ts +4 -0
  882. package/dist/src/internal/workflow-bundle/eve-service-route-output.js +54 -0
  883. package/dist/src/internal/workflow-bundle/nitro-step-entry.d.ts +17 -0
  884. package/dist/src/internal/workflow-bundle/nitro-step-entry.js +2 -0
  885. package/dist/src/internal/workflow-bundle/vercel-workflow-output.d.ts +66 -0
  886. package/dist/src/internal/workflow-bundle/vercel-workflow-output.js +3 -0
  887. package/dist/src/internal/workflow-bundle/workflow-builders.d.ts +44 -0
  888. package/dist/src/internal/workflow-bundle/workflow-builders.js +1 -0
  889. package/dist/src/internal/workflow-bundle/workflow-core-shim.d.ts +82 -0
  890. package/dist/src/internal/workflow-bundle/workflow-core-shim.js +1 -0
  891. package/dist/src/internal/workflow-bundle/workflow-transformer.d.ts +25 -0
  892. package/dist/src/internal/workflow-bundle/workflow-transformer.js +5 -0
  893. package/dist/src/node_modules/.pnpm/@clack_core@1.3.1/node_modules/@clack/core/dist/index.js +10 -0
  894. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/ajv.js +1 -0
  895. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/code.js +1 -0
  896. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/index.js +2 -0
  897. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/codegen/scope.js +1 -0
  898. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/errors.js +1 -0
  899. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/index.js +1 -0
  900. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/names.js +1 -0
  901. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/ref_error.js +1 -0
  902. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/resolve.js +1 -0
  903. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/rules.js +1 -0
  904. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/util.js +1 -0
  905. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/applicability.js +1 -0
  906. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/boolSchema.js +1 -0
  907. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/dataType.js +4 -0
  908. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/defaults.js +1 -0
  909. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/index.js +1 -0
  910. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/keyword.js +1 -0
  911. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/compile/validate/subschema.js +1 -0
  912. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/core.js +1 -0
  913. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/data.js +1 -0
  914. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/refs/json-schema-draft-07.js +1 -0
  915. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/equal.js +1 -0
  916. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/ucs2length.js +1 -0
  917. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/uri.js +1 -0
  918. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/runtime/validation_error.js +1 -0
  919. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +1 -0
  920. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +1 -0
  921. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/allOf.js +1 -0
  922. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +1 -0
  923. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/contains.js +1 -0
  924. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +4 -0
  925. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/if.js +1 -0
  926. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -0
  927. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items.js +1 -0
  928. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/items2020.js +1 -0
  929. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/not.js +1 -0
  930. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +1 -0
  931. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +1 -0
  932. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +1 -0
  933. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/properties.js +1 -0
  934. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +1 -0
  935. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +1 -0
  936. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/code.js +1 -0
  937. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/id.js +1 -0
  938. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/index.js +1 -0
  939. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/core/ref.js +1 -0
  940. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -0
  941. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/discriminator/types.js +1 -0
  942. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/draft7.js +1 -0
  943. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/format.js +1 -0
  944. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/format/index.js +1 -0
  945. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/metadata.js +1 -0
  946. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/const.js +1 -0
  947. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/enum.js +1 -0
  948. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/index.js +1 -0
  949. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitItems.js +1 -0
  950. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitLength.js +1 -0
  951. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +1 -0
  952. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +1 -0
  953. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +1 -0
  954. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/pattern.js +1 -0
  955. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/required.js +1 -0
  956. package/dist/src/node_modules/.pnpm/ajv@8.20.0/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +1 -0
  957. package/dist/src/node_modules/.pnpm/autoevals@0.0.132_ws@8.21.0/node_modules/autoevals/jsdist/index.js +384 -0
  958. package/dist/src/node_modules/.pnpm/compute-cosine-similarity@1.1.0/node_modules/compute-cosine-similarity/lib/index.js +1 -0
  959. package/dist/src/node_modules/.pnpm/compute-dot@1.1.0/node_modules/compute-dot/lib/index.js +1 -0
  960. package/dist/src/node_modules/.pnpm/compute-l2norm@1.1.0/node_modules/compute-l2norm/lib/index.js +1 -0
  961. package/dist/src/node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/index.js +1 -0
  962. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/index.js +1 -0
  963. package/dist/src/node_modules/.pnpm/fast-string-truncated-width@3.0.3/node_modules/fast-string-truncated-width/dist/utils.js +1 -0
  964. package/dist/src/node_modules/.pnpm/fast-string-width@3.0.2/node_modules/fast-string-width/dist/index.js +1 -0
  965. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/index.js +1 -0
  966. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/schemes.js +1 -0
  967. package/dist/src/node_modules/.pnpm/fast-uri@3.1.2/node_modules/fast-uri/lib/utils.js +1 -0
  968. package/dist/src/node_modules/.pnpm/fast-wrap-ansi@0.2.2/node_modules/fast-wrap-ansi/lib/main.js +5 -0
  969. package/dist/src/node_modules/.pnpm/js-levenshtein@1.1.6/node_modules/js-levenshtein/index.js +1 -0
  970. package/dist/src/node_modules/.pnpm/js-yaml@4.1.1/node_modules/js-yaml/dist/js-yaml.js +32 -0
  971. package/dist/src/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js +1 -0
  972. package/dist/src/node_modules/.pnpm/mustache@4.2.0/node_modules/mustache/mustache.js +4 -0
  973. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/_vendor/partial-json-parser/parser.js +2 -0
  974. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/auth/workload-identity-auth.js +1 -0
  975. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/azure.js +1 -0
  976. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/client.js +11 -0
  977. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/api-promise.js +1 -0
  978. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/error.js +1 -0
  979. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/pagination.js +1 -0
  980. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/resource.js +1 -0
  981. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/streaming.js +3 -0
  982. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/core/uploads.js +1 -0
  983. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/error.js +1 -0
  984. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/index.js +1 -0
  985. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/decoders/line.js +3 -0
  986. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/detect-platform.js +1 -0
  987. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/errors.js +1 -0
  988. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/headers.js +1 -0
  989. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/parse.js +1 -0
  990. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/formats.js +1 -0
  991. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/stringify.js +1 -0
  992. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/qs/utils.js +1 -0
  993. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/request-options.js +1 -0
  994. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/shims.js +1 -0
  995. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/to-file.js +1 -0
  996. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/tslib.js +1 -0
  997. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/uploads.js +1 -0
  998. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/base64.js +1 -0
  999. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/bytes.js +1 -0
  1000. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/env.js +1 -0
  1001. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/log.js +1 -0
  1002. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/path.js +2 -0
  1003. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/query.js +1 -0
  1004. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/sleep.js +1 -0
  1005. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/uuid.js +1 -0
  1006. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils/values.js +1 -0
  1007. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/internal/utils.js +1 -0
  1008. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AbstractChatCompletionRunner.js +1 -0
  1009. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/AssistantStream.js +1 -0
  1010. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionRunner.js +1 -0
  1011. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStream.js +1 -0
  1012. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ChatCompletionStreamingRunner.js +1 -0
  1013. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/EventStream.js +1 -0
  1014. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/ResponsesParser.js +1 -0
  1015. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/RunnableFunction.js +1 -0
  1016. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/Util.js +1 -0
  1017. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/chatCompletionUtils.js +1 -0
  1018. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/parser.js +1 -0
  1019. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/lib/responses/ResponseStream.js +1 -0
  1020. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/admin.js +1 -0
  1021. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/admin-api-keys.js +1 -0
  1022. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/audit-logs.js +1 -0
  1023. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/certificates.js +1 -0
  1024. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/data-retention.js +1 -0
  1025. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/groups.js +1 -0
  1026. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/roles.js +1 -0
  1027. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/groups/users.js +1 -0
  1028. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/invites.js +1 -0
  1029. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/organization.js +1 -0
  1030. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/api-keys.js +1 -0
  1031. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/certificates.js +1 -0
  1032. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/data-retention.js +1 -0
  1033. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/groups.js +1 -0
  1034. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/groups/roles.js +1 -0
  1035. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.js +1 -0
  1036. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/model-permissions.js +1 -0
  1037. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/projects.js +1 -0
  1038. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/rate-limits.js +1 -0
  1039. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/roles.js +1 -0
  1040. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/service-accounts.js +1 -0
  1041. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/spend-alerts.js +1 -0
  1042. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/roles.js +1 -0
  1043. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/projects/users/users.js +1 -0
  1044. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/roles.js +1 -0
  1045. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/spend-alerts.js +1 -0
  1046. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/usage.js +1 -0
  1047. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/roles.js +1 -0
  1048. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/admin/organization/users/users.js +1 -0
  1049. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/audio.js +1 -0
  1050. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/speech.js +1 -0
  1051. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/transcriptions.js +1 -0
  1052. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/audio/translations.js +1 -0
  1053. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/batches.js +1 -0
  1054. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/assistants.js +1 -0
  1055. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/beta.js +1 -0
  1056. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/chatkit.js +1 -0
  1057. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/sessions.js +1 -0
  1058. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/chatkit/threads.js +1 -0
  1059. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/realtime.js +1 -0
  1060. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/sessions.js +1 -0
  1061. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/realtime/transcription-sessions.js +1 -0
  1062. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/messages.js +1 -0
  1063. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/runs.js +1 -0
  1064. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/runs/steps.js +1 -0
  1065. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/beta/threads/threads.js +1 -0
  1066. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/chat.js +1 -0
  1067. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/completions.js +1 -0
  1068. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/index.js +1 -0
  1069. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/completions/messages.js +1 -0
  1070. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/chat/index.js +1 -0
  1071. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/completions.js +1 -0
  1072. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/containers.js +1 -0
  1073. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/content.js +1 -0
  1074. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/containers/files/files.js +1 -0
  1075. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/conversations.js +1 -0
  1076. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/conversations/items.js +1 -0
  1077. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/embeddings.js +1 -0
  1078. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/evals.js +1 -0
  1079. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/output-items.js +1 -0
  1080. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/evals/runs/runs.js +1 -0
  1081. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/files.js +1 -0
  1082. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/alpha.js +1 -0
  1083. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/alpha/graders.js +1 -0
  1084. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.js +1 -0
  1085. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/checkpoints/permissions.js +1 -0
  1086. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/fine-tuning.js +1 -0
  1087. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/checkpoints.js +1 -0
  1088. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/jobs/jobs.js +1 -0
  1089. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/fine-tuning/methods.js +1 -0
  1090. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/grader-models.js +1 -0
  1091. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/graders/graders.js +1 -0
  1092. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/images.js +1 -0
  1093. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/index.js +1 -0
  1094. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/models.js +1 -0
  1095. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/moderations.js +1 -0
  1096. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/calls.js +1 -0
  1097. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/client-secrets.js +1 -0
  1098. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/realtime/realtime.js +1 -0
  1099. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-items.js +1 -0
  1100. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/input-tokens.js +1 -0
  1101. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/responses/responses.js +1 -0
  1102. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/shared.js +1 -0
  1103. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/content.js +1 -0
  1104. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/skills.js +1 -0
  1105. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/content.js +1 -0
  1106. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/skills/versions/versions.js +1 -0
  1107. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/parts.js +1 -0
  1108. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/uploads/uploads.js +1 -0
  1109. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/file-batches.js +1 -0
  1110. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/files.js +1 -0
  1111. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/vector-stores/vector-stores.js +1 -0
  1112. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/videos.js +1 -0
  1113. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/index.js +1 -0
  1114. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks/webhooks.js +1 -0
  1115. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/resources/webhooks.js +1 -0
  1116. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/streaming.js +1 -0
  1117. package/dist/src/node_modules/.pnpm/openai@6.39.1_ws@8.21.0_zod@3.25.76/node_modules/openai/version.js +1 -0
  1118. package/dist/src/node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js +1 -0
  1119. package/dist/src/node_modules/.pnpm/sisteransi@1.0.5/node_modules/sisteransi/src/index.js +1 -0
  1120. package/dist/src/node_modules/.pnpm/validate.io-array@1.0.6/node_modules/validate.io-array/lib/index.js +1 -0
  1121. package/dist/src/node_modules/.pnpm/validate.io-function@1.0.2/node_modules/validate.io-function/lib/index.js +1 -0
  1122. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js +1 -0
  1123. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js +1 -0
  1124. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +1 -0
  1125. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +1 -0
  1126. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/index.js +1 -0
  1127. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js +1 -0
  1128. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseTypes.js +1 -0
  1129. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +1 -0
  1130. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +1 -0
  1131. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +1 -0
  1132. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +1 -0
  1133. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +1 -0
  1134. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +1 -0
  1135. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +1 -0
  1136. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +1 -0
  1137. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +1 -0
  1138. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +1 -0
  1139. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +1 -0
  1140. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +1 -0
  1141. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +1 -0
  1142. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +1 -0
  1143. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +1 -0
  1144. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +1 -0
  1145. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +1 -0
  1146. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +1 -0
  1147. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +1 -0
  1148. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +1 -0
  1149. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +1 -0
  1150. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +1 -0
  1151. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +1 -0
  1152. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +1 -0
  1153. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +1 -0
  1154. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +3 -0
  1155. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +1 -0
  1156. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +1 -0
  1157. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +1 -0
  1158. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +1 -0
  1159. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js +1 -0
  1160. package/dist/src/node_modules/.pnpm/zod-to-json-schema@3.25.2_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +1 -0
  1161. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/index.js +1 -0
  1162. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/ZodError.js +1 -0
  1163. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/errors.js +1 -0
  1164. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/external.js +1 -0
  1165. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/errorUtil.js +1 -0
  1166. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/parseUtil.js +1 -0
  1167. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/typeAliases.js +1 -0
  1168. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/helpers/util.js +1 -0
  1169. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/index.js +1 -0
  1170. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/locales/en.js +1 -0
  1171. package/dist/src/node_modules/.pnpm/zod@3.25.76/node_modules/zod/v3/types.js +1 -0
  1172. package/dist/src/packages/eve-catalog/src/index.js +1 -0
  1173. package/dist/src/packages/eve-scaffold/src/channels-catalog.js +1 -0
  1174. package/dist/src/packages/eve-scaffold/src/channels.js +7 -0
  1175. package/dist/src/packages/eve-scaffold/src/cli/channel-add-prompter.js +1 -0
  1176. package/dist/src/packages/eve-scaffold/src/cli/channel-setup-prompter.js +1 -0
  1177. package/dist/src/packages/eve-scaffold/src/cli/command-output.js +1 -0
  1178. package/dist/src/packages/eve-scaffold/src/cli/connection-add-prompter.js +1 -0
  1179. package/dist/src/packages/eve-scaffold/src/cli/index.js +1 -0
  1180. package/dist/src/packages/eve-scaffold/src/cli/prompt-ui.js +5 -0
  1181. package/dist/src/packages/eve-scaffold/src/cli/rail-log.js +2 -0
  1182. package/dist/src/packages/eve-scaffold/src/cli/select-component.js +1 -0
  1183. package/dist/src/packages/eve-scaffold/src/cli/select-state.js +1 -0
  1184. package/dist/src/packages/eve-scaffold/src/connections/catalog.js +1 -0
  1185. package/dist/src/packages/eve-scaffold/src/connections.js +21 -0
  1186. package/dist/src/packages/eve-scaffold/src/files.js +1 -0
  1187. package/dist/src/packages/eve-scaffold/src/human-action.js +1 -0
  1188. package/dist/src/packages/eve-scaffold/src/index.js +1 -0
  1189. package/dist/src/packages/eve-scaffold/src/module-files.js +1 -0
  1190. package/dist/src/packages/eve-scaffold/src/package-json.js +1 -0
  1191. package/dist/src/packages/eve-scaffold/src/pnpm-workspace.js +11 -0
  1192. package/dist/src/packages/eve-scaffold/src/primitives/detect-deployment.js +1 -0
  1193. package/dist/src/packages/eve-scaffold/src/primitives/index.js +1 -0
  1194. package/dist/src/packages/eve-scaffold/src/primitives/pnpm-invocation.js +1 -0
  1195. package/dist/src/packages/eve-scaffold/src/primitives/process-output.js +1 -0
  1196. package/dist/src/packages/eve-scaffold/src/primitives/run-pnpm.js +1 -0
  1197. package/dist/src/packages/eve-scaffold/src/primitives/run-vercel.js +1 -0
  1198. package/dist/src/packages/eve-scaffold/src/primitives/update-connection-connector.js +1 -0
  1199. package/dist/src/packages/eve-scaffold/src/primitives/update-slack-channel.js +1 -0
  1200. package/dist/src/packages/eve-scaffold/src/project.js +1 -0
  1201. package/dist/src/packages/eve-scaffold/src/steps/deploy-to-vercel.js +1 -0
  1202. package/dist/src/packages/eve-scaffold/src/steps/index.js +1 -0
  1203. package/dist/src/packages/eve-scaffold/src/steps/project-resolution.js +1 -0
  1204. package/dist/src/packages/eve-scaffold/src/steps/run-add-connection.js +1 -0
  1205. package/dist/src/packages/eve-scaffold/src/steps/run-add-to-agent.js +2 -0
  1206. package/dist/src/packages/eve-scaffold/src/steps/setup-connection.js +1 -0
  1207. package/dist/src/packages/eve-scaffold/src/steps/setup-slackbot.js +1 -0
  1208. package/dist/src/packages/eve-scaffold/src/web-template.js +4691 -0
  1209. package/dist/src/protocol/message.d.ts +732 -0
  1210. package/dist/src/protocol/message.js +2 -0
  1211. package/dist/src/protocol/routes.d.ts +108 -0
  1212. package/dist/src/protocol/routes.js +1 -0
  1213. package/dist/src/public/agents/auth.d.ts +46 -0
  1214. package/dist/src/public/agents/auth.js +1 -0
  1215. package/dist/src/public/channels/auth.d.ts +416 -0
  1216. package/dist/src/public/channels/auth.js +1 -0
  1217. package/dist/src/public/channels/discord/api.d.ts +106 -0
  1218. package/dist/src/public/channels/discord/api.js +2 -0
  1219. package/dist/src/public/channels/discord/defaults.d.ts +15 -0
  1220. package/dist/src/public/channels/discord/defaults.js +3 -0
  1221. package/dist/src/public/channels/discord/discordChannel.d.ts +134 -0
  1222. package/dist/src/public/channels/discord/discordChannel.js +1 -0
  1223. package/dist/src/public/channels/discord/hitl.d.ts +47 -0
  1224. package/dist/src/public/channels/discord/hitl.js +1 -0
  1225. package/dist/src/public/channels/discord/inbound.d.ts +106 -0
  1226. package/dist/src/public/channels/discord/inbound.js +2 -0
  1227. package/dist/src/public/channels/discord/index.d.ts +23 -0
  1228. package/dist/src/public/channels/discord/index.js +1 -0
  1229. package/dist/src/public/channels/discord/responses.d.ts +11 -0
  1230. package/dist/src/public/channels/discord/responses.js +1 -0
  1231. package/dist/src/public/channels/discord/verify.d.ts +46 -0
  1232. package/dist/src/public/channels/discord/verify.js +1 -0
  1233. package/dist/src/public/channels/discord/verifyInbound.d.ts +6 -0
  1234. package/dist/src/public/channels/discord/verifyInbound.js +1 -0
  1235. package/dist/src/public/channels/eve.d.ts +81 -0
  1236. package/dist/src/public/channels/eve.js +2 -0
  1237. package/dist/src/public/channels/github/api.d.ts +177 -0
  1238. package/dist/src/public/channels/github/api.js +1 -0
  1239. package/dist/src/public/channels/github/auth.d.ts +82 -0
  1240. package/dist/src/public/channels/github/auth.js +2 -0
  1241. package/dist/src/public/channels/github/binding.d.ts +59 -0
  1242. package/dist/src/public/channels/github/binding.js +1 -0
  1243. package/dist/src/public/channels/github/checkout.d.ts +48 -0
  1244. package/dist/src/public/channels/github/checkout.js +1 -0
  1245. package/dist/src/public/channels/github/constants.d.ts +2 -0
  1246. package/dist/src/public/channels/github/constants.js +1 -0
  1247. package/dist/src/public/channels/github/defaults.d.ts +26 -0
  1248. package/dist/src/public/channels/github/defaults.js +3 -0
  1249. package/dist/src/public/channels/github/dispatch.d.ts +34 -0
  1250. package/dist/src/public/channels/github/dispatch.js +1 -0
  1251. package/dist/src/public/channels/github/githubChannel.d.ts +126 -0
  1252. package/dist/src/public/channels/github/githubChannel.js +1 -0
  1253. package/dist/src/public/channels/github/inbound.d.ts +183 -0
  1254. package/dist/src/public/channels/github/inbound.js +2 -0
  1255. package/dist/src/public/channels/github/index.d.ts +9 -0
  1256. package/dist/src/public/channels/github/index.js +1 -0
  1257. package/dist/src/public/channels/github/limits.d.ts +4 -0
  1258. package/dist/src/public/channels/github/limits.js +2 -0
  1259. package/dist/src/public/channels/github/pr-context.d.ts +46 -0
  1260. package/dist/src/public/channels/github/pr-context.js +5 -0
  1261. package/dist/src/public/channels/github/state.d.ts +60 -0
  1262. package/dist/src/public/channels/github/state.js +1 -0
  1263. package/dist/src/public/channels/github/verify.d.ts +35 -0
  1264. package/dist/src/public/channels/github/verify.js +1 -0
  1265. package/dist/src/public/channels/index.d.ts +89 -0
  1266. package/dist/src/public/channels/index.js +1 -0
  1267. package/dist/src/public/channels/linear/api.d.ts +122 -0
  1268. package/dist/src/public/channels/linear/api.js +69 -0
  1269. package/dist/src/public/channels/linear/auth.d.ts +22 -0
  1270. package/dist/src/public/channels/linear/auth.js +1 -0
  1271. package/dist/src/public/channels/linear/constants.d.ts +2 -0
  1272. package/dist/src/public/channels/linear/constants.js +1 -0
  1273. package/dist/src/public/channels/linear/defaults.d.ts +16 -0
  1274. package/dist/src/public/channels/linear/defaults.js +3 -0
  1275. package/dist/src/public/channels/linear/hitl.d.ts +14 -0
  1276. package/dist/src/public/channels/linear/hitl.js +4 -0
  1277. package/dist/src/public/channels/linear/inbound.d.ts +88 -0
  1278. package/dist/src/public/channels/linear/inbound.js +2 -0
  1279. package/dist/src/public/channels/linear/index.d.ts +8 -0
  1280. package/dist/src/public/channels/linear/index.js +1 -0
  1281. package/dist/src/public/channels/linear/linearChannel.d.ts +138 -0
  1282. package/dist/src/public/channels/linear/linearChannel.js +1 -0
  1283. package/dist/src/public/channels/linear/verify.d.ts +22 -0
  1284. package/dist/src/public/channels/linear/verify.js +1 -0
  1285. package/dist/src/public/channels/slack/api-encoding.d.ts +5 -0
  1286. package/dist/src/public/channels/slack/api-encoding.js +1 -0
  1287. package/dist/src/public/channels/slack/api.d.ts +258 -0
  1288. package/dist/src/public/channels/slack/api.js +1 -0
  1289. package/dist/src/public/channels/slack/attachments.d.ts +51 -0
  1290. package/dist/src/public/channels/slack/attachments.js +1 -0
  1291. package/dist/src/public/channels/slack/auth.d.ts +16 -0
  1292. package/dist/src/public/channels/slack/auth.js +1 -0
  1293. package/dist/src/public/channels/slack/blocks.d.ts +45 -0
  1294. package/dist/src/public/channels/slack/blocks.js +3 -0
  1295. package/dist/src/public/channels/slack/connections.d.ts +53 -0
  1296. package/dist/src/public/channels/slack/connections.js +1 -0
  1297. package/dist/src/public/channels/slack/constants.d.ts +7 -0
  1298. package/dist/src/public/channels/slack/constants.js +1 -0
  1299. package/dist/src/public/channels/slack/defaults.d.ts +36 -0
  1300. package/dist/src/public/channels/slack/defaults.js +4 -0
  1301. package/dist/src/public/channels/slack/hitl.d.ts +141 -0
  1302. package/dist/src/public/channels/slack/hitl.js +1 -0
  1303. package/dist/src/public/channels/slack/inbound.d.ts +122 -0
  1304. package/dist/src/public/channels/slack/inbound.js +2 -0
  1305. package/dist/src/public/channels/slack/index.d.ts +22 -0
  1306. package/dist/src/public/channels/slack/index.js +1 -0
  1307. package/dist/src/public/channels/slack/interactions.d.ts +64 -0
  1308. package/dist/src/public/channels/slack/interactions.js +1 -0
  1309. package/dist/src/public/channels/slack/limits.d.ts +62 -0
  1310. package/dist/src/public/channels/slack/limits.js +1 -0
  1311. package/dist/src/public/channels/slack/mrkdwn.d.ts +38 -0
  1312. package/dist/src/public/channels/slack/mrkdwn.js +1 -0
  1313. package/dist/src/public/channels/slack/slackChannel.d.ts +303 -0
  1314. package/dist/src/public/channels/slack/slackChannel.js +1 -0
  1315. package/dist/src/public/channels/slack/thread.d.ts +33 -0
  1316. package/dist/src/public/channels/slack/thread.js +1 -0
  1317. package/dist/src/public/channels/slack/utils.d.ts +1 -0
  1318. package/dist/src/public/channels/slack/utils.js +1 -0
  1319. package/dist/src/public/channels/slack/verify.d.ts +48 -0
  1320. package/dist/src/public/channels/slack/verify.js +1 -0
  1321. package/dist/src/public/channels/teams/api.d.ts +155 -0
  1322. package/dist/src/public/channels/teams/api.js +4 -0
  1323. package/dist/src/public/channels/teams/attachments.d.ts +35 -0
  1324. package/dist/src/public/channels/teams/attachments.js +1 -0
  1325. package/dist/src/public/channels/teams/defaults.d.ts +24 -0
  1326. package/dist/src/public/channels/teams/defaults.js +3 -0
  1327. package/dist/src/public/channels/teams/hitl.d.ts +49 -0
  1328. package/dist/src/public/channels/teams/hitl.js +1 -0
  1329. package/dist/src/public/channels/teams/inbound.d.ts +85 -0
  1330. package/dist/src/public/channels/teams/inbound.js +3 -0
  1331. package/dist/src/public/channels/teams/index.d.ts +19 -0
  1332. package/dist/src/public/channels/teams/index.js +1 -0
  1333. package/dist/src/public/channels/teams/limits.d.ts +8 -0
  1334. package/dist/src/public/channels/teams/limits.js +1 -0
  1335. package/dist/src/public/channels/teams/teamsChannel.d.ts +164 -0
  1336. package/dist/src/public/channels/teams/teamsChannel.js +1 -0
  1337. package/dist/src/public/channels/teams/verify.d.ts +50 -0
  1338. package/dist/src/public/channels/teams/verify.js +1 -0
  1339. package/dist/src/public/channels/telegram/api.d.ts +120 -0
  1340. package/dist/src/public/channels/telegram/api.js +2 -0
  1341. package/dist/src/public/channels/telegram/attachments.d.ts +31 -0
  1342. package/dist/src/public/channels/telegram/attachments.js +1 -0
  1343. package/dist/src/public/channels/telegram/defaults.d.ts +9 -0
  1344. package/dist/src/public/channels/telegram/defaults.js +3 -0
  1345. package/dist/src/public/channels/telegram/hitl.d.ts +59 -0
  1346. package/dist/src/public/channels/telegram/hitl.js +1 -0
  1347. package/dist/src/public/channels/telegram/inbound.d.ts +102 -0
  1348. package/dist/src/public/channels/telegram/inbound.js +2 -0
  1349. package/dist/src/public/channels/telegram/index.d.ts +19 -0
  1350. package/dist/src/public/channels/telegram/index.js +1 -0
  1351. package/dist/src/public/channels/telegram/telegramChannel.d.ts +127 -0
  1352. package/dist/src/public/channels/telegram/telegramChannel.js +1 -0
  1353. package/dist/src/public/channels/telegram/verify.d.ts +35 -0
  1354. package/dist/src/public/channels/telegram/verify.js +1 -0
  1355. package/dist/src/public/channels/twilio/api.d.ts +74 -0
  1356. package/dist/src/public/channels/twilio/api.js +1 -0
  1357. package/dist/src/public/channels/twilio/defaults.d.ts +17 -0
  1358. package/dist/src/public/channels/twilio/defaults.js +3 -0
  1359. package/dist/src/public/channels/twilio/inbound.d.ts +60 -0
  1360. package/dist/src/public/channels/twilio/inbound.js +2 -0
  1361. package/dist/src/public/channels/twilio/index.d.ts +5 -0
  1362. package/dist/src/public/channels/twilio/index.js +1 -0
  1363. package/dist/src/public/channels/twilio/twilioChannel.d.ts +195 -0
  1364. package/dist/src/public/channels/twilio/twilioChannel.js +1 -0
  1365. package/dist/src/public/channels/twilio/twiml.d.ts +37 -0
  1366. package/dist/src/public/channels/twilio/twiml.js +1 -0
  1367. package/dist/src/public/channels/twilio/verify.d.ts +50 -0
  1368. package/dist/src/public/channels/twilio/verify.js +1 -0
  1369. package/dist/src/public/channels/upload-policy.d.ts +101 -0
  1370. package/dist/src/public/channels/upload-policy.js +1 -0
  1371. package/dist/src/public/connections/errors.d.ts +117 -0
  1372. package/dist/src/public/connections/errors.js +1 -0
  1373. package/dist/src/public/connections/index.d.ts +9 -0
  1374. package/dist/src/public/connections/index.js +1 -0
  1375. package/dist/src/public/context/index.d.ts +14 -0
  1376. package/dist/src/public/context/index.js +1 -0
  1377. package/dist/src/public/definitions/agent.d.ts +24 -0
  1378. package/dist/src/public/definitions/agent.js +1 -0
  1379. package/dist/src/public/definitions/callback-context.d.ts +33 -0
  1380. package/dist/src/public/definitions/callback-context.js +1 -0
  1381. package/dist/src/public/definitions/channel.d.ts +126 -0
  1382. package/dist/src/public/definitions/channel.js +1 -0
  1383. package/dist/src/public/definitions/connections/mcp.d.ts +82 -0
  1384. package/dist/src/public/definitions/connections/mcp.js +1 -0
  1385. package/dist/src/public/definitions/connections/openapi.d.ts +99 -0
  1386. package/dist/src/public/definitions/connections/openapi.js +1 -0
  1387. package/dist/src/public/definitions/connections/protocol.d.ts +12 -0
  1388. package/dist/src/public/definitions/connections/protocol.js +1 -0
  1389. package/dist/src/public/definitions/defineChannel.d.ts +145 -0
  1390. package/dist/src/public/definitions/defineChannel.js +1 -0
  1391. package/dist/src/public/definitions/exact.d.ts +7 -0
  1392. package/dist/src/public/definitions/exact.js +1 -0
  1393. package/dist/src/public/definitions/hook.d.ts +60 -0
  1394. package/dist/src/public/definitions/hook.js +1 -0
  1395. package/dist/src/public/definitions/instructions.d.ts +31 -0
  1396. package/dist/src/public/definitions/instructions.js +1 -0
  1397. package/dist/src/public/definitions/instrumentation.d.ts +1 -0
  1398. package/dist/src/public/definitions/instrumentation.js +1 -0
  1399. package/dist/src/public/definitions/remote-agent.d.ts +49 -0
  1400. package/dist/src/public/definitions/remote-agent.js +1 -0
  1401. package/dist/src/public/definitions/sandbox-backend.d.ts +17 -0
  1402. package/dist/src/public/definitions/sandbox-backend.js +1 -0
  1403. package/dist/src/public/definitions/sandbox.d.ts +24 -0
  1404. package/dist/src/public/definitions/sandbox.js +1 -0
  1405. package/dist/src/public/definitions/schedule.d.ts +96 -0
  1406. package/dist/src/public/definitions/schedule.js +1 -0
  1407. package/dist/src/public/definitions/skill.d.ts +21 -0
  1408. package/dist/src/public/definitions/skill.js +1 -0
  1409. package/dist/src/public/definitions/source.d.ts +8 -0
  1410. package/dist/src/public/definitions/source.js +1 -0
  1411. package/dist/src/public/definitions/state.d.ts +37 -0
  1412. package/dist/src/public/definitions/state.js +1 -0
  1413. package/dist/src/public/definitions/tool.d.ts +285 -0
  1414. package/dist/src/public/definitions/tool.js +1 -0
  1415. package/dist/src/public/hooks/index.d.ts +8 -0
  1416. package/dist/src/public/hooks/index.js +1 -0
  1417. package/dist/src/public/index.d.ts +5 -0
  1418. package/dist/src/public/index.js +1 -0
  1419. package/dist/src/public/instructions/index.d.ts +7 -0
  1420. package/dist/src/public/instructions/index.js +1 -0
  1421. package/dist/src/public/instrumentation/index.d.ts +144 -0
  1422. package/dist/src/public/instrumentation/index.js +1 -0
  1423. package/dist/src/public/next/index.d.ts +86 -0
  1424. package/dist/src/public/next/index.js +1 -0
  1425. package/dist/src/public/next/server.d.ts +6 -0
  1426. package/dist/src/public/next/server.js +1 -0
  1427. package/dist/src/public/next/vercel-output-config.d.ts +9 -0
  1428. package/dist/src/public/next/vercel-output-config.js +1 -0
  1429. package/dist/src/public/nuxt/dev-server.d.ts +24 -0
  1430. package/dist/src/public/nuxt/dev-server.js +1 -0
  1431. package/dist/src/public/nuxt/index.d.ts +1 -0
  1432. package/dist/src/public/nuxt/index.js +1 -0
  1433. package/dist/src/public/nuxt/module.d.ts +43 -0
  1434. package/dist/src/public/nuxt/module.js +1 -0
  1435. package/dist/src/public/nuxt/routing.d.ts +55 -0
  1436. package/dist/src/public/nuxt/routing.js +1 -0
  1437. package/dist/src/public/nuxt/vercel-json.d.ts +17 -0
  1438. package/dist/src/public/nuxt/vercel-json.js +1 -0
  1439. package/dist/src/public/sandbox/backends/default.d.ts +22 -0
  1440. package/dist/src/public/sandbox/backends/default.js +1 -0
  1441. package/dist/src/public/sandbox/backends/local.d.ts +17 -0
  1442. package/dist/src/public/sandbox/backends/local.js +1 -0
  1443. package/dist/src/public/sandbox/backends/vercel.d.ts +24 -0
  1444. package/dist/src/public/sandbox/backends/vercel.js +1 -0
  1445. package/dist/src/public/sandbox/index.d.ts +13 -0
  1446. package/dist/src/public/sandbox/index.js +1 -0
  1447. package/dist/src/public/sandbox/local-sandbox.d.ts +7 -0
  1448. package/dist/src/public/sandbox/local-sandbox.js +1 -0
  1449. package/dist/src/public/sandbox/vercel-sandbox.d.ts +42 -0
  1450. package/dist/src/public/sandbox/vercel-sandbox.js +1 -0
  1451. package/dist/src/public/schedules/index.d.ts +4 -0
  1452. package/dist/src/public/schedules/index.js +1 -0
  1453. package/dist/src/public/skills/index.d.ts +7 -0
  1454. package/dist/src/public/skills/index.js +1 -0
  1455. package/dist/src/public/sveltekit/dev-server.d.ts +24 -0
  1456. package/dist/src/public/sveltekit/dev-server.js +1 -0
  1457. package/dist/src/public/sveltekit/index.d.ts +44 -0
  1458. package/dist/src/public/sveltekit/index.js +1 -0
  1459. package/dist/src/public/sveltekit/routing.d.ts +32 -0
  1460. package/dist/src/public/sveltekit/routing.js +1 -0
  1461. package/dist/src/public/sveltekit/vercel-json.d.ts +17 -0
  1462. package/dist/src/public/sveltekit/vercel-json.js +1 -0
  1463. package/dist/src/public/tool-result-narrowing.d.ts +74 -0
  1464. package/dist/src/public/tool-result-narrowing.js +1 -0
  1465. package/dist/src/public/tools/approval/approval-helpers.d.ts +19 -0
  1466. package/dist/src/public/tools/approval/approval-helpers.js +1 -0
  1467. package/dist/src/public/tools/approval/index.d.ts +5 -0
  1468. package/dist/src/public/tools/approval/index.js +1 -0
  1469. package/dist/src/public/tools/defaults.d.ts +60 -0
  1470. package/dist/src/public/tools/defaults.js +1 -0
  1471. package/dist/src/public/tools/define-bash-tool.d.ts +21 -0
  1472. package/dist/src/public/tools/define-bash-tool.js +1 -0
  1473. package/dist/src/public/tools/define-glob-tool.d.ts +22 -0
  1474. package/dist/src/public/tools/define-glob-tool.js +1 -0
  1475. package/dist/src/public/tools/define-grep-tool.d.ts +22 -0
  1476. package/dist/src/public/tools/define-grep-tool.js +1 -0
  1477. package/dist/src/public/tools/define-read-file-tool.d.ts +27 -0
  1478. package/dist/src/public/tools/define-read-file-tool.js +1 -0
  1479. package/dist/src/public/tools/define-write-file-tool.d.ts +22 -0
  1480. package/dist/src/public/tools/define-write-file-tool.js +1 -0
  1481. package/dist/src/public/tools/index.d.ts +12 -0
  1482. package/dist/src/public/tools/index.js +1 -0
  1483. package/dist/src/public/tools/internal.d.ts +12 -0
  1484. package/dist/src/public/tools/internal.js +1 -0
  1485. package/dist/src/public/types/json.d.ts +28 -0
  1486. package/dist/src/public/types/json.js +1 -0
  1487. package/dist/src/react/index.d.ts +3 -0
  1488. package/dist/src/react/index.js +1 -0
  1489. package/dist/src/react/use-eve-agent.d.ts +76 -0
  1490. package/dist/src/react/use-eve-agent.js +1 -0
  1491. package/dist/src/runtime/actions/keys.d.ts +11 -0
  1492. package/dist/src/runtime/actions/keys.js +1 -0
  1493. package/dist/src/runtime/actions/types.d.ts +150 -0
  1494. package/dist/src/runtime/actions/types.js +1 -0
  1495. package/dist/src/runtime/agent/bootstrap-model-utils.d.ts +37 -0
  1496. package/dist/src/runtime/agent/bootstrap-model-utils.js +1 -0
  1497. package/dist/src/runtime/agent/bootstrap-model.d.ts +7 -0
  1498. package/dist/src/runtime/agent/bootstrap-model.js +1 -0
  1499. package/dist/src/runtime/agent/bootstrap.d.ts +44 -0
  1500. package/dist/src/runtime/agent/bootstrap.js +1 -0
  1501. package/dist/src/runtime/agent/mock-model-adapter.d.ts +21 -0
  1502. package/dist/src/runtime/agent/mock-model-adapter.js +5 -0
  1503. package/dist/src/runtime/agent/mock-model-skill-selection.d.ts +9 -0
  1504. package/dist/src/runtime/agent/mock-model-skill-selection.js +4 -0
  1505. package/dist/src/runtime/agent/mock-structured-output.d.ts +5 -0
  1506. package/dist/src/runtime/agent/mock-structured-output.js +1 -0
  1507. package/dist/src/runtime/agent/resolve-model.d.ts +11 -0
  1508. package/dist/src/runtime/agent/resolve-model.js +1 -0
  1509. package/dist/src/runtime/attributes/emit.d.ts +73 -0
  1510. package/dist/src/runtime/attributes/emit.js +1 -0
  1511. package/dist/src/runtime/cache-key.d.ts +9 -0
  1512. package/dist/src/runtime/cache-key.js +1 -0
  1513. package/dist/src/runtime/channels/registry.d.ts +27 -0
  1514. package/dist/src/runtime/channels/registry.js +1 -0
  1515. package/dist/src/runtime/compiled-artifacts-source.d.ts +44 -0
  1516. package/dist/src/runtime/compiled-artifacts-source.js +1 -0
  1517. package/dist/src/runtime/connections/authorization-complete-page.d.ts +11 -0
  1518. package/dist/src/runtime/connections/authorization-complete-page.js +53 -0
  1519. package/dist/src/runtime/connections/authorization-tokens.d.ts +51 -0
  1520. package/dist/src/runtime/connections/authorization-tokens.js +1 -0
  1521. package/dist/src/runtime/connections/callback-route.d.ts +55 -0
  1522. package/dist/src/runtime/connections/callback-route.js +1 -0
  1523. package/dist/src/runtime/connections/mcp-client.d.ts +74 -0
  1524. package/dist/src/runtime/connections/mcp-client.js +1 -0
  1525. package/dist/src/runtime/connections/openapi-client.d.ts +43 -0
  1526. package/dist/src/runtime/connections/openapi-client.js +1 -0
  1527. package/dist/src/runtime/connections/openapi-operations.d.ts +30 -0
  1528. package/dist/src/runtime/connections/openapi-operations.js +1 -0
  1529. package/dist/src/runtime/connections/openapi-schema.d.ts +39 -0
  1530. package/dist/src/runtime/connections/openapi-schema.js +1 -0
  1531. package/dist/src/runtime/connections/openapi-security.d.ts +41 -0
  1532. package/dist/src/runtime/connections/openapi-security.js +1 -0
  1533. package/dist/src/runtime/connections/openapi-spec.d.ts +20 -0
  1534. package/dist/src/runtime/connections/openapi-spec.js +1 -0
  1535. package/dist/src/runtime/connections/principal.d.ts +66 -0
  1536. package/dist/src/runtime/connections/principal.js +1 -0
  1537. package/dist/src/runtime/connections/registry.d.ts +36 -0
  1538. package/dist/src/runtime/connections/registry.js +1 -0
  1539. package/dist/src/runtime/connections/scoped-authorization.d.ts +61 -0
  1540. package/dist/src/runtime/connections/scoped-authorization.js +1 -0
  1541. package/dist/src/runtime/connections/types.d.ts +349 -0
  1542. package/dist/src/runtime/connections/types.js +1 -0
  1543. package/dist/src/runtime/connections/validate-authorization.d.ts +21 -0
  1544. package/dist/src/runtime/connections/validate-authorization.js +1 -0
  1545. package/dist/src/runtime/framework-channels/index.d.ts +11 -0
  1546. package/dist/src/runtime/framework-channels/index.js +1 -0
  1547. package/dist/src/runtime/framework-tools/ask-question.d.ts +21 -0
  1548. package/dist/src/runtime/framework-tools/ask-question.js +1 -0
  1549. package/dist/src/runtime/framework-tools/bash.d.ts +17 -0
  1550. package/dist/src/runtime/framework-tools/bash.js +1 -0
  1551. package/dist/src/runtime/framework-tools/code-mode-connection-auth.d.ts +29 -0
  1552. package/dist/src/runtime/framework-tools/code-mode-connection-auth.js +1 -0
  1553. package/dist/src/runtime/framework-tools/connection-search-dynamic.d.ts +35 -0
  1554. package/dist/src/runtime/framework-tools/connection-search-dynamic.js +1 -0
  1555. package/dist/src/runtime/framework-tools/file-state.d.ts +62 -0
  1556. package/dist/src/runtime/framework-tools/file-state.js +1 -0
  1557. package/dist/src/runtime/framework-tools/final-output.d.ts +14 -0
  1558. package/dist/src/runtime/framework-tools/final-output.js +1 -0
  1559. package/dist/src/runtime/framework-tools/glob.d.ts +17 -0
  1560. package/dist/src/runtime/framework-tools/glob.js +2 -0
  1561. package/dist/src/runtime/framework-tools/grep.d.ts +17 -0
  1562. package/dist/src/runtime/framework-tools/grep.js +2 -0
  1563. package/dist/src/runtime/framework-tools/index.d.ts +26 -0
  1564. package/dist/src/runtime/framework-tools/index.js +1 -0
  1565. package/dist/src/runtime/framework-tools/read-file.d.ts +17 -0
  1566. package/dist/src/runtime/framework-tools/read-file.js +2 -0
  1567. package/dist/src/runtime/framework-tools/skill.d.ts +4 -0
  1568. package/dist/src/runtime/framework-tools/skill.js +1 -0
  1569. package/dist/src/runtime/framework-tools/todo.d.ts +39 -0
  1570. package/dist/src/runtime/framework-tools/todo.js +3 -0
  1571. package/dist/src/runtime/framework-tools/web-fetch.d.ts +5 -0
  1572. package/dist/src/runtime/framework-tools/web-fetch.js +2 -0
  1573. package/dist/src/runtime/framework-tools/web-search.d.ts +26 -0
  1574. package/dist/src/runtime/framework-tools/web-search.js +1 -0
  1575. package/dist/src/runtime/framework-tools/write-file.d.ts +17 -0
  1576. package/dist/src/runtime/framework-tools/write-file.js +2 -0
  1577. package/dist/src/runtime/governance/auth/http-basic.d.ts +8 -0
  1578. package/dist/src/runtime/governance/auth/http-basic.js +1 -0
  1579. package/dist/src/runtime/governance/auth/jwt-ecdsa.d.ts +8 -0
  1580. package/dist/src/runtime/governance/auth/jwt-ecdsa.js +1 -0
  1581. package/dist/src/runtime/governance/auth/jwt-hmac.d.ts +8 -0
  1582. package/dist/src/runtime/governance/auth/jwt-hmac.js +1 -0
  1583. package/dist/src/runtime/governance/auth/oidc.d.ts +8 -0
  1584. package/dist/src/runtime/governance/auth/oidc.js +1 -0
  1585. package/dist/src/runtime/governance/auth/token-claims.d.ts +17 -0
  1586. package/dist/src/runtime/governance/auth/token-claims.js +1 -0
  1587. package/dist/src/runtime/governance/auth/types.d.ts +104 -0
  1588. package/dist/src/runtime/governance/auth/types.js +1 -0
  1589. package/dist/src/runtime/governance/network/ip-allow-list.d.ts +17 -0
  1590. package/dist/src/runtime/governance/network/ip-allow-list.js +1 -0
  1591. package/dist/src/runtime/graph.d.ts +46 -0
  1592. package/dist/src/runtime/graph.js +1 -0
  1593. package/dist/src/runtime/hooks/registry.d.ts +40 -0
  1594. package/dist/src/runtime/hooks/registry.js +1 -0
  1595. package/dist/src/runtime/input/types.d.ts +78 -0
  1596. package/dist/src/runtime/input/types.js +1 -0
  1597. package/dist/src/runtime/loaders/artifact-paths.d.ts +18 -0
  1598. package/dist/src/runtime/loaders/artifact-paths.js +1 -0
  1599. package/dist/src/runtime/loaders/bundled-artifacts.d.ts +36 -0
  1600. package/dist/src/runtime/loaders/bundled-artifacts.js +1 -0
  1601. package/dist/src/runtime/loaders/compile-metadata.d.ts +14 -0
  1602. package/dist/src/runtime/loaders/compile-metadata.js +1 -0
  1603. package/dist/src/runtime/loaders/manifest.d.ts +21 -0
  1604. package/dist/src/runtime/loaders/manifest.js +1 -0
  1605. package/dist/src/runtime/loaders/module-map.d.ts +21 -0
  1606. package/dist/src/runtime/loaders/module-map.js +1 -0
  1607. package/dist/src/runtime/prompt/compose.d.ts +19 -0
  1608. package/dist/src/runtime/prompt/compose.js +2 -0
  1609. package/dist/src/runtime/prompt/connections.d.ts +9 -0
  1610. package/dist/src/runtime/prompt/connections.js +2 -0
  1611. package/dist/src/runtime/resolve-agent-graph.d.ts +17 -0
  1612. package/dist/src/runtime/resolve-agent-graph.js +1 -0
  1613. package/dist/src/runtime/resolve-agent.d.ts +16 -0
  1614. package/dist/src/runtime/resolve-agent.js +1 -0
  1615. package/dist/src/runtime/resolve-channel.d.ts +17 -0
  1616. package/dist/src/runtime/resolve-channel.js +1 -0
  1617. package/dist/src/runtime/resolve-connection.d.ts +15 -0
  1618. package/dist/src/runtime/resolve-connection.js +1 -0
  1619. package/dist/src/runtime/resolve-dynamic-instructions.d.ts +4 -0
  1620. package/dist/src/runtime/resolve-dynamic-instructions.js +1 -0
  1621. package/dist/src/runtime/resolve-dynamic-skill.d.ts +8 -0
  1622. package/dist/src/runtime/resolve-dynamic-skill.js +1 -0
  1623. package/dist/src/runtime/resolve-dynamic-tool.d.ts +12 -0
  1624. package/dist/src/runtime/resolve-dynamic-tool.js +1 -0
  1625. package/dist/src/runtime/resolve-helpers.d.ts +43 -0
  1626. package/dist/src/runtime/resolve-helpers.js +1 -0
  1627. package/dist/src/runtime/resolve-hook.d.ts +13 -0
  1628. package/dist/src/runtime/resolve-hook.js +1 -0
  1629. package/dist/src/runtime/resolve-sandbox.d.ts +13 -0
  1630. package/dist/src/runtime/resolve-sandbox.js +1 -0
  1631. package/dist/src/runtime/resolve-tool.d.ts +14 -0
  1632. package/dist/src/runtime/resolve-tool.js +1 -0
  1633. package/dist/src/runtime/sandbox/keys.d.ts +38 -0
  1634. package/dist/src/runtime/sandbox/keys.js +1 -0
  1635. package/dist/src/runtime/sandbox/registry.d.ts +61 -0
  1636. package/dist/src/runtime/sandbox/registry.js +1 -0
  1637. package/dist/src/runtime/sandbox/template-plan.d.ts +26 -0
  1638. package/dist/src/runtime/sandbox/template-plan.js +1 -0
  1639. package/dist/src/runtime/schedules/register.d.ts +35 -0
  1640. package/dist/src/runtime/schedules/register.js +1 -0
  1641. package/dist/src/runtime/schedules/resolve-schedule.d.ts +31 -0
  1642. package/dist/src/runtime/schedules/resolve-schedule.js +1 -0
  1643. package/dist/src/runtime/session-callback-route.d.ts +6 -0
  1644. package/dist/src/runtime/session-callback-route.js +1 -0
  1645. package/dist/src/runtime/sessions/auth.d.ts +39 -0
  1646. package/dist/src/runtime/sessions/auth.js +1 -0
  1647. package/dist/src/runtime/sessions/compiled-agent-cache.d.ts +47 -0
  1648. package/dist/src/runtime/sessions/compiled-agent-cache.js +1 -0
  1649. package/dist/src/runtime/sessions/runtime-context-keys.d.ts +11 -0
  1650. package/dist/src/runtime/sessions/runtime-context-keys.js +1 -0
  1651. package/dist/src/runtime/sessions/runtime-session.d.ts +52 -0
  1652. package/dist/src/runtime/sessions/runtime-session.js +1 -0
  1653. package/dist/src/runtime/sessions/turn.d.ts +33 -0
  1654. package/dist/src/runtime/sessions/turn.js +1 -0
  1655. package/dist/src/runtime/skills/fragment-context.d.ts +4 -0
  1656. package/dist/src/runtime/skills/fragment-context.js +1 -0
  1657. package/dist/src/runtime/skills/sandbox-access.d.ts +21 -0
  1658. package/dist/src/runtime/skills/sandbox-access.js +1 -0
  1659. package/dist/src/runtime/subagents/registry.d.ts +32 -0
  1660. package/dist/src/runtime/subagents/registry.js +1 -0
  1661. package/dist/src/runtime/tools/registry.d.ts +30 -0
  1662. package/dist/src/runtime/tools/registry.js +1 -0
  1663. package/dist/src/runtime/types.d.ts +368 -0
  1664. package/dist/src/runtime/types.js +1 -0
  1665. package/dist/src/runtime/validation.d.ts +5 -0
  1666. package/dist/src/runtime/validation.js +1 -0
  1667. package/dist/src/runtime/workspace/seed-files.d.ts +15 -0
  1668. package/dist/src/runtime/workspace/seed-files.js +1 -0
  1669. package/dist/src/runtime/workspace/spec.d.ts +6 -0
  1670. package/dist/src/runtime/workspace/spec.js +2 -0
  1671. package/dist/src/runtime/workspace/types.d.ts +18 -0
  1672. package/dist/src/runtime/workspace/types.js +1 -0
  1673. package/dist/src/sandbox/state.d.ts +33 -0
  1674. package/dist/src/sandbox/state.js +1 -0
  1675. package/dist/src/services/dev-client/request-headers.d.ts +74 -0
  1676. package/dist/src/services/dev-client/request-headers.js +1 -0
  1677. package/dist/src/services/dev-client/stream.d.ts +5 -0
  1678. package/dist/src/services/dev-client/stream.js +1 -0
  1679. package/dist/src/services/dev-client/url.d.ts +11 -0
  1680. package/dist/src/services/dev-client/url.js +1 -0
  1681. package/dist/src/services/dev-client/vercel-auth-error.d.ts +42 -0
  1682. package/dist/src/services/dev-client/vercel-auth-error.js +2 -0
  1683. package/dist/src/services/dev-client.d.ts +75 -0
  1684. package/dist/src/services/dev-client.js +1 -0
  1685. package/dist/src/services/inspect-application.d.ts +23 -0
  1686. package/dist/src/services/inspect-application.js +1 -0
  1687. package/dist/src/shared/agent-definition.d.ts +154 -0
  1688. package/dist/src/shared/agent-definition.js +1 -0
  1689. package/dist/src/shared/code-mode.d.ts +29 -0
  1690. package/dist/src/shared/code-mode.js +1 -0
  1691. package/dist/src/shared/dynamic-tool-definition.d.ts +159 -0
  1692. package/dist/src/shared/dynamic-tool-definition.js +1 -0
  1693. package/dist/src/shared/errors.d.ts +17 -0
  1694. package/dist/src/shared/errors.js +1 -0
  1695. package/dist/src/shared/guards.d.ts +45 -0
  1696. package/dist/src/shared/guards.js +1 -0
  1697. package/dist/src/shared/json-schema.d.ts +9 -0
  1698. package/dist/src/shared/json-schema.js +1 -0
  1699. package/dist/src/shared/json-schemas.d.ts +10 -0
  1700. package/dist/src/shared/json-schemas.js +1 -0
  1701. package/dist/src/shared/json.d.ts +34 -0
  1702. package/dist/src/shared/json.js +1 -0
  1703. package/dist/src/shared/network-address.d.ts +11 -0
  1704. package/dist/src/shared/network-address.js +1 -0
  1705. package/dist/src/shared/node.d.ts +6 -0
  1706. package/dist/src/shared/node.js +1 -0
  1707. package/dist/src/shared/optional.d.ts +3 -0
  1708. package/dist/src/shared/optional.js +1 -0
  1709. package/dist/src/shared/run-mode.d.ts +7 -0
  1710. package/dist/src/shared/run-mode.js +1 -0
  1711. package/dist/src/shared/sandbox-backend.d.ts +149 -0
  1712. package/dist/src/shared/sandbox-backend.js +1 -0
  1713. package/dist/src/shared/sandbox-definition.d.ts +110 -0
  1714. package/dist/src/shared/sandbox-definition.js +1 -0
  1715. package/dist/src/shared/sandbox-network-policy.d.ts +23 -0
  1716. package/dist/src/shared/sandbox-network-policy.js +1 -0
  1717. package/dist/src/shared/sandbox-session.d.ts +144 -0
  1718. package/dist/src/shared/sandbox-session.js +1 -0
  1719. package/dist/src/shared/skill-definition.d.ts +24 -0
  1720. package/dist/src/shared/skill-definition.js +1 -0
  1721. package/dist/src/shared/skill-package.d.ts +50 -0
  1722. package/dist/src/shared/skill-package.js +1 -0
  1723. package/dist/src/shared/source-ref.d.ts +53 -0
  1724. package/dist/src/shared/source-ref.js +1 -0
  1725. package/dist/src/shared/tool-definition.d.ts +58 -0
  1726. package/dist/src/shared/tool-definition.js +1 -0
  1727. package/dist/src/shared/vercel-output-directory.d.ts +2 -0
  1728. package/dist/src/shared/vercel-output-directory.js +1 -0
  1729. package/dist/src/svelte/index.d.ts +3 -0
  1730. package/dist/src/svelte/index.js +3 -0
  1731. package/dist/src/svelte/use-eve-agent.d.ts +105 -0
  1732. package/dist/src/svelte/use-eve-agent.js +3 -0
  1733. package/dist/src/vue/index.d.ts +3 -0
  1734. package/dist/src/vue/index.js +3 -0
  1735. package/dist/src/vue/use-eve-agent.d.ts +103 -0
  1736. package/dist/src/vue/use-eve-agent.js +3 -0
  1737. package/package.json +336 -71
  1738. package/.npmignore +0 -2
  1739. package/component.json +0 -13
  1740. package/dr.json +0 -10
  1741. package/e.html +0 -66
  1742. package/eve.js +0 -435
  1743. package/template.dot +0 -13
@@ -0,0 +1,4691 @@
1
+ const WEB_APP_TEMPLATE_FILES={"agent/channels/eve.ts":`import { eveChannel } from "eve/channels/eve";
2
+ import { localDev, placeholderAuth, vercelOidc } from "eve/channels/auth";
3
+
4
+ export default eveChannel({
5
+ auth: [
6
+ // Open on localhost for \`eve dev\` and the REPL; ignored in production.
7
+ localDev(),
8
+ // Lets the Eve TUI and your Vercel deployments reach the deployed agent.
9
+ vercelOidc(),
10
+ // This placeholder will not allow browser requests in production.
11
+ // Replace it with your app's auth provider, like Auth.js or Clerk,
12
+ // or use none() for a public demo.
13
+ placeholderAuth(),
14
+ ],
15
+ });
16
+ `,"app/_components/agent-chat.tsx":`"use client";
17
+
18
+ import { useEveAgent } from "eve/react";
19
+ import { AlertCircleIcon } from "lucide-react";
20
+ import {
21
+ Conversation,
22
+ ConversationContent,
23
+ ConversationScrollButton,
24
+ } from "@/components/ai-elements/conversation";
25
+ import {
26
+ PromptInput,
27
+ type PromptInputMessage,
28
+ PromptInputSubmit,
29
+ PromptInputTextarea,
30
+ } from "@/components/ai-elements/prompt-input";
31
+ import { cn } from "@/lib/utils";
32
+ import { AgentMessage } from "./agent-message";
33
+
34
+ const AGENT_NAME = "__EVE_INIT_APP_NAME__";
35
+
36
+ type AgentStatus = ReturnType<typeof useEveAgent>["status"];
37
+
38
+ export function AgentChat() {
39
+ const agent = useEveAgent();
40
+ const isBusy = agent.status === "submitted" || agent.status === "streaming";
41
+ const isEmpty = agent.data.messages.length === 0;
42
+
43
+ const handleSubmit = async (message: PromptInputMessage) => {
44
+ const text = message.text.trim();
45
+ if (!text || isBusy) return;
46
+
47
+ await agent.send({ message: text });
48
+ };
49
+
50
+ const composer = (
51
+ <PromptInput onSubmit={handleSubmit}>
52
+ <PromptInputTextarea placeholder="Send a message…" />
53
+ <PromptInputSubmit onStop={agent.stop} status={agent.status} />
54
+ </PromptInput>
55
+ );
56
+
57
+ return (
58
+ <main className="flex h-dvh flex-col overflow-hidden bg-background text-foreground">
59
+ {isEmpty ? null : (
60
+ <header className="flex h-14 shrink-0 items-center justify-center gap-2 pl-4 pr-2">
61
+ <span className="text-muted-foreground text-sm">{AGENT_NAME}</span>
62
+ <StatusDot status={agent.status} />
63
+ </header>
64
+ )}
65
+
66
+ {agent.error ? (
67
+ <div className="mx-auto w-full max-w-3xl shrink-0 px-4 pt-2 sm:px-6">
68
+ <div className="flex items-start gap-3 rounded-lg border border-destructive/30 bg-destructive/5 px-3 py-2.5 text-sm">
69
+ <AlertCircleIcon className="mt-0.5 size-4 shrink-0 text-destructive" />
70
+ <div>
71
+ <p className="font-medium">Request failed</p>
72
+ <p className="mt-0.5 text-muted-foreground">{agent.error.message}</p>
73
+ </div>
74
+ </div>
75
+ </div>
76
+ ) : null}
77
+
78
+ {isEmpty ? null : (
79
+ <Conversation className="min-h-0 flex-1">
80
+ <ConversationContent className="mx-auto w-full max-w-3xl gap-6 px-4 py-6 sm:px-6">
81
+ {agent.data.messages.map((message, index) => (
82
+ <AgentMessage
83
+ canRespond={!isBusy}
84
+ isStreaming={
85
+ agent.status === "streaming" && index === agent.data.messages.length - 1
86
+ }
87
+ key={message.id}
88
+ message={message}
89
+ onInputResponses={(inputResponses) => agent.send({ inputResponses })}
90
+ />
91
+ ))}
92
+ </ConversationContent>
93
+ <ConversationScrollButton />
94
+ </Conversation>
95
+ )}
96
+
97
+ <div
98
+ className={cn(
99
+ "mx-auto w-full px-4 sm:px-6",
100
+ isEmpty
101
+ ? "flex max-w-xl flex-1 flex-col items-center justify-center gap-8 pb-[10vh]"
102
+ : "max-w-3xl shrink-0 pb-6",
103
+ )}
104
+ >
105
+ {isEmpty ? <h1 className="font-medium text-5xl tracking-tighter">{AGENT_NAME}</h1> : null}
106
+ <div className="w-full">{composer}</div>
107
+ </div>
108
+ </main>
109
+ );
110
+ }
111
+
112
+ function StatusDot({ status }: { readonly status: AgentStatus }) {
113
+ const isLive = status === "submitted" || status === "streaming";
114
+ const tone =
115
+ status === "error"
116
+ ? "bg-destructive"
117
+ : isLive
118
+ ? "bg-emerald-500"
119
+ : status === "ready"
120
+ ? "bg-muted-foreground"
121
+ : "bg-muted-foreground/50";
122
+
123
+ return (
124
+ <span className="relative flex size-1">
125
+ {isLive ? (
126
+ <span
127
+ className={cn(
128
+ "absolute inline-flex size-full animate-ping rounded-full opacity-75",
129
+ tone,
130
+ )}
131
+ />
132
+ ) : null}
133
+ <span className={cn("relative inline-flex size-1 rounded-full transition-colors", tone)} />
134
+ </span>
135
+ );
136
+ }
137
+ `,"app/_components/agent-message.tsx":`"use client";
138
+
139
+ import type { EveDynamicToolPart, EveMessage, EveMessagePart } from "eve/react";
140
+ import { Message, MessageContent, MessageResponse } from "@/components/ai-elements/message";
141
+ import { Reasoning, ReasoningContent, ReasoningTrigger } from "@/components/ai-elements/reasoning";
142
+ import {
143
+ Tool,
144
+ ToolContent,
145
+ ToolHeader,
146
+ ToolInput,
147
+ ToolOutput,
148
+ } from "@/components/ai-elements/tool";
149
+ import { Button } from "@/components/ui/button";
150
+
151
+ export type AgentInputResponse = {
152
+ readonly optionId?: string;
153
+ readonly requestId: string;
154
+ readonly text?: string;
155
+ };
156
+
157
+ export function AgentMessage({
158
+ canRespond,
159
+ isStreaming,
160
+ message,
161
+ onInputResponses,
162
+ }: {
163
+ readonly canRespond: boolean;
164
+ readonly isStreaming: boolean;
165
+ readonly message: EveMessage;
166
+ readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise<void>;
167
+ }) {
168
+ const lastTextIndex = message.parts.reduce(
169
+ (last, part, index) => (part.type === "text" ? index : last),
170
+ -1,
171
+ );
172
+
173
+ return (
174
+ <Message
175
+ data-optimistic={message.metadata?.optimistic ? "true" : undefined}
176
+ from={message.role}
177
+ >
178
+ <MessageContent>
179
+ {message.parts.map((part, index) => (
180
+ <AgentMessagePart
181
+ canRespond={canRespond}
182
+ key={partKey(part, index)}
183
+ onInputResponses={onInputResponses}
184
+ part={part}
185
+ showCaret={isStreaming && message.role === "assistant" && index === lastTextIndex}
186
+ />
187
+ ))}
188
+ </MessageContent>
189
+ </Message>
190
+ );
191
+ }
192
+
193
+ function AgentMessagePart({
194
+ canRespond,
195
+ onInputResponses,
196
+ part,
197
+ showCaret,
198
+ }: {
199
+ readonly canRespond: boolean;
200
+ readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise<void>;
201
+ readonly part: EveMessagePart;
202
+ readonly showCaret: boolean;
203
+ }) {
204
+ switch (part.type) {
205
+ case "step-start":
206
+ return null;
207
+ case "text":
208
+ return (
209
+ <MessageResponse caret="block" isAnimating={showCaret}>
210
+ {part.text}
211
+ </MessageResponse>
212
+ );
213
+ case "reasoning":
214
+ return (
215
+ <Reasoning defaultOpen isStreaming={part.state === "streaming"}>
216
+ <ReasoningTrigger />
217
+ <ReasoningContent>{part.text}</ReasoningContent>
218
+ </Reasoning>
219
+ );
220
+ case "dynamic-tool":
221
+ return (
222
+ <Tool
223
+ defaultOpen={part.state === "approval-requested" || part.state === "approval-responded"}
224
+ >
225
+ <ToolHeader
226
+ state={part.state}
227
+ title={part.toolName}
228
+ toolName={part.toolName}
229
+ type="dynamic-tool"
230
+ />
231
+ <ToolContent>
232
+ <ToolInput input={part.input} />
233
+ <InputRequestActions
234
+ canRespond={canRespond}
235
+ part={part}
236
+ onInputResponses={onInputResponses}
237
+ />
238
+ <ToolOutput errorText={part.errorText} output={part.output} />
239
+ </ToolContent>
240
+ </Tool>
241
+ );
242
+ }
243
+ }
244
+
245
+ function InputRequestActions({
246
+ canRespond,
247
+ onInputResponses,
248
+ part,
249
+ }: {
250
+ readonly canRespond: boolean;
251
+ readonly onInputResponses: (responses: readonly AgentInputResponse[]) => void | Promise<void>;
252
+ readonly part: EveDynamicToolPart;
253
+ }) {
254
+ const inputRequest = part.toolMetadata?.eve?.inputRequest;
255
+ if (!inputRequest) {
256
+ return null;
257
+ }
258
+
259
+ const inputResponse = part.toolMetadata?.eve?.inputResponse;
260
+ const selectedOption = inputRequest.options?.find(
261
+ (option) => option.id === inputResponse?.optionId,
262
+ );
263
+
264
+ return (
265
+ <div className="space-y-3 rounded-md border border-yellow-500/30 bg-yellow-500/5 p-3">
266
+ <p className="text-muted-foreground text-sm">{inputRequest.prompt}</p>
267
+ {inputResponse ? (
268
+ <p className="font-medium text-sm">
269
+ Responded: {selectedOption?.label ?? inputResponse.text ?? inputResponse.optionId}
270
+ </p>
271
+ ) : (
272
+ <div className="flex flex-wrap gap-2">
273
+ {inputRequest.options?.map((option) => (
274
+ <Button
275
+ disabled={!canRespond}
276
+ key={option.id}
277
+ onClick={() => {
278
+ void onInputResponses([
279
+ {
280
+ optionId: option.id,
281
+ requestId: inputRequest.requestId,
282
+ },
283
+ ]);
284
+ }}
285
+ size="sm"
286
+ type="button"
287
+ variant={option.style === "danger" ? "destructive" : "default"}
288
+ >
289
+ {option.label}
290
+ </Button>
291
+ ))}
292
+ </div>
293
+ )}
294
+ </div>
295
+ );
296
+ }
297
+
298
+ function partKey(part: EveMessagePart, index: number): string {
299
+ switch (part.type) {
300
+ case "dynamic-tool":
301
+ return part.toolCallId;
302
+ default:
303
+ return \`\${part.type}:\${index}\`;
304
+ }
305
+ }
306
+ `,"app/globals.css":`@import "tailwindcss";
307
+ @source "../node_modules/streamdown/dist/*.js";
308
+
309
+ @theme inline {
310
+ --color-background: var(--background);
311
+ --color-foreground: var(--foreground);
312
+ --color-card: var(--card);
313
+ --color-card-foreground: var(--card-foreground);
314
+ --color-popover: var(--popover);
315
+ --color-popover-foreground: var(--popover-foreground);
316
+ --color-primary: var(--primary);
317
+ --color-primary-foreground: var(--primary-foreground);
318
+ --color-secondary: var(--secondary);
319
+ --color-secondary-foreground: var(--secondary-foreground);
320
+ --color-muted: var(--muted);
321
+ --color-muted-foreground: var(--muted-foreground);
322
+ --color-accent: var(--accent);
323
+ --color-accent-foreground: var(--accent-foreground);
324
+ --color-destructive: var(--destructive);
325
+ --color-border: var(--border);
326
+ --color-input: var(--input);
327
+ --color-ring: var(--ring);
328
+ --radius-sm: calc(var(--radius) - 4px);
329
+ --radius-md: calc(var(--radius) - 2px);
330
+ --radius-lg: var(--radius);
331
+ --radius-xl: calc(var(--radius) + 4px);
332
+ --font-sans: "Geist", "Geist Fallback", ui-sans-serif, system-ui, sans-serif;
333
+ --font-mono: "Geist Mono", "Geist Mono Fallback", ui-monospace, monospace;
334
+ }
335
+
336
+ :root {
337
+ color-scheme: light;
338
+ /* Soft neutral page with white elevated surfaces so cards/composer pop. */
339
+ --background: oklch(0.971 0 0);
340
+ --foreground: oklch(0.16 0 0);
341
+ --card: oklch(1 0 0);
342
+ --card-foreground: oklch(0.16 0 0);
343
+ --popover: oklch(1 0 0);
344
+ --popover-foreground: oklch(0.16 0 0);
345
+ --primary: oklch(0.19 0 0);
346
+ --primary-foreground: oklch(0.985 0 0);
347
+ --secondary: oklch(0.94 0 0);
348
+ --secondary-foreground: oklch(0.19 0 0);
349
+ --muted: oklch(0.94 0 0);
350
+ --muted-foreground: oklch(0.6 0 0);
351
+ --accent: oklch(0.94 0 0);
352
+ --accent-foreground: oklch(0.19 0 0);
353
+ --destructive: oklch(0.577 0.245 27.325);
354
+ --border: oklch(0.916 0 0);
355
+ --input: oklch(0.916 0 0);
356
+ --ring: oklch(0.708 0 0);
357
+ --radius: 0.625rem;
358
+ }
359
+
360
+ @media (prefers-color-scheme: dark) {
361
+ :root {
362
+ color-scheme: dark;
363
+ --background: oklch(0.145 0 0);
364
+ --foreground: oklch(0.985 0 0);
365
+ --card: oklch(0.205 0 0);
366
+ --card-foreground: oklch(0.985 0 0);
367
+ --popover: oklch(0.205 0 0);
368
+ --popover-foreground: oklch(0.985 0 0);
369
+ --primary: oklch(0.922 0 0);
370
+ --primary-foreground: oklch(0.205 0 0);
371
+ --secondary: oklch(0.269 0 0);
372
+ --secondary-foreground: oklch(0.985 0 0);
373
+ --muted: oklch(0.269 0 0);
374
+ --muted-foreground: oklch(0.708 0 0);
375
+ --accent: oklch(0.269 0 0);
376
+ --accent-foreground: oklch(0.985 0 0);
377
+ --destructive: oklch(0.704 0.191 22.216);
378
+ --border: oklch(1 0 0 / 10%);
379
+ --input: oklch(1 0 0 / 15%);
380
+ --ring: oklch(0.556 0 0);
381
+ }
382
+ }
383
+
384
+ * {
385
+ border-color: var(--border);
386
+ }
387
+
388
+ html {
389
+ height: 100%;
390
+ }
391
+
392
+ body {
393
+ min-height: 100%;
394
+ margin: 0;
395
+ background: var(--background);
396
+ font-family: var(--font-sans);
397
+ }
398
+
399
+ button,
400
+ input,
401
+ textarea {
402
+ font: inherit;
403
+ }
404
+ `,"app/layout.tsx":`import type { Metadata } from "next";
405
+ import { Geist, Geist_Mono } from "next/font/google";
406
+ import type { ReactNode } from "react";
407
+ import { TooltipProvider } from "@/components/ui/tooltip";
408
+ import { cn } from "@/lib/utils";
409
+ import "./globals.css";
410
+
411
+ const sans = Geist({
412
+ variable: "--font-sans",
413
+ subsets: ["latin"],
414
+ weight: "variable",
415
+ display: "swap",
416
+ });
417
+
418
+ const mono = Geist_Mono({
419
+ variable: "--font-mono",
420
+ subsets: ["latin"],
421
+ weight: "variable",
422
+ display: "swap",
423
+ });
424
+
425
+ export const metadata: Metadata = {
426
+ title: "__EVE_INIT_APP_NAME__",
427
+ description: "A Next.js starter for Eve agents with AI Elements.",
428
+ };
429
+
430
+ export default function RootLayout({ children }: { readonly children: ReactNode }) {
431
+ return (
432
+ <html className={cn(sans.variable, mono.variable)} lang="en">
433
+ <body>
434
+ <TooltipProvider>{children}</TooltipProvider>
435
+ </body>
436
+ </html>
437
+ );
438
+ }
439
+ `,"app/page.tsx":`import { AgentChat } from "@/app/_components/agent-chat";
440
+
441
+ export default function Page() {
442
+ return <AgentChat />;
443
+ }
444
+ `,"components/ai-elements/chain-of-thought.tsx":`"use client";
445
+
446
+ import { useControllableState } from "@radix-ui/react-use-controllable-state";
447
+ import { Badge } from "@/components/ui/badge";
448
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
449
+ import { cn } from "@/lib/utils";
450
+ import type { LucideIcon } from "lucide-react";
451
+ import { BrainIcon, ChevronDownIcon, DotIcon } from "lucide-react";
452
+ import type { ComponentProps, ReactNode } from "react";
453
+ import { createContext, memo, useContext, useMemo } from "react";
454
+
455
+ interface ChainOfThoughtContextValue {
456
+ isOpen: boolean;
457
+ setIsOpen: (open: boolean) => void;
458
+ }
459
+
460
+ const ChainOfThoughtContext = createContext<ChainOfThoughtContextValue | null>(null);
461
+
462
+ const useChainOfThought = () => {
463
+ const context = useContext(ChainOfThoughtContext);
464
+ if (!context) {
465
+ throw new Error("ChainOfThought components must be used within ChainOfThought");
466
+ }
467
+ return context;
468
+ };
469
+
470
+ export type ChainOfThoughtProps = ComponentProps<"div"> & {
471
+ open?: boolean;
472
+ defaultOpen?: boolean;
473
+ onOpenChange?: (open: boolean) => void;
474
+ };
475
+
476
+ export const ChainOfThought = memo(
477
+ ({
478
+ className,
479
+ open,
480
+ defaultOpen = false,
481
+ onOpenChange,
482
+ children,
483
+ ...props
484
+ }: ChainOfThoughtProps) => {
485
+ const [isOpen, setIsOpen] = useControllableState({
486
+ defaultProp: defaultOpen,
487
+ onChange: onOpenChange,
488
+ prop: open,
489
+ });
490
+
491
+ const chainOfThoughtContext = useMemo(() => ({ isOpen, setIsOpen }), [isOpen, setIsOpen]);
492
+
493
+ return (
494
+ <ChainOfThoughtContext.Provider value={chainOfThoughtContext}>
495
+ <div className={cn("not-prose w-full space-y-4", className)} {...props}>
496
+ {children}
497
+ </div>
498
+ </ChainOfThoughtContext.Provider>
499
+ );
500
+ },
501
+ );
502
+
503
+ export type ChainOfThoughtHeaderProps = ComponentProps<typeof CollapsibleTrigger>;
504
+
505
+ export const ChainOfThoughtHeader = memo(
506
+ ({ className, children, ...props }: ChainOfThoughtHeaderProps) => {
507
+ const { isOpen, setIsOpen } = useChainOfThought();
508
+
509
+ return (
510
+ <Collapsible onOpenChange={setIsOpen} open={isOpen}>
511
+ <CollapsibleTrigger
512
+ className={cn(
513
+ "flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
514
+ className,
515
+ )}
516
+ {...props}
517
+ >
518
+ <BrainIcon className="size-4" />
519
+ <span className="flex-1 text-left">{children ?? "Chain of Thought"}</span>
520
+ <ChevronDownIcon
521
+ className={cn("size-4 transition-transform", isOpen ? "rotate-180" : "rotate-0")}
522
+ />
523
+ </CollapsibleTrigger>
524
+ </Collapsible>
525
+ );
526
+ },
527
+ );
528
+
529
+ export type ChainOfThoughtStepProps = ComponentProps<"div"> & {
530
+ icon?: LucideIcon;
531
+ label: ReactNode;
532
+ description?: ReactNode;
533
+ status?: "complete" | "active" | "pending";
534
+ };
535
+
536
+ const stepStatusStyles = {
537
+ active: "text-foreground",
538
+ complete: "text-muted-foreground",
539
+ pending: "text-muted-foreground/50",
540
+ };
541
+
542
+ export const ChainOfThoughtStep = memo(
543
+ ({
544
+ className,
545
+ icon: Icon = DotIcon,
546
+ label,
547
+ description,
548
+ status = "complete",
549
+ children,
550
+ ...props
551
+ }: ChainOfThoughtStepProps) => (
552
+ <div
553
+ className={cn(
554
+ "flex gap-2 text-sm",
555
+ stepStatusStyles[status],
556
+ "fade-in-0 slide-in-from-top-2 animate-in",
557
+ className,
558
+ )}
559
+ {...props}
560
+ >
561
+ <div className="relative mt-0.5">
562
+ <Icon className="size-4" />
563
+ <div className="absolute top-7 bottom-0 left-1/2 -mx-px w-px bg-border" />
564
+ </div>
565
+ <div className="flex-1 space-y-2 overflow-hidden">
566
+ <div>{label}</div>
567
+ {description && <div className="text-muted-foreground text-xs">{description}</div>}
568
+ {children}
569
+ </div>
570
+ </div>
571
+ ),
572
+ );
573
+
574
+ export type ChainOfThoughtSearchResultsProps = ComponentProps<"div">;
575
+
576
+ export const ChainOfThoughtSearchResults = memo(
577
+ ({ className, ...props }: ChainOfThoughtSearchResultsProps) => (
578
+ <div className={cn("flex flex-wrap items-center gap-2", className)} {...props} />
579
+ ),
580
+ );
581
+
582
+ export type ChainOfThoughtSearchResultProps = ComponentProps<typeof Badge>;
583
+
584
+ export const ChainOfThoughtSearchResult = memo(
585
+ ({ className, children, ...props }: ChainOfThoughtSearchResultProps) => (
586
+ <Badge
587
+ className={cn("gap-1 px-2 py-0.5 font-normal text-xs", className)}
588
+ variant="secondary"
589
+ {...props}
590
+ >
591
+ {children}
592
+ </Badge>
593
+ ),
594
+ );
595
+
596
+ export type ChainOfThoughtContentProps = ComponentProps<typeof CollapsibleContent>;
597
+
598
+ export const ChainOfThoughtContent = memo(
599
+ ({ className, children, ...props }: ChainOfThoughtContentProps) => {
600
+ const { isOpen } = useChainOfThought();
601
+
602
+ return (
603
+ <Collapsible open={isOpen}>
604
+ <CollapsibleContent
605
+ className={cn(
606
+ "mt-2 space-y-3",
607
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
608
+ className,
609
+ )}
610
+ {...props}
611
+ >
612
+ {children}
613
+ </CollapsibleContent>
614
+ </Collapsible>
615
+ );
616
+ },
617
+ );
618
+
619
+ export type ChainOfThoughtImageProps = ComponentProps<"div"> & {
620
+ caption?: string;
621
+ };
622
+
623
+ export const ChainOfThoughtImage = memo(
624
+ ({ className, children, caption, ...props }: ChainOfThoughtImageProps) => (
625
+ <div className={cn("mt-2 space-y-2", className)} {...props}>
626
+ <div className="relative flex max-h-[22rem] items-center justify-center overflow-hidden rounded-lg bg-muted p-3">
627
+ {children}
628
+ </div>
629
+ {caption && <p className="text-muted-foreground text-xs">{caption}</p>}
630
+ </div>
631
+ ),
632
+ );
633
+
634
+ ChainOfThought.displayName = "ChainOfThought";
635
+ ChainOfThoughtHeader.displayName = "ChainOfThoughtHeader";
636
+ ChainOfThoughtStep.displayName = "ChainOfThoughtStep";
637
+ ChainOfThoughtSearchResults.displayName = "ChainOfThoughtSearchResults";
638
+ ChainOfThoughtSearchResult.displayName = "ChainOfThoughtSearchResult";
639
+ ChainOfThoughtContent.displayName = "ChainOfThoughtContent";
640
+ ChainOfThoughtImage.displayName = "ChainOfThoughtImage";
641
+ `,"components/ai-elements/code-block.tsx":`"use client";
642
+
643
+ import { Button } from "@/components/ui/button";
644
+ import {
645
+ Select,
646
+ SelectContent,
647
+ SelectItem,
648
+ SelectTrigger,
649
+ SelectValue,
650
+ } from "@/components/ui/select";
651
+ import { cn } from "@/lib/utils";
652
+ import { CheckIcon, CopyIcon } from "lucide-react";
653
+ import type { ComponentProps, CSSProperties, HTMLAttributes } from "react";
654
+ import {
655
+ createContext,
656
+ memo,
657
+ useCallback,
658
+ useContext,
659
+ useEffect,
660
+ useMemo,
661
+ useRef,
662
+ useState,
663
+ } from "react";
664
+ import type { BundledLanguage, BundledTheme, HighlighterGeneric, ThemedToken } from "shiki";
665
+ import { createHighlighter } from "shiki";
666
+
667
+ // Shiki uses bitflags for font styles: 1=italic, 2=bold, 4=underline
668
+ // oxlint-disable-next-line eslint(no-bitwise)
669
+ const isItalic = (fontStyle: number | undefined) => fontStyle && fontStyle & 1;
670
+ // oxlint-disable-next-line eslint(no-bitwise)
671
+ const isBold = (fontStyle: number | undefined) => fontStyle && fontStyle & 2;
672
+ const isUnderline = (fontStyle: number | undefined) =>
673
+ // oxlint-disable-next-line eslint(no-bitwise)
674
+ fontStyle && fontStyle & 4;
675
+
676
+ // Transform tokens to include pre-computed keys to avoid noArrayIndexKey lint
677
+ interface KeyedToken {
678
+ token: ThemedToken;
679
+ key: string;
680
+ }
681
+ interface KeyedLine {
682
+ tokens: KeyedToken[];
683
+ key: string;
684
+ }
685
+
686
+ const addKeysToTokens = (lines: ThemedToken[][]): KeyedLine[] =>
687
+ lines.map((line, lineIdx) => ({
688
+ key: \`line-\${lineIdx}\`,
689
+ tokens: line.map((token, tokenIdx) => ({
690
+ key: \`line-\${lineIdx}-\${tokenIdx}\`,
691
+ token,
692
+ })),
693
+ }));
694
+
695
+ // Token rendering component
696
+ const TokenSpan = ({ token }: { token: ThemedToken }) => (
697
+ <span
698
+ className="dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]"
699
+ style={
700
+ {
701
+ backgroundColor: token.bgColor,
702
+ color: token.color,
703
+ fontStyle: isItalic(token.fontStyle) ? "italic" : undefined,
704
+ fontWeight: isBold(token.fontStyle) ? "bold" : undefined,
705
+ textDecoration: isUnderline(token.fontStyle) ? "underline" : undefined,
706
+ ...token.htmlStyle,
707
+ } as CSSProperties
708
+ }
709
+ >
710
+ {token.content}
711
+ </span>
712
+ );
713
+
714
+ // Line number styles using CSS counters
715
+ const LINE_NUMBER_CLASSES = cn(
716
+ "block",
717
+ "before:content-[counter(line)]",
718
+ "before:inline-block",
719
+ "before:[counter-increment:line]",
720
+ "before:w-8",
721
+ "before:mr-4",
722
+ "before:text-right",
723
+ "before:text-muted-foreground/50",
724
+ "before:font-mono",
725
+ "before:select-none",
726
+ );
727
+
728
+ // Line rendering component
729
+ const LineSpan = ({
730
+ keyedLine,
731
+ showLineNumbers,
732
+ }: {
733
+ keyedLine: KeyedLine;
734
+ showLineNumbers: boolean;
735
+ }) => (
736
+ <span className={showLineNumbers ? LINE_NUMBER_CLASSES : "block"}>
737
+ {keyedLine.tokens.length === 0
738
+ ? "\\n"
739
+ : keyedLine.tokens.map(({ token, key }) => <TokenSpan key={key} token={token} />)}
740
+ </span>
741
+ );
742
+
743
+ // Types
744
+ type CodeBlockProps = HTMLAttributes<HTMLDivElement> & {
745
+ code: string;
746
+ language: BundledLanguage;
747
+ showLineNumbers?: boolean;
748
+ };
749
+
750
+ interface TokenizedCode {
751
+ tokens: ThemedToken[][];
752
+ fg: string;
753
+ bg: string;
754
+ }
755
+
756
+ interface CodeBlockContextType {
757
+ code: string;
758
+ }
759
+
760
+ // Context
761
+ const CodeBlockContext = createContext<CodeBlockContextType>({
762
+ code: "",
763
+ });
764
+
765
+ // Highlighter cache (singleton per language)
766
+ const highlighterCache = new Map<
767
+ string,
768
+ Promise<HighlighterGeneric<BundledLanguage, BundledTheme>>
769
+ >();
770
+
771
+ // Token cache
772
+ const tokensCache = new Map<string, TokenizedCode>();
773
+
774
+ // Subscribers for async token updates
775
+ const subscribers = new Map<string, Set<(result: TokenizedCode) => void>>();
776
+
777
+ const getTokensCacheKey = (code: string, language: BundledLanguage) => {
778
+ const start = code.slice(0, 100);
779
+ const end = code.length > 100 ? code.slice(-100) : "";
780
+ return \`\${language}:\${code.length}:\${start}:\${end}\`;
781
+ };
782
+
783
+ const getHighlighter = (
784
+ language: BundledLanguage,
785
+ ): Promise<HighlighterGeneric<BundledLanguage, BundledTheme>> => {
786
+ const cached = highlighterCache.get(language);
787
+ if (cached) {
788
+ return cached;
789
+ }
790
+
791
+ const highlighterPromise = createHighlighter({
792
+ langs: [language],
793
+ themes: ["github-light", "github-dark"],
794
+ });
795
+
796
+ highlighterCache.set(language, highlighterPromise);
797
+ return highlighterPromise;
798
+ };
799
+
800
+ // Create raw tokens for immediate display while highlighting loads
801
+ const createRawTokens = (code: string): TokenizedCode => ({
802
+ bg: "transparent",
803
+ fg: "inherit",
804
+ tokens: code.split("\\n").map((line) =>
805
+ line === ""
806
+ ? []
807
+ : [
808
+ {
809
+ color: "inherit",
810
+ content: line,
811
+ } as ThemedToken,
812
+ ],
813
+ ),
814
+ });
815
+
816
+ // Synchronous highlight with callback for async results
817
+ export const highlightCode = (
818
+ code: string,
819
+ language: BundledLanguage,
820
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-callbacks)
821
+ callback?: (result: TokenizedCode) => void,
822
+ ): TokenizedCode | null => {
823
+ const tokensCacheKey = getTokensCacheKey(code, language);
824
+
825
+ // Return cached result if available
826
+ const cached = tokensCache.get(tokensCacheKey);
827
+ if (cached) {
828
+ return cached;
829
+ }
830
+
831
+ // Subscribe callback if provided
832
+ if (callback) {
833
+ if (!subscribers.has(tokensCacheKey)) {
834
+ subscribers.set(tokensCacheKey, new Set());
835
+ }
836
+ subscribers.get(tokensCacheKey)?.add(callback);
837
+ }
838
+
839
+ // Start highlighting in background - fire-and-forget async pattern
840
+ getHighlighter(language)
841
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then)
842
+ .then((highlighter) => {
843
+ const availableLangs = highlighter.getLoadedLanguages();
844
+ const langToUse = availableLangs.includes(language) ? language : "text";
845
+
846
+ const result = highlighter.codeToTokens(code, {
847
+ lang: langToUse,
848
+ themes: {
849
+ dark: "github-dark",
850
+ light: "github-light",
851
+ },
852
+ });
853
+
854
+ const tokenized: TokenizedCode = {
855
+ bg: result.bg ?? "transparent",
856
+ fg: result.fg ?? "inherit",
857
+ tokens: result.tokens,
858
+ };
859
+
860
+ // Cache the result
861
+ tokensCache.set(tokensCacheKey, tokenized);
862
+
863
+ // Notify all subscribers
864
+ const subs = subscribers.get(tokensCacheKey);
865
+ if (subs) {
866
+ for (const sub of subs) {
867
+ sub(tokenized);
868
+ }
869
+ subscribers.delete(tokensCacheKey);
870
+ }
871
+ })
872
+ // oxlint-disable-next-line eslint-plugin-promise(prefer-await-to-then), eslint-plugin-promise(prefer-await-to-callbacks)
873
+ .catch((error) => {
874
+ console.error("Failed to highlight code:", error);
875
+ subscribers.delete(tokensCacheKey);
876
+ });
877
+
878
+ return null;
879
+ };
880
+
881
+ const CodeBlockBody = memo(
882
+ ({
883
+ tokenized,
884
+ showLineNumbers,
885
+ className,
886
+ }: {
887
+ tokenized: TokenizedCode;
888
+ showLineNumbers: boolean;
889
+ className?: string;
890
+ }) => {
891
+ const preStyle = useMemo(
892
+ () => ({
893
+ backgroundColor: tokenized.bg,
894
+ color: tokenized.fg,
895
+ }),
896
+ [tokenized.bg, tokenized.fg],
897
+ );
898
+
899
+ const keyedLines = useMemo(() => addKeysToTokens(tokenized.tokens), [tokenized.tokens]);
900
+
901
+ return (
902
+ <pre
903
+ className={cn(
904
+ "dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",
905
+ className,
906
+ )}
907
+ style={preStyle}
908
+ >
909
+ <code
910
+ className={cn(
911
+ "font-mono text-sm",
912
+ showLineNumbers && "[counter-increment:line_0] [counter-reset:line]",
913
+ )}
914
+ >
915
+ {keyedLines.map((keyedLine) => (
916
+ <LineSpan key={keyedLine.key} keyedLine={keyedLine} showLineNumbers={showLineNumbers} />
917
+ ))}
918
+ </code>
919
+ </pre>
920
+ );
921
+ },
922
+ (prevProps, nextProps) =>
923
+ prevProps.tokenized === nextProps.tokenized &&
924
+ prevProps.showLineNumbers === nextProps.showLineNumbers &&
925
+ prevProps.className === nextProps.className,
926
+ );
927
+
928
+ CodeBlockBody.displayName = "CodeBlockBody";
929
+
930
+ export const CodeBlockContainer = ({
931
+ className,
932
+ language,
933
+ style,
934
+ ...props
935
+ }: HTMLAttributes<HTMLDivElement> & { language: string }) => (
936
+ <div
937
+ className={cn(
938
+ "group relative w-full overflow-hidden rounded-md border bg-background text-foreground",
939
+ className,
940
+ )}
941
+ data-language={language}
942
+ style={{
943
+ containIntrinsicSize: "auto 200px",
944
+ contentVisibility: "auto",
945
+ ...style,
946
+ }}
947
+ {...props}
948
+ />
949
+ );
950
+
951
+ export const CodeBlockHeader = ({
952
+ children,
953
+ className,
954
+ ...props
955
+ }: HTMLAttributes<HTMLDivElement>) => (
956
+ <div
957
+ className={cn(
958
+ "flex items-center justify-between border-b bg-muted/80 px-3 py-2 text-muted-foreground text-xs",
959
+ className,
960
+ )}
961
+ {...props}
962
+ >
963
+ {children}
964
+ </div>
965
+ );
966
+
967
+ export const CodeBlockTitle = ({
968
+ children,
969
+ className,
970
+ ...props
971
+ }: HTMLAttributes<HTMLDivElement>) => (
972
+ <div className={cn("flex items-center gap-2", className)} {...props}>
973
+ {children}
974
+ </div>
975
+ );
976
+
977
+ export const CodeBlockFilename = ({
978
+ children,
979
+ className,
980
+ ...props
981
+ }: HTMLAttributes<HTMLSpanElement>) => (
982
+ <span className={cn("font-mono", className)} {...props}>
983
+ {children}
984
+ </span>
985
+ );
986
+
987
+ export const CodeBlockActions = ({
988
+ children,
989
+ className,
990
+ ...props
991
+ }: HTMLAttributes<HTMLDivElement>) => (
992
+ <div className={cn("-my-1 -mr-1 flex items-center gap-2", className)} {...props}>
993
+ {children}
994
+ </div>
995
+ );
996
+
997
+ export const CodeBlockContent = ({
998
+ code,
999
+ language,
1000
+ showLineNumbers = false,
1001
+ }: {
1002
+ code: string;
1003
+ language: BundledLanguage;
1004
+ showLineNumbers?: boolean;
1005
+ }) => {
1006
+ // Memoized raw tokens for immediate display
1007
+ const rawTokens = useMemo(() => createRawTokens(code), [code]);
1008
+
1009
+ // Synchronous cache lookup — avoids setState in effect for cached results
1010
+ const syncTokens = useMemo(
1011
+ () => highlightCode(code, language) ?? rawTokens,
1012
+ [code, language, rawTokens],
1013
+ );
1014
+
1015
+ // Async highlighting result (populated after shiki loads)
1016
+ const [asyncTokens, setAsyncTokens] = useState<TokenizedCode | null>(null);
1017
+ const asyncKeyRef = useRef({ code, language });
1018
+
1019
+ // Invalidate stale async tokens synchronously during render
1020
+ if (asyncKeyRef.current.code !== code || asyncKeyRef.current.language !== language) {
1021
+ asyncKeyRef.current = { code, language };
1022
+ setAsyncTokens(null);
1023
+ }
1024
+
1025
+ useEffect(() => {
1026
+ let cancelled = false;
1027
+
1028
+ highlightCode(code, language, (result) => {
1029
+ if (!cancelled) {
1030
+ setAsyncTokens(result);
1031
+ }
1032
+ });
1033
+
1034
+ return () => {
1035
+ cancelled = true;
1036
+ };
1037
+ }, [code, language]);
1038
+
1039
+ const tokenized = asyncTokens ?? syncTokens;
1040
+
1041
+ return (
1042
+ <div className="relative overflow-auto">
1043
+ <CodeBlockBody showLineNumbers={showLineNumbers} tokenized={tokenized} />
1044
+ </div>
1045
+ );
1046
+ };
1047
+
1048
+ export const CodeBlock = ({
1049
+ code,
1050
+ language,
1051
+ showLineNumbers = false,
1052
+ className,
1053
+ children,
1054
+ ...props
1055
+ }: CodeBlockProps) => {
1056
+ const contextValue = useMemo(() => ({ code }), [code]);
1057
+
1058
+ return (
1059
+ <CodeBlockContext.Provider value={contextValue}>
1060
+ <CodeBlockContainer className={className} language={language} {...props}>
1061
+ {children}
1062
+ <CodeBlockContent code={code} language={language} showLineNumbers={showLineNumbers} />
1063
+ </CodeBlockContainer>
1064
+ </CodeBlockContext.Provider>
1065
+ );
1066
+ };
1067
+
1068
+ export type CodeBlockCopyButtonProps = ComponentProps<typeof Button> & {
1069
+ onCopy?: () => void;
1070
+ onError?: (error: Error) => void;
1071
+ timeout?: number;
1072
+ };
1073
+
1074
+ export const CodeBlockCopyButton = ({
1075
+ onCopy,
1076
+ onError,
1077
+ timeout = 2000,
1078
+ children,
1079
+ className,
1080
+ ...props
1081
+ }: CodeBlockCopyButtonProps) => {
1082
+ const [isCopied, setIsCopied] = useState(false);
1083
+ const timeoutRef = useRef<number>(0);
1084
+ const { code } = useContext(CodeBlockContext);
1085
+
1086
+ const copyToClipboard = useCallback(async () => {
1087
+ if (typeof window === "undefined" || !navigator?.clipboard?.writeText) {
1088
+ onError?.(new Error("Clipboard API not available"));
1089
+ return;
1090
+ }
1091
+
1092
+ try {
1093
+ if (!isCopied) {
1094
+ await navigator.clipboard.writeText(code);
1095
+ setIsCopied(true);
1096
+ onCopy?.();
1097
+ timeoutRef.current = window.setTimeout(() => setIsCopied(false), timeout);
1098
+ }
1099
+ } catch (error) {
1100
+ onError?.(error as Error);
1101
+ }
1102
+ }, [code, onCopy, onError, timeout, isCopied]);
1103
+
1104
+ useEffect(
1105
+ () => () => {
1106
+ window.clearTimeout(timeoutRef.current);
1107
+ },
1108
+ [],
1109
+ );
1110
+
1111
+ const Icon = isCopied ? CheckIcon : CopyIcon;
1112
+
1113
+ return (
1114
+ <Button
1115
+ className={cn("shrink-0", className)}
1116
+ onClick={copyToClipboard}
1117
+ size="icon"
1118
+ variant="ghost"
1119
+ {...props}
1120
+ >
1121
+ {children ?? <Icon size={14} />}
1122
+ </Button>
1123
+ );
1124
+ };
1125
+
1126
+ export type CodeBlockLanguageSelectorProps = ComponentProps<typeof Select>;
1127
+
1128
+ export const CodeBlockLanguageSelector = (props: CodeBlockLanguageSelectorProps) => (
1129
+ <Select {...props} />
1130
+ );
1131
+
1132
+ export type CodeBlockLanguageSelectorTriggerProps = ComponentProps<typeof SelectTrigger>;
1133
+
1134
+ export const CodeBlockLanguageSelectorTrigger = ({
1135
+ className,
1136
+ ...props
1137
+ }: CodeBlockLanguageSelectorTriggerProps) => (
1138
+ <SelectTrigger
1139
+ className={cn("h-7 border-none bg-transparent px-2 text-xs shadow-none", className)}
1140
+ size="sm"
1141
+ {...props}
1142
+ />
1143
+ );
1144
+
1145
+ export type CodeBlockLanguageSelectorValueProps = ComponentProps<typeof SelectValue>;
1146
+
1147
+ export const CodeBlockLanguageSelectorValue = (props: CodeBlockLanguageSelectorValueProps) => (
1148
+ <SelectValue {...props} />
1149
+ );
1150
+
1151
+ export type CodeBlockLanguageSelectorContentProps = ComponentProps<typeof SelectContent>;
1152
+
1153
+ export const CodeBlockLanguageSelectorContent = ({
1154
+ align = "end",
1155
+ ...props
1156
+ }: CodeBlockLanguageSelectorContentProps) => <SelectContent align={align} {...props} />;
1157
+
1158
+ export type CodeBlockLanguageSelectorItemProps = ComponentProps<typeof SelectItem>;
1159
+
1160
+ export const CodeBlockLanguageSelectorItem = (props: CodeBlockLanguageSelectorItemProps) => (
1161
+ <SelectItem {...props} />
1162
+ );
1163
+ `,"components/ai-elements/conversation.tsx":`"use client";
1164
+
1165
+ import { Button } from "@/components/ui/button";
1166
+ import { cn } from "@/lib/utils";
1167
+ import type { UIMessage } from "ai";
1168
+ import { ArrowDownIcon, DownloadIcon } from "lucide-react";
1169
+ import type { ComponentProps } from "react";
1170
+ import { useCallback } from "react";
1171
+ import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom";
1172
+
1173
+ export type ConversationProps = ComponentProps<typeof StickToBottom>;
1174
+
1175
+ export const Conversation = ({ className, ...props }: ConversationProps) => (
1176
+ <StickToBottom
1177
+ className={cn("relative flex-1 overflow-y-hidden", className)}
1178
+ initial="smooth"
1179
+ resize="smooth"
1180
+ role="log"
1181
+ {...props}
1182
+ />
1183
+ );
1184
+
1185
+ export type ConversationContentProps = ComponentProps<typeof StickToBottom.Content>;
1186
+
1187
+ export const ConversationContent = ({ className, ...props }: ConversationContentProps) => (
1188
+ <StickToBottom.Content className={cn("flex flex-col gap-8 p-4", className)} {...props} />
1189
+ );
1190
+
1191
+ export type ConversationEmptyStateProps = ComponentProps<"div"> & {
1192
+ title?: string;
1193
+ description?: string;
1194
+ icon?: React.ReactNode;
1195
+ };
1196
+
1197
+ export const ConversationEmptyState = ({
1198
+ className,
1199
+ title = "No messages yet",
1200
+ description = "Start a conversation to see messages here",
1201
+ icon,
1202
+ children,
1203
+ ...props
1204
+ }: ConversationEmptyStateProps) => (
1205
+ <div
1206
+ className={cn(
1207
+ "flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
1208
+ className,
1209
+ )}
1210
+ {...props}
1211
+ >
1212
+ {children ?? (
1213
+ <>
1214
+ {icon && <div className="text-muted-foreground">{icon}</div>}
1215
+ <div className="space-y-1">
1216
+ <h3 className="font-medium text-sm">{title}</h3>
1217
+ {description && <p className="text-muted-foreground text-sm">{description}</p>}
1218
+ </div>
1219
+ </>
1220
+ )}
1221
+ </div>
1222
+ );
1223
+
1224
+ export type ConversationScrollButtonProps = ComponentProps<typeof Button>;
1225
+
1226
+ export const ConversationScrollButton = ({
1227
+ className,
1228
+ ...props
1229
+ }: ConversationScrollButtonProps) => {
1230
+ const { isAtBottom, scrollToBottom } = useStickToBottomContext();
1231
+
1232
+ const handleScrollToBottom = useCallback(() => {
1233
+ scrollToBottom();
1234
+ }, [scrollToBottom]);
1235
+
1236
+ return (
1237
+ !isAtBottom && (
1238
+ <Button
1239
+ className={cn(
1240
+ "absolute bottom-4 left-[50%] translate-x-[-50%] rounded-full dark:bg-background dark:hover:bg-muted",
1241
+ className,
1242
+ )}
1243
+ onClick={handleScrollToBottom}
1244
+ size="icon"
1245
+ type="button"
1246
+ variant="outline"
1247
+ {...props}
1248
+ >
1249
+ <ArrowDownIcon className="size-4" />
1250
+ </Button>
1251
+ )
1252
+ );
1253
+ };
1254
+
1255
+ const getMessageText = (message: UIMessage): string =>
1256
+ message.parts
1257
+ .filter((part) => part.type === "text")
1258
+ .map((part) => part.text)
1259
+ .join("");
1260
+
1261
+ export type ConversationDownloadProps = Omit<ComponentProps<typeof Button>, "onClick"> & {
1262
+ messages: UIMessage[];
1263
+ filename?: string;
1264
+ formatMessage?: (message: UIMessage, index: number) => string;
1265
+ };
1266
+
1267
+ const defaultFormatMessage = (message: UIMessage): string => {
1268
+ const roleLabel = message.role.charAt(0).toUpperCase() + message.role.slice(1);
1269
+ return \`**\${roleLabel}:** \${getMessageText(message)}\`;
1270
+ };
1271
+
1272
+ export const messagesToMarkdown = (
1273
+ messages: UIMessage[],
1274
+ formatMessage: (message: UIMessage, index: number) => string = defaultFormatMessage,
1275
+ ): string => messages.map((msg, i) => formatMessage(msg, i)).join("\\n\\n");
1276
+
1277
+ export const ConversationDownload = ({
1278
+ messages,
1279
+ filename = "conversation.md",
1280
+ formatMessage = defaultFormatMessage,
1281
+ className,
1282
+ children,
1283
+ ...props
1284
+ }: ConversationDownloadProps) => {
1285
+ const handleDownload = useCallback(() => {
1286
+ const markdown = messagesToMarkdown(messages, formatMessage);
1287
+ const blob = new Blob([markdown], { type: "text/markdown" });
1288
+ const url = URL.createObjectURL(blob);
1289
+ const link = document.createElement("a");
1290
+ link.href = url;
1291
+ link.download = filename;
1292
+ document.body.append(link);
1293
+ link.click();
1294
+ link.remove();
1295
+ URL.revokeObjectURL(url);
1296
+ }, [messages, filename, formatMessage]);
1297
+
1298
+ return (
1299
+ <Button
1300
+ className={cn(
1301
+ "absolute top-4 right-4 rounded-full dark:bg-background dark:hover:bg-muted",
1302
+ className,
1303
+ )}
1304
+ onClick={handleDownload}
1305
+ size="icon"
1306
+ type="button"
1307
+ variant="outline"
1308
+ {...props}
1309
+ >
1310
+ {children ?? <DownloadIcon className="size-4" />}
1311
+ </Button>
1312
+ );
1313
+ };
1314
+ `,"components/ai-elements/message.tsx":`"use client";
1315
+
1316
+ import { Button } from "@/components/ui/button";
1317
+ import { ButtonGroup, ButtonGroupText } from "@/components/ui/button-group";
1318
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
1319
+ import { cn } from "@/lib/utils";
1320
+ import { cjk } from "@streamdown/cjk";
1321
+ import { code } from "@streamdown/code";
1322
+ import { math } from "@streamdown/math";
1323
+ import { mermaid } from "@streamdown/mermaid";
1324
+ import type { UIMessage } from "ai";
1325
+ import { ChevronLeftIcon, ChevronRightIcon } from "lucide-react";
1326
+ import type { ComponentProps, HTMLAttributes, ReactElement } from "react";
1327
+ import { createContext, memo, useCallback, useContext, useEffect, useMemo, useState } from "react";
1328
+ import { Streamdown } from "streamdown";
1329
+
1330
+ export type MessageProps = HTMLAttributes<HTMLDivElement> & {
1331
+ from: UIMessage["role"];
1332
+ };
1333
+
1334
+ export const Message = ({ className, from, ...props }: MessageProps) => (
1335
+ <div
1336
+ className={cn(
1337
+ "group flex w-full max-w-[95%] flex-col gap-2",
1338
+ from === "user" ? "is-user ml-auto justify-end" : "is-assistant",
1339
+ className,
1340
+ )}
1341
+ {...props}
1342
+ />
1343
+ );
1344
+
1345
+ export type MessageContentProps = HTMLAttributes<HTMLDivElement>;
1346
+
1347
+ export const MessageContent = ({ children, className, ...props }: MessageContentProps) => (
1348
+ <div
1349
+ className={cn(
1350
+ "is-user:dark flex w-fit min-w-0 max-w-full flex-col gap-2 overflow-hidden text-sm",
1351
+ "group-[.is-user]:ml-auto group-[.is-user]:rounded-2xl group-[.is-user]:bg-primary group-[.is-user]:px-4 group-[.is-user]:py-2.5 group-[.is-user]:text-primary-foreground",
1352
+ "group-[.is-assistant]:w-full group-[.is-assistant]:text-foreground",
1353
+ "group-data-[optimistic=true]:opacity-70",
1354
+ className,
1355
+ )}
1356
+ {...props}
1357
+ >
1358
+ {children}
1359
+ </div>
1360
+ );
1361
+
1362
+ export type MessageActionsProps = ComponentProps<"div">;
1363
+
1364
+ export const MessageActions = ({ className, children, ...props }: MessageActionsProps) => (
1365
+ <div className={cn("flex items-center gap-1", className)} {...props}>
1366
+ {children}
1367
+ </div>
1368
+ );
1369
+
1370
+ export type MessageActionProps = ComponentProps<typeof Button> & {
1371
+ tooltip?: string;
1372
+ label?: string;
1373
+ };
1374
+
1375
+ export const MessageAction = ({
1376
+ tooltip,
1377
+ children,
1378
+ label,
1379
+ variant = "ghost",
1380
+ size = "icon-sm",
1381
+ ...props
1382
+ }: MessageActionProps) => {
1383
+ const button = (
1384
+ <Button size={size} type="button" variant={variant} {...props}>
1385
+ {children}
1386
+ <span className="sr-only">{label || tooltip}</span>
1387
+ </Button>
1388
+ );
1389
+
1390
+ if (tooltip) {
1391
+ return (
1392
+ <TooltipProvider>
1393
+ <Tooltip>
1394
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
1395
+ <TooltipContent>
1396
+ <p>{tooltip}</p>
1397
+ </TooltipContent>
1398
+ </Tooltip>
1399
+ </TooltipProvider>
1400
+ );
1401
+ }
1402
+
1403
+ return button;
1404
+ };
1405
+
1406
+ interface MessageBranchContextType {
1407
+ currentBranch: number;
1408
+ totalBranches: number;
1409
+ goToPrevious: () => void;
1410
+ goToNext: () => void;
1411
+ branches: ReactElement[];
1412
+ setBranches: (branches: ReactElement[]) => void;
1413
+ }
1414
+
1415
+ const MessageBranchContext = createContext<MessageBranchContextType | null>(null);
1416
+
1417
+ const useMessageBranch = () => {
1418
+ const context = useContext(MessageBranchContext);
1419
+
1420
+ if (!context) {
1421
+ throw new Error("MessageBranch components must be used within MessageBranch");
1422
+ }
1423
+
1424
+ return context;
1425
+ };
1426
+
1427
+ export type MessageBranchProps = HTMLAttributes<HTMLDivElement> & {
1428
+ defaultBranch?: number;
1429
+ onBranchChange?: (branchIndex: number) => void;
1430
+ };
1431
+
1432
+ export const MessageBranch = ({
1433
+ defaultBranch = 0,
1434
+ onBranchChange,
1435
+ className,
1436
+ ...props
1437
+ }: MessageBranchProps) => {
1438
+ const [currentBranch, setCurrentBranch] = useState(defaultBranch);
1439
+ const [branches, setBranches] = useState<ReactElement[]>([]);
1440
+
1441
+ const handleBranchChange = useCallback(
1442
+ (newBranch: number) => {
1443
+ setCurrentBranch(newBranch);
1444
+ onBranchChange?.(newBranch);
1445
+ },
1446
+ [onBranchChange],
1447
+ );
1448
+
1449
+ const goToPrevious = useCallback(() => {
1450
+ const newBranch = currentBranch > 0 ? currentBranch - 1 : branches.length - 1;
1451
+ handleBranchChange(newBranch);
1452
+ }, [currentBranch, branches.length, handleBranchChange]);
1453
+
1454
+ const goToNext = useCallback(() => {
1455
+ const newBranch = currentBranch < branches.length - 1 ? currentBranch + 1 : 0;
1456
+ handleBranchChange(newBranch);
1457
+ }, [currentBranch, branches.length, handleBranchChange]);
1458
+
1459
+ const contextValue = useMemo<MessageBranchContextType>(
1460
+ () => ({
1461
+ branches,
1462
+ currentBranch,
1463
+ goToNext,
1464
+ goToPrevious,
1465
+ setBranches,
1466
+ totalBranches: branches.length,
1467
+ }),
1468
+ [branches, currentBranch, goToNext, goToPrevious],
1469
+ );
1470
+
1471
+ return (
1472
+ <MessageBranchContext.Provider value={contextValue}>
1473
+ <div className={cn("grid w-full gap-2 [&>div]:pb-0", className)} {...props} />
1474
+ </MessageBranchContext.Provider>
1475
+ );
1476
+ };
1477
+
1478
+ export type MessageBranchContentProps = HTMLAttributes<HTMLDivElement>;
1479
+
1480
+ export const MessageBranchContent = ({ children, ...props }: MessageBranchContentProps) => {
1481
+ const { currentBranch, setBranches, branches } = useMessageBranch();
1482
+ const childrenArray = useMemo(
1483
+ () => (Array.isArray(children) ? children : [children]),
1484
+ [children],
1485
+ );
1486
+
1487
+ // Use useEffect to update branches when they change
1488
+ useEffect(() => {
1489
+ if (branches.length !== childrenArray.length) {
1490
+ setBranches(childrenArray);
1491
+ }
1492
+ }, [childrenArray, branches, setBranches]);
1493
+
1494
+ return childrenArray.map((branch, index) => (
1495
+ <div
1496
+ className={cn(
1497
+ "grid gap-2 overflow-hidden [&>div]:pb-0",
1498
+ index === currentBranch ? "block" : "hidden",
1499
+ )}
1500
+ key={branch.key}
1501
+ {...props}
1502
+ >
1503
+ {branch}
1504
+ </div>
1505
+ ));
1506
+ };
1507
+
1508
+ export type MessageBranchSelectorProps = ComponentProps<typeof ButtonGroup>;
1509
+
1510
+ export const MessageBranchSelector = ({ className, ...props }: MessageBranchSelectorProps) => {
1511
+ const { totalBranches } = useMessageBranch();
1512
+
1513
+ // Don't render if there's only one branch
1514
+ if (totalBranches <= 1) {
1515
+ return null;
1516
+ }
1517
+
1518
+ return (
1519
+ <ButtonGroup
1520
+ className={cn(
1521
+ "[&>*:not(:first-child)]:rounded-l-md [&>*:not(:last-child)]:rounded-r-md",
1522
+ className,
1523
+ )}
1524
+ orientation="horizontal"
1525
+ {...props}
1526
+ />
1527
+ );
1528
+ };
1529
+
1530
+ export type MessageBranchPreviousProps = ComponentProps<typeof Button>;
1531
+
1532
+ export const MessageBranchPrevious = ({ children, ...props }: MessageBranchPreviousProps) => {
1533
+ const { goToPrevious, totalBranches } = useMessageBranch();
1534
+
1535
+ return (
1536
+ <Button
1537
+ aria-label="Previous branch"
1538
+ disabled={totalBranches <= 1}
1539
+ onClick={goToPrevious}
1540
+ size="icon-sm"
1541
+ type="button"
1542
+ variant="ghost"
1543
+ {...props}
1544
+ >
1545
+ {children ?? <ChevronLeftIcon size={14} />}
1546
+ </Button>
1547
+ );
1548
+ };
1549
+
1550
+ export type MessageBranchNextProps = ComponentProps<typeof Button>;
1551
+
1552
+ export const MessageBranchNext = ({ children, ...props }: MessageBranchNextProps) => {
1553
+ const { goToNext, totalBranches } = useMessageBranch();
1554
+
1555
+ return (
1556
+ <Button
1557
+ aria-label="Next branch"
1558
+ disabled={totalBranches <= 1}
1559
+ onClick={goToNext}
1560
+ size="icon-sm"
1561
+ type="button"
1562
+ variant="ghost"
1563
+ {...props}
1564
+ >
1565
+ {children ?? <ChevronRightIcon size={14} />}
1566
+ </Button>
1567
+ );
1568
+ };
1569
+
1570
+ export type MessageBranchPageProps = HTMLAttributes<HTMLSpanElement>;
1571
+
1572
+ export const MessageBranchPage = ({ className, ...props }: MessageBranchPageProps) => {
1573
+ const { currentBranch, totalBranches } = useMessageBranch();
1574
+
1575
+ return (
1576
+ <ButtonGroupText
1577
+ className={cn("border-none bg-transparent text-muted-foreground shadow-none", className)}
1578
+ {...props}
1579
+ >
1580
+ {currentBranch + 1} of {totalBranches}
1581
+ </ButtonGroupText>
1582
+ );
1583
+ };
1584
+
1585
+ export type MessageResponseProps = ComponentProps<typeof Streamdown>;
1586
+
1587
+ const streamdownPlugins = { cjk, code, math, mermaid };
1588
+
1589
+ export const MessageResponse = memo(
1590
+ ({ className, ...props }: MessageResponseProps) => (
1591
+ <Streamdown
1592
+ className={cn("size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0", className)}
1593
+ plugins={streamdownPlugins}
1594
+ {...props}
1595
+ />
1596
+ ),
1597
+ (prevProps, nextProps) =>
1598
+ prevProps.children === nextProps.children && nextProps.isAnimating === prevProps.isAnimating,
1599
+ );
1600
+
1601
+ MessageResponse.displayName = "MessageResponse";
1602
+
1603
+ export type MessageToolbarProps = ComponentProps<"div">;
1604
+
1605
+ export const MessageToolbar = ({ className, children, ...props }: MessageToolbarProps) => (
1606
+ <div className={cn("mt-4 flex w-full items-center justify-between gap-4", className)} {...props}>
1607
+ {children}
1608
+ </div>
1609
+ );
1610
+ `,"components/ai-elements/prompt-input.tsx":`"use client";
1611
+
1612
+ import {
1613
+ Command,
1614
+ CommandEmpty,
1615
+ CommandGroup,
1616
+ CommandInput,
1617
+ CommandItem,
1618
+ CommandList,
1619
+ CommandSeparator,
1620
+ } from "@/components/ui/command";
1621
+ import {
1622
+ DropdownMenu,
1623
+ DropdownMenuContent,
1624
+ DropdownMenuItem,
1625
+ DropdownMenuTrigger,
1626
+ } from "@/components/ui/dropdown-menu";
1627
+ import { HoverCard, HoverCardContent, HoverCardTrigger } from "@/components/ui/hover-card";
1628
+ import {
1629
+ InputGroup,
1630
+ InputGroupAddon,
1631
+ InputGroupButton,
1632
+ InputGroupTextarea,
1633
+ } from "@/components/ui/input-group";
1634
+ import {
1635
+ Select,
1636
+ SelectContent,
1637
+ SelectItem,
1638
+ SelectTrigger,
1639
+ SelectValue,
1640
+ } from "@/components/ui/select";
1641
+ import { Spinner } from "@/components/ui/spinner";
1642
+ import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
1643
+ import { cn } from "@/lib/utils";
1644
+ import type { ChatStatus, FileUIPart, SourceDocumentUIPart } from "ai";
1645
+ import { ArrowUpIcon, ImageIcon, Monitor, PlusIcon, SquareIcon, XIcon } from "lucide-react";
1646
+ import { nanoid } from "nanoid";
1647
+ import type {
1648
+ ChangeEvent,
1649
+ ChangeEventHandler,
1650
+ ClipboardEventHandler,
1651
+ ComponentProps,
1652
+ FormEvent,
1653
+ FormEventHandler,
1654
+ HTMLAttributes,
1655
+ KeyboardEventHandler,
1656
+ PropsWithChildren,
1657
+ ReactNode,
1658
+ RefObject,
1659
+ } from "react";
1660
+ import {
1661
+ Children,
1662
+ createContext,
1663
+ useCallback,
1664
+ useContext,
1665
+ useEffect,
1666
+ useMemo,
1667
+ useRef,
1668
+ useState,
1669
+ } from "react";
1670
+
1671
+ // ============================================================================
1672
+ // Helpers
1673
+ // ============================================================================
1674
+
1675
+ const convertBlobUrlToDataUrl = async (url: string): Promise<string | null> => {
1676
+ try {
1677
+ const response = await fetch(url);
1678
+ const blob = await response.blob();
1679
+ // FileReader uses callback-based API, wrapping in Promise is necessary
1680
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
1681
+ return new Promise((resolve) => {
1682
+ const reader = new FileReader();
1683
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
1684
+ reader.onloadend = () => resolve(reader.result as string);
1685
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
1686
+ reader.onerror = () => resolve(null);
1687
+ reader.readAsDataURL(blob);
1688
+ });
1689
+ } catch {
1690
+ return null;
1691
+ }
1692
+ };
1693
+
1694
+ const captureScreenshot = async (): Promise<File | null> => {
1695
+ if (typeof navigator === "undefined" || !navigator.mediaDevices?.getDisplayMedia) {
1696
+ return null;
1697
+ }
1698
+
1699
+ let stream: MediaStream | null = null;
1700
+ const video = document.createElement("video");
1701
+ video.muted = true;
1702
+ video.playsInline = true;
1703
+
1704
+ try {
1705
+ stream = await navigator.mediaDevices.getDisplayMedia({
1706
+ audio: false,
1707
+ video: true,
1708
+ });
1709
+
1710
+ video.srcObject = stream;
1711
+
1712
+ // Video element uses callback-based API, wrapping in Promise is necessary
1713
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
1714
+ await new Promise<void>((resolve, reject) => {
1715
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
1716
+ video.onloadedmetadata = () => resolve();
1717
+ // oxlint-disable-next-line eslint-plugin-unicorn(prefer-add-event-listener)
1718
+ video.onerror = () => reject(new Error("Failed to load screen stream"));
1719
+ });
1720
+
1721
+ await video.play();
1722
+
1723
+ const width = video.videoWidth;
1724
+ const height = video.videoHeight;
1725
+ if (!width || !height) {
1726
+ return null;
1727
+ }
1728
+
1729
+ const canvas = document.createElement("canvas");
1730
+ canvas.width = width;
1731
+ canvas.height = height;
1732
+ const context = canvas.getContext("2d");
1733
+ if (!context) {
1734
+ return null;
1735
+ }
1736
+
1737
+ context.drawImage(video, 0, 0, width, height);
1738
+ // canvas.toBlob uses callback-based API, wrapping in Promise is necessary
1739
+ // oxlint-disable-next-line eslint-plugin-promise(avoid-new)
1740
+ const blob = await new Promise<Blob | null>((resolve) => {
1741
+ canvas.toBlob(resolve, "image/png");
1742
+ });
1743
+ if (!blob) {
1744
+ return null;
1745
+ }
1746
+
1747
+ const timestamp = new Date()
1748
+ .toISOString()
1749
+ .replaceAll(/[:.]/g, "-")
1750
+ .replace("T", "_")
1751
+ .replace("Z", "");
1752
+
1753
+ return new File([blob], \`screenshot-\${timestamp}.png\`, {
1754
+ lastModified: Date.now(),
1755
+ type: "image/png",
1756
+ });
1757
+ } finally {
1758
+ if (stream) {
1759
+ for (const track of stream.getTracks()) {
1760
+ track.stop();
1761
+ }
1762
+ }
1763
+ video.pause();
1764
+ video.srcObject = null;
1765
+ }
1766
+ };
1767
+
1768
+ // ============================================================================
1769
+ // Provider Context & Types
1770
+ // ============================================================================
1771
+
1772
+ export interface AttachmentsContext {
1773
+ files: (FileUIPart & { id: string })[];
1774
+ add: (files: File[] | FileList) => void;
1775
+ remove: (id: string) => void;
1776
+ clear: () => void;
1777
+ openFileDialog: () => void;
1778
+ fileInputRef: RefObject<HTMLInputElement | null>;
1779
+ }
1780
+
1781
+ export interface TextInputContext {
1782
+ value: string;
1783
+ setInput: (v: string) => void;
1784
+ clear: () => void;
1785
+ }
1786
+
1787
+ export interface PromptInputControllerProps {
1788
+ textInput: TextInputContext;
1789
+ attachments: AttachmentsContext;
1790
+ /** INTERNAL: Allows PromptInput to register its file textInput + "open" callback */
1791
+ __registerFileInput: (ref: RefObject<HTMLInputElement | null>, open: () => void) => void;
1792
+ }
1793
+
1794
+ const PromptInputController = createContext<PromptInputControllerProps | null>(null);
1795
+ const ProviderAttachmentsContext = createContext<AttachmentsContext | null>(null);
1796
+
1797
+ export const usePromptInputController = () => {
1798
+ const ctx = useContext(PromptInputController);
1799
+ if (!ctx) {
1800
+ throw new Error(
1801
+ "Wrap your component inside <PromptInputProvider> to use usePromptInputController().",
1802
+ );
1803
+ }
1804
+ return ctx;
1805
+ };
1806
+
1807
+ // Optional variants (do NOT throw). Useful for dual-mode components.
1808
+ const useOptionalPromptInputController = () => useContext(PromptInputController);
1809
+
1810
+ export const useProviderAttachments = () => {
1811
+ const ctx = useContext(ProviderAttachmentsContext);
1812
+ if (!ctx) {
1813
+ throw new Error(
1814
+ "Wrap your component inside <PromptInputProvider> to use useProviderAttachments().",
1815
+ );
1816
+ }
1817
+ return ctx;
1818
+ };
1819
+
1820
+ const useOptionalProviderAttachments = () => useContext(ProviderAttachmentsContext);
1821
+
1822
+ export type PromptInputProviderProps = PropsWithChildren<{
1823
+ initialInput?: string;
1824
+ }>;
1825
+
1826
+ /**
1827
+ * Optional global provider that lifts PromptInput state outside of PromptInput.
1828
+ * If you don't use it, PromptInput stays fully self-managed.
1829
+ */
1830
+ export const PromptInputProvider = ({
1831
+ initialInput: initialTextInput = "",
1832
+ children,
1833
+ }: PromptInputProviderProps) => {
1834
+ // ----- textInput state
1835
+ const [textInput, setTextInput] = useState(initialTextInput);
1836
+ const clearInput = useCallback(() => setTextInput(""), []);
1837
+
1838
+ // ----- attachments state (global when wrapped)
1839
+ const [attachmentFiles, setAttachmentFiles] = useState<(FileUIPart & { id: string })[]>([]);
1840
+ const fileInputRef = useRef<HTMLInputElement | null>(null);
1841
+ // oxlint-disable-next-line eslint(no-empty-function)
1842
+ const openRef = useRef<() => void>(() => {});
1843
+
1844
+ const add = useCallback((files: File[] | FileList) => {
1845
+ const incoming = [...files];
1846
+ if (incoming.length === 0) {
1847
+ return;
1848
+ }
1849
+
1850
+ setAttachmentFiles((prev) => [
1851
+ ...prev,
1852
+ ...incoming.map((file) => ({
1853
+ filename: file.name,
1854
+ id: nanoid(),
1855
+ mediaType: file.type,
1856
+ type: "file" as const,
1857
+ url: URL.createObjectURL(file),
1858
+ })),
1859
+ ]);
1860
+ }, []);
1861
+
1862
+ const remove = useCallback((id: string) => {
1863
+ setAttachmentFiles((prev) => {
1864
+ const found = prev.find((f) => f.id === id);
1865
+ if (found?.url) {
1866
+ URL.revokeObjectURL(found.url);
1867
+ }
1868
+ return prev.filter((f) => f.id !== id);
1869
+ });
1870
+ }, []);
1871
+
1872
+ const clear = useCallback(() => {
1873
+ setAttachmentFiles((prev) => {
1874
+ for (const f of prev) {
1875
+ if (f.url) {
1876
+ URL.revokeObjectURL(f.url);
1877
+ }
1878
+ }
1879
+ return [];
1880
+ });
1881
+ }, []);
1882
+
1883
+ // Keep a ref to attachments for cleanup on unmount (avoids stale closure)
1884
+ const attachmentsRef = useRef(attachmentFiles);
1885
+
1886
+ useEffect(() => {
1887
+ attachmentsRef.current = attachmentFiles;
1888
+ }, [attachmentFiles]);
1889
+
1890
+ // Cleanup blob URLs on unmount to prevent memory leaks
1891
+ useEffect(
1892
+ () => () => {
1893
+ for (const f of attachmentsRef.current) {
1894
+ if (f.url) {
1895
+ URL.revokeObjectURL(f.url);
1896
+ }
1897
+ }
1898
+ },
1899
+ [],
1900
+ );
1901
+
1902
+ const openFileDialog = useCallback(() => {
1903
+ openRef.current?.();
1904
+ }, []);
1905
+
1906
+ const attachments = useMemo<AttachmentsContext>(
1907
+ () => ({
1908
+ add,
1909
+ clear,
1910
+ fileInputRef,
1911
+ files: attachmentFiles,
1912
+ openFileDialog,
1913
+ remove,
1914
+ }),
1915
+ [attachmentFiles, add, remove, clear, openFileDialog],
1916
+ );
1917
+
1918
+ const __registerFileInput = useCallback(
1919
+ (ref: RefObject<HTMLInputElement | null>, open: () => void) => {
1920
+ fileInputRef.current = ref.current;
1921
+ openRef.current = open;
1922
+ },
1923
+ [],
1924
+ );
1925
+
1926
+ const controller = useMemo<PromptInputControllerProps>(
1927
+ () => ({
1928
+ __registerFileInput,
1929
+ attachments,
1930
+ textInput: {
1931
+ clear: clearInput,
1932
+ setInput: setTextInput,
1933
+ value: textInput,
1934
+ },
1935
+ }),
1936
+ [textInput, clearInput, attachments, __registerFileInput],
1937
+ );
1938
+
1939
+ return (
1940
+ <PromptInputController.Provider value={controller}>
1941
+ <ProviderAttachmentsContext.Provider value={attachments}>
1942
+ {children}
1943
+ </ProviderAttachmentsContext.Provider>
1944
+ </PromptInputController.Provider>
1945
+ );
1946
+ };
1947
+
1948
+ // ============================================================================
1949
+ // Component Context & Hooks
1950
+ // ============================================================================
1951
+
1952
+ const LocalAttachmentsContext = createContext<AttachmentsContext | null>(null);
1953
+
1954
+ export const usePromptInputAttachments = () => {
1955
+ // Prefer local context (inside PromptInput) as it has validation, fall back to provider
1956
+ const provider = useOptionalProviderAttachments();
1957
+ const local = useContext(LocalAttachmentsContext);
1958
+ const context = local ?? provider;
1959
+ if (!context) {
1960
+ throw new Error(
1961
+ "usePromptInputAttachments must be used within a PromptInput or PromptInputProvider",
1962
+ );
1963
+ }
1964
+ return context;
1965
+ };
1966
+
1967
+ // ============================================================================
1968
+ // Referenced Sources (Local to PromptInput)
1969
+ // ============================================================================
1970
+
1971
+ export interface ReferencedSourcesContext {
1972
+ sources: (SourceDocumentUIPart & { id: string })[];
1973
+ add: (sources: SourceDocumentUIPart[] | SourceDocumentUIPart) => void;
1974
+ remove: (id: string) => void;
1975
+ clear: () => void;
1976
+ }
1977
+
1978
+ export const LocalReferencedSourcesContext = createContext<ReferencedSourcesContext | null>(null);
1979
+
1980
+ export const usePromptInputReferencedSources = () => {
1981
+ const ctx = useContext(LocalReferencedSourcesContext);
1982
+ if (!ctx) {
1983
+ throw new Error(
1984
+ "usePromptInputReferencedSources must be used within a LocalReferencedSourcesContext.Provider",
1985
+ );
1986
+ }
1987
+ return ctx;
1988
+ };
1989
+
1990
+ export type PromptInputActionAddAttachmentsProps = ComponentProps<typeof DropdownMenuItem> & {
1991
+ label?: string;
1992
+ };
1993
+
1994
+ export const PromptInputActionAddAttachments = ({
1995
+ label = "Add photos or files",
1996
+ ...props
1997
+ }: PromptInputActionAddAttachmentsProps) => {
1998
+ const attachments = usePromptInputAttachments();
1999
+
2000
+ const handleSelect = useCallback(
2001
+ (e: Event) => {
2002
+ e.preventDefault();
2003
+ attachments.openFileDialog();
2004
+ },
2005
+ [attachments],
2006
+ );
2007
+
2008
+ return (
2009
+ <DropdownMenuItem {...props} onSelect={handleSelect}>
2010
+ <ImageIcon className="mr-2 size-4" /> {label}
2011
+ </DropdownMenuItem>
2012
+ );
2013
+ };
2014
+
2015
+ export type PromptInputActionAddScreenshotProps = ComponentProps<typeof DropdownMenuItem> & {
2016
+ label?: string;
2017
+ };
2018
+
2019
+ export const PromptInputActionAddScreenshot = ({
2020
+ label = "Take screenshot",
2021
+ onSelect,
2022
+ ...props
2023
+ }: PromptInputActionAddScreenshotProps) => {
2024
+ const attachments = usePromptInputAttachments();
2025
+
2026
+ const handleSelect = useCallback(
2027
+ async (event: Event) => {
2028
+ onSelect?.(event);
2029
+ if (event.defaultPrevented) {
2030
+ return;
2031
+ }
2032
+
2033
+ try {
2034
+ const screenshot = await captureScreenshot();
2035
+ if (screenshot) {
2036
+ attachments.add([screenshot]);
2037
+ }
2038
+ } catch (error) {
2039
+ if (
2040
+ error instanceof DOMException &&
2041
+ (error.name === "NotAllowedError" || error.name === "AbortError")
2042
+ ) {
2043
+ return;
2044
+ }
2045
+ throw error;
2046
+ }
2047
+ },
2048
+ [onSelect, attachments],
2049
+ );
2050
+
2051
+ return (
2052
+ <DropdownMenuItem {...props} onSelect={handleSelect}>
2053
+ <Monitor className="mr-2 size-4" />
2054
+ {label}
2055
+ </DropdownMenuItem>
2056
+ );
2057
+ };
2058
+
2059
+ export interface PromptInputMessage {
2060
+ text: string;
2061
+ files: FileUIPart[];
2062
+ }
2063
+
2064
+ export type PromptInputProps = Omit<HTMLAttributes<HTMLFormElement>, "onSubmit" | "onError"> & {
2065
+ // e.g., "image/*" or leave undefined for any
2066
+ accept?: string;
2067
+ multiple?: boolean;
2068
+ // When true, accepts drops anywhere on document. Default false (opt-in).
2069
+ globalDrop?: boolean;
2070
+ // Render a hidden input with given name and keep it in sync for native form posts. Default false.
2071
+ syncHiddenInput?: boolean;
2072
+ // Minimal constraints
2073
+ maxFiles?: number;
2074
+ // bytes
2075
+ maxFileSize?: number;
2076
+ onError?: (err: { code: "max_files" | "max_file_size" | "accept"; message: string }) => void;
2077
+ onSubmit: (
2078
+ message: PromptInputMessage,
2079
+ event: FormEvent<HTMLFormElement>,
2080
+ ) => void | Promise<void>;
2081
+ };
2082
+
2083
+ export const PromptInput = ({
2084
+ className,
2085
+ accept,
2086
+ multiple,
2087
+ globalDrop,
2088
+ syncHiddenInput,
2089
+ maxFiles,
2090
+ maxFileSize,
2091
+ onError,
2092
+ onSubmit,
2093
+ children,
2094
+ ...props
2095
+ }: PromptInputProps) => {
2096
+ // Try to use a provider controller if present
2097
+ const controller = useOptionalPromptInputController();
2098
+ const usingProvider = !!controller;
2099
+
2100
+ // Refs
2101
+ const inputRef = useRef<HTMLInputElement | null>(null);
2102
+ const formRef = useRef<HTMLFormElement | null>(null);
2103
+
2104
+ // ----- Local attachments (only used when no provider)
2105
+ const [items, setItems] = useState<(FileUIPart & { id: string })[]>([]);
2106
+ const files = usingProvider ? controller.attachments.files : items;
2107
+
2108
+ // ----- Local referenced sources (always local to PromptInput)
2109
+ const [referencedSources, setReferencedSources] = useState<
2110
+ (SourceDocumentUIPart & { id: string })[]
2111
+ >([]);
2112
+
2113
+ // Keep a ref to files for cleanup on unmount (avoids stale closure)
2114
+ const filesRef = useRef(files);
2115
+
2116
+ useEffect(() => {
2117
+ filesRef.current = files;
2118
+ }, [files]);
2119
+
2120
+ const openFileDialogLocal = useCallback(() => {
2121
+ inputRef.current?.click();
2122
+ }, []);
2123
+
2124
+ const matchesAccept = useCallback(
2125
+ (f: File) => {
2126
+ if (!accept || accept.trim() === "") {
2127
+ return true;
2128
+ }
2129
+
2130
+ const patterns = accept
2131
+ .split(",")
2132
+ .map((s) => s.trim())
2133
+ .filter(Boolean);
2134
+
2135
+ return patterns.some((pattern) => {
2136
+ if (pattern.endsWith("/*")) {
2137
+ // e.g: image/* -> image/
2138
+ const prefix = pattern.slice(0, -1);
2139
+ return f.type.startsWith(prefix);
2140
+ }
2141
+ return f.type === pattern;
2142
+ });
2143
+ },
2144
+ [accept],
2145
+ );
2146
+
2147
+ const addLocal = useCallback(
2148
+ (fileList: File[] | FileList) => {
2149
+ const incoming = [...fileList];
2150
+ const accepted = incoming.filter((f) => matchesAccept(f));
2151
+ if (incoming.length && accepted.length === 0) {
2152
+ onError?.({
2153
+ code: "accept",
2154
+ message: "No files match the accepted types.",
2155
+ });
2156
+ return;
2157
+ }
2158
+ const withinSize = (f: File) => (maxFileSize ? f.size <= maxFileSize : true);
2159
+ const sized = accepted.filter(withinSize);
2160
+ if (accepted.length > 0 && sized.length === 0) {
2161
+ onError?.({
2162
+ code: "max_file_size",
2163
+ message: "All files exceed the maximum size.",
2164
+ });
2165
+ return;
2166
+ }
2167
+
2168
+ setItems((prev) => {
2169
+ const capacity =
2170
+ typeof maxFiles === "number" ? Math.max(0, maxFiles - prev.length) : undefined;
2171
+ const capped = typeof capacity === "number" ? sized.slice(0, capacity) : sized;
2172
+ if (typeof capacity === "number" && sized.length > capacity) {
2173
+ onError?.({
2174
+ code: "max_files",
2175
+ message: "Too many files. Some were not added.",
2176
+ });
2177
+ }
2178
+ const next: (FileUIPart & { id: string })[] = [];
2179
+ for (const file of capped) {
2180
+ next.push({
2181
+ filename: file.name,
2182
+ id: nanoid(),
2183
+ mediaType: file.type,
2184
+ type: "file",
2185
+ url: URL.createObjectURL(file),
2186
+ });
2187
+ }
2188
+ return [...prev, ...next];
2189
+ });
2190
+ },
2191
+ [matchesAccept, maxFiles, maxFileSize, onError],
2192
+ );
2193
+
2194
+ const removeLocal = useCallback(
2195
+ (id: string) =>
2196
+ setItems((prev) => {
2197
+ const found = prev.find((file) => file.id === id);
2198
+ if (found?.url) {
2199
+ URL.revokeObjectURL(found.url);
2200
+ }
2201
+ return prev.filter((file) => file.id !== id);
2202
+ }),
2203
+ [],
2204
+ );
2205
+
2206
+ // Wrapper that validates files before calling provider's add
2207
+ const addWithProviderValidation = useCallback(
2208
+ (fileList: File[] | FileList) => {
2209
+ const incoming = [...fileList];
2210
+ const accepted = incoming.filter((f) => matchesAccept(f));
2211
+ if (incoming.length && accepted.length === 0) {
2212
+ onError?.({
2213
+ code: "accept",
2214
+ message: "No files match the accepted types.",
2215
+ });
2216
+ return;
2217
+ }
2218
+ const withinSize = (f: File) => (maxFileSize ? f.size <= maxFileSize : true);
2219
+ const sized = accepted.filter(withinSize);
2220
+ if (accepted.length > 0 && sized.length === 0) {
2221
+ onError?.({
2222
+ code: "max_file_size",
2223
+ message: "All files exceed the maximum size.",
2224
+ });
2225
+ return;
2226
+ }
2227
+
2228
+ const currentCount = files.length;
2229
+ const capacity =
2230
+ typeof maxFiles === "number" ? Math.max(0, maxFiles - currentCount) : undefined;
2231
+ const capped = typeof capacity === "number" ? sized.slice(0, capacity) : sized;
2232
+ if (typeof capacity === "number" && sized.length > capacity) {
2233
+ onError?.({
2234
+ code: "max_files",
2235
+ message: "Too many files. Some were not added.",
2236
+ });
2237
+ }
2238
+
2239
+ if (capped.length > 0) {
2240
+ controller?.attachments.add(capped);
2241
+ }
2242
+ },
2243
+ [matchesAccept, maxFileSize, maxFiles, onError, files.length, controller],
2244
+ );
2245
+
2246
+ const clearAttachments = useCallback(
2247
+ () =>
2248
+ usingProvider
2249
+ ? controller?.attachments.clear()
2250
+ : setItems((prev) => {
2251
+ for (const file of prev) {
2252
+ if (file.url) {
2253
+ URL.revokeObjectURL(file.url);
2254
+ }
2255
+ }
2256
+ return [];
2257
+ }),
2258
+ [usingProvider, controller],
2259
+ );
2260
+
2261
+ const clearReferencedSources = useCallback(() => setReferencedSources([]), []);
2262
+
2263
+ const add = usingProvider ? addWithProviderValidation : addLocal;
2264
+ const remove = usingProvider ? controller.attachments.remove : removeLocal;
2265
+ const openFileDialog = usingProvider
2266
+ ? controller.attachments.openFileDialog
2267
+ : openFileDialogLocal;
2268
+
2269
+ const clear = useCallback(() => {
2270
+ clearAttachments();
2271
+ clearReferencedSources();
2272
+ }, [clearAttachments, clearReferencedSources]);
2273
+
2274
+ // Let provider know about our hidden file input so external menus can call openFileDialog()
2275
+ useEffect(() => {
2276
+ if (!usingProvider) {
2277
+ return;
2278
+ }
2279
+ controller.__registerFileInput(inputRef, () => inputRef.current?.click());
2280
+ }, [usingProvider, controller]);
2281
+
2282
+ // Note: File input cannot be programmatically set for security reasons
2283
+ // The syncHiddenInput prop is no longer functional
2284
+ useEffect(() => {
2285
+ if (syncHiddenInput && inputRef.current && files.length === 0) {
2286
+ inputRef.current.value = "";
2287
+ }
2288
+ }, [files, syncHiddenInput]);
2289
+
2290
+ // Attach drop handlers on nearest form and document (opt-in)
2291
+ useEffect(() => {
2292
+ const form = formRef.current;
2293
+ if (!form) {
2294
+ return;
2295
+ }
2296
+ if (globalDrop) {
2297
+ // when global drop is on, let the document-level handler own drops
2298
+ return;
2299
+ }
2300
+
2301
+ const onDragOver = (e: DragEvent) => {
2302
+ if (e.dataTransfer?.types?.includes("Files")) {
2303
+ e.preventDefault();
2304
+ }
2305
+ };
2306
+ const onDrop = (e: DragEvent) => {
2307
+ if (e.dataTransfer?.types?.includes("Files")) {
2308
+ e.preventDefault();
2309
+ }
2310
+ if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
2311
+ add(e.dataTransfer.files);
2312
+ }
2313
+ };
2314
+ form.addEventListener("dragover", onDragOver);
2315
+ form.addEventListener("drop", onDrop);
2316
+ return () => {
2317
+ form.removeEventListener("dragover", onDragOver);
2318
+ form.removeEventListener("drop", onDrop);
2319
+ };
2320
+ }, [add, globalDrop]);
2321
+
2322
+ useEffect(() => {
2323
+ if (!globalDrop) {
2324
+ return;
2325
+ }
2326
+
2327
+ const onDragOver = (e: DragEvent) => {
2328
+ if (e.dataTransfer?.types?.includes("Files")) {
2329
+ e.preventDefault();
2330
+ }
2331
+ };
2332
+ const onDrop = (e: DragEvent) => {
2333
+ if (e.dataTransfer?.types?.includes("Files")) {
2334
+ e.preventDefault();
2335
+ }
2336
+ if (e.dataTransfer?.files && e.dataTransfer.files.length > 0) {
2337
+ add(e.dataTransfer.files);
2338
+ }
2339
+ };
2340
+ document.addEventListener("dragover", onDragOver);
2341
+ document.addEventListener("drop", onDrop);
2342
+ return () => {
2343
+ document.removeEventListener("dragover", onDragOver);
2344
+ document.removeEventListener("drop", onDrop);
2345
+ };
2346
+ }, [add, globalDrop]);
2347
+
2348
+ useEffect(
2349
+ () => () => {
2350
+ if (!usingProvider) {
2351
+ for (const f of filesRef.current) {
2352
+ if (f.url) {
2353
+ URL.revokeObjectURL(f.url);
2354
+ }
2355
+ }
2356
+ }
2357
+ },
2358
+ [usingProvider],
2359
+ );
2360
+
2361
+ const handleChange: ChangeEventHandler<HTMLInputElement> = useCallback(
2362
+ (event) => {
2363
+ if (event.currentTarget.files) {
2364
+ add(event.currentTarget.files);
2365
+ }
2366
+ // Reset input value to allow selecting files that were previously removed
2367
+ event.currentTarget.value = "";
2368
+ },
2369
+ [add],
2370
+ );
2371
+
2372
+ const attachmentsCtx = useMemo<AttachmentsContext>(
2373
+ () => ({
2374
+ add,
2375
+ clear: clearAttachments,
2376
+ fileInputRef: inputRef,
2377
+ files: files.map((item) => ({ ...item, id: item.id })),
2378
+ openFileDialog,
2379
+ remove,
2380
+ }),
2381
+ [files, add, remove, clearAttachments, openFileDialog],
2382
+ );
2383
+
2384
+ const refsCtx = useMemo<ReferencedSourcesContext>(
2385
+ () => ({
2386
+ add: (incoming: SourceDocumentUIPart[] | SourceDocumentUIPart) => {
2387
+ const array = Array.isArray(incoming) ? incoming : [incoming];
2388
+ setReferencedSources((prev) => [...prev, ...array.map((s) => ({ ...s, id: nanoid() }))]);
2389
+ },
2390
+ clear: clearReferencedSources,
2391
+ remove: (id: string) => {
2392
+ setReferencedSources((prev) => prev.filter((s) => s.id !== id));
2393
+ },
2394
+ sources: referencedSources,
2395
+ }),
2396
+ [referencedSources, clearReferencedSources],
2397
+ );
2398
+
2399
+ const handleSubmit: FormEventHandler<HTMLFormElement> = useCallback(
2400
+ async (event) => {
2401
+ event.preventDefault();
2402
+
2403
+ const form = event.currentTarget;
2404
+ const text = usingProvider
2405
+ ? controller.textInput.value
2406
+ : (() => {
2407
+ const formData = new FormData(form);
2408
+ return (formData.get("message") as string) || "";
2409
+ })();
2410
+
2411
+ // Reset form immediately after capturing text to avoid race condition
2412
+ // where user input during async blob conversion would be lost
2413
+ if (!usingProvider) {
2414
+ form.reset();
2415
+ }
2416
+
2417
+ try {
2418
+ // Convert blob URLs to data URLs asynchronously
2419
+ const convertedFiles: FileUIPart[] = await Promise.all(
2420
+ files.map(async ({ id: _id, ...item }) => {
2421
+ if (item.url?.startsWith("blob:")) {
2422
+ const dataUrl = await convertBlobUrlToDataUrl(item.url);
2423
+ // If conversion failed, keep the original blob URL
2424
+ return {
2425
+ ...item,
2426
+ url: dataUrl ?? item.url,
2427
+ };
2428
+ }
2429
+ return item;
2430
+ }),
2431
+ );
2432
+
2433
+ const result = onSubmit({ files: convertedFiles, text }, event);
2434
+
2435
+ // Handle both sync and async onSubmit
2436
+ if (result instanceof Promise) {
2437
+ try {
2438
+ await result;
2439
+ clear();
2440
+ if (usingProvider) {
2441
+ controller.textInput.clear();
2442
+ }
2443
+ } catch {
2444
+ // Don't clear on error - user may want to retry
2445
+ }
2446
+ } else {
2447
+ // Sync function completed without throwing, clear inputs
2448
+ clear();
2449
+ if (usingProvider) {
2450
+ controller.textInput.clear();
2451
+ }
2452
+ }
2453
+ } catch {
2454
+ // Don't clear on error - user may want to retry
2455
+ }
2456
+ },
2457
+ [usingProvider, controller, files, onSubmit, clear],
2458
+ );
2459
+
2460
+ // Render with or without local provider
2461
+ const inner = (
2462
+ <>
2463
+ <input
2464
+ accept={accept}
2465
+ aria-label="Upload files"
2466
+ className="hidden"
2467
+ multiple={multiple}
2468
+ onChange={handleChange}
2469
+ ref={inputRef}
2470
+ title="Upload files"
2471
+ type="file"
2472
+ />
2473
+ <form className="w-full" onSubmit={handleSubmit} ref={formRef} {...props}>
2474
+ <InputGroup
2475
+ className={cn(
2476
+ "overflow-hidden rounded-2xl bg-card shadow-sm",
2477
+ "focus-within:border-foreground has-[[data-slot=input-group-control]:focus-visible]:border-foreground",
2478
+ className,
2479
+ )}
2480
+ >
2481
+ {children}
2482
+ </InputGroup>
2483
+ </form>
2484
+ </>
2485
+ );
2486
+
2487
+ const withReferencedSources = (
2488
+ <LocalReferencedSourcesContext.Provider value={refsCtx}>
2489
+ {inner}
2490
+ </LocalReferencedSourcesContext.Provider>
2491
+ );
2492
+
2493
+ // Always provide LocalAttachmentsContext so children get validated add function
2494
+ return (
2495
+ <LocalAttachmentsContext.Provider value={attachmentsCtx}>
2496
+ {withReferencedSources}
2497
+ </LocalAttachmentsContext.Provider>
2498
+ );
2499
+ };
2500
+
2501
+ export type PromptInputBodyProps = HTMLAttributes<HTMLDivElement>;
2502
+
2503
+ export const PromptInputBody = ({ className, ...props }: PromptInputBodyProps) => (
2504
+ <div className={cn("contents", className)} {...props} />
2505
+ );
2506
+
2507
+ export type PromptInputTextareaProps = ComponentProps<typeof InputGroupTextarea>;
2508
+
2509
+ export const PromptInputTextarea = ({
2510
+ onChange,
2511
+ onKeyDown,
2512
+ className,
2513
+ placeholder = "What would you like to know?",
2514
+ ...props
2515
+ }: PromptInputTextareaProps) => {
2516
+ const controller = useOptionalPromptInputController();
2517
+ const attachments = usePromptInputAttachments();
2518
+ const [isComposing, setIsComposing] = useState(false);
2519
+
2520
+ const handleKeyDown: KeyboardEventHandler<HTMLTextAreaElement> = useCallback(
2521
+ (e) => {
2522
+ // Call the external onKeyDown handler first
2523
+ onKeyDown?.(e);
2524
+
2525
+ // If the external handler prevented default, don't run internal logic
2526
+ if (e.defaultPrevented) {
2527
+ return;
2528
+ }
2529
+
2530
+ if (e.key === "Enter") {
2531
+ if (isComposing || e.nativeEvent.isComposing) {
2532
+ return;
2533
+ }
2534
+ if (e.shiftKey) {
2535
+ return;
2536
+ }
2537
+ e.preventDefault();
2538
+
2539
+ // Check if the submit button is disabled before submitting
2540
+ const { form } = e.currentTarget;
2541
+ const submitButton = form?.querySelector(
2542
+ 'button[type="submit"]',
2543
+ ) as HTMLButtonElement | null;
2544
+ if (submitButton?.disabled) {
2545
+ return;
2546
+ }
2547
+
2548
+ form?.requestSubmit();
2549
+ }
2550
+
2551
+ // Remove last attachment when Backspace is pressed and textarea is empty
2552
+ if (e.key === "Backspace" && e.currentTarget.value === "" && attachments.files.length > 0) {
2553
+ e.preventDefault();
2554
+ const lastAttachment = attachments.files.at(-1);
2555
+ if (lastAttachment) {
2556
+ attachments.remove(lastAttachment.id);
2557
+ }
2558
+ }
2559
+ },
2560
+ [onKeyDown, isComposing, attachments],
2561
+ );
2562
+
2563
+ const handlePaste: ClipboardEventHandler<HTMLTextAreaElement> = useCallback(
2564
+ (event) => {
2565
+ const items = event.clipboardData?.items;
2566
+
2567
+ if (!items) {
2568
+ return;
2569
+ }
2570
+
2571
+ const files: File[] = [];
2572
+
2573
+ for (const item of items) {
2574
+ if (item.kind === "file") {
2575
+ const file = item.getAsFile();
2576
+ if (file) {
2577
+ files.push(file);
2578
+ }
2579
+ }
2580
+ }
2581
+
2582
+ if (files.length > 0) {
2583
+ event.preventDefault();
2584
+ attachments.add(files);
2585
+ }
2586
+ },
2587
+ [attachments],
2588
+ );
2589
+
2590
+ const handleCompositionEnd = useCallback(() => setIsComposing(false), []);
2591
+ const handleCompositionStart = useCallback(() => setIsComposing(true), []);
2592
+
2593
+ const controlledProps = controller
2594
+ ? {
2595
+ onChange: (e: ChangeEvent<HTMLTextAreaElement>) => {
2596
+ controller.textInput.setInput(e.currentTarget.value);
2597
+ onChange?.(e);
2598
+ },
2599
+ value: controller.textInput.value,
2600
+ }
2601
+ : {
2602
+ onChange,
2603
+ };
2604
+
2605
+ return (
2606
+ <InputGroupTextarea
2607
+ className={cn("field-sizing-content max-h-48 min-h-18", className)}
2608
+ name="message"
2609
+ onCompositionEnd={handleCompositionEnd}
2610
+ onCompositionStart={handleCompositionStart}
2611
+ onKeyDown={handleKeyDown}
2612
+ onPaste={handlePaste}
2613
+ placeholder={placeholder}
2614
+ {...props}
2615
+ {...controlledProps}
2616
+ />
2617
+ );
2618
+ };
2619
+
2620
+ export type PromptInputHeaderProps = Omit<ComponentProps<typeof InputGroupAddon>, "align">;
2621
+
2622
+ export const PromptInputHeader = ({ className, ...props }: PromptInputHeaderProps) => (
2623
+ <InputGroupAddon
2624
+ align="block-end"
2625
+ className={cn("order-first flex-wrap gap-1", className)}
2626
+ {...props}
2627
+ />
2628
+ );
2629
+
2630
+ export type PromptInputFooterProps = Omit<ComponentProps<typeof InputGroupAddon>, "align">;
2631
+
2632
+ export const PromptInputFooter = ({ className, ...props }: PromptInputFooterProps) => (
2633
+ <InputGroupAddon
2634
+ align="block-end"
2635
+ className={cn("justify-between gap-1", className)}
2636
+ {...props}
2637
+ />
2638
+ );
2639
+
2640
+ export type PromptInputToolsProps = HTMLAttributes<HTMLDivElement>;
2641
+
2642
+ export const PromptInputTools = ({ className, ...props }: PromptInputToolsProps) => (
2643
+ <div className={cn("flex min-w-0 items-center gap-1", className)} {...props} />
2644
+ );
2645
+
2646
+ export type PromptInputButtonTooltip =
2647
+ | string
2648
+ | {
2649
+ content: ReactNode;
2650
+ shortcut?: string;
2651
+ side?: ComponentProps<typeof TooltipContent>["side"];
2652
+ };
2653
+
2654
+ export type PromptInputButtonProps = ComponentProps<typeof InputGroupButton> & {
2655
+ tooltip?: PromptInputButtonTooltip;
2656
+ };
2657
+
2658
+ export const PromptInputButton = ({
2659
+ variant = "ghost",
2660
+ className,
2661
+ size,
2662
+ tooltip,
2663
+ ...props
2664
+ }: PromptInputButtonProps) => {
2665
+ const newSize = size ?? (Children.count(props.children) > 1 ? "sm" : "icon-sm");
2666
+
2667
+ const button = (
2668
+ <InputGroupButton
2669
+ className={cn(className)}
2670
+ size={newSize}
2671
+ type="button"
2672
+ variant={variant}
2673
+ {...props}
2674
+ />
2675
+ );
2676
+
2677
+ if (!tooltip) {
2678
+ return button;
2679
+ }
2680
+
2681
+ const tooltipContent = typeof tooltip === "string" ? tooltip : tooltip.content;
2682
+ const shortcut = typeof tooltip === "string" ? undefined : tooltip.shortcut;
2683
+ const side = typeof tooltip === "string" ? "top" : (tooltip.side ?? "top");
2684
+
2685
+ return (
2686
+ <Tooltip>
2687
+ <TooltipTrigger asChild>{button}</TooltipTrigger>
2688
+ <TooltipContent side={side}>
2689
+ {tooltipContent}
2690
+ {shortcut && <span className="ml-2 text-muted-foreground">{shortcut}</span>}
2691
+ </TooltipContent>
2692
+ </Tooltip>
2693
+ );
2694
+ };
2695
+
2696
+ export type PromptInputActionMenuProps = ComponentProps<typeof DropdownMenu>;
2697
+ export const PromptInputActionMenu = (props: PromptInputActionMenuProps) => (
2698
+ <DropdownMenu {...props} />
2699
+ );
2700
+
2701
+ export type PromptInputActionMenuTriggerProps = PromptInputButtonProps;
2702
+
2703
+ export const PromptInputActionMenuTrigger = ({
2704
+ className,
2705
+ children,
2706
+ ...props
2707
+ }: PromptInputActionMenuTriggerProps) => (
2708
+ <DropdownMenuTrigger asChild>
2709
+ <PromptInputButton className={className} {...props}>
2710
+ {children ?? <PlusIcon className="size-4" />}
2711
+ </PromptInputButton>
2712
+ </DropdownMenuTrigger>
2713
+ );
2714
+
2715
+ export type PromptInputActionMenuContentProps = ComponentProps<typeof DropdownMenuContent>;
2716
+ export const PromptInputActionMenuContent = ({
2717
+ className,
2718
+ ...props
2719
+ }: PromptInputActionMenuContentProps) => (
2720
+ <DropdownMenuContent align="start" className={cn(className)} {...props} />
2721
+ );
2722
+
2723
+ export type PromptInputActionMenuItemProps = ComponentProps<typeof DropdownMenuItem>;
2724
+ export const PromptInputActionMenuItem = ({
2725
+ className,
2726
+ ...props
2727
+ }: PromptInputActionMenuItemProps) => <DropdownMenuItem className={cn(className)} {...props} />;
2728
+
2729
+ // Note: Actions that perform side-effects (like opening a file dialog)
2730
+ // are provided in opt-in modules (e.g., prompt-input-attachments).
2731
+
2732
+ export type PromptInputSubmitProps = ComponentProps<typeof InputGroupButton> & {
2733
+ status?: ChatStatus;
2734
+ onStop?: () => void;
2735
+ };
2736
+
2737
+ export const PromptInputSubmit = ({
2738
+ className,
2739
+ variant = "default",
2740
+ size = "icon-sm",
2741
+ status,
2742
+ onStop,
2743
+ onClick,
2744
+ children,
2745
+ ...props
2746
+ }: PromptInputSubmitProps) => {
2747
+ const isGenerating = status === "submitted" || status === "streaming";
2748
+
2749
+ let Icon = <ArrowUpIcon className="size-4" />;
2750
+
2751
+ if (status === "submitted") {
2752
+ Icon = <Spinner />;
2753
+ } else if (status === "streaming") {
2754
+ Icon = <SquareIcon className="size-4" />;
2755
+ } else if (status === "error") {
2756
+ Icon = <XIcon className="size-4" />;
2757
+ }
2758
+
2759
+ const handleClick = useCallback(
2760
+ (e: React.MouseEvent<HTMLButtonElement>) => {
2761
+ if (isGenerating && onStop) {
2762
+ e.preventDefault();
2763
+ onStop();
2764
+ return;
2765
+ }
2766
+ onClick?.(e);
2767
+ },
2768
+ [isGenerating, onStop, onClick],
2769
+ );
2770
+
2771
+ return (
2772
+ <InputGroupButton
2773
+ aria-label={isGenerating ? "Stop" : "Submit"}
2774
+ className={cn("absolute right-2.5 bottom-2.5 rounded-full", className)}
2775
+ onClick={handleClick}
2776
+ size={size}
2777
+ type={isGenerating && onStop ? "button" : "submit"}
2778
+ variant={variant}
2779
+ {...props}
2780
+ >
2781
+ {children ?? Icon}
2782
+ </InputGroupButton>
2783
+ );
2784
+ };
2785
+
2786
+ export type PromptInputSelectProps = ComponentProps<typeof Select>;
2787
+
2788
+ export const PromptInputSelect = (props: PromptInputSelectProps) => <Select {...props} />;
2789
+
2790
+ export type PromptInputSelectTriggerProps = ComponentProps<typeof SelectTrigger>;
2791
+
2792
+ export const PromptInputSelectTrigger = ({
2793
+ className,
2794
+ ...props
2795
+ }: PromptInputSelectTriggerProps) => (
2796
+ <SelectTrigger
2797
+ className={cn(
2798
+ "border-none bg-transparent font-medium text-muted-foreground shadow-none transition-colors",
2799
+ "hover:bg-accent hover:text-foreground aria-expanded:bg-accent aria-expanded:text-foreground",
2800
+ className,
2801
+ )}
2802
+ {...props}
2803
+ />
2804
+ );
2805
+
2806
+ export type PromptInputSelectContentProps = ComponentProps<typeof SelectContent>;
2807
+
2808
+ export const PromptInputSelectContent = ({
2809
+ className,
2810
+ ...props
2811
+ }: PromptInputSelectContentProps) => <SelectContent className={cn(className)} {...props} />;
2812
+
2813
+ export type PromptInputSelectItemProps = ComponentProps<typeof SelectItem>;
2814
+
2815
+ export const PromptInputSelectItem = ({ className, ...props }: PromptInputSelectItemProps) => (
2816
+ <SelectItem className={cn(className)} {...props} />
2817
+ );
2818
+
2819
+ export type PromptInputSelectValueProps = ComponentProps<typeof SelectValue>;
2820
+
2821
+ export const PromptInputSelectValue = ({ className, ...props }: PromptInputSelectValueProps) => (
2822
+ <SelectValue className={cn(className)} {...props} />
2823
+ );
2824
+
2825
+ export type PromptInputHoverCardProps = ComponentProps<typeof HoverCard>;
2826
+
2827
+ export const PromptInputHoverCard = ({
2828
+ openDelay = 0,
2829
+ closeDelay = 0,
2830
+ ...props
2831
+ }: PromptInputHoverCardProps) => (
2832
+ <HoverCard closeDelay={closeDelay} openDelay={openDelay} {...props} />
2833
+ );
2834
+
2835
+ export type PromptInputHoverCardTriggerProps = ComponentProps<typeof HoverCardTrigger>;
2836
+
2837
+ export const PromptInputHoverCardTrigger = (props: PromptInputHoverCardTriggerProps) => (
2838
+ <HoverCardTrigger {...props} />
2839
+ );
2840
+
2841
+ export type PromptInputHoverCardContentProps = ComponentProps<typeof HoverCardContent>;
2842
+
2843
+ export const PromptInputHoverCardContent = ({
2844
+ align = "start",
2845
+ ...props
2846
+ }: PromptInputHoverCardContentProps) => <HoverCardContent align={align} {...props} />;
2847
+
2848
+ export type PromptInputTabsListProps = HTMLAttributes<HTMLDivElement>;
2849
+
2850
+ export const PromptInputTabsList = ({ className, ...props }: PromptInputTabsListProps) => (
2851
+ <div className={cn(className)} {...props} />
2852
+ );
2853
+
2854
+ export type PromptInputTabProps = HTMLAttributes<HTMLDivElement>;
2855
+
2856
+ export const PromptInputTab = ({ className, ...props }: PromptInputTabProps) => (
2857
+ <div className={cn(className)} {...props} />
2858
+ );
2859
+
2860
+ export type PromptInputTabLabelProps = HTMLAttributes<HTMLHeadingElement>;
2861
+
2862
+ export const PromptInputTabLabel = ({ className, ...props }: PromptInputTabLabelProps) => (
2863
+ // Content provided via children in props
2864
+ // oxlint-disable-next-line eslint-plugin-jsx-a11y(heading-has-content)
2865
+ <h3 className={cn("mb-2 px-3 font-medium text-muted-foreground text-xs", className)} {...props} />
2866
+ );
2867
+
2868
+ export type PromptInputTabBodyProps = HTMLAttributes<HTMLDivElement>;
2869
+
2870
+ export const PromptInputTabBody = ({ className, ...props }: PromptInputTabBodyProps) => (
2871
+ <div className={cn("space-y-1", className)} {...props} />
2872
+ );
2873
+
2874
+ export type PromptInputTabItemProps = HTMLAttributes<HTMLDivElement>;
2875
+
2876
+ export const PromptInputTabItem = ({ className, ...props }: PromptInputTabItemProps) => (
2877
+ <div
2878
+ className={cn("flex items-center gap-2 px-3 py-2 text-xs hover:bg-accent", className)}
2879
+ {...props}
2880
+ />
2881
+ );
2882
+
2883
+ export type PromptInputCommandProps = ComponentProps<typeof Command>;
2884
+
2885
+ export const PromptInputCommand = ({ className, ...props }: PromptInputCommandProps) => (
2886
+ <Command className={cn(className)} {...props} />
2887
+ );
2888
+
2889
+ export type PromptInputCommandInputProps = ComponentProps<typeof CommandInput>;
2890
+
2891
+ export const PromptInputCommandInput = ({ className, ...props }: PromptInputCommandInputProps) => (
2892
+ <CommandInput className={cn(className)} {...props} />
2893
+ );
2894
+
2895
+ export type PromptInputCommandListProps = ComponentProps<typeof CommandList>;
2896
+
2897
+ export const PromptInputCommandList = ({ className, ...props }: PromptInputCommandListProps) => (
2898
+ <CommandList className={cn(className)} {...props} />
2899
+ );
2900
+
2901
+ export type PromptInputCommandEmptyProps = ComponentProps<typeof CommandEmpty>;
2902
+
2903
+ export const PromptInputCommandEmpty = ({ className, ...props }: PromptInputCommandEmptyProps) => (
2904
+ <CommandEmpty className={cn(className)} {...props} />
2905
+ );
2906
+
2907
+ export type PromptInputCommandGroupProps = ComponentProps<typeof CommandGroup>;
2908
+
2909
+ export const PromptInputCommandGroup = ({ className, ...props }: PromptInputCommandGroupProps) => (
2910
+ <CommandGroup className={cn(className)} {...props} />
2911
+ );
2912
+
2913
+ export type PromptInputCommandItemProps = ComponentProps<typeof CommandItem>;
2914
+
2915
+ export const PromptInputCommandItem = ({ className, ...props }: PromptInputCommandItemProps) => (
2916
+ <CommandItem className={cn(className)} {...props} />
2917
+ );
2918
+
2919
+ export type PromptInputCommandSeparatorProps = ComponentProps<typeof CommandSeparator>;
2920
+
2921
+ export const PromptInputCommandSeparator = ({
2922
+ className,
2923
+ ...props
2924
+ }: PromptInputCommandSeparatorProps) => <CommandSeparator className={cn(className)} {...props} />;
2925
+ `,"components/ai-elements/reasoning.tsx":`"use client";
2926
+
2927
+ import { useControllableState } from "@radix-ui/react-use-controllable-state";
2928
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
2929
+ import { cn } from "@/lib/utils";
2930
+ import { cjk } from "@streamdown/cjk";
2931
+ import { code } from "@streamdown/code";
2932
+ import { math } from "@streamdown/math";
2933
+ import { mermaid } from "@streamdown/mermaid";
2934
+ import { BrainIcon, ChevronDownIcon } from "lucide-react";
2935
+ import type { ComponentProps, ReactNode } from "react";
2936
+ import {
2937
+ createContext,
2938
+ memo,
2939
+ useCallback,
2940
+ useContext,
2941
+ useEffect,
2942
+ useMemo,
2943
+ useRef,
2944
+ useState,
2945
+ } from "react";
2946
+ import { Streamdown } from "streamdown";
2947
+
2948
+ import { Shimmer } from "./shimmer";
2949
+
2950
+ interface ReasoningContextValue {
2951
+ isStreaming: boolean;
2952
+ isOpen: boolean;
2953
+ setIsOpen: (open: boolean) => void;
2954
+ duration: number | undefined;
2955
+ }
2956
+
2957
+ const ReasoningContext = createContext<ReasoningContextValue | null>(null);
2958
+
2959
+ export const useReasoning = () => {
2960
+ const context = useContext(ReasoningContext);
2961
+ if (!context) {
2962
+ throw new Error("Reasoning components must be used within Reasoning");
2963
+ }
2964
+ return context;
2965
+ };
2966
+
2967
+ export type ReasoningProps = ComponentProps<typeof Collapsible> & {
2968
+ isStreaming?: boolean;
2969
+ open?: boolean;
2970
+ defaultOpen?: boolean;
2971
+ onOpenChange?: (open: boolean) => void;
2972
+ duration?: number;
2973
+ };
2974
+
2975
+ const AUTO_CLOSE_DELAY = 1000;
2976
+ const MS_IN_S = 1000;
2977
+
2978
+ export const Reasoning = memo(
2979
+ ({
2980
+ className,
2981
+ isStreaming = false,
2982
+ open,
2983
+ defaultOpen,
2984
+ onOpenChange,
2985
+ duration: durationProp,
2986
+ children,
2987
+ ...props
2988
+ }: ReasoningProps) => {
2989
+ const resolvedDefaultOpen = defaultOpen ?? isStreaming;
2990
+ // Track if defaultOpen was explicitly set to false (to prevent auto-open)
2991
+ const isExplicitlyClosed = defaultOpen === false;
2992
+
2993
+ const [isOpen, setIsOpen] = useControllableState<boolean>({
2994
+ defaultProp: resolvedDefaultOpen,
2995
+ onChange: onOpenChange,
2996
+ prop: open,
2997
+ });
2998
+ const [duration, setDuration] = useControllableState<number | undefined>({
2999
+ defaultProp: undefined,
3000
+ prop: durationProp,
3001
+ });
3002
+
3003
+ const hasEverStreamedRef = useRef(isStreaming);
3004
+ const [hasAutoClosed, setHasAutoClosed] = useState(false);
3005
+ const startTimeRef = useRef<number | null>(null);
3006
+
3007
+ // Track when streaming starts and compute duration
3008
+ useEffect(() => {
3009
+ if (isStreaming) {
3010
+ hasEverStreamedRef.current = true;
3011
+ if (startTimeRef.current === null) {
3012
+ startTimeRef.current = Date.now();
3013
+ }
3014
+ } else if (startTimeRef.current !== null) {
3015
+ setDuration(Math.ceil((Date.now() - startTimeRef.current) / MS_IN_S));
3016
+ startTimeRef.current = null;
3017
+ }
3018
+ }, [isStreaming, setDuration]);
3019
+
3020
+ // Auto-open when streaming starts (unless explicitly closed)
3021
+ useEffect(() => {
3022
+ if (isStreaming && !isOpen && !isExplicitlyClosed) {
3023
+ setIsOpen(true);
3024
+ }
3025
+ }, [isStreaming, isOpen, setIsOpen, isExplicitlyClosed]);
3026
+
3027
+ // Auto-close when streaming ends (once only, and only if it ever streamed)
3028
+ useEffect(() => {
3029
+ if (hasEverStreamedRef.current && !isStreaming && isOpen && !hasAutoClosed) {
3030
+ const timer = setTimeout(() => {
3031
+ setIsOpen(false);
3032
+ setHasAutoClosed(true);
3033
+ }, AUTO_CLOSE_DELAY);
3034
+
3035
+ return () => clearTimeout(timer);
3036
+ }
3037
+ }, [isStreaming, isOpen, setIsOpen, hasAutoClosed]);
3038
+
3039
+ const handleOpenChange = useCallback(
3040
+ (newOpen: boolean) => {
3041
+ setIsOpen(newOpen);
3042
+ },
3043
+ [setIsOpen],
3044
+ );
3045
+
3046
+ const contextValue = useMemo(
3047
+ () => ({ duration, isOpen, isStreaming, setIsOpen }),
3048
+ [duration, isOpen, isStreaming, setIsOpen],
3049
+ );
3050
+
3051
+ return (
3052
+ <ReasoningContext.Provider value={contextValue}>
3053
+ <Collapsible
3054
+ className={cn("not-prose mb-4 w-full", className)}
3055
+ onOpenChange={handleOpenChange}
3056
+ open={isOpen}
3057
+ {...props}
3058
+ >
3059
+ {children}
3060
+ </Collapsible>
3061
+ </ReasoningContext.Provider>
3062
+ );
3063
+ },
3064
+ );
3065
+
3066
+ export type ReasoningTriggerProps = ComponentProps<typeof CollapsibleTrigger> & {
3067
+ getThinkingMessage?: (isStreaming: boolean, duration?: number) => ReactNode;
3068
+ };
3069
+
3070
+ const defaultGetThinkingMessage = (isStreaming: boolean, duration?: number) => {
3071
+ if (isStreaming || duration === 0) {
3072
+ return <Shimmer duration={1}>Thinking...</Shimmer>;
3073
+ }
3074
+ if (duration === undefined) {
3075
+ return <p>Thought for a few seconds</p>;
3076
+ }
3077
+ return <p>Thought for {duration} seconds</p>;
3078
+ };
3079
+
3080
+ export const ReasoningTrigger = memo(
3081
+ ({
3082
+ className,
3083
+ children,
3084
+ getThinkingMessage = defaultGetThinkingMessage,
3085
+ ...props
3086
+ }: ReasoningTriggerProps) => {
3087
+ const { isStreaming, isOpen, duration } = useReasoning();
3088
+
3089
+ return (
3090
+ <CollapsibleTrigger
3091
+ className={cn(
3092
+ "flex w-full items-center gap-2 text-muted-foreground text-sm transition-colors hover:text-foreground",
3093
+ className,
3094
+ )}
3095
+ {...props}
3096
+ >
3097
+ {children ?? (
3098
+ <>
3099
+ <BrainIcon className="size-4" />
3100
+ {getThinkingMessage(isStreaming, duration)}
3101
+ <ChevronDownIcon
3102
+ className={cn("size-4 transition-transform", isOpen ? "rotate-180" : "rotate-0")}
3103
+ />
3104
+ </>
3105
+ )}
3106
+ </CollapsibleTrigger>
3107
+ );
3108
+ },
3109
+ );
3110
+
3111
+ export type ReasoningContentProps = ComponentProps<typeof CollapsibleContent> & {
3112
+ children: string;
3113
+ };
3114
+
3115
+ const streamdownPlugins = { cjk, code, math, mermaid };
3116
+
3117
+ export const ReasoningContent = memo(({ className, children, ...props }: ReasoningContentProps) => (
3118
+ <CollapsibleContent
3119
+ className={cn(
3120
+ "mt-4 text-sm",
3121
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 text-muted-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
3122
+ className,
3123
+ )}
3124
+ {...props}
3125
+ >
3126
+ <Streamdown plugins={streamdownPlugins}>{children}</Streamdown>
3127
+ </CollapsibleContent>
3128
+ ));
3129
+
3130
+ Reasoning.displayName = "Reasoning";
3131
+ ReasoningTrigger.displayName = "ReasoningTrigger";
3132
+ ReasoningContent.displayName = "ReasoningContent";
3133
+ `,"components/ai-elements/shimmer.tsx":`"use client";
3134
+
3135
+ import { cn } from "@/lib/utils";
3136
+ import type { MotionProps } from "motion/react";
3137
+ import { motion } from "motion/react";
3138
+ import type { CSSProperties, ElementType, JSX } from "react";
3139
+ import { memo, useMemo } from "react";
3140
+
3141
+ type MotionHTMLProps = MotionProps & Record<string, unknown>;
3142
+
3143
+ // Cache motion components at module level to avoid creating during render
3144
+ const motionComponentCache = new Map<
3145
+ keyof JSX.IntrinsicElements,
3146
+ React.ComponentType<MotionHTMLProps>
3147
+ >();
3148
+
3149
+ const getMotionComponent = (element: keyof JSX.IntrinsicElements) => {
3150
+ let component = motionComponentCache.get(element);
3151
+ if (!component) {
3152
+ component = motion.create(element);
3153
+ motionComponentCache.set(element, component);
3154
+ }
3155
+ return component;
3156
+ };
3157
+
3158
+ export interface TextShimmerProps {
3159
+ children: string;
3160
+ as?: ElementType;
3161
+ className?: string;
3162
+ duration?: number;
3163
+ spread?: number;
3164
+ }
3165
+
3166
+ const ShimmerComponent = ({
3167
+ children,
3168
+ as: Component = "p",
3169
+ className,
3170
+ duration = 2,
3171
+ spread = 2,
3172
+ }: TextShimmerProps) => {
3173
+ const MotionComponent = getMotionComponent(Component as keyof JSX.IntrinsicElements);
3174
+
3175
+ const dynamicSpread = useMemo(() => (children?.length ?? 0) * spread, [children, spread]);
3176
+
3177
+ return (
3178
+ <MotionComponent
3179
+ animate={{ backgroundPosition: "0% center" }}
3180
+ className={cn(
3181
+ "relative inline-block bg-[length:250%_100%,auto] bg-clip-text text-transparent",
3182
+ "[--bg:linear-gradient(90deg,#0000_calc(50%-var(--spread)),var(--color-background),#0000_calc(50%+var(--spread)))] [background-repeat:no-repeat,padding-box]",
3183
+ className,
3184
+ )}
3185
+ initial={{ backgroundPosition: "100% center" }}
3186
+ style={
3187
+ {
3188
+ "--spread": \`\${dynamicSpread}px\`,
3189
+ backgroundImage:
3190
+ "var(--bg), linear-gradient(var(--color-muted-foreground), var(--color-muted-foreground))",
3191
+ } as CSSProperties
3192
+ }
3193
+ transition={{
3194
+ duration,
3195
+ ease: "linear",
3196
+ repeat: Number.POSITIVE_INFINITY,
3197
+ }}
3198
+ >
3199
+ {children}
3200
+ </MotionComponent>
3201
+ );
3202
+ };
3203
+
3204
+ export const Shimmer = memo(ShimmerComponent);
3205
+ `,"components/ai-elements/tool.tsx":`"use client";
3206
+
3207
+ import { Badge } from "@/components/ui/badge";
3208
+ import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@/components/ui/collapsible";
3209
+ import { cn } from "@/lib/utils";
3210
+ import type { DynamicToolUIPart, ToolUIPart } from "ai";
3211
+ import {
3212
+ CheckCircleIcon,
3213
+ ChevronDownIcon,
3214
+ CircleIcon,
3215
+ ClockIcon,
3216
+ WrenchIcon,
3217
+ XCircleIcon,
3218
+ } from "lucide-react";
3219
+ import type { ComponentProps, ReactNode } from "react";
3220
+ import { isValidElement } from "react";
3221
+
3222
+ import { CodeBlock } from "./code-block";
3223
+
3224
+ export type ToolProps = ComponentProps<typeof Collapsible>;
3225
+
3226
+ export const Tool = ({ className, ...props }: ToolProps) => (
3227
+ <Collapsible
3228
+ className={cn("group not-prose mb-4 w-full rounded-md border", className)}
3229
+ {...props}
3230
+ />
3231
+ );
3232
+
3233
+ export type ToolPart = ToolUIPart | DynamicToolUIPart;
3234
+
3235
+ export type ToolHeaderProps = {
3236
+ title?: string;
3237
+ className?: string;
3238
+ } & (
3239
+ | { type: ToolUIPart["type"]; state: ToolUIPart["state"]; toolName?: never }
3240
+ | {
3241
+ type: DynamicToolUIPart["type"];
3242
+ state: DynamicToolUIPart["state"];
3243
+ toolName: string;
3244
+ }
3245
+ );
3246
+
3247
+ const statusLabels: Record<ToolPart["state"], string> = {
3248
+ "approval-requested": "Awaiting Approval",
3249
+ "approval-responded": "Responded",
3250
+ "input-available": "Running",
3251
+ "input-streaming": "Pending",
3252
+ "output-available": "Completed",
3253
+ "output-denied": "Denied",
3254
+ "output-error": "Error",
3255
+ };
3256
+
3257
+ const statusIcons: Record<ToolPart["state"], ReactNode> = {
3258
+ "approval-requested": <ClockIcon className="size-4 text-yellow-600" />,
3259
+ "approval-responded": <CheckCircleIcon className="size-4 text-blue-600" />,
3260
+ "input-available": <ClockIcon className="size-4 animate-pulse" />,
3261
+ "input-streaming": <CircleIcon className="size-4" />,
3262
+ "output-available": <CheckCircleIcon className="size-4 text-green-600" />,
3263
+ "output-denied": <XCircleIcon className="size-4 text-orange-600" />,
3264
+ "output-error": <XCircleIcon className="size-4 text-red-600" />,
3265
+ };
3266
+
3267
+ export const getStatusBadge = (status: ToolPart["state"]) => (
3268
+ <Badge className="gap-1.5 rounded-full text-xs" variant="secondary">
3269
+ {statusIcons[status]}
3270
+ {statusLabels[status]}
3271
+ </Badge>
3272
+ );
3273
+
3274
+ export const ToolHeader = ({
3275
+ className,
3276
+ title,
3277
+ type,
3278
+ state,
3279
+ toolName,
3280
+ ...props
3281
+ }: ToolHeaderProps) => {
3282
+ const derivedName = type === "dynamic-tool" ? toolName : type.split("-").slice(1).join("-");
3283
+
3284
+ return (
3285
+ <CollapsibleTrigger
3286
+ className={cn("flex w-full items-center justify-between gap-4 p-3", className)}
3287
+ {...props}
3288
+ >
3289
+ <div className="flex items-center gap-2">
3290
+ <WrenchIcon className="size-4 text-muted-foreground" />
3291
+ <span className="font-medium text-sm">{title ?? derivedName}</span>
3292
+ {getStatusBadge(state)}
3293
+ </div>
3294
+ <ChevronDownIcon className="size-4 text-muted-foreground transition-transform group-data-[state=open]:rotate-180" />
3295
+ </CollapsibleTrigger>
3296
+ );
3297
+ };
3298
+
3299
+ export type ToolContentProps = ComponentProps<typeof CollapsibleContent>;
3300
+
3301
+ export const ToolContent = ({ className, ...props }: ToolContentProps) => (
3302
+ <CollapsibleContent
3303
+ className={cn(
3304
+ "data-[state=closed]:fade-out-0 data-[state=closed]:slide-out-to-top-2 data-[state=open]:slide-in-from-top-2 space-y-4 p-4 text-popover-foreground outline-none data-[state=closed]:animate-out data-[state=open]:animate-in",
3305
+ className,
3306
+ )}
3307
+ {...props}
3308
+ />
3309
+ );
3310
+
3311
+ export type ToolInputProps = ComponentProps<"div"> & {
3312
+ input: ToolPart["input"];
3313
+ };
3314
+
3315
+ export const ToolInput = ({ className, input, ...props }: ToolInputProps) => (
3316
+ <div className={cn("space-y-2 overflow-hidden", className)} {...props}>
3317
+ <h4 className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
3318
+ Parameters
3319
+ </h4>
3320
+ <div className="rounded-md bg-muted/50">
3321
+ <CodeBlock code={JSON.stringify(input, null, 2)} language="json" />
3322
+ </div>
3323
+ </div>
3324
+ );
3325
+
3326
+ export type ToolOutputProps = ComponentProps<"div"> & {
3327
+ output: ToolPart["output"];
3328
+ errorText: ToolPart["errorText"];
3329
+ };
3330
+
3331
+ export const ToolOutput = ({ className, output, errorText, ...props }: ToolOutputProps) => {
3332
+ if (!(output || errorText)) {
3333
+ return null;
3334
+ }
3335
+
3336
+ let Output = <div>{output as ReactNode}</div>;
3337
+
3338
+ if (typeof output === "object" && !isValidElement(output)) {
3339
+ Output = <CodeBlock code={JSON.stringify(output, null, 2)} language="json" />;
3340
+ } else if (typeof output === "string") {
3341
+ Output = <CodeBlock code={output} language="json" />;
3342
+ }
3343
+
3344
+ return (
3345
+ <div className={cn("space-y-2", className)} {...props}>
3346
+ <h4 className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
3347
+ {errorText ? "Error" : "Result"}
3348
+ </h4>
3349
+ <div
3350
+ className={cn(
3351
+ "overflow-x-auto rounded-md text-xs [&_table]:w-full",
3352
+ errorText ? "bg-destructive/10 text-destructive" : "bg-muted/50 text-foreground",
3353
+ )}
3354
+ >
3355
+ {errorText && <div>{errorText}</div>}
3356
+ {Output}
3357
+ </div>
3358
+ </div>
3359
+ );
3360
+ };
3361
+ `,"components/ui/badge.tsx":`import * as React from "react";
3362
+ import { cva, type VariantProps } from "class-variance-authority";
3363
+ import { Slot } from "radix-ui";
3364
+
3365
+ import { cn } from "@/lib/utils";
3366
+
3367
+ const badgeVariants = cva(
3368
+ "inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-full border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3",
3369
+ {
3370
+ variants: {
3371
+ variant: {
3372
+ default: "bg-primary text-primary-foreground [a&]:hover:bg-primary/90",
3373
+ secondary: "bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",
3374
+ destructive:
3375
+ "bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90",
3376
+ outline:
3377
+ "border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
3378
+ ghost: "[a&]:hover:bg-accent [a&]:hover:text-accent-foreground",
3379
+ link: "text-primary underline-offset-4 [a&]:hover:underline",
3380
+ },
3381
+ },
3382
+ defaultVariants: {
3383
+ variant: "default",
3384
+ },
3385
+ },
3386
+ );
3387
+
3388
+ function Badge({
3389
+ className,
3390
+ variant = "default",
3391
+ asChild = false,
3392
+ ...props
3393
+ }: React.ComponentProps<"span"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
3394
+ const Comp = asChild ? Slot.Root : "span";
3395
+
3396
+ return (
3397
+ <Comp
3398
+ data-slot="badge"
3399
+ data-variant={variant}
3400
+ className={cn(badgeVariants({ variant }), className)}
3401
+ {...props}
3402
+ />
3403
+ );
3404
+ }
3405
+
3406
+ export { Badge, badgeVariants };
3407
+ `,"components/ui/button-group.tsx":`import { cva, type VariantProps } from "class-variance-authority";
3408
+ import { Slot } from "radix-ui";
3409
+
3410
+ import { cn } from "@/lib/utils";
3411
+ import { Separator } from "@/components/ui/separator";
3412
+
3413
+ const buttonGroupVariants = cva(
3414
+ "flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-2 [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-r-md [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
3415
+ {
3416
+ variants: {
3417
+ orientation: {
3418
+ horizontal:
3419
+ "[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none",
3420
+ vertical:
3421
+ "flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none",
3422
+ },
3423
+ },
3424
+ defaultVariants: {
3425
+ orientation: "horizontal",
3426
+ },
3427
+ },
3428
+ );
3429
+
3430
+ function ButtonGroup({
3431
+ className,
3432
+ orientation,
3433
+ ...props
3434
+ }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>) {
3435
+ return (
3436
+ <div
3437
+ role="group"
3438
+ data-slot="button-group"
3439
+ data-orientation={orientation}
3440
+ className={cn(buttonGroupVariants({ orientation }), className)}
3441
+ {...props}
3442
+ />
3443
+ );
3444
+ }
3445
+
3446
+ function ButtonGroupText({
3447
+ className,
3448
+ asChild = false,
3449
+ ...props
3450
+ }: React.ComponentProps<"div"> & {
3451
+ asChild?: boolean;
3452
+ }) {
3453
+ const Comp = asChild ? Slot.Root : "div";
3454
+
3455
+ return (
3456
+ <Comp
3457
+ className={cn(
3458
+ "flex items-center gap-2 rounded-md border bg-muted px-4 text-sm font-medium shadow-xs [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
3459
+ className,
3460
+ )}
3461
+ {...props}
3462
+ />
3463
+ );
3464
+ }
3465
+
3466
+ function ButtonGroupSeparator({
3467
+ className,
3468
+ orientation = "vertical",
3469
+ ...props
3470
+ }: React.ComponentProps<typeof Separator>) {
3471
+ return (
3472
+ <Separator
3473
+ data-slot="button-group-separator"
3474
+ orientation={orientation}
3475
+ className={cn(
3476
+ "relative m-0! self-stretch bg-input data-[orientation=vertical]:h-auto",
3477
+ className,
3478
+ )}
3479
+ {...props}
3480
+ />
3481
+ );
3482
+ }
3483
+
3484
+ export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
3485
+ `,"components/ui/button.tsx":`import * as React from "react";
3486
+ import { cva, type VariantProps } from "class-variance-authority";
3487
+ import { Slot } from "radix-ui";
3488
+
3489
+ import { cn } from "@/lib/utils";
3490
+
3491
+ const buttonVariants = cva(
3492
+ "inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
3493
+ {
3494
+ variants: {
3495
+ variant: {
3496
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
3497
+ destructive:
3498
+ "bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",
3499
+ outline:
3500
+ "border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",
3501
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
3502
+ ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",
3503
+ link: "text-primary underline-offset-4 hover:underline",
3504
+ },
3505
+ size: {
3506
+ default: "h-9 px-4 py-2 has-[>svg]:px-3",
3507
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
3508
+ sm: "h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",
3509
+ lg: "h-10 rounded-md px-6 has-[>svg]:px-4",
3510
+ icon: "size-9",
3511
+ "icon-xs": "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
3512
+ "icon-sm": "size-8",
3513
+ "icon-lg": "size-10",
3514
+ },
3515
+ },
3516
+ defaultVariants: {
3517
+ variant: "default",
3518
+ size: "default",
3519
+ },
3520
+ },
3521
+ );
3522
+
3523
+ function Button({
3524
+ className,
3525
+ variant = "default",
3526
+ size = "default",
3527
+ asChild = false,
3528
+ ...props
3529
+ }: React.ComponentProps<"button"> &
3530
+ VariantProps<typeof buttonVariants> & {
3531
+ asChild?: boolean;
3532
+ }) {
3533
+ const Comp = asChild ? Slot.Root : "button";
3534
+
3535
+ return (
3536
+ <Comp
3537
+ data-slot="button"
3538
+ data-variant={variant}
3539
+ data-size={size}
3540
+ className={cn(buttonVariants({ variant, size, className }))}
3541
+ {...props}
3542
+ />
3543
+ );
3544
+ }
3545
+
3546
+ export { Button, buttonVariants };
3547
+ `,"components/ui/collapsible.tsx":`"use client";
3548
+
3549
+ import { Collapsible as CollapsiblePrimitive } from "radix-ui";
3550
+
3551
+ function Collapsible({ ...props }: React.ComponentProps<typeof CollapsiblePrimitive.Root>) {
3552
+ return <CollapsiblePrimitive.Root data-slot="collapsible" {...props} />;
3553
+ }
3554
+
3555
+ function CollapsibleTrigger({
3556
+ ...props
3557
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleTrigger>) {
3558
+ return <CollapsiblePrimitive.CollapsibleTrigger data-slot="collapsible-trigger" {...props} />;
3559
+ }
3560
+
3561
+ function CollapsibleContent({
3562
+ ...props
3563
+ }: React.ComponentProps<typeof CollapsiblePrimitive.CollapsibleContent>) {
3564
+ return <CollapsiblePrimitive.CollapsibleContent data-slot="collapsible-content" {...props} />;
3565
+ }
3566
+
3567
+ export { Collapsible, CollapsibleTrigger, CollapsibleContent };
3568
+ `,"components/ui/command.tsx":`"use client";
3569
+
3570
+ import * as React from "react";
3571
+ import { Command as CommandPrimitive } from "cmdk";
3572
+ import { SearchIcon } from "lucide-react";
3573
+
3574
+ import { cn } from "@/lib/utils";
3575
+ import {
3576
+ Dialog,
3577
+ DialogContent,
3578
+ DialogDescription,
3579
+ DialogHeader,
3580
+ DialogTitle,
3581
+ } from "@/components/ui/dialog";
3582
+
3583
+ function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
3584
+ return (
3585
+ <CommandPrimitive
3586
+ data-slot="command"
3587
+ className={cn(
3588
+ "flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",
3589
+ className,
3590
+ )}
3591
+ {...props}
3592
+ />
3593
+ );
3594
+ }
3595
+
3596
+ function CommandDialog({
3597
+ title = "Command Palette",
3598
+ description = "Search for a command to run...",
3599
+ children,
3600
+ className,
3601
+ showCloseButton = true,
3602
+ ...props
3603
+ }: React.ComponentProps<typeof Dialog> & {
3604
+ title?: string;
3605
+ description?: string;
3606
+ className?: string;
3607
+ showCloseButton?: boolean;
3608
+ }) {
3609
+ return (
3610
+ <Dialog {...props}>
3611
+ <DialogHeader className="sr-only">
3612
+ <DialogTitle>{title}</DialogTitle>
3613
+ <DialogDescription>{description}</DialogDescription>
3614
+ </DialogHeader>
3615
+ <DialogContent
3616
+ className={cn("overflow-hidden p-0", className)}
3617
+ showCloseButton={showCloseButton}
3618
+ >
3619
+ <Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
3620
+ {children}
3621
+ </Command>
3622
+ </DialogContent>
3623
+ </Dialog>
3624
+ );
3625
+ }
3626
+
3627
+ function CommandInput({
3628
+ className,
3629
+ ...props
3630
+ }: React.ComponentProps<typeof CommandPrimitive.Input>) {
3631
+ return (
3632
+ <div data-slot="command-input-wrapper" className="flex h-9 items-center gap-2 border-b px-3">
3633
+ <SearchIcon className="size-4 shrink-0 opacity-50" />
3634
+ <CommandPrimitive.Input
3635
+ data-slot="command-input"
3636
+ className={cn(
3637
+ "flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",
3638
+ className,
3639
+ )}
3640
+ {...props}
3641
+ />
3642
+ </div>
3643
+ );
3644
+ }
3645
+
3646
+ function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
3647
+ return (
3648
+ <CommandPrimitive.List
3649
+ data-slot="command-list"
3650
+ className={cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className)}
3651
+ {...props}
3652
+ />
3653
+ );
3654
+ }
3655
+
3656
+ function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
3657
+ return (
3658
+ <CommandPrimitive.Empty
3659
+ data-slot="command-empty"
3660
+ className="py-6 text-center text-sm"
3661
+ {...props}
3662
+ />
3663
+ );
3664
+ }
3665
+
3666
+ function CommandGroup({
3667
+ className,
3668
+ ...props
3669
+ }: React.ComponentProps<typeof CommandPrimitive.Group>) {
3670
+ return (
3671
+ <CommandPrimitive.Group
3672
+ data-slot="command-group"
3673
+ className={cn(
3674
+ "overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",
3675
+ className,
3676
+ )}
3677
+ {...props}
3678
+ />
3679
+ );
3680
+ }
3681
+
3682
+ function CommandSeparator({
3683
+ className,
3684
+ ...props
3685
+ }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
3686
+ return (
3687
+ <CommandPrimitive.Separator
3688
+ data-slot="command-separator"
3689
+ className={cn("-mx-1 h-px bg-border", className)}
3690
+ {...props}
3691
+ />
3692
+ );
3693
+ }
3694
+
3695
+ function CommandItem({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
3696
+ return (
3697
+ <CommandPrimitive.Item
3698
+ data-slot="command-item"
3699
+ className={cn(
3700
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
3701
+ className,
3702
+ )}
3703
+ {...props}
3704
+ />
3705
+ );
3706
+ }
3707
+
3708
+ function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {
3709
+ return (
3710
+ <span
3711
+ data-slot="command-shortcut"
3712
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
3713
+ {...props}
3714
+ />
3715
+ );
3716
+ }
3717
+
3718
+ export {
3719
+ Command,
3720
+ CommandDialog,
3721
+ CommandInput,
3722
+ CommandList,
3723
+ CommandEmpty,
3724
+ CommandGroup,
3725
+ CommandItem,
3726
+ CommandShortcut,
3727
+ CommandSeparator,
3728
+ };
3729
+ `,"components/ui/dialog.tsx":`"use client";
3730
+
3731
+ import * as React from "react";
3732
+ import { XIcon } from "lucide-react";
3733
+ import { Dialog as DialogPrimitive } from "radix-ui";
3734
+
3735
+ import { cn } from "@/lib/utils";
3736
+ import { Button } from "@/components/ui/button";
3737
+
3738
+ function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
3739
+ return <DialogPrimitive.Root data-slot="dialog" {...props} />;
3740
+ }
3741
+
3742
+ function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>) {
3743
+ return <DialogPrimitive.Trigger data-slot="dialog-trigger" {...props} />;
3744
+ }
3745
+
3746
+ function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>) {
3747
+ return <DialogPrimitive.Portal data-slot="dialog-portal" {...props} />;
3748
+ }
3749
+
3750
+ function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>) {
3751
+ return <DialogPrimitive.Close data-slot="dialog-close" {...props} />;
3752
+ }
3753
+
3754
+ function DialogOverlay({
3755
+ className,
3756
+ ...props
3757
+ }: React.ComponentProps<typeof DialogPrimitive.Overlay>) {
3758
+ return (
3759
+ <DialogPrimitive.Overlay
3760
+ data-slot="dialog-overlay"
3761
+ className={cn(
3762
+ "fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0",
3763
+ className,
3764
+ )}
3765
+ {...props}
3766
+ />
3767
+ );
3768
+ }
3769
+
3770
+ function DialogContent({
3771
+ className,
3772
+ children,
3773
+ showCloseButton = true,
3774
+ ...props
3775
+ }: React.ComponentProps<typeof DialogPrimitive.Content> & {
3776
+ showCloseButton?: boolean;
3777
+ }) {
3778
+ return (
3779
+ <DialogPortal data-slot="dialog-portal">
3780
+ <DialogOverlay />
3781
+ <DialogPrimitive.Content
3782
+ data-slot="dialog-content"
3783
+ className={cn(
3784
+ "fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg",
3785
+ className,
3786
+ )}
3787
+ {...props}
3788
+ >
3789
+ {children}
3790
+ {showCloseButton && (
3791
+ <DialogPrimitive.Close
3792
+ data-slot="dialog-close"
3793
+ className="absolute top-4 right-4 rounded-xs opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:ring-2 focus:ring-ring focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
3794
+ >
3795
+ <XIcon />
3796
+ <span className="sr-only">Close</span>
3797
+ </DialogPrimitive.Close>
3798
+ )}
3799
+ </DialogPrimitive.Content>
3800
+ </DialogPortal>
3801
+ );
3802
+ }
3803
+
3804
+ function DialogHeader({ className, ...props }: React.ComponentProps<"div">) {
3805
+ return (
3806
+ <div
3807
+ data-slot="dialog-header"
3808
+ className={cn("flex flex-col gap-2 text-center sm:text-left", className)}
3809
+ {...props}
3810
+ />
3811
+ );
3812
+ }
3813
+
3814
+ function DialogFooter({
3815
+ className,
3816
+ showCloseButton = false,
3817
+ children,
3818
+ ...props
3819
+ }: React.ComponentProps<"div"> & {
3820
+ showCloseButton?: boolean;
3821
+ }) {
3822
+ return (
3823
+ <div
3824
+ data-slot="dialog-footer"
3825
+ className={cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", className)}
3826
+ {...props}
3827
+ >
3828
+ {children}
3829
+ {showCloseButton && (
3830
+ <DialogPrimitive.Close asChild>
3831
+ <Button variant="outline">Close</Button>
3832
+ </DialogPrimitive.Close>
3833
+ )}
3834
+ </div>
3835
+ );
3836
+ }
3837
+
3838
+ function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>) {
3839
+ return (
3840
+ <DialogPrimitive.Title
3841
+ data-slot="dialog-title"
3842
+ className={cn("text-lg leading-none font-semibold", className)}
3843
+ {...props}
3844
+ />
3845
+ );
3846
+ }
3847
+
3848
+ function DialogDescription({
3849
+ className,
3850
+ ...props
3851
+ }: React.ComponentProps<typeof DialogPrimitive.Description>) {
3852
+ return (
3853
+ <DialogPrimitive.Description
3854
+ data-slot="dialog-description"
3855
+ className={cn("text-sm text-muted-foreground", className)}
3856
+ {...props}
3857
+ />
3858
+ );
3859
+ }
3860
+
3861
+ export {
3862
+ Dialog,
3863
+ DialogClose,
3864
+ DialogContent,
3865
+ DialogDescription,
3866
+ DialogFooter,
3867
+ DialogHeader,
3868
+ DialogOverlay,
3869
+ DialogPortal,
3870
+ DialogTitle,
3871
+ DialogTrigger,
3872
+ };
3873
+ `,"components/ui/dropdown-menu.tsx":`"use client";
3874
+
3875
+ import * as React from "react";
3876
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from "lucide-react";
3877
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
3878
+
3879
+ import { cn } from "@/lib/utils";
3880
+
3881
+ function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>) {
3882
+ return <DropdownMenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
3883
+ }
3884
+
3885
+ function DropdownMenuPortal({
3886
+ ...props
3887
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>) {
3888
+ return <DropdownMenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
3889
+ }
3890
+
3891
+ function DropdownMenuTrigger({
3892
+ ...props
3893
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>) {
3894
+ return <DropdownMenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
3895
+ }
3896
+
3897
+ function DropdownMenuContent({
3898
+ className,
3899
+ sideOffset = 4,
3900
+ ...props
3901
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>) {
3902
+ return (
3903
+ <DropdownMenuPrimitive.Portal>
3904
+ <DropdownMenuPrimitive.Content
3905
+ data-slot="dropdown-menu-content"
3906
+ sideOffset={sideOffset}
3907
+ className={cn(
3908
+ "z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
3909
+ className,
3910
+ )}
3911
+ {...props}
3912
+ />
3913
+ </DropdownMenuPrimitive.Portal>
3914
+ );
3915
+ }
3916
+
3917
+ function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>) {
3918
+ return <DropdownMenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
3919
+ }
3920
+
3921
+ function DropdownMenuItem({
3922
+ className,
3923
+ inset,
3924
+ variant = "default",
3925
+ ...props
3926
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
3927
+ inset?: boolean;
3928
+ variant?: "default" | "destructive";
3929
+ }) {
3930
+ return (
3931
+ <DropdownMenuPrimitive.Item
3932
+ data-slot="dropdown-menu-item"
3933
+ data-inset={inset}
3934
+ data-variant={variant}
3935
+ className={cn(
3936
+ "relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!",
3937
+ className,
3938
+ )}
3939
+ {...props}
3940
+ />
3941
+ );
3942
+ }
3943
+
3944
+ function DropdownMenuCheckboxItem({
3945
+ className,
3946
+ children,
3947
+ checked,
3948
+ ...props
3949
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem>) {
3950
+ return (
3951
+ <DropdownMenuPrimitive.CheckboxItem
3952
+ data-slot="dropdown-menu-checkbox-item"
3953
+ className={cn(
3954
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
3955
+ className,
3956
+ )}
3957
+ checked={checked}
3958
+ {...props}
3959
+ >
3960
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
3961
+ <DropdownMenuPrimitive.ItemIndicator>
3962
+ <CheckIcon className="size-4" />
3963
+ </DropdownMenuPrimitive.ItemIndicator>
3964
+ </span>
3965
+ {children}
3966
+ </DropdownMenuPrimitive.CheckboxItem>
3967
+ );
3968
+ }
3969
+
3970
+ function DropdownMenuRadioGroup({
3971
+ ...props
3972
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>) {
3973
+ return <DropdownMenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
3974
+ }
3975
+
3976
+ function DropdownMenuRadioItem({
3977
+ className,
3978
+ children,
3979
+ ...props
3980
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem>) {
3981
+ return (
3982
+ <DropdownMenuPrimitive.RadioItem
3983
+ data-slot="dropdown-menu-radio-item"
3984
+ className={cn(
3985
+ "relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
3986
+ className,
3987
+ )}
3988
+ {...props}
3989
+ >
3990
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
3991
+ <DropdownMenuPrimitive.ItemIndicator>
3992
+ <CircleIcon className="size-2 fill-current" />
3993
+ </DropdownMenuPrimitive.ItemIndicator>
3994
+ </span>
3995
+ {children}
3996
+ </DropdownMenuPrimitive.RadioItem>
3997
+ );
3998
+ }
3999
+
4000
+ function DropdownMenuLabel({
4001
+ className,
4002
+ inset,
4003
+ ...props
4004
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
4005
+ inset?: boolean;
4006
+ }) {
4007
+ return (
4008
+ <DropdownMenuPrimitive.Label
4009
+ data-slot="dropdown-menu-label"
4010
+ data-inset={inset}
4011
+ className={cn("px-2 py-1.5 text-sm font-medium data-[inset]:pl-8", className)}
4012
+ {...props}
4013
+ />
4014
+ );
4015
+ }
4016
+
4017
+ function DropdownMenuSeparator({
4018
+ className,
4019
+ ...props
4020
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>) {
4021
+ return (
4022
+ <DropdownMenuPrimitive.Separator
4023
+ data-slot="dropdown-menu-separator"
4024
+ className={cn("-mx-1 my-1 h-px bg-border", className)}
4025
+ {...props}
4026
+ />
4027
+ );
4028
+ }
4029
+
4030
+ function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
4031
+ return (
4032
+ <span
4033
+ data-slot="dropdown-menu-shortcut"
4034
+ className={cn("ml-auto text-xs tracking-widest text-muted-foreground", className)}
4035
+ {...props}
4036
+ />
4037
+ );
4038
+ }
4039
+
4040
+ function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>) {
4041
+ return <DropdownMenuPrimitive.Sub data-slot="dropdown-menu-sub" {...props} />;
4042
+ }
4043
+
4044
+ function DropdownMenuSubTrigger({
4045
+ className,
4046
+ inset,
4047
+ children,
4048
+ ...props
4049
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
4050
+ inset?: boolean;
4051
+ }) {
4052
+ return (
4053
+ <DropdownMenuPrimitive.SubTrigger
4054
+ data-slot="dropdown-menu-sub-trigger"
4055
+ data-inset={inset}
4056
+ className={cn(
4057
+ "flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[inset]:pl-8 data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
4058
+ className,
4059
+ )}
4060
+ {...props}
4061
+ >
4062
+ {children}
4063
+ <ChevronRightIcon className="ml-auto size-4" />
4064
+ </DropdownMenuPrimitive.SubTrigger>
4065
+ );
4066
+ }
4067
+
4068
+ function DropdownMenuSubContent({
4069
+ className,
4070
+ ...props
4071
+ }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>) {
4072
+ return (
4073
+ <DropdownMenuPrimitive.SubContent
4074
+ data-slot="dropdown-menu-sub-content"
4075
+ className={cn(
4076
+ "z-50 min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
4077
+ className,
4078
+ )}
4079
+ {...props}
4080
+ />
4081
+ );
4082
+ }
4083
+
4084
+ export {
4085
+ DropdownMenu,
4086
+ DropdownMenuPortal,
4087
+ DropdownMenuTrigger,
4088
+ DropdownMenuContent,
4089
+ DropdownMenuGroup,
4090
+ DropdownMenuLabel,
4091
+ DropdownMenuItem,
4092
+ DropdownMenuCheckboxItem,
4093
+ DropdownMenuRadioGroup,
4094
+ DropdownMenuRadioItem,
4095
+ DropdownMenuSeparator,
4096
+ DropdownMenuShortcut,
4097
+ DropdownMenuSub,
4098
+ DropdownMenuSubTrigger,
4099
+ DropdownMenuSubContent,
4100
+ };
4101
+ `,"components/ui/hover-card.tsx":`"use client";
4102
+
4103
+ import * as React from "react";
4104
+ import { HoverCard as HoverCardPrimitive } from "radix-ui";
4105
+
4106
+ import { cn } from "@/lib/utils";
4107
+
4108
+ function HoverCard({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Root>) {
4109
+ return <HoverCardPrimitive.Root data-slot="hover-card" {...props} />;
4110
+ }
4111
+
4112
+ function HoverCardTrigger({ ...props }: React.ComponentProps<typeof HoverCardPrimitive.Trigger>) {
4113
+ return <HoverCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />;
4114
+ }
4115
+
4116
+ function HoverCardContent({
4117
+ className,
4118
+ align = "center",
4119
+ sideOffset = 4,
4120
+ ...props
4121
+ }: React.ComponentProps<typeof HoverCardPrimitive.Content>) {
4122
+ return (
4123
+ <HoverCardPrimitive.Portal data-slot="hover-card-portal">
4124
+ <HoverCardPrimitive.Content
4125
+ data-slot="hover-card-content"
4126
+ align={align}
4127
+ sideOffset={sideOffset}
4128
+ className={cn(
4129
+ "z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-hidden data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
4130
+ className,
4131
+ )}
4132
+ {...props}
4133
+ />
4134
+ </HoverCardPrimitive.Portal>
4135
+ );
4136
+ }
4137
+
4138
+ export { HoverCard, HoverCardTrigger, HoverCardContent };
4139
+ `,"components/ui/input-group.tsx":`"use client";
4140
+
4141
+ import * as React from "react";
4142
+ import { cva, type VariantProps } from "class-variance-authority";
4143
+
4144
+ import { cn } from "@/lib/utils";
4145
+ import { Button } from "@/components/ui/button";
4146
+ import { Input } from "@/components/ui/input";
4147
+ import { Textarea } from "@/components/ui/textarea";
4148
+
4149
+ function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
4150
+ return (
4151
+ <div
4152
+ data-slot="input-group"
4153
+ role="group"
4154
+ className={cn(
4155
+ "group/input-group relative flex w-full items-center rounded-md border border-input shadow-xs transition-[color,box-shadow] outline-none dark:bg-input/30",
4156
+ "h-9 min-w-0 has-[>textarea]:h-auto",
4157
+
4158
+ // Variants based on alignment.
4159
+ "has-[>[data-align=inline-start]]:[&>input]:pl-2",
4160
+ "has-[>[data-align=inline-end]]:[&>input]:pr-2",
4161
+ "has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-start]]:[&>input]:pb-3",
4162
+ "has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3",
4163
+
4164
+ // Focus state.
4165
+ "has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-[3px] has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50",
4166
+
4167
+ // Error state.
4168
+ "has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-destructive/20 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",
4169
+
4170
+ className,
4171
+ )}
4172
+ {...props}
4173
+ />
4174
+ );
4175
+ }
4176
+
4177
+ const inputGroupAddonVariants = cva(
4178
+ "flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4",
4179
+ {
4180
+ variants: {
4181
+ align: {
4182
+ "inline-start": "order-first pl-3 has-[>button]:ml-[-0.45rem] has-[>kbd]:ml-[-0.35rem]",
4183
+ "inline-end": "order-last pr-3 has-[>button]:mr-[-0.45rem] has-[>kbd]:mr-[-0.35rem]",
4184
+ "block-start":
4185
+ "order-first w-full justify-start px-3 pt-3 group-has-[>input]/input-group:pt-2.5 [.border-b]:pb-3",
4186
+ "block-end":
4187
+ "order-last w-full justify-start px-3 pb-3 group-has-[>input]/input-group:pb-2.5 [.border-t]:pt-3",
4188
+ },
4189
+ },
4190
+ defaultVariants: {
4191
+ align: "inline-start",
4192
+ },
4193
+ },
4194
+ );
4195
+
4196
+ function InputGroupAddon({
4197
+ className,
4198
+ align = "inline-start",
4199
+ ...props
4200
+ }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
4201
+ return (
4202
+ <div
4203
+ role="group"
4204
+ data-slot="input-group-addon"
4205
+ data-align={align}
4206
+ className={cn(inputGroupAddonVariants({ align }), className)}
4207
+ onClick={(e) => {
4208
+ if ((e.target as HTMLElement).closest("button")) {
4209
+ return;
4210
+ }
4211
+ e.currentTarget.parentElement?.querySelector("input")?.focus();
4212
+ }}
4213
+ {...props}
4214
+ />
4215
+ );
4216
+ }
4217
+
4218
+ const inputGroupButtonVariants = cva("flex items-center gap-2 text-sm shadow-none", {
4219
+ variants: {
4220
+ size: {
4221
+ xs: "h-6 gap-1 rounded-[calc(var(--radius)-5px)] px-2 has-[>svg]:px-2 [&>svg:not([class*='size-'])]:size-3.5",
4222
+ sm: "h-8 gap-1.5 rounded-md px-2.5 has-[>svg]:px-2.5",
4223
+ "icon-xs": "size-6 rounded-[calc(var(--radius)-5px)] p-0 has-[>svg]:p-0",
4224
+ "icon-sm": "size-8 p-0 has-[>svg]:p-0",
4225
+ },
4226
+ },
4227
+ defaultVariants: {
4228
+ size: "xs",
4229
+ },
4230
+ });
4231
+
4232
+ function InputGroupButton({
4233
+ className,
4234
+ type = "button",
4235
+ variant = "ghost",
4236
+ size = "xs",
4237
+ ...props
4238
+ }: Omit<React.ComponentProps<typeof Button>, "size"> &
4239
+ VariantProps<typeof inputGroupButtonVariants>) {
4240
+ return (
4241
+ <Button
4242
+ type={type}
4243
+ data-size={size}
4244
+ variant={variant}
4245
+ className={cn(inputGroupButtonVariants({ size }), className)}
4246
+ {...props}
4247
+ />
4248
+ );
4249
+ }
4250
+
4251
+ function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
4252
+ return (
4253
+ <span
4254
+ className={cn(
4255
+ "flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
4256
+ className,
4257
+ )}
4258
+ {...props}
4259
+ />
4260
+ );
4261
+ }
4262
+
4263
+ function InputGroupInput({ className, ...props }: React.ComponentProps<"input">) {
4264
+ return (
4265
+ <Input
4266
+ data-slot="input-group-control"
4267
+ className={cn(
4268
+ "flex-1 rounded-none border-0 bg-transparent shadow-none focus-visible:ring-0 dark:bg-transparent",
4269
+ className,
4270
+ )}
4271
+ {...props}
4272
+ />
4273
+ );
4274
+ }
4275
+
4276
+ function InputGroupTextarea({ className, ...props }: React.ComponentProps<"textarea">) {
4277
+ return (
4278
+ <Textarea
4279
+ data-slot="input-group-control"
4280
+ className={cn(
4281
+ "flex-1 resize-none rounded-none border-0 bg-transparent py-3 shadow-none focus-visible:ring-0 dark:bg-transparent",
4282
+ className,
4283
+ )}
4284
+ {...props}
4285
+ />
4286
+ );
4287
+ }
4288
+
4289
+ export {
4290
+ InputGroup,
4291
+ InputGroupAddon,
4292
+ InputGroupButton,
4293
+ InputGroupText,
4294
+ InputGroupInput,
4295
+ InputGroupTextarea,
4296
+ };
4297
+ `,"components/ui/input.tsx":`import * as React from "react";
4298
+
4299
+ import { cn } from "@/lib/utils";
4300
+
4301
+ function Input({ className, type, ...props }: React.ComponentProps<"input">) {
4302
+ return (
4303
+ <input
4304
+ type={type}
4305
+ data-slot="input"
4306
+ className={cn(
4307
+ "h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30",
4308
+ "focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50",
4309
+ "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",
4310
+ className,
4311
+ )}
4312
+ {...props}
4313
+ />
4314
+ );
4315
+ }
4316
+
4317
+ export { Input };
4318
+ `,"components/ui/select.tsx":`"use client";
4319
+
4320
+ import * as React from "react";
4321
+ import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from "lucide-react";
4322
+ import { Select as SelectPrimitive } from "radix-ui";
4323
+
4324
+ import { cn } from "@/lib/utils";
4325
+
4326
+ function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
4327
+ return <SelectPrimitive.Root data-slot="select" {...props} />;
4328
+ }
4329
+
4330
+ function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
4331
+ return <SelectPrimitive.Group data-slot="select-group" {...props} />;
4332
+ }
4333
+
4334
+ function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
4335
+ return <SelectPrimitive.Value data-slot="select-value" {...props} />;
4336
+ }
4337
+
4338
+ function SelectTrigger({
4339
+ className,
4340
+ size = "default",
4341
+ children,
4342
+ ...props
4343
+ }: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
4344
+ size?: "sm" | "default";
4345
+ }) {
4346
+ return (
4347
+ <SelectPrimitive.Trigger
4348
+ data-slot="select-trigger"
4349
+ data-size={size}
4350
+ className={cn(
4351
+ "flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:bg-input/30 dark:hover:bg-input/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
4352
+ className,
4353
+ )}
4354
+ {...props}
4355
+ >
4356
+ {children}
4357
+ <SelectPrimitive.Icon asChild>
4358
+ <ChevronDownIcon className="size-4 opacity-50" />
4359
+ </SelectPrimitive.Icon>
4360
+ </SelectPrimitive.Trigger>
4361
+ );
4362
+ }
4363
+
4364
+ function SelectContent({
4365
+ className,
4366
+ children,
4367
+ position = "item-aligned",
4368
+ align = "center",
4369
+ ...props
4370
+ }: React.ComponentProps<typeof SelectPrimitive.Content>) {
4371
+ return (
4372
+ <SelectPrimitive.Portal>
4373
+ <SelectPrimitive.Content
4374
+ data-slot="select-content"
4375
+ className={cn(
4376
+ "relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95",
4377
+ position === "popper" &&
4378
+ "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
4379
+ className,
4380
+ )}
4381
+ position={position}
4382
+ align={align}
4383
+ {...props}
4384
+ >
4385
+ <SelectScrollUpButton />
4386
+ <SelectPrimitive.Viewport
4387
+ className={cn(
4388
+ "p-1",
4389
+ position === "popper" &&
4390
+ "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1",
4391
+ )}
4392
+ >
4393
+ {children}
4394
+ </SelectPrimitive.Viewport>
4395
+ <SelectScrollDownButton />
4396
+ </SelectPrimitive.Content>
4397
+ </SelectPrimitive.Portal>
4398
+ );
4399
+ }
4400
+
4401
+ function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
4402
+ return (
4403
+ <SelectPrimitive.Label
4404
+ data-slot="select-label"
4405
+ className={cn("px-2 py-1.5 text-xs text-muted-foreground", className)}
4406
+ {...props}
4407
+ />
4408
+ );
4409
+ }
4410
+
4411
+ function SelectItem({
4412
+ className,
4413
+ children,
4414
+ ...props
4415
+ }: React.ComponentProps<typeof SelectPrimitive.Item>) {
4416
+ return (
4417
+ <SelectPrimitive.Item
4418
+ data-slot="select-item"
4419
+ className={cn(
4420
+ "relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
4421
+ className,
4422
+ )}
4423
+ {...props}
4424
+ >
4425
+ <span
4426
+ data-slot="select-item-indicator"
4427
+ className="absolute right-2 flex size-3.5 items-center justify-center"
4428
+ >
4429
+ <SelectPrimitive.ItemIndicator>
4430
+ <CheckIcon className="size-4" />
4431
+ </SelectPrimitive.ItemIndicator>
4432
+ </span>
4433
+ <SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
4434
+ </SelectPrimitive.Item>
4435
+ );
4436
+ }
4437
+
4438
+ function SelectSeparator({
4439
+ className,
4440
+ ...props
4441
+ }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
4442
+ return (
4443
+ <SelectPrimitive.Separator
4444
+ data-slot="select-separator"
4445
+ className={cn("pointer-events-none -mx-1 my-1 h-px bg-border", className)}
4446
+ {...props}
4447
+ />
4448
+ );
4449
+ }
4450
+
4451
+ function SelectScrollUpButton({
4452
+ className,
4453
+ ...props
4454
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
4455
+ return (
4456
+ <SelectPrimitive.ScrollUpButton
4457
+ data-slot="select-scroll-up-button"
4458
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
4459
+ {...props}
4460
+ >
4461
+ <ChevronUpIcon className="size-4" />
4462
+ </SelectPrimitive.ScrollUpButton>
4463
+ );
4464
+ }
4465
+
4466
+ function SelectScrollDownButton({
4467
+ className,
4468
+ ...props
4469
+ }: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
4470
+ return (
4471
+ <SelectPrimitive.ScrollDownButton
4472
+ data-slot="select-scroll-down-button"
4473
+ className={cn("flex cursor-default items-center justify-center py-1", className)}
4474
+ {...props}
4475
+ >
4476
+ <ChevronDownIcon className="size-4" />
4477
+ </SelectPrimitive.ScrollDownButton>
4478
+ );
4479
+ }
4480
+
4481
+ export {
4482
+ Select,
4483
+ SelectContent,
4484
+ SelectGroup,
4485
+ SelectItem,
4486
+ SelectLabel,
4487
+ SelectScrollDownButton,
4488
+ SelectScrollUpButton,
4489
+ SelectSeparator,
4490
+ SelectTrigger,
4491
+ SelectValue,
4492
+ };
4493
+ `,"components/ui/separator.tsx":`"use client";
4494
+
4495
+ import * as React from "react";
4496
+ import { Separator as SeparatorPrimitive } from "radix-ui";
4497
+
4498
+ import { cn } from "@/lib/utils";
4499
+
4500
+ function Separator({
4501
+ className,
4502
+ orientation = "horizontal",
4503
+ decorative = true,
4504
+ ...props
4505
+ }: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
4506
+ return (
4507
+ <SeparatorPrimitive.Root
4508
+ data-slot="separator"
4509
+ decorative={decorative}
4510
+ orientation={orientation}
4511
+ className={cn(
4512
+ "shrink-0 bg-border data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",
4513
+ className,
4514
+ )}
4515
+ {...props}
4516
+ />
4517
+ );
4518
+ }
4519
+
4520
+ export { Separator };
4521
+ `,"components/ui/spinner.tsx":`import { Loader2Icon } from "lucide-react";
4522
+
4523
+ import { cn } from "@/lib/utils";
4524
+
4525
+ function Spinner({ className, ...props }: React.ComponentProps<"svg">) {
4526
+ return (
4527
+ <Loader2Icon
4528
+ role="status"
4529
+ aria-label="Loading"
4530
+ className={cn("size-4 animate-spin", className)}
4531
+ {...props}
4532
+ />
4533
+ );
4534
+ }
4535
+
4536
+ export { Spinner };
4537
+ `,"components/ui/textarea.tsx":`import * as React from "react";
4538
+
4539
+ import { cn } from "@/lib/utils";
4540
+
4541
+ function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
4542
+ return (
4543
+ <textarea
4544
+ data-slot="textarea"
4545
+ className={cn(
4546
+ "flex field-sizing-content min-h-16 w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 md:text-sm dark:bg-input/30 dark:aria-invalid:ring-destructive/40",
4547
+ className,
4548
+ )}
4549
+ {...props}
4550
+ />
4551
+ );
4552
+ }
4553
+
4554
+ export { Textarea };
4555
+ `,"components/ui/tooltip.tsx":`"use client";
4556
+
4557
+ import * as React from "react";
4558
+ import { Tooltip as TooltipPrimitive } from "radix-ui";
4559
+
4560
+ import { cn } from "@/lib/utils";
4561
+
4562
+ function TooltipProvider({
4563
+ delayDuration = 0,
4564
+ ...props
4565
+ }: React.ComponentProps<typeof TooltipPrimitive.Provider>) {
4566
+ return (
4567
+ <TooltipPrimitive.Provider
4568
+ data-slot="tooltip-provider"
4569
+ delayDuration={delayDuration}
4570
+ {...props}
4571
+ />
4572
+ );
4573
+ }
4574
+
4575
+ function Tooltip({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Root>) {
4576
+ return <TooltipPrimitive.Root data-slot="tooltip" {...props} />;
4577
+ }
4578
+
4579
+ function TooltipTrigger({ ...props }: React.ComponentProps<typeof TooltipPrimitive.Trigger>) {
4580
+ return <TooltipPrimitive.Trigger data-slot="tooltip-trigger" {...props} />;
4581
+ }
4582
+
4583
+ function TooltipContent({
4584
+ className,
4585
+ sideOffset = 0,
4586
+ children,
4587
+ ...props
4588
+ }: React.ComponentProps<typeof TooltipPrimitive.Content>) {
4589
+ return (
4590
+ <TooltipPrimitive.Portal>
4591
+ <TooltipPrimitive.Content
4592
+ data-slot="tooltip-content"
4593
+ sideOffset={sideOffset}
4594
+ className={cn(
4595
+ "z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95",
4596
+ className,
4597
+ )}
4598
+ {...props}
4599
+ >
4600
+ {children}
4601
+ <TooltipPrimitive.Arrow className="z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" />
4602
+ </TooltipPrimitive.Content>
4603
+ </TooltipPrimitive.Portal>
4604
+ );
4605
+ }
4606
+
4607
+ export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
4608
+ `,"components.json":`{
4609
+ "$schema": "https://ui.shadcn.com/schema.json",
4610
+ "style": "new-york",
4611
+ "rsc": true,
4612
+ "tsx": true,
4613
+ "tailwind": {
4614
+ "config": "",
4615
+ "css": "app/globals.css",
4616
+ "baseColor": "neutral",
4617
+ "cssVariables": true,
4618
+ "prefix": ""
4619
+ },
4620
+ "iconLibrary": "lucide",
4621
+ "aliases": {
4622
+ "components": "@/components",
4623
+ "utils": "@/lib/utils",
4624
+ "ui": "@/components/ui",
4625
+ "lib": "@/lib",
4626
+ "hooks": "@/hooks"
4627
+ },
4628
+ "registries": {}
4629
+ }
4630
+ `,"css.d.ts":`declare module "*.css";
4631
+ `,"lib/utils.ts":`import { clsx, type ClassValue } from "clsx";
4632
+ import { twMerge } from "tailwind-merge";
4633
+
4634
+ export function cn(...inputs: ClassValue[]): string {
4635
+ return twMerge(clsx(inputs));
4636
+ }
4637
+ `,"next-env.d.ts":`/// <reference types="next" />
4638
+ /// <reference types="next/image-types/global" />
4639
+ import "./.next/types/routes.d.ts";
4640
+
4641
+ // NOTE: This file should not be edited
4642
+ // see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
4643
+ `,"next.config.ts":`import type { NextConfig } from "next";
4644
+ import { withEve } from "eve/next";
4645
+
4646
+ const nextConfig: NextConfig = {};
4647
+
4648
+ export default withEve(nextConfig__EVE_INIT_WITH_EVE_OPTIONS__);
4649
+ `,"postcss.config.mjs":`const config = {
4650
+ plugins: {
4651
+ "@tailwindcss/postcss": {},
4652
+ },
4653
+ };
4654
+
4655
+ export default config;
4656
+ `,"tsconfig.json":`{
4657
+ "$schema": "https://json.schemastore.org/tsconfig",
4658
+ "compilerOptions": {
4659
+ "target": "ES2017",
4660
+ "lib": ["dom", "dom.iterable", "esnext"],
4661
+ "allowJs": true,
4662
+ "skipLibCheck": true,
4663
+ "strict": true,
4664
+ "noEmit": true,
4665
+ "esModuleInterop": true,
4666
+ "module": "esnext",
4667
+ "moduleResolution": "Bundler",
4668
+ "resolveJsonModule": true,
4669
+ "isolatedModules": true,
4670
+ "jsx": "react-jsx",
4671
+ "incremental": true,
4672
+ "plugins": [
4673
+ {
4674
+ "name": "next"
4675
+ }
4676
+ ],
4677
+ "paths": {
4678
+ "@/*": ["./*"]
4679
+ }
4680
+ },
4681
+ "include": [
4682
+ "next-env.d.ts",
4683
+ "**/*.ts",
4684
+ "**/*.tsx",
4685
+ ".eve/**/*.d.ts",
4686
+ ".next/types/**/*.ts",
4687
+ ".next/dev/types/**/*.ts"
4688
+ ],
4689
+ "exclude": ["node_modules"]
4690
+ }
4691
+ `},WEB_APP_TEMPLATE_PACKAGE_JSON={scripts:{build:`next build`,dev:`next dev`,start:`next start`,typecheck:`tsgo --noEmit -p tsconfig.json`},dependencies:{"@radix-ui/react-use-controllable-state":`1.2.2`,"@shikijs/core":`4.1.0`,"@shikijs/engine-javascript":`4.1.0`,"@shikijs/engine-oniguruma":`4.1.0`,"@streamdown/cjk":`1.0.3`,"@streamdown/code":`1.1.1`,"@streamdown/math":`1.0.2`,"@streamdown/mermaid":`1.0.2`,"@tailwindcss/postcss":`4.3.0`,ai:`catalog:`,"class-variance-authority":`0.7.1`,clsx:`2.1.1`,cmdk:`1.1.1`,eve:`workspace:*`,"lucide-react":`1.16.0`,motion:`12.40.0`,nanoid:`5.1.11`,next:`catalog:`,"radix-ui":`1.4.3`,react:`catalog:`,"react-dom":`catalog:`,shiki:`4.1.0`,streamdown:`catalog:`,"tailwind-merge":`3.6.0`,tailwindcss:`4.3.0`,"use-stick-to-bottom":`1.1.4`,zod:`catalog:`},devDependencies:{"@types/node":`catalog:`,"@types/react":`catalog:`,"@types/react-dom":`catalog:`}};export{WEB_APP_TEMPLATE_FILES,WEB_APP_TEMPLATE_PACKAGE_JSON};