veryfront 0.1.46 → 0.1.47

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 (51) hide show
  1. package/esm/deno.d.ts +0 -2
  2. package/esm/deno.js +3 -5
  3. package/esm/src/modules/server/module-server.d.ts.map +1 -1
  4. package/esm/src/modules/server/module-server.js +4 -1
  5. package/esm/src/platform/compat/dynamic-import.d.ts +11 -0
  6. package/esm/src/platform/compat/dynamic-import.d.ts.map +1 -0
  7. package/esm/src/platform/compat/dynamic-import.js +11 -0
  8. package/esm/src/platform/compat/opaque-deps.d.ts +21 -0
  9. package/esm/src/platform/compat/opaque-deps.d.ts.map +1 -0
  10. package/esm/src/platform/compat/opaque-deps.js +29 -0
  11. package/esm/src/platform/compat/process.d.ts.map +1 -1
  12. package/esm/src/platform/compat/process.js +1 -3
  13. package/esm/src/provider/local/local-engine.d.ts.map +1 -1
  14. package/esm/src/provider/local/local-engine.js +2 -1
  15. package/esm/src/rendering/component-handling.d.ts.map +1 -1
  16. package/esm/src/rendering/component-handling.js +4 -1
  17. package/esm/src/rendering/page-rendering.d.ts.map +1 -1
  18. package/esm/src/rendering/page-rendering.js +2 -2
  19. package/esm/src/transforms/md/compiler/md-compiler.d.ts +1 -1
  20. package/esm/src/transforms/md/compiler/md-compiler.d.ts.map +1 -1
  21. package/esm/src/transforms/md/compiler/md-compiler.js +10 -5
  22. package/esm/src/transforms/mdx/compiler/index.d.ts +1 -1
  23. package/esm/src/transforms/mdx/compiler/index.d.ts.map +1 -1
  24. package/esm/src/transforms/mdx/compiler/index.js +3 -3
  25. package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts +1 -1
  26. package/esm/src/transforms/mdx/compiler/mdx-compiler.d.ts.map +1 -1
  27. package/esm/src/transforms/mdx/compiler/mdx-compiler.js +5 -1
  28. package/esm/src/transforms/plugins/babel-node-positions.d.ts +1 -1
  29. package/esm/src/transforms/plugins/babel-node-positions.d.ts.map +1 -1
  30. package/esm/src/transforms/plugins/babel-node-positions.js +4 -5
  31. package/esm/src/transforms/plugins/rehype-node-positions.d.ts +19 -0
  32. package/esm/src/transforms/plugins/rehype-node-positions.d.ts.map +1 -0
  33. package/esm/src/transforms/plugins/rehype-node-positions.js +44 -0
  34. package/esm/src/workflow/claude-code/agent.d.ts +8 -0
  35. package/esm/src/workflow/claude-code/agent.d.ts.map +1 -1
  36. package/esm/src/workflow/claude-code/agent.js +5 -4
  37. package/package.json +1 -3
  38. package/src/deno.js +3 -5
  39. package/src/src/modules/server/module-server.ts +4 -1
  40. package/src/src/platform/compat/dynamic-import.ts +14 -0
  41. package/src/src/platform/compat/opaque-deps.ts +33 -0
  42. package/src/src/platform/compat/process.ts +1 -6
  43. package/src/src/provider/local/local-engine.ts +2 -1
  44. package/src/src/rendering/component-handling.ts +4 -1
  45. package/src/src/rendering/page-rendering.ts +4 -0
  46. package/src/src/transforms/md/compiler/md-compiler.ts +11 -4
  47. package/src/src/transforms/mdx/compiler/index.ts +12 -1
  48. package/src/src/transforms/mdx/compiler/mdx-compiler.ts +6 -0
  49. package/src/src/transforms/plugins/babel-node-positions.ts +7 -15
  50. package/src/src/transforms/plugins/rehype-node-positions.ts +66 -0
  51. package/src/src/workflow/claude-code/agent.ts +5 -5
package/esm/deno.d.ts CHANGED
@@ -229,7 +229,6 @@ declare namespace _default {
229
229
  "@ai-sdk/openai": string;
230
230
  "@ai-sdk/anthropic": string;
231
231
  "@ai-sdk/google": string;
232
- "@anthropic-ai/claude-agent-sdk": string;
233
232
  tailwindcss: string;
234
233
  "tailwindcss/plugin": string;
235
234
  "tailwindcss/defaultTheme": string;
@@ -247,7 +246,6 @@ declare namespace _default {
247
246
  "@babel/traverse": string;
248
247
  "@babel/generator": string;
249
248
  "@babel/types": string;
250
- "@huggingface/transformers": string;
251
249
  };
252
250
  namespace compilerOptions {
253
251
  let jsx: string;
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -239,7 +239,6 @@ export default {
239
239
  "@ai-sdk/openai": "npm:@ai-sdk/openai@3.0.28",
240
240
  "@ai-sdk/anthropic": "npm:@ai-sdk/anthropic@3.0.43",
241
241
  "@ai-sdk/google": "npm:@ai-sdk/google@3.0.29",
242
- "@anthropic-ai/claude-agent-sdk": "npm:@anthropic-ai/claude-agent-sdk@0.2.37",
243
242
  "tailwindcss": "https://esm.sh/tailwindcss@4.1.8",
244
243
  "tailwindcss/plugin": "https://esm.sh/tailwindcss@4.1.8/plugin",
245
244
  "tailwindcss/defaultTheme": "https://esm.sh/tailwindcss@4.1.8/defaultTheme",
@@ -256,8 +255,7 @@ export default {
256
255
  "@babel/parser": "npm:@babel/parser@7.26.3",
257
256
  "@babel/traverse": "npm:@babel/traverse@7.26.3",
258
257
  "@babel/generator": "npm:@babel/generator@7.26.3",
259
- "@babel/types": "npm:@babel/types@7.26.3",
260
- "@huggingface/transformers": "npm:@huggingface/transformers@3.4.2"
258
+ "@babel/types": "npm:@babel/types@7.26.3"
261
259
  },
262
260
  "compilerOptions": {
263
261
  "jsx": "react-jsx",
@@ -391,7 +389,7 @@ export default {
391
389
  "allowScripts": {
392
390
  "allow": [
393
391
  "npm:sharp@0.33.5",
394
- "npm:onnxruntime-node@1.20.1"
392
+ "npm:onnxruntime-node@1.21.0"
395
393
  ],
396
394
  "deny": [
397
395
  "npm:esbuild@0.20.2",
@@ -1 +1 @@
1
- {"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAmBtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkDrD,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB/D;AASD,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAiTzG;AAmND;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAG7D"}
1
+ {"version":3,"file":"module-server.d.ts","sourceRoot":"","sources":["../../../../src/src/modules/server/module-server.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAC5E,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAIlD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAmBtE;;;;;;;;;GASG;AACH,eAAO,MAAM,kBAAkB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAkDrD,CAAC;AAEF;;;;;GAKG;AACH,wBAAsB,yBAAyB,IAAI,OAAO,CAAC,IAAI,CAAC,CAuB/D;AASD,MAAM,WAAW,mBAAmB;IAClC,yDAAyD;IACzD,SAAS,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,sBAAsB;IACtB,OAAO,EAAE,cAAc,CAAC;IACxB,uBAAuB;IACvB,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,+DAA+D;IAC/D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gFAAgF;IAChF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,uDAAuD;IACvD,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAoTzG;AAmND;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAG7D"}
@@ -301,7 +301,10 @@ export function serveModule(req, options) {
301
301
  const studioEmbed = url.searchParams.get("studio_embed") === "true";
302
302
  const isJsxFile = /\.(tsx|jsx)$/i.test(sourceFile);
303
303
  if (studioEmbed && !isFrameworkFile && isJsxFile) {
304
- source = injectNodePositions(source, { filePath: sourceFile });
304
+ const relativeFilePath = sourceFile.startsWith(projectDir)
305
+ ? sourceFile.slice(projectDir.length).replace(/^\/+/, "")
306
+ : sourceFile;
307
+ source = injectNodePositions(source, { filePath: relativeFilePath });
305
308
  }
306
309
  logger.debug("SSR mode check", {
307
310
  isSSR,
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Opaque dynamic import helper.
3
+ *
4
+ * Uses `new Function` to hide the `import()` call from static analysis
5
+ * by bundlers and `deno compile`, preventing them from tracing into
6
+ * the imported specifier.
7
+ *
8
+ * @module platform/compat
9
+ */
10
+ export declare const dynamicImport: <T = any>(specifier: string) => Promise<T>;
11
+ //# sourceMappingURL=dynamic-import.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dynamic-import.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/dynamic-import.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,eAAO,MAAM,aAAa,EAA4D,CAAC,CAAC,GAAG,GAAG,EAC5F,SAAS,EAAE,MAAM,KACd,OAAO,CAAC,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Opaque dynamic import helper.
3
+ *
4
+ * Uses `new Function` to hide the `import()` call from static analysis
5
+ * by bundlers and `deno compile`, preventing them from tracing into
6
+ * the imported specifier.
7
+ *
8
+ * @module platform/compat
9
+ */
10
+ // deno-lint-ignore no-explicit-any
11
+ export const dynamicImport = new Function("specifier", "return import(specifier)");
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Opaque dynamic imports for heavy optional dependencies.
3
+ *
4
+ * These packages are excluded from the deno.json import map to prevent
5
+ * `deno compile` from bundling them into the binary. The `new Function`
6
+ * pattern makes the import invisible to static analysis so `deno compile`
7
+ * won't trace it.
8
+ *
9
+ * - Deno: resolves via `npm:` specifiers at runtime
10
+ * - Node/Bun: resolves via bare package names from node_modules
11
+ * - Compiled binary: fails (callers must handle the error)
12
+ *
13
+ * Update versions here when upgrading these packages.
14
+ *
15
+ * @module platform/compat
16
+ */
17
+ /** Lazily import `@huggingface/transformers` (+ onnxruntime, ~500MB). */
18
+ export declare function importTransformers(): Promise<any>;
19
+ /** Lazily import `@anthropic-ai/claude-agent-sdk` (~69MB). */
20
+ export declare function importClaudeAgentSDK(): Promise<any>;
21
+ //# sourceMappingURL=opaque-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opaque-deps.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/opaque-deps.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AASH,yEAAyE;AACzE,wBAAgB,kBAAkB,IAAI,OAAO,CAAC,GAAG,CAAC,CAEjD;AAED,8DAA8D;AAC9D,wBAAgB,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,CAEnD"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Opaque dynamic imports for heavy optional dependencies.
3
+ *
4
+ * These packages are excluded from the deno.json import map to prevent
5
+ * `deno compile` from bundling them into the binary. The `new Function`
6
+ * pattern makes the import invisible to static analysis so `deno compile`
7
+ * won't trace it.
8
+ *
9
+ * - Deno: resolves via `npm:` specifiers at runtime
10
+ * - Node/Bun: resolves via bare package names from node_modules
11
+ * - Compiled binary: fails (callers must handle the error)
12
+ *
13
+ * Update versions here when upgrading these packages.
14
+ *
15
+ * @module platform/compat
16
+ */
17
+ import { isDeno } from "./runtime.js";
18
+ import { dynamicImport } from "./dynamic-import.js";
19
+ function resolve(pkg, version) {
20
+ return isDeno ? `npm:${pkg}@${version}` : pkg;
21
+ }
22
+ /** Lazily import `@huggingface/transformers` (+ onnxruntime, ~500MB). */
23
+ export function importTransformers() {
24
+ return dynamicImport(resolve("@huggingface/transformers", "3.4.2"));
25
+ }
26
+ /** Lazily import `@anthropic-ai/claude-agent-sdk` (~69MB). */
27
+ export function importClaudeAgentSDK() {
28
+ return dynamicImport(resolve("@anthropic-ai/claude-agent-sdk", "0.2.37"));
29
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"process.d.ts","sourceRoot":"","sources":["../../../../src/src/platform/compat/process.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAmBlD,6EAA6E;AAC7E,wBAAgB,OAAO,IAAI,MAAM,EAAE,CAIlC;AAED,yFAAyF;AACzF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CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7B,gDAAgD;IAChD,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,mEAAmE;IACnE,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,sEAAsE;IACtE,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAwBD;;;;;;;;;GASG;AACH,wBAAsB,UAAU,CAC9B,GAAG,EAAE,MAAM,EACX,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,CAAC,CA6HxB"}
@@ -1,10 +1,8 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { isBun as IS_BUN, isDeno as IS_DENO } from "./runtime.js";
3
+ import { dynamicImport } from "./dynamic-import.js";
3
4
  const nodeProcess = dntShim.dntGlobalThis.process;
4
5
  const hasNodeProcess = !!nodeProcess?.versions?.node;
5
- // Dynamic import helper to avoid static analysis by bundlers
6
- // This prevents Bun from trying to resolve node:child_process at compile time
7
- const dynamicImport = new Function("specifier", "return import(specifier)");
8
6
  function isWindowsPlatform() {
9
7
  if (IS_DENO)
10
8
  return dntShim.Deno.build.os === "windows";
@@ -1 +1 @@
1
- {"version":3,"file":"local-engine.d.ts","sourceRoot":"","sources":["../../../../src/src/provider/local/local-engine.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AASH,sDAAsD;AACtD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;IACtC,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,kCAAkC;AAClC,MAAM,WAAW,eAAe;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,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,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGxE;AAED;;;;GAIG;AACH,wBAAuB,cAAc,CACnC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,GAAE,eAAoB,GAC5B,cAAc,CAAC,MAAM,EAAE,IAAI,EAAE,SAAS,CAAC,CAoEzC;AAED;;GAEG;AACH,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,WAAW,EAAE,EACvB,OAAO,GAAE,eAAoB,GAC5B,OAAO,CAAC,MAAM,CAAC,CAMjB;AAED;;GAEG;AACH,wBAAsB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAGjE;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAGtD"}
@@ -12,6 +12,7 @@
12
12
  */
13
13
  import { serverLogger } from "../../utils/index.js";
14
14
  import { createError, toError } from "../../errors/veryfront-error.js";
15
+ import { importTransformers } from "../../platform/compat/opaque-deps.js";
15
16
  import { DEFAULT_LOCAL_MODEL, resolveLocalModel } from "./model-catalog.js";
16
17
  import { isLocalAIDisabled } from "./env.js";
17
18
  const logger = serverLogger.component("local-llm");
@@ -36,7 +37,7 @@ async function getTransformers() {
36
37
  }
37
38
  logger.info("Loading @huggingface/transformers...");
38
39
  try {
39
- transformersModule = await import("@huggingface/transformers");
40
+ transformersModule = await importTransformers();
40
41
  }
41
42
  catch {
42
43
  throw toError(createError({
@@ -1 +1 @@
1
- {"version":3,"file":"component-handling.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/component-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,KAAK,YAAY,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQhE,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,YAAY,CAAC,YAAY,CAAC;IACvC,UAAU,EAAE,UAAU,CAAC;CACxB;AAgBD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,OAAO,EAC3B,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,mBAAmB,CAAC,CAsE9B"}
1
+ {"version":3,"file":"component-handling.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/component-handling.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,KAAK,YAAY,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAQhE,MAAM,WAAW,mBAAmB;IAClC,WAAW,EAAE,YAAY,CAAC,YAAY,CAAC;IACvC,UAAU,EAAE,UAAU,CAAC;CACxB;AAgBD;;GAEG;AACH,wBAAsB,mBAAmB,CACvC,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,kBAAkB,EAAE,OAAO,EAC3B,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IACR,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wDAAwD;IACxD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,wEAAwE;IACxE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yDAAyD;IACzD,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB,GACA,OAAO,CAAC,mBAAmB,CAAC,CAyE9B"}
@@ -28,8 +28,11 @@ export async function handleComponentPage(pageInfo, slug, projectDir, _component
28
28
  try {
29
29
  logger.debug(`Loading TSX/JSX file: ${pageInfo.entity.path}`);
30
30
  const rawFileContent = await adapter.fs.readFile(pageInfo.entity.path);
31
+ const normalizedPath = pageInfo.entity.path.startsWith(projectDir)
32
+ ? pageInfo.entity.path.slice(projectDir.length).replace(/^\/+/, "")
33
+ : pageInfo.entity.path;
31
34
  const fileContent = options?.studioEmbed
32
- ? injectNodePositions(rawFileContent, { filePath: pageInfo.entity.path })
35
+ ? injectNodePositions(rawFileContent, { filePath: normalizedPath })
33
36
  : rawFileContent;
34
37
  const clientModuleCode = options?.cachedClientModule ??
35
38
  (await bundleComponentForClient(fileContent, pageInfo.entity.path, projectDir, adapter, options?.moduleServerUrl, options?.projectId, options?.reactVersion));
@@ -1 +1 @@
1
- {"version":3,"file":"page-rendering.d.ts","sourceRoot":"","sources":["../../../src/src/rendering/page-rendering.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,YAAY,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,SAAS,EAAE,aAAa,EAAa,UAAU,EAAE,MAAM,mBAAmB,CAAC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UAAU,EAAE,UAAU,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC5C;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,UAAU,EACpB,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,MAAM,EAClB,gBAAgB,EAAE,aAAa,EAC/B,WAAW,EAAE,CACX,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,KACd,OAAO,CAAC,SAAS,CAAC,EACvB,OAAO,EAAE,cAAc,EACvB,OAAO,CAAC,EAAE;IACR,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;IAC3C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qCAAqC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2DAA2D;IAC3D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,gFAAgF;IAChF,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GACA,OAAO,CAAC,aAAa,CAAC,CA+GxB"}
@@ -9,7 +9,7 @@ export function handleMDXPage(pageInfo, slug, projectDir, mergedComponents, _com
9
9
  return withSpan("rendering.handleMDXPage", async () => {
10
10
  const { frontmatter, content, path } = pageInfo.entity;
11
11
  const fmArg = frontmatter && Object.keys(frontmatter).length > 0 ? frontmatter : undefined;
12
- const ssrBundle = await compileContent("development", projectDir, content, fmArg, path, "server");
12
+ const ssrBundle = await compileContent("development", projectDir, content, fmArg, path, "server", undefined, options?.studioEmbed);
13
13
  const pageBundle = ssrBundle;
14
14
  let collectedMetadata = {};
15
15
  try {
@@ -17,7 +17,7 @@ export function handleMDXPage(pageInfo, slug, projectDir, mergedComponents, _com
17
17
  pageBundle.clientModuleCode = options.precompiledModule;
18
18
  }
19
19
  else {
20
- const browserBundle = await compileContent("development", projectDir, content, fmArg, path, "browser");
20
+ const browserBundle = await compileContent("development", projectDir, content, fmArg, path, "browser", undefined, options?.studioEmbed);
21
21
  pageBundle.clientModuleCode = browserBundle.compiledCode;
22
22
  }
23
23
  const clientModuleCode = pageBundle.clientModuleCode;
@@ -1,3 +1,3 @@
1
1
  import type { CompilationMode, CompilationTarget, MdxRuntimeBundle } from "../../mdx/compiler/types.js";
2
- export declare function compileMarkdownRuntime(_mode: CompilationMode, _projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, _target?: CompilationTarget, _baseUrl?: string): Promise<MdxRuntimeBundle>;
2
+ export declare function compileMarkdownRuntime(_mode: CompilationMode, _projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, _target?: CompilationTarget, _baseUrl?: string, studioEmbed?: boolean): Promise<MdxRuntimeBundle>;
3
3
  //# sourceMappingURL=md-compiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"md-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/md/compiler/md-compiler.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAoDrC,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,GAAE,iBAA4B,EACrC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,gBAAgB,CAAC,CAsE3B"}
1
+ {"version":3,"file":"md-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/md/compiler/md-compiler.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EACV,eAAe,EACf,iBAAiB,EACjB,gBAAgB,EACjB,MAAM,6BAA6B,CAAC;AAoDrC,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,eAAe,EACtB,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,OAAO,GAAE,iBAA4B,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,gBAAgB,CAAC,CA2E3B"}
@@ -9,6 +9,7 @@ import rehypeStringify from "rehype-stringify";
9
9
  import { visit } from "unist-util-visit";
10
10
  import { toString } from "mdast-util-to-string";
11
11
  import { rendererLogger } from "../../../utils/index.js";
12
+ import { rehypeNodePositions } from "../../plugins/rehype-node-positions.js";
12
13
  import { extractFrontmatter } from "../../mdx/compiler/frontmatter-extractor.js";
13
14
  import { isMarkdownPreview as checkMarkdownPreview } from "../utils.js";
14
15
  import { createError, toError } from "../../../errors/veryfront-error.js";
@@ -48,21 +49,25 @@ export default function MDContent({ components, params, className, ...props }) {
48
49
  }
49
50
  `;
50
51
  }
51
- export function compileMarkdownRuntime(_mode, _projectDir, content, frontmatter, filePath, _target = "server", _baseUrl) {
52
+ export function compileMarkdownRuntime(_mode, _projectDir, content, frontmatter, filePath, _target = "server", _baseUrl, studioEmbed) {
52
53
  return withSpan("transforms.compileMarkdownRuntime", async () => {
53
54
  try {
54
55
  const { body, frontmatter: extractedFrontmatter } = extractFrontmatter(content, frontmatter);
55
56
  const headings = [];
56
- const processor = unified()
57
+ const pipeline = unified()
57
58
  .use(remarkParse)
58
59
  .use(remarkGfm)
59
60
  .use(remarkFrontmatter)
60
61
  .use(remarkExtractHeadings, headings)
61
62
  .use(remarkRehype, { allowDangerousHtml: true })
62
63
  .use(rehypeStarryNight)
63
- .use(rehypeSlug)
64
- .use(rehypeStringify, { allowDangerousHtml: true });
65
- const result = await processor.process(body);
64
+ .use(rehypeSlug);
65
+ if (studioEmbed && filePath) {
66
+ pipeline.use(rehypeNodePositions, { filePath });
67
+ }
68
+ const result = await pipeline
69
+ .use(rehypeStringify, { allowDangerousHtml: true })
70
+ .process(body);
66
71
  const html = String(result);
67
72
  logger.debug("Compiled markdown:", {
68
73
  filePath,
@@ -10,5 +10,5 @@ export type { CompilationMode, CompilationTarget, MdxRuntimeBundle } from "./typ
10
10
  export type { FrontmatterExtractionResult } from "./frontmatter-extractor.js";
11
11
  export type { ImportRewriterConfig } from "./import-rewriter.js";
12
12
  import type { CompilationMode, CompilationTarget, MdxRuntimeBundle } from "./types.js";
13
- export declare function compileContent(mode: CompilationMode, projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, target?: CompilationTarget, baseUrl?: string): Promise<MdxRuntimeBundle>;
13
+ export declare function compileContent(mode: CompilationMode, projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, target?: CompilationTarget, baseUrl?: string, studioEmbed?: boolean): Promise<MdxRuntimeBundle>;
14
14
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9E,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMvF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,CAAC,CAc3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAClF,YAAY,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AACvF,YAAY,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAC9E,YAAY,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAIjE,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAMvF,wBAAgB,cAAc,CAC5B,IAAI,EAAE,eAAe,EACrB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,gBAAgB,CAAC,CAwB3B"}
@@ -11,9 +11,9 @@ import { compileMarkdownRuntime } from "../../md/compiler/index.js";
11
11
  function isMarkdownFile(filePath) {
12
12
  return filePath?.endsWith(".md") ?? false;
13
13
  }
14
- export function compileContent(mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl) {
14
+ export function compileContent(mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl, studioEmbed) {
15
15
  if (isMarkdownFile(filePath)) {
16
- return compileMarkdownRuntime(mode, projectDir, content, frontmatter, filePath, target, baseUrl);
16
+ return compileMarkdownRuntime(mode, projectDir, content, frontmatter, filePath, target, baseUrl, studioEmbed);
17
17
  }
18
- return compileMDXRuntime(mode, projectDir, content, frontmatter, filePath, target, baseUrl);
18
+ return compileMDXRuntime(mode, projectDir, content, frontmatter, filePath, target, baseUrl, studioEmbed);
19
19
  }
@@ -1,3 +1,3 @@
1
1
  import type { CompilationMode, CompilationTarget, MdxRuntimeBundle } from "./types.js";
2
- export declare function compileMDXRuntime(_mode: CompilationMode, projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, target?: CompilationTarget, baseUrl?: string): Promise<MdxRuntimeBundle>;
2
+ export declare function compileMDXRuntime(_mode: CompilationMode, projectDir: string, content: string, frontmatter?: Record<string, unknown>, filePath?: string, target?: CompilationTarget, baseUrl?: string, studioEmbed?: boolean): Promise<MdxRuntimeBundle>;
3
3
  //# sourceMappingURL=mdx-compiler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mdx-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/mdx-compiler.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQvF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,gBAAgB,CAAC,CAyF3B"}
1
+ {"version":3,"file":"mdx-compiler.d.ts","sourceRoot":"","sources":["../../../../../src/src/transforms/mdx/compiler/mdx-compiler.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAQvF,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,EACtB,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,MAAM,EACf,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACrC,QAAQ,CAAC,EAAE,MAAM,EACjB,MAAM,GAAE,iBAA4B,EACpC,OAAO,CAAC,EAAE,MAAM,EAChB,WAAW,CAAC,EAAE,OAAO,GACpB,OAAO,CAAC,gBAAgB,CAAC,CA6F3B"}
@@ -1,16 +1,20 @@
1
1
  import { rendererLogger } from "../../../utils/index.js";
2
2
  import { getRehypePlugins, getRemarkPlugins } from "../../plugins/plugin-loader.js";
3
+ import { rehypeNodePositions } from "../../plugins/rehype-node-positions.js";
3
4
  import { extractFrontmatter } from "./frontmatter-extractor.js";
4
5
  import { rewriteBodyImports, rewriteCompiledImports } from "./import-rewriter.js";
5
6
  import { createError, toError } from "../../../errors/veryfront-error.js";
6
7
  import { withSpan } from "../../../observability/tracing/otlp-setup.js";
7
8
  const logger = rendererLogger.component("mdx-compiler");
8
- export function compileMDXRuntime(_mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl) {
9
+ export function compileMDXRuntime(_mode, projectDir, content, frontmatter, filePath, target = "server", baseUrl, studioEmbed) {
9
10
  return withSpan("transforms.compileMDXRuntime", async () => {
10
11
  try {
11
12
  const { compile } = await import("@mdx-js/mdx");
12
13
  const remarkPlugins = (await getRemarkPlugins());
13
14
  const rehypePlugins = (await getRehypePlugins());
15
+ if (studioEmbed && filePath) {
16
+ rehypePlugins.push([rehypeNodePositions, { filePath }]);
17
+ }
14
18
  const { body: extractedBody, frontmatter: extractedFrontmatter } = extractFrontmatter(content, frontmatter);
15
19
  const shouldRewriteImports = Boolean(filePath) &&
16
20
  (target === "browser" || target === "server");
@@ -11,6 +11,6 @@ interface TransformOptions {
11
11
  * Transform TSX source to inject position data attributes into JSX elements.
12
12
  * This enables Studio Navigator to map rendered elements back to source positions.
13
13
  */
14
- export declare function injectNodePositions(source: string, _options: TransformOptions): string;
14
+ export declare function injectNodePositions(source: string, options: TransformOptions): string;
15
15
  export {};
16
16
  //# sourceMappingURL=babel-node-positions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-node-positions.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/plugins/babel-node-positions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2EH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AA4CD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CA6DtF"}
1
+ {"version":3,"file":"babel-node-positions.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/plugins/babel-node-positions.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA2EH,UAAU,gBAAgB;IACxB,QAAQ,EAAE,MAAM,CAAC;CAClB;AA4CD;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,gBAAgB,GAAG,MAAM,CAqDrF"}
@@ -87,9 +87,11 @@ function hasPositionAttribute(attributes) {
87
87
  * Transform TSX source to inject position data attributes into JSX elements.
88
88
  * This enables Studio Navigator to map rendered elements back to source positions.
89
89
  */
90
- export function injectNodePositions(source, _options) {
90
+ export function injectNodePositions(source, options) {
91
91
  if (!source.trim())
92
92
  return source;
93
+ if (!options.filePath)
94
+ return source;
93
95
  try {
94
96
  const ast = parser.parse(source, {
95
97
  sourceType: "module",
@@ -111,10 +113,7 @@ export function injectNodePositions(source, _options) {
111
113
  if (!loc)
112
114
  return;
113
115
  const nodeId = `node-${nodeCounter++}`;
114
- openingElement.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-node-id"), t.stringLiteral(nodeId)), t.jsxAttribute(t.jsxIdentifier("data-node-line"), t.stringLiteral(String(loc.start.line))), t.jsxAttribute(t.jsxIdentifier("data-node-column"), t.stringLiteral(String(loc.start.column))));
115
- if (!loc.end)
116
- return;
117
- openingElement.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-node-end-line"), t.stringLiteral(String(loc.end.line))), t.jsxAttribute(t.jsxIdentifier("data-node-end-column"), t.stringLiteral(String(loc.end.column))));
116
+ openingElement.attributes.push(t.jsxAttribute(t.jsxIdentifier("data-node-id"), t.stringLiteral(nodeId)), t.jsxAttribute(t.jsxIdentifier("data-node-file"), t.stringLiteral(options.filePath)), t.jsxAttribute(t.jsxIdentifier("data-node-name"), t.stringLiteral(elementName)), t.jsxAttribute(t.jsxIdentifier("data-node-line"), t.stringLiteral(String(loc.start.line))), t.jsxAttribute(t.jsxIdentifier("data-node-column"), t.stringLiteral(String(loc.start.column))));
118
117
  },
119
118
  },
120
119
  });
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Rehype plugin that injects source location attributes on every element.
3
+ *
4
+ * Handles both:
5
+ * - HTML elements from markdown (h1, p, li, …)
6
+ * - MDX JSX nodes (mdxJsxFlowElement, mdxJsxTextElement)
7
+ *
8
+ * Injected attributes:
9
+ * data-node-file — project-relative source file path
10
+ * data-node-name — element or component name
11
+ * data-node-line — source line number
12
+ * data-node-column — source column number (0-based)
13
+ */
14
+ import type { Root } from "@types/hast";
15
+ export interface RehypeNodePositionsOptions {
16
+ filePath?: string;
17
+ }
18
+ export declare function rehypeNodePositions(options?: RehypeNodePositionsOptions): (tree: Root) => void;
19
+ //# sourceMappingURL=rehype-node-positions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rehype-node-positions.d.ts","sourceRoot":"","sources":["../../../../src/src/transforms/plugins/rehype-node-positions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAW,IAAI,EAAE,MAAM,aAAa,CAAC;AAGjD,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AASD,wBAAgB,mBAAmB,CACjC,OAAO,GAAE,0BAA+B,GACvC,CAAC,IAAI,EAAE,IAAI,KAAK,IAAI,CAmCtB"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Rehype plugin that injects source location attributes on every element.
3
+ *
4
+ * Handles both:
5
+ * - HTML elements from markdown (h1, p, li, …)
6
+ * - MDX JSX nodes (mdxJsxFlowElement, mdxJsxTextElement)
7
+ *
8
+ * Injected attributes:
9
+ * data-node-file — project-relative source file path
10
+ * data-node-name — element or component name
11
+ * data-node-line — source line number
12
+ * data-node-column — source column number (0-based)
13
+ */
14
+ import { visit } from "unist-util-visit";
15
+ export function rehypeNodePositions(options = {}) {
16
+ return function transform(tree) {
17
+ visit(tree, (node) => {
18
+ if (node.type === "element") {
19
+ const el = node;
20
+ if (!el.position)
21
+ return;
22
+ const props = el.properties ?? (el.properties = {});
23
+ const { start } = el.position;
24
+ if (options.filePath)
25
+ props["data-node-file"] = options.filePath;
26
+ props["data-node-name"] = el.tagName;
27
+ props["data-node-line"] = String(start.line);
28
+ props["data-node-column"] = String(start.column - 1);
29
+ return;
30
+ }
31
+ if (node.type !== "mdxJsxFlowElement" && node.type !== "mdxJsxTextElement")
32
+ return;
33
+ const mdx = node;
34
+ if (!mdx.position)
35
+ return;
36
+ const attrs = mdx.attributes ?? (mdx.attributes = []);
37
+ const { start } = mdx.position;
38
+ if (options.filePath) {
39
+ attrs.push({ type: "mdxJsxAttribute", name: "data-node-file", value: options.filePath });
40
+ }
41
+ attrs.push({ type: "mdxJsxAttribute", name: "data-node-name", value: mdx.name || "unknown" }, { type: "mdxJsxAttribute", name: "data-node-line", value: String(start.line) }, { type: "mdxJsxAttribute", name: "data-node-column", value: String(start.column - 1) });
42
+ });
43
+ };
44
+ }
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Claude Agent SDK Integration
3
+ *
4
+ * Uses the official @anthropic-ai/claude-agent-sdk which runs through
5
+ * your local Claude Code installation. No separate API key needed —
6
+ * it uses whatever auth your `claude` binary is configured with
7
+ * (Max subscription, API key, org key, etc.).
8
+ */
1
9
  import type { ClaudeCodeMode, ClaudeCodeResult } from "./types.js";
2
10
  /**
3
11
  * Agent configuration
@@ -1 +1 @@
1
- {"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../../../../src/src/workflow/claude-code/agent.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInE;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,+CAA+C;IAC/C,IAAI,CAAC,EAAE,cAAc,CAAC;IAEtB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,4BAA4B;IAC5B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,6BAA6B;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,4CAA4C;IAC5C,GAAG,CAAC,EAAE,MAAM,CAAC;IAEb,qDAAqD;IACrD,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;IAExB,+CAA+C;IAC/C,qBAAqB,CAAC,EAAE,MAAM,EAAE,CAAC;IAEjC,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAEhB,wCAAwC;IACxC,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,gBAAgB,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjE;AAwBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,GAAE,WAAgB,GACvB,OAAO,CAAC,gBAAgB,CAAC,CA+H3B;AAED;;;;;;;;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AAW,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAGtE"}
@@ -6,8 +6,9 @@
6
6
  * it uses whatever auth your `claude` binary is configured with
7
7
  * (Max subscription, API key, org key, etc.).
8
8
  */
9
- import * as dntShim from "../../../_dnt.shims.js";
10
9
  import { logger as baseLogger } from "../../utils/index.js";
10
+ import { cwd } from "../../platform/compat/process.js";
11
+ import { importClaudeAgentSDK } from "../../platform/compat/opaque-deps.js";
11
12
  const logger = baseLogger.component("agent-sdk");
12
13
  const DEFAULT_MODEL = "claude-sonnet-4-5-20250929";
13
14
  /**
@@ -46,12 +47,12 @@ export async function executeAgent(task, config = {}) {
46
47
  const commandsExecuted = [];
47
48
  try {
48
49
  // Dynamic import — only loads SDK when actually used
49
- const { query } = await import("@anthropic-ai/claude-agent-sdk");
50
+ const { query } = await importClaudeAgentSDK();
50
51
  if (config.debug) {
51
52
  logger.info("Starting task:", task);
52
53
  logger.info("Config:", {
53
54
  model: config.model || DEFAULT_MODEL,
54
- cwd: config.cwd || dntShim.Deno.cwd(),
55
+ cwd: config.cwd || cwd(),
55
56
  maxTurns: config.maxTurns,
56
57
  mode: config.mode,
57
58
  });
@@ -60,7 +61,7 @@ export async function executeAgent(task, config = {}) {
60
61
  prompt: task,
61
62
  options: {
62
63
  model: config.model || DEFAULT_MODEL,
63
- cwd: config.cwd || dntShim.Deno.cwd(),
64
+ cwd: config.cwd || cwd(),
64
65
  maxTurns: config.maxTurns,
65
66
  maxBudgetUsd: config.maxBudgetUsd,
66
67
  permissionMode: resolvePermissionMode(config.mode),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "veryfront",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "description": "The simplest way to build AI-powered apps",
5
5
  "keywords": [
6
6
  "react",
@@ -120,12 +120,10 @@
120
120
  "@ai-sdk/anthropic": "3.0.43",
121
121
  "@ai-sdk/google": "3.0.29",
122
122
  "@ai-sdk/openai": "3.0.28",
123
- "@anthropic-ai/claude-agent-sdk": "0.2.37",
124
123
  "@babel/generator": "7.26.3",
125
124
  "@babel/parser": "7.26.3",
126
125
  "@babel/traverse": "7.26.3",
127
126
  "@babel/types": "7.26.3",
128
- "@huggingface/transformers": "3.4.2",
129
127
  "@mdx-js/mdx": "3.0.0",
130
128
  "@opentelemetry/api": "1",
131
129
  "@opentelemetry/context-async-hooks": "1",
package/src/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.46",
3
+ "version": "0.1.47",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -239,7 +239,6 @@ export default {
239
239
  "@ai-sdk/openai": "npm:@ai-sdk/openai@3.0.28",
240
240
  "@ai-sdk/anthropic": "npm:@ai-sdk/anthropic@3.0.43",
241
241
  "@ai-sdk/google": "npm:@ai-sdk/google@3.0.29",
242
- "@anthropic-ai/claude-agent-sdk": "npm:@anthropic-ai/claude-agent-sdk@0.2.37",
243
242
  "tailwindcss": "https://esm.sh/tailwindcss@4.1.8",
244
243
  "tailwindcss/plugin": "https://esm.sh/tailwindcss@4.1.8/plugin",
245
244
  "tailwindcss/defaultTheme": "https://esm.sh/tailwindcss@4.1.8/defaultTheme",
@@ -256,8 +255,7 @@ export default {
256
255
  "@babel/parser": "npm:@babel/parser@7.26.3",
257
256
  "@babel/traverse": "npm:@babel/traverse@7.26.3",
258
257
  "@babel/generator": "npm:@babel/generator@7.26.3",
259
- "@babel/types": "npm:@babel/types@7.26.3",
260
- "@huggingface/transformers": "npm:@huggingface/transformers@3.4.2"
258
+ "@babel/types": "npm:@babel/types@7.26.3"
261
259
  },
262
260
  "compilerOptions": {
263
261
  "jsx": "react-jsx",
@@ -391,7 +389,7 @@ export default {
391
389
  "allowScripts": {
392
390
  "allow": [
393
391
  "npm:sharp@0.33.5",
394
- "npm:onnxruntime-node@1.20.1"
392
+ "npm:onnxruntime-node@1.21.0"
395
393
  ],
396
394
  "deny": [
397
395
  "npm:esbuild@0.20.2",
@@ -401,7 +401,10 @@ export function serveModule(req: dntShim.Request, options: ModuleServerOptions):
401
401
  const studioEmbed = url.searchParams.get("studio_embed") === "true";
402
402
  const isJsxFile = /\.(tsx|jsx)$/i.test(sourceFile);
403
403
  if (studioEmbed && !isFrameworkFile && isJsxFile) {
404
- source = injectNodePositions(source, { filePath: sourceFile });
404
+ const relativeFilePath = sourceFile.startsWith(projectDir)
405
+ ? sourceFile.slice(projectDir.length).replace(/^\/+/, "")
406
+ : sourceFile;
407
+ source = injectNodePositions(source, { filePath: relativeFilePath });
405
408
  }
406
409
 
407
410
  logger.debug("SSR mode check", {
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Opaque dynamic import helper.
3
+ *
4
+ * Uses `new Function` to hide the `import()` call from static analysis
5
+ * by bundlers and `deno compile`, preventing them from tracing into
6
+ * the imported specifier.
7
+ *
8
+ * @module platform/compat
9
+ */
10
+
11
+ // deno-lint-ignore no-explicit-any
12
+ export const dynamicImport = new Function("specifier", "return import(specifier)") as <T = any>(
13
+ specifier: string,
14
+ ) => Promise<T>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Opaque dynamic imports for heavy optional dependencies.
3
+ *
4
+ * These packages are excluded from the deno.json import map to prevent
5
+ * `deno compile` from bundling them into the binary. The `new Function`
6
+ * pattern makes the import invisible to static analysis so `deno compile`
7
+ * won't trace it.
8
+ *
9
+ * - Deno: resolves via `npm:` specifiers at runtime
10
+ * - Node/Bun: resolves via bare package names from node_modules
11
+ * - Compiled binary: fails (callers must handle the error)
12
+ *
13
+ * Update versions here when upgrading these packages.
14
+ *
15
+ * @module platform/compat
16
+ */
17
+
18
+ import { isDeno } from "./runtime.js";
19
+ import { dynamicImport } from "./dynamic-import.js";
20
+
21
+ function resolve(pkg: string, version: string): string {
22
+ return isDeno ? `npm:${pkg}@${version}` : pkg;
23
+ }
24
+
25
+ /** Lazily import `@huggingface/transformers` (+ onnxruntime, ~500MB). */
26
+ export function importTransformers(): Promise<any> {
27
+ return dynamicImport(resolve("@huggingface/transformers", "3.4.2"));
28
+ }
29
+
30
+ /** Lazily import `@anthropic-ai/claude-agent-sdk` (~69MB). */
31
+ export function importClaudeAgentSDK(): Promise<any> {
32
+ return dynamicImport(resolve("@anthropic-ai/claude-agent-sdk", "0.2.37"));
33
+ }
@@ -1,15 +1,10 @@
1
1
  import * as dntShim from "../../../_dnt.shims.js";
2
2
  import { isBun as IS_BUN, isDeno as IS_DENO } from "./runtime.js";
3
+ import { dynamicImport } from "./dynamic-import.js";
3
4
 
4
5
  const nodeProcess = (dntShim.dntGlobalThis as { process?: typeof import("node:process") }).process;
5
6
  const hasNodeProcess = !!nodeProcess?.versions?.node;
6
7
 
7
- // Dynamic import helper to avoid static analysis by bundlers
8
- // This prevents Bun from trying to resolve node:child_process at compile time
9
- const dynamicImport = new Function("specifier", "return import(specifier)") as <T>(
10
- specifier: string,
11
- ) => Promise<T>;
12
-
13
8
  function isWindowsPlatform(): boolean {
14
9
  if (IS_DENO) return dntShim.Deno.build.os === "windows";
15
10
  const platform = nodeProcess?.platform ??
@@ -13,6 +13,7 @@
13
13
 
14
14
  import { serverLogger } from "../../utils/index.js";
15
15
  import { createError, toError } from "../../errors/veryfront-error.js";
16
+ import { importTransformers } from "../../platform/compat/opaque-deps.js";
16
17
  import { DEFAULT_LOCAL_MODEL, type ModelInfo, resolveLocalModel } from "./model-catalog.js";
17
18
  import { isLocalAIDisabled } from "./env.js";
18
19
 
@@ -66,7 +67,7 @@ async function getTransformers(): Promise<TransformersModule> {
66
67
  logger.info("Loading @huggingface/transformers...");
67
68
 
68
69
  try {
69
- transformersModule = await import("@huggingface/transformers");
70
+ transformersModule = await importTransformers();
70
71
  } catch {
71
72
  throw toError(
72
73
  createError({
@@ -60,8 +60,11 @@ export async function handleComponentPage(
60
60
  logger.debug(`Loading TSX/JSX file: ${pageInfo.entity.path}`);
61
61
 
62
62
  const rawFileContent = await adapter.fs.readFile(pageInfo.entity.path);
63
+ const normalizedPath = pageInfo.entity.path.startsWith(projectDir)
64
+ ? pageInfo.entity.path.slice(projectDir.length).replace(/^\/+/, "")
65
+ : pageInfo.entity.path;
63
66
  const fileContent = options?.studioEmbed
64
- ? injectNodePositions(rawFileContent, { filePath: pageInfo.entity.path })
67
+ ? injectNodePositions(rawFileContent, { filePath: normalizedPath })
65
68
  : rawFileContent;
66
69
 
67
70
  const clientModuleCode = options?.cachedClientModule ??
@@ -52,6 +52,8 @@ export function handleMDXPage(
52
52
  fmArg,
53
53
  path,
54
54
  "server",
55
+ undefined,
56
+ options?.studioEmbed,
55
57
  );
56
58
 
57
59
  const pageBundle = ssrBundle as PageBundle;
@@ -68,6 +70,8 @@ export function handleMDXPage(
68
70
  fmArg,
69
71
  path,
70
72
  "browser",
73
+ undefined,
74
+ options?.studioEmbed,
71
75
  );
72
76
  pageBundle.clientModuleCode = browserBundle.compiledCode;
73
77
  }
@@ -10,6 +10,7 @@ import { visit } from "unist-util-visit";
10
10
  import { toString } from "mdast-util-to-string";
11
11
  import type { Heading, Root as MdastRoot } from "@types/mdast";
12
12
  import { rendererLogger } from "../../../utils/index.js";
13
+ import { rehypeNodePositions } from "../../plugins/rehype-node-positions.js";
13
14
  import { extractFrontmatter } from "../../mdx/compiler/frontmatter-extractor.js";
14
15
  import type {
15
16
  CompilationMode,
@@ -75,6 +76,7 @@ export function compileMarkdownRuntime(
75
76
  filePath?: string,
76
77
  _target: CompilationTarget = "server",
77
78
  _baseUrl?: string,
79
+ studioEmbed?: boolean,
78
80
  ): Promise<MdxRuntimeBundle> {
79
81
  return withSpan(
80
82
  "transforms.compileMarkdownRuntime",
@@ -87,17 +89,22 @@ export function compileMarkdownRuntime(
87
89
 
88
90
  const headings: ExtractedHeading[] = [];
89
91
 
90
- const processor = unified()
92
+ const pipeline = unified()
91
93
  .use(remarkParse)
92
94
  .use(remarkGfm)
93
95
  .use(remarkFrontmatter)
94
96
  .use(remarkExtractHeadings, headings)
95
97
  .use(remarkRehype, { allowDangerousHtml: true })
96
98
  .use(rehypeStarryNight)
97
- .use(rehypeSlug)
98
- .use(rehypeStringify, { allowDangerousHtml: true });
99
+ .use(rehypeSlug);
99
100
 
100
- const result = await processor.process(body);
101
+ if (studioEmbed && filePath) {
102
+ pipeline.use(rehypeNodePositions, { filePath });
103
+ }
104
+
105
+ const result = await pipeline
106
+ .use(rehypeStringify, { allowDangerousHtml: true })
107
+ .process(body);
101
108
  const html = String(result);
102
109
 
103
110
  logger.debug("Compiled markdown:", {
@@ -27,6 +27,7 @@ export function compileContent(
27
27
  filePath?: string,
28
28
  target: CompilationTarget = "server",
29
29
  baseUrl?: string,
30
+ studioEmbed?: boolean,
30
31
  ): Promise<MdxRuntimeBundle> {
31
32
  if (isMarkdownFile(filePath)) {
32
33
  return compileMarkdownRuntime(
@@ -37,8 +38,18 @@ export function compileContent(
37
38
  filePath,
38
39
  target,
39
40
  baseUrl,
41
+ studioEmbed,
40
42
  );
41
43
  }
42
44
 
43
- return compileMDXRuntime(mode, projectDir, content, frontmatter, filePath, target, baseUrl);
45
+ return compileMDXRuntime(
46
+ mode,
47
+ projectDir,
48
+ content,
49
+ frontmatter,
50
+ filePath,
51
+ target,
52
+ baseUrl,
53
+ studioEmbed,
54
+ );
44
55
  }
@@ -1,6 +1,7 @@
1
1
  import type { Pluggable } from "unified";
2
2
  import { rendererLogger } from "../../../utils/index.js";
3
3
  import { getRehypePlugins, getRemarkPlugins } from "../../plugins/plugin-loader.js";
4
+ import { rehypeNodePositions } from "../../plugins/rehype-node-positions.js";
4
5
  import { extractFrontmatter } from "./frontmatter-extractor.js";
5
6
  import { rewriteBodyImports, rewriteCompiledImports } from "./import-rewriter.js";
6
7
  import type { CompilationMode, CompilationTarget, MdxRuntimeBundle } from "./types.js";
@@ -19,6 +20,7 @@ export function compileMDXRuntime(
19
20
  filePath?: string,
20
21
  target: CompilationTarget = "server",
21
22
  baseUrl?: string,
23
+ studioEmbed?: boolean,
22
24
  ): Promise<MdxRuntimeBundle> {
23
25
  return withSpan(
24
26
  "transforms.compileMDXRuntime",
@@ -29,6 +31,10 @@ export function compileMDXRuntime(
29
31
  const remarkPlugins = (await getRemarkPlugins()) as unknown as PluggableList;
30
32
  const rehypePlugins = (await getRehypePlugins()) as unknown as PluggableList;
31
33
 
34
+ if (studioEmbed && filePath) {
35
+ rehypePlugins.push([rehypeNodePositions, { filePath }] as unknown as Pluggable);
36
+ }
37
+
32
38
  const { body: extractedBody, frontmatter: extractedFrontmatter } = extractFrontmatter(
33
39
  content,
34
40
  frontmatter,
@@ -128,8 +128,9 @@ function hasPositionAttribute(attributes: (t.JSXAttribute | t.JSXSpreadAttribute
128
128
  * Transform TSX source to inject position data attributes into JSX elements.
129
129
  * This enables Studio Navigator to map rendered elements back to source positions.
130
130
  */
131
- export function injectNodePositions(source: string, _options: TransformOptions): string {
131
+ export function injectNodePositions(source: string, options: TransformOptions): string {
132
132
  if (!source.trim()) return source;
133
+ if (!options.filePath) return source;
133
134
 
134
135
  try {
135
136
  const ast = parser.parse(source, {
@@ -153,9 +154,13 @@ export function injectNodePositions(source: string, _options: TransformOptions):
153
154
  if (!loc) return;
154
155
 
155
156
  const nodeId = `node-${nodeCounter++}`;
156
-
157
157
  openingElement.attributes.push(
158
158
  t.jsxAttribute(t.jsxIdentifier("data-node-id"), t.stringLiteral(nodeId)),
159
+ t.jsxAttribute(
160
+ t.jsxIdentifier("data-node-file"),
161
+ t.stringLiteral(options.filePath),
162
+ ),
163
+ t.jsxAttribute(t.jsxIdentifier("data-node-name"), t.stringLiteral(elementName)),
159
164
  t.jsxAttribute(
160
165
  t.jsxIdentifier("data-node-line"),
161
166
  t.stringLiteral(String(loc.start.line)),
@@ -165,19 +170,6 @@ export function injectNodePositions(source: string, _options: TransformOptions):
165
170
  t.stringLiteral(String(loc.start.column)),
166
171
  ),
167
172
  );
168
-
169
- if (!loc.end) return;
170
-
171
- openingElement.attributes.push(
172
- t.jsxAttribute(
173
- t.jsxIdentifier("data-node-end-line"),
174
- t.stringLiteral(String(loc.end.line)),
175
- ),
176
- t.jsxAttribute(
177
- t.jsxIdentifier("data-node-end-column"),
178
- t.stringLiteral(String(loc.end.column)),
179
- ),
180
- );
181
173
  },
182
174
  },
183
175
  });
@@ -0,0 +1,66 @@
1
+ /**
2
+ * Rehype plugin that injects source location attributes on every element.
3
+ *
4
+ * Handles both:
5
+ * - HTML elements from markdown (h1, p, li, …)
6
+ * - MDX JSX nodes (mdxJsxFlowElement, mdxJsxTextElement)
7
+ *
8
+ * Injected attributes:
9
+ * data-node-file — project-relative source file path
10
+ * data-node-name — element or component name
11
+ * data-node-line — source line number
12
+ * data-node-column — source column number (0-based)
13
+ */
14
+
15
+ import type { Element, Root } from "@types/hast";
16
+ import { visit } from "unist-util-visit";
17
+
18
+ export interface RehypeNodePositionsOptions {
19
+ filePath?: string;
20
+ }
21
+
22
+ interface MdxJsxNode {
23
+ type: string;
24
+ name?: string;
25
+ attributes?: Array<{ type: string; name: string; value: unknown }>;
26
+ position?: { start: { line: number; column: number } };
27
+ }
28
+
29
+ export function rehypeNodePositions(
30
+ options: RehypeNodePositionsOptions = {},
31
+ ): (tree: Root) => void {
32
+ return function transform(tree: Root): void {
33
+ visit(tree, (node) => {
34
+ if (node.type === "element") {
35
+ const el = node as Element;
36
+ if (!el.position) return;
37
+
38
+ const props = el.properties ?? (el.properties = {});
39
+ const { start } = el.position;
40
+
41
+ if (options.filePath) props["data-node-file"] = options.filePath;
42
+ props["data-node-name"] = el.tagName;
43
+ props["data-node-line"] = String(start.line);
44
+ props["data-node-column"] = String(start.column - 1);
45
+ return;
46
+ }
47
+
48
+ if (node.type !== "mdxJsxFlowElement" && node.type !== "mdxJsxTextElement") return;
49
+
50
+ const mdx = node as MdxJsxNode;
51
+ if (!mdx.position) return;
52
+
53
+ const attrs = mdx.attributes ?? (mdx.attributes = []);
54
+ const { start } = mdx.position;
55
+
56
+ if (options.filePath) {
57
+ attrs.push({ type: "mdxJsxAttribute", name: "data-node-file", value: options.filePath });
58
+ }
59
+ attrs.push(
60
+ { type: "mdxJsxAttribute", name: "data-node-name", value: mdx.name || "unknown" },
61
+ { type: "mdxJsxAttribute", name: "data-node-line", value: String(start.line) },
62
+ { type: "mdxJsxAttribute", name: "data-node-column", value: String(start.column - 1) },
63
+ );
64
+ });
65
+ };
66
+ }
@@ -6,10 +6,10 @@
6
6
  * it uses whatever auth your `claude` binary is configured with
7
7
  * (Max subscription, API key, org key, etc.).
8
8
  */
9
- import * as dntShim from "../../../_dnt.shims.js";
10
-
11
9
 
12
10
  import { logger as baseLogger } from "../../utils/index.js";
11
+ import { cwd } from "../../platform/compat/process.js";
12
+ import { importClaudeAgentSDK } from "../../platform/compat/opaque-deps.js";
13
13
  import type { ClaudeCodeMode, ClaudeCodeResult } from "./types.js";
14
14
 
15
15
  const logger = baseLogger.component("agent-sdk");
@@ -94,13 +94,13 @@ export async function executeAgent(
94
94
 
95
95
  try {
96
96
  // Dynamic import — only loads SDK when actually used
97
- const { query } = await import("@anthropic-ai/claude-agent-sdk");
97
+ const { query } = await importClaudeAgentSDK();
98
98
 
99
99
  if (config.debug) {
100
100
  logger.info("Starting task:", task);
101
101
  logger.info("Config:", {
102
102
  model: config.model || DEFAULT_MODEL,
103
- cwd: config.cwd || dntShim.Deno.cwd(),
103
+ cwd: config.cwd || cwd(),
104
104
  maxTurns: config.maxTurns,
105
105
  mode: config.mode,
106
106
  });
@@ -110,7 +110,7 @@ export async function executeAgent(
110
110
  prompt: task,
111
111
  options: {
112
112
  model: config.model || DEFAULT_MODEL,
113
- cwd: config.cwd || dntShim.Deno.cwd(),
113
+ cwd: config.cwd || cwd(),
114
114
  maxTurns: config.maxTurns,
115
115
  maxBudgetUsd: config.maxBudgetUsd,
116
116
  permissionMode: resolvePermissionMode(config.mode),