veryfront 0.1.811 → 0.1.813

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 (106) hide show
  1. package/esm/deno.js +1 -1
  2. package/esm/src/agent/conversation/durable-contracts.d.ts +204 -0
  3. package/esm/src/agent/conversation/durable-contracts.d.ts.map +1 -0
  4. package/esm/src/agent/conversation/durable-contracts.js +168 -0
  5. package/esm/src/agent/conversation/durable.d.ts +3 -198
  6. package/esm/src/agent/conversation/durable.d.ts.map +1 -1
  7. package/esm/src/agent/conversation/durable.js +2 -167
  8. package/esm/src/agent/runtime/agent-runtime-step.d.ts +44 -0
  9. package/esm/src/agent/runtime/agent-runtime-step.d.ts.map +1 -0
  10. package/esm/src/agent/runtime/agent-runtime-step.js +23 -0
  11. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  12. package/esm/src/agent/runtime/index.js +40 -39
  13. package/esm/src/agent/runtime/model-transport.d.ts +23 -0
  14. package/esm/src/agent/runtime/model-transport.d.ts.map +1 -0
  15. package/esm/src/agent/runtime/model-transport.js +26 -0
  16. package/esm/src/cache/keys/builders/render.d.ts.map +1 -1
  17. package/esm/src/cache/keys/builders/render.js +3 -2
  18. package/esm/src/cache/request-cacheability.d.ts +3 -0
  19. package/esm/src/cache/request-cacheability.d.ts.map +1 -0
  20. package/esm/src/cache/request-cacheability.js +26 -0
  21. package/esm/src/html/hydration-script-builder/hydration-data-generator.d.ts.map +1 -1
  22. package/esm/src/html/hydration-script-builder/hydration-data-generator.js +1 -10
  23. package/esm/src/html/hydration-script-builder/templates/router.d.ts.map +1 -1
  24. package/esm/src/html/hydration-script-builder/templates/router.js +41 -10
  25. package/esm/src/modules/import-map/loader.d.ts.map +1 -1
  26. package/esm/src/modules/import-map/loader.js +2 -1
  27. package/esm/src/modules/manifest/route-module-manifest.d.ts.map +1 -1
  28. package/esm/src/modules/manifest/route-module-manifest.js +2 -0
  29. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  30. package/esm/src/modules/server/module-server.js +27 -9
  31. package/esm/src/observability/request-profiler.d.ts.map +1 -1
  32. package/esm/src/observability/request-profiler.js +1 -0
  33. package/esm/src/observability/simple-metrics/index.d.ts +6 -3
  34. package/esm/src/observability/simple-metrics/index.d.ts.map +1 -1
  35. package/esm/src/observability/simple-metrics/index.js +5 -2
  36. package/esm/src/observability/simple-metrics/metrics-recorder.d.ts +4 -0
  37. package/esm/src/observability/simple-metrics/metrics-recorder.d.ts.map +1 -1
  38. package/esm/src/observability/simple-metrics/metrics-recorder.js +34 -0
  39. package/esm/src/observability/simple-metrics/metrics-state.d.ts.map +1 -1
  40. package/esm/src/observability/simple-metrics/metrics-state.js +24 -0
  41. package/esm/src/observability/simple-metrics/otel-instruments.d.ts.map +1 -1
  42. package/esm/src/observability/simple-metrics/otel-instruments.js +13 -0
  43. package/esm/src/observability/simple-metrics/types.d.ts +12 -0
  44. package/esm/src/observability/simple-metrics/types.d.ts.map +1 -1
  45. package/esm/src/platform/adapters/runtime/shared/shared-watcher.d.ts.map +1 -1
  46. package/esm/src/platform/adapters/runtime/shared/shared-watcher.js +1 -1
  47. package/esm/src/platform/compat/http/native-response.d.ts +10 -1
  48. package/esm/src/platform/compat/http/native-response.d.ts.map +1 -1
  49. package/esm/src/platform/compat/http/native-response.js +20 -14
  50. package/esm/src/proxy/handler.d.ts +1 -7
  51. package/esm/src/proxy/handler.d.ts.map +1 -1
  52. package/esm/src/proxy/handler.js +63 -189
  53. package/esm/src/proxy/main.js +21 -20
  54. package/esm/src/proxy/proxy-access-control.d.ts +41 -0
  55. package/esm/src/proxy/proxy-access-control.d.ts.map +1 -0
  56. package/esm/src/proxy/proxy-access-control.js +151 -0
  57. package/esm/src/proxy/proxy-error-context.d.ts +20 -0
  58. package/esm/src/proxy/proxy-error-context.d.ts.map +1 -0
  59. package/esm/src/proxy/proxy-error-context.js +35 -0
  60. package/esm/src/proxy/request-lifecycle.d.ts +19 -0
  61. package/esm/src/proxy/request-lifecycle.d.ts.map +1 -0
  62. package/esm/src/proxy/request-lifecycle.js +27 -0
  63. package/esm/src/proxy/upstream-error-response.d.ts +5 -0
  64. package/esm/src/proxy/upstream-error-response.d.ts.map +1 -0
  65. package/esm/src/proxy/upstream-error-response.js +15 -0
  66. package/esm/src/react/components/chat/chat/composition/chat-composer.d.ts.map +1 -1
  67. package/esm/src/react/components/chat/chat/composition/chat-composer.js +3 -1
  68. package/esm/src/release-assets/client-module-map.d.ts +3 -0
  69. package/esm/src/release-assets/client-module-map.d.ts.map +1 -0
  70. package/esm/src/release-assets/client-module-map.js +10 -0
  71. package/esm/src/rendering/cache/cache-coordinator.d.ts.map +1 -1
  72. package/esm/src/rendering/cache/cache-coordinator.js +1 -0
  73. package/esm/src/rendering/cache/stores/memory-store.d.ts +2 -0
  74. package/esm/src/rendering/cache/stores/memory-store.d.ts.map +1 -1
  75. package/esm/src/rendering/cache/stores/memory-store.js +2 -1
  76. package/esm/src/rendering/orchestrator/lifecycle.d.ts.map +1 -1
  77. package/esm/src/rendering/orchestrator/lifecycle.js +1 -0
  78. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  79. package/esm/src/rendering/orchestrator/module-loader/index.js +13 -49
  80. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts +25 -0
  81. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.d.ts.map +1 -0
  82. package/esm/src/rendering/orchestrator/module-loader/module-cache-lookup.js +69 -0
  83. package/esm/src/rendering/orchestrator/pipeline.d.ts.map +1 -1
  84. package/esm/src/rendering/orchestrator/pipeline.js +22 -35
  85. package/esm/src/rendering/orchestrator/render-result-assembly.d.ts +27 -0
  86. package/esm/src/rendering/orchestrator/render-result-assembly.d.ts.map +1 -0
  87. package/esm/src/rendering/orchestrator/render-result-assembly.js +28 -0
  88. package/esm/src/rendering/orchestrator/types.d.ts +2 -0
  89. package/esm/src/rendering/orchestrator/types.d.ts.map +1 -1
  90. package/esm/src/rendering/renderer.d.ts.map +1 -1
  91. package/esm/src/rendering/renderer.js +24 -19
  92. package/esm/src/rendering/shared/context-aware-cache.d.ts.map +1 -1
  93. package/esm/src/rendering/shared/context-aware-cache.js +1 -0
  94. package/esm/src/server/handlers/dev/dashboard/api.d.ts +3 -0
  95. package/esm/src/server/handlers/dev/dashboard/api.d.ts.map +1 -1
  96. package/esm/src/server/handlers/dev/dashboard/api.js +41 -57
  97. package/esm/src/server/handlers/dev/framework-candidates.generated.d.ts.map +1 -1
  98. package/esm/src/server/handlers/dev/framework-candidates.generated.js +11 -1
  99. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts +1 -0
  100. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.d.ts.map +1 -1
  101. package/esm/src/server/handlers/request/module/page-data-endpoint-handler.js +98 -8
  102. package/esm/src/transforms/esm/specifier-resolver.d.ts.map +1 -1
  103. package/esm/src/transforms/esm/specifier-resolver.js +14 -0
  104. package/esm/src/utils/version-constant.d.ts +1 -1
  105. package/esm/src/utils/version-constant.js +1 -1
  106. package/package.json +1 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proxy-error-context.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/proxy-error-context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAEjD,MAAM,MAAM,cAAc,GACtB,uBAAuB,GACvB,mBAAmB,GACnB,mBAAmB,CAAC;AAExB,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,UAAU,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,cAAc,CAAC;CACvB;AAED,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,wBAAwB,GAChC,YAAY,CAkBd;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,qBAAqB,EAC3B,OAAO,EAAE,2BAA2B,GAAG,mBAAmB,EAC1D,KAAK,CAAC,EAAE,MAAM,GACb,YAAY,CAOd;AAED,wBAAgB,iCAAiC,CAC/C,IAAI,EAAE,qBAAqB,EAC3B,KAAK,CAAC,EAAE,MAAM,GACb,YAAY,CAOd"}
@@ -0,0 +1,35 @@
1
+ export function createProxyErrorContext(base, options) {
2
+ return {
3
+ token: options.token,
4
+ projectSlug: undefined,
5
+ projectId: undefined,
6
+ environment: base.scope,
7
+ contentSourceId: "error",
8
+ localPath: undefined,
9
+ host: base.host,
10
+ parsedDomain: base.parsedDomain,
11
+ isLocalProject: false,
12
+ error: {
13
+ status: options.status,
14
+ message: options.message,
15
+ redirectUrl: options.redirectUrl,
16
+ slug: options.slug,
17
+ },
18
+ };
19
+ }
20
+ export function createProjectNotFoundProxyContext(base, message, token) {
21
+ return createProxyErrorContext(base, {
22
+ status: 404,
23
+ message,
24
+ token,
25
+ slug: "project-not-found",
26
+ });
27
+ }
28
+ export function createReleaseNotFoundProxyContext(base, token) {
29
+ return createProxyErrorContext(base, {
30
+ status: 404,
31
+ message: "No active release found",
32
+ token,
33
+ slug: "release-not-found",
34
+ });
35
+ }
@@ -0,0 +1,19 @@
1
+ import type { Context, Span } from "../observability/tracing/api-shim.js";
2
+ export interface ProxyRequestLifecycle {
3
+ end(statusCode: number, error?: Error): void;
4
+ }
5
+ export interface RunProxyRequestLifecycleOptions {
6
+ req: Request;
7
+ url: URL;
8
+ extractContext(headers: Headers): Context | undefined;
9
+ startServerSpan(method: string, path: string, parentContext?: Context): {
10
+ span: Span;
11
+ context: Context;
12
+ } | null;
13
+ withContext<T>(spanContext: Context, fn: () => Promise<T>): Promise<T>;
14
+ endSpan(span: Span | undefined, statusCode: number, error?: Error): void;
15
+ handle(lifecycle: ProxyRequestLifecycle): Promise<Response>;
16
+ }
17
+ /** Run a proxied HTTP request with tracing context and exactly-once span finalization. */
18
+ export declare function runProxyRequestLifecycle(options: RunProxyRequestLifecycleOptions): Promise<Response>;
19
+ //# sourceMappingURL=request-lifecycle.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/request-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAE1E,MAAM,WAAW,qBAAqB;IACpC,GAAG,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;CAC9C;AAED,MAAM,WAAW,+BAA+B;IAC9C,GAAG,EAAE,OAAO,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,cAAc,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAAC;IACtD,eAAe,CACb,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,EACZ,aAAa,CAAC,EAAE,OAAO,GACtB;QAAE,IAAI,EAAE,IAAI,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,GAAG,IAAI,CAAC;IAC3C,WAAW,CAAC,CAAC,EAAE,WAAW,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IACvE,OAAO,CAAC,IAAI,EAAE,IAAI,GAAG,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK,GAAG,IAAI,CAAC;IACzE,MAAM,CAAC,SAAS,EAAE,qBAAqB,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;CAC7D;AAED,0FAA0F;AAC1F,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,+BAA+B,GACvC,OAAO,CAAC,QAAQ,CAAC,CA0BnB"}
@@ -0,0 +1,27 @@
1
+ /** Run a proxied HTTP request with tracing context and exactly-once span finalization. */
2
+ export async function runProxyRequestLifecycle(options) {
3
+ const parentContext = options.extractContext(options.req.headers);
4
+ const spanInfo = options.startServerSpan(options.req.method, options.url.pathname, parentContext);
5
+ let ended = false;
6
+ const lifecycle = {
7
+ end(statusCode, error) {
8
+ if (ended)
9
+ return;
10
+ ended = true;
11
+ options.endSpan(spanInfo?.span, statusCode, error);
12
+ },
13
+ };
14
+ const execute = async () => {
15
+ try {
16
+ const response = await options.handle(lifecycle);
17
+ lifecycle.end(response.status);
18
+ return response;
19
+ }
20
+ catch (error) {
21
+ const spanError = error instanceof Error ? error : new Error(String(error));
22
+ lifecycle.end(500, spanError);
23
+ throw error;
24
+ }
25
+ };
26
+ return spanInfo?.context ? options.withContext(spanInfo.context, execute) : execute();
27
+ }
@@ -0,0 +1,5 @@
1
+ export declare const UPSTREAM_TIMEOUT_STATUS = 504;
2
+ export declare const UPSTREAM_FAILURE_STATUS = 502;
3
+ export declare function createUpstreamTimeoutResponse(timeoutMs: number): Response;
4
+ export declare function createUpstreamFailureResponse(error: unknown): Response;
5
+ //# sourceMappingURL=upstream-error-response.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstream-error-response.d.ts","sourceRoot":"","sources":["../../../src/src/proxy/upstream-error-response.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAC3C,eAAO,MAAM,uBAAuB,MAAM,CAAC;AAE3C,wBAAgB,6BAA6B,CAAC,SAAS,EAAE,MAAM,GAAG,QAAQ,CAKzE;AAED,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,GAAG,QAAQ,CAKtE"}
@@ -0,0 +1,15 @@
1
+ import { jsonErrorResponse } from "./error-response.js";
2
+ export const UPSTREAM_TIMEOUT_STATUS = 504;
3
+ export const UPSTREAM_FAILURE_STATUS = 502;
4
+ export function createUpstreamTimeoutResponse(timeoutMs) {
5
+ return jsonErrorResponse(UPSTREAM_TIMEOUT_STATUS, {
6
+ error: "Gateway Timeout",
7
+ message: `Server request timed out after ${timeoutMs}ms`,
8
+ });
9
+ }
10
+ export function createUpstreamFailureResponse(error) {
11
+ return jsonErrorResponse(UPSTREAM_FAILURE_STATUS, {
12
+ error: "Proxy Error",
13
+ message: error instanceof Error ? error.message : "Unknown error",
14
+ });
15
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-composer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAI1D,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjF,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAGlB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,4BAA4B;AAC5B,eAAO,MAAM,YAAY,0FAyMxB,CAAC"}
1
+ {"version":3,"file":"chat-composer.d.ts","sourceRoot":"","sources":["../../../../../../../src/src/react/components/chat/chat/composition/chat-composer.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,kCAAkC,CAAC;AAI1D,OAAO,EAAE,KAAK,WAAW,EAAiB,MAAM,yBAAyB,CAAC;AAC1E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAEvE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAEvE,uCAAuC;AACvC,MAAM,WAAW,iBAAiB;IAChC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC,gBAAgB,GAAG,mBAAmB,CAAC,KAAK,IAAI,CAAC;IACjF,QAAQ,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,SAAS,KAAK,IAAI,CAAC;IACzC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,SAAS,CAAC;IAGlB,IAAI,CAAC,EAAE,MAAM,IAAI,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IAGpB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAGxC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAC;IACrC,kBAAkB,CAAC,EAAE,MAAM,IAAI,CAAC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,cAAc,EAAE,CAAC;IAC/B,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IAG1C,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE,WAAW,EAAE,CAAC;IAEzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED,4BAA4B;AAC5B,eAAO,MAAM,YAAY,0FA4MxB,CAAC"}
@@ -14,6 +14,8 @@ import { downloadMarkdown } from "../utils/export.js";
14
14
  export const ChatComposer = React.forwardRef(function ChatComposer({ input, onChange, onSubmit, isLoading, placeholder = "Type a message...", theme, stop, onVoice, isListening = false, transcript, models, model, onModelChange, onAttach, onSelectAttachment, attachAccept, attachments, onRemoveAttachment, showExport = false, messages, className, children, }, ref) {
15
15
  const fileInputRef = React.useRef(null);
16
16
  const [attachmentMenuOpen, setAttachmentMenuOpen] = React.useState(false);
17
+ const inputPlaceholder = isListening ? "Listening..." : placeholder;
18
+ const inputLabel = inputPlaceholder || "Message";
17
19
  return (React.createElement("div", { ref: ref, className: cn("flex-shrink-0 pb-6 pt-2", className) },
18
20
  React.createElement("div", { className: "mx-auto w-full max-w-3xl px-4" },
19
21
  children && (React.createElement("div", { className: "flex flex-wrap items-center gap-1.5 pb-3" }, children)),
@@ -57,7 +59,7 @@ export const ChatComposer = React.forwardRef(function ChatComposer({ input, onCh
57
59
  setAttachmentMenuOpen(false);
58
60
  onSelectAttachment();
59
61
  } }, "Select document")))))),
60
- React.createElement(InputBox, { value: isListening ? transcript || input : input, onChange: onChange, onSubmit: () => onSubmit?.(), placeholder: isListening ? "Listening..." : placeholder, disabled: isLoading || isListening, multiline: true, className: cn("min-h-9 min-w-0 flex-1 py-2 text-[15px] leading-normal text-[var(--foreground)] placeholder:text-[var(--input-placeholder)]", theme?.input) }),
62
+ React.createElement(InputBox, { value: isListening ? transcript || input : input, onChange: onChange, onSubmit: () => onSubmit?.(), placeholder: inputPlaceholder, "aria-label": inputLabel, disabled: isLoading || isListening, multiline: true, className: cn("min-h-9 min-w-0 flex-1 py-2 text-[15px] leading-normal text-[var(--foreground)] placeholder:text-[var(--input-placeholder)]", theme?.input) }),
61
63
  React.createElement("div", { className: "flex items-center gap-2" },
62
64
  models && models.length > 0 && onModelChange && (React.createElement(ModelSelector, { models: models, value: model, onChange: onModelChange, disabled: isLoading })),
63
65
  showExport && messages && messages.length > 0 && (React.createElement("button", { type: "button", onClick: () => downloadMarkdown(messages), className: "size-9 flex items-center justify-center rounded-full text-[var(--muted-foreground)] hover:text-[var(--foreground)] hover:bg-[var(--foreground)]/5 transition-colors shrink-0", "aria-label": "Export conversation", title: "Export as Markdown" },
@@ -0,0 +1,3 @@
1
+ import type { ReleaseAssetManifest } from "./manifest-schema.js";
2
+ export declare function buildReleaseAssetModules(manifest?: ReleaseAssetManifest | null): Record<string, string> | undefined;
3
+ //# sourceMappingURL=client-module-map.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client-module-map.d.ts","sourceRoot":"","sources":["../../../src/src/release-assets/client-module-map.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,wBAAgB,wBAAwB,CACtC,QAAQ,CAAC,EAAE,oBAAoB,GAAG,IAAI,GACrC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CASpC"}
@@ -0,0 +1,10 @@
1
+ import { releaseAssetUrl } from "./constants.js";
2
+ export function buildReleaseAssetModules(manifest) {
3
+ if (!manifest)
4
+ return undefined;
5
+ const modules = {};
6
+ for (const [path, entry] of Object.entries(manifest.modules)) {
7
+ modules[path] = releaseAssetUrl(entry.contentHash, "js");
8
+ }
9
+ return Object.keys(modules).length > 0 ? modules : undefined;
10
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"cache-coordinator.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/cache/cache-coordinator.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,KAAK,EAAgB,UAAU,EAAE,MAAM,YAAY,CAAC;AAC3D,OAAO,EAAoB,KAAK,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAQnF,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB,MAAM,CAAC,EAAE,uBAAuB,CAAC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;;;;;OAUG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,iBAAiB,GAAG,KAAK,GAAG,MAAM,GAAG,SAAS,CAA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,CAAC,IAAI,CAAC;IA+B7E,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAIzB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAU5C;;;OAGG;IACG,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAShC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,aAAa;CAkBtB"}
@@ -29,6 +29,7 @@ export class CacheCoordinator {
29
29
  new MemoryCacheStore({
30
30
  maxEntries: options.memory?.maxEntries,
31
31
  ttlMs: options.memory?.ttlMs ?? this.ttlMs,
32
+ enforceStoreTtl: false,
32
33
  });
33
34
  }
34
35
  /**
@@ -10,6 +10,8 @@ interface CacheLike<K, V> {
10
10
  export interface MemoryCacheStoreOptions {
11
11
  maxEntries?: number;
12
12
  ttlMs?: number;
13
+ /** Disable store-level TTL when callers classify payload expiration themselves. */
14
+ enforceStoreTtl?: boolean;
13
15
  /** Optional cache implementation for testing */
14
16
  cache?: CacheLike<string, CachePayload>;
15
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"memory-store.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/cache/stores/memory-store.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAI7E,UAAU,SAAS,CAAC,CAAC,EAAE,CAAC;IACtB,GAAG,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;IAC3B,GAAG,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,IAAI,CAAC;IAC5B,MAAM,CAAC,GAAG,EAAE,CAAC,GAAG,IAAI,CAAC;IACrB,IAAI,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAC5B,KAAK,IAAI,IAAI,CAAC;IACd,OAAO,CAAC,IAAI,IAAI,CAAC;C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AAO,CAAC,IAAI,IAAI,CAAC;CAClB;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,gDAAgD;IAChD,KAAK,CAAC,EAAE,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;CACzC;AAED,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,KAAK,CAAkC;gBAEnC,OAAO,GAAE,uBAA4B;IAcjD,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC;IAInD,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC;IAKpD,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAKlC,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAa/C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAKtB,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxB,IAAI,IAAI,MAAM;IAMd,QAAQ,IAAI,eAAe;CAG5B"}
@@ -18,9 +18,10 @@ export class MemoryCacheStore {
18
18
  return;
19
19
  }
20
20
  const disableIntervals = isLruIntervalDisabled();
21
+ const enforceStoreTtl = options.enforceStoreTtl ?? true;
21
22
  this.cache = new LRUCache({
22
23
  maxEntries: options.maxEntries ?? DEFAULT_MAX_ENTRIES,
23
- ttlMs: disableIntervals ? undefined : options.ttlMs,
24
+ ttlMs: disableIntervals || !enforceStoreTtl ? undefined : options.ttlMs,
24
25
  });
25
26
  }
26
27
  get(key) {
@@ -1 +1 @@
1
- {"version":3,"file":"lifecycle.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/lifecycle.ts"],"names":[],"mappings":"AAE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CAAuB;IAC5C,OAAO,CAAC,IAAI,CAAS;IACrB,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,SAAS,CAAC,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,CAAmB;IACpC,OAAO,CAAC,OAAO,CAAkB;IACjC,OAAO,CAAC,eAAe,CAAC,CAAgD;gBAE5D,OAAO,EAAE,gBAAgB;IAS/B,UAAU,IAAI,OAAO,CAAC,gBAAgB,CAAC;IAsJ7C,gBAAgB,CACd,UAAU,EAAE,CACV,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC,SAAS,CAAC,GACtB,IAAI;IAcP,WAAW,IAAI,gBAAgB;IAazB,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC;IAc3C,cAAc,IAAI,IAAI;IAWtB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;IAS5B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAG/B"}
@@ -82,6 +82,7 @@ export class RendererLifecycle {
82
82
  maxEntries: renderCacheConfig.maxEntries ??
83
83
  (debugMode ? DEBUG_MODE_MAX_ENTRIES : PRODUCTION_MAX_ENTRIES),
84
84
  ttlMs: renderCacheConfig.ttl,
85
+ enforceStoreTtl: false,
85
86
  });
86
87
  break;
87
88
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAuBzE,OAAO,EAAE,cAAc,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,m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E,MAAM,EACd,YAAY,EAAE,cAAc,EAC5B,MAAM,EAAE,kBAAkB,EAC1B,eAAe,UAAQ,GACtB,OAAO,CAAC,MAAM,CAAC,CAsFjB;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,cAAc,CAAC;IACxB,IAAI,EAAE,aAAa,GAAG,YAAY,CAAC;IACnC,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,QAAQ,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAyBD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAI5D;AAED;;;;;;GAMG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CA6DlC"}
@@ -8,23 +8,18 @@
8
8
  */
9
9
  import { rendererLogger } from "../../../utils/index.js";
10
10
  import { getLocalAdapter } from "../../../platform/adapters/registry.js";
11
- import { createFileSystem } from "../../../platform/compat/fs.js";
12
11
  import { getProjectTmpDir } from "../../../modules/react-loader/index.js";
13
12
  import { getHttpBundleCacheDir, getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
14
13
  import { join } from "../../../platform/compat/path/index.js";
15
- import { invalidateMdxEsmModule, lookupMdxEsmCache, } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
14
+ import { invalidateMdxEsmModule } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
16
15
  import { resolveModuleDependencies, rewriteResolvedDependencyImports, } from "./dependency-resolver.js";
17
16
  import { persistTransformedModule } from "./module-persistence.js";
18
- import { transformModuleCodeWithCache, UNRESOLVED_VF_MODULES_RE, } from "./module-transform-cache.js";
17
+ import { transformModuleCodeWithCache } from "./module-transform-cache.js";
18
+ import { getModuleCacheKey, resolveCachedModulePath } from "./module-cache-lookup.js";
19
19
  const logger = rendererLogger.component("module-loader");
20
20
  // Re-export utilities
21
21
  export { createEsmCache, createModuleCache, generateHash } from "./cache.js";
22
22
  export { fetchEsmModule, rewriteEsmPaths } from "./esm-rewriter.js";
23
- function getModuleCacheKey(filePath, projectId, projectDir, contentSourceId) {
24
- const base = projectId ?? projectDir ?? "default";
25
- const source = contentSourceId ?? "default";
26
- return `${base}:${source}:${filePath}`;
27
- }
28
23
  function decodeFileContent(fileContent) {
29
24
  if (typeof fileContent === "string")
30
25
  return fileContent;
@@ -43,48 +38,17 @@ function decodeFileContent(fileContent) {
43
38
  export async function transformModuleWithDeps(filePath, tmpDir, localAdapter, config, useLocalAdapter = false) {
44
39
  const { moduleCache, projectDir, projectId, contentSourceId, adapter, mode } = config;
45
40
  const cacheKey = getModuleCacheKey(filePath, projectId, projectDir, contentSourceId);
46
- const cachedPath = moduleCache.get(cacheKey);
41
+ const cachedPath = await resolveCachedModulePath({
42
+ cacheKey,
43
+ filePath,
44
+ projectDir,
45
+ projectId,
46
+ contentSourceId,
47
+ moduleCache,
48
+ reactVersion: config.reactVersion,
49
+ });
47
50
  if (cachedPath) {
48
- // Validate cached file doesn't contain unresolved /_vf_modules/ imports
49
- // These would fail at runtime and indicate stale cache from before framework import fix
50
- try {
51
- const cachedCode = await createFileSystem().readTextFile(cachedPath);
52
- if (UNRESOLVED_VF_MODULES_RE.test(cachedCode)) {
53
- logger.warn("[ModuleLoader] In-memory cache contains unresolved _vf_modules, invalidating", {
54
- filePath: filePath.slice(-60),
55
- cachedPath: cachedPath.slice(-60),
56
- });
57
- moduleCache.delete(cacheKey);
58
- // Don't return - fall through to re-transform
59
- }
60
- else {
61
- return cachedPath;
62
- }
63
- }
64
- catch (_) {
65
- /* expected: cached file may no longer exist on disk */
66
- moduleCache.delete(cacheKey);
67
- }
68
- }
69
- if (projectId && contentSourceId) {
70
- const baseCacheDir = getMdxEsmCacheDir();
71
- const projectKey = encodeURIComponent(projectId);
72
- const sourceKey = encodeURIComponent(contentSourceId);
73
- const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
74
- const mdxCacheResult = await lookupMdxEsmCache(filePath, mdxCacheDir, projectDir, undefined, {
75
- projectId,
76
- contentSourceId,
77
- }, config.reactVersion);
78
- if (mdxCacheResult.status === "hit") {
79
- moduleCache.set(cacheKey, mdxCacheResult.path);
80
- return mdxCacheResult.path;
81
- }
82
- if (mdxCacheResult.status === "corrupted") {
83
- logger.warn("MDX-ESM cache corrupted, will re-transform", {
84
- filePath,
85
- reason: mdxCacheResult.reason,
86
- });
87
- }
51
+ return cachedPath;
88
52
  }
89
53
  const readAdapter = useLocalAdapter ? localAdapter : adapter;
90
54
  let fileContent = decodeFileContent(await readAdapter.fs.readFile(filePath));
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Cache lookup phase for the SSR module loader.
3
+ *
4
+ * @module rendering/orchestrator/module-loader/module-cache-lookup
5
+ */
6
+ import { createFileSystem } from "../../../platform/compat/fs.js";
7
+ import { lookupMdxEsmCache } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
8
+ export declare function getModuleCacheKey(filePath: string, projectId?: string, projectDir?: string, contentSourceId?: string): string;
9
+ type LookupMdxCache = typeof lookupMdxEsmCache;
10
+ type FileSystemReader = Pick<ReturnType<typeof createFileSystem>, "readTextFile">;
11
+ export interface ResolveCachedModulePathInput {
12
+ cacheKey: string;
13
+ filePath: string;
14
+ projectDir: string;
15
+ projectId?: string;
16
+ contentSourceId?: string;
17
+ reactVersion?: string;
18
+ moduleCache: Map<string, string>;
19
+ readTextFile?: (path: string) => Promise<string>;
20
+ fileSystem?: FileSystemReader;
21
+ lookupMdxCache?: LookupMdxCache;
22
+ }
23
+ export declare function resolveCachedModulePath(input: ResolveCachedModulePathInput): Promise<string | undefined>;
24
+ export {};
25
+ //# sourceMappingURL=module-cache-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-cache-lookup.d.ts","sourceRoot":"","sources":["../../../../../src/src/rendering/orchestrator/module-loader/module-cache-lookup.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAEL,iBAAiB,EAClB,MAAM,0DAA0D,CAAC;AAOlE,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,CAAC,EAAE,MAAM,EAClB,UAAU,CAAC,EAAE,MAAM,EACnB,eAAe,CAAC,EAAE,MAAM,GACvB,MAAM,CAIR;AAED,KAAK,cAAc,GAAG,OAAO,iBAAiB,CAAC;AAC/C,KAAK,gBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,gBAAgB,CAAC,EAAE,cAAc,CAAC,CAAC;AAElF,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,UAAU,CAAC,EAAE,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAuED,wBAAsB,uBAAuB,CAC3C,KAAK,EAAE,4BAA4B,GAClC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAK7B"}
@@ -0,0 +1,69 @@
1
+ /**
2
+ * Cache lookup phase for the SSR module loader.
3
+ *
4
+ * @module rendering/orchestrator/module-loader/module-cache-lookup
5
+ */
6
+ import { join } from "../../../platform/compat/path/index.js";
7
+ import { createFileSystem } from "../../../platform/compat/fs.js";
8
+ import { lookupMdxEsmCache, } from "../../../transforms/mdx/esm-module-loader/cache/index.js";
9
+ import { getMdxEsmCacheDir } from "../../../utils/cache-dir.js";
10
+ import { rendererLogger } from "../../../utils/index.js";
11
+ import { UNRESOLVED_VF_MODULES_RE } from "./module-transform-cache.js";
12
+ const logger = rendererLogger.component("module-loader");
13
+ export function getModuleCacheKey(filePath, projectId, projectDir, contentSourceId) {
14
+ const base = projectId ?? projectDir ?? "default";
15
+ const source = contentSourceId ?? "default";
16
+ return `${base}:${source}:${filePath}`;
17
+ }
18
+ async function resolveInMemoryCachedPath(input) {
19
+ const cachedPath = input.moduleCache.get(input.cacheKey);
20
+ if (!cachedPath)
21
+ return undefined;
22
+ try {
23
+ const fileSystem = input.fileSystem ?? createFileSystem();
24
+ const readTextFile = input.readTextFile ??
25
+ ((path) => fileSystem.readTextFile(path));
26
+ const cachedCode = await readTextFile(cachedPath);
27
+ if (!UNRESOLVED_VF_MODULES_RE.test(cachedCode))
28
+ return cachedPath;
29
+ logger.warn("[ModuleLoader] In-memory cache contains unresolved _vf_modules, invalidating", {
30
+ filePath: input.filePath.slice(-60),
31
+ cachedPath: cachedPath.slice(-60),
32
+ });
33
+ }
34
+ catch (_) {
35
+ /* expected: cached file may no longer exist on disk */
36
+ }
37
+ input.moduleCache.delete(input.cacheKey);
38
+ return undefined;
39
+ }
40
+ async function resolveMdxEsmCachedPath(input) {
41
+ if (!input.projectId || !input.contentSourceId)
42
+ return undefined;
43
+ const baseCacheDir = getMdxEsmCacheDir();
44
+ const projectKey = encodeURIComponent(input.projectId);
45
+ const sourceKey = encodeURIComponent(input.contentSourceId);
46
+ const mdxCacheDir = join(baseCacheDir, projectKey, sourceKey);
47
+ const lookup = input.lookupMdxCache ?? lookupMdxEsmCache;
48
+ const mdxCacheResult = await lookup(input.filePath, mdxCacheDir, input.projectDir, undefined, {
49
+ projectId: input.projectId,
50
+ contentSourceId: input.contentSourceId,
51
+ }, input.reactVersion);
52
+ if (mdxCacheResult.status === "hit") {
53
+ input.moduleCache.set(input.cacheKey, mdxCacheResult.path);
54
+ return mdxCacheResult.path;
55
+ }
56
+ if (mdxCacheResult.status === "corrupted") {
57
+ logger.warn("MDX-ESM cache corrupted, will re-transform", {
58
+ filePath: input.filePath,
59
+ reason: mdxCacheResult.reason,
60
+ });
61
+ }
62
+ return undefined;
63
+ }
64
+ export async function resolveCachedModulePath(input) {
65
+ const inMemoryPath = await resolveInMemoryCachedPath(input);
66
+ if (inMemoryPath)
67
+ return inMemoryPath;
68
+ return await resolveMdxEsmCachedPath(input);
69
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"pipeline.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/pipeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAsBH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA4ChF,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACxE,aA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0BD,qBAAa,cAAc;IACzB,OAAO,CAAC,MAAM,CAAuB;IACrC,OAAO,CAAC,WAAW,CAAc;IACjC,OAAO,CAAC,kBAAkB,CAAqB;gBAEnC,MAAM,EAAE,oBAAoB;IAaxC;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IAKxB,OAAO,CAAC,UAAU;YAIJ,0BAA0B;IAaxC;;;;;;;;;OASG;YACW,qBAAqB;IAyDnC;;;OAGG;YACW,mBAAmB;IAiGjC,OAAO,CAAC,uBAAuB;IAkCzB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC;IA8O9E,+EAA+E;IACzE,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAsFzE,kBAAkB;YA2ClB,cAAc;IAW5B,OAAO,CAAC,uBAAuB;YAYjB,kBAAkB;IA8EhC,OAAO,CAAC,kBAAkB;YAQZ,uBAAuB;IAmBrC;;;;;;OAMG;IACH,OAAO,CAAC,aAAa;CAStB"}
@@ -21,6 +21,7 @@ import { SpanNames } from "../../observability/tracing/span-names.js";
21
21
  import { VeryfrontError } from "../../errors/index.js";
22
22
  import { FILE_NOT_FOUND, RENDER_ERROR } from "../../errors/error-registry.js";
23
23
  import { buildQueryAwareCacheKey } from "../../cache/keys.js";
24
+ import { requestHasCacheSensitiveState } from "../../cache/request-cacheability.js";
24
25
  import { extractRelativePath as extractRelativePathShared, extractRouteParams as extractRouteParamsShared, } from "../../utils/route-path-utils.js";
25
26
  import { extractRenderedCssHash, hasRenderedReleaseAssetCss, serializeLayoutProps, serializeLayouts, } from "./pipeline-helpers.js";
26
27
  import { join } from "../../platform/compat/path/index.js";
@@ -31,10 +32,12 @@ import { setupSSRGlobals } from "../ssr-globals.js";
31
32
  import { LAYOUT_EXTENSIONS } from "../layouts/types.js";
32
33
  import { withTimeout, withTimeoutThrow } from "../utils/stream-utils.js";
33
34
  import { extractCandidates, generateTailwindCSS } from "../../html/styles-builder/index.js";
35
+ import { buildReleaseAssetModules } from "../../release-assets/client-module-map.js";
34
36
  import { getCSSByHashAsync, regenerateCSSByHash, } from "../../html/styles-builder/tailwind-compiler.js";
35
37
  import { getReadyManifestForRender } from "../../release-assets/manifest-cache.js";
36
38
  import { createEsmCache, createModuleCache, loadModule } from "./module-loader/index.js";
37
39
  import { getCSSImports, runWithCSSCollector, } from "../../modules/react-loader/css-import-collector.js";
40
+ import { assembleRenderResult } from "./render-result-assembly.js";
38
41
  // Extracted modules
39
42
  import { EMPTY_LAYOUT_RESULT, isDotPath } from "./path-helpers.js";
40
43
  import { cachePageCss, CSS_SSR_TIMEOUT_MS, getCachedPageCss, getPageCssCacheKey, } from "./css-cache.js";
@@ -232,7 +235,7 @@ export class RenderPipeline {
232
235
  const projectId = options?.projectId ?? this.config.projectDir;
233
236
  const cacheKey = this.buildCacheKey(slug, options);
234
237
  let cacheResult = null;
235
- const shouldCache = !!cacheKey && options?.delivery !== "stream";
238
+ const shouldCache = cacheKey !== null && options?.delivery !== "stream";
236
239
  if (shouldCache && !options?.skipCacheCheck) {
237
240
  const cacheCheckStart = performance.now();
238
241
  cacheResult = await this.config.cacheCoordinator.checkCache(slug, cacheKey);
@@ -342,31 +345,18 @@ export class RenderPipeline {
342
345
  paths: collectedCSSImports.map((p) => p.split("/").pop()),
343
346
  });
344
347
  }
345
- const pageModule = pageBundleResult.clientModuleCode && pageBundleResult.pageModuleType
346
- ? {
347
- slug,
348
- code: pageBundleResult.clientModuleCode,
349
- type: pageBundleResult.pageModuleType,
350
- }
351
- : undefined;
352
- const result = {
353
- html: ssrResult.fullHtml,
354
- frontmatter: pageBundleResult.pageBundle.frontmatter || {},
355
- headings: pageBundleResult.pageBundle.headings || [],
356
- nodeMap: pageBundleResult.pageBundle.nodeMap,
357
- stream: ssrResult.finalStream,
358
- ssrHash: ssrResult.ssrHash,
359
- ...(pageModule ? { pageModule } : {}),
360
- };
361
- if (shouldCache && !options?.skipCachePersist) {
362
- void this.config.cacheCoordinator.persistResult(result, slug, cacheKey).catch((error) => {
363
- renderPipelineLog.error("Cache persist failed", {
364
- slug,
365
- error: error instanceof Error ? error.message : String(error),
366
- stack: error instanceof Error ? error.stack : undefined,
367
- });
368
- });
369
- }
348
+ const result = assembleRenderResult({
349
+ slug,
350
+ cacheKey,
351
+ ssrResult,
352
+ pageBundle: pageBundleResult.pageBundle,
353
+ clientModuleCode: pageBundleResult.clientModuleCode,
354
+ pageModuleType: pageBundleResult.pageModuleType,
355
+ shouldCache,
356
+ skipCachePersist: options?.skipCachePersist,
357
+ cacheCoordinator: this.config.cacheCoordinator,
358
+ logger: renderPipelineLog,
359
+ });
370
360
  timing.total = Math.round(performance.now() - pipelineStartTime);
371
361
  renderPipelineLog.debug("Complete", { slug, timing });
372
362
  return result;
@@ -435,6 +425,7 @@ export class RenderPipeline {
435
425
  layoutProps,
436
426
  buildVersion: createBuildVersion(projectUpdatedAt),
437
427
  appPath,
428
+ releaseAssetModules: buildReleaseAssetModules(options?.releaseAssetManifest),
438
429
  headings,
439
430
  css,
440
431
  cssAction,
@@ -547,7 +538,9 @@ export class RenderPipeline {
547
538
  hasReadyReleaseCss(options) {
548
539
  if (options?.environment !== "production")
549
540
  return false;
550
- const releaseManifest = getReadyManifestForRender(options?.releaseId);
541
+ const releaseManifest = options.releaseAssetManifest !== undefined
542
+ ? options.releaseAssetManifest
543
+ : getReadyManifestForRender(options?.releaseId);
551
544
  return (releaseManifest?.css?.length ?? 0) > 0;
552
545
  }
553
546
  async generatePageCssFromHtml(slug, html, options) {
@@ -574,15 +567,9 @@ export class RenderPipeline {
574
567
  return options.cacheKey;
575
568
  const req = options?.request;
576
569
  if (req) {
577
- const hasAuth = req.headers.has("authorization") ||
578
- req.headers.has("cookie") ||
579
- req.headers.has("x-api-key");
580
- if (hasAuth)
570
+ if (requestHasCacheSensitiveState(req))
581
571
  return null;
582
572
  }
583
- const url = options?.url;
584
- if (!url)
585
- return slug;
586
- return buildQueryAwareCacheKey(slug, url, this.config.queryParamOptions);
573
+ return buildQueryAwareCacheKey(slug, options?.url, this.config.queryParamOptions);
587
574
  }
588
575
  }
@@ -0,0 +1,27 @@
1
+ import type { PageBundle, RenderResult } from "../../types/index.js";
2
+ interface RenderResultAssemblyCache {
3
+ persistResult(result: RenderResult, slug: string, cacheKey?: string): Promise<void>;
4
+ }
5
+ interface RenderResultAssemblyLogger {
6
+ error(message: string, metadata?: Record<string, unknown>): void;
7
+ }
8
+ interface SSRResult {
9
+ fullHtml: string;
10
+ finalStream?: ReadableStream | null;
11
+ ssrHash?: string;
12
+ }
13
+ export interface AssembleRenderResultOptions {
14
+ slug: string;
15
+ cacheKey?: string | null;
16
+ ssrResult: SSRResult;
17
+ pageBundle: PageBundle;
18
+ clientModuleCode?: string;
19
+ pageModuleType?: "mdx" | "component";
20
+ shouldCache: boolean;
21
+ skipCachePersist?: boolean;
22
+ cacheCoordinator?: RenderResultAssemblyCache;
23
+ logger?: RenderResultAssemblyLogger;
24
+ }
25
+ export declare function assembleRenderResult(options: AssembleRenderResultOptions): RenderResult;
26
+ export {};
27
+ //# sourceMappingURL=render-result-assembly.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"render-result-assembly.d.ts","sourceRoot":"","sources":["../../../../src/src/rendering/orchestrator/render-result-assembly.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAErE,UAAU,yBAAyB;IACjC,aAAa,CAAC,MAAM,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACrF;AAED,UAAU,0BAA0B;IAClC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAClE;AAED,UAAU,SAAS;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,SAAS,EAAE,SAAS,CAAC;IACrB,UAAU,EAAE,UAAU,CAAC;IACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,cAAc,CAAC,EAAE,KAAK,GAAG,WAAW,CAAC;IACrC,WAAW,EAAE,OAAO,CAAC;IACrB,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;IAC7C,MAAM,CAAC,EAAE,0BAA0B,CAAC;CACrC;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,2BAA2B,GAAG,YAAY,CAoCvF"}
@@ -0,0 +1,28 @@
1
+ export function assembleRenderResult(options) {
2
+ const pageModule = options.clientModuleCode && options.pageModuleType
3
+ ? {
4
+ slug: options.slug,
5
+ code: options.clientModuleCode,
6
+ type: options.pageModuleType,
7
+ }
8
+ : undefined;
9
+ const result = {
10
+ html: options.ssrResult.fullHtml,
11
+ frontmatter: options.pageBundle.frontmatter || {},
12
+ headings: options.pageBundle.headings || [],
13
+ nodeMap: options.pageBundle.nodeMap,
14
+ stream: options.ssrResult.finalStream,
15
+ ssrHash: options.ssrResult.ssrHash,
16
+ ...(pageModule ? { pageModule } : {}),
17
+ };
18
+ if (options.shouldCache && !options.skipCachePersist) {
19
+ void options.cacheCoordinator?.persistResult(result, options.slug, options.cacheKey ?? undefined).catch((error) => {
20
+ options.logger?.error("Cache persist failed", {
21
+ slug: options.slug,
22
+ error: error instanceof Error ? error.message : String(error),
23
+ stack: error instanceof Error ? error.stack : undefined,
24
+ });
25
+ });
26
+ }
27
+ return result;
28
+ }