veryfront 0.1.754 → 0.1.756

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 (108) hide show
  1. package/esm/cli/auth/callback-server.d.ts +4 -1
  2. package/esm/cli/auth/callback-server.d.ts.map +1 -1
  3. package/esm/cli/auth/callback-server.js +52 -13
  4. package/esm/cli/auth/index.d.ts +1 -1
  5. package/esm/cli/auth/index.d.ts.map +1 -1
  6. package/esm/cli/auth/index.js +1 -1
  7. package/esm/cli/auth/login.d.ts +2 -0
  8. package/esm/cli/auth/login.d.ts.map +1 -1
  9. package/esm/cli/auth/login.js +18 -6
  10. package/esm/cli/commands/demo/demo.d.ts.map +1 -1
  11. package/esm/cli/commands/demo/demo.js +6 -7
  12. package/esm/deno.js +1 -1
  13. package/esm/src/agent/runtime/index.d.ts +3 -96
  14. package/esm/src/agent/runtime/index.d.ts.map +1 -1
  15. package/esm/src/agent/runtime/index.js +21 -341
  16. package/esm/src/agent/runtime/model-capabilities.d.ts +3 -0
  17. package/esm/src/agent/runtime/model-capabilities.d.ts.map +1 -0
  18. package/esm/src/agent/runtime/model-capabilities.js +18 -0
  19. package/esm/src/agent/runtime/runtime-tool-config.d.ts +14 -0
  20. package/esm/src/agent/runtime/runtime-tool-config.d.ts.map +1 -0
  21. package/esm/src/agent/runtime/runtime-tool-config.js +37 -0
  22. package/esm/src/agent/runtime/skill-policy-enforcement.d.ts +16 -0
  23. package/esm/src/agent/runtime/skill-policy-enforcement.d.ts.map +1 -0
  24. package/esm/src/agent/runtime/skill-policy-enforcement.js +55 -0
  25. package/esm/src/agent/runtime/tool-result-continuation.d.ts +34 -0
  26. package/esm/src/agent/runtime/tool-result-continuation.d.ts.map +1 -0
  27. package/esm/src/agent/runtime/tool-result-continuation.js +194 -0
  28. package/esm/src/agent/schemas/agent.schema.d.ts +7 -0
  29. package/esm/src/agent/schemas/agent.schema.d.ts.map +1 -1
  30. package/esm/src/agent/schemas/agent.schema.js +9 -3
  31. package/esm/src/agent/schemas/index.d.ts +1 -1
  32. package/esm/src/agent/schemas/index.d.ts.map +1 -1
  33. package/esm/src/agent/schemas/index.js +1 -1
  34. package/esm/src/cache/dependency-graph.d.ts +1 -0
  35. package/esm/src/cache/dependency-graph.d.ts.map +1 -1
  36. package/esm/src/cache/dependency-graph.js +7 -1
  37. package/esm/src/modules/server/module-batch-handler.d.ts.map +1 -1
  38. package/esm/src/modules/server/module-batch-handler.js +47 -35
  39. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  40. package/esm/src/modules/server/module-server.js +31 -9
  41. package/esm/src/modules/server/rate-limiter.d.ts +3 -2
  42. package/esm/src/modules/server/rate-limiter.d.ts.map +1 -1
  43. package/esm/src/platform/adapters/base.d.ts +24 -3
  44. package/esm/src/platform/adapters/base.d.ts.map +1 -1
  45. package/esm/src/platform/adapters/base.js +15 -1
  46. package/esm/src/platform/adapters/runtime/bun/websocket-adapter.d.ts +2 -0
  47. package/esm/src/platform/adapters/runtime/bun/websocket-adapter.d.ts.map +1 -1
  48. package/esm/src/platform/adapters/runtime/bun/websocket-adapter.js +33 -1
  49. package/esm/src/platform/adapters/runtime/node/websocket-adapter.d.ts +1 -1
  50. package/esm/src/platform/adapters/runtime/node/websocket-adapter.d.ts.map +1 -1
  51. package/esm/src/platform/adapters/runtime/node/websocket-adapter.js +3 -10
  52. package/esm/src/proxy/handler.d.ts.map +1 -1
  53. package/esm/src/proxy/handler.js +25 -116
  54. package/esm/src/proxy/local-project-resolver.d.ts +18 -0
  55. package/esm/src/proxy/local-project-resolver.d.ts.map +1 -0
  56. package/esm/src/proxy/local-project-resolver.js +63 -0
  57. package/esm/src/proxy/proxy-token-resolution.d.ts +37 -0
  58. package/esm/src/proxy/proxy-token-resolution.d.ts.map +1 -0
  59. package/esm/src/proxy/proxy-token-resolution.js +51 -0
  60. package/esm/src/rendering/orchestrator/module-loader/index.d.ts +10 -0
  61. package/esm/src/rendering/orchestrator/module-loader/index.d.ts.map +1 -1
  62. package/esm/src/rendering/orchestrator/module-loader/index.js +23 -158
  63. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts +20 -0
  64. package/esm/src/rendering/orchestrator/module-loader/module-persistence.d.ts.map +1 -0
  65. package/esm/src/rendering/orchestrator/module-loader/module-persistence.js +80 -0
  66. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts +59 -0
  67. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.d.ts.map +1 -0
  68. package/esm/src/rendering/orchestrator/module-loader/module-transform-cache.js +97 -0
  69. package/esm/src/routing/api/handler.d.ts +2 -1
  70. package/esm/src/routing/api/handler.d.ts.map +1 -1
  71. package/esm/src/routing/api/handler.js +2 -1
  72. package/esm/src/routing/api/route-executor.d.ts +3 -0
  73. package/esm/src/routing/api/route-executor.d.ts.map +1 -1
  74. package/esm/src/routing/api/route-executor.js +28 -0
  75. package/esm/src/runtime/runtime-bridge.js +2 -2
  76. package/esm/src/security/http/base-handler.d.ts +3 -2
  77. package/esm/src/security/http/base-handler.d.ts.map +1 -1
  78. package/esm/src/security/http/base-handler.js +1 -1
  79. package/esm/src/security/sandbox/project-worker.d.ts +1 -0
  80. package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
  81. package/esm/src/security/sandbox/project-worker.js +17 -1
  82. package/esm/src/security/sandbox/worker-egress-guard.d.ts +15 -0
  83. package/esm/src/security/sandbox/worker-egress-guard.d.ts.map +1 -0
  84. package/esm/src/security/sandbox/worker-egress-guard.js +201 -0
  85. package/esm/src/security/sandbox/worker-permissions.d.ts +6 -2
  86. package/esm/src/security/sandbox/worker-permissions.d.ts.map +1 -1
  87. package/esm/src/security/sandbox/worker-permissions.js +34 -3
  88. package/esm/src/security/sandbox/worker-pool.d.ts +1 -1
  89. package/esm/src/security/sandbox/worker-pool.d.ts.map +1 -1
  90. package/esm/src/security/sandbox/worker-pool.js +35 -9
  91. package/esm/src/server/handlers/preview/hmr-client-manager.d.ts +3 -2
  92. package/esm/src/server/handlers/preview/hmr-client-manager.d.ts.map +1 -1
  93. package/esm/src/server/handlers/preview/hmr.handler.d.ts.map +1 -1
  94. package/esm/src/server/handlers/preview/hmr.handler.js +4 -1
  95. package/esm/src/server/handlers/request/api/api-handler-wrapper.js +1 -1
  96. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts +32 -0
  97. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.d.ts.map +1 -0
  98. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/http-fallback.js +27 -0
  99. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/import-rewriter.d.ts.map +1 -1
  100. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/import-rewriter.js +23 -3
  101. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.d.ts.map +1 -1
  102. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/index.js +32 -30
  103. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts +34 -0
  104. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.d.ts.map +1 -0
  105. package/esm/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.js +30 -0
  106. package/esm/src/utils/version-constant.d.ts +1 -1
  107. package/esm/src/utils/version-constant.js +1 -1
  108. package/package.json +1 -1
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Unresolved module HTTP fallback phase for the MDX ESM module fetcher.
3
+ *
4
+ * @module transforms/mdx/esm-module-loader/module-fetcher/http-fallback
5
+ */
6
+ import { buildMissingModuleError } from "../missing-module.js";
7
+ import { fetchModuleViaHTTP } from "./http-fetcher.js";
8
+ import { cacheModule } from "./module-cache.js";
9
+ /**
10
+ * Resolve an unresolved filesystem module through the local HTTP fallback.
11
+ */
12
+ export async function resolveUnresolvedModuleViaHttpFallback(input) {
13
+ const fetchViaHttp = input.fetchViaHttp ?? fetchModuleViaHTTP;
14
+ const cacheLocalModule = input.cacheLocalModule ?? cacheModule;
15
+ const moduleCode = await fetchViaHttp(input.normalizedPath, input.adapter, input.fetchAndCacheModule, input.log, input.projectSlug, input.isLocalProject);
16
+ if (moduleCode) {
17
+ return await cacheLocalModule(input.normalizedPath, moduleCode, input.esmCacheDir, input.pathCache, input.log, input.reactVersion);
18
+ }
19
+ if (input.strictMissingModules ?? true) {
20
+ throw buildMissingModuleError({
21
+ modulePath: input.normalizedPath,
22
+ importer: input.parentModulePath,
23
+ projectSlug: input.projectSlug,
24
+ });
25
+ }
26
+ return null;
27
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/import-rewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAaH;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgB5D;AAwCD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0D7F"}
1
+ {"version":3,"file":"import-rewriter.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/import-rewriter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA2CH;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAgB5D;AAwCD,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA0D7F"}
@@ -5,23 +5,43 @@
5
5
  */
6
6
  import { dirname, join, resolve } from "../../../../platform/compat/path/index.js";
7
7
  import { FRAMEWORK_ROOT } from "../constants.js";
8
- import { resolveVeryfrontModuleUrl } from "../../../veryfront-module-urls.js";
8
+ import { DEFAULT_REACT_VERSION, veryfrontStrategy, } from "../../../import-rewriter/index.js";
9
9
  import { getLocalFs } from "../cache/index.js";
10
10
  import { findStaticImportFromSpans, findStaticSideEffectImportSpans, replaceSourceSpans, } from "../utils/source-spans.js";
11
+ const MODULE_FETCHER_VERYFRONT_CONTEXT = {
12
+ filePath: "",
13
+ projectDir: "",
14
+ projectId: "",
15
+ target: "ssr",
16
+ dev: false,
17
+ reactVersion: DEFAULT_REACT_VERSION,
18
+ };
19
+ function rewriteVeryfrontModuleSpecifier(specifier) {
20
+ const result = veryfrontStrategy.rewrite({
21
+ specifier,
22
+ isDynamic: false,
23
+ start: 0,
24
+ end: specifier.length,
25
+ statementStart: 0,
26
+ statementEnd: 0,
27
+ raw: {},
28
+ }, MODULE_FETCHER_VERYFRONT_CONTEXT);
29
+ return result.specifier;
30
+ }
11
31
  /**
12
32
  * Rewrite veryfront/* imports to /_vf_modules/_veryfront/ paths for MDX module loading.
13
33
  * Uses deno.json exports/imports as the source of truth and appends ?ssr=true.
14
34
  */
15
35
  export function rewriteVeryfrontImports(code) {
16
36
  const replacements = findStaticImportFromSpans(code, (specifier) => specifier.startsWith("veryfront/") ? specifier : null).flatMap(({ original, path, start, end }) => {
17
- const mapped = resolveVeryfrontModuleUrl(path);
37
+ const mapped = rewriteVeryfrontModuleSpecifier(path);
18
38
  if (!mapped)
19
39
  return [];
20
40
  return [{
21
41
  start,
22
42
  end,
23
43
  expected: original,
24
- replacement: `from "${mapped}?ssr=true"`,
44
+ replacement: `from "${mapped}"`,
25
45
  }];
26
46
  });
27
47
  return replaceSourceSpans(code, replacements);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAcxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAS9B;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAOtD;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,SAAS,EAAE,MAAM;CAI9B;AAcD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,EAC7B,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwFxB;AA6KD;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IACR,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,GACA,oBAAoB,CAUtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AACjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAG5E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAcxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACnB,MAAM,sBAAsB,CAAC;AAS9B;;GAEG;AACH,qBAAa,yBAA0B,SAAQ,KAAK;gBACtC,cAAc,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM;CAOtD;AAED;;GAEG;AACH,qBAAa,6BAA8B,SAAQ,KAAK;gBAC1C,SAAS,EAAE,MAAM;CAI9B;AAcD;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,oBAAoB,EAC7B,gBAAgB,CAAC,EAAE,MAAM,EACzB,OAAO,GAAE,GAAG,CAAC,MAAM,CAAa,GAC/B,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAwFxB;AA8ID;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,cAAc,EACvB,UAAU,EAAE,MAAM,EAClB,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE;IACR,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC,GACA,oBAAoB,CAUtB"}
@@ -17,13 +17,13 @@ import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
17
17
  import { getModulePathCache } from "../cache/index.js";
18
18
  import { hashString } from "../utils/hash.js";
19
19
  import { resolveModuleFile } from "../resolution/file-finder.js";
20
- import { buildMissingModuleError } from "../missing-module.js";
21
20
  import { getTransformCacheKey, getVersionedPathCacheKey } from "./cache-keys.js";
22
21
  import { resolveNestedModuleImports } from "./nested-imports.js";
23
- import { readDistributedCache, writeDistributedCache } from "./distributed-cache.js";
24
- import { fetchModuleViaHTTP } from "./http-fetcher.js";
25
- import { cacheModule, normalizePath } from "./module-cache.js";
22
+ import { readDistributedCache } from "./distributed-cache.js";
23
+ import { resolveUnresolvedModuleViaHttpFallback } from "./http-fallback.js";
24
+ import { normalizePath } from "./module-cache.js";
26
25
  import { readValidCachedModulePath } from "./path-cache-lookup.js";
26
+ import { persistResolvedModule } from "./persistence.js";
27
27
  import { transformResolvedModuleSource } from "./source-transform.js";
28
28
  // Re-export extracted modules for backward compatibility
29
29
  export { rewriteDntImports } from "./import-rewriter.js";
@@ -165,18 +165,19 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
165
165
  try {
166
166
  const resolved = await resolveModuleFile(normalizedPath, adapter, projectDir);
167
167
  if (!resolved) {
168
- const moduleCode = await fetchModuleViaHTTP(normalizedPath, adapter, fetchAndCacheModuleFn, log, projectSlug, context.isLocalProject);
169
- if (moduleCode) {
170
- return await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log, effectiveReactVersion);
171
- }
172
- if (context.strictMissingModules ?? true) {
173
- throw buildMissingModuleError({
174
- modulePath: normalizedPath,
175
- importer: parentModulePath,
176
- projectSlug,
177
- });
178
- }
179
- return null;
168
+ return await resolveUnresolvedModuleViaHttpFallback({
169
+ normalizedPath,
170
+ adapter,
171
+ fetchAndCacheModule: fetchAndCacheModuleFn,
172
+ log,
173
+ projectSlug,
174
+ isLocalProject: context.isLocalProject,
175
+ strictMissingModules: context.strictMissingModules ?? true,
176
+ esmCacheDir,
177
+ pathCache,
178
+ reactVersion: effectiveReactVersion,
179
+ parentModulePath,
180
+ });
180
181
  }
181
182
  const { sourceCode, actualFilePath } = resolved;
182
183
  const contentHash = hashString(sourceCode);
@@ -219,23 +220,24 @@ async function doFetchAndCacheModule(normalizedPath, context, fetchAndCacheModul
219
220
  fetchAndCacheModule: fetchAndCacheModuleFn,
220
221
  log,
221
222
  });
222
- // Write to distributed cache AFTER nested imports are resolved.
223
- // This ensures other pods get fully-resolved code without /_vf_modules/ paths.
224
- if (needsDistributedCacheWrite && distResult?.distributedCache && transformCacheKey) {
225
- writeDistributedCache(distResult.distributedCache, transformCacheKey, projectId, contentSourceId, moduleCode, normalizedPath, log);
226
- }
227
- log.debug(`${LOG_PREFIX_MDX_LOADER} [fetchAndCacheModule] cacheModule START`, {
228
- projectSlug,
223
+ return await persistResolvedModule({
229
224
  normalizedPath,
230
- });
231
- const cacheStart = performance.now();
232
- const finalCachedPath = await cacheModule(normalizedPath, moduleCode, esmCacheDir, pathCache, log, effectiveReactVersion);
233
- log.debug(`${LOG_PREFIX_MDX_LOADER} [fetchAndCacheModule] cacheModule DONE`, {
225
+ moduleCode,
226
+ esmCacheDir,
227
+ pathCache,
228
+ log,
234
229
  projectSlug,
235
- normalizedPath,
236
- cacheMs: (performance.now() - cacheStart).toFixed(1),
230
+ reactVersion: effectiveReactVersion,
231
+ distributedCacheWrite: needsDistributedCacheWrite && distResult?.distributedCache && transformCacheKey &&
232
+ contentSourceId
233
+ ? {
234
+ distributedCache: distResult.distributedCache,
235
+ transformCacheKey,
236
+ projectId,
237
+ contentSourceId,
238
+ }
239
+ : undefined,
237
240
  });
238
- return finalCachedPath;
239
241
  }
240
242
  catch (error) {
241
243
  log.warn(`${LOG_PREFIX_MDX_LOADER} Failed to process ${normalizedPath}`, error);
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Final persistence phase for the MDX ESM module fetcher.
3
+ *
4
+ * @module transforms/mdx/esm-module-loader/module-fetcher/persistence
5
+ */
6
+ import type { Logger } from "../../../../utils/logger/logger.js";
7
+ import { cacheModule } from "./module-cache.js";
8
+ import { writeDistributedCache } from "./distributed-cache.js";
9
+ type CacheLocalModuleFn = typeof cacheModule;
10
+ type WriteDistributedCacheFn = typeof writeDistributedCache;
11
+ type DistributedCache = Parameters<WriteDistributedCacheFn>[0];
12
+ export interface PersistResolvedModuleInput {
13
+ normalizedPath: string;
14
+ moduleCode: string;
15
+ esmCacheDir: string;
16
+ pathCache: Map<string, string>;
17
+ log: Logger;
18
+ projectSlug: string;
19
+ reactVersion?: string;
20
+ distributedCacheWrite?: {
21
+ distributedCache: DistributedCache;
22
+ transformCacheKey: string;
23
+ projectId: string;
24
+ contentSourceId: string;
25
+ };
26
+ cacheLocalModule?: CacheLocalModuleFn;
27
+ writeToDistributedCache?: WriteDistributedCacheFn;
28
+ }
29
+ /**
30
+ * Persist fully resolved module code to distributed and local caches.
31
+ */
32
+ export declare function persistResolvedModule(input: PersistResolvedModuleInput): Promise<string | null>;
33
+ export {};
34
+ //# sourceMappingURL=persistence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"persistence.d.ts","sourceRoot":"","sources":["../../../../../../src/src/transforms/mdx/esm-module-loader/module-fetcher/persistence.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oCAAoC,CAAC;AAEjE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,KAAK,kBAAkB,GAAG,OAAO,WAAW,CAAC;AAC7C,KAAK,uBAAuB,GAAG,OAAO,qBAAqB,CAAC;AAC5D,KAAK,gBAAgB,GAAG,UAAU,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;AAE/D,MAAM,WAAW,0BAA0B;IACzC,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,qBAAqB,CAAC,EAAE;QACtB,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,SAAS,EAAE,MAAM,CAAC;QAClB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;IACF,gBAAgB,CAAC,EAAE,kBAAkB,CAAC;IACtC,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CACnD;AAED;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,KAAK,EAAE,0BAA0B,GAChC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoCxB"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Final persistence phase for the MDX ESM module fetcher.
3
+ *
4
+ * @module transforms/mdx/esm-module-loader/module-fetcher/persistence
5
+ */
6
+ import { LOG_PREFIX_MDX_LOADER } from "../constants.js";
7
+ import { cacheModule } from "./module-cache.js";
8
+ import { writeDistributedCache } from "./distributed-cache.js";
9
+ /**
10
+ * Persist fully resolved module code to distributed and local caches.
11
+ */
12
+ export async function persistResolvedModule(input) {
13
+ const writeToDistributedCache = input.writeToDistributedCache ?? writeDistributedCache;
14
+ const cacheLocalModule = input.cacheLocalModule ?? cacheModule;
15
+ if (input.distributedCacheWrite) {
16
+ writeToDistributedCache(input.distributedCacheWrite.distributedCache, input.distributedCacheWrite.transformCacheKey, input.distributedCacheWrite.projectId, input.distributedCacheWrite.contentSourceId, input.moduleCode, input.normalizedPath, input.log);
17
+ }
18
+ input.log.debug(`${LOG_PREFIX_MDX_LOADER} [fetchAndCacheModule] cacheModule START`, {
19
+ projectSlug: input.projectSlug,
20
+ normalizedPath: input.normalizedPath,
21
+ });
22
+ const cacheStart = performance.now();
23
+ const finalCachedPath = await cacheLocalModule(input.normalizedPath, input.moduleCode, input.esmCacheDir, input.pathCache, input.log, input.reactVersion);
24
+ input.log.debug(`${LOG_PREFIX_MDX_LOADER} [fetchAndCacheModule] cacheModule DONE`, {
25
+ projectSlug: input.projectSlug,
26
+ normalizedPath: input.normalizedPath,
27
+ cacheMs: (performance.now() - cacheStart).toFixed(1),
28
+ });
29
+ return finalCachedPath;
30
+ }
@@ -1,3 +1,3 @@
1
1
  /** Shared version value. */
2
- export declare const VERSION = "0.1.754";
2
+ export declare const VERSION = "0.1.756";
3
3
  //# sourceMappingURL=version-constant.d.ts.map
@@ -1,4 +1,4 @@
1
1
  // Keep in sync with deno.json version.
2
2
  // scripts/release.ts updates this constant during releases.
3
3
  /** Shared version value. */
4
- export const VERSION = "0.1.754";
4
+ export const VERSION = "0.1.756";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.754",
3
+ "version": "0.1.756",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",