veryfront 0.1.1239 → 0.1.1241

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 (611) hide show
  1. package/esm/cli/commands/build/command-help.d.ts.map +1 -1
  2. package/esm/cli/commands/build/command-help.js +4 -0
  3. package/esm/cli/commands/build/command.d.ts +3 -1
  4. package/esm/cli/commands/build/command.d.ts.map +1 -1
  5. package/esm/cli/commands/build/command.js +13 -5
  6. package/esm/cli/commands/build/handler.d.ts +17 -0
  7. package/esm/cli/commands/build/handler.d.ts.map +1 -1
  8. package/esm/cli/commands/build/handler.js +188 -9
  9. package/esm/cli/commands/generate/command.d.ts.map +1 -1
  10. package/esm/cli/commands/generate/command.js +40 -0
  11. package/esm/cli/commands/push/command.d.ts.map +1 -1
  12. package/esm/cli/commands/push/command.js +24 -16
  13. package/esm/cli/shared/ensure-content-processor.d.ts +16 -1
  14. package/esm/cli/shared/ensure-content-processor.d.ts.map +1 -1
  15. package/esm/cli/shared/ensure-content-processor.js +39 -5
  16. package/esm/cli/shared/project-creation.d.ts.map +1 -1
  17. package/esm/cli/shared/project-creation.js +29 -1
  18. package/esm/deno.d.ts +14 -5
  19. package/esm/deno.js +23 -7
  20. package/esm/extensions/ext-llm-openai/src/openai-chat-stream.d.ts.map +1 -1
  21. package/esm/extensions/ext-llm-openai/src/openai-chat-stream.js +16 -6
  22. package/esm/extensions/ext-llm-openai/src/openai-provider.d.ts.map +1 -1
  23. package/esm/extensions/ext-llm-openai/src/openai-provider.js +11 -2
  24. package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts +2 -14
  25. package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.d.ts.map +1 -1
  26. package/esm/extensions/ext-llm-openai/src/openai-reasoning-models.js +1 -72
  27. package/esm/extensions/ext-schema-zod/src/adapter.d.ts.map +1 -1
  28. package/esm/src/agent/ag-ui/browser-aliases.d.ts +164 -0
  29. package/esm/src/agent/ag-ui/browser-aliases.d.ts.map +1 -0
  30. package/esm/src/agent/ag-ui/browser-aliases.js +68 -0
  31. package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts +35 -0
  32. package/esm/src/agent/ag-ui/chat-ui-chunk-encoder.d.ts.map +1 -0
  33. package/esm/src/agent/ag-ui/{chat-ui-chunk-browser-encoder.js → chat-ui-chunk-encoder.js} +11 -11
  34. package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts +8 -6
  35. package/esm/src/agent/ag-ui/chunk-encoder-bridge.d.ts.map +1 -1
  36. package/esm/src/agent/ag-ui/chunk-encoder-bridge.js +5 -4
  37. package/esm/src/agent/ag-ui/chunk-encoder.d.ts +26 -0
  38. package/esm/src/agent/ag-ui/chunk-encoder.d.ts.map +1 -0
  39. package/esm/src/agent/ag-ui/{browser-chunk-encoder.js → chunk-encoder.js} +3 -2
  40. package/esm/src/agent/ag-ui/{browser-encoder.d.ts → encoder.d.ts} +33 -19
  41. package/esm/src/agent/ag-ui/encoder.d.ts.map +1 -0
  42. package/esm/src/agent/ag-ui/{browser-encoder.js → encoder.js} +81 -27
  43. package/esm/src/agent/ag-ui/finalize-tracker.d.ts +15 -0
  44. package/esm/src/agent/ag-ui/finalize-tracker.d.ts.map +1 -0
  45. package/esm/src/agent/ag-ui/{browser-finalize-tracker.js → finalize-tracker.js} +4 -4
  46. package/esm/src/agent/ag-ui/response-stream.d.ts +36 -0
  47. package/esm/src/agent/ag-ui/response-stream.d.ts.map +1 -0
  48. package/esm/src/agent/ag-ui/{browser-response-stream.js → response-stream.js} +6 -3
  49. package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts +1 -1
  50. package/esm/src/agent/ag-ui/runtime-chat-stream-encoder.d.ts.map +1 -1
  51. package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts +7 -7
  52. package/esm/src/agent/ag-ui/runtime-event-encoder.d.ts.map +1 -1
  53. package/esm/src/agent/ag-ui/runtime-event-encoder.js +4 -4
  54. package/esm/src/agent/ag-ui/runtime-response.d.ts +20 -0
  55. package/esm/src/agent/ag-ui/runtime-response.d.ts.map +1 -0
  56. package/esm/src/agent/ag-ui/runtime-response.js +16 -0
  57. package/esm/src/agent/ag-ui/sse-parser.d.ts +1 -1
  58. package/esm/src/agent/ag-ui/sse-parser.d.ts.map +1 -1
  59. package/esm/src/agent/ag-ui/sse-parser.js +3 -3
  60. package/esm/src/agent/ag-ui/tracked-response.d.ts +11 -0
  61. package/esm/src/agent/ag-ui/tracked-response.d.ts.map +1 -0
  62. package/esm/src/agent/ag-ui/{tracked-browser-response.js → tracked-response.js} +6 -4
  63. package/esm/src/agent/conversation/hosted-lifecycle.d.ts.map +1 -1
  64. package/esm/src/agent/conversation/hosted-lifecycle.js +2 -1
  65. package/esm/src/agent/conversation/lifecycle-run-event-adapter.d.ts.map +1 -1
  66. package/esm/src/agent/conversation/lifecycle-run-event-adapter.js +2 -0
  67. package/esm/src/agent/conversation/private-run-event.d.ts.map +1 -1
  68. package/esm/src/agent/conversation/private-run-event.js +174 -3
  69. package/esm/src/agent/conversation/run-chunk-mirror.d.ts +2 -0
  70. package/esm/src/agent/conversation/run-chunk-mirror.d.ts.map +1 -1
  71. package/esm/src/agent/conversation/run-chunk-mirror.js +13 -6
  72. package/esm/src/agent/conversation/run-events.d.ts +8 -0
  73. package/esm/src/agent/conversation/run-events.d.ts.map +1 -1
  74. package/esm/src/agent/conversation/run-events.js +54 -4
  75. package/esm/src/agent/conversation/run-stream-mirror.d.ts.map +1 -1
  76. package/esm/src/agent/conversation/run-stream-mirror.js +5 -2
  77. package/esm/src/agent/hosted/durable-run-event-sink.d.ts +2 -1
  78. package/esm/src/agent/hosted/durable-run-event-sink.d.ts.map +1 -1
  79. package/esm/src/agent/hosted/durable-run-event-sink.js +9 -7
  80. package/esm/src/agent/hosted/prepared-chat-execution.js +2 -2
  81. package/esm/src/agent/index.d.ts +9 -8
  82. package/esm/src/agent/index.d.ts.map +1 -1
  83. package/esm/src/agent/index.js +9 -8
  84. package/esm/src/agent/memory/memory.d.ts.map +1 -1
  85. package/esm/src/agent/memory/memory.js +7 -6
  86. package/esm/src/agent/react/use-chat/types.d.ts +2 -0
  87. package/esm/src/agent/react/use-chat/types.d.ts.map +1 -1
  88. package/esm/src/agent/react/use-chat/use-chat.js +3 -2
  89. package/esm/src/agent/runtime/ag-ui-contract.d.ts +2 -2
  90. package/esm/src/agent/runtime/ag-ui-contract.d.ts.map +1 -1
  91. package/esm/src/agent/runtime/ag-ui-contract.js +2 -2
  92. package/esm/src/agent/runtime/chat-stream-handler.d.ts.map +1 -1
  93. package/esm/src/agent/runtime/chat-stream-handler.js +34 -4
  94. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  95. package/esm/src/agent/runtime/index.js +15 -6
  96. package/esm/src/agent/streaming/data-stream.d.ts +1 -1
  97. package/esm/src/agent/streaming/data-stream.d.ts.map +1 -1
  98. package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts +1 -1
  99. package/esm/src/agent/streaming/fork-runtime-part-mapper.d.ts.map +1 -1
  100. package/esm/src/agent/streaming/lifecycle/live-adapter.d.ts.map +1 -1
  101. package/esm/src/agent/streaming/lifecycle/live-adapter.js +2 -0
  102. package/esm/src/agent/streaming/lifecycle/reducer.d.ts.map +1 -1
  103. package/esm/src/agent/streaming/lifecycle/reducer.js +7 -0
  104. package/esm/src/agent/streaming/lifecycle/runtime-provider-adapter.js +4 -0
  105. package/esm/src/build/production-build/templates.d.ts.map +1 -1
  106. package/esm/src/build/production-build/templates.js +1 -1
  107. package/esm/src/cache/request-cache-batcher.d.ts +1 -0
  108. package/esm/src/cache/request-cache-batcher.d.ts.map +1 -1
  109. package/esm/src/cache/request-cache-batcher.js +21 -7
  110. package/esm/src/chat/ag-ui.d.ts +1 -1
  111. package/esm/src/chat/index.d.ts +2 -2
  112. package/esm/src/chat/index.d.ts.map +1 -1
  113. package/esm/src/chat/index.js +1 -1
  114. package/esm/src/config/config-shim.d.ts +1 -1
  115. package/esm/src/config/config-shim.d.ts.map +1 -1
  116. package/esm/src/config/config-shim.js +1 -1
  117. package/esm/src/config/declarative-evaluator-worker-protocol.d.ts.map +1 -1
  118. package/esm/src/config/env.js +1 -1
  119. package/esm/src/config/environment-config.js +1 -1
  120. package/esm/src/config/loader.d.ts.map +1 -1
  121. package/esm/src/config/loader.js +4 -4
  122. package/esm/src/config/schemas/config.schema.d.ts +20 -0
  123. package/esm/src/config/schemas/config.schema.d.ts.map +1 -1
  124. package/esm/src/config/schemas/config.schema.js +27 -0
  125. package/esm/src/config/server-external-packages.d.ts +11 -0
  126. package/esm/src/config/server-external-packages.d.ts.map +1 -0
  127. package/esm/src/config/server-external-packages.js +53 -0
  128. package/esm/src/data/data-fetcher.d.ts.map +1 -1
  129. package/esm/src/data/data-fetcher.js +9 -4
  130. package/esm/src/data/data-result-validation.d.ts +5 -0
  131. package/esm/src/data/data-result-validation.d.ts.map +1 -0
  132. package/esm/src/data/data-result-validation.js +56 -0
  133. package/esm/src/data/helpers.d.ts +5 -5
  134. package/esm/src/data/helpers.d.ts.map +1 -1
  135. package/esm/src/data/helpers.js +22 -68
  136. package/esm/src/data/index.d.ts +1 -1
  137. package/esm/src/data/index.d.ts.map +1 -1
  138. package/esm/src/data/response-metadata.d.ts +23 -0
  139. package/esm/src/data/response-metadata.d.ts.map +1 -0
  140. package/esm/src/data/response-metadata.js +311 -0
  141. package/esm/src/data/schemas/data.schema.d.ts +95 -6
  142. package/esm/src/data/schemas/data.schema.d.ts.map +1 -1
  143. package/esm/src/data/schemas/data.schema.js +57 -3
  144. package/esm/src/data/schemas/index.d.ts +1 -1
  145. package/esm/src/data/schemas/index.d.ts.map +1 -1
  146. package/esm/src/data/schemas/index.js +1 -1
  147. package/esm/src/data/server-data-fetcher.d.ts.map +1 -1
  148. package/esm/src/data/server-data-fetcher.js +5 -5
  149. package/esm/src/data/static-data-fetcher.d.ts +2 -2
  150. package/esm/src/data/static-data-fetcher.d.ts.map +1 -1
  151. package/esm/src/data/static-data-fetcher.js +6 -3
  152. package/esm/src/data/types.d.ts +1 -1
  153. package/esm/src/data/types.d.ts.map +1 -1
  154. package/esm/src/discovery/discovery-engine.d.ts.map +1 -1
  155. package/esm/src/discovery/discovery-engine.js +81 -26
  156. package/esm/src/discovery/handlers/task-handler.d.ts +1 -1
  157. package/esm/src/discovery/handlers/task-handler.d.ts.map +1 -1
  158. package/esm/src/discovery/handlers/task-handler.js +6 -3
  159. package/esm/src/discovery/types.d.ts +6 -4
  160. package/esm/src/discovery/types.d.ts.map +1 -1
  161. package/esm/src/errors/error-registry/runtime.d.ts +2 -0
  162. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -1
  163. package/esm/src/errors/error-registry/runtime.js +8 -0
  164. package/esm/src/errors/error-registry.d.ts +1 -0
  165. package/esm/src/errors/error-registry.d.ts.map +1 -1
  166. package/esm/src/errors/index.d.ts +1 -1
  167. package/esm/src/errors/index.d.ts.map +1 -1
  168. package/esm/src/errors/index.js +1 -1
  169. package/esm/src/errors/user-friendly/error-wrapper.js +1 -1
  170. package/esm/src/errors/veryfront-error.d.ts.map +1 -1
  171. package/esm/src/extensions/index.d.ts +2 -0
  172. package/esm/src/extensions/index.d.ts.map +1 -1
  173. package/esm/src/extensions/index.js +1 -0
  174. package/esm/src/extensions/parser/code-parser.d.ts +9 -0
  175. package/esm/src/extensions/parser/code-parser.d.ts.map +1 -1
  176. package/esm/src/extensions/parser/defaults.d.ts +5 -0
  177. package/esm/src/extensions/parser/defaults.d.ts.map +1 -1
  178. package/esm/src/extensions/parser/defaults.js +23 -11
  179. package/esm/src/fs/index.d.ts +50 -1
  180. package/esm/src/fs/index.d.ts.map +1 -1
  181. package/esm/src/fs/index.js +50 -1
  182. package/esm/src/html/html-injection.d.ts +2 -0
  183. package/esm/src/html/html-injection.d.ts.map +1 -1
  184. package/esm/src/html/html-injection.js +4 -1
  185. package/esm/src/html/html-shell-generator.d.ts.map +1 -1
  186. package/esm/src/html/html-shell-generator.js +11 -3
  187. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.d.ts.map +1 -1
  188. package/esm/src/html/hydration-script-builder/hydration-runtime.generated.js +1 -1
  189. package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts +23 -0
  190. package/esm/src/html/hydration-script-builder/prod-runtime-selection.d.ts.map +1 -0
  191. package/esm/src/html/hydration-script-builder/prod-runtime-selection.js +55 -0
  192. package/esm/src/html/hydration-script-builder/prod-scripts.d.ts +2 -0
  193. package/esm/src/html/hydration-script-builder/prod-scripts.d.ts.map +1 -1
  194. package/esm/src/html/hydration-script-builder/prod-scripts.js +12 -3
  195. package/esm/src/html/schemas/html.schema.d.ts +2 -0
  196. package/esm/src/html/schemas/html.schema.d.ts.map +1 -1
  197. package/esm/src/html/schemas/html.schema.js +2 -0
  198. package/esm/src/html/styles-builder/css-hash-cache.d.ts +1 -1
  199. package/esm/src/html/styles-builder/css-hash-cache.d.ts.map +1 -1
  200. package/esm/src/html/styles-builder/css-hash-cache.js +1 -1
  201. package/esm/src/index.client.d.ts +2 -2
  202. package/esm/src/index.client.d.ts.map +1 -1
  203. package/esm/src/index.client.js +3 -1
  204. package/esm/src/index.d.ts +1 -1
  205. package/esm/src/index.d.ts.map +1 -1
  206. package/esm/src/internal-agents/ag-ui-sse.d.ts +7 -7
  207. package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
  208. package/esm/src/internal-agents/ag-ui-sse.js +17 -9
  209. package/esm/src/internal-agents/control-plane-auth.js +1 -1
  210. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  211. package/esm/src/internal-agents/run-stream.js +15 -9
  212. package/esm/src/modules/import-map/loader.d.ts.map +1 -1
  213. package/esm/src/modules/import-map/loader.js +2 -2
  214. package/esm/src/modules/import-map/merger.js +2 -2
  215. package/esm/src/modules/import-map/preloader.js +2 -2
  216. package/esm/src/modules/react-loader/component-loader.d.ts.map +1 -1
  217. package/esm/src/modules/react-loader/component-loader.js +2 -0
  218. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts +1 -1
  219. package/esm/src/modules/react-loader/ssr-module-loader/loader.d.ts.map +1 -1
  220. package/esm/src/modules/react-loader/ssr-module-loader/loader.js +3 -2
  221. package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.d.ts.map +1 -1
  222. package/esm/src/modules/react-loader/ssr-module-loader/ssr-cache-manager.js +7 -1
  223. package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts +2 -0
  224. package/esm/src/modules/react-loader/ssr-module-loader/types.d.ts.map +1 -1
  225. package/esm/src/modules/react-loader/transformed-module-coordinator.d.ts.map +1 -1
  226. package/esm/src/modules/react-loader/transformed-module-coordinator.js +2 -1
  227. package/esm/src/modules/react-loader/types.d.ts +2 -0
  228. package/esm/src/modules/react-loader/types.d.ts.map +1 -1
  229. package/esm/src/modules/server/module-response-cache.d.ts +1 -0
  230. package/esm/src/modules/server/module-response-cache.d.ts.map +1 -1
  231. package/esm/src/modules/server/module-response-cache.js +5 -0
  232. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  233. package/esm/src/modules/server/module-server.js +4 -0
  234. package/esm/src/modules/server/module-transform.d.ts.map +1 -1
  235. package/esm/src/modules/server/module-transform.js +2 -0
  236. package/esm/src/observability/metrics/config.js +1 -1
  237. package/esm/src/observability/request-profiler.js +1 -1
  238. package/esm/src/observability/telemetry-error.js +2 -2
  239. package/esm/src/observability/tracing/telemetry-env.js +1 -1
  240. package/esm/src/platform/adapters/fs/cache/file-cache.d.ts.map +1 -1
  241. package/esm/src/platform/adapters/fs/cache/file-cache.js +5 -0
  242. package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts +39 -0
  243. package/esm/src/platform/adapters/fs/veryfront/adapter.d.ts.map +1 -1
  244. package/esm/src/platform/adapters/fs/veryfront/adapter.js +209 -40
  245. package/esm/src/platform/adapters/fs/veryfront/file-list-index.d.ts.map +1 -1
  246. package/esm/src/platform/adapters/fs/veryfront/file-list-index.js +0 -14
  247. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts +0 -1
  248. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.d.ts.map +1 -1
  249. package/esm/src/platform/adapters/fs/veryfront/read-operations-helpers.js +0 -3
  250. package/esm/src/platform/adapters/fs/veryfront/read-operations.d.ts.map +1 -1
  251. package/esm/src/platform/adapters/fs/veryfront/read-operations.js +1 -4
  252. package/esm/src/platform/adapters/fs/veryfront/request-context.d.ts.map +1 -1
  253. package/esm/src/platform/adapters/fs/veryfront/request-context.js +4 -0
  254. package/esm/src/platform/adapters/fs/veryfront/stat-operations.d.ts.map +1 -1
  255. package/esm/src/platform/adapters/fs/veryfront/stat-operations.js +9 -1
  256. package/esm/src/platform/adapters/fs/veryfront/websocket-manager-helpers.js +1 -1
  257. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts +2 -1
  258. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.d.ts.map +1 -1
  259. package/esm/src/platform/adapters/fs/veryfront/websocket-manager.js +97 -66
  260. package/esm/src/platform/compat/dns.d.ts +10 -0
  261. package/esm/src/platform/compat/dns.d.ts.map +1 -1
  262. package/esm/src/platform/compat/dns.js +50 -0
  263. package/esm/src/platform/compat/http/pinned-fetch.d.ts +1 -1
  264. package/esm/src/platform/compat/process/lifecycle.d.ts +10 -0
  265. package/esm/src/platform/compat/process/lifecycle.d.ts.map +1 -1
  266. package/esm/src/platform/compat/process/lifecycle.js +23 -0
  267. package/esm/src/platform/compat/process.d.ts +1 -1
  268. package/esm/src/platform/compat/process.d.ts.map +1 -1
  269. package/esm/src/platform/compat/process.js +1 -1
  270. package/esm/src/platform/compat/proxy-topology.js +1 -1
  271. package/esm/src/platform/request-context-access.d.ts +24 -0
  272. package/esm/src/platform/request-context-access.d.ts.map +1 -0
  273. package/esm/src/platform/request-context-access.js +26 -0
  274. package/esm/src/provider/shared/openai-reasoning.d.ts +16 -0
  275. package/esm/src/provider/shared/openai-reasoning.d.ts.map +1 -0
  276. package/esm/src/provider/shared/openai-reasoning.js +73 -0
  277. package/esm/src/provider/types.d.ts +2 -0
  278. package/esm/src/provider/types.d.ts.map +1 -1
  279. package/esm/src/provider/veryfront-cloud/provider.d.ts.map +1 -1
  280. package/esm/src/provider/veryfront-cloud/provider.js +45 -18
  281. package/esm/src/proxy/handler.d.ts +1 -0
  282. package/esm/src/proxy/handler.d.ts.map +1 -1
  283. package/esm/src/proxy/handler.js +17 -4
  284. package/esm/src/proxy/proxy-error-context.d.ts +1 -0
  285. package/esm/src/proxy/proxy-error-context.d.ts.map +1 -1
  286. package/esm/src/proxy/proxy-error-context.js +1 -0
  287. package/esm/src/proxy/request-host.d.ts +3 -0
  288. package/esm/src/proxy/request-host.d.ts.map +1 -1
  289. package/esm/src/proxy/request-host.js +28 -8
  290. package/esm/src/proxy/routing-invalidation-redis.d.ts.map +1 -1
  291. package/esm/src/proxy/routing-invalidation-redis.js +38 -4
  292. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts +27 -3
  293. package/esm/src/react/components/chat/chat/components/attachments-panel.d.ts.map +1 -1
  294. package/esm/src/react/components/chat/chat/components/attachments-panel.js +29 -7
  295. package/esm/src/react/components/chat/chat/components/sidebar.d.ts +15 -6
  296. package/esm/src/react/components/chat/chat/components/sidebar.d.ts.map +1 -1
  297. package/esm/src/react/components/chat/chat/components/sidebar.js +37 -4
  298. package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts +12 -1
  299. package/esm/src/react/components/chat/chat/components/sidebar.types.d.ts.map +1 -1
  300. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts +3 -1
  301. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  302. package/esm/src/react/components/chat/chat/composition/chat-composer.js +17 -6
  303. package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts +12 -5
  304. package/esm/src/react/components/chat/chat/composition/chat-composer.types.d.ts.map +1 -1
  305. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts +18 -5
  306. package/esm/src/react/components/chat/chat/composition/chat-root.d.ts.map +1 -1
  307. package/esm/src/react/components/chat/chat/composition/chat-root.js +65 -1
  308. package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts +6 -3
  309. package/esm/src/react/components/chat/chat/composition/use-composer-value.d.ts.map +1 -1
  310. package/esm/src/react/components/chat/chat/composition/use-composer-value.js +56 -5
  311. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts +7 -1
  312. package/esm/src/react/components/chat/chat/contexts/chat-context.d.ts.map +1 -1
  313. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts +14 -4
  314. package/esm/src/react/components/chat/chat/contexts/conversations-context.d.ts.map +1 -1
  315. package/esm/src/react/components/chat/chat/contexts/conversations-context.js +10 -1
  316. package/esm/src/react/components/chat/chat/index.d.ts +1 -1
  317. package/esm/src/react/components/chat/chat/index.d.ts.map +1 -1
  318. package/esm/src/react/components/chat/chat/persistence/conversation-codec.d.ts.map +1 -1
  319. package/esm/src/react/components/chat/chat.d.ts +1 -1
  320. package/esm/src/react/components/chat/chat.d.ts.map +1 -1
  321. package/esm/src/react/server-render-context.d.ts.map +1 -1
  322. package/esm/src/release-assets/dependency-artifact-builder.d.ts.map +1 -1
  323. package/esm/src/rendering/app-reserved.d.ts +2 -2
  324. package/esm/src/rendering/app-reserved.d.ts.map +1 -1
  325. package/esm/src/rendering/app-reserved.js +4 -3
  326. package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
  327. package/esm/src/rendering/cache/cache-coordinator.js +1 -0
  328. package/esm/src/rendering/cache/cache-payload.d.ts.map +1 -1
  329. package/esm/src/rendering/cache/cache-payload.js +44 -0
  330. package/esm/src/rendering/component-handling.d.ts +4 -1
  331. package/esm/src/rendering/component-handling.d.ts.map +1 -1
  332. package/esm/src/rendering/component-handling.js +13 -6
  333. package/esm/src/rendering/layouts/layout-applicator.d.ts.map +1 -1
  334. package/esm/src/rendering/layouts/layout-applicator.js +3 -1
  335. package/esm/src/rendering/layouts/layout-collector.d.ts +1 -0
  336. package/esm/src/rendering/layouts/layout-collector.d.ts.map +1 -1
  337. package/esm/src/rendering/layouts/layout-collector.js +201 -4
  338. package/esm/src/rendering/layouts/utils/applicator.d.ts +1 -1
  339. package/esm/src/rendering/layouts/utils/applicator.d.ts.map +1 -1
  340. package/esm/src/rendering/layouts/utils/applicator.js +3 -3
  341. package/esm/src/rendering/layouts/utils/component-loader.d.ts +2 -2
  342. package/esm/src/rendering/layouts/utils/component-loader.d.ts.map +1 -1
  343. package/esm/src/rendering/layouts/utils/component-loader.js +12 -4
  344. package/esm/src/rendering/orchestrator/file-resolver/index.d.ts +3 -1
  345. package/esm/src/rendering/orchestrator/file-resolver/index.d.ts.map +1 -1
  346. package/esm/src/rendering/orchestrator/file-resolver/index.js +13 -5
  347. package/esm/src/rendering/orchestrator/html.d.ts.map +1 -1
  348. package/esm/src/rendering/orchestrator/html.js +26 -10
  349. package/esm/src/rendering/orchestrator/layout.d.ts.map +1 -1
  350. package/esm/src/rendering/orchestrator/layout.js +2 -2
  351. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.d.ts.map +1 -1
  352. package/esm/src/rendering/orchestrator/module-loader/dependency-resolver.js +20 -2
  353. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +2 -0
  354. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  355. package/esm/src/rendering/orchestrator/module-loader/index.js +6 -3
  356. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +3 -2
  357. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts.map +1 -1
  358. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.js +6 -6
  359. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +1 -0
  360. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -1
  361. package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +2 -2
  362. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts +2 -0
  363. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts.map +1 -1
  364. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.js +7 -1
  365. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  366. package/esm/src/rendering/orchestrator/pipeline.js +58 -10
  367. package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +3 -0
  368. package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -1
  369. package/esm/src/rendering/orchestrator/render-result-assembly.js +3 -1
  370. package/esm/src/rendering/page-renderer.d.ts +2 -0
  371. package/esm/src/rendering/page-renderer.d.ts.map +1 -1
  372. package/esm/src/rendering/page-renderer.js +4 -1
  373. package/esm/src/rendering/page-rendering.d.ts +2 -0
  374. package/esm/src/rendering/page-rendering.d.ts.map +1 -1
  375. package/esm/src/rendering/page-rendering.js +1 -0
  376. package/esm/src/rendering/renderer.d.ts.map +1 -1
  377. package/esm/src/rendering/renderer.js +31 -1
  378. package/esm/src/rendering/script-page-handling.d.ts +2 -0
  379. package/esm/src/rendering/script-page-handling.d.ts.map +1 -1
  380. package/esm/src/rendering/script-page-handling.js +17 -1
  381. package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
  382. package/esm/src/rendering/shared/context-aware-cache.js +3 -0
  383. package/esm/src/rendering/snippet-renderer.d.ts +10 -0
  384. package/esm/src/rendering/snippet-renderer.d.ts.map +1 -1
  385. package/esm/src/rendering/snippet-renderer.js +40 -18
  386. package/esm/src/rendering/ssr/component-registry.d.ts +1 -1
  387. package/esm/src/rendering/ssr/component-registry.d.ts.map +1 -1
  388. package/esm/src/rendering/ssr/component-registry.js +13 -6
  389. package/esm/src/rendering/ssr-outcome.d.ts +4 -3
  390. package/esm/src/rendering/ssr-outcome.d.ts.map +1 -1
  391. package/esm/src/rendering/ssr-outcome.js +25 -8
  392. package/esm/src/routing/api/handler.d.ts +1 -1
  393. package/esm/src/routing/api/handler.d.ts.map +1 -1
  394. package/esm/src/routing/api/handler.js +6 -1
  395. package/esm/src/runtime/model-call-context.d.ts +37 -2
  396. package/esm/src/runtime/model-call-context.d.ts.map +1 -1
  397. package/esm/src/runtime/model-call-context.js +42 -1
  398. package/esm/src/runtime/runtime-bridge.d.ts.map +1 -1
  399. package/esm/src/runtime/runtime-bridge.js +108 -8
  400. package/esm/src/sandbox/shell-tools.d.ts.map +1 -1
  401. package/esm/src/sandbox/shell-tools.js +16 -6
  402. package/esm/src/schedule/validation.d.ts +9 -1
  403. package/esm/src/schedule/validation.d.ts.map +1 -1
  404. package/esm/src/schedule/validation.js +167 -80
  405. package/esm/src/schemas/json-value.d.ts.map +1 -1
  406. package/esm/src/schemas/json-value.js +81 -37
  407. package/esm/src/security/http/base-handler.js +1 -1
  408. package/esm/src/security/sandbox/project-worker.d.ts +1 -0
  409. package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
  410. package/esm/src/security/sandbox/project-worker.js +6 -0
  411. package/esm/src/security/sandbox/worker-read-scope.d.ts +20 -0
  412. package/esm/src/security/sandbox/worker-read-scope.d.ts.map +1 -0
  413. package/esm/src/security/sandbox/worker-read-scope.js +127 -0
  414. package/esm/src/security/sandbox/worker-types.d.ts +12 -0
  415. package/esm/src/security/sandbox/worker-types.d.ts.map +1 -1
  416. package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
  417. package/esm/src/server/handlers/dev/dashboard/api.js +70 -3
  418. package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts +5 -0
  419. package/esm/src/server/handlers/dev/files/esbuild-plugins.d.ts.map +1 -1
  420. package/esm/src/server/handlers/dev/files/esbuild-plugins.js +61 -3
  421. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  422. package/esm/src/server/handlers/dev/framework-candidates.generated.js +227 -29
  423. package/esm/src/server/handlers/request/api/pages-api-handler.d.ts.map +1 -1
  424. package/esm/src/server/handlers/request/api/pages-api-handler.js +20 -2
  425. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
  426. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +32 -15
  427. package/esm/src/server/handlers/request/prod-hydration-module.handler.d.ts.map +1 -1
  428. package/esm/src/server/handlers/request/prod-hydration-module.handler.js +10 -3
  429. package/esm/src/server/handlers/request/project-run-execute.handler.d.ts.map +1 -1
  430. package/esm/src/server/handlers/request/project-run-execute.handler.js +1 -0
  431. package/esm/src/server/handlers/request/snippet.handler.d.ts +6 -0
  432. package/esm/src/server/handlers/request/snippet.handler.d.ts.map +1 -1
  433. package/esm/src/server/handlers/request/snippet.handler.js +8 -1
  434. package/esm/src/server/handlers/request/ssr/error-page-fallback.js +1 -0
  435. package/esm/src/server/handlers/request/ssr/ssr-response-builder.d.ts.map +1 -1
  436. package/esm/src/server/handlers/request/ssr/ssr-response-builder.js +10 -6
  437. package/esm/src/server/handlers/request/ssr/ssr.handler.d.ts.map +1 -1
  438. package/esm/src/server/handlers/request/ssr/ssr.handler.js +22 -10
  439. package/esm/src/server/handlers/request/static.handler.d.ts.map +1 -1
  440. package/esm/src/server/handlers/request/static.handler.js +1 -0
  441. package/esm/src/server/runtime-handler/handler-context-builder.d.ts +2 -0
  442. package/esm/src/server/runtime-handler/handler-context-builder.d.ts.map +1 -1
  443. package/esm/src/server/runtime-handler/handler-context-builder.js +1 -0
  444. package/esm/src/server/runtime-handler/project-runtime-context.d.ts.map +1 -1
  445. package/esm/src/server/runtime-handler/project-runtime-context.js +6 -2
  446. package/esm/src/server/runtime-handler/request-tracker.d.ts.map +1 -1
  447. package/esm/src/server/runtime-handler/request-tracker.js +10 -3
  448. package/esm/src/server/services/rendering/ssr.service.d.ts +5 -0
  449. package/esm/src/server/services/rendering/ssr.service.d.ts.map +1 -1
  450. package/esm/src/server/services/rendering/ssr.service.js +71 -16
  451. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  452. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  453. package/esm/src/server/services/rsc/orchestrators/handler.d.ts.map +1 -1
  454. package/esm/src/server/services/rsc/orchestrators/handler.js +1 -0
  455. package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts +1 -0
  456. package/esm/src/server/services/rsc/orchestrators/render-handler.d.ts.map +1 -1
  457. package/esm/src/server/services/rsc/orchestrators/render-handler.js +2 -0
  458. package/esm/src/server/services/static/static-file.service.d.ts +4 -1
  459. package/esm/src/server/services/static/static-file.service.d.ts.map +1 -1
  460. package/esm/src/server/services/static/static-file.service.js +48 -22
  461. package/esm/src/server/shared/browser-module-bundler.d.ts.map +1 -1
  462. package/esm/src/server/shared/browser-module-bundler.js +10 -0
  463. package/esm/src/server/utils/request-host.d.ts +6 -0
  464. package/esm/src/server/utils/request-host.d.ts.map +1 -1
  465. package/esm/src/server/utils/request-host.js +42 -1
  466. package/esm/src/skill/tools.d.ts.map +1 -1
  467. package/esm/src/task/definition-snapshot.d.ts +8 -0
  468. package/esm/src/task/definition-snapshot.d.ts.map +1 -0
  469. package/esm/src/task/definition-snapshot.js +154 -0
  470. package/esm/src/task/discovery.d.ts.map +1 -1
  471. package/esm/src/task/discovery.js +47 -21
  472. package/esm/src/task/types.d.ts +3 -0
  473. package/esm/src/task/types.d.ts.map +1 -1
  474. package/esm/src/task/types.js +7 -16
  475. package/esm/src/tool/remote-mcp.d.ts.map +1 -1
  476. package/esm/src/tool/remote-mcp.js +86 -5
  477. package/esm/src/transforms/esm/bundle-recovery.d.ts.map +1 -1
  478. package/esm/src/transforms/esm/bundle-recovery.js +1 -0
  479. package/esm/src/transforms/esm/http-cache-helpers.d.ts +3 -1
  480. package/esm/src/transforms/esm/http-cache-helpers.d.ts.map +1 -1
  481. package/esm/src/transforms/esm/http-cache-helpers.js +18 -2
  482. package/esm/src/transforms/esm/http-cache-wrapper.d.ts.map +1 -1
  483. package/esm/src/transforms/esm/http-cache-wrapper.js +23 -0
  484. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  485. package/esm/src/transforms/esm/specifier-resolver.js +2 -1
  486. package/esm/src/transforms/esm/types.d.ts +2 -0
  487. package/esm/src/transforms/esm/types.d.ts.map +1 -1
  488. package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts +22 -0
  489. package/esm/src/transforms/import-rewriter/commonjs-policy.d.ts.map +1 -0
  490. package/esm/src/transforms/import-rewriter/commonjs-policy.js +75 -0
  491. package/esm/src/transforms/import-rewriter/core.d.ts.map +1 -1
  492. package/esm/src/transforms/import-rewriter/core.js +29 -1
  493. package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts +2 -0
  494. package/esm/src/transforms/import-rewriter/ssr-adapter.d.ts.map +1 -1
  495. package/esm/src/transforms/import-rewriter/ssr-adapter.js +79 -10
  496. package/esm/src/transforms/import-rewriter/strategies/bare-strategy.d.ts.map +1 -1
  497. package/esm/src/transforms/import-rewriter/strategies/bare-strategy.js +14 -4
  498. package/esm/src/transforms/import-rewriter/types.d.ts +2 -0
  499. package/esm/src/transforms/import-rewriter/types.d.ts.map +1 -1
  500. package/esm/src/transforms/import-rewriter/url-builder.d.ts +2 -19
  501. package/esm/src/transforms/import-rewriter/url-builder.d.ts.map +1 -1
  502. package/esm/src/transforms/import-rewriter/url-builder.js +2 -67
  503. package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts +3 -2
  504. package/esm/src/transforms/mdx/esm-module-loader/import-transformer.d.ts.map +1 -1
  505. package/esm/src/transforms/mdx/esm-module-loader/import-transformer.js +39 -8
  506. package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.d.ts.map +1 -1
  507. package/esm/src/transforms/mdx/esm-module-loader/jsx/runtime-loader.js +1 -1
  508. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.d.ts.map +1 -1
  509. package/esm/src/transforms/mdx/esm-module-loader/loader-helpers.js +1 -0
  510. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts +3 -3
  511. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.d.ts.map +1 -1
  512. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/cache-keys.js +14 -6
  513. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts +1 -1
  514. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.d.ts.map +1 -1
  515. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/distributed-cache.js +2 -1
  516. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts +1 -0
  517. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -1
  518. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +1 -1
  519. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts +1 -0
  520. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
  521. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +6 -3
  522. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts +1 -1
  523. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.d.ts.map +1 -1
  524. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/module-cache.js +2 -2
  525. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts +1 -0
  526. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts.map +1 -1
  527. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.js +1 -1
  528. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts +1 -0
  529. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.d.ts.map +1 -1
  530. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/source-transform.js +2 -0
  531. package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts +2 -2
  532. package/esm/src/transforms/mdx/esm-module-loader/module-writer.d.ts.map +1 -1
  533. package/esm/src/transforms/mdx/esm-module-loader/module-writer.js +15 -7
  534. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts +4 -0
  535. package/esm/src/transforms/mdx/esm-module-loader/types.d.ts.map +1 -1
  536. package/esm/src/transforms/mdx/index.d.ts +1 -0
  537. package/esm/src/transforms/mdx/index.d.ts.map +1 -1
  538. package/esm/src/transforms/mdx/index.js +2 -1
  539. package/esm/src/transforms/pipeline/cache-identity.d.ts +1 -0
  540. package/esm/src/transforms/pipeline/cache-identity.d.ts.map +1 -1
  541. package/esm/src/transforms/pipeline/cache-identity.js +15 -0
  542. package/esm/src/transforms/pipeline/context.d.ts.map +1 -1
  543. package/esm/src/transforms/pipeline/context.js +2 -0
  544. package/esm/src/transforms/pipeline/index.d.ts.map +1 -1
  545. package/esm/src/transforms/pipeline/index.js +1 -0
  546. package/esm/src/transforms/pipeline/stages/resolve-imports.d.ts.map +1 -1
  547. package/esm/src/transforms/pipeline/stages/resolve-imports.js +1 -0
  548. package/esm/src/transforms/pipeline/stages/ssr-http-cache.d.ts.map +1 -1
  549. package/esm/src/transforms/pipeline/stages/ssr-http-cache.js +1 -0
  550. package/esm/src/transforms/pipeline/types.d.ts +4 -0
  551. package/esm/src/transforms/pipeline/types.d.ts.map +1 -1
  552. package/esm/src/transforms/shared/esm-sh-specifier.d.ts +18 -0
  553. package/esm/src/transforms/shared/esm-sh-specifier.d.ts.map +1 -0
  554. package/esm/src/transforms/shared/esm-sh-specifier.js +253 -0
  555. package/esm/src/transforms/shared/package-specifier.d.ts.map +1 -1
  556. package/esm/src/transforms/shared/package-specifier.js +9 -2
  557. package/esm/src/transforms/shared/server-only-packages.d.ts +25 -1
  558. package/esm/src/transforms/shared/server-only-packages.d.ts.map +1 -1
  559. package/esm/src/transforms/shared/server-only-packages.js +176 -4
  560. package/esm/src/types/entities/getEntityInfo.d.ts.map +1 -1
  561. package/esm/src/types/index.d.ts +5 -0
  562. package/esm/src/types/index.d.ts.map +1 -1
  563. package/esm/src/types/server.d.ts +6 -0
  564. package/esm/src/types/server.d.ts.map +1 -1
  565. package/esm/src/utils/env-loader.d.ts.map +1 -1
  566. package/esm/src/utils/env-loader.js +2 -1
  567. package/esm/src/utils/feature-flags.js +1 -1
  568. package/esm/src/utils/lru-wrapper.js +2 -2
  569. package/esm/src/utils/memory/profiler.d.ts +20 -0
  570. package/esm/src/utils/memory/profiler.d.ts.map +1 -1
  571. package/esm/src/utils/memory/profiler.js +43 -5
  572. package/esm/src/utils/perf-timer.js +1 -1
  573. package/esm/src/utils/redirect-policy.d.ts +18 -0
  574. package/esm/src/utils/redirect-policy.d.ts.map +1 -0
  575. package/esm/src/utils/redirect-policy.js +92 -0
  576. package/esm/src/utils/redis-client.d.ts.map +1 -1
  577. package/esm/src/utils/redis-client.js +6 -3
  578. package/esm/src/utils/version-constant.d.ts +1 -1
  579. package/esm/src/utils/version-constant.js +1 -1
  580. package/esm/src/workflow/claude-code/tool.d.ts +27 -27
  581. package/esm/src/workflow/claude-code/tool.d.ts.map +1 -1
  582. package/esm/src/workflow/claude-code/wire-protocol.d.ts.map +1 -1
  583. package/esm/src/workflow/dsl/workflow.d.ts +3 -0
  584. package/esm/src/workflow/dsl/workflow.d.ts.map +1 -1
  585. package/esm/src/workflow/dsl/workflow.js +2 -1
  586. package/esm/src/workflow/executor/workflow-definition-snapshot.d.ts.map +1 -1
  587. package/esm/src/workflow/executor/workflow-definition-snapshot.js +88 -39
  588. package/esm/src/workflow/registry.d.ts +4 -1
  589. package/esm/src/workflow/registry.d.ts.map +1 -1
  590. package/esm/src/workflow/registry.js +10 -8
  591. package/esm/src/workflow/types.d.ts +3 -0
  592. package/esm/src/workflow/types.d.ts.map +1 -1
  593. package/esm/templates/index.d.ts.map +1 -1
  594. package/esm/templates/index.js +7 -0
  595. package/esm/templates/manifest.generated.d.ts.map +1 -1
  596. package/esm/templates/manifest.generated.js +1 -1
  597. package/package.json +16 -9
  598. package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts +0 -24
  599. package/esm/src/agent/ag-ui/browser-chunk-encoder.d.ts.map +0 -1
  600. package/esm/src/agent/ag-ui/browser-encoder.d.ts.map +0 -1
  601. package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts +0 -15
  602. package/esm/src/agent/ag-ui/browser-finalize-tracker.d.ts.map +0 -1
  603. package/esm/src/agent/ag-ui/browser-response-stream.d.ts +0 -33
  604. package/esm/src/agent/ag-ui/browser-response-stream.d.ts.map +0 -1
  605. package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts +0 -35
  606. package/esm/src/agent/ag-ui/chat-ui-chunk-browser-encoder.d.ts.map +0 -1
  607. package/esm/src/agent/ag-ui/runtime-browser-response.d.ts +0 -20
  608. package/esm/src/agent/ag-ui/runtime-browser-response.d.ts.map +0 -1
  609. package/esm/src/agent/ag-ui/runtime-browser-response.js +0 -16
  610. package/esm/src/agent/ag-ui/tracked-browser-response.d.ts +0 -11
  611. package/esm/src/agent/ag-ui/tracked-browser-response.d.ts.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"file-cache.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/cache/file-cache.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,KAAK,EAAc,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAkC3E;;;GAGG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,OAAO,CAAC,CAwBnE;AAED;;GAEG;AACH,wBAAgB,6BAA6B,IAAI,OAAO,CAEvD;AAED;;;;;GAKG;AACH,qBAAa,SAAS;IACpB,OAAO,CAAC,aAAa,CAA0C;IAC/D,OAAO,CAAC,kBAAkB,CAAK;IAC/B,OAAO,CAAC,OAAO,CAA6B;IAC5C,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,MAAM,CAAK;gBAEP,OAAO,GAAE,gBAAqB;IAc1C,OAAO,CAAC,UAAU;IAKlB;;;OAGG;IACH,GAAG,CAAC,CAAC,EAAE,GAAG,EAAE,MAA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,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqBpD,uBAAuB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IAa/D,4BAA4B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB7E,KAAK,IAAI,IAAI;IAOb,KAAK,IAAI,UAAU,GAAG;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE;IAazC,YAAY,IAAI,MAAM;IAetB,OAAO,CAAC,qBAAqB;CAoB9B"}
@@ -255,6 +255,11 @@ export class FileCache {
255
255
  deleteAsync(key) {
256
256
  return withSpan("platform.fs.cache.deleteAsync", async () => {
257
257
  const deletedFromFallback = this.delete(key);
258
+ // setAsync() publishes distributed writes into the request-scoped
259
+ // cache before awaiting the backend. Invalidate that view as part of
260
+ // the same delete, or this request can keep reading a value that the
261
+ // backend no longer contains.
262
+ setInRequestCache(key, null);
258
263
  const backend = this.getBackend();
259
264
  if (backend) {
260
265
  await backend.del(key);
@@ -20,6 +20,18 @@ export declare class VeryfrontFSAdapter implements FSAdapter {
20
20
  /** Single-flight background rewarm when the file list cache disappears */
21
21
  private fileListWarmupPromise;
22
22
  private fileListWarmupKey;
23
+ /**
24
+ * Last listing this adapter fetched or was poked with, kept in memory because
25
+ * a cache write is not guaranteed to retain it: writes are skipped entirely
26
+ * when caching is disabled, oversized listings are dropped by the memory
27
+ * cache, and backend writes can fail. Without this, every module lookup of a
28
+ * render would miss the cache and await its own full listing fetch -- more
29
+ * API traffic than the per-file probing this replaced. It expires with the
30
+ * same TTL as the cache entry it stands in for and is dropped by every
31
+ * invalidation, so it is never fresher or staler than a retained cache write.
32
+ */
33
+ private retainedFileList;
34
+ private readonly fileListRetentionMs;
23
35
  /** Single-flight foreground refresh when a branch preview read misses a newly pushed file. */
24
36
  private branchMissRecoveryPromise;
25
37
  private branchMissRecoveryGeneration;
@@ -53,6 +65,27 @@ export declare class VeryfrontFSAdapter implements FSAdapter {
53
65
  private syncClientContext;
54
66
  private getCachedFileListSync;
55
67
  private getCachedFileListAsync;
68
+ /** Keep `files` answerable from memory for as long as a cache write would. */
69
+ private retainFileList;
70
+ private clearRetainedFileList;
71
+ /**
72
+ * The retained listing, if it still describes the snapshot the caller is
73
+ * reading. Anything that supersedes the snapshot -- a poke, a refresh, a
74
+ * branch or token change -- either drops it outright or moves the snapshot
75
+ * version past it, so a superseded listing can never answer a read.
76
+ */
77
+ private readRetainedFileList;
78
+ /**
79
+ * Wait for the in-flight file-list warmup for `cacheKey` and return the
80
+ * fetched listing. SSR module resolution reads this list for every module of
81
+ * a page; when the cached listing has expired, answering "no list" makes each
82
+ * module fall back to its own per-file/per-extension API probing (dozens of
83
+ * sequential fetches per render). Paying for one awaited listing fetch keeps
84
+ * that fan-out at a single API call while staying exactly as fresh: the
85
+ * listing is fetched from the API at request time. Warmup failures resolve to
86
+ * undefined so callers keep the legacy per-file fallback.
87
+ */
88
+ private awaitFileListWarmup;
56
89
  constructor(config: FSAdapterConfig);
57
90
  initialize(): Promise<void>;
58
91
  private isPersistentCacheInvalidated;
@@ -64,6 +97,12 @@ export declare class VeryfrontFSAdapter implements FSAdapter {
64
97
  private refreshBranchSnapshotAfterMiss;
65
98
  private withBranchSnapshotRecovery;
66
99
  private scheduleFileListWarmup;
100
+ /**
101
+ * Drop every in-memory view of the current source snapshot. Used by pokes
102
+ * that invalidate without carrying replacement files inline, so the next read
103
+ * re-derives everything from the API rather than from a superseded listing.
104
+ */
105
+ private clearMemoryCaches;
67
106
  private markSourceSnapshotChanged;
68
107
  private runSourceSnapshotMutation;
69
108
  private replaceSourceSnapshot;
@@ -1 +1 @@
1
- {"version":3,"file":"adapter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/adapter.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,UAAU,EAEV,cAAc,EACd,SAAS,EACT,eAAe,EAEf,sBAAsB,EAGvB,MA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kB,IAAI,IAAI;IAQ1B,iBAAiB,CAAC,OAAO,EAAE,sBAAsB,GAAG,IAAI;IA6DxD,iBAAiB,IAAI,sBAAsB,GAAG,IAAI;IAWlD,SAAS,IAAI,kBAAkB;YAIjB,iBAAiB;YAKjB,0BAA0B;IAkCxC;;;;;OAKG;YACW,uBAAuB;CAsCtC"}
@@ -10,7 +10,7 @@ import { buildDirCacheKeyPrefix, buildFileCacheKeyPrefix, buildFileListCacheKey,
10
10
  import { isPrefixBeingInvalidated } from "./invalidation-state.js";
11
11
  import { WebSocketManager } from "./websocket-manager.js";
12
12
  import { fetchFileListForContext, hasContentContextChanged, resolveContentContext, summarizeFileList, toClientContext, } from "./adapter-content-context.js";
13
- import { buildFileCacheOptions, buildRetryConfig, shouldBackgroundPregenerateStyles, } from "./adapter-helpers.js";
13
+ import { buildFileCacheOptions, buildRetryConfig, DEFAULT_CACHE_TTL_MS, shouldBackgroundPregenerateStyles, } from "./adapter-helpers.js";
14
14
  import { isNotFoundLikeError } from "./read-operations-helpers.js";
15
15
  import { DEFAULT_VERYFRONT_API_SUCCESS_BODY_BYTES } from "../../veryfront-api-transport.js";
16
16
  import { requireBoundedFileReadLimit } from "../../bounded-file-read.js";
@@ -74,6 +74,18 @@ export class VeryfrontFSAdapter {
74
74
  // entirely when caching is disabled, and can fail on a backend cache.
75
75
  fileListWarmupPromise = null;
76
76
  fileListWarmupKey = null;
77
+ /**
78
+ * Last listing this adapter fetched or was poked with, kept in memory because
79
+ * a cache write is not guaranteed to retain it: writes are skipped entirely
80
+ * when caching is disabled, oversized listings are dropped by the memory
81
+ * cache, and backend writes can fail. Without this, every module lookup of a
82
+ * render would miss the cache and await its own full listing fetch -- more
83
+ * API traffic than the per-file probing this replaced. It expires with the
84
+ * same TTL as the cache entry it stands in for and is dropped by every
85
+ * invalidation, so it is never fresher or staler than a retained cache write.
86
+ */
87
+ retainedFileList = null;
88
+ fileListRetentionMs;
77
89
  /** Single-flight foreground refresh when a branch preview read misses a newly pushed file. */
78
90
  branchMissRecoveryPromise = null;
79
91
  branchMissRecoveryGeneration = 0;
@@ -136,24 +148,81 @@ export class VeryfrontFSAdapter {
136
148
  return undefined;
137
149
  return this.cache.get(cacheKey);
138
150
  }
139
- async getCachedFileListAsync(noContextMessage, lookupLabel, missReason) {
151
+ async getCachedFileListAsync(noContextMessage, lookupLabel, missReason, options = {}) {
140
152
  const cacheKey = this.getCurrentFileListCacheKey();
141
153
  if (!cacheKey) {
142
154
  logger.debug(noContextMessage);
143
155
  return undefined;
144
156
  }
145
- const files = await this.cache.getAsync(cacheKey);
157
+ let files = await this.cache.getAsync(cacheKey);
146
158
  logger.debug(`${lookupLabel} lookup`, {
147
159
  cacheKey,
148
160
  hasResult: !!files,
149
161
  resultSize: files?.length ?? 0,
150
162
  hasContent: files?.filter((file) => !!file.content)?.length ?? 0,
151
163
  });
152
- if (!files?.length) {
164
+ if (files === undefined) {
165
+ files = this.readRetainedFileList(cacheKey);
166
+ }
167
+ if (files === undefined) {
153
168
  this.scheduleFileListWarmup(missReason, cacheKey);
169
+ if (options.waitForWarmup) {
170
+ files = await this.awaitFileListWarmup(cacheKey) ?? files;
171
+ }
154
172
  }
155
173
  return { cacheKey, files };
156
174
  }
175
+ /** Keep `files` answerable from memory for as long as a cache write would. */
176
+ retainFileList(cacheKey, files) {
177
+ this.retainedFileList = {
178
+ cacheKey,
179
+ files,
180
+ snapshotVersion: this.sourceSnapshotVersion,
181
+ retainedAt: Date.now(),
182
+ };
183
+ }
184
+ clearRetainedFileList() {
185
+ this.retainedFileList = null;
186
+ }
187
+ /**
188
+ * The retained listing, if it still describes the snapshot the caller is
189
+ * reading. Anything that supersedes the snapshot -- a poke, a refresh, a
190
+ * branch or token change -- either drops it outright or moves the snapshot
191
+ * version past it, so a superseded listing can never answer a read.
192
+ */
193
+ readRetainedFileList(cacheKey) {
194
+ const retained = this.retainedFileList;
195
+ if (!retained)
196
+ return undefined;
197
+ if (retained.cacheKey !== cacheKey ||
198
+ retained.snapshotVersion !== this.sourceSnapshotVersion) {
199
+ this.clearRetainedFileList();
200
+ return undefined;
201
+ }
202
+ if (Date.now() - retained.retainedAt > this.fileListRetentionMs) {
203
+ logger.debug("Retained file list expired", { cacheKey });
204
+ this.clearRetainedFileList();
205
+ return undefined;
206
+ }
207
+ return retained.files;
208
+ }
209
+ /**
210
+ * Wait for the in-flight file-list warmup for `cacheKey` and return the
211
+ * fetched listing. SSR module resolution reads this list for every module of
212
+ * a page; when the cached listing has expired, answering "no list" makes each
213
+ * module fall back to its own per-file/per-extension API probing (dozens of
214
+ * sequential fetches per render). Paying for one awaited listing fetch keeps
215
+ * that fan-out at a single API call while staying exactly as fresh: the
216
+ * listing is fetched from the API at request time. Warmup failures resolve to
217
+ * undefined so callers keep the legacy per-file fallback.
218
+ */
219
+ async awaitFileListWarmup(cacheKey) {
220
+ const warmupPromise = this.fileListWarmupPromise;
221
+ if (!warmupPromise || this.fileListWarmupKey !== cacheKey)
222
+ return undefined;
223
+ const fetched = await warmupPromise;
224
+ return fetched === null ? undefined : fetched;
225
+ }
157
226
  constructor(config) {
158
227
  this.invalidationCallbacks = config.invalidationCallbacks ?? {};
159
228
  this.styleCallbacks = config.styleCallbacks ?? {};
@@ -182,6 +251,7 @@ export class VeryfrontFSAdapter {
182
251
  });
183
252
  const cacheConfig = buildFileCacheOptions(vf.cache);
184
253
  this.cache = new FileCache(cacheConfig);
254
+ this.fileListRetentionMs = cacheConfig.ttl ?? DEFAULT_CACHE_TTL_MS;
185
255
  this.normalizer = new PathNormalizer(config.projectDir);
186
256
  // Per-releaseId fetcher registration is done in setContentContext when a
187
257
  // release context is resolved, ensuring the correct project-scoped token.
@@ -190,12 +260,14 @@ export class VeryfrontFSAdapter {
190
260
  getReleaseId: () => this.contentContext?.releaseId ?? null,
191
261
  getContentContext: () => this.contentContext,
192
262
  getFileList: async () => {
193
- const cached = await this.getCachedFileListAsync("getFileList: no contentContext", "getFileList", "getFileList miss");
263
+ const cached = await this.getCachedFileListAsync("getFileList: no contentContext", "getFileList", "getFileList miss", {
264
+ waitForWarmup: true,
265
+ });
194
266
  return cached?.files;
195
267
  },
196
268
  hasCachedFileList: async () => {
197
- const cached = await this.getCachedFileListAsync("hasCachedFileList: no contentContext", "hasCachedFileList", "hasCachedFileList miss");
198
- return Array.isArray(cached?.files) && cached.files.length > 0;
269
+ const cached = await this.getCachedFileListAsync("hasCachedFileList: no contentContext", "hasCachedFileList", "hasCachedFileList miss", { waitForWarmup: true });
270
+ return Array.isArray(cached?.files);
199
271
  },
200
272
  isPersistentCacheInvalidated: (prefix) => this.isPersistentCacheInvalidated(prefix),
201
273
  isReleaseBeingInvalidated: (releaseId) => this.isPersistentCacheInvalidated(buildFileCacheKeyPrefix({
@@ -206,7 +278,7 @@ export class VeryfrontFSAdapter {
206
278
  };
207
279
  this.statOps = new StatOperations(this.client, this.cache, this.normalizer, contentContextGetter);
208
280
  this.readOps = new ReadOperations(this.client, this.cache, this.normalizer, contentContextGetter, (path) => this.statOps.getOriginalApiPath(path), async () => {
209
- const cached = await this.getCachedFileListAsync("getFileListCache: no contentContext", "getFileListCache", "getFileListCache miss");
281
+ const cached = await this.getCachedFileListAsync("getFileListCache: no contentContext", "getFileListCache", "getFileListCache miss", { waitForWarmup: true });
210
282
  return cached?.files;
211
283
  });
212
284
  this.dirOps = new DirectoryOperations(this.client, this.cache, this.normalizer, contentContextGetter);
@@ -220,13 +292,9 @@ export class VeryfrontFSAdapter {
220
292
  getContentContext: () => this.contentContext,
221
293
  getContentSource: () => this.contentSource,
222
294
  getProjectDir: () => this.normalizer.getProjectDir(),
223
- clearMemoryCaches: () => {
224
- clearCachedReleaseAssetManifests();
225
- this.readOps.clearFileListIndex();
226
- this.statOps.clearIndex();
227
- this.dirOps.clearTree();
228
- },
229
- replaceSourceSnapshot: (cacheKey, files) => this.replaceSourceSnapshot(cacheKey, files),
295
+ clearMemoryCaches: () => this.clearMemoryCaches(),
296
+ getSourceSnapshotVersion: () => this.sourceSnapshotVersion,
297
+ replaceSourceSnapshot: (cacheKey, files, expectedSnapshotVersion) => this.replaceSourceSnapshot(cacheKey, files, expectedSnapshotVersion),
230
298
  pregenerateStyles: (files) => this.triggerCSSPregeneration(files),
231
299
  });
232
300
  logger.debug("Created", {
@@ -303,15 +371,34 @@ export class VeryfrontFSAdapter {
303
371
  releaseId: contentContext.releaseId,
304
372
  });
305
373
  const cacheKey = buildFileListCacheKey(contentContext);
374
+ const initializationIdentity = this.getCurrentSourceSnapshotIdentity();
375
+ const initializationSnapshotVersion = this.sourceSnapshotVersion;
306
376
  logger.debug("Step 4: fetchFileList START", { projectSlug, cacheKey });
307
377
  try {
308
378
  const files = await fetchFileListForContext(this.client, contentContext);
309
379
  const fileSummary = summarizeFileList(files);
310
- await this.cache.setAsync(cacheKey, files);
311
- this.markSourceSnapshotChanged(files);
380
+ const initialSnapshotApplied = await this.runSourceSnapshotMutation(async () => {
381
+ const isSnapshotSuperseded = () => this.contentContext !== contentContext ||
382
+ this.getCurrentSourceSnapshotIdentity() !== initializationIdentity ||
383
+ this.sourceSnapshotVersion !== initializationSnapshotVersion;
384
+ if (isSnapshotSuperseded())
385
+ return false;
386
+ await this.cache.setAsync(cacheKey, files);
387
+ if (isSnapshotSuperseded()) {
388
+ await this.cache.deleteAsync(cacheKey);
389
+ return false;
390
+ }
391
+ this.markSourceSnapshotChanged(files, initializationIdentity);
392
+ // Retain after the generation bump so the first read can reuse the
393
+ // initialized snapshot even when the configured cache keeps nothing.
394
+ this.retainFileList(cacheKey, files);
395
+ return true;
396
+ });
312
397
  this.fileListReadyResolve?.();
313
398
  this.fileListReadyResolve = null;
314
- logger.debug("Fetched files during initialization", {
399
+ logger.debug(initialSnapshotApplied
400
+ ? "Fetched files during initialization"
401
+ : "Discarded initialization files superseded by a newer source snapshot", {
315
402
  cacheKey,
316
403
  totalFiles: fileSummary.totalFiles,
317
404
  filesWithContent: fileSummary.filesWithContent,
@@ -321,7 +408,9 @@ export class VeryfrontFSAdapter {
321
408
  // Trigger CSS pre-generation after the initial file snapshot is ready for
322
409
  // published contexts. Branch previews should first try remote metadata
323
410
  // recovery on cold starts instead of repopulating the prepared cache here.
324
- if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
411
+ if (initialSnapshotApplied &&
412
+ fileSummary.sourceFilesWithContent > 0 &&
413
+ this.shouldBackgroundPregenerateStyles()) {
325
414
  this.triggerCSSPregeneration(files).catch(() => {
326
415
  // Error already logged in triggerCSSPregeneration
327
416
  });
@@ -329,14 +418,15 @@ export class VeryfrontFSAdapter {
329
418
  this.initialized = true;
330
419
  logger.debug("initialize COMPLETE", {
331
420
  projectSlug,
332
- fileCount: files.length,
421
+ fileCount: initialSnapshotApplied ? files.length : 0,
333
422
  totalDuration: `${(performance.now() - initStartTime).toFixed(2)}ms`,
334
423
  });
335
- if (contentContext.sourceType === "branch") {
424
+ const initializedContext = this.contentContext;
425
+ if (initializedContext?.sourceType === "branch") {
336
426
  logger.debug("Initialized (branch mode)", {
337
427
  projectId: this.client.getProjectId(),
338
- files: files.length,
339
- branch: contentContext.branch,
428
+ files: initialSnapshotApplied ? files.length : 0,
429
+ branch: initializedContext.branch,
340
430
  proxyMode: this.proxyMode,
341
431
  });
342
432
  this.wsManager.connect(projectId);
@@ -344,14 +434,14 @@ export class VeryfrontFSAdapter {
344
434
  }
345
435
  logger.debug("Initialized (published mode)", {
346
436
  projectId: this.client.getProjectId(),
347
- files: files.length,
348
- sourceType: contentContext.sourceType,
349
- environmentName: contentContext.environmentName,
350
- releaseId: contentContext.releaseId,
437
+ files: initialSnapshotApplied ? files.length : 0,
438
+ sourceType: initializedContext?.sourceType,
439
+ environmentName: initializedContext?.environmentName,
440
+ releaseId: initializedContext?.releaseId,
351
441
  });
352
442
  // Keep a WebSocket connection in environment mode to receive deployment pokes.
353
443
  // Release mode is immutable, so no need to keep a live connection.
354
- if (contentContext.sourceType === "environment") {
444
+ if (initializedContext?.sourceType === "environment") {
355
445
  this.wsManager.connect(projectId);
356
446
  }
357
447
  }
@@ -490,11 +580,12 @@ export class VeryfrontFSAdapter {
490
580
  return;
491
581
  }
492
582
  const warmupContext = this.contentContext;
583
+ const warmupSnapshotVersion = this.sourceSnapshotVersion;
493
584
  let warmupPromise = null;
494
585
  warmupPromise = (async () => {
495
586
  try {
496
587
  const existing = await this.cache.getAsync(effectiveCacheKey);
497
- if (existing?.length) {
588
+ if (existing !== undefined) {
498
589
  logger.debug("Skipping file list warmup because cache is already populated", {
499
590
  reason,
500
591
  cacheKey: effectiveCacheKey,
@@ -511,7 +602,37 @@ export class VeryfrontFSAdapter {
511
602
  releaseId: warmupContext.releaseId,
512
603
  });
513
604
  const files = await fetchFileListForContext(this.client, warmupContext);
514
- await this.cache.setAsync(effectiveCacheKey, files);
605
+ // A WebSocket snapshot can land while this fetch is open. Publishing
606
+ // the pre-poke listing would roll both the cache and this caller's
607
+ // answer back to the older draft, so the write is serialized against
608
+ // snapshot mutations and stands down when one won the race.
609
+ const applied = await this.runSourceSnapshotMutation(async () => {
610
+ if (this.contentContext !== warmupContext ||
611
+ this.sourceSnapshotVersion !== warmupSnapshotVersion) {
612
+ return false;
613
+ }
614
+ await this.cache.setAsync(effectiveCacheKey, files);
615
+ // A poke can advance the generation while a distributed cache write
616
+ // is pending. Remove the value that just landed before releasing the
617
+ // mutation lock, so neither this waiter nor a later read sees it.
618
+ if (this.contentContext !== warmupContext ||
619
+ this.sourceSnapshotVersion !== warmupSnapshotVersion) {
620
+ await this.cache.deleteAsync(effectiveCacheKey);
621
+ return false;
622
+ }
623
+ this.retainFileList(effectiveCacheKey, files);
624
+ return true;
625
+ });
626
+ if (!applied) {
627
+ logger.debug("Discarding file list warmup superseded by a newer source snapshot", {
628
+ reason,
629
+ cacheKey: effectiveCacheKey,
630
+ });
631
+ // Answer with the snapshot that superseded this fetch rather than
632
+ // the listing it carries, so the caller stays as fresh as the poke.
633
+ return await this.cache.getAsync(effectiveCacheKey) ?? this.readRetainedFileList(effectiveCacheKey) ??
634
+ null;
635
+ }
515
636
  const fileSummary = summarizeFileList(files);
516
637
  if (fileSummary.sourceFilesWithContent > 0 && this.shouldBackgroundPregenerateStyles()) {
517
638
  this.triggerCSSPregeneration(files).catch(() => {
@@ -546,6 +667,22 @@ export class VeryfrontFSAdapter {
546
667
  // That collaborator only needs completion, not the payload.
547
668
  this.readOps.setFileListReadyPromise(warmupPromise.then(() => { }));
548
669
  }
670
+ /**
671
+ * Drop every in-memory view of the current source snapshot. Used by pokes
672
+ * that invalidate without carrying replacement files inline, so the next read
673
+ * re-derives everything from the API rather than from a superseded listing.
674
+ */
675
+ clearMemoryCaches() {
676
+ clearCachedReleaseAssetManifests();
677
+ // An accepted poke may clear memory before its debounced replacement
678
+ // listing arrives. Advance the generation immediately so an older warmup
679
+ // cannot repopulate the cache or answer a waiting read in that window.
680
+ this.sourceSnapshotVersion = nextSourceSnapshotGeneration();
681
+ this.clearRetainedFileList();
682
+ this.readOps.clearFileListIndex();
683
+ this.statOps.clearIndex();
684
+ this.dirOps.clearTree();
685
+ }
549
686
  markSourceSnapshotChanged(files, identity = this.getCurrentSourceSnapshotIdentity()) {
550
687
  this.sourceSnapshotFiles = files;
551
688
  this.sourceSnapshotIdentity = identity;
@@ -559,19 +696,34 @@ export class VeryfrontFSAdapter {
559
696
  this.sourceSnapshotMutationTail = mutation.then(() => undefined, () => undefined);
560
697
  return mutation;
561
698
  }
562
- replaceSourceSnapshot(cacheKey, files) {
699
+ replaceSourceSnapshot(cacheKey, files, expectedSnapshotVersion = this.sourceSnapshotVersion) {
700
+ const expectedContext = this.contentContext;
563
701
  return this.runSourceSnapshotMutation(async () => {
564
- const context = this.contentContext;
565
- if (!context || buildFileListCacheKey(context) !== cacheKey) {
566
- logger.debug("Discarding source snapshot for superseded content context", {
702
+ if (!expectedContext ||
703
+ this.contentContext !== expectedContext ||
704
+ this.sourceSnapshotVersion !== expectedSnapshotVersion ||
705
+ buildFileListCacheKey(expectedContext) !== cacheKey) {
706
+ logger.debug("Discarding superseded source snapshot", {
567
707
  cacheKey,
568
708
  projectSlug: this.projectSlug,
569
709
  });
570
- return;
710
+ return undefined;
571
711
  }
572
712
  await this.cache.setAsync(cacheKey, files);
713
+ if (this.contentContext !== expectedContext ||
714
+ this.sourceSnapshotVersion !== expectedSnapshotVersion) {
715
+ // A newer poke invalidated this replacement while its distributed
716
+ // cache write was pending. Remove the value that just landed and leave
717
+ // memory empty so the next read derives the newer snapshot.
718
+ await this.cache.deleteAsync(cacheKey);
719
+ return undefined;
720
+ }
573
721
  this.readOps.clearFileListIndex();
574
722
  this.markSourceSnapshotChanged(files);
723
+ // Retain after the version bump so the poked listing -- not the one it
724
+ // replaced -- is what later reads see when the cache keeps nothing.
725
+ this.retainFileList(cacheKey, files);
726
+ return this.sourceSnapshotVersion;
575
727
  });
576
728
  }
577
729
  async invalidateDerivedSourceCaches() {
@@ -608,15 +760,17 @@ export class VeryfrontFSAdapter {
608
760
  const previousVersion = this.sourceSnapshotVersion;
609
761
  const files = await fetchFileListForContext(this.client, refreshContext);
610
762
  const result = await this.runSourceSnapshotMutation(async () => {
611
- if (this.contentContext !== refreshContext ||
763
+ const isSnapshotSuperseded = () => this.contentContext !== refreshContext ||
612
764
  this.getCurrentSourceSnapshotIdentity() !== refreshIdentity ||
613
- this.sourceSnapshotVersion !== previousVersion) {
765
+ this.sourceSnapshotVersion !== previousVersion;
766
+ if (isSnapshotSuperseded()) {
614
767
  return { applied: false, sourceChanged: false };
615
768
  }
616
769
  const sourceChanged = !sourceSnapshotsEqual(previousFiles, files);
617
770
  if (sourceChanged) {
618
771
  this.fileListWarmupPromise = null;
619
772
  this.fileListWarmupKey = null;
773
+ this.clearRetainedFileList();
620
774
  this.readOps.clearFileListIndex();
621
775
  this.statOps.clearIndex();
622
776
  this.dirOps.clearTree();
@@ -626,11 +780,21 @@ export class VeryfrontFSAdapter {
626
780
  this.cache.deleteByPrefixAsync(buildDirCacheKeyPrefix(refreshContext)),
627
781
  this.cache.deleteAsync(cacheKey),
628
782
  ]);
783
+ if (isSnapshotSuperseded()) {
784
+ return { applied: false, sourceChanged: false };
785
+ }
629
786
  }
630
787
  await this.cache.setAsync(cacheKey, files);
631
- this.branchMissRecoveryFailures.clear();
788
+ if (isSnapshotSuperseded()) {
789
+ await this.cache.deleteAsync(cacheKey);
790
+ return { applied: false, sourceChanged: false };
791
+ }
632
792
  if (sourceChanged) {
633
793
  await this.invalidateDerivedSourceCaches();
794
+ if (isSnapshotSuperseded()) {
795
+ await this.cache.deleteAsync(cacheKey);
796
+ return { applied: false, sourceChanged: false };
797
+ }
634
798
  // Publish freshness only after every cache derived from the previous
635
799
  // snapshot has been invalidated. Concurrent followers remain attached
636
800
  // to the refresh singleflight until this point.
@@ -641,6 +805,8 @@ export class VeryfrontFSAdapter {
641
805
  this.sourceSnapshotIdentity = refreshIdentity;
642
806
  this.sourceSnapshotCheckedAt = Date.now();
643
807
  }
808
+ this.branchMissRecoveryFailures.clear();
809
+ this.retainFileList(cacheKey, files);
644
810
  return { applied: true, sourceChanged };
645
811
  });
646
812
  if (!result.applied) {
@@ -770,6 +936,7 @@ export class VeryfrontFSAdapter {
770
936
  this.exactReadInitializationGeneration++;
771
937
  this.fileListWarmupPromise = null;
772
938
  this.fileListWarmupKey = null;
939
+ this.clearRetainedFileList();
773
940
  this.branchMissRecoveryPromise = null;
774
941
  this.branchMissRecoveryGeneration++;
775
942
  this.branchMissRecoveryFailures.clear();
@@ -804,12 +971,12 @@ export class VeryfrontFSAdapter {
804
971
  // populates it for a release-backed context, so returning early meant the
805
972
  // list was empty on every request for the life of the process. Wait for the
806
973
  // fetch this read just started, then look again.
807
- if (options.waitForWarmup && cacheKey && !files?.length && this.fileListWarmupPromise) {
974
+ if (options.waitForWarmup && cacheKey && files === undefined && this.fileListWarmupPromise) {
808
975
  // Take what the fetch returned rather than re-reading the cache: with
809
976
  // caching disabled, or a failed backend write, the cache keeps nothing
810
977
  // and correctness would depend on a write that never happened.
811
978
  const fetched = await this.fileListWarmupPromise;
812
- files = fetched?.length
979
+ files = fetched !== null
813
980
  ? fetched
814
981
  : await this.cache.getAsync(cacheKey);
815
982
  }
@@ -883,6 +1050,7 @@ export class VeryfrontFSAdapter {
883
1050
  }
884
1051
  invalidateRequestAuthoritySnapshot() {
885
1052
  this.cache.clear();
1053
+ this.clearRetainedFileList();
886
1054
  this.readOps.clearFileListIndex();
887
1055
  this.statOps.clearIndex();
888
1056
  this.dirOps.clearTree();
@@ -945,6 +1113,7 @@ export class VeryfrontFSAdapter {
945
1113
  this.dirOps.clearTree();
946
1114
  this.fileListWarmupPromise = null;
947
1115
  this.fileListWarmupKey = null;
1116
+ this.clearRetainedFileList();
948
1117
  this.branchMissRecoveryPromise = null;
949
1118
  this.branchMissRecoveryGeneration++;
950
1119
  this.branchMissRecoveryFailures.clear();
@@ -1 +1 @@
1
- {"version":3,"file":"file-list-index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/file-list-index.ts"],"names":[],"mappings":"AAIA,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,yBAAyB,GAAG,KAAK,CAAC;IACtE,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAeD,qBAAa,aAAa;IAStB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IARpC,OAAO,CAAC,KAAK,CAAoC;IACjD,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAA8B;gBAG/B,gBAAgB,CAAC,GAAE,MAAM,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC,aAAA;IAG1F,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI7C,KAAK,IAAI,IAAI;YAYC,WAAW;IAWnB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3D,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA8C3D,oBAAoB,CACxB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAMnD,cAAc,CAClB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,mBAAmB,CAAC;YA6BjB,UAAU;CAoGzB"}
1
+ {"version":3,"file":"file-list-index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/file-list-index.ts"],"names":[],"mappings":"AAIA,UAAU,kBAAkB;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,aAAa,GAAG,SAAS,GAAG,yBAAyB,GAAG,KAAK,CAAC;IACtE,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAID,qBAAa,aAAa;IAStB,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC;IARpC,OAAO,CAAC,KAAK,CAAoC;IACjD,OAAO,CAAC,OAAO,CAA4B;IAC3C,OAAO,CAAC,QAAQ,CAAuB;IACvC,OAAO,CAAC,YAAY,CAAK;IACzB,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,YAAY,CAA8B;gBAG/B,gBAAgB,CAAC,GAAE,MAAM,OAAO,CAAC,KAAK,CAAC,kBAAkB,CAAC,GAAG,SAAS,CAAC,aAAA;IAG1F,eAAe,CAAC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI;IAI7C,KAAK,IAAI,IAAI;YAYC,WAAW;IAWnB,MAAM,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAK3D,KAAK,CAAC,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IA4C3D,oBAAoB,CACxB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC;IAMnD,cAAc,CAClB,eAAe,EAAE,MAAM,EAAE,GACxB,OAAO,CAAC,mBAAmB,CAAC;YA6BjB,UAAU;CAiGzB"}
@@ -1,14 +1,5 @@
1
1
  import { logger as baseLogger } from "../../../../utils/index.js";
2
2
  const logger = baseLogger.component("read-operations");
3
- function hashPreview(content) {
4
- return content
5
- .slice(0, 100)
6
- .split("")
7
- .reduce((h, c) => ((h << 5) - h + c.charCodeAt(0)) | 0, 0);
8
- }
9
- function previewText(content, max = 80) {
10
- return content.length > max ? `${content.slice(0, max)}...` : content;
11
- }
12
3
  const INDEX_STALENESS_LIMIT_MS = 5 * 60 * 1000; // 5 minutes
13
4
  export class FileListIndex {
14
5
  getFileListCache;
@@ -80,8 +71,6 @@ export class FileListIndex {
80
71
  logger.debug("FILE_LIST_CACHE_HIT - serving from file list cache", {
81
72
  path: normalizedPath,
82
73
  contentLength: content.length,
83
- contentHash: hashPreview(content),
84
- contentPreview: previewText(content, 200).replace(/\n/g, "\\n"),
85
74
  });
86
75
  return {
87
76
  status: "hit",
@@ -165,7 +154,6 @@ export class FileListIndex {
165
154
  filesWithContent: fileList.filter((f) => f.content).length,
166
155
  sampleFilePath: cacheCheckSample?.path,
167
156
  sampleContentLength: cacheCheckSample?.content?.length,
168
- sampleContentPreview: cacheCheckSample?.content?.slice(0, 200)?.replace(/\n/g, "\\n"),
169
157
  });
170
158
  const indexKey = `${fileList.length}:${fileList[0]?.path ?? ""}:${fileList[fileList.length - 1]?.path ?? ""}`;
171
159
  if (this.index && this.pathSet && this.indexKey === indexKey) {
@@ -196,8 +184,6 @@ export class FileListIndex {
196
184
  indexedWithContent: index.size,
197
185
  sampleFilePath: sampleFile?.path,
198
186
  sampleContentLength: sampleContent?.length,
199
- sampleContentHash: sampleContent ? hashPreview(sampleContent) : undefined,
200
- sampleContentPreview: sampleContent?.slice(0, 200)?.replace(/\n/g, "\\n"),
201
187
  });
202
188
  return {
203
189
  content: index,
@@ -31,7 +31,6 @@ interface BuildReadFetchStateOptions {
31
31
  export declare function assertProjectSourcePath(normalizedPath: string): void;
32
32
  export declare function buildReadFetchState(options: BuildReadFetchStateOptions): ReadFetchState;
33
33
  export declare function getResolvedCacheKey(cacheKeyPrefix: string, normalizedResolvedPath: string): string;
34
- export declare function buildContentPreview(content: string, max?: number): string;
35
34
  export declare function buildExtensionCandidatePaths(basePath: string): string[];
36
35
  export declare function splitKnownFileExtension(apiPath: string): {
37
36
  originalExtension: string;
@@ -1 +1 @@
1
- {"version":3,"file":"read-operations-helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,UAAU,uBAAuB;IAC/B,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,4BAA4B,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3D,yBAAyB,CA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C,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAS3D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAEvE"}
1
+ {"version":3,"file":"read-operations-helpers.d.ts","sourceRoot":"","sources":["../../../../../../src/src/platform/adapters/fs/veryfront/read-operations-helpers.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iCAAiC,EAAE,MAAM,yBAAyB,CAAC;AAC5E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEzD,OAAO,EAAE,iCAAiC,EAAE,CAAC;AAE7C,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAE1D,UAAU,uBAAuB;IAC/B,gBAAgB,EAAE,MAAM,OAAO,CAAC;IAChC,4BAA4B,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3D,yBAAyB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC5D;AAED,UAAU,cAAc;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,cAAc,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,OAAO,CAAC;IACtB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;IACrC,mBAAmB,EAAE,OAAO,CAAC;IAC7B,oBAAoB,EAAE,OAAO,GAAG,SAAS,CAAC;IAC1C,oBAAoB,EAAE,OAAO,CAAC;CAC/B;AAED,UAAU,0BAA0B;IAClC,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,sBAAsB,GAAG,IAAI,CAAC;IAC9C,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C,kBAAkB,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;CAC/C;AAED,wBAAgB,uBAAuB,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,CAOpE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,0BAA0B,GAAG,cAAc,CA2BvF;AAED,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,MAAM,EACtB,sBAAsB,EAAE,MAAM,GAC7B,MAAM,CAER;AAED,wBAAgB,4BAA4B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAEvE;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,GACd;IAAE,iBAAiB,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASxD;AAED,4FAA4F;AAC5F,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEnE;AAED,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAS3D;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,CAEvE"}
@@ -40,9 +40,6 @@ export function buildReadFetchState(options) {
40
40
  export function getResolvedCacheKey(cacheKeyPrefix, normalizedResolvedPath) {
41
41
  return `${cacheKeyPrefix}:${normalizedResolvedPath}`;
42
42
  }
43
- export function buildContentPreview(content, max = 80) {
44
- return content.length > max ? `${content.slice(0, max)}...` : content;
45
- }
46
43
  export function buildExtensionCandidatePaths(basePath) {
47
44
  return READ_OPERATION_EXTENSION_PRIORITY.map((ext) => `${basePath}${ext}`);
48
45
  }