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
@@ -1,4 +1,14 @@
1
1
  export declare function extractNamedImports(code: string, importStatement: string): string[];
2
2
  export declare function generateStubCode(modulePath: string, namedImports?: string[]): string;
3
- export declare function createStubModule(modulePath: string, code: string, importStatement: string, esmCacheDir: string): Promise<string | null>;
3
+ export interface DeferredImportErrorDescriptor {
4
+ name: string;
5
+ message: string;
6
+ }
7
+ export interface CreateStubModuleOptions {
8
+ /** Reject a dynamic import when it executes instead of exporting fallback values. */
9
+ failOnImport?: boolean;
10
+ /** Sanitized typed error to throw when a strict dynamic import executes. */
11
+ deferredError?: DeferredImportErrorDescriptor;
12
+ }
13
+ export declare function createStubModule(modulePath: string, code: string, importStatement: string, esmCacheDir: string, options?: CreateStubModuleOptions): Promise<string | null>;
4
14
  //# sourceMappingURL=stub-module.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stub-module.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,EAAE,CAcV;AAgBD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAM,EAAO,GAC1B,MAAM,CA0BR;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkCxB"}
1
+ {"version":3,"file":"stub-module.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/utils/stub-module.ts"],"names":[],"mappings":"AAOA,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,GACtB,MAAM,EAAE,CAcV;AAgBD,wBAAgB,gBAAgB,CAC9B,UAAU,EAAE,MAAM,EAClB,YAAY,GAAE,MAAM,EAAO,GAC1B,MAAM,CA0BR;AAED,MAAM,WAAW,6BAA6B;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAiBD,MAAM,WAAW,uBAAuB;IACtC,qFAAqF;IACrF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,4EAA4E;IAC5E,aAAa,CAAC,EAAE,6BAA6B,CAAC;CAC/C;AAED,wBAAsB,gBAAgB,CACpC,UAAU,EAAE,MAAM,EAClB,IAAI,EAAE,MAAM,EACZ,eAAe,EAAE,MAAM,EACvB,WAAW,EAAE,MAAM,EACnB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CA4CxB"}
@@ -52,28 +52,45 @@ export default new Proxy(function(){}, handler);
52
52
  ${namedExports}
53
53
  `;
54
54
  }
55
- export async function createStubModule(modulePath, code, importStatement, esmCacheDir) {
55
+ function generateDeferredImportFailureCode(modulePath, deferredError) {
56
+ const message = JSON.stringify(deferredError?.message ??
57
+ `[Veryfront] Missing module: ${modulePath}. This module or file does not exist in your project.`);
58
+ const name = JSON.stringify(deferredError?.name ?? "MissingModuleError");
59
+ return `const error = new Error(${message});
60
+ error.name = ${name};
61
+ throw error;
62
+ `;
63
+ }
64
+ export async function createStubModule(modulePath, code, importStatement, esmCacheDir, options = {}) {
56
65
  const namedImports = extractNamedImports(code, importStatement);
57
- const stubHash = hashString(`stub:${modulePath}:${namedImports.join(",")}`);
66
+ const behavior = options.failOnImport ? "fail-on-import" : "fallback";
67
+ const deferredIdentity = options.deferredError
68
+ ? `${options.deferredError.name}:${options.deferredError.message}`
69
+ : "";
70
+ const stubHash = hashString(`stub:${behavior}:${modulePath}:${namedImports.join(",")}:${deferredIdentity}`);
58
71
  const stubPath = join(esmCacheDir, `stub-${stubHash}.mjs`);
59
- const stubCode = generateStubCode(modulePath, namedImports);
72
+ const stubCode = options.failOnImport
73
+ ? generateDeferredImportFailureCode(modulePath, options.deferredError)
74
+ : generateStubCode(modulePath, namedImports);
60
75
  try {
61
76
  await getLocalFs().writeTextFile(stubPath, stubCode);
62
- const errorMessage = namedImports.length
63
- ? `Missing module: ${modulePath} (imports: ${namedImports.join(", ")})`
64
- : `Missing module: ${modulePath}`;
65
- try {
66
- getErrorCollector().addModuleError(errorMessage, modulePath, {
77
+ if (!options.failOnImport) {
78
+ const errorMessage = namedImports.length
79
+ ? `Missing module: ${modulePath} (imports: ${namedImports.join(", ")})`
80
+ : `Missing module: ${modulePath}`;
81
+ try {
82
+ getErrorCollector().addModuleError(errorMessage, modulePath, {
83
+ namedImports,
84
+ importStatement,
85
+ });
86
+ }
87
+ catch (_) {
88
+ /* expected: error collector may not be initialized in all contexts */
89
+ }
90
+ logger.error(`${LOG_PREFIX_MDX_LOADER} Missing module: ${modulePath}`, {
67
91
  namedImports,
68
- importStatement,
69
92
  });
70
93
  }
71
- catch (_) {
72
- /* expected: error collector may not be initialized in all contexts */
73
- }
74
- logger.error(`${LOG_PREFIX_MDX_LOADER} Missing module: ${modulePath}`, {
75
- namedImports,
76
- });
77
94
  return stubPath;
78
95
  }
79
96
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/pipeline/stages/compile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyB,KAAK,eAAe,EAAkB,MAAM,aAAa,CAAC;AAI1F,eAAO,MAAM,aAAa,EAAE,eAiE3B,CAAC"}
1
+ {"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/pipeline/stages/compile.ts"],"names":[],"mappings":"AAMA,OAAO,EAAyB,KAAK,eAAe,EAAkB,MAAM,aAAa,CAAC;AAoD1F,eAAO,MAAM,aAAa,EAAE,eAqE3B,CAAC"}
@@ -6,6 +6,46 @@ import { upgradeImportAssertions } from "../../esm/import-attributes.js";
6
6
  import { ESBUILD_SUPPORTED_FEATURES, getLoaderFromPath } from "../../esm/transform-utils.js";
7
7
  import { TransformStage } from "../types.js";
8
8
  const logger = rendererLogger.component("esm-transform");
9
+ const ESBUILD_SOURCE_DIAGNOSTIC = Symbol.for("veryfront.bundler.esbuild-source-diagnostic");
10
+ const ObjectPrototypeHasOwnProperty = Object.prototype.hasOwnProperty;
11
+ const ReflectApply = Reflect.apply;
12
+ const ReflectGetOwnPropertyDescriptor = Reflect.getOwnPropertyDescriptor;
13
+ function readOwnDataProperty(value, key) {
14
+ if (value === null ||
15
+ (typeof value !== "object" && typeof value !== "function")) {
16
+ return undefined;
17
+ }
18
+ try {
19
+ const descriptor = ReflectGetOwnPropertyDescriptor(value, key);
20
+ if (descriptor !== undefined &&
21
+ ReflectApply(ObjectPrototypeHasOwnProperty, descriptor, ["value"]) === true) {
22
+ return descriptor.value;
23
+ }
24
+ }
25
+ catch {
26
+ // A hostile proxy cannot provide trusted source-diagnostic evidence.
27
+ }
28
+ return undefined;
29
+ }
30
+ function isEsbuildSourceDiagnostic(error) {
31
+ return readOwnDataProperty(error, ESBUILD_SOURCE_DIAGNOSTIC) === true;
32
+ }
33
+ /**
34
+ * `.mdx` and `.md` reach this stage as *generated* JSX: PARSE has already run
35
+ * the MDX compiler over the tenant's source, so `ctx.code` here is framework
36
+ * output. A diagnostic with a location points into that generated code, not
37
+ * into anything the project wrote, so it must not claim tenant ownership — a
38
+ * remark/rehype/recma plugin emitting broken JSX is a framework fault that has
39
+ * to page someone.
40
+ *
41
+ * Nothing is lost by refusing to infer ownership for these two extensions:
42
+ * genuine MDX and Markdown *source* errors are classified upstream at PARSE as
43
+ * `mdx-compile-error` / `markdown-compile-error`, both of which the shared
44
+ * tenant classifier already recognizes.
45
+ */
46
+ function isGeneratedContentOutput(filePath) {
47
+ return filePath.endsWith(".mdx") || filePath.endsWith(".md");
48
+ }
9
49
  export const compilePlugin = {
10
50
  name: "esbuild-compile",
11
51
  stage: TransformStage.COMPILE,
@@ -58,6 +98,10 @@ export const compilePlugin = {
58
98
  throw COMPILATION_ERROR.create({
59
99
  detail: `ESM transform failed for ${ctx.filePath} (loader: ${loader}): ${errorMsg}`,
60
100
  cause: err,
101
+ context: {
102
+ tenantBuildFailure: !isGeneratedContentOutput(ctx.filePath) &&
103
+ isEsbuildSourceDiagnostic(err),
104
+ },
61
105
  });
62
106
  }
63
107
  },
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Import specifier query/hash suffix splitting.
3
+ *
4
+ * @module transforms/shared/specifier-suffix
5
+ */
6
+ /** A specifier split into its path and its trailing `?query` / `#hash`. */
7
+ export interface SplitSpecifier {
8
+ readonly path: string;
9
+ readonly suffix: string;
10
+ }
11
+ /**
12
+ * Split an import specifier into the path and everything from the first `?` or
13
+ * `#` onward, whichever comes first.
14
+ *
15
+ * The cut is at whichever delimiter appears first, not at `?` by preference:
16
+ * `@/a#b?c` is a hash whose fragment happens to contain a `?`, so the suffix is
17
+ * `#b?c` and the path is `@/a`. Splitting on `?` there would leave `#b` stuck
18
+ * on the path and no file would resolve.
19
+ *
20
+ * This is the single definition of that rule. It previously existed as three
21
+ * separate copies across the alias, nested-import and HTTP-cache resolvers,
22
+ * which agreed only by coincidence.
23
+ */
24
+ export declare function splitSpecifierSuffix(specifier: string): SplitSpecifier;
25
+ //# sourceMappingURL=specifier-suffix.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"specifier-suffix.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/shared/specifier-suffix.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAeH,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,cAAc,CActE"}
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Import specifier query/hash suffix splitting.
3
+ *
4
+ * @module transforms/shared/specifier-suffix
5
+ */
6
+ const ReflectApply = Reflect.apply;
7
+ const MathMin = Math.min;
8
+ const StringIndexOf = String.prototype.indexOf;
9
+ const StringSlice = String.prototype.slice;
10
+ function stringIndexOf(value, search) {
11
+ return ReflectApply(StringIndexOf, value, [search]);
12
+ }
13
+ function stringSlice(value, start, end) {
14
+ return ReflectApply(StringSlice, value, end === undefined ? [start] : [start, end]);
15
+ }
16
+ /**
17
+ * Split an import specifier into the path and everything from the first `?` or
18
+ * `#` onward, whichever comes first.
19
+ *
20
+ * The cut is at whichever delimiter appears first, not at `?` by preference:
21
+ * `@/a#b?c` is a hash whose fragment happens to contain a `?`, so the suffix is
22
+ * `#b?c` and the path is `@/a`. Splitting on `?` there would leave `#b` stuck
23
+ * on the path and no file would resolve.
24
+ *
25
+ * This is the single definition of that rule. It previously existed as three
26
+ * separate copies across the alias, nested-import and HTTP-cache resolvers,
27
+ * which agreed only by coincidence.
28
+ */
29
+ export function splitSpecifierSuffix(specifier) {
30
+ const queryStart = stringIndexOf(specifier, "?");
31
+ const hashStart = stringIndexOf(specifier, "#");
32
+ const suffixStart = queryStart === -1
33
+ ? hashStart
34
+ : hashStart === -1
35
+ ? queryStart
36
+ : MathMin(queryStart, hashStart);
37
+ if (suffixStart === -1)
38
+ return { path: specifier, suffix: "" };
39
+ return {
40
+ path: stringSlice(specifier, 0, suffixStart),
41
+ suffix: stringSlice(specifier, suffixStart),
42
+ };
43
+ }
@@ -24,9 +24,9 @@
24
24
  import "../../_dnt.polyfills.js";
25
25
  export { discoverSourceTriggers } from "./discovery.js";
26
26
  export { runTriggerTarget } from "./local-runner.js";
27
- export { isTriggerTarget } from "./target.js";
27
+ export { conversationConflictDiagnostic, declarationConflictDiagnostic, isTriggerTarget, } from "./target.js";
28
28
  export { isTriggerId } from "./validation.js";
29
29
  export type { SourceTriggerDiscoveryError, SourceTriggerDiscoveryErrorCode, SourceTriggerDiscoveryOptions, SourceTriggerDiscoveryResult, SourceTriggerKind, TriggerDefinitionWithId, TriggerDiscoveryOptions, } from "./discovery.js";
30
30
  export type { RunTriggerTargetOptions, TriggerTargetRunResult } from "./local-runner.js";
31
- export type { TriggerTarget, TriggerTargetKind } from "./target.js";
31
+ export type { AgentConversationMode, AgentTriggerTarget, ResolvedTriggerTarget, TaskTriggerTarget, TriggerTarget, TriggerTargetConfig, TriggerTargetKind, WorkflowTriggerTarget, } from "./target.js";
32
32
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzF,YAAY,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EACL,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,GAChB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,YAAY,EACV,2BAA2B,EAC3B,+BAA+B,EAC/B,6BAA6B,EAC7B,4BAA4B,EAC5B,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,gBAAgB,CAAC;AACxB,YAAY,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACzF,YAAY,EACV,qBAAqB,EACrB,kBAAkB,EAClB,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,aAAa,CAAC"}
@@ -24,5 +24,5 @@
24
24
  import "../../_dnt.polyfills.js";
25
25
  export { discoverSourceTriggers } from "./discovery.js";
26
26
  export { runTriggerTarget } from "./local-runner.js";
27
- export { isTriggerTarget } from "./target.js";
27
+ export { conversationConflictDiagnostic, declarationConflictDiagnostic, isTriggerTarget, } from "./target.js";
28
28
  export { isTriggerId } from "./validation.js";
@@ -1,6 +1,6 @@
1
1
  import type { RuntimeAdapter } from "../platform/index.js";
2
2
  import type { VeryfrontConfig } from "../config/index.js";
3
- import { type TriggerTarget } from "./target.js";
3
+ import { type TriggerTarget, type TriggerTargetConfig } from "./target.js";
4
4
  /** Options for one local trigger target execution. */
5
5
  export interface RunTriggerTargetOptions {
6
6
  /** Project root used by unified runtime discovery. */
@@ -14,7 +14,7 @@ export interface RunTriggerTargetOptions {
14
14
  /** Project identifier exposed to task execution context. */
15
15
  projectId?: string;
16
16
  /** Canonical task, workflow, or agent reference to execute. */
17
- target: TriggerTarget;
17
+ target: TriggerTargetConfig;
18
18
  /** Bounded JSON input supplied to tasks and workflows. */
19
19
  input?: unknown;
20
20
  /** Required prompt input for agent targets. */
@@ -1 +1 @@
1
- {"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/local-runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAAyB,KAAK,aAAa,EAAE,MAAM,aAAa,CAAC;AAKxE,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,OAAO,EAAE,cAAc,CAAC;IACxB,qEAAqE;IACrE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,EAAE,aAAa,CAAC;IACtB,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;CACpB;AAuSD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CAwBjC"}
1
+ {"version":3,"file":"local-runner.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/local-runner.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAU1D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,aAAa,CAAC;AAKrB,sDAAsD;AACtD,MAAM,WAAW,uBAAuB;IACtC,sDAAsD;IACtD,UAAU,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,OAAO,EAAE,cAAc,CAAC;IACxB,qEAAqE;IACrE,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,4DAA4D;IAC5D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,MAAM,EAAE,mBAAmB,CAAC;IAC5B,0DAA0D;IAC1D,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACvC,2EAA2E;IAC3E,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,yCAAyC;IACzC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,8CAA8C;AAC9C,MAAM,WAAW,sBAAsB;IACrC,4BAA4B;IAC5B,IAAI,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IAC5B,mCAAmC;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,sCAAsC;IACtC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kFAAkF;IAClF,UAAU,EAAE,MAAM,CAAC;CACpB;AAuSD;;;;;;GAMG;AACH,wBAAsB,gBAAgB,CACpC,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,sBAAsB,CAAC,CA+BjC"}
@@ -6,7 +6,7 @@ import { createWorkflowClient } from "../workflow/api/workflow-client.js";
6
6
  import { discoverProjectTaskRuntime, findProjectRuntimeTask, } from "../task/project-runtime.js";
7
7
  import { runTask } from "../task/runner.js";
8
8
  import { sleep } from "../utils/sleep.js";
9
- import { snapshotTriggerTarget } from "./target.js";
9
+ import { resolveTriggerTarget, } from "./target.js";
10
10
  import { snapshotSerializable } from "./validation.js";
11
11
  const WORKFLOW_STATUS_POLL_INTERVAL_MS = 1_000;
12
12
  function invalidTriggerConfiguration(detail) {
@@ -257,9 +257,16 @@ async function runAgentTarget(options) {
257
257
  export async function runTriggerTarget(options) {
258
258
  const start = performance.now();
259
259
  options.signal?.throwIfAborted();
260
- const target = snapshotTriggerTarget(options.target);
261
- if (target === null) {
262
- invalidTriggerConfiguration("Trigger target must specify a canonical task, workflow, or agent id.");
260
+ const resolution = resolveTriggerTarget("Trigger target", options.target);
261
+ if (resolution.target === undefined) {
262
+ invalidTriggerConfiguration(resolution.detail);
263
+ }
264
+ const target = resolution.target;
265
+ // A local run never reaches the hosted conversation store, so only
266
+ // `existing` is refusable: `create_new` and `none` both mean "run
267
+ // standalone here" and need no local handling.
268
+ if (target.kind === "agent" && target.conversationMode === "existing") {
269
+ invalidTriggerConfiguration("Local agent trigger runs cannot attach to an existing cloud conversation.");
263
270
  }
264
271
  const normalizedOptions = {
265
272
  ...options,
@@ -1,16 +1,108 @@
1
- /** Supported local trigger target kinds. */
2
- export type TriggerTargetKind = "task" | "workflow" | "agent";
1
+ /** Hosted conversation behavior for an agent trigger target. */
2
+ export type AgentConversationMode = "create_new" | "existing" | "none";
3
+ /** Trigger target addressing a task definition. */
4
+ export interface TaskTriggerTarget extends TriggerTarget {
5
+ /** Definition kind resolved by project runtime discovery. */
6
+ kind: "task";
7
+ /** Canonical slash-separated definition identifier. */
8
+ id: string;
9
+ /** Task targets do not carry hosted conversation behavior. */
10
+ conversationMode?: never;
11
+ /** Task targets do not carry hosted conversation identifiers. */
12
+ conversationId?: never;
13
+ }
14
+ /** Trigger target addressing a workflow definition. */
15
+ export interface WorkflowTriggerTarget extends TriggerTarget {
16
+ /** Definition kind resolved by project runtime discovery. */
17
+ kind: "workflow";
18
+ /** Canonical slash-separated definition identifier. */
19
+ id: string;
20
+ /** Workflow targets do not carry hosted conversation behavior. */
21
+ conversationMode?: never;
22
+ /** Workflow targets do not carry hosted conversation identifiers. */
23
+ conversationId?: never;
24
+ }
25
+ /** Trigger target addressing an agent definition and its hosted conversation. */
26
+ export interface AgentTriggerTarget extends TriggerTarget {
27
+ /** Definition kind resolved by project runtime discovery. */
28
+ kind: "agent";
29
+ /** Canonical slash-separated definition identifier. */
30
+ id: string;
31
+ /** Hosted conversation behavior; defaults to `none`. */
32
+ conversationMode?: AgentConversationMode | undefined;
33
+ /** Existing conversation UUID; required only with `conversationMode: "existing"`. */
34
+ conversationId?: string | null | undefined;
35
+ }
3
36
  /** Canonical reference to a runnable project definition. */
4
37
  export interface TriggerTarget {
5
38
  /** Definition kind resolved by project runtime discovery. */
6
- kind: TriggerTargetKind;
39
+ kind: "task" | "workflow" | "agent";
7
40
  /** Canonical slash-separated definition identifier. */
8
41
  id: string;
9
42
  }
43
+ /** Author-facing target shape accepting stored base values and kind-specific literals. */
44
+ export type TriggerTargetConfig = (TriggerTarget & {
45
+ conversationMode?: never;
46
+ conversationId?: never;
47
+ }) | TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget;
48
+ /** Validated target value that narrows conversation fields by `kind`. */
49
+ export type ResolvedTriggerTarget = TaskTriggerTarget | WorkflowTriggerTarget | AgentTriggerTarget;
50
+ /** Supported local trigger target kinds. */
51
+ export type TriggerTargetKind = TriggerTarget["kind"];
52
+ /**
53
+ * Own keys a trigger target may declare, widened for agent targets.
54
+ *
55
+ * TypeScript without `exactOptionalPropertyTypes` accepts an explicitly
56
+ * undefined value for an optional `never` property. Keep that authoring shape
57
+ * aligned with runtime normalization while still rejecting accessors and every
58
+ * defined conversation value on non-agent targets.
59
+ */
60
+ export declare function triggerTargetKeys(value: unknown): readonly string[];
61
+ /**
62
+ * Describe why agent conversation addressing is invalid, or return `null`.
63
+ *
64
+ * `label` prefixes the diagnostic so schedules, webhooks, and targets report
65
+ * the same invariant with their own field path.
66
+ */
67
+ export declare function agentConversationDiagnostic(label: string, conversationMode: unknown, conversationId: unknown): string | null;
68
+ /**
69
+ * Describe one value declared in two places with disagreeing content.
70
+ *
71
+ * Repeating a value is redundant, not wrong: an author spanning a platform
72
+ * upgrade must be able to write a single definition that both the old and the
73
+ * new platform read correctly. Only a disagreement is unresolvable, because
74
+ * honoring one copy would detach the deployed trigger from what the other copy
75
+ * names.
76
+ */
77
+ export declare function declarationConflictDiagnostic(label: string, path: string, legacyPath: string, value: unknown, legacyValue: unknown): string | null;
78
+ /**
79
+ * Describe a conversation pair that disagrees across two locations.
80
+ *
81
+ * `legacyLabel` names the other location so the message spells out both real
82
+ * field paths without ranking them: which one a given platform reads depends
83
+ * on its version, so neither can be called authoritative here.
84
+ */
85
+ export declare function conversationConflictDiagnostic(label: string, legacyLabel: string, target: ResolvedTriggerTarget, legacyConversationMode: unknown, legacyConversationId: unknown): string | null;
86
+ /** A canonical target, or the reason the value is not one. */
87
+ export type TriggerTargetResolution = {
88
+ readonly target: ResolvedTriggerTarget;
89
+ readonly detail?: undefined;
90
+ } | {
91
+ readonly target?: undefined;
92
+ readonly detail: string;
93
+ };
94
+ /**
95
+ * Validate and copy the canonical fields of a trigger target.
96
+ *
97
+ * Public `TriggerTarget` interfaces are intentionally extendable, so this
98
+ * generic helper ignores caller-owned extension fields. Schedule and webhook
99
+ * authoring validators apply strict key checks before calling this helper.
100
+ */
101
+ export declare function resolveTriggerTarget(label: string, value: unknown): TriggerTargetResolution;
10
102
  /**
11
103
  * Validate and copy a trigger target without retaining caller-owned state.
12
104
  */
13
- export declare function snapshotTriggerTarget(value: unknown): TriggerTarget | null;
105
+ export declare function snapshotTriggerTarget(value: unknown): ResolvedTriggerTarget | null;
14
106
  /** Return true only for canonical targets stored in own data properties. */
15
- export declare function isTriggerTarget(value: unknown): value is TriggerTarget;
107
+ export declare function isTriggerTarget(value: unknown): value is ResolvedTriggerTarget;
16
108
  //# sourceMappingURL=target.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/target.ts"],"names":[],"mappings":"AAEA,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;AAE9D,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,iBAAiB,CAAC;IACxB,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;CACZ;AAOD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,aAAa,GAAG,IAAI,CAgB1E;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,aAAa,CAEtE"}
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../src/src/trigger/target.ts"],"names":[],"mappings":"AAEA,gEAAgE;AAChE,MAAM,MAAM,qBAAqB,GAAG,YAAY,GAAG,UAAU,GAAG,MAAM,CAAC;AAEvE,mDAAmD;AACnD,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,iEAAiE;IACjE,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,uDAAuD;AACvD,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IAC1D,6DAA6D;IAC7D,IAAI,EAAE,UAAU,CAAC;IACjB,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,kEAAkE;IAClE,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,qEAAqE;IACrE,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB;AAED,iFAAiF;AACjF,MAAM,WAAW,kBAAmB,SAAQ,aAAa;IACvD,6DAA6D;IAC7D,IAAI,EAAE,OAAO,CAAC;IACd,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;IACX,wDAAwD;IACxD,gBAAgB,CAAC,EAAE,qBAAqB,GAAG,SAAS,CAAC;IACrD,qFAAqF;IACrF,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CAC5C;AAED,4DAA4D;AAC5D,MAAM,WAAW,aAAa;IAC5B,6DAA6D;IAC7D,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC;IACpC,uDAAuD;IACvD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,0FAA0F;AAC1F,MAAM,MAAM,mBAAmB,GAC3B,CAAC,aAAa,GAAG;IACjB,gBAAgB,CAAC,EAAE,KAAK,CAAC;IACzB,cAAc,CAAC,EAAE,KAAK,CAAC;CACxB,CAAC,GACA,iBAAiB,GACjB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,yEAAyE;AACzE,MAAM,MAAM,qBAAqB,GAC7B,iBAAiB,GACjB,qBAAqB,GACrB,kBAAkB,CAAC;AAEvB,4CAA4C;AAC5C,MAAM,MAAM,iBAAiB,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAuBtD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,SAAS,MAAM,EAAE,CAgBnE;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,cAAc,EAAE,OAAO,GACtB,MAAM,GAAG,IAAI,CAuBf;AAED;;;;;;;;GAQG;AACH,wBAAgB,6BAA6B,CAC3C,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,OAAO,GACnB,MAAM,GAAG,IAAI,CAIf;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,KAAK,EAAE,MAAM,EACb,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,qBAAqB,EAC7B,sBAAsB,EAAE,OAAO,EAC/B,oBAAoB,EAAE,OAAO,GAC5B,MAAM,GAAG,IAAI,CAkBf;AAmBD,8DAA8D;AAC9D,MAAM,MAAM,uBAAuB,GAC/B;IAAE,QAAQ,CAAC,MAAM,EAAE,qBAAqB,CAAC;IAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,GACvE;IAAE,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAc7D;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,OAAO,GACb,uBAAuB,CAsDzB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,qBAAqB,GAAG,IAAI,CAElF;AAED,4EAA4E;AAC5E,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,qBAAqB,CAE9E"}
@@ -1,27 +1,197 @@
1
1
  import { isTriggerId } from "./validation.js";
2
+ const AGENT_CONVERSATION_MODES = new Set([
3
+ "create_new",
4
+ "existing",
5
+ "none",
6
+ ]);
7
+ const CONVERSATION_ID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;
8
+ const MAX_DIAGNOSTIC_KEY_LENGTH = 80;
9
+ const SIMPLE_DIAGNOSTIC_KEY_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$-]*$/;
10
+ const TARGET_KEYS = ["kind", "id"];
11
+ const CONVERSATION_TARGET_KEYS = ["conversationMode", "conversationId"];
12
+ const AGENT_TARGET_KEYS = [
13
+ ...TARGET_KEYS,
14
+ ...CONVERSATION_TARGET_KEYS,
15
+ ];
2
16
  function readOwnDataProperty(value, key) {
3
17
  const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
4
18
  return descriptor && "value" in descriptor ? descriptor.value : undefined;
5
19
  }
6
20
  /**
7
- * Validate and copy a trigger target without retaining caller-owned state.
21
+ * Own keys a trigger target may declare, widened for agent targets.
22
+ *
23
+ * TypeScript without `exactOptionalPropertyTypes` accepts an explicitly
24
+ * undefined value for an optional `never` property. Keep that authoring shape
25
+ * aligned with runtime normalization while still rejecting accessors and every
26
+ * defined conversation value on non-agent targets.
8
27
  */
9
- export function snapshotTriggerTarget(value) {
28
+ export function triggerTargetKeys(value) {
10
29
  if (typeof value !== "object" || value === null)
30
+ return TARGET_KEYS;
31
+ try {
32
+ if (readOwnDataProperty(value, "kind") === "agent")
33
+ return AGENT_TARGET_KEYS;
34
+ const keys = [...TARGET_KEYS];
35
+ for (const key of CONVERSATION_TARGET_KEYS) {
36
+ const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
37
+ if (descriptor !== undefined && "value" in descriptor && descriptor.value === undefined) {
38
+ keys.push(key);
39
+ }
40
+ }
41
+ return keys;
42
+ }
43
+ catch {
44
+ return TARGET_KEYS;
45
+ }
46
+ }
47
+ /**
48
+ * Describe why agent conversation addressing is invalid, or return `null`.
49
+ *
50
+ * `label` prefixes the diagnostic so schedules, webhooks, and targets report
51
+ * the same invariant with their own field path.
52
+ */
53
+ export function agentConversationDiagnostic(label, conversationMode, conversationId) {
54
+ if (conversationMode !== undefined &&
55
+ !AGENT_CONVERSATION_MODES.has(conversationMode)) {
56
+ return `${label}.conversationMode must be create_new, existing, or none.`;
57
+ }
58
+ if (conversationId !== undefined && conversationId !== null &&
59
+ (typeof conversationId !== "string" ||
60
+ !CONVERSATION_ID_PATTERN.test(conversationId))) {
61
+ return `${label}.conversationId must be a UUID or null.`;
62
+ }
63
+ const effectiveMode = conversationMode ?? "none";
64
+ if (effectiveMode === "existing" && typeof conversationId !== "string") {
65
+ return `${label}.conversationId is required when conversationMode is existing.`;
66
+ }
67
+ if (effectiveMode !== "existing" && typeof conversationId === "string") {
68
+ return `${label}.conversationId is allowed only when conversationMode is existing.`;
69
+ }
70
+ return null;
71
+ }
72
+ /**
73
+ * Describe one value declared in two places with disagreeing content.
74
+ *
75
+ * Repeating a value is redundant, not wrong: an author spanning a platform
76
+ * upgrade must be able to write a single definition that both the old and the
77
+ * new platform read correctly. Only a disagreement is unresolvable, because
78
+ * honoring one copy would detach the deployed trigger from what the other copy
79
+ * names.
80
+ */
81
+ export function declarationConflictDiagnostic(label, path, legacyPath, value, legacyValue) {
82
+ if (value === undefined || legacyValue === undefined)
83
+ return null;
84
+ if (value === legacyValue)
85
+ return null;
86
+ return `${label} ${path} and ${legacyPath} are both set to different values. Declare it in one place.`;
87
+ }
88
+ /**
89
+ * Describe a conversation pair that disagrees across two locations.
90
+ *
91
+ * `legacyLabel` names the other location so the message spells out both real
92
+ * field paths without ranking them: which one a given platform reads depends
93
+ * on its version, so neither can be called authoritative here.
94
+ */
95
+ export function conversationConflictDiagnostic(label, legacyLabel, target, legacyConversationMode, legacyConversationId) {
96
+ if (target.kind !== "agent")
97
+ return null;
98
+ for (const [field, targetValue, legacyValue] of [
99
+ ["conversationMode", target.conversationMode, legacyConversationMode],
100
+ ["conversationId", target.conversationId, legacyConversationId],
101
+ ]) {
102
+ const detail = declarationConflictDiagnostic(label, `target.${field}`, `${legacyLabel}.${field}`, targetValue, legacyValue);
103
+ if (detail !== null)
104
+ return detail;
105
+ }
106
+ return null;
107
+ }
108
+ function truncateDiagnosticKey(key) {
109
+ if (key.length <= MAX_DIAGNOSTIC_KEY_LENGTH)
110
+ return key;
111
+ let prefix = key.slice(0, MAX_DIAGNOSTIC_KEY_LENGTH);
112
+ const finalCodeUnit = prefix.charCodeAt(prefix.length - 1);
113
+ if (finalCodeUnit >= 0xd800 && finalCodeUnit <= 0xdbff) {
114
+ prefix = prefix.slice(0, -1);
115
+ }
116
+ return `${prefix}…`;
117
+ }
118
+ function formatDiagnosticProperty(label, key) {
119
+ const boundedKey = truncateDiagnosticKey(key);
120
+ return SIMPLE_DIAGNOSTIC_KEY_PATTERN.test(boundedKey)
121
+ ? `${label}.${boundedKey}`
122
+ : `${label}[${JSON.stringify(boundedKey)}]`;
123
+ }
124
+ function requireOwnDataField(label, value, key) {
125
+ const descriptor = Reflect.getOwnPropertyDescriptor(value, key);
126
+ if (descriptor === undefined || "value" in descriptor)
11
127
  return null;
128
+ return {
129
+ detail: `${formatDiagnosticProperty(label, key)} must be an own data property.`,
130
+ };
131
+ }
132
+ /**
133
+ * Validate and copy the canonical fields of a trigger target.
134
+ *
135
+ * Public `TriggerTarget` interfaces are intentionally extendable, so this
136
+ * generic helper ignores caller-owned extension fields. Schedule and webhook
137
+ * authoring validators apply strict key checks before calling this helper.
138
+ */
139
+ export function resolveTriggerTarget(label, value) {
140
+ const notATarget = {
141
+ detail: `${label} must specify a canonical task, workflow, or agent id.`,
142
+ };
143
+ if (typeof value !== "object" || value === null)
144
+ return notATarget;
12
145
  try {
13
146
  const kind = readOwnDataProperty(value, "kind");
14
147
  const id = readOwnDataProperty(value, "id");
15
148
  if ((kind !== "task" && kind !== "workflow" && kind !== "agent") ||
16
149
  !isTriggerId(id)) {
17
- return null;
150
+ return notATarget;
18
151
  }
19
- return { kind, id };
152
+ const conversationModeField = requireOwnDataField(label, value, "conversationMode");
153
+ if (conversationModeField !== null)
154
+ return conversationModeField;
155
+ const conversationIdField = requireOwnDataField(label, value, "conversationId");
156
+ if (conversationIdField !== null)
157
+ return conversationIdField;
158
+ const conversationMode = readOwnDataProperty(value, "conversationMode");
159
+ const conversationId = readOwnDataProperty(value, "conversationId");
160
+ if (kind !== "agent") {
161
+ if (conversationMode !== undefined) {
162
+ return { detail: `${label}.conversationMode is supported only for agent targets.` };
163
+ }
164
+ if (conversationId !== undefined) {
165
+ return { detail: `${label}.conversationId is supported only for agent targets.` };
166
+ }
167
+ return { target: { kind, id } };
168
+ }
169
+ const conversationDetail = agentConversationDiagnostic(label, conversationMode, conversationId);
170
+ if (conversationDetail !== null)
171
+ return { detail: conversationDetail };
172
+ return {
173
+ target: {
174
+ kind,
175
+ id,
176
+ ...(conversationMode === undefined
177
+ ? {}
178
+ : { conversationMode: conversationMode }),
179
+ ...(conversationId === undefined
180
+ ? {}
181
+ : { conversationId: conversationId }),
182
+ },
183
+ };
20
184
  }
21
185
  catch {
22
- return null;
186
+ return notATarget;
23
187
  }
24
188
  }
189
+ /**
190
+ * Validate and copy a trigger target without retaining caller-owned state.
191
+ */
192
+ export function snapshotTriggerTarget(value) {
193
+ return resolveTriggerTarget("Trigger target", value).target ?? null;
194
+ }
25
195
  /** Return true only for canonical targets stored in own data properties. */
26
196
  export function isTriggerTarget(value) {
27
197
  return snapshotTriggerTarget(value) !== null;
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.1237";
2
+ export declare const VERSION = "0.1.1239";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.1237";
4
+ export const VERSION = "0.1.1239";