veryfront 0.1.1237 → 0.1.1239

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 (493) hide show
  1. package/esm/cli/auth/login.d.ts +24 -2
  2. package/esm/cli/auth/login.d.ts.map +1 -1
  3. package/esm/cli/auth/login.js +444 -35
  4. package/esm/cli/commands/build/error-handler.d.ts.map +1 -1
  5. package/esm/cli/commands/build/error-handler.js +41 -3
  6. package/esm/cli/commands/build/handler.d.ts.map +1 -1
  7. package/esm/cli/commands/build/handler.js +1 -1
  8. package/esm/cli/commands/dev/command.d.ts.map +1 -1
  9. package/esm/cli/commands/dev/command.js +14 -1
  10. package/esm/cli/commands/dev/inference-status.d.ts +6 -0
  11. package/esm/cli/commands/dev/inference-status.d.ts.map +1 -1
  12. package/esm/cli/commands/dev/inference-status.js +14 -2
  13. package/esm/cli/commands/generate/command.d.ts.map +1 -1
  14. package/esm/cli/commands/generate/command.js +61 -0
  15. package/esm/cli/commands/init/init-command.d.ts.map +1 -1
  16. package/esm/cli/commands/init/init-command.js +23 -31
  17. package/esm/cli/commands/install/registry.d.ts.map +1 -1
  18. package/esm/cli/commands/install/registry.js +6 -9
  19. package/esm/cli/commands/login/command-help.d.ts.map +1 -1
  20. package/esm/cli/commands/login/command-help.js +3 -1
  21. package/esm/cli/commands/pull/command.d.ts +1 -0
  22. package/esm/cli/commands/pull/command.d.ts.map +1 -1
  23. package/esm/cli/commands/pull/command.js +49 -6
  24. package/esm/cli/commands/push/command-help.d.ts.map +1 -1
  25. package/esm/cli/commands/push/command-help.js +7 -0
  26. package/esm/cli/commands/push/command.d.ts +23 -12
  27. package/esm/cli/commands/push/command.d.ts.map +1 -1
  28. package/esm/cli/commands/push/command.js +461 -44
  29. package/esm/cli/commands/push/plan.d.ts +35 -0
  30. package/esm/cli/commands/push/plan.d.ts.map +1 -0
  31. package/esm/cli/commands/push/plan.js +96 -0
  32. package/esm/cli/commands/schedule/handler.d.ts +21 -2
  33. package/esm/cli/commands/schedule/handler.d.ts.map +1 -1
  34. package/esm/cli/commands/schedule/handler.js +74 -27
  35. package/esm/cli/commands/schema/command-help.js +1 -1
  36. package/esm/cli/commands/up/command.js +1 -1
  37. package/esm/cli/commands/webhook/handler.d.ts.map +1 -1
  38. package/esm/cli/commands/webhook/handler.js +3 -1
  39. package/esm/cli/router.d.ts.map +1 -1
  40. package/esm/cli/router.js +27 -5
  41. package/esm/cli/shared/args.d.ts +15 -1
  42. package/esm/cli/shared/args.d.ts.map +1 -1
  43. package/esm/cli/shared/args.js +56 -3
  44. package/esm/cli/shared/config.d.ts +11 -2
  45. package/esm/cli/shared/config.d.ts.map +1 -1
  46. package/esm/cli/shared/config.js +72 -27
  47. package/esm/cli/shared/project-creation.js +1 -1
  48. package/esm/cli/sync/state.d.ts +20 -0
  49. package/esm/cli/sync/state.d.ts.map +1 -0
  50. package/esm/cli/sync/state.js +193 -0
  51. package/esm/deno.js +2 -2
  52. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.d.ts.map +1 -1
  53. package/esm/extensions/ext-llm-anthropic/src/anthropic-request-builder.js +852 -21
  54. package/esm/extensions/ext-observability-sentry/src/policy.d.ts +2 -0
  55. package/esm/extensions/ext-observability-sentry/src/policy.d.ts.map +1 -1
  56. package/esm/extensions/ext-observability-sentry/src/policy.js +214 -3
  57. package/esm/src/agent/conversation/delegation-policy.d.ts +2 -0
  58. package/esm/src/agent/conversation/delegation-policy.d.ts.map +1 -1
  59. package/esm/src/agent/conversation/delegation-policy.js +13 -3
  60. package/esm/src/agent/conversation/hosted-terminal.d.ts.map +1 -1
  61. package/esm/src/agent/conversation/hosted-terminal.js +6 -2
  62. package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
  63. package/esm/src/agent/conversation/run-chunk-mirror.js +14 -2
  64. package/esm/src/agent/factory.d.ts.map +1 -1
  65. package/esm/src/agent/factory.js +22 -11
  66. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts +2 -0
  67. package/esm/src/agent/hosted/chat-runtime-tool-assembly.d.ts.map +1 -1
  68. package/esm/src/agent/hosted/chat-runtime-tool-assembly.js +6 -1
  69. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts +2 -1
  70. package/esm/src/agent/hosted/child-fork-execution-runner.d.ts.map +1 -1
  71. package/esm/src/agent/hosted/child-fork-execution-runner.js +6 -3
  72. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts +12 -3
  73. package/esm/src/agent/hosted/child-fork-step-message-preparation.d.ts.map +1 -1
  74. package/esm/src/agent/hosted/child-fork-step-message-preparation.js +16 -3
  75. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts +1 -1
  76. package/esm/src/agent/hosted/cloud-agent-chat-execution.d.ts.map +1 -1
  77. package/esm/src/agent/hosted/cloud-agent-chat-execution.js +3 -3
  78. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts +11 -0
  79. package/esm/src/agent/hosted/cloud-agent-child-tools.d.ts.map +1 -1
  80. package/esm/src/agent/hosted/cloud-agent-child-tools.js +2 -3
  81. package/esm/src/agent/hosted/cloud-agent-config.d.ts +1 -0
  82. package/esm/src/agent/hosted/cloud-agent-config.d.ts.map +1 -1
  83. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts +16 -1
  84. package/esm/src/agent/hosted/cloud-runtime-system-messages.d.ts.map +1 -1
  85. package/esm/src/agent/hosted/cloud-runtime-system-messages.js +13 -3
  86. package/esm/src/agent/hosted/default-chat-runtime.d.ts +2 -1
  87. package/esm/src/agent/hosted/default-chat-runtime.d.ts.map +1 -1
  88. package/esm/src/agent/hosted/default-chat-runtime.js +18 -7
  89. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts +2 -1
  90. package/esm/src/agent/hosted/default-invoke-agent-tool.d.ts.map +1 -1
  91. package/esm/src/agent/hosted/default-invoke-agent-tool.js +11 -3
  92. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts +2 -1
  93. package/esm/src/agent/hosted/default-project-steering-refresh.d.ts.map +1 -1
  94. package/esm/src/agent/hosted/default-project-steering-refresh.js +4 -1
  95. package/esm/src/agent/hosted/runtime-state-resolver.d.ts +6 -4
  96. package/esm/src/agent/hosted/runtime-state-resolver.d.ts.map +1 -1
  97. package/esm/src/agent/hosted/runtime-state-resolver.js +8 -11
  98. package/esm/src/agent/index.d.ts +3 -3
  99. package/esm/src/agent/index.d.ts.map +1 -1
  100. package/esm/src/agent/project/agent-runtime.d.ts.map +1 -1
  101. package/esm/src/agent/project/agent-runtime.js +6 -3
  102. package/esm/src/agent/runtime/agent-definition.d.ts +68 -66
  103. package/esm/src/agent/runtime/agent-definition.d.ts.map +1 -1
  104. package/esm/src/agent/runtime/agent-definition.js +15 -2
  105. package/esm/src/agent/runtime/agent-invocation-contract.d.ts +2 -0
  106. package/esm/src/agent/runtime/agent-invocation-contract.d.ts.map +1 -1
  107. package/esm/src/agent/runtime/agent-markdown-adapter.js +1 -1
  108. package/esm/src/agent/runtime/agent-runtime-step.d.ts +11 -5
  109. package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -1
  110. package/esm/src/agent/runtime/agent-runtime-step.js +23 -6
  111. package/esm/src/agent/runtime/call-context.d.ts +42 -11
  112. package/esm/src/agent/runtime/call-context.d.ts.map +1 -1
  113. package/esm/src/agent/runtime/call-context.js +480 -42
  114. package/esm/src/agent/runtime/chat-stream-handler.d.ts +18 -0
  115. package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
  116. package/esm/src/agent/runtime/chat-stream-handler.js +38 -18
  117. package/esm/src/agent/runtime/effective-agent-system.d.ts +13 -4
  118. package/esm/src/agent/runtime/effective-agent-system.d.ts.map +1 -1
  119. package/esm/src/agent/runtime/effective-agent-system.js +29 -0
  120. package/esm/src/agent/runtime/index.d.ts +1 -0
  121. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  122. package/esm/src/agent/runtime/index.js +638 -53
  123. package/esm/src/agent/runtime/load-skill-tool.d.ts +33 -3
  124. package/esm/src/agent/runtime/load-skill-tool.d.ts.map +1 -1
  125. package/esm/src/agent/runtime/load-skill-tool.js +152 -21
  126. package/esm/src/agent/runtime/model-resolution.d.ts +3 -0
  127. package/esm/src/agent/runtime/model-resolution.d.ts.map +1 -1
  128. package/esm/src/agent/runtime/model-resolution.js +14 -0
  129. package/esm/src/agent/runtime/model-transport.d.ts +1 -0
  130. package/esm/src/agent/runtime/model-transport.d.ts.map +1 -1
  131. package/esm/src/agent/runtime/model-transport.js +5 -2
  132. package/esm/src/agent/runtime/run-runtime-context.d.ts +4 -0
  133. package/esm/src/agent/runtime/run-runtime-context.d.ts.map +1 -1
  134. package/esm/src/agent/runtime/run-runtime-context.js +9 -3
  135. package/esm/src/agent/runtime/runtime-tool-config.d.ts +1 -0
  136. package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -1
  137. package/esm/src/agent/runtime/skill-prompt.d.ts +3 -0
  138. package/esm/src/agent/runtime/skill-prompt.d.ts.map +1 -1
  139. package/esm/src/agent/runtime/skill-prompt.js +113 -25
  140. package/esm/src/agent/runtime/streamed-assistant-message.d.ts +22 -2
  141. package/esm/src/agent/runtime/streamed-assistant-message.d.ts.map +1 -1
  142. package/esm/src/agent/runtime/streamed-assistant-message.js +26 -5
  143. package/esm/src/agent/runtime/tool-inventory.d.ts.map +1 -1
  144. package/esm/src/agent/runtime/tool-inventory.js +13 -9
  145. package/esm/src/agent/runtime/tool-result-continuation.d.ts +4 -2
  146. package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -1
  147. package/esm/src/agent/runtime/tool-result-continuation.js +24 -20
  148. package/esm/src/agent/schemas/agent.schema.d.ts +2 -2
  149. package/esm/src/agent/service/runtime.js +1 -1
  150. package/esm/src/agent/streaming/fork-runtime-stream.d.ts +5 -4
  151. package/esm/src/agent/streaming/fork-runtime-stream.d.ts.map +1 -1
  152. package/esm/src/agent/types.d.ts +14 -1
  153. package/esm/src/agent/types.d.ts.map +1 -1
  154. package/esm/src/chat/chat-ui-message-helpers.d.ts.map +1 -1
  155. package/esm/src/chat/chat-ui-message-helpers.js +75 -16
  156. package/esm/src/config/loader.d.ts.map +1 -1
  157. package/esm/src/config/loader.js +37 -1
  158. package/esm/src/errors/catalog/build-errors.d.ts.map +1 -1
  159. package/esm/src/errors/catalog/build-errors.js +14 -0
  160. package/esm/src/errors/error-registry/build.d.ts +2 -0
  161. package/esm/src/errors/error-registry/build.d.ts.map +1 -1
  162. package/esm/src/errors/error-registry/build.js +8 -0
  163. package/esm/src/errors/error-registry/deploy.d.ts +4 -0
  164. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -1
  165. package/esm/src/errors/error-registry/deploy.js +16 -0
  166. package/esm/src/errors/error-registry.d.ts +3 -0
  167. package/esm/src/errors/error-registry.d.ts.map +1 -1
  168. package/esm/src/errors/index.d.ts +2 -1
  169. package/esm/src/errors/index.d.ts.map +1 -1
  170. package/esm/src/errors/index.js +4 -3
  171. package/esm/src/errors/tenant-classification.d.ts +25 -0
  172. package/esm/src/errors/tenant-classification.d.ts.map +1 -0
  173. package/esm/src/errors/tenant-classification.js +61 -0
  174. package/esm/src/extensions/builtin-extensions.d.ts +10 -15
  175. package/esm/src/extensions/builtin-extensions.d.ts.map +1 -1
  176. package/esm/src/extensions/builtin-extensions.js +32 -26
  177. package/esm/src/extensions/deferred-extension.d.ts +4 -4
  178. package/esm/src/extensions/deferred-extension.js +4 -4
  179. package/esm/src/extensions/index.d.ts +1 -0
  180. package/esm/src/extensions/index.d.ts.map +1 -1
  181. package/esm/src/extensions/index.js +1 -0
  182. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
  183. package/esm/src/integrations/_data.d.ts.map +1 -1
  184. package/esm/src/integrations/_data.js +6 -0
  185. package/esm/src/integrations/schema.d.ts +8 -0
  186. package/esm/src/integrations/schema.d.ts.map +1 -1
  187. package/esm/src/integrations/schema.js +3 -0
  188. package/esm/src/integrations/types.d.ts +2 -0
  189. package/esm/src/integrations/types.d.ts.map +1 -1
  190. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  191. package/esm/src/internal-agents/run-stream.js +35 -20
  192. package/esm/src/internal-agents/run-system-prompt.d.ts +7 -2
  193. package/esm/src/internal-agents/run-system-prompt.d.ts.map +1 -1
  194. package/esm/src/internal-agents/run-system-prompt.js +19 -13
  195. package/esm/src/internal-agents/schema.d.ts +2 -0
  196. package/esm/src/internal-agents/schema.d.ts.map +1 -1
  197. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  198. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +2 -18
  199. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts +11 -0
  200. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.d.ts.map +1 -1
  201. package/esm/src/modules/react-loader/ssr-module-loader/ssr-dependency-validator.js +53 -6
  202. package/esm/src/observability/application-error-contract.d.ts +4 -0
  203. package/esm/src/observability/application-error-contract.d.ts.map +1 -1
  204. package/esm/src/observability/application-errors.d.ts.map +1 -1
  205. package/esm/src/observability/application-errors.js +64 -3
  206. package/esm/src/platform/adapters/runtime/deno/http-server.d.ts.map +1 -1
  207. package/esm/src/platform/adapters/runtime/deno/http-server.js +2 -10
  208. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts +14 -0
  209. package/esm/src/platform/adapters/runtime/shared/request-peer.d.ts.map +1 -1
  210. package/esm/src/platform/adapters/runtime/shared/request-peer.js +82 -0
  211. package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
  212. package/esm/src/provider/runtime-loader/provider-http.d.ts +5 -1
  213. package/esm/src/provider/runtime-loader/provider-http.d.ts.map +1 -1
  214. package/esm/src/provider/runtime-loader/provider-http.js +55 -17
  215. package/esm/src/provider/shared/index.d.ts +1 -0
  216. package/esm/src/provider/shared/index.d.ts.map +1 -1
  217. package/esm/src/provider/shared/index.js +2 -0
  218. package/esm/src/provider/types.d.ts +1 -0
  219. package/esm/src/provider/types.d.ts.map +1 -1
  220. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts +3 -0
  221. package/esm/src/react/components/ui/adapter/builtin/combobox.d.ts.map +1 -0
  222. package/esm/src/react/components/ui/adapter/builtin/combobox.js +204 -0
  223. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts +3 -0
  224. package/esm/src/react/components/ui/adapter/builtin/dialog.d.ts.map +1 -0
  225. package/esm/src/react/components/ui/adapter/builtin/dialog.js +20 -0
  226. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts +3 -0
  227. package/esm/src/react/components/ui/adapter/builtin/drawer.d.ts.map +1 -0
  228. package/esm/src/react/components/ui/adapter/builtin/drawer.js +21 -0
  229. package/esm/src/react/components/ui/adapter/builtin/index.d.ts.map +1 -1
  230. package/esm/src/react/components/ui/adapter/builtin/index.js +10 -0
  231. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts +3 -0
  232. package/esm/src/react/components/ui/adapter/builtin/popover.d.ts.map +1 -0
  233. package/esm/src/react/components/ui/adapter/builtin/popover.js +28 -0
  234. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts +3 -0
  235. package/esm/src/react/components/ui/adapter/builtin/tabs.d.ts.map +1 -0
  236. package/esm/src/react/components/ui/adapter/builtin/tabs.js +73 -0
  237. package/esm/src/react/components/ui/adapter/context.d.ts.map +1 -1
  238. package/esm/src/react/components/ui/adapter/context.js +10 -0
  239. package/esm/src/react/components/ui/adapter/contract.d.ts +212 -0
  240. package/esm/src/react/components/ui/adapter/contract.d.ts.map +1 -1
  241. package/esm/src/react/components/ui/adapter/token-scope.d.ts +24 -0
  242. package/esm/src/react/components/ui/adapter/token-scope.d.ts.map +1 -0
  243. package/esm/src/react/components/ui/adapter/token-scope.js +26 -0
  244. package/esm/src/react/components/ui/alert-dialog.d.ts +101 -0
  245. package/esm/src/react/components/ui/alert-dialog.d.ts.map +1 -0
  246. package/esm/src/react/components/ui/alert-dialog.js +181 -0
  247. package/esm/src/react/components/ui/aspect-ratio.d.ts +18 -0
  248. package/esm/src/react/components/ui/aspect-ratio.d.ts.map +1 -0
  249. package/esm/src/react/components/ui/aspect-ratio.js +13 -0
  250. package/esm/src/react/components/ui/autocomplete.d.ts +67 -0
  251. package/esm/src/react/components/ui/autocomplete.d.ts.map +1 -0
  252. package/esm/src/react/components/ui/autocomplete.js +59 -0
  253. package/esm/src/react/components/ui/breadcrumb.d.ts +86 -0
  254. package/esm/src/react/components/ui/breadcrumb.d.ts.map +1 -0
  255. package/esm/src/react/components/ui/breadcrumb.js +67 -0
  256. package/esm/src/react/components/ui/calendar.d.ts +40 -0
  257. package/esm/src/react/components/ui/calendar.d.ts.map +1 -0
  258. package/esm/src/react/components/ui/calendar.js +170 -0
  259. package/esm/src/react/components/ui/combobox.d.ts +74 -0
  260. package/esm/src/react/components/ui/combobox.d.ts.map +1 -0
  261. package/esm/src/react/components/ui/combobox.js +100 -0
  262. package/esm/src/react/components/ui/context-menu.d.ts +116 -0
  263. package/esm/src/react/components/ui/context-menu.d.ts.map +1 -0
  264. package/esm/src/react/components/ui/context-menu.js +168 -0
  265. package/esm/src/react/components/ui/date-picker.d.ts +69 -0
  266. package/esm/src/react/components/ui/date-picker.d.ts.map +1 -0
  267. package/esm/src/react/components/ui/date-picker.js +96 -0
  268. package/esm/src/react/components/ui/dialog.d.ts +41 -11
  269. package/esm/src/react/components/ui/dialog.d.ts.map +1 -1
  270. package/esm/src/react/components/ui/dialog.js +47 -28
  271. package/esm/src/react/components/ui/drawer.d.ts +31 -8
  272. package/esm/src/react/components/ui/drawer.d.ts.map +1 -1
  273. package/esm/src/react/components/ui/drawer.js +33 -22
  274. package/esm/src/react/components/ui/dropdown-menu.d.ts.map +1 -1
  275. package/esm/src/react/components/ui/dropdown-menu.js +7 -75
  276. package/esm/src/react/components/ui/field.d.ts +70 -0
  277. package/esm/src/react/components/ui/field.d.ts.map +1 -0
  278. package/esm/src/react/components/ui/field.js +161 -0
  279. package/esm/src/react/components/ui/file-type.d.ts +9 -8
  280. package/esm/src/react/components/ui/file-type.d.ts.map +1 -1
  281. package/esm/src/react/components/ui/file-type.js +8 -8
  282. package/esm/src/react/components/ui/hover-card.d.ts +82 -0
  283. package/esm/src/react/components/ui/hover-card.d.ts.map +1 -0
  284. package/esm/src/react/components/ui/hover-card.js +140 -0
  285. package/esm/src/react/components/ui/index.d.ts +23 -2
  286. package/esm/src/react/components/ui/index.d.ts.map +1 -1
  287. package/esm/src/react/components/ui/index.js +21 -0
  288. package/esm/src/react/components/ui/input-otp.d.ts +37 -0
  289. package/esm/src/react/components/ui/input-otp.d.ts.map +1 -0
  290. package/esm/src/react/components/ui/input-otp.js +42 -0
  291. package/esm/src/react/components/ui/menu-keyboard.d.ts +8 -0
  292. package/esm/src/react/components/ui/menu-keyboard.d.ts.map +1 -0
  293. package/esm/src/react/components/ui/menu-keyboard.js +76 -0
  294. package/esm/src/react/components/ui/menubar.d.ts +98 -0
  295. package/esm/src/react/components/ui/menubar.d.ts.map +1 -0
  296. package/esm/src/react/components/ui/menubar.js +173 -0
  297. package/esm/src/react/components/ui/meter.d.ts +45 -0
  298. package/esm/src/react/components/ui/meter.d.ts.map +1 -0
  299. package/esm/src/react/components/ui/meter.js +59 -0
  300. package/esm/src/react/components/ui/modal-surface.d.ts +7 -1
  301. package/esm/src/react/components/ui/modal-surface.d.ts.map +1 -1
  302. package/esm/src/react/components/ui/modal-surface.js +23 -6
  303. package/esm/src/react/components/ui/navigation-menu.d.ts +101 -0
  304. package/esm/src/react/components/ui/navigation-menu.d.ts.map +1 -0
  305. package/esm/src/react/components/ui/navigation-menu.js +195 -0
  306. package/esm/src/react/components/ui/number-field.d.ts +46 -0
  307. package/esm/src/react/components/ui/number-field.d.ts.map +1 -0
  308. package/esm/src/react/components/ui/number-field.js +121 -0
  309. package/esm/src/react/components/ui/pagination.d.ts +77 -0
  310. package/esm/src/react/components/ui/pagination.d.ts.map +1 -0
  311. package/esm/src/react/components/ui/pagination.js +62 -0
  312. package/esm/src/react/components/ui/popover.d.ts +42 -13
  313. package/esm/src/react/components/ui/popover.d.ts.map +1 -1
  314. package/esm/src/react/components/ui/popover.js +25 -12
  315. package/esm/src/react/components/ui/scroll-area.d.ts +38 -0
  316. package/esm/src/react/components/ui/scroll-area.d.ts.map +1 -0
  317. package/esm/src/react/components/ui/scroll-area.js +35 -0
  318. package/esm/src/react/components/ui/separator.d.ts +20 -0
  319. package/esm/src/react/components/ui/separator.d.ts.map +1 -0
  320. package/esm/src/react/components/ui/separator.js +13 -0
  321. package/esm/src/react/components/ui/slider.d.ts +44 -0
  322. package/esm/src/react/components/ui/slider.d.ts.map +1 -0
  323. package/esm/src/react/components/ui/slider.js +46 -0
  324. package/esm/src/react/components/ui/status.d.ts +6 -5
  325. package/esm/src/react/components/ui/status.d.ts.map +1 -1
  326. package/esm/src/react/components/ui/status.js +4 -4
  327. package/esm/src/react/components/ui/tabs.d.ts +32 -9
  328. package/esm/src/react/components/ui/tabs.d.ts.map +1 -1
  329. package/esm/src/react/components/ui/tabs.js +46 -22
  330. package/esm/src/react/components/ui/toggle.d.ts +26 -0
  331. package/esm/src/react/components/ui/toggle.d.ts.map +1 -0
  332. package/esm/src/react/components/ui/toggle.js +29 -0
  333. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts +2 -1
  334. package/esm/src/react/components/ui/use-isomorphic-layout-effect.d.ts.map +1 -1
  335. package/esm/src/react/components/ui/use-isomorphic-layout-effect.js +6 -3
  336. package/esm/src/rendering/chunk-optimizer/source-imports.d.ts.map +1 -1
  337. package/esm/src/rendering/chunk-optimizer/source-imports.js +4 -114
  338. package/esm/src/rendering/orchestrator/css-candidate-manifest.d.ts.map +1 -1
  339. package/esm/src/rendering/orchestrator/css-candidate-manifest.js +30 -1
  340. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts +10 -0
  341. package/esm/src/rendering/orchestrator/module-loader/build-failure.d.ts.map +1 -1
  342. package/esm/src/rendering/orchestrator/module-loader/build-failure.js +50 -3
  343. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts +2 -0
  344. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
  345. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +21 -6
  346. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -1
  347. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  348. package/esm/src/rendering/orchestrator/module-loader/index.js +190 -7
  349. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +4 -0
  350. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
  351. package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +374 -7
  352. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  353. package/esm/src/rendering/orchestrator/pipeline.js +12 -1
  354. package/esm/src/runs/runs-client.d.ts +2 -4
  355. package/esm/src/runs/runs-client.d.ts.map +1 -1
  356. package/esm/src/runs/schemas.d.ts +18 -8
  357. package/esm/src/runs/schemas.d.ts.map +1 -1
  358. package/esm/src/runs/schemas.js +26 -0
  359. package/esm/src/runtime/model-call-context.d.ts +6 -1
  360. package/esm/src/runtime/model-call-context.d.ts.map +1 -1
  361. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
  362. package/esm/src/runtime/runtime-bridge.js +133 -15
  363. package/esm/src/schedule/factory.d.ts +8 -2
  364. package/esm/src/schedule/factory.d.ts.map +1 -1
  365. package/esm/src/schedule/factory.js +0 -8
  366. package/esm/src/schedule/index.d.ts +10 -1
  367. package/esm/src/schedule/index.d.ts.map +1 -1
  368. package/esm/src/schedule/index.js +9 -0
  369. package/esm/src/schedule/types.d.ts +30 -11
  370. package/esm/src/schedule/types.d.ts.map +1 -1
  371. package/esm/src/schedule/validation.d.ts +17 -0
  372. package/esm/src/schedule/validation.d.ts.map +1 -1
  373. package/esm/src/schedule/validation.js +93 -5
  374. package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
  375. package/esm/src/security/sandbox/worker-pool.js +6 -1
  376. package/esm/src/server/bootstrap.d.ts.map +1 -1
  377. package/esm/src/server/bootstrap.js +6 -0
  378. package/esm/src/server/dev-server/index.d.ts +1 -1
  379. package/esm/src/server/dev-server/index.d.ts.map +1 -1
  380. package/esm/src/server/dev-server/server.d.ts +7 -3
  381. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  382. package/esm/src/server/dev-server/server.js +12 -3
  383. package/esm/src/server/dev-server/types.d.ts +7 -1
  384. package/esm/src/server/dev-server/types.d.ts.map +1 -1
  385. package/esm/src/server/dev-server.d.ts +1 -1
  386. package/esm/src/server/dev-server.d.ts.map +1 -1
  387. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  388. package/esm/src/server/handlers/dev/framework-candidates.generated.js +2509 -34
  389. package/esm/src/server/handlers/dev/projects/index.d.ts.map +1 -1
  390. package/esm/src/server/handlers/dev/projects/index.js +3 -0
  391. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  392. package/esm/src/server/handlers/request/agent-stream.handler.js +29 -24
  393. package/esm/src/server/index.d.ts +3 -3
  394. package/esm/src/server/index.d.ts.map +1 -1
  395. package/esm/src/server/index.js +10 -5
  396. package/esm/src/server/node-handler.d.ts.map +1 -1
  397. package/esm/src/server/node-handler.js +4 -1
  398. package/esm/src/server/production-server.d.ts.map +1 -1
  399. package/esm/src/server/production-server.js +2 -1
  400. package/esm/src/server/project-env/cache.d.ts +17 -0
  401. package/esm/src/server/project-env/cache.d.ts.map +1 -1
  402. package/esm/src/server/project-env/cache.js +78 -2
  403. package/esm/src/server/project-env/fetcher.d.ts.map +1 -1
  404. package/esm/src/server/project-env/fetcher.js +24 -14
  405. package/esm/src/server/project-env/index.d.ts +1 -1
  406. package/esm/src/server/project-env/index.d.ts.map +1 -1
  407. package/esm/src/server/project-env/index.js +1 -1
  408. package/esm/src/server/project-env/internal-authorization.d.ts +7 -0
  409. package/esm/src/server/project-env/internal-authorization.d.ts.map +1 -0
  410. package/esm/src/server/project-env/internal-authorization.js +32 -0
  411. package/esm/src/server/runtime-handler/index.d.ts.map +1 -1
  412. package/esm/src/server/runtime-handler/index.js +1 -1
  413. package/esm/src/server/runtime-handler/projects-handler.d.ts +1 -1
  414. package/esm/src/server/runtime-handler/projects-handler.d.ts.map +1 -1
  415. package/esm/src/server/runtime-handler/projects-handler.js +4 -2
  416. package/esm/src/transforms/esm/http-bundler.d.ts.map +1 -1
  417. package/esm/src/transforms/esm/http-bundler.js +6 -5
  418. package/esm/src/transforms/esm/http-cache-helpers.d.ts +11 -0
  419. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  420. package/esm/src/transforms/esm/http-cache-helpers.js +35 -0
  421. package/esm/src/transforms/esm/http-cache.d.ts.map +1 -1
  422. package/esm/src/transforms/esm/http-cache.js +16 -10
  423. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  424. package/esm/src/transforms/esm/specifier-resolver.js +87 -7
  425. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts +2 -0
  426. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.d.ts.map +1 -1
  427. package/esm/src/transforms/import-rewriter/strategies/alias-strategy.js +11 -6
  428. package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
  429. package/esm/src/transforms/md/compiler/md-compiler.js +12 -5
  430. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts +2 -0
  431. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.d.ts.map +1 -1
  432. package/esm/src/transforms/mdx/compiler/frontmatter-extractor.js +33 -1
  433. package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
  434. package/esm/src/transforms/mdx/compiler/mdx-compiler.js +46 -7
  435. package/esm/src/transforms/mdx/esm-module-loader/cache/index.d.ts.map +1 -1
  436. package/esm/src/transforms/mdx/esm-module-loader/cache/index.js +8 -2
  437. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts +1 -0
  438. package/esm/src/transforms/mdx/esm-module-loader/cache-format.d.ts.map +1 -1
  439. package/esm/src/transforms/mdx/esm-module-loader/cache-format.js +3 -0
  440. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts +4 -0
  441. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
  442. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +44 -8
  443. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts +2 -0
  444. package/esm/src/transforms/mdx/esm-module-loader/missing-module.d.ts.map +1 -1
  445. package/esm/src/transforms/mdx/esm-module-loader/missing-module.js +4 -0
  446. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
  447. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +5 -1
  448. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts +2 -0
  449. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.d.ts.map +1 -1
  450. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fetcher.js +50 -11
  451. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts +24 -12
  452. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.d.ts.map +1 -1
  453. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/nested-imports.js +201 -18
  454. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +5 -0
  455. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  456. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts +22 -2
  457. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.d.ts.map +1 -1
  458. package/esm/src/transforms/mdx/esm-module-loader/utils/source-spans.js +2080 -129
  459. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts +11 -1
  460. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.d.ts.map +1 -1
  461. package/esm/src/transforms/mdx/esm-module-loader/utils/stub-module.js +32 -15
  462. package/esm/src/transforms/pipeline/stages/compile.d.ts.map +1 -1
  463. package/esm/src/transforms/pipeline/stages/compile.js +44 -0
  464. package/esm/src/transforms/shared/specifier-suffix.d.ts +25 -0
  465. package/esm/src/transforms/shared/specifier-suffix.d.ts.map +1 -0
  466. package/esm/src/transforms/shared/specifier-suffix.js +43 -0
  467. package/esm/src/trigger/index.d.ts +2 -2
  468. package/esm/src/trigger/index.d.ts.map +1 -1
  469. package/esm/src/trigger/index.js +1 -1
  470. package/esm/src/trigger/local-runner.d.ts +2 -2
  471. package/esm/src/trigger/local-runner.d.ts.map +1 -1
  472. package/esm/src/trigger/local-runner.js +11 -4
  473. package/esm/src/trigger/target.d.ts +97 -5
  474. package/esm/src/trigger/target.d.ts.map +1 -1
  475. package/esm/src/trigger/target.js +175 -5
  476. package/esm/src/utils/version-constant.d.ts +1 -1
  477. package/esm/src/utils/version-constant.js +1 -1
  478. package/esm/src/webhook/types.d.ts +21 -6
  479. package/esm/src/webhook/types.d.ts.map +1 -1
  480. package/esm/src/webhook/validation.d.ts.map +1 -1
  481. package/esm/src/webhook/validation.js +27 -39
  482. package/esm/templates/index.d.ts +1 -1
  483. package/esm/templates/index.d.ts.map +1 -1
  484. package/esm/templates/loader.d.ts +6 -6
  485. package/esm/templates/loader.d.ts.map +1 -1
  486. package/esm/templates/loader.js +34 -18
  487. package/esm/templates/manifest.generated.d.ts +3 -0
  488. package/esm/templates/manifest.generated.d.ts.map +1 -0
  489. package/esm/templates/manifest.generated.js +2 -0
  490. package/package.json +8 -8
  491. package/esm/templates/manifest.d.ts +0 -664
  492. package/esm/templates/manifest.d.ts.map +0 -1
  493. package/esm/templates/manifest.js +0 -662
@@ -9,6 +9,7 @@
9
9
  * @module platform/adapters/runtime/shared/request-peer
10
10
  */
11
11
  const requestPeerProvenance = new WeakMap();
12
+ const interceptorHandledRequests = new WeakSet();
12
13
  const MAX_PEER_HOSTNAME_CHARACTERS = 255;
13
14
  const DECIMAL_OCTET_PATTERN = /^(?:0|[1-9][0-9]{0,2})$/;
14
15
  const IPV4_MAPPED_IPV6_PATTERN = /^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/;
@@ -68,6 +69,75 @@ export function recordRequestPeerFromTransport(request, provenance) {
68
69
  }));
69
70
  return true;
70
71
  }
72
+ /** @internal Record the native peer supplied to a Deno.serve handler. */
73
+ export function recordDenoServeRequestPeer(request, info) {
74
+ if (typeof info !== "object" || info === null)
75
+ return false;
76
+ try {
77
+ const remoteAddress = info.remoteAddr;
78
+ if (remoteAddress?.transport !== "tcp" ||
79
+ typeof remoteAddress.hostname !== "string") {
80
+ return false;
81
+ }
82
+ return recordRequestPeerFromTransport(request, {
83
+ runtime: "deno",
84
+ transport: "tcp",
85
+ hostname: remoteAddress.hostname,
86
+ });
87
+ }
88
+ catch {
89
+ return false;
90
+ }
91
+ }
92
+ /** @internal Record the native peer supplied by a Node IncomingMessage. */
93
+ export function recordNodeIncomingRequestPeer(request, incoming) {
94
+ if (typeof incoming !== "object" || incoming === null)
95
+ return false;
96
+ try {
97
+ const socket = incoming.socket;
98
+ if (typeof socket?.remoteAddress !== "string")
99
+ return false;
100
+ return recordRequestPeerFromTransport(request, {
101
+ runtime: "node",
102
+ transport: "tcp",
103
+ hostname: socket.remoteAddress,
104
+ });
105
+ }
106
+ catch {
107
+ return false;
108
+ }
109
+ }
110
+ /** @internal Record the native peer supplied by a Bun server context. */
111
+ export function recordBunServerRequestPeer(request, server) {
112
+ if (typeof server !== "object" || server === null)
113
+ return false;
114
+ try {
115
+ const requestIP = server.requestIP;
116
+ if (typeof requestIP !== "function")
117
+ return false;
118
+ const peer = requestIP.call(server, request);
119
+ if (typeof peer?.address !== "string")
120
+ return false;
121
+ return recordRequestPeerFromTransport(request, {
122
+ runtime: "bun",
123
+ transport: "tcp",
124
+ hostname: peer.address,
125
+ });
126
+ }
127
+ catch {
128
+ return false;
129
+ }
130
+ }
131
+ /**
132
+ * @internal Record native peer context passed through a public handler bridge.
133
+ * Supports Deno.serve handler info, Node IncomingMessage values, and Bun server
134
+ * context values.
135
+ */
136
+ export function recordHandlerRequestPeer(request, context) {
137
+ return recordDenoServeRequestPeer(request, context) ||
138
+ recordNodeIncomingRequestPeer(request, context) ||
139
+ recordBunServerRequestPeer(request, context);
140
+ }
71
141
  /** @internal Read immutable transport provenance without consulting headers. */
72
142
  export function getRequestPeerProvenance(request) {
73
143
  return requestPeerProvenance.get(request);
@@ -87,6 +157,18 @@ export function inheritRequestPeerProvenance(source, target) {
87
157
  requestPeerProvenance.set(target, provenance);
88
158
  return target;
89
159
  }
160
+ /** @internal Run an interceptor without discarding transport peer authority. */
161
+ export async function runRequestInterceptor(request, interceptor) {
162
+ interceptorHandledRequests.add(request);
163
+ const intercepted = await interceptor(request);
164
+ if (intercepted === request)
165
+ return request;
166
+ if (interceptorHandledRequests.has(intercepted)) {
167
+ throw new TypeError("Request interceptors must return a fresh replacement Request");
168
+ }
169
+ interceptorHandledRequests.add(intercepted);
170
+ return inheritRequestPeerProvenance(request, intercepted);
171
+ }
90
172
  /** @internal True for IPv4 127/8, IPv6 ::1, or mapped IPv4 127/8. */
91
173
  export function isLoopbackAddress(hostname) {
92
174
  const ipv4 = parseCanonicalIpv4(hostname);
@@ -7,7 +7,7 @@
7
7
  * Client identity for guarded egress, standing in for the runtime-supplied
8
8
  * `user-agent` (`node`, `Deno/x.y.z`) that this transport cannot inherit.
9
9
  */
10
- export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.1237";
10
+ export declare const DEFAULT_OUTBOUND_USER_AGENT = "veryfront/0.1.1239";
11
11
  /**
12
12
  * Fill in the request headers a plain `fetch` attaches on its own, leaving any
13
13
  * the caller set untouched. This transport talks to `node:http` directly, so
@@ -68,7 +68,11 @@ export declare function requestJson(options: {
68
68
  maxResponseBytes?: number;
69
69
  }): Promise<unknown>;
70
70
  /**
71
- * Request a streaming response.
71
+ * Request a streaming response. When the request body is replayable,
72
+ * classified rate-limit responses are retried up to two times before provider
73
+ * output is exposed, with all retry waits and attempts bounded by the stream
74
+ * header deadline. ReadableStream request bodies are not retried because fetch
75
+ * can consume them on the first attempt.
72
76
  *
73
77
  * Response headers and error bodies have a 30-second default deadline. After
74
78
  * headers arrive, caller cancellation remains connected to the returned body;
@@ -1 +1 @@
1
- {"version":3,"file":"provider-http.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/runtime-loader/provider-http.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,CAAC;AA8BxF;;;;;GAKG;AACH,qBAAa,aAAc,SAAQ,KAAK;IACtC,QAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;IAChC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B;;;OAGG;IACH,SAAiB,YAAY,CAAC,EAAE,MAAM,CAAC;gBAE3B,OAAO,EAAE;QACnB,QAAQ,EAAE,YAAY,CAAC;QACvB,MAAM,EAAE,MAAM,CAAC;QACf,OAAO,EAAE,MAAM,CAAC;QAChB,SAAS,EAAE,OAAO,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB;CAcF;AAED,4EAA4E;AAC5E,qBAAa,uBAAwB,SAAQ,aAAa;CAAG;AAE7D,mFAAmF;AACnF,qBAAa,sBAAuB,SAAQ,aAAa;CAAG;AAE5D,2DAA2D;AAC3D,qBAAa,kBAAmB,SAAQ,aAAa;CAAG;AAExD,6DAA6D;AAC7D,qBAAa,oBAAqB,SAAQ,aAAa;CAAG;AAe1D,6BAA6B;AAC7B,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAuB3E;AA+BD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,UAAU,CAAC,KAAK,CAAC;IACnC,IAAI,EAAE,WAAW,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,cAAc,CAAC,UAAU,CAAC,CAAC,CAiEtC"}
@@ -5,6 +5,8 @@ import { MAX_TIMER_DELAY_MS, normalizeTimerDurationMs } from "../../utils/timer.
5
5
  const MAX_ERROR_BODY_BYTES = 8_000;
6
6
  const DEFAULT_PROVIDER_JSON_TIMEOUT_MS = 5 * 60_000;
7
7
  const DEFAULT_PROVIDER_STREAM_HEADERS_TIMEOUT_MS = 30_000;
8
+ const MAX_PROVIDER_STREAM_RATE_LIMIT_RETRIES = 2;
9
+ const DEFAULT_PROVIDER_STREAM_RATE_LIMIT_RETRY_DELAY_MS = 1_000;
8
10
  const DEFAULT_PROVIDER_JSON_MAX_BYTES = 32 * 1024 * 1024;
9
11
  const MAX_PROVIDER_JSON_MAX_BYTES = 256 * 1024 * 1024;
10
12
  const MAX_PROVIDER_JSON_BODY_READS = 65_536;
@@ -367,6 +369,25 @@ async function waitForAbortable(operation, abortSignal, onLateValue) {
367
369
  });
368
370
  });
369
371
  }
372
+ async function waitForProviderRateLimitRetry(delayMs, abortSignal) {
373
+ abortSignal.throwIfAborted();
374
+ if (delayMs === 0)
375
+ return;
376
+ await new Promise((resolve, reject) => {
377
+ const timeoutId = setTimeout(() => {
378
+ abortSignal.removeEventListener("abort", onAbort);
379
+ resolve();
380
+ }, delayMs);
381
+ const onAbort = () => {
382
+ clearTimeout(timeoutId);
383
+ abortSignal.removeEventListener("abort", onAbort);
384
+ reject(abortSignal.reason);
385
+ };
386
+ abortSignal.addEventListener("abort", onAbort, { once: true });
387
+ if (abortSignal.aborted)
388
+ onAbort();
389
+ });
390
+ }
370
391
  function cancelLateResponse(response) {
371
392
  try {
372
393
  const cancellation = response.body?.cancel();
@@ -587,7 +608,11 @@ export async function requestJson(options) {
587
608
  }
588
609
  }
589
610
  /**
590
- * Request a streaming response.
611
+ * Request a streaming response. When the request body is replayable,
612
+ * classified rate-limit responses are retried up to two times before provider
613
+ * output is exposed, with all retry waits and attempts bounded by the stream
614
+ * header deadline. ReadableStream request bodies are not retried because fetch
615
+ * can consume them on the first attempt.
591
616
  *
592
617
  * Response headers and error bodies have a 30-second default deadline. After
593
618
  * headers arrive, caller cancellation remains connected to the returned body;
@@ -596,24 +621,37 @@ export async function requestJson(options) {
596
621
  export async function requestStream(options) {
597
622
  const deadline = createRequestDeadline(options.init, options.headersTimeoutMs ?? DEFAULT_PROVIDER_STREAM_HEADERS_TIMEOUT_MS, "headersTimeoutMs");
598
623
  let streamOwnsDeadline = false;
624
+ let rateLimitRetryCount = 0;
625
+ const requestBodyIsReplayable = !(deadline.init.body instanceof ReadableStream);
599
626
  try {
600
- const response = await waitForAbortable(() => options.fetchImpl(options.url, deadline.init), deadline.deadlineSignal, cancelLateResponse);
601
- if (!response.ok) {
602
- const err = await buildProviderError(options.providerKind, response, deadline.deadlineSignal);
603
- err.message = `${options.providerLabel} request failed: ${err.message}`;
604
- throw err;
605
- }
606
- if (!response.body) {
607
- throw new ProviderRequestError({
608
- provider: options.providerKind,
609
- status: response.status,
610
- message: `${options.providerLabel} request failed: stream body missing`,
611
- retryable: false,
612
- });
627
+ while (true) {
628
+ const response = await waitForAbortable(() => options.fetchImpl(options.url, deadline.init), deadline.deadlineSignal, cancelLateResponse);
629
+ if (!response.ok) {
630
+ const err = await buildProviderError(options.providerKind, response, deadline.deadlineSignal);
631
+ err.message = `${options.providerLabel} request failed: ${err.message}`;
632
+ if (err instanceof ProviderRateLimitError &&
633
+ requestBodyIsReplayable &&
634
+ rateLimitRetryCount < MAX_PROVIDER_STREAM_RATE_LIMIT_RETRIES) {
635
+ const retryDelayMs = err.retryAfterMs ??
636
+ DEFAULT_PROVIDER_STREAM_RATE_LIMIT_RETRY_DELAY_MS * 2 ** rateLimitRetryCount;
637
+ rateLimitRetryCount++;
638
+ await waitForProviderRateLimitRetry(retryDelayMs, deadline.deadlineSignal);
639
+ continue;
640
+ }
641
+ throw err;
642
+ }
643
+ if (!response.body) {
644
+ throw new ProviderRequestError({
645
+ provider: options.providerKind,
646
+ status: response.status,
647
+ message: `${options.providerLabel} request failed: stream body missing`,
648
+ retryable: false,
649
+ });
650
+ }
651
+ deadline.cancelTimeout();
652
+ streamOwnsDeadline = true;
653
+ return streamWithCleanup(response.body, deadline.deadlineSignal, deadline.abort, deadline.dispose);
613
654
  }
614
- deadline.cancelTimeout();
615
- streamOwnsDeadline = true;
616
- return streamWithCleanup(response.body, deadline.deadlineSignal, deadline.abort, deadline.dispose);
617
655
  }
618
656
  catch (error) {
619
657
  if (deadline.timedOut) {
@@ -15,4 +15,5 @@ export { MAX_PROVIDER_SSE_BUFFER_CODE_UNITS, parseFinalSseChunk, parseSseChunk,
15
15
  export { buildProviderError, createWarningCollector, isNumberArray, jsonValuesEqual, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, readGatewayBillingMode, readProviderOptions, readRecord, readTextParts, requestJson, requestStream, snapshotJsonValue, snapshotProviderJsonValue, stringifyJsonValue, stringifyToolArguments, stringifyToolResultValue, toOpenAICompatibleMessages, toOpenAICompatibleTools, unwrapToolInputSchema, } from "../runtime-loader.js";
16
16
  export type { JsonSnapshotOptions, JsonSnapshotValue, OpenAICompatibleChatMessage, OpenAICompatibleChatRequest, ProviderWarning, RuntimeUsage, } from "../runtime-loader.js";
17
17
  export type { ModelRuntimeCallOptions, ModelRuntimePromptMessage, ModelRuntimeToolDefinition, RuntimeAssistantContentPart, RuntimePromptMessage, RuntimeReasoningOption, RuntimeResponseFormat, } from "../types.js";
18
+ export { canIdentifyProxyWithoutHooks, isProxyWithoutHooks, } from "../../platform/compat/error-introspection.js";
18
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,kCAAkC,EAClC,kBAAkB,EAClB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/shared/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,4BAA4B,CAAC;AAEpC,OAAO,EACL,uBAAuB,EACvB,qBAAqB,EACrB,2BAA2B,EAC3B,iCAAiC,EACjC,2BAA2B,EAC3B,qBAAqB,EACrB,qBAAqB,GACtB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,4CAA4C,CAAC;AAGpD,OAAO,EACL,+BAA+B,EAC/B,8BAA8B,GAC/B,MAAM,wCAAwC,CAAC;AAGhD,OAAO,EACL,kCAAkC,EAClC,kBAAkB,EAClB,aAAa,GACd,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,kBAAkB,EAClB,sBAAsB,EACtB,aAAa,EACb,eAAe,EACf,UAAU,EACV,iBAAiB,EACjB,aAAa,EACb,uBAAuB,EACvB,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,aAAa,EACb,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,yBAAyB,EACzB,kBAAkB,EAClB,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,sBAAsB,CAAC;AAE9B,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,2BAA2B,EAC3B,2BAA2B,EAC3B,eAAe,EACf,YAAY,GACb,MAAM,sBAAsB,CAAC;AAC9B,YAAY,EACV,uBAAuB,EACvB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC3B,oBAAoB,EACpB,sBAAsB,EACtB,qBAAqB,GACtB,MAAM,aAAa,CAAC;AAGrB,OAAO,EACL,4BAA4B,EAC5B,mBAAmB,GACpB,MAAM,8CAA8C,CAAC"}
@@ -18,3 +18,5 @@ export { TOOL_INPUT_PENDING_THRESHOLD_MS, withToolInputStatusTransitions, } from
18
18
  export { MAX_PROVIDER_SSE_BUFFER_CODE_UNITS, parseFinalSseChunk, parseSseChunk, } from "../runtime-loader/provider-sse.js";
19
19
  // Retry, error, HTTP, usage, and JSON boundary plumbing.
20
20
  export { buildProviderError, createWarningCollector, isNumberArray, jsonValuesEqual, mergeUsage, parseRetryAfterMs, ProviderError, ProviderOverloadedError, ProviderQuotaError, ProviderRateLimitError, ProviderRequestError, readGatewayBillingMode, readProviderOptions, readRecord, readTextParts, requestJson, requestStream, snapshotJsonValue, snapshotProviderJsonValue, stringifyJsonValue, stringifyToolArguments, stringifyToolResultValue, toOpenAICompatibleMessages, toOpenAICompatibleTools, unwrapToolInputSchema, } from "../runtime-loader.js";
21
+ // No-hook runtime inspection used by provider extensions at JSON boundaries.
22
+ export { canIdentifyProxyWithoutHooks, isProxyWithoutHooks, } from "../../platform/compat/error-introspection.js";
@@ -59,6 +59,7 @@ export type RuntimeAssistantContentPart = Exclude<RuntimePromptAssistantContentP
59
59
  export type RuntimePromptMessage = {
60
60
  role: "system";
61
61
  content: string;
62
+ providerOptions?: Record<string, unknown>;
62
63
  } | {
63
64
  role: "user";
64
65
  content: Array<{
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/src/provider/types.ts"],"names":[],"mappings":"AAAA,OAAO,yBAAyB,CAAC;AACjC,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACjC;AAED,KAAK,iCAAiC,GAClC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC9B;IACA,IAAI,EAAE,WAAW,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,OAAO,CAAC;IACf,gBAAgB,CAAC,E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O,EAAE;QACf,MAAM,EAAE,MAAM,EAAE,CAAC;QACjB,WAAW,CAAC,EAAE,WAAW,CAAC;KAC3B,GAAG,WAAW,CAAC;QACd,UAAU,EAAE,MAAM,EAAE,EAAE,CAAC;QACvB,KAAK,CAAC,EAAE;YACN,MAAM,CAAC,EAAE,MAAM,CAAC;SACjB,CAAC;QACF,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,QAAQ,CAAC,EAAE,OAAO,EAAE,CAAC;KACtB,CAAC,CAAC;CACJ"}
@@ -0,0 +1,3 @@
1
+ import type { ComboboxParts } from "../contract.js";
2
+ export declare const builtinCombobox: ComboboxParts;
3
+ //# sourceMappingURL=combobox.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/combobox.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAiB,MAAM,gBAAgB,CAAC;AAoRnE,eAAO,MAAM,eAAe,EAAE,aAK7B,CAAC"}
@@ -0,0 +1,204 @@
1
+ /**
2
+ * Builtin Combobox adapter - the zero-dependency, hand-rolled engine for the
3
+ * Combobox primitive: a `role="combobox"` text input filtering a `role="listbox"`
4
+ * of `role="option"`s, with `aria-activedescendant` keyboard navigation
5
+ * (ArrowUp/Down/Home/End/Enter/Escape) over the *filtered* option set. Filtering,
6
+ * the option registry, and the active-descendant live here (the adapter), not in
7
+ * the skin - see {@link ComboboxState}. The floating listbox portals into the
8
+ * token scope via `Floating`. No `cmdk`/Base UI dependency; those are opt-in
9
+ * adapters that satisfy the same `ComboboxParts` contract.
10
+ *
11
+ * @module react/components/ui/adapter/builtin/combobox
12
+ */
13
+ import * as React from "react";
14
+ import { createStrictContext } from "../../../create-strict-context.js";
15
+ import { Floating } from "../../floating.js";
16
+ const [ComboboxContext, useCombobox] = createStrictContext("Combobox components", "<Combobox>");
17
+ function ComboboxRoot({ children, value, defaultValue, onValueChange, open, defaultOpen, onOpenChange, defaultInputValue, optionLabels = [], onInputValueChange, }) {
18
+ const listboxId = React.useId();
19
+ const anchorRef = React.useRef(null);
20
+ const optionsRef = React.useRef([]);
21
+ const selectedValue = value ?? defaultValue;
22
+ const selectedLabel = optionLabels.find((option) => option.value === selectedValue)?.text;
23
+ const [query, setQueryState] = React.useState(defaultInputValue ?? selectedLabel ?? "");
24
+ const [internalValue, setInternalValue] = React.useState(defaultValue);
25
+ const [internalOpen, setInternalOpen] = React.useState(defaultOpen ?? false);
26
+ const [activeId, setActiveId] = React.useState(undefined);
27
+ const isValueControlled = value !== undefined;
28
+ const isOpenControlled = open !== undefined;
29
+ const currentValue = isValueControlled ? value : internalValue;
30
+ const isOpen = isOpenControlled ? open : internalOpen;
31
+ const synchronizedValueRef = React.useRef(defaultInputValue !== undefined || selectedLabel !== undefined ? currentValue : undefined);
32
+ React.useEffect(() => {
33
+ if (currentValue === undefined && !isValueControlled)
34
+ return;
35
+ if (!isValueControlled && synchronizedValueRef.current === currentValue)
36
+ return;
37
+ const label = optionLabels.find((option) => option.value === currentValue)?.text;
38
+ if (label === undefined) {
39
+ synchronizedValueRef.current = currentValue;
40
+ setQueryState((previous) => previous === "" ? previous : "");
41
+ onInputValueChange?.("");
42
+ return;
43
+ }
44
+ if (synchronizedValueRef.current === currentValue)
45
+ return;
46
+ synchronizedValueRef.current = currentValue;
47
+ setQueryState(label);
48
+ onInputValueChange?.(label);
49
+ }, [currentValue, isValueControlled, onInputValueChange, optionLabels]);
50
+ const matches = React.useCallback((text) => !query || text.toLowerCase().includes(query.toLowerCase()), [query]);
51
+ const setOpen = React.useCallback((next) => {
52
+ if (!isOpenControlled)
53
+ setInternalOpen(next);
54
+ onOpenChange?.(next);
55
+ if (!next)
56
+ setActiveId(undefined);
57
+ }, [isOpenControlled, onOpenChange]);
58
+ const setQuery = React.useCallback((next) => {
59
+ setQueryState(next);
60
+ onInputValueChange?.(next);
61
+ setActiveId(undefined);
62
+ if (!isOpenControlled)
63
+ setInternalOpen(true);
64
+ onOpenChange?.(true);
65
+ }, [isOpenControlled, onOpenChange, onInputValueChange]);
66
+ const select = React.useCallback((nextValue, text) => {
67
+ if (!isValueControlled)
68
+ setInternalValue(nextValue);
69
+ synchronizedValueRef.current = nextValue;
70
+ onValueChange?.(nextValue);
71
+ setQueryState(text);
72
+ onInputValueChange?.(text);
73
+ setActiveId(undefined);
74
+ if (!isOpenControlled)
75
+ setInternalOpen(false);
76
+ onOpenChange?.(false);
77
+ }, [isValueControlled, onValueChange, isOpenControlled, onOpenChange, onInputValueChange]);
78
+ const registerOption = React.useCallback((id, value, text, disabled = false) => {
79
+ const existing = optionsRef.current.find((o) => o.id === id);
80
+ if (existing) {
81
+ existing.value = value;
82
+ existing.text = text;
83
+ existing.disabled = disabled;
84
+ }
85
+ else {
86
+ optionsRef.current.push({ id, value, text, disabled });
87
+ }
88
+ }, []);
89
+ const unregisterOption = React.useCallback((id) => {
90
+ optionsRef.current = optionsRef.current.filter((o) => o.id !== id);
91
+ }, []);
92
+ const onInputKeyDown = React.useCallback((event) => {
93
+ const visible = optionsRef.current.filter((o) => !o.disabled && matches(o.text));
94
+ const currentIndex = visible.findIndex((o) => o.id === activeId);
95
+ const move = (nextIndex) => {
96
+ const clamped = Math.max(0, Math.min(visible.length - 1, nextIndex));
97
+ setActiveId(visible[clamped]?.id);
98
+ };
99
+ switch (event.key) {
100
+ case "ArrowDown":
101
+ event.preventDefault();
102
+ if (!isOpen)
103
+ setOpen(true);
104
+ else
105
+ move(currentIndex + 1);
106
+ break;
107
+ case "ArrowUp":
108
+ event.preventDefault();
109
+ if (!isOpen)
110
+ setOpen(true);
111
+ else
112
+ move(currentIndex <= 0 ? 0 : currentIndex - 1);
113
+ break;
114
+ case "Home":
115
+ if (isOpen && visible.length) {
116
+ event.preventDefault();
117
+ move(0);
118
+ }
119
+ break;
120
+ case "End":
121
+ if (isOpen && visible.length) {
122
+ event.preventDefault();
123
+ move(visible.length - 1);
124
+ }
125
+ break;
126
+ case "Enter": {
127
+ const active = visible.find((o) => o.id === activeId);
128
+ if (isOpen && active) {
129
+ event.preventDefault();
130
+ select(active.value, active.text);
131
+ }
132
+ break;
133
+ }
134
+ case "Escape":
135
+ if (isOpen) {
136
+ event.preventDefault();
137
+ setOpen(false);
138
+ }
139
+ break;
140
+ }
141
+ }, [matches, activeId, isOpen, setOpen, select]);
142
+ const ctx = React.useMemo(() => ({
143
+ query,
144
+ setQuery,
145
+ open: isOpen,
146
+ setOpen,
147
+ value: currentValue,
148
+ select,
149
+ activeId,
150
+ matches,
151
+ listboxId,
152
+ registerOption,
153
+ unregisterOption,
154
+ onInputKeyDown,
155
+ anchorRef,
156
+ }), [
157
+ query,
158
+ setQuery,
159
+ isOpen,
160
+ setOpen,
161
+ currentValue,
162
+ select,
163
+ activeId,
164
+ matches,
165
+ listboxId,
166
+ registerOption,
167
+ unregisterOption,
168
+ onInputKeyDown,
169
+ ]);
170
+ return React.createElement(ComboboxContext.Provider, { value: ctx }, children);
171
+ }
172
+ function ComboboxInputPart({ className, onChange, onKeyDown, onFocus, ref, ...props }) {
173
+ const ctx = useCombobox();
174
+ const setRef = React.useCallback((node) => {
175
+ ctx.anchorRef.current = node;
176
+ if (typeof ref === "function")
177
+ ref(node);
178
+ else if (ref != null)
179
+ ref.current = node;
180
+ }, [ctx.anchorRef, ref]);
181
+ return (React.createElement("input", { ref: setRef, role: "combobox", "aria-expanded": ctx.open, "aria-controls": ctx.listboxId, "aria-activedescendant": ctx.activeId, "aria-autocomplete": "list", autoComplete: "off", value: ctx.query, className: className, onChange: (event) => {
182
+ onChange?.(event);
183
+ ctx.setQuery(event.target.value);
184
+ }, onKeyDown: (event) => {
185
+ onKeyDown?.(event);
186
+ if (!event.defaultPrevented)
187
+ ctx.onInputKeyDown(event);
188
+ }, onFocus: (event) => {
189
+ onFocus?.(event);
190
+ if (!ctx.open)
191
+ ctx.setOpen(true);
192
+ }, ...props }));
193
+ }
194
+ function ComboboxContentPart({ className, children, ref, ...props }) {
195
+ const ctx = useCombobox();
196
+ return (React.createElement(Floating, { anchorRef: ctx.anchorRef, open: ctx.open, align: "start", matchTriggerWidth: true, onDismiss: () => ctx.setOpen(false), role: "listbox", id: ctx.listboxId, className: className, contentRef: ref, ...props },
197
+ React.createElement("div", { className: "p-1.5" }, children)));
198
+ }
199
+ export const builtinCombobox = {
200
+ Root: ComboboxRoot,
201
+ Input: ComboboxInputPart,
202
+ Content: ComboboxContentPart,
203
+ useCombobox: useCombobox,
204
+ };
@@ -0,0 +1,3 @@
1
+ import type { DialogParts } from "../contract.js";
2
+ export declare const builtinDialog: DialogParts;
3
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/dialog.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAMlD,eAAO,MAAM,aAAa,EAAE,WAM3B,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Builtin Dialog adapter - a behaviour-preserving wrapper over the existing
3
+ * `createModalSurfaceParts("Dialog")` machinery (overlay + centered panel,
4
+ * Escape / overlay-click dismiss, first-focusable focus + restoration). The
5
+ * default zero-dependency engine; nothing about the rendered output changes
6
+ * versus the pre-adapter `dialog.tsx`.
7
+ *
8
+ * @module react/components/ui/adapter/builtin/dialog
9
+ */
10
+ import { createModalSurfaceParts } from "../../modal-surface.js";
11
+ // One instance at module scope - distinct from Drawer's so a nested DrawerClose
12
+ // cannot close an enclosing Dialog.
13
+ const parts = createModalSurfaceParts("Dialog");
14
+ export const builtinDialog = {
15
+ Root: parts.ModalRoot,
16
+ Trigger: parts.ModalTrigger,
17
+ Content: parts.ModalContent,
18
+ Close: parts.ModalClose,
19
+ useDialog: parts.useModal,
20
+ };
@@ -0,0 +1,3 @@
1
+ import type { DrawerParts } from "../contract.js";
2
+ export declare const builtinDrawer: DrawerParts;
3
+ //# sourceMappingURL=drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/drawer.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,eAAO,MAAM,aAAa,EAAE,WAQ3B,CAAC"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Builtin Drawer adapter - the zero-dependency STATIC bottom sheet: the shared
3
+ * modal surface (overlay + panel, Escape/outside-click dismiss) assembled as
4
+ * `DrawerParts`, with the drawer skin supplying the edge-slide layout. No drag
5
+ * physics. Custom drawer adapters can supply different mechanics through
6
+ * `UIAdapterProvider`.
7
+ *
8
+ * @module react/components/ui/adapter/builtin/drawer
9
+ */
10
+ import { createModalSurfaceParts } from "../../modal-surface.js";
11
+ // A distinct modal instance from Dialog's, so the two never share open-state.
12
+ const parts = createModalSurfaceParts("Drawer");
13
+ export const builtinDrawer = {
14
+ // `direction` is ignored by the builtin (the skin positions the sheet); it is
15
+ // part of the contract for engines like Vaul that drive the slide direction.
16
+ Root: ({ direction: _direction, ...props }) => React.createElement(parts.ModalRoot, { ...props }),
17
+ Trigger: parts.ModalTrigger,
18
+ Content: parts.ModalContent,
19
+ Close: parts.ModalClose,
20
+ useDrawer: parts.useModal,
21
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAMhD,eAAO,MAAM,cAAc,EAAE,SAM5B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAWhD,eAAO,MAAM,cAAc,EAAE,SAW5B,CAAC"}
@@ -2,10 +2,20 @@ import { builtinToast } from "./toast.js";
2
2
  import { builtinDisclosure } from "./disclosure.js";
3
3
  import { builtinToggleGroup } from "./toggle-group.js";
4
4
  import { builtinToolbar } from "./toolbar.js";
5
+ import { builtinDialog } from "./dialog.js";
6
+ import { builtinDrawer } from "./drawer.js";
7
+ import { builtinTabs } from "./tabs.js";
8
+ import { builtinPopover } from "./popover.js";
9
+ import { builtinCombobox } from "./combobox.js";
5
10
  export const builtinAdapter = {
6
11
  name: "builtin",
7
12
  toast: builtinToast,
8
13
  disclosure: builtinDisclosure,
9
14
  toggleGroup: builtinToggleGroup,
10
15
  toolbar: builtinToolbar,
16
+ dialog: builtinDialog,
17
+ drawer: builtinDrawer,
18
+ tabs: builtinTabs,
19
+ popover: builtinPopover,
20
+ combobox: builtinCombobox,
11
21
  };
@@ -0,0 +1,3 @@
1
+ import type { PopoverParts } from "../contract.js";
2
+ export declare const builtinPopover: PopoverParts;
3
+ //# sourceMappingURL=popover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"popover.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/ui/adapter/builtin/popover.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAQnD,eAAO,MAAM,cAAc,EAAE,YAQ5B,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Builtin Popover adapter - a behaviour-preserving wrapper over the existing
3
+ * `createAnchoredSurfaceParts()` machinery. This is the default, zero-dependency
4
+ * engine: nothing about the rendered output or behaviour changes versus the
5
+ * pre-adapter `popover.tsx` that called the factory directly.
6
+ *
7
+ * The `<span className="relative inline-block">` positioning anchor now lives
8
+ * entirely inside this builtin adapter (via `AnchoredRoot`) - it is no longer
9
+ * part of the Popover *contract*, so a parts-based engine (Base UI) is free to
10
+ * anchor on the trigger and emit no wrapper at all.
11
+ *
12
+ * @module react/components/ui/adapter/builtin/popover
13
+ */
14
+ import { createAnchoredSurfaceParts } from "../../anchored-surface.js";
15
+ // One instance, created once at module scope - exactly as `popover.tsx` used to
16
+ // do. Keeping this distinct from the DropdownMenu instance preserves the
17
+ // per-skin context isolation (a nested menu must not close an enclosing
18
+ // popover).
19
+ const parts = createAnchoredSurfaceParts();
20
+ export const builtinPopover = {
21
+ Root: parts.AnchoredRoot,
22
+ // `haspopup` is a builtin-machinery concern (Popover vs Menu differ only
23
+ // here), so the builtin trigger supplies it and the skin stays engine-neutral.
24
+ Trigger: (props) => React.createElement(parts.AnchoredTrigger, { haspopup: "dialog", ...props }),
25
+ // Already portals via `Floating` into the nearest `[data-vf-ui]`/`[data-vf-chat]`
26
+ // token scope. The skin passes the contract-level initial-focus default.
27
+ Content: (props) => React.createElement(parts.AnchoredContent, { ...props }),
28
+ };
@@ -0,0 +1,3 @@
1
+ import type { TabsParts } from "../contract.js";
2
+ export declare const builtinTabs: TabsParts;
3
+ //# sourceMappingURL=tabs.d.ts.map