ai-props 2.1.3 → 2.4.0

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 (105) hide show
  1. package/.dev.vars +2 -0
  2. package/.turbo/turbo-build.log +1 -1
  3. package/CHANGELOG.md +20 -0
  4. package/README.md +2 -0
  5. package/dist/ai.d.ts.map +1 -1
  6. package/dist/ai.js +4 -4
  7. package/dist/ai.js.map +1 -1
  8. package/dist/cascade.d.ts +329 -0
  9. package/dist/cascade.d.ts.map +1 -0
  10. package/dist/cascade.js +522 -0
  11. package/dist/cascade.js.map +1 -0
  12. package/dist/client.d.ts +233 -0
  13. package/dist/client.d.ts.map +1 -0
  14. package/dist/client.js +191 -0
  15. package/dist/client.js.map +1 -0
  16. package/dist/durable-cascade.d.ts +280 -0
  17. package/dist/durable-cascade.d.ts.map +1 -0
  18. package/dist/durable-cascade.js +469 -0
  19. package/dist/durable-cascade.js.map +1 -0
  20. package/dist/event-bridge.d.ts +257 -0
  21. package/dist/event-bridge.d.ts.map +1 -0
  22. package/dist/event-bridge.js +317 -0
  23. package/dist/event-bridge.js.map +1 -0
  24. package/dist/generate.d.ts.map +1 -1
  25. package/dist/generate.js +12 -6
  26. package/dist/generate.js.map +1 -1
  27. package/dist/hoc.d.ts.map +1 -1
  28. package/dist/hoc.js +13 -13
  29. package/dist/hoc.js.map +1 -1
  30. package/dist/hono-jsx.d.ts +208 -0
  31. package/dist/hono-jsx.d.ts.map +1 -0
  32. package/dist/hono-jsx.js +459 -0
  33. package/dist/hono-jsx.js.map +1 -0
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +2 -0
  37. package/dist/index.js.map +1 -1
  38. package/dist/mdx-types.d.ts +152 -0
  39. package/dist/mdx-types.d.ts.map +1 -0
  40. package/dist/mdx-types.js +9 -0
  41. package/dist/mdx-types.js.map +1 -0
  42. package/dist/mdx-utils.d.ts +106 -0
  43. package/dist/mdx-utils.d.ts.map +1 -0
  44. package/dist/mdx-utils.js +384 -0
  45. package/dist/mdx-utils.js.map +1 -0
  46. package/dist/mdx.d.ts +230 -0
  47. package/dist/mdx.d.ts.map +1 -0
  48. package/dist/mdx.js +820 -0
  49. package/dist/mdx.js.map +1 -0
  50. package/dist/rpc.d.ts +313 -0
  51. package/dist/rpc.d.ts.map +1 -0
  52. package/dist/rpc.js +359 -0
  53. package/dist/rpc.js.map +1 -0
  54. package/dist/streaming.d.ts +199 -0
  55. package/dist/streaming.d.ts.map +1 -0
  56. package/dist/streaming.js +402 -0
  57. package/dist/streaming.js.map +1 -0
  58. package/dist/validate.d.ts.map +1 -1
  59. package/dist/validate.js +11 -13
  60. package/dist/validate.js.map +1 -1
  61. package/dist/worker.d.ts +270 -0
  62. package/dist/worker.d.ts.map +1 -0
  63. package/dist/worker.js +405 -0
  64. package/dist/worker.js.map +1 -0
  65. package/package.json +39 -13
  66. package/src/ai.ts +12 -31
  67. package/src/cascade.ts +795 -0
  68. package/src/client.ts +440 -0
  69. package/src/durable-cascade.ts +743 -0
  70. package/src/event-bridge.ts +478 -0
  71. package/src/generate.ts +14 -12
  72. package/src/hoc.ts +15 -19
  73. package/src/hono-jsx.ts +675 -0
  74. package/src/index.ts +30 -0
  75. package/src/mdx-types.ts +169 -0
  76. package/src/mdx-utils.ts +437 -0
  77. package/src/mdx.ts +1008 -0
  78. package/src/rpc.ts +614 -0
  79. package/src/streaming.ts +618 -0
  80. package/src/validate.ts +15 -29
  81. package/src/worker.ts +547 -0
  82. package/test/cascade.test.ts +338 -0
  83. package/test/durable-cascade.test.ts +319 -0
  84. package/test/event-bridge.test.ts +351 -0
  85. package/test/generate.test.ts +6 -16
  86. package/test/mdx.test.ts +817 -0
  87. package/test/worker/capnweb-rpc.test.ts +1084 -0
  88. package/test/worker/full-flow.integration.test.ts +1463 -0
  89. package/test/worker/hono-jsx.test.ts +1258 -0
  90. package/test/worker/mdx-parsing.test.ts +1148 -0
  91. package/test/worker/setup.ts +56 -0
  92. package/test/worker.test.ts +595 -0
  93. package/tsconfig.json +2 -1
  94. package/vitest.config.js +6 -0
  95. package/vitest.config.ts +15 -1
  96. package/vitest.workers.config.ts +58 -0
  97. package/wrangler.jsonc +27 -0
  98. package/LICENSE +0 -21
  99. package/src/ai.js +0 -198
  100. package/src/cache.js +0 -182
  101. package/src/generate.js +0 -220
  102. package/src/hoc.js +0 -235
  103. package/src/index.js +0 -20
  104. package/src/types.js +0 -6
  105. package/src/validate.js +0 -252
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx-types.js","sourceRoot":"","sources":["../src/mdx-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
@@ -0,0 +1,106 @@
1
+ /**
2
+ * MDX utility functions
3
+ *
4
+ * Internal utilities for MDX parsing, component extraction, and content hashing.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ import type { MDXParseError } from './mdx-types.js';
9
+ /**
10
+ * Default cache TTL for MDX parsing (5 minutes)
11
+ */
12
+ export declare const MDX_CACHE_TTL: number;
13
+ /**
14
+ * Create a content hash for cache keys
15
+ *
16
+ * Uses a simple but fast hash algorithm suitable for cache keys.
17
+ *
18
+ * @param content - Content to hash
19
+ * @returns Hash string
20
+ */
21
+ export declare function hashContent(content: string): string;
22
+ /**
23
+ * Create an MDX parse error with location information
24
+ *
25
+ * @param message - Error message
26
+ * @param source - Source content where error occurred
27
+ * @param position - Position in source (optional)
28
+ * @returns MDXParseError
29
+ */
30
+ export declare function createParseError(message: string, source?: string, position?: number): MDXParseError;
31
+ /**
32
+ * Parse YAML frontmatter
33
+ *
34
+ * Handles basic YAML types: strings, numbers, booleans, arrays, and nested objects.
35
+ *
36
+ * @param yaml - YAML content string
37
+ * @returns Parsed key-value pairs
38
+ * @throws Error if YAML is invalid
39
+ */
40
+ export declare function parseYAML(yaml: string): Record<string, unknown>;
41
+ /**
42
+ * Parse a YAML value to its appropriate type
43
+ *
44
+ * @param value - YAML value string
45
+ * @returns Parsed value
46
+ * @throws Error if value is malformed
47
+ */
48
+ export declare function parseYAMLValue(value: string): unknown;
49
+ /**
50
+ * Extract component names from MDX content
51
+ *
52
+ * Finds all PascalCase JSX component tags.
53
+ *
54
+ * @param content - MDX body content
55
+ * @returns Array of unique component names
56
+ */
57
+ export declare function extractComponents(content: string): string[];
58
+ /**
59
+ * Extract props from a component tag string
60
+ *
61
+ * Parses string props, expression props, and boolean props.
62
+ *
63
+ * @param tag - Component tag content (attributes portion)
64
+ * @returns Props object
65
+ */
66
+ export declare function extractPropsFromTag(tag: string): Record<string, unknown>;
67
+ /**
68
+ * Extract component props from all components in MDX content
69
+ *
70
+ * @param content - MDX body content
71
+ * @returns Map of component names to their props
72
+ */
73
+ export declare function extractComponentProps(content: string): Record<string, Record<string, unknown>>;
74
+ /**
75
+ * Validate MDX syntax
76
+ *
77
+ * Checks for unclosed tags and invalid prop syntax.
78
+ *
79
+ * @param content - MDX body content
80
+ * @throws MDXParseError if syntax is invalid
81
+ */
82
+ export declare function validateMDX(content: string): void;
83
+ /**
84
+ * Serialize props to JSX attribute string
85
+ *
86
+ * @param props - Props object
87
+ * @returns JSX attribute string
88
+ */
89
+ export declare function serializeProps(props: Record<string, unknown>): string;
90
+ /**
91
+ * Sort object keys for consistent hashing
92
+ *
93
+ * @param obj - Object to sort
94
+ * @returns Object with sorted keys
95
+ */
96
+ export declare function sortObject(obj: Record<string, unknown>): Record<string, unknown>;
97
+ /**
98
+ * Create a cache key for MDX props generation
99
+ *
100
+ * @param componentName - Component name
101
+ * @param schema - Component schema
102
+ * @param context - Frontmatter context
103
+ * @returns Cache key string
104
+ */
105
+ export declare function createMDXCacheKey(componentName: string, schema: Record<string, string>, context?: Record<string, unknown>): string;
106
+ //# sourceMappingURL=mdx-utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx-utils.d.ts","sourceRoot":"","sources":["../src/mdx-utils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAa,aAAa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AM,EACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC9B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAChC,MAAM,CAIR"}
@@ -0,0 +1,384 @@
1
+ /**
2
+ * MDX utility functions
3
+ *
4
+ * Internal utilities for MDX parsing, component extraction, and content hashing.
5
+ *
6
+ * @packageDocumentation
7
+ */
8
+ /**
9
+ * Default cache TTL for MDX parsing (5 minutes)
10
+ */
11
+ export const MDX_CACHE_TTL = 5 * 60 * 1000;
12
+ /**
13
+ * Create a content hash for cache keys
14
+ *
15
+ * Uses a simple but fast hash algorithm suitable for cache keys.
16
+ *
17
+ * @param content - Content to hash
18
+ * @returns Hash string
19
+ */
20
+ export function hashContent(content) {
21
+ let hash = 0;
22
+ for (let i = 0; i < content.length; i++) {
23
+ const char = content.charCodeAt(i);
24
+ hash = (hash << 5) - hash + char;
25
+ hash = hash & hash; // Convert to 32-bit integer
26
+ }
27
+ return hash.toString(36);
28
+ }
29
+ /**
30
+ * Create an MDX parse error with location information
31
+ *
32
+ * @param message - Error message
33
+ * @param source - Source content where error occurred
34
+ * @param position - Position in source (optional)
35
+ * @returns MDXParseError
36
+ */
37
+ export function createParseError(message, source, position) {
38
+ const error = new Error(message);
39
+ if (source !== undefined) {
40
+ error.source = source;
41
+ }
42
+ if (source && position !== undefined) {
43
+ const lines = source.slice(0, position).split('\n');
44
+ error.line = lines.length;
45
+ error.column = (lines[lines.length - 1]?.length || 0) + 1;
46
+ }
47
+ return error;
48
+ }
49
+ /**
50
+ * Parse YAML frontmatter
51
+ *
52
+ * Handles basic YAML types: strings, numbers, booleans, arrays, and nested objects.
53
+ *
54
+ * @param yaml - YAML content string
55
+ * @returns Parsed key-value pairs
56
+ * @throws Error if YAML is invalid
57
+ */
58
+ export function parseYAML(yaml) {
59
+ const result = {};
60
+ const lines = yaml.trim().split('\n');
61
+ // Stack for tracking nested objects
62
+ // Each entry stores: the parent object, the parent indent level, and the current object's indent
63
+ const stack = [];
64
+ let currentObj = result;
65
+ let currentIndent = -1; // Use -1 for root level
66
+ let currentArray = null;
67
+ for (const line of lines) {
68
+ // Skip empty lines
69
+ if (!line.trim())
70
+ continue;
71
+ // Calculate indentation
72
+ const indentMatch = line.match(/^(\s*)/);
73
+ const indent = indentMatch && indentMatch[1] !== undefined ? indentMatch[1].length : 0;
74
+ // Pop stack if we've dedented (back to a parent level or sibling)
75
+ while (stack.length > 0 && indent <= stack[stack.length - 1].thisIndent) {
76
+ const popped = stack.pop();
77
+ currentObj = popped.parentObj;
78
+ currentIndent = popped.parentIndent;
79
+ currentArray = null;
80
+ }
81
+ // Check for array item
82
+ const arrayMatch = line.match(/^(\s*)-\s*(.*)$/);
83
+ if (arrayMatch && arrayMatch[2] !== undefined && currentArray !== null) {
84
+ const value = parseYAMLValue(arrayMatch[2].trim());
85
+ currentArray.push(value);
86
+ continue;
87
+ }
88
+ // Check for key-value pair (supporting special chars like $)
89
+ const keyMatch = line.match(/^(\s*)([\w$]+):\s*(.*)$/);
90
+ if (keyMatch && keyMatch[2] !== undefined && keyMatch[3] !== undefined) {
91
+ const key = keyMatch[2];
92
+ const value = keyMatch[3].trim();
93
+ // If the value is empty, this might be a nested object or array
94
+ if (value === '') {
95
+ // Check if this is an array or nested object by looking at the next line
96
+ const lineIndex = lines.indexOf(line);
97
+ const nextLine = lines[lineIndex + 1];
98
+ if (nextLine && nextLine.trim().startsWith('-')) {
99
+ // It's an array
100
+ currentArray = [];
101
+ currentObj[key] = currentArray;
102
+ }
103
+ else {
104
+ // It's a nested object
105
+ const nestedObj = {};
106
+ currentObj[key] = nestedObj;
107
+ stack.push({
108
+ parentObj: currentObj,
109
+ parentIndent: currentIndent,
110
+ thisIndent: indent,
111
+ });
112
+ currentObj = nestedObj;
113
+ currentIndent = indent;
114
+ currentArray = null;
115
+ }
116
+ }
117
+ else {
118
+ currentObj[key] = parseYAMLValue(value);
119
+ currentArray = null;
120
+ }
121
+ }
122
+ }
123
+ return result;
124
+ }
125
+ /**
126
+ * Parse a YAML value to its appropriate type
127
+ *
128
+ * @param value - YAML value string
129
+ * @returns Parsed value
130
+ * @throws Error if value is malformed
131
+ */
132
+ export function parseYAMLValue(value) {
133
+ // Boolean
134
+ if (value === 'true')
135
+ return true;
136
+ if (value === 'false')
137
+ return false;
138
+ // Number
139
+ const num = Number(value);
140
+ if (!isNaN(num) && value !== '')
141
+ return num;
142
+ // String (remove quotes if present)
143
+ if ((value.startsWith('"') && value.endsWith('"')) ||
144
+ (value.startsWith("'") && value.endsWith("'"))) {
145
+ return value.slice(1, -1);
146
+ }
147
+ // Check for invalid YAML (incomplete objects/arrays)
148
+ if (value.startsWith('[') && !value.endsWith(']')) {
149
+ throw createParseError('Invalid YAML: unclosed array');
150
+ }
151
+ if (value.startsWith('{') && !value.endsWith('}')) {
152
+ throw createParseError('Invalid YAML: unclosed object');
153
+ }
154
+ return value;
155
+ }
156
+ /**
157
+ * Extract component names from MDX content
158
+ *
159
+ * Finds all PascalCase JSX component tags.
160
+ *
161
+ * @param content - MDX body content
162
+ * @returns Array of unique component names
163
+ */
164
+ export function extractComponents(content) {
165
+ const components = new Set();
166
+ // Match JSX component tags (PascalCase)
167
+ // Self-closing: <Component />
168
+ // Opening: <Component>
169
+ const tagRegex = /<([A-Z][a-zA-Z0-9]*)(?:\s|>|\/)/g;
170
+ let match;
171
+ while ((match = tagRegex.exec(content)) !== null) {
172
+ if (match[1]) {
173
+ components.add(match[1]);
174
+ }
175
+ }
176
+ return Array.from(components);
177
+ }
178
+ /**
179
+ * Extract props from a component tag string
180
+ *
181
+ * Parses string props, expression props, and boolean props.
182
+ *
183
+ * @param tag - Component tag content (attributes portion)
184
+ * @returns Props object
185
+ */
186
+ export function extractPropsFromTag(tag) {
187
+ const props = {};
188
+ // Extract string props: name="value"
189
+ const stringPropRegex = /(\w+)="([^"]*)"/g;
190
+ let match;
191
+ while ((match = stringPropRegex.exec(tag)) !== null) {
192
+ const name = match[1];
193
+ const value = match[2];
194
+ if (name !== undefined && value !== undefined) {
195
+ props[name] = value;
196
+ }
197
+ }
198
+ // Extract expression props: name={expression}
199
+ const exprPropRegex = /(\w+)=\{([^}]*)\}/g;
200
+ while ((match = exprPropRegex.exec(tag)) !== null) {
201
+ const name = match[1];
202
+ const exprValue = match[2];
203
+ if (name !== undefined && exprValue !== undefined) {
204
+ try {
205
+ // Try to parse as JSON
206
+ props[name] = JSON.parse(exprValue);
207
+ }
208
+ catch {
209
+ // Try to evaluate simple expressions
210
+ if (exprValue === 'true') {
211
+ props[name] = true;
212
+ }
213
+ else if (exprValue === 'false') {
214
+ props[name] = false;
215
+ }
216
+ else if (!isNaN(Number(exprValue))) {
217
+ props[name] = Number(exprValue);
218
+ }
219
+ else {
220
+ // Keep as expression string
221
+ props[name] = exprValue;
222
+ }
223
+ }
224
+ }
225
+ }
226
+ // Extract boolean props (word not followed by =)
227
+ const booleanPropRegex = /\s([a-z][a-zA-Z0-9]*)(?=\s|>|\/|$)/g;
228
+ while ((match = booleanPropRegex.exec(tag)) !== null) {
229
+ const name = match[1];
230
+ // Only add if not already defined
231
+ if (name !== undefined && !(name in props)) {
232
+ props[name] = true;
233
+ }
234
+ }
235
+ return props;
236
+ }
237
+ /**
238
+ * Extract component props from all components in MDX content
239
+ *
240
+ * @param content - MDX body content
241
+ * @returns Map of component names to their props
242
+ */
243
+ export function extractComponentProps(content) {
244
+ const componentProps = {};
245
+ // Match full component tags (including multi-line)
246
+ const tagRegex = /<([A-Z][a-zA-Z0-9]*)([\s\S]*?)(?:\/>|>)/g;
247
+ let match;
248
+ while ((match = tagRegex.exec(content)) !== null) {
249
+ const componentName = match[1];
250
+ const propsStr = match[2];
251
+ if (componentName === undefined || propsStr === undefined)
252
+ continue;
253
+ const props = extractPropsFromTag(propsStr);
254
+ if (Object.keys(props).length > 0) {
255
+ // Merge with existing props for this component
256
+ componentProps[componentName] = {
257
+ ...componentProps[componentName],
258
+ ...props,
259
+ };
260
+ }
261
+ }
262
+ return componentProps;
263
+ }
264
+ /**
265
+ * Validate MDX syntax
266
+ *
267
+ * Checks for unclosed tags and invalid prop syntax.
268
+ *
269
+ * @param content - MDX body content
270
+ * @throws MDXParseError if syntax is invalid
271
+ */
272
+ export function validateMDX(content) {
273
+ // Check for incomplete tags at the end of content
274
+ const tagStarts = [];
275
+ const tagStartRegex = /<([A-Z][a-zA-Z0-9]*)/g;
276
+ let match;
277
+ while ((match = tagStartRegex.exec(content)) !== null) {
278
+ const name = match[1];
279
+ if (name !== undefined) {
280
+ tagStarts.push({ name, index: match.index });
281
+ }
282
+ }
283
+ // For each tag start, check if there's a closing >
284
+ for (let i = 0; i < tagStarts.length; i++) {
285
+ const start = tagStarts[i];
286
+ if (!start)
287
+ continue;
288
+ const endBound = tagStarts[i + 1]?.index ?? content.length;
289
+ const tagContent = content.slice(start.index, endBound);
290
+ if (!tagContent.includes('>')) {
291
+ throw createParseError(`Invalid MDX syntax: incomplete tag <${start.name}`, content, start.index);
292
+ }
293
+ }
294
+ // Check for invalid prop syntax: prop=>
295
+ const invalidPropMatch = content.match(/\w+=\s*>/);
296
+ if (invalidPropMatch) {
297
+ const position = content.indexOf(invalidPropMatch[0]);
298
+ throw createParseError('Invalid MDX syntax: incomplete prop value', content, position);
299
+ }
300
+ // Validate matching open/close tags
301
+ const allTagsRegex = /<\/?([A-Z][a-zA-Z0-9]*)[\s\S]*?>/g;
302
+ const tagMatches = [];
303
+ while ((match = allTagsRegex.exec(content)) !== null) {
304
+ const full = match[0];
305
+ const name = match[1];
306
+ if (name === undefined)
307
+ continue;
308
+ if (full.startsWith('</')) {
309
+ tagMatches.push({ name, type: 'close', full });
310
+ }
311
+ else if (full.trimEnd().endsWith('/>')) {
312
+ tagMatches.push({ name, type: 'selfClose', full });
313
+ }
314
+ else {
315
+ tagMatches.push({ name, type: 'open', full });
316
+ }
317
+ }
318
+ // Count opens and closes per tag name
319
+ const openCount = {};
320
+ const closeCount = {};
321
+ for (const tag of tagMatches) {
322
+ if (tag.type === 'open') {
323
+ openCount[tag.name] = (openCount[tag.name] || 0) + 1;
324
+ }
325
+ else if (tag.type === 'close') {
326
+ closeCount[tag.name] = (closeCount[tag.name] || 0) + 1;
327
+ }
328
+ }
329
+ // Each open tag should have a matching close tag
330
+ for (const name of Object.keys(openCount)) {
331
+ const opens = openCount[name] || 0;
332
+ const closes = closeCount[name] || 0;
333
+ if (opens > closes) {
334
+ throw createParseError(`Invalid MDX syntax: unclosed <${name}> tag`, content);
335
+ }
336
+ }
337
+ }
338
+ /**
339
+ * Serialize props to JSX attribute string
340
+ *
341
+ * @param props - Props object
342
+ * @returns JSX attribute string
343
+ */
344
+ export function serializeProps(props) {
345
+ return Object.entries(props)
346
+ .map(([k, v]) => {
347
+ if (typeof v === 'string') {
348
+ return `${k}="${v}"`;
349
+ }
350
+ return `${k}={${JSON.stringify(v)}}`;
351
+ })
352
+ .join(' ');
353
+ }
354
+ /**
355
+ * Sort object keys for consistent hashing
356
+ *
357
+ * @param obj - Object to sort
358
+ * @returns Object with sorted keys
359
+ */
360
+ export function sortObject(obj) {
361
+ const sorted = {};
362
+ for (const key of Object.keys(obj).sort()) {
363
+ const value = obj[key];
364
+ sorted[key] =
365
+ value && typeof value === 'object' && !Array.isArray(value)
366
+ ? sortObject(value)
367
+ : value;
368
+ }
369
+ return sorted;
370
+ }
371
+ /**
372
+ * Create a cache key for MDX props generation
373
+ *
374
+ * @param componentName - Component name
375
+ * @param schema - Component schema
376
+ * @param context - Frontmatter context
377
+ * @returns Cache key string
378
+ */
379
+ export function createMDXCacheKey(componentName, schema, context) {
380
+ const schemaHash = hashContent(JSON.stringify(sortObject(schema)));
381
+ const contextHash = context ? hashContent(JSON.stringify(sortObject(context))) : '';
382
+ return `mdx:${componentName}:${schemaHash}:${contextHash}`;
383
+ }
384
+ //# sourceMappingURL=mdx-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx-utils.js","sourceRoot":"","sources":["../src/mdx-utils.ts"],"names":[],"mappings":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