tempo-sdk 0.0.99 → 0.0.102
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.
- package/README.md +3 -403
- package/dist/assets/editor.d.ts +43 -65
- package/dist/assets/editor.js +1 -573
- package/dist/assets/index.d.ts +11 -61
- package/dist/assets/index.js +1 -338
- package/dist/assets/parser.d.ts +68 -78
- package/dist/assets/parser.js +1 -33
- package/dist/astro/asset-preview-client.d.ts +3 -2
- package/dist/astro/asset-preview-client.js +1 -93
- package/dist/astro/controls.d.ts +1 -3
- package/dist/astro/controls.js +1 -7
- package/dist/astro/document-client.d.ts +5 -6
- package/dist/astro/document-client.js +1 -78
- package/dist/astro/runtime.d.ts +23 -11
- package/dist/astro/runtime.js +1 -86
- package/dist/astro.d.ts +19 -13
- package/dist/astro.js +1 -818
- package/dist/canvas/astro-contract.d.ts +0 -3
- package/dist/canvas/astro-contract.js +1 -9
- package/dist/canvas/astro.d.ts +3 -4
- package/dist/canvas/astro.js +1 -42
- package/dist/canvas/editor.d.ts +187 -183
- package/dist/canvas/editor.js +1 -1094
- package/dist/canvas/flutter-preview.d.ts +0 -1
- package/dist/canvas/flutter-preview.js +1 -9
- package/dist/canvas/index.d.ts +46 -100
- package/dist/canvas/index.js +1 -3926
- package/dist/canvas/interact-projection.d.ts +7 -5
- package/dist/canvas/interact-projection.js +1 -12
- package/dist/canvas/parser.d.ts +10 -303
- package/dist/canvas/parser.js +1 -30
- package/dist/canvas/svelte.d.ts +6 -7
- package/dist/canvas/svelte.js +1 -91
- package/dist/canvas/vue.d.ts +9 -49
- package/dist/canvas/vue.js +1 -264
- package/dist/chunk-CXCUJCXD.js +1 -0
- package/dist/chunk-FH6TMWFA.js +1 -0
- package/dist/chunk-FL7FSJSL.js +1 -0
- package/dist/chunk-GQIOB5SV.js +1 -0
- package/dist/chunk-HBQ7FFH7.js +1 -0
- package/dist/chunk-JRJOWLCN.js +1 -0
- package/dist/chunk-LJCBFTMP.js +1 -0
- package/dist/chunk-M3GN2KUH.js +1 -0
- package/dist/chunk-MPIHFFML.js +1 -0
- package/dist/chunk-T5TY3U2H.js +1 -0
- package/dist/chunk-XO2BSHWM.js +1 -0
- package/dist/chunk-XUSV3KOD.js +1 -0
- package/dist/chunk-ZXBMP6RV.js +1 -0
- package/dist/{controls-uCaQ3CNX.d.ts → controls-DKslABtM.d.ts} +0 -3
- package/dist/expo/plugin.cjs +1 -1928
- package/dist/expo/plugin.js +1 -8
- package/dist/expo-babel-plugin.cjs +1 -1928
- package/dist/expo-babel-plugin.d.cts +46 -40
- package/dist/expo-babel-plugin.d.ts +46 -40
- package/dist/expo-babel-plugin.js +1 -8
- package/dist/flutter-preview-path.d.ts +23 -7
- package/dist/flutter-preview-path.js +1 -16
- package/dist/index.d.ts +33 -45
- package/dist/index.js +1 -20
- package/dist/nextjs/plugin.cjs +1 -413
- package/dist/nextjs/plugin.js +1 -7
- package/dist/nextjs-loader.cjs +1 -2277
- package/dist/nextjs.cjs +1 -484
- package/dist/nextjs.d.cts +2 -58
- package/dist/nextjs.d.ts +2 -58
- package/dist/nextjs.js +1 -17
- package/dist/nuxt/runtime/identity.d.ts +2 -4
- package/dist/nuxt/runtime/identity.js +1 -18
- package/dist/nuxt.d.ts +31 -92
- package/dist/nuxt.js +1 -5854
- package/dist/{page-DwLnOM5d.d.ts → page-Bc8PekIX.d.ts} +1 -5
- package/dist/parser.d-MO5ciJ5n.d.ts +236 -0
- package/dist/{storyboard-CMJVBSXn.d.ts → storyboard.contract.d-UQ4MUYN5.d.ts} +3 -25
- package/dist/svelte.d.ts +8 -18
- package/dist/svelte.js +1 -917
- package/dist/types-CfUgM2w4.d.ts +57 -0
- package/dist/v1-client-compat-n0E0XxuX.d.ts +5 -0
- package/dist/vue.d.ts +17 -58
- package/dist/vue.js +1 -1501
- package/package.json +12 -62
- package/dist/assets/editor.js.map +0 -1
- package/dist/assets/index.js.map +0 -1
- package/dist/assets/parser.js.map +0 -1
- package/dist/astro/asset-preview-client.js.map +0 -1
- package/dist/astro/controls.js.map +0 -1
- package/dist/astro/document-client.js.map +0 -1
- package/dist/astro/runtime.js.map +0 -1
- package/dist/astro.js.map +0 -1
- package/dist/canvas/astro-contract.js.map +0 -1
- package/dist/canvas/astro.js.map +0 -1
- package/dist/canvas/editor.js.map +0 -1
- package/dist/canvas/flutter-preview.js.map +0 -1
- package/dist/canvas/index.js.map +0 -1
- package/dist/canvas/interact-projection.js.map +0 -1
- package/dist/canvas/parser.js.map +0 -1
- package/dist/canvas/svelte.js.map +0 -1
- package/dist/canvas/vue.js.map +0 -1
- package/dist/chunk-27WT3XUG.js +0 -455
- package/dist/chunk-27WT3XUG.js.map +0 -1
- package/dist/chunk-5HIIF354.js +0 -67
- package/dist/chunk-5HIIF354.js.map +0 -1
- package/dist/chunk-65B52AR7.js +0 -11
- package/dist/chunk-65B52AR7.js.map +0 -1
- package/dist/chunk-6HYKKP5N.js +0 -2658
- package/dist/chunk-6HYKKP5N.js.map +0 -1
- package/dist/chunk-6SOP4XU6.js +0 -1891
- package/dist/chunk-6SOP4XU6.js.map +0 -1
- package/dist/chunk-AFXE462X.js +0 -1253
- package/dist/chunk-AFXE462X.js.map +0 -1
- package/dist/chunk-BQPKOVI5.js +0 -115
- package/dist/chunk-BQPKOVI5.js.map +0 -1
- package/dist/chunk-CYDF4LYJ.js +0 -342
- package/dist/chunk-CYDF4LYJ.js.map +0 -1
- package/dist/chunk-CYQE3TLC.js +0 -37
- package/dist/chunk-CYQE3TLC.js.map +0 -1
- package/dist/chunk-DI2ZFAWL.js +0 -14
- package/dist/chunk-DI2ZFAWL.js.map +0 -1
- package/dist/chunk-EGRHWZRV.js +0 -1
- package/dist/chunk-EGRHWZRV.js.map +0 -1
- package/dist/chunk-FGWGY3G3.js +0 -157
- package/dist/chunk-FGWGY3G3.js.map +0 -1
- package/dist/chunk-HOBTDB6G.js +0 -112
- package/dist/chunk-HOBTDB6G.js.map +0 -1
- package/dist/chunk-I7VF4ZOV.js +0 -630
- package/dist/chunk-I7VF4ZOV.js.map +0 -1
- package/dist/chunk-JVVHU3A7.js +0 -1077
- package/dist/chunk-JVVHU3A7.js.map +0 -1
- package/dist/chunk-MIXQVPDH.js +0 -8606
- package/dist/chunk-MIXQVPDH.js.map +0 -1
- package/dist/chunk-MU7S7NU7.js +0 -183
- package/dist/chunk-MU7S7NU7.js.map +0 -1
- package/dist/chunk-OX2YKYSL.js +0 -13
- package/dist/chunk-OX2YKYSL.js.map +0 -1
- package/dist/chunk-PYAJHLXO.js +0 -903
- package/dist/chunk-PYAJHLXO.js.map +0 -1
- package/dist/chunk-SGN7BDRE.js +0 -16
- package/dist/chunk-SGN7BDRE.js.map +0 -1
- package/dist/chunk-SGTGDLOX.js +0 -285
- package/dist/chunk-SGTGDLOX.js.map +0 -1
- package/dist/chunk-T364NBR3.js +0 -1440
- package/dist/chunk-T364NBR3.js.map +0 -1
- package/dist/chunk-U66QI3EN.js +0 -1524
- package/dist/chunk-U66QI3EN.js.map +0 -1
- package/dist/chunk-WTXOWQ7N.js +0 -47
- package/dist/chunk-WTXOWQ7N.js.map +0 -1
- package/dist/chunk-X5DJKVBT.js +0 -1308
- package/dist/chunk-X5DJKVBT.js.map +0 -1
- package/dist/chunk-ZT7HJ6YU.js +0 -38
- package/dist/chunk-ZT7HJ6YU.js.map +0 -1
- package/dist/chunk-ZW26VZHX.js +0 -3169
- package/dist/chunk-ZW26VZHX.js.map +0 -1
- package/dist/controls-reader-5MFHYBZZ.js +0 -192
- package/dist/controls-reader-5MFHYBZZ.js.map +0 -1
- package/dist/expo/plugin.cjs.map +0 -1
- package/dist/expo/plugin.js.map +0 -1
- package/dist/expo-babel-plugin.cjs.map +0 -1
- package/dist/expo-babel-plugin.js.map +0 -1
- package/dist/flutter-preview-path.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/nextjs/plugin.cjs.map +0 -1
- package/dist/nextjs/plugin.js.map +0 -1
- package/dist/nextjs-loader.cjs.map +0 -1
- package/dist/nextjs.cjs.map +0 -1
- package/dist/nextjs.js.map +0 -1
- package/dist/nuxt/runtime/identity.js.map +0 -1
- package/dist/nuxt.js.map +0 -1
- package/dist/svelte.js.map +0 -1
- package/dist/types-C8OIU-kc.d.ts +0 -106
- package/dist/v1-client-compat-qxaXEDm_.d.ts +0 -23
- package/dist/vue.js.map +0 -1
package/dist/svelte.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../svelte.ts","../../../modules/svelte-editor/compiler.ts","../../../modules/svelte-editor/byte-order-mark.ts","../../../modules/svelte-editor/escape.ts","../../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/walker.js","../../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/sync.js","../../../node_modules/.pnpm/estree-walker@3.0.3/node_modules/estree-walker/src/index.js","../../../modules/svelte-editor/literal-attributes.ts","../../../modules/svelte-editor/style-directives.ts","../../../modules/svelte-editor/parse.ts","../../../modules/svelte-editor/annotate.ts"],"sourcesContent":["/**\n * Svelte-specific Tempo source annotation.\n *\n * Keep this adapter first in `svelte({ preprocess: [...] })`. It only supplies\n * filesystem/project identity; parsing and annotation remain isolated in the\n * framework-focused @modules/svelte-editor package.\n */\n\nimport { readFileSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { createSvelteAnnotationPreprocessor } from \"@modules/svelte-editor\";\nimport type { PreprocessorGroup } from \"svelte/compiler\";\nimport { sourceVersionHash } from \"../../modules/annotation/source-version.ts\";\nimport {\n defaultSourceRoot,\n readModifiedTs,\n resolveAnnotationIdentity,\n} from \"./annotation-identity.ts\";\nimport { appendModuleVersionRecord } from \"./annotation-strategy.ts\";\n\nexport interface TempoSveltePreprocessOptions {\n /** Annotation identity root. Defaults to the process working directory. */\n root?: string;\n /** Allowed source boundary. Defaults to the package-manager workspace\n * around `root`, else `root` (see defaultSourceRoot); host sidecars set\n * this to the project root while annotations remain relative to the host\n * root. */\n sourceRoot?: string;\n /** Override the normal TEMPO environment gate, primarily for tests. */\n enabled?: boolean;\n}\n\n/** A top-level module script, Svelte 5 (`module`) or 4 (`context=\"module\"`). */\nconst MODULE_SCRIPT =\n /<script\\b[^>]*\\b(?:module\\b|context\\s*=\\s*[\"']module[\"'])[^>]*>/;\n\nexport function tempoSveltePreprocess(\n options: TempoSveltePreprocessOptions = {},\n): PreprocessorGroup {\n const root = resolve(options.root ?? process.cwd());\n const sourceRoot = resolve(options.sourceRoot ?? defaultSourceRoot(root));\n const enabled = options.enabled ?? Boolean(process.env.TEMPO);\n\n const metadata = ({ filename }: { filename?: string }) => {\n if (!enabled || !filename) return null;\n const identity = resolveAnnotationIdentity(filename, { root, sourceRoot });\n if (!identity?.absoluteFilename.endsWith(\".svelte\")) return null;\n return {\n filepath: identity.filepath,\n modifiedTs: readModifiedTs(identity.absoluteFilename),\n };\n };\n const annotation = createSvelteAnnotationPreprocessor({ metadata });\n\n return {\n name: \"svelte-source-annotation\",\n // The annotation, plus an empty module script when the file has none:\n // the module version record must run once per module evaluation, which\n // is what a module script's top level does (V2-498).\n markup(input) {\n const result = annotation.markup?.(input);\n if (!result || !(\"code\" in result)) return result;\n if (MODULE_SCRIPT.test(result.code)) return result;\n return {\n ...result,\n code: `${result.code}\\n<script module></script>\\n`,\n };\n },\n // The module version record ends the module script, as it ends every\n // annotated JSX module. The file's own bytes name its version, the same\n // raw-source hash the element stamps carry.\n script({ content, attributes, filename }) {\n const moduleScript =\n attributes.module === true || attributes.context === \"module\";\n if (!moduleScript) return undefined;\n const identity = metadata({ filename });\n if (!identity || !filename) return undefined;\n const sourceVersion = sourceVersionHash(readFileSync(filename, \"utf8\"));\n return {\n code: appendModuleVersionRecord(\n content,\n identity.filepath,\n identity.modifiedTs,\n sourceVersion,\n ),\n };\n },\n };\n}\n","/**\n * The Svelte compiler functions the editor calls. Every value import of the\n * compiler goes through here, as `#svelte-compiler` (package.json\n * \"imports\"), so a bundler can swap in `compiler-deferred.ts`; the other\n * modules import only its types. Both read the source in the caller's\n * offsets (see byte-order-mark.ts).\n */\nimport * as SvelteCompiler from \"svelte/compiler\";\nimport { withoutByteOrderMark } from \"./byte-order-mark\";\n\nexport const compile: typeof SvelteCompiler.compile = (source, options) =>\n SvelteCompiler.compile(withoutByteOrderMark(source), options);\n// Svelte overloads `parse` on `modern`, which a forwarding arrow cannot\n// declare; the cast restores the overloads.\nexport const parse = ((\n source: string,\n options?: Parameters<typeof SvelteCompiler.parse>[1],\n) =>\n SvelteCompiler.parse(\n withoutByteOrderMark(source),\n options,\n )) as typeof SvelteCompiler.parse;\n","/**\n * Svelte's `parse` and `compile` drop a leading byte-order mark before they\n * read the source, so every syntax offset they report is one short of the\n * text a caller holds. The editor's offsets index that text, so its compiler\n * entry hands Svelte the source with the mark replaced by a space instead:\n * the length is unchanged, and leading whitespace in a component's markup\n * renders nothing.\n */\nexport function withoutByteOrderMark(source: string): string {\n return source.charCodeAt(0) === 0xfeff ? ` ${source.slice(1)}` : source;\n}\n","export function escapeSvelteAttributeValue(\n value: string,\n quote: '\"' | \"'\",\n): string {\n let escaped = value\n .split(\"&\")\n .join(\"&\")\n .split(\"<\")\n .join(\"<\")\n .split(\">\")\n .join(\">\")\n .split(\"{\")\n .join(\"{\")\n .split(\"}\")\n .join(\"}\");\n escaped =\n quote === '\"'\n ? escaped.split('\"').join(\""\")\n : escaped.split(\"'\").join(\"'\");\n return escaped;\n}\n","/**\n * @typedef { import('estree').Node} Node\n * @typedef {{\n * skip: () => void;\n * remove: () => void;\n * replace: (node: Node) => void;\n * }} WalkerContext\n */\n\nexport class WalkerBase {\n\tconstructor() {\n\t\t/** @type {boolean} */\n\t\tthis.should_skip = false;\n\n\t\t/** @type {boolean} */\n\t\tthis.should_remove = false;\n\n\t\t/** @type {Node | null} */\n\t\tthis.replacement = null;\n\n\t\t/** @type {WalkerContext} */\n\t\tthis.context = {\n\t\t\tskip: () => (this.should_skip = true),\n\t\t\tremove: () => (this.should_remove = true),\n\t\t\treplace: (node) => (this.replacement = node)\n\t\t};\n\t}\n\n\t/**\n\t * @template {Node} Parent\n\t * @param {Parent | null | undefined} parent\n\t * @param {keyof Parent | null | undefined} prop\n\t * @param {number | null | undefined} index\n\t * @param {Node} node\n\t */\n\treplace(parent, prop, index, node) {\n\t\tif (parent && prop) {\n\t\t\tif (index != null) {\n\t\t\t\t/** @type {Array<Node>} */ (parent[prop])[index] = node;\n\t\t\t} else {\n\t\t\t\t/** @type {Node} */ (parent[prop]) = node;\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * @template {Node} Parent\n\t * @param {Parent | null | undefined} parent\n\t * @param {keyof Parent | null | undefined} prop\n\t * @param {number | null | undefined} index\n\t */\n\tremove(parent, prop, index) {\n\t\tif (parent && prop) {\n\t\t\tif (index !== null && index !== undefined) {\n\t\t\t\t/** @type {Array<Node>} */ (parent[prop]).splice(index, 1);\n\t\t\t} else {\n\t\t\t\tdelete parent[prop];\n\t\t\t}\n\t\t}\n\t}\n}\n","import { WalkerBase } from './walker.js';\n\n/**\n * @typedef { import('estree').Node} Node\n * @typedef { import('./walker.js').WalkerContext} WalkerContext\n * @typedef {(\n * this: WalkerContext,\n * node: Node,\n * parent: Node | null,\n * key: string | number | symbol | null | undefined,\n * index: number | null | undefined\n * ) => void} SyncHandler\n */\n\nexport class SyncWalker extends WalkerBase {\n\t/**\n\t *\n\t * @param {SyncHandler} [enter]\n\t * @param {SyncHandler} [leave]\n\t */\n\tconstructor(enter, leave) {\n\t\tsuper();\n\n\t\t/** @type {boolean} */\n\t\tthis.should_skip = false;\n\n\t\t/** @type {boolean} */\n\t\tthis.should_remove = false;\n\n\t\t/** @type {Node | null} */\n\t\tthis.replacement = null;\n\n\t\t/** @type {WalkerContext} */\n\t\tthis.context = {\n\t\t\tskip: () => (this.should_skip = true),\n\t\t\tremove: () => (this.should_remove = true),\n\t\t\treplace: (node) => (this.replacement = node)\n\t\t};\n\n\t\t/** @type {SyncHandler | undefined} */\n\t\tthis.enter = enter;\n\n\t\t/** @type {SyncHandler | undefined} */\n\t\tthis.leave = leave;\n\t}\n\n\t/**\n\t * @template {Node} Parent\n\t * @param {Node} node\n\t * @param {Parent | null} parent\n\t * @param {keyof Parent} [prop]\n\t * @param {number | null} [index]\n\t * @returns {Node | null}\n\t */\n\tvisit(node, parent, prop, index) {\n\t\tif (node) {\n\t\t\tif (this.enter) {\n\t\t\t\tconst _should_skip = this.should_skip;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tthis.should_skip = false;\n\t\t\t\tthis.should_remove = false;\n\t\t\t\tthis.replacement = null;\n\n\t\t\t\tthis.enter.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst skipped = this.should_skip;\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.should_skip = _should_skip;\n\t\t\t\tthis.should_remove = _should_remove;\n\t\t\t\tthis.replacement = _replacement;\n\n\t\t\t\tif (skipped) return node;\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\n\t\t\t/** @type {keyof Node} */\n\t\t\tlet key;\n\n\t\t\tfor (key in node) {\n\t\t\t\t/** @type {unknown} */\n\t\t\t\tconst value = node[key];\n\n\t\t\t\tif (value && typeof value === 'object') {\n\t\t\t\t\tif (Array.isArray(value)) {\n\t\t\t\t\t\tconst nodes = /** @type {Array<unknown>} */ (value);\n\t\t\t\t\t\tfor (let i = 0; i < nodes.length; i += 1) {\n\t\t\t\t\t\t\tconst item = nodes[i];\n\t\t\t\t\t\t\tif (isNode(item)) {\n\t\t\t\t\t\t\t\tif (!this.visit(item, node, key, i)) {\n\t\t\t\t\t\t\t\t\t// removed\n\t\t\t\t\t\t\t\t\ti--;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (isNode(value)) {\n\t\t\t\t\t\tthis.visit(value, node, key, null);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (this.leave) {\n\t\t\t\tconst _replacement = this.replacement;\n\t\t\t\tconst _should_remove = this.should_remove;\n\t\t\t\tthis.replacement = null;\n\t\t\t\tthis.should_remove = false;\n\n\t\t\t\tthis.leave.call(this.context, node, parent, prop, index);\n\n\t\t\t\tif (this.replacement) {\n\t\t\t\t\tnode = this.replacement;\n\t\t\t\t\tthis.replace(parent, prop, index, node);\n\t\t\t\t}\n\n\t\t\t\tif (this.should_remove) {\n\t\t\t\t\tthis.remove(parent, prop, index);\n\t\t\t\t}\n\n\t\t\t\tconst removed = this.should_remove;\n\n\t\t\t\tthis.replacement = _replacement;\n\t\t\t\tthis.should_remove = _should_remove;\n\n\t\t\t\tif (removed) return null;\n\t\t\t}\n\t\t}\n\n\t\treturn node;\n\t}\n}\n\n/**\n * Ducktype a node.\n *\n * @param {unknown} value\n * @returns {value is Node}\n */\nfunction isNode(value) {\n\treturn (\n\t\tvalue !== null && typeof value === 'object' && 'type' in value && typeof value.type === 'string'\n\t);\n}\n","import { SyncWalker } from './sync.js';\nimport { AsyncWalker } from './async.js';\n\n/**\n * @typedef {import('estree').Node} Node\n * @typedef {import('./sync.js').SyncHandler} SyncHandler\n * @typedef {import('./async.js').AsyncHandler} AsyncHandler\n */\n\n/**\n * @param {Node} ast\n * @param {{\n * enter?: SyncHandler\n * leave?: SyncHandler\n * }} walker\n * @returns {Node | null}\n */\nexport function walk(ast, { enter, leave }) {\n\tconst instance = new SyncWalker(enter, leave);\n\treturn instance.visit(ast, null);\n}\n\n/**\n * @param {Node} ast\n * @param {{\n * enter?: AsyncHandler\n * leave?: AsyncHandler\n * }} walker\n * @returns {Promise<Node | null>}\n */\nexport async function asyncWalk(ast, { enter, leave }) {\n\tconst instance = new AsyncWalker(enter, leave);\n\treturn await instance.visit(ast, null);\n}\n","import { readLiteralExpression } from \"@modules/annotation/expression-facts\";\nimport type { AST } from \"svelte/compiler\";\nimport type { StringEdit } from \"./types\";\n\n/**\n * A native element attribute written as one mustache that holds only a\n * literal (`x={2}`, `x={\"2\"}`, `x=\"{2}\"`), the way Svelte icons write SVG\n * geometry. Svelte renders it as the literal's string, so it is as static\n * as `x=\"2\"`. Null, undefined and booleans are not: Svelte omits or\n * coerces those. `class`, `style` and event handlers have their own\n * readers and are never read here.\n */\nexport function literalMustacheAttribute(attribute: AST.Attribute): {\n value: string | number;\n rendered: string;\n expression: { start: number; end: number };\n quoted: boolean;\n} | null {\n const name = attribute.name.toLowerCase();\n if (name === \"class\" || name === \"style\" || name.startsWith(\"on\"))\n return null;\n const tag = Array.isArray(attribute.value)\n ? attribute.value.length === 1\n ? attribute.value[0]\n : undefined\n : attribute.value === true\n ? undefined\n : attribute.value;\n if (tag?.type !== \"ExpressionTag\") return null;\n const expression = tag.expression as unknown as {\n type: string;\n start: number;\n end: number;\n [key: string]: unknown;\n };\n const value = readLiteralExpression(expression);\n if (typeof value !== \"string\" && typeof value !== \"number\") return null;\n return {\n value,\n rendered: String(value),\n expression: { start: expression.start, end: expression.end },\n quoted: Array.isArray(attribute.value),\n };\n}\n\n/** The edit that writes `value` into a literal mustache attribute, in the\n * author's form: a number stays a number when the new value is one, and\n * any other value is a string literal. Null when the quoted form\n * (`x=\"{2}\"`) would need a quote inside its quotes. */\nexport function planLiteralMustacheUpdate(\n literal: NonNullable<ReturnType<typeof literalMustacheAttribute>>,\n value: string,\n): StringEdit | null {\n const numeric = Number(value);\n const replacement =\n typeof literal.value === \"number\" &&\n value.trim() !== \"\" &&\n Number.isFinite(numeric) &&\n String(numeric) === value\n ? value\n : literal.quoted\n ? null\n : JSON.stringify(value);\n if (replacement === null) return null;\n return {\n start: literal.expression.start,\n end: literal.expression.end,\n replacement,\n };\n}\n","import { cssPropertiesOverlap } from \"@modules/inline-style-value\";\nimport type { AST } from \"svelte/compiler\";\nimport type { StringEdit } from \"./types\";\nimport { escapeSvelteAttributeValue } from \"./escape\";\n\n/**\n * A `style:` directive sets one CSS property at runtime, and Svelte gives it\n * precedence over the static style attribute one property at a time\n * (`set_style`): a static declaration of any other property renders as\n * written. These helpers decide which properties a directive owns, and\n * rewrite a directive whose value is one quoted literal.\n */\n\n/** Shorthands the shared table leaves out whose longhands do not share\n * their name as a prefix. */\nconst EXTRA_COVERAGE: Readonly<Record<string, readonly string[]>> = {\n \"place-content\": [\"align-content\", \"justify-content\"],\n \"place-items\": [\"align-items\", \"justify-items\"],\n \"place-self\": [\"align-self\", \"justify-self\"],\n \"grid-area\": [\n \"grid-row-start\",\n \"grid-row-end\",\n \"grid-column-start\",\n \"grid-column-end\",\n ],\n};\n\nfunction normalizeProperty(property: string): string {\n const trimmed = property.trim();\n return trimmed.startsWith(\"--\") ? trimmed : trimmed.toLowerCase();\n}\n\n/**\n * Whether a directive named `directive` can set `property` at runtime: the\n * same property, two properties the shared shorthand table relates, or a\n * property named after the other (`grid-template` and\n * `grid-template-columns`), which also covers shorthands the table does not\n * list. A custom property overlaps only itself.\n */\nexport function styleDirectiveOverlaps(\n directive: string,\n property: string,\n): boolean {\n const left = normalizeProperty(directive);\n const right = normalizeProperty(property);\n if (left === right) return true;\n if (left.startsWith(\"--\") || right.startsWith(\"--\")) return false;\n if (left === \"all\" || right === \"all\") return true;\n if (left.startsWith(`${right}-`) || right.startsWith(`${left}-`)) return true;\n if (\n EXTRA_COVERAGE[left]?.includes(right) ||\n EXTRA_COVERAGE[right]?.includes(left)\n )\n return true;\n return cssPropertiesOverlap(left, right);\n}\n\n/** The element's style directives. */\nexport function styleDirectives(\n attributes: readonly { type: string }[],\n): AST.StyleDirective[] {\n return attributes.filter(\n (attribute) => attribute.type === \"StyleDirective\",\n ) as AST.StyleDirective[];\n}\n\n/** A directive whose value is one quoted text chunk with no modifier, its\n * name written once on the element: its decoded value and where the quoted\n * text sits. Null for any other directive. */\nexport function literalStyleDirective(\n source: string,\n directive: AST.StyleDirective,\n siblings: readonly AST.StyleDirective[],\n): { value: string; start: number; end: number; quote: '\"' | \"'\" } | null {\n if (directive.modifiers.length > 0) return null;\n if (\n siblings.some(\n (other) =>\n other !== directive &&\n normalizeProperty(other.name) === normalizeProperty(directive.name),\n )\n )\n return null;\n const value = directive.value;\n if (!Array.isArray(value) || value.length !== 1) return null;\n const text = value[0]!;\n if (text.type !== \"Text\") return null;\n const quote = source[text.start - 1];\n if (\n (quote !== '\"' && quote !== \"'\") ||\n source[text.end] !== quote ||\n text.end + 1 !== directive.end\n )\n return null;\n return { value: text.data, start: text.start, end: text.end, quote };\n}\n\n/**\n * The edits that write `styles` into the element's literal directives of\n * the same property (a null value removes the directive with the\n * whitespace before it), and the styles left for the static attribute.\n * Null when a property left over is one a directive owns: a static\n * declaration of it would never render. `owned` is a directive the caller\n * rewrites itself. `cleared` names each property whose directive a removal\n * deletes: a static declaration of it, hidden while the directive stood,\n * renders once it is gone, so the caller clears that too.\n */\nexport function planStyleDirectives(\n source: string,\n attributes: readonly { type: string }[],\n styles: Readonly<Record<string, string | null>>,\n owned?: string,\n):\n | {\n kind: \"ok\";\n edits: StringEdit[];\n remaining: Record<string, string | null>;\n cleared: string[];\n }\n | { kind: \"conflict\"; directive: string; property: string } {\n const directives = styleDirectives(attributes).filter(\n (directive) => directive.name !== owned,\n );\n const edits: StringEdit[] = [];\n const remaining: Record<string, string | null> = {};\n const cleared: string[] = [];\n for (const [property, value] of Object.entries(styles)) {\n const own = directives.find(\n (directive) =>\n normalizeProperty(directive.name) === normalizeProperty(property),\n );\n const literal =\n owned === undefined && own\n ? literalStyleDirective(source, own, directives)\n : null;\n // Another directive that sets the property too leaves which one renders\n // to Svelte's order of application.\n const conflict = directives.find(\n (directive) =>\n !(literal && directive === own) &&\n styleDirectiveOverlaps(directive.name, property),\n );\n if (conflict)\n return { kind: \"conflict\", directive: conflict.name, property };\n if (!own || !literal) {\n remaining[property] = value;\n continue;\n }\n let start = own.start;\n while (start > 0 && /\\s/.test(source[start - 1]!)) start -= 1;\n if (value === null) cleared.push(property);\n edits.push(\n value === null\n ? { start, end: own.end, replacement: \"\" }\n : {\n start: literal.start,\n end: literal.end,\n replacement: escapeSvelteAttributeValue(value, literal.quote),\n },\n );\n }\n return { kind: \"ok\", edits, remaining, cleared };\n}\n","import { walk } from \"estree-walker\";\nimport type { AST } from \"svelte/compiler\";\nimport { compile, parse } from \"#svelte-compiler\";\nimport { literalMustacheAttribute } from \"./literal-attributes\";\nimport { literalStyleDirective, styleDirectives } from \"./style-directives\";\nimport type {\n SvelteElementInfo,\n SvelteParseResult,\n SvelteTargetInfo,\n} from \"./types\";\n\ninterface InternalElementInfo extends SvelteElementInfo {\n node: AST.RegularElement;\n parentFragment: AST.Fragment;\n /** Owner of the exact Fragment that directly contains this element. */\n parentFragmentOwnerType: string | null;\n containsDynamicTemplateSyntax: boolean;\n}\n\nexport type InternalParseResult =\n | {\n kind: \"ok\";\n elements: ReadonlyMap<number, InternalElementInfo>;\n /** Component invocations (`Component` nodes) as move subjects, read\n * like elements; `<svelte:component>` is not one. */\n invocations: ReadonlyMap<number, InternalElementInfo>;\n /** Native DOM wrappers and plain component slots preserve this scope; blocks, `let:` slots and local declarations do not. */\n templateScopes: WeakMap<AST.Fragment, AST.Fragment>;\n targets: ReadonlyMap<number, SvelteTargetInfo>;\n targetNodes: ReadonlyMap<\n number,\n AST.BaseNode & { name?: string; attributes?: AST.AttributeLike[] }\n >;\n }\n | Extract<SvelteParseResult, { kind: \"invalid\" }>;\n\nexport function parseSvelteSource(\n source: string,\n filename = \"Component.svelte\",\n): SvelteParseResult {\n const result = parseSvelteSourceInternal(source, filename);\n if (result.kind === \"invalid\") return result;\n\n return toPublicParseResult(result);\n}\n\nfunction toPublicParseResult(\n result: Extract<InternalParseResult, { kind: \"ok\" }>,\n): Extract<SvelteParseResult, { kind: \"ok\" }> {\n return {\n kind: \"ok\",\n elements: new Map(\n [...result.elements].map(([offset, element]) => [\n offset,\n toPublicElementInfo(element),\n ]),\n ),\n targets: new Map(result.targets),\n };\n}\n\nexport function findSvelteElementAtOffset(\n parsed: SvelteParseResult,\n offset: number,\n): SvelteElementInfo | null {\n if (parsed.kind !== \"ok\" || !Number.isInteger(offset)) return null;\n return parsed.elements.get(offset) ?? null;\n}\n\nexport function parseSvelteSourceInternal(\n source: string,\n filename: string,\n validation: \"compiler\" | \"syntax\" = \"compiler\",\n): InternalParseResult {\n const cacheKey = `${validation}\\0${filename}\\0${source}`;\n const cached = parseCache.get(cacheKey);\n if (cached) {\n parseCache.delete(cacheKey);\n parseCache.set(cacheKey, cached);\n return cached;\n }\n try {\n // `parse` intentionally accepts some compiler-invalid semantic forms.\n // Establish compiler validity before exposing offsets as editable anchors.\n if (validation === \"compiler\") {\n compile(source, { filename, generate: false });\n }\n const ast = parse(source, { filename, modern: true });\n const elements = new Map<number, InternalElementInfo>();\n const invocations = new Map<number, InternalElementInfo>();\n const targets = new Map<number, SvelteTargetInfo>();\n const targetNodes = new Map<\n number,\n AST.BaseNode & { name?: string; attributes?: AST.AttributeLike[] }\n >();\n const elementStack: AST.RegularElement[] = [];\n const fragmentOwnerTypes = new WeakMap<object, string | null>();\n const templateScopes = new WeakMap<AST.Fragment, AST.Fragment>();\n const scopeStack: AST.Fragment[] = [];\n\n walk(ast as unknown as Parameters<typeof walk>[0], {\n enter(node, parent) {\n const svelteNode = node as unknown as AST.BaseNode;\n if (svelteNode.type === \"Fragment\") {\n const fragment = node as unknown as AST.Fragment;\n const owner = parent as unknown as AST.BaseNode | null;\n // A DOM wrapper adds no names, and neither does a component's\n // default slot unless it binds `let:` slot props: the content is\n // a closure over this file's scope.\n const inherits =\n (owner?.type === \"RegularElement\" ||\n owner?.type === \"Component\" ||\n owner?.type === \"SvelteComponent\") &&\n !(owner as AST.RegularElement).attributes.some(\n (attribute) => attribute.type === \"LetDirective\",\n ) &&\n !fragment.nodes.some(\n (child) =>\n child.type === \"ConstTag\" || child.type === \"SnippetBlock\",\n );\n const scope = inherits\n ? (scopeStack[scopeStack.length - 1] ?? fragment)\n : fragment;\n templateScopes.set(fragment, scope);\n scopeStack.push(scope);\n fragmentOwnerTypes.set(\n node as object,\n (parent as unknown as AST.BaseNode | null)?.type ?? null,\n );\n }\n const target = toTargetInfo(\n source,\n node as unknown as AST.BaseNode & {\n name?: string;\n },\n );\n if (target) {\n const fragment = parent as unknown as AST.BaseNode | null;\n target.parentFragmentOwnerType =\n fragment?.type === \"Fragment\"\n ? (fragmentOwnerTypes.get(fragment as object) ?? null)\n : null;\n targets.set(target.start, target);\n targetNodes.set(\n target.start,\n node as unknown as AST.BaseNode & {\n name?: string;\n attributes?: AST.AttributeLike[];\n },\n );\n }\n if (\n svelteNode.type !== \"RegularElement\" &&\n svelteNode.type !== \"Component\"\n )\n return;\n const element = node as unknown as AST.RegularElement;\n const parentFragment = parent as unknown as AST.Fragment;\n /* v8 ignore next 4 -- Svelte's modern AST schema parents every RegularElement with Fragment */\n if (parentFragment.type !== \"Fragment\") {\n throw new Error(\n `native element at offset ${element.start} has no exact template fragment parent`,\n );\n }\n const opening = locateOpeningTagEnd(source, element);\n /* v8 ignore next 3 -- a compiler-parsed RegularElement always has an authored opening terminator */\n if (opening.kind === \"invalid\") {\n throw new Error(opening.message);\n }\n const into = svelteNode.type === \"Component\" ? invocations : elements;\n /* v8 ignore next 4 -- modern AST source ranges cannot assign one start to two nodes */\n if (into.has(element.start)) {\n throw new Error(\n `multiple native elements start at UTF-16 offset ${element.start}`,\n );\n }\n into.set(element.start, {\n node: element,\n tagName: element.name,\n start: element.start,\n end: element.end,\n openingEnd: opening.openingEnd,\n selfClosing: opening.selfClosing,\n childrenStart: opening.selfClosing ? null : opening.openingEnd,\n childrenEnd: opening.selfClosing\n ? null\n : locateClosingTagStart(source, element, opening.openingEnd),\n parentElementStart:\n elementStack[elementStack.length - 1]?.start ?? null,\n parentFragment,\n parentFragmentOwnerType:\n fragmentOwnerTypes.get(parentFragment as object) ?? null,\n // An invocation runs another component's code with its props.\n containsDynamicTemplateSyntax:\n svelteNode.type === \"Component\" || containsDynamicSyntax(element),\n attributeNames: element.attributes\n .filter(\n (attribute): attribute is AST.Attribute =>\n attribute.type === \"Attribute\",\n )\n .map((attribute) => attribute.name),\n hasSpreadAttributes: element.attributes.some(\n (attribute) => attribute.type === \"SpreadAttribute\",\n ),\n directiveTypes: element.attributes\n .filter(\n (attribute) =>\n attribute.type !== \"Attribute\" &&\n attribute.type !== \"SpreadAttribute\",\n )\n .map((attribute) => attribute.type),\n });\n if (svelteNode.type === \"RegularElement\") elementStack.push(element);\n },\n leave(node) {\n const svelteNode = node as unknown as AST.BaseNode;\n if (svelteNode.type === \"RegularElement\") elementStack.pop();\n if (svelteNode.type === \"Fragment\") scopeStack.pop();\n },\n });\n\n const result = {\n kind: \"ok\",\n elements,\n invocations,\n templateScopes,\n targets,\n targetNodes,\n } as const;\n rememberParse(cacheKey, result);\n return result;\n } catch (error) {\n const result = compilerError(error);\n rememberParse(cacheKey, result);\n return result;\n }\n}\n\nfunction toTargetInfo(\n source: string,\n node: AST.BaseNode & {\n name?: string;\n attributes?: AST.AttributeLike[];\n },\n): SvelteTargetInfo | null {\n if (node.type === \"RegularElement\") {\n return {\n kind: \"native-element\",\n tagName: node.name ?? \"\",\n start: node.start,\n end: node.end,\n ...targetAttributeFacts(source, node.attributes ?? [], true),\n };\n }\n if (node.type === \"Component\") {\n return {\n kind: \"component\",\n tagName: node.name ?? \"\",\n start: node.start,\n end: node.end,\n ...targetAttributeFacts(source, node.attributes ?? []),\n };\n }\n if (node.type === \"SvelteComponent\") {\n return {\n kind: \"component\",\n tagName: node.name ?? node.type,\n start: node.start,\n end: node.end,\n ...targetAttributeFacts(source, node.attributes ?? []),\n };\n }\n if (node.type === \"SvelteElement\") {\n return {\n kind: \"dynamic-element\",\n tagName: node.name ?? node.type,\n start: node.start,\n end: node.end,\n ...targetAttributeFacts(source, node.attributes ?? []),\n };\n }\n if (\n node.type === \"SlotElement\" ||\n node.type === \"TitleElement\" ||\n node.type === \"SvelteBody\" ||\n node.type === \"SvelteBoundary\" ||\n node.type === \"SvelteDocument\" ||\n node.type === \"SvelteFragment\" ||\n node.type === \"SvelteHead\" ||\n node.type === \"SvelteSelf\" ||\n node.type === \"SvelteWindow\"\n ) {\n return {\n kind: \"special-element\",\n tagName: node.name ?? node.type,\n start: node.start,\n end: node.end,\n };\n }\n return null;\n}\n\nfunction targetAttributeFacts(\n source: string,\n attributes: readonly AST.AttributeLike[],\n native = false,\n): Pick<\n SvelteTargetInfo,\n | \"attributeNames\"\n | \"hasSpreadAttributes\"\n | \"directiveTypes\"\n | \"staticAttributes\"\n | \"styleDirectives\"\n> {\n const directives = styleDirectives(attributes);\n // A spread may override any attribute, so only an element without one\n // reads a literal mustache as its value (a component's is a typed prop).\n const literalMustaches =\n native &&\n !attributes.some((attribute) => attribute.type === \"SpreadAttribute\");\n const staticAttributes: Record<string, string | true> = {};\n for (const attribute of attributes) {\n if (attribute.type !== \"Attribute\") continue;\n const literal = literalMustaches\n ? literalMustacheAttribute(attribute)\n : null;\n if (literal) {\n staticAttributes[attribute.name] = literal.rendered;\n continue;\n }\n if (attribute.value === true) {\n staticAttributes[attribute.name] = true;\n continue;\n }\n if (\n Array.isArray(attribute.value) &&\n attribute.value.every((part) => part.type === \"Text\")\n ) {\n staticAttributes[attribute.name] = attribute.value\n .map((part) => (part as AST.Text).data)\n .join(\"\");\n }\n }\n return {\n attributeNames: attributes\n .filter(\n (attribute): attribute is AST.Attribute =>\n attribute.type === \"Attribute\",\n )\n .map((attribute) => attribute.name),\n hasSpreadAttributes: attributes.some(\n (attribute) => attribute.type === \"SpreadAttribute\",\n ),\n directiveTypes: attributes\n .filter(\n (attribute) =>\n attribute.type !== \"Attribute\" &&\n attribute.type !== \"SpreadAttribute\",\n )\n .map((attribute) => attribute.type),\n staticAttributes,\n styleDirectives: directives.map((directive) => {\n const literal = literalStyleDirective(source, directive, directives);\n return {\n name: directive.name,\n ...(literal ? { literal: literal.value } : {}),\n };\n }),\n };\n}\n\nconst PARSE_CACHE_LIMIT = 16;\nconst parseCache = new Map<string, InternalParseResult>();\n\nfunction rememberParse(key: string, result: InternalParseResult): void {\n parseCache.set(key, result);\n while (parseCache.size > PARSE_CACHE_LIMIT) {\n const oldest = parseCache.keys().next().value;\n if (oldest === undefined) break;\n parseCache.delete(oldest);\n }\n}\n\nexport function clearSvelteParseCacheForTests(): void {\n parseCache.clear();\n}\n\nfunction locateOpeningTagEnd(\n source: string,\n element: AST.RegularElement,\n):\n | { kind: \"ok\"; openingEnd: number; selfClosing: boolean }\n | { kind: \"invalid\"; message: string } {\n const lastAttribute = element.attributes[element.attributes.length - 1];\n const afterName = element.start + 1 + element.name.length;\n const cursor = lastAttribute?.end ?? afterName;\n const tail = source.slice(cursor, element.end);\n const closing = /^(\\s*)(\\/?)>/.exec(tail);\n /* v8 ignore next 6 -- invoked only for compiler-parsed RegularElements */\n if (!closing) {\n return {\n kind: \"invalid\",\n message: `could not locate the opening-tag terminator for <${element.name}> at UTF-16 offset ${element.start}`,\n };\n }\n return {\n kind: \"ok\",\n openingEnd: cursor + closing[0].length,\n selfClosing: closing[2] === \"/\",\n };\n}\n\nfunction locateClosingTagStart(\n source: string,\n element: AST.RegularElement,\n openingEnd: number,\n): number | null {\n const escapedName = element.name.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const match = new RegExp(`</${escapedName}\\\\s*>$`).exec(\n source.slice(openingEnd, element.end),\n );\n return match ? openingEnd + match.index : null;\n}\n\nfunction containsDynamicSyntax(element: AST.RegularElement): boolean {\n let dynamic = false;\n walk(element as unknown as Parameters<typeof walk>[0], {\n enter(node) {\n const type = (node as { type?: unknown }).type;\n if (\n type === \"ExpressionTag\" ||\n type === \"HtmlTag\" ||\n type === \"RenderTag\" ||\n type === \"AttachTag\" ||\n type === \"ConstTag\" ||\n type === \"DeclarationTag\" ||\n type === \"DebugTag\" ||\n type === \"SpreadAttribute\" ||\n (typeof type === \"string\" && type.endsWith(\"Directive\")) ||\n type === \"Component\" ||\n type === \"SvelteComponent\" ||\n type === \"SvelteElement\" ||\n type === \"EachBlock\" ||\n type === \"IfBlock\" ||\n type === \"AwaitBlock\" ||\n type === \"KeyBlock\" ||\n type === \"SnippetBlock\"\n ) {\n dynamic = true;\n this.skip();\n }\n },\n });\n return dynamic;\n}\n\nfunction compilerError(\n error: unknown,\n): Extract<SvelteParseResult, { kind: \"invalid\" }> {\n if (error && typeof error === \"object\") {\n const value = error as { code?: unknown; message?: unknown };\n return {\n kind: \"invalid\",\n code: typeof value.code === \"string\" ? value.code : \"invalid_svelte\",\n message:\n typeof value.message === \"string\"\n ? value.message\n : /* v8 ignore next -- Svelte compiler diagnostics always carry messages */\n \"Svelte source could not be parsed\",\n };\n }\n /* v8 ignore next 5 -- Svelte compiler and parser throw diagnostic objects */\n return {\n kind: \"invalid\",\n code: \"invalid_svelte\",\n message: String(error),\n };\n}\n\nfunction toPublicElementInfo(element: InternalElementInfo): SvelteElementInfo {\n return {\n tagName: element.tagName,\n start: element.start,\n end: element.end,\n openingEnd: element.openingEnd,\n selfClosing: element.selfClosing,\n childrenStart: element.childrenStart,\n childrenEnd: element.childrenEnd,\n parentElementStart: element.parentElementStart,\n attributeNames: element.attributeNames,\n hasSpreadAttributes: element.hasSpreadAttributes,\n directiveTypes: element.directiveTypes,\n };\n}\n","import { sourceVersionHash } from \"@modules/annotation/source-version\";\nimport MagicString, { type SourceMap } from \"magic-string\";\nimport type { AST, PreprocessorGroup } from \"svelte/compiler\";\nimport { compile } from \"#svelte-compiler\";\nimport {\n applyStringEdits,\n mapOffsetThroughStringEdits,\n} from \"@modules/template-edits\";\nimport { escapeSvelteAttributeValue } from \"./escape\";\nimport { parseSvelteSourceInternal } from \"./parse\";\nimport type { StringEdit } from \"./types\";\n\nconst TEMPO_ATTRIBUTE_NAMES = [\n \"data-tempo-filepath\",\n \"data-tempo-position\",\n \"data-tempo-modifiedts\",\n \"data-tempo-source-version\",\n] as const;\nconst TEMPO_ATTRIBUTE_NAME_SET = new Set<string>(TEMPO_ATTRIBUTE_NAMES);\nexport const TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE =\n \"data-tempo-svelte-source-registry\";\n\nexport interface TempoSvelteComponentSourceRecord {\n readonly kind: \"component\";\n readonly name: string;\n /** Svelte dev metadata uses one-based lines and zero-based columns. */\n readonly line: number;\n readonly column: number;\n /** Exact UTF-16 offset in the annotation-free authored source. */\n readonly position: number;\n readonly className?: string;\n readonly style?: string;\n /** Literal author metadata on a component invocation, even when the\n * component does not forward it to a DOM host. */\n readonly locked?: boolean;\n /** Attributes written as expressions (`class={x}`, `class=\"a {b}\"`),\n * space separated as the canvas names them (`class` is `className`),\n * directives in their own spelling (`class:on`, `bind:value`),\n * `@attach`, and `#slot` when the element is a block's child (`{#each}`,\n * `{#if}`); the Svelte form of the JSX `data-tempo-expr` stamp. Empty\n * when a spread is the only one, absent when there is none. */\n readonly expressions?: string;\n readonly supportsClassName: boolean;\n readonly supportsStyle: boolean;\n}\n\nexport interface TempoSvelteHostSourceRecord {\n readonly kind: \"host\";\n readonly name: string;\n readonly line: number;\n readonly column: number;\n readonly position: number;\n readonly className?: string;\n readonly style?: string;\n /** Attributes written as expressions (`class={x}`, `class=\"a {b}\"`),\n * space separated as the canvas names them (`class` is `className`),\n * directives in their own spelling (`class:on`, `bind:value`),\n * `@attach`, and `#slot` when the element is a block's child (`{#each}`,\n * `{#if}`); the Svelte form of the JSX `data-tempo-expr` stamp. Empty\n * when a spread is the only one, absent when there is none. */\n readonly expressions?: string;\n readonly supportsClassName: boolean;\n readonly supportsStyle: boolean;\n}\n\nexport interface TempoSvelteSourceRegistryRecord {\n readonly filename: string;\n readonly filepath: string;\n readonly modifiedTs: number;\n readonly sourceVersion: string;\n readonly components: readonly TempoSvelteComponentSourceRecord[];\n readonly hosts: readonly TempoSvelteHostSourceRecord[];\n}\n\nexport interface AnnotateSvelteSourceOptions {\n source: string;\n filename: string;\n filepath: string;\n modifiedTs: number;\n sourceVersion?: string;\n /** `syntax` is for a first-in-chain preprocessor whose later stages validate. */\n validation?: \"compiler\" | \"syntax\";\n}\n\nexport type AnnotateSvelteSourceResult =\n | {\n kind: \"ok\";\n code: string;\n map: SourceMap;\n /** Insertion offsets in the annotated input passed to this call. */\n edits: readonly StringEdit[];\n elementsAnnotated: number;\n /** Recovered base-source offsets after existing annotations are removed. */\n skippedExistingAnnotations: readonly number[];\n sourceVersion: string;\n }\n | {\n kind: \"refused\";\n code:\n | \"invalid_source\"\n | \"invalid_output\"\n | \"invalid_metadata\"\n | \"annotation_conflict\";\n message: string;\n };\n\n/** Pure Svelte source annotation transform with exact original UTF-16 anchors. */\nexport function annotateSvelteSource(\n options: AnnotateSvelteSourceOptions,\n): AnnotateSvelteSourceResult {\n if (\n !options.filepath ||\n !options.filename ||\n !Number.isFinite(options.modifiedTs) ||\n !Number.isInteger(options.modifiedTs) ||\n options.modifiedTs < 0 ||\n options.sourceVersion === \"\"\n ) {\n return {\n kind: \"refused\",\n code: \"invalid_metadata\",\n message:\n \"filename, filepath, a non-negative integer modifiedTs, and a non-empty sourceVersion are required\",\n };\n }\n const inputSource = removeGeneratedSourceRegistries(options.source);\n const validation = options.validation ?? \"compiler\";\n const parsed = parseSvelteSourceInternal(\n inputSource,\n options.filename,\n validation,\n );\n if (parsed.kind === \"invalid\") {\n return { kind: \"refused\", code: \"invalid_source\", message: parsed.message };\n }\n\n const removalEdits: StringEdit[] = [];\n const existing = new Map<\n number,\n {\n filepath: string;\n position: number;\n modifiedTs: number;\n sourceVersion: string;\n }\n >();\n for (const element of parsed.elements.values()) {\n const tempoAttributes = element.node.attributes.filter(\n (attribute): attribute is AST.Attribute =>\n attribute.type === \"Attribute\" &&\n TEMPO_ATTRIBUTE_NAME_SET.has(attribute.name),\n );\n if (tempoAttributes.length === 0) continue;\n const conflict = readExistingAnnotation(inputSource, element.node);\n if (conflict.kind === \"refused\") return conflict;\n existing.set(element.start, conflict.metadata);\n removalEdits.push(conflict.removalEdit);\n }\n\n const baseSource = applyStringEdits(inputSource, removalEdits);\n const baseParsed = parseSvelteSourceInternal(\n baseSource,\n options.filename,\n validation,\n );\n /* v8 ignore next 6 -- exact generated-annotation removal from parsed input cannot invalidate syntax */\n if (baseParsed.kind === \"invalid\") {\n return {\n kind: \"refused\",\n code: \"annotation_conflict\",\n message:\n \"removing existing Tempo annotations did not recover valid source\",\n };\n }\n const version = options.sourceVersion ?? sourceVersionHash(baseSource);\n for (const [currentOffset, metadata] of existing) {\n const baseOffset = mapOffsetThroughStringEdits(currentOffset, removalEdits);\n if (\n baseOffset === null ||\n !baseParsed.elements.has(baseOffset) ||\n metadata.filepath !== options.filepath ||\n metadata.position !== baseOffset ||\n metadata.modifiedTs !== options.modifiedTs ||\n metadata.sourceVersion !== version\n ) {\n return {\n kind: \"refused\",\n code: \"annotation_conflict\",\n message: `existing Tempo annotations at UTF-16 offset ${currentOffset} do not exactly match the recovered source identity`,\n };\n }\n }\n\n const edits: StringEdit[] = [];\n const skippedExistingAnnotations: number[] = [];\n for (const element of parsed.elements.values()) {\n const baseOffset = mapOffsetThroughStringEdits(element.start, removalEdits);\n /* v8 ignore next 6 -- validated non-overlapping annotation removals preserve opening anchors */\n if (baseOffset === null || !baseParsed.elements.has(baseOffset)) {\n return {\n kind: \"refused\",\n code: \"annotation_conflict\",\n message: `could not map element at UTF-16 offset ${element.start} to recovered source`,\n };\n }\n if (existing.has(element.start)) {\n skippedExistingAnnotations.push(baseOffset);\n continue;\n }\n const insertionOffset =\n element.node.attributes[element.node.attributes.length - 1]?.end ??\n element.start + 1 + element.tagName.length;\n edits.push({\n start: insertionOffset,\n end: insertionOffset,\n replacement: serializeAnnotations({\n filepath: options.filepath,\n position: baseOffset,\n modifiedTs: options.modifiedTs,\n sourceVersion: version,\n }),\n });\n }\n\n // A comment marks the start of this invocation's roots without affecting\n // element selectors. @html keeps it present even with preserveComments off.\n // It follows a byte-order mark, which Svelte drops only as the file's\n // first character.\n const markupStart = inputSource.charCodeAt(0) === 0xfeff ? 1 : 0;\n const startEdit: StringEdit = {\n start: markupStart,\n end: markupStart,\n replacement: `{@html '<!--${TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE}-->'}`,\n };\n const annotationEdits = [startEdit, ...edits];\n const annotatedCode = applyStringEdits(inputSource, annotationEdits);\n const sourceRecords = buildSourceRecords({\n source: inputSource,\n parsed,\n removalEdits,\n annotationEdits,\n annotatedCode,\n });\n const registry: TempoSvelteSourceRegistryRecord = {\n filename: options.filename,\n filepath: options.filepath,\n modifiedTs: options.modifiedTs,\n sourceVersion: version,\n components: sourceRecords.components,\n hosts: sourceRecords.hosts,\n };\n const registryEdit: StringEdit = {\n start: inputSource.length,\n end: inputSource.length,\n replacement: `\\n<template ${TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE}=\"${escapeSvelteAttributeValue(JSON.stringify(registry), '\"')}\"></template>\\n`,\n };\n const transformEdits = [...annotationEdits, registryEdit];\n const code = applyStringEdits(inputSource, transformEdits);\n try {\n if (validation === \"compiler\") {\n compile(code, { filename: options.filename, generate: false });\n } else {\n const parsedOutput = parseSvelteSourceInternal(\n code,\n options.filename,\n \"syntax\",\n );\n if (parsedOutput.kind === \"invalid\")\n throw new Error(parsedOutput.message);\n }\n /* v8 ignore next 6 -- static attributes inserted into compiler-validated RegularElements are syntax-preserving */\n } catch (error) {\n return {\n kind: \"refused\",\n code: \"invalid_output\",\n message: error instanceof Error ? error.message : String(error),\n };\n }\n\n const magic = new MagicString(inputSource);\n for (const edit of transformEdits) {\n magic.appendLeft(edit.start, edit.replacement);\n }\n /* v8 ignore next 6 -- both outputs consume the same insertion-only edit list */\n if (magic.toString() !== code) {\n return {\n kind: \"refused\",\n code: \"invalid_output\",\n message: \"annotation code and source-map transform outputs diverged\",\n };\n }\n return {\n kind: \"ok\",\n code,\n map: magic.generateMap({\n source: options.filename,\n includeContent: true,\n hires: true,\n }),\n edits,\n elementsAnnotated: edits.length,\n skippedExistingAnnotations,\n sourceVersion: version,\n };\n}\n\nfunction removeGeneratedSourceRegistries(source: string): string {\n const escaped = TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE.replace(\n /[.*+?^${}()|[\\]\\\\]/g,\n \"\\\\$&\",\n );\n return source\n .replace(`{@html '<!--${TEMPO_SVELTE_SOURCE_REGISTRY_ATTRIBUTE}-->'}`, \"\")\n .replace(\n new RegExp(\n `\\\\n?<template\\\\s+${escaped}=(?:\"[^\"]*\"|'[^']*')\\\\s*><\\\\/template>\\\\n?`,\n \"g\",\n ),\n \"\",\n );\n}\n\nfunction buildSourceRecords(options: {\n source: string;\n parsed: Extract<ReturnType<typeof parseSvelteSourceInternal>, { kind: \"ok\" }>;\n removalEdits: readonly StringEdit[];\n annotationEdits: readonly StringEdit[];\n annotatedCode: string;\n}): {\n components: TempoSvelteComponentSourceRecord[];\n hosts: TempoSvelteHostSourceRecord[];\n} {\n const components: TempoSvelteComponentSourceRecord[] = [];\n const hosts: TempoSvelteHostSourceRecord[] = [];\n for (const target of options.parsed.targets.values()) {\n if (\n target.kind !== \"component\" &&\n target.kind !== \"native-element\" &&\n target.kind !== \"dynamic-element\"\n ) {\n continue;\n }\n const position = mapOffsetThroughStringEdits(\n target.start,\n options.removalEdits,\n );\n if (position === null) continue;\n const compiledOffset = mapOffsetForward(\n target.start,\n options.annotationEdits,\n );\n const location = sourceLocationAt(options.annotatedCode, compiledOffset);\n const classValue = target.staticAttributes?.class;\n const styleValue = target.staticAttributes?.style;\n const lockValue = target.staticAttributes?.[\"data-tempo-locked\"];\n const hasSpread = target.hasSpreadAttributes === true;\n const directives = new Set(target.directiveTypes ?? []);\n const attributes = new Set(target.attributeNames ?? []);\n // A block child's own slot is dynamic, as a JSX `.map` root or\n // conditional branch is (`#slot`, user decision 2026-09-25: Svelte\n // follows the JSX rule). A written attribute with no literal value is\n // an expression.\n const blockChild = /Block$/.test(target.parentFragmentOwnerType ?? \"\");\n const node = options.parsed.targetNodes.get(target.start);\n // A directive or an attachment is written in the source and may show\n // nothing on the page (`class:on` while off): the canvas cannot learn\n // it from the DOM, so it is a fact here, in its own spelling.\n const directiveFacts = (node?.attributes ?? []).flatMap((attribute) => {\n if (\n attribute.type === \"Attribute\" ||\n attribute.type === \"SpreadAttribute\"\n )\n return [];\n // Svelte's AttributeLike type leaves out `{@attach}`, which the parser\n // still lists among the attributes.\n if ((attribute.type as string) === \"AttachTag\") return [\"@attach\"];\n const written = options.source.slice(attribute.start, attribute.end);\n return [written.split(\"=\")[0]!.trim()];\n });\n const expressions = [\n ...(blockChild ? [\"#slot\"] : []),\n ...[...attributes]\n .filter((name) => target.staticAttributes?.[name] === undefined)\n .map((name) => (name === \"class\" ? \"className\" : name)),\n ...directiveFacts,\n ].join(\" \");\n const common = {\n name: target.tagName,\n line: location.line,\n column: location.column,\n position,\n ...(typeof classValue === \"string\" ? { className: classValue } : {}),\n ...(typeof styleValue === \"string\" ? { style: styleValue } : {}),\n ...(lockValue === true || lockValue === \"true\" || lockValue === \"\"\n ? { locked: true }\n : lockValue === \"false\"\n ? { locked: false }\n : {}),\n // A spread gets a stamp even with no fact, as JSX's does.\n ...(expressions || hasSpread ? { expressions } : {}),\n supportsClassName:\n !hasSpread &&\n !directives.has(\"ClassDirective\") &&\n (!attributes.has(\"class\") || typeof classValue === \"string\"),\n supportsStyle:\n !hasSpread &&\n !directives.has(\"StyleDirective\") &&\n (!attributes.has(\"style\") || typeof styleValue === \"string\"),\n } as const;\n if (target.kind === \"component\") {\n components.push({ kind: \"component\", ...common });\n } else {\n hosts.push({ kind: \"host\", ...common });\n }\n }\n return { components, hosts };\n}\n\nfunction mapOffsetForward(\n offset: number,\n edits: readonly StringEdit[],\n): number {\n let mapped = offset;\n for (const edit of edits) {\n if (edit.start > offset) continue;\n mapped += edit.replacement.length - (edit.end - edit.start);\n }\n return mapped;\n}\n\nfunction sourceLocationAt(\n source: string,\n offset: number,\n): { line: number; column: number } {\n const before = source.slice(0, offset);\n const lines = before.split(\"\\n\");\n return {\n line: lines.length,\n column: lines[lines.length - 1]?.length ?? 0,\n };\n}\n\nexport interface CreateSvelteAnnotationPreprocessorOptions {\n metadata(input: { filename: string | undefined; source: string }): {\n filepath: string;\n modifiedTs: number;\n sourceVersion?: string;\n } | null;\n}\n\n/**\n * Create a Svelte markup preprocessor for raw-source annotations. It must be\n * first in the caller's preprocessor array so stored offsets identify the\n * authored file rather than another preprocessor's generated source.\n */\nexport function createSvelteAnnotationPreprocessor(\n options: CreateSvelteAnnotationPreprocessorOptions,\n): PreprocessorGroup {\n return {\n name: \"svelte-source-annotation\",\n markup: ({ content, filename }) => {\n const metadata = options.metadata({ filename, source: content });\n if (metadata === null) return undefined;\n const result = annotateSvelteSource({\n source: content,\n filename: filename ?? metadata.filepath,\n ...metadata,\n validation: \"syntax\",\n });\n if (result.kind === \"refused\") {\n throw new Error(`${result.code}: ${result.message}`);\n }\n return { code: result.code, map: result.map };\n },\n };\n}\n\ntype ExistingAnnotationRead =\n | {\n kind: \"ok\";\n metadata: {\n filepath: string;\n position: number;\n modifiedTs: number;\n sourceVersion: string;\n };\n removalEdit: StringEdit;\n }\n | Extract<AnnotateSvelteSourceResult, { kind: \"refused\" }>;\n\nfunction readExistingAnnotation(\n source: string,\n element: AST.RegularElement,\n): ExistingAnnotationRead {\n const attributes = element.attributes.filter(\n (attribute): attribute is AST.Attribute => attribute.type === \"Attribute\",\n );\n const tempo = attributes.filter((attribute) =>\n TEMPO_ATTRIBUTE_NAME_SET.has(attribute.name),\n );\n const names = tempo.map((attribute) => attribute.name);\n if (\n tempo.length !== TEMPO_ATTRIBUTE_NAMES.length ||\n TEMPO_ATTRIBUTE_NAMES.some((name, index) => names[index] !== name) ||\n attributes\n .slice(-TEMPO_ATTRIBUTE_NAMES.length)\n .some((attribute, index) => attribute !== tempo[index]) ||\n tempo.some((attribute) => !isStaticLiteralAttribute(attribute))\n ) {\n return annotationConflict(element.start);\n }\n const [\n filepathAttribute,\n positionAttribute,\n modifiedAttribute,\n versionAttribute,\n ] = tempo;\n /* v8 ignore next 7 -- the length and ordered-name checks above prove all tuple members exist */\n if (\n !filepathAttribute ||\n !positionAttribute ||\n !modifiedAttribute ||\n !versionAttribute\n ) {\n return annotationConflict(element.start);\n }\n const filepath = staticLiteralAttributeValue(filepathAttribute);\n const positionText = staticLiteralAttributeValue(positionAttribute);\n const modifiedText = staticLiteralAttributeValue(modifiedAttribute);\n const sourceVersion = staticLiteralAttributeValue(versionAttribute);\n const position = Number(positionText);\n const modifiedTs = Number(modifiedText);\n const first = tempo[0];\n const last = tempo[tempo.length - 1];\n if (\n !first ||\n !last ||\n source[first.start - 1] !== \" \" ||\n !Number.isSafeInteger(position) ||\n position < 0 ||\n !Number.isSafeInteger(modifiedTs) ||\n modifiedTs < 0 ||\n !filepath ||\n !sourceVersion\n ) {\n return annotationConflict(element.start);\n }\n const expected = serializeAnnotations({\n filepath,\n position,\n modifiedTs,\n sourceVersion,\n }).slice(1);\n if (source.slice(first.start, last.end) !== expected) {\n return annotationConflict(element.start);\n }\n return {\n kind: \"ok\",\n metadata: { filepath, position, modifiedTs, sourceVersion },\n removalEdit: {\n start: first.start - 1,\n end: last.end,\n replacement: \"\",\n },\n };\n}\n\nfunction annotationConflict(\n offset: number,\n): Extract<AnnotateSvelteSourceResult, { kind: \"refused\" }> {\n return {\n kind: \"refused\",\n code: \"annotation_conflict\",\n message: `element at UTF-16 offset ${offset} has partial, dynamic, reordered, or conflicting Tempo annotations`,\n };\n}\n\nfunction isStaticLiteralAttribute(attribute: AST.Attribute): boolean {\n return (\n Array.isArray(attribute.value) &&\n attribute.value.every((part) => part.type === \"Text\")\n );\n}\n\nfunction staticLiteralAttributeValue(attribute: AST.Attribute): string {\n /* v8 ignore next -- callers first prove the attribute is a static Text array */\n return Array.isArray(attribute.value)\n ? attribute.value\n .map((part) => (part.type === \"Text\" ? part.data : \"\"))\n .join(\"\")\n : \"\";\n}\n\nfunction serializeAnnotations(metadata: {\n filepath: string;\n position: number;\n modifiedTs: number;\n sourceVersion: string;\n}): string {\n const values = {\n \"data-tempo-filepath\": metadata.filepath,\n \"data-tempo-position\": String(metadata.position),\n \"data-tempo-modifiedts\": String(metadata.modifiedTs),\n \"data-tempo-source-version\": metadata.sourceVersion,\n };\n return Object.entries(values)\n .map(\n ([name, value]) => ` ${name}=\"${escapeSvelteAttributeValue(value, '\"')}\"`,\n )\n .join(\"\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,SAAS,oBAAoB;AAC7B,SAAS,eAAe;;;ACFxB,YAAY,oBAAoB;;;ACCzB,SAAS,qBAAqB,QAAwB;AAC3D,SAAO,OAAO,WAAW,CAAC,MAAM,QAAS,IAAI,OAAO,MAAM,CAAC,CAAC,KAAK;AACnE;;;ADAO,IAAMA,WAAyC,CAAC,QAAQ,YAC9C,uBAAQ,qBAAqB,MAAM,GAAG,OAAO;AAGvD,IAAMC,UAAS,CACpB,QACA,YAEe;AAAA,EACb,qBAAqB,MAAM;AAAA,EAC3B;AACF;;;AErBK,SAAS,2BACd,OACA,OACQ;AACR,MAAI,UAAU,MACX,MAAM,GAAG,EACT,KAAK,OAAO,EACZ,MAAM,GAAG,EACT,KAAK,MAAM,EACX,MAAM,GAAG,EACT,KAAK,MAAM,EACX,MAAM,GAAG,EACT,KAAK,QAAQ,EACb,MAAM,GAAG,EACT,KAAK,QAAQ;AAChB,YACE,UAAU,MACN,QAAQ,MAAM,GAAG,EAAE,KAAK,QAAQ,IAChC,QAAQ,MAAM,GAAG,EAAE,KAAK,OAAO;AACrC,SAAO;AACT;;;ACXO,IAAM,aAAN,MAAiB;AAAA,EACvB,cAAc;AAEb,SAAK,cAAc;AAGnB,SAAK,gBAAgB;AAGrB,SAAK,cAAc;AAGnB,SAAK,UAAU;AAAA,MACd,MAAM,MAAO,KAAK,cAAc;AAAA,MAChC,QAAQ,MAAO,KAAK,gBAAgB;AAAA,MACpC,SAAS,CAAC,SAAU,KAAK,cAAc;AAAA,IACxC;AAAA,EACD;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U,QAAS,QAAO;AAC3C,UAAI,cAAc,KAAK,OAAO,IAAI,EAAG,QAAO;AAC5C,aAAO;AAAA,QACL,GAAG;AAAA,QACH,MAAM,GAAG,OAAO,IAAI;AAAA;AAAA;AAAA,MACtB;AAAA,IACF;AAAA;AAAA;AAAA;AAAA,IAIA,OAAO,EAAE,SAAS,YAAY,SAAS,GAAG;AACxC,YAAM,eACJ,WAAW,WAAW,QAAQ,WAAW,YAAY;AACvD,UAAI,CAAC,aAAc,QAAO;AAC1B,YAAM,WAAW,SAAS,EAAE,SAAS,CAAC;AACtC,UAAI,CAAC,YAAY,CAAC,SAAU,QAAO;AACnC,YAAM,gBAAgB,kBAAkB,aAAa,UAAU,MAAM,CAAC;AACtE,aAAO;AAAA,QACL,MAAM;AAAA,UACJ;AAAA,UACA,SAAS;AAAA,UACT,SAAS;AAAA,UACT;AAAA,QACF;AAAA,MACF;AAAA,IACF;AAAA,EACF;AACF;","names":["compile","parse","compile","parse","compile"]}
|
package/dist/types-C8OIU-kc.d.ts
DELETED
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared data-model types for the asset system's static pipeline: the parser
|
|
3
|
-
* (`tempo-sdk/assets/parser`), the source editor (`tempo-sdk/assets/editor`),
|
|
4
|
-
* and downstream consumers (`@tempo-modules/asset-libraries` index + MCP
|
|
5
|
-
* tools). Everything here must stay JSON-serializable — parse results cross
|
|
6
|
-
* IPC and MCP boundaries verbatim.
|
|
7
|
-
*
|
|
8
|
-
* See specs/asset-libraries.md §3 for the full parsing contract.
|
|
9
|
-
*/
|
|
10
|
-
type AssetSourceSpan = {
|
|
11
|
-
start: number;
|
|
12
|
-
end: number;
|
|
13
|
-
};
|
|
14
|
-
/** Stable machine-readable identifiers for every parse/edit problem. */
|
|
15
|
-
type AssetParseErrorCode = "misimported_define_asset" | "non_identifier_component" | "unknown_binding" | "imported_binding" | "non_top_level_binding" | "config_not_object_literal" | "invalid_call_arguments" | "duplicate_declaration" | "non_top_level_call" | "unparseable_source" | "invalid_control" | "invalid_variant_config" | "component_declaration_outside_canvas" | "duplicate_asset_declaration" | "missing_canvas_pointer" | "stale_canvas_pointer" | "canvas_pointer_unverified" | "redundant_canvas_declaration" | "non_literal_library" | "empty_library_name" | "duplicate_library" | "empty_variants" | "variants_on_canvas" | "unresolved_prop_value" | "not_exported";
|
|
16
|
-
type AssetParseError = {
|
|
17
|
-
code: AssetParseErrorCode;
|
|
18
|
-
message: string;
|
|
19
|
-
/** "structural": the declaration is excluded from the index — readers must
|
|
20
|
-
* fail closed. "degraded": the declaration is indexed; this is a warning
|
|
21
|
-
* carried on the entry. "info": advisory note carried on the entry —
|
|
22
|
-
* best-effort validation that could not run to a verdict; never a
|
|
23
|
-
* failure. Mirrors CanvasParseError's severity split. */
|
|
24
|
-
severity: "structural" | "degraded" | "info";
|
|
25
|
-
span?: AssetSourceSpan;
|
|
26
|
-
};
|
|
27
|
-
/**
|
|
28
|
-
* A config value the parser could not resolve statically (identifier
|
|
29
|
-
* reference, call result, JSX, spread, …). The `$unresolved` shape is the
|
|
30
|
-
* wire format everywhere (index, IPC, MCP) — no translation layers.
|
|
31
|
-
* A user literally writing `{ $unresolved: true }` as a prop value is
|
|
32
|
-
* indistinguishable from this marker; that collision is accepted.
|
|
33
|
-
*/
|
|
34
|
-
type UnresolvedValue = {
|
|
35
|
-
$unresolved: true;
|
|
36
|
-
};
|
|
37
|
-
declare const UNRESOLVED_VALUE: UnresolvedValue;
|
|
38
|
-
declare function isUnresolvedValue(value: unknown): value is UnresolvedValue;
|
|
39
|
-
/** Statically-readable config value: JSON literals plus the UNRESOLVED marker. */
|
|
40
|
-
type StaticValue = string | number | boolean | null | UnresolvedValue | StaticValue[] | {
|
|
41
|
-
[key: string]: StaticValue;
|
|
42
|
-
};
|
|
43
|
-
type ParsedAssetVariant = {
|
|
44
|
-
name: string;
|
|
45
|
-
/** Statically validated JSX template. Never evaluated as a function during insertion. */
|
|
46
|
-
render?: {
|
|
47
|
-
jsx: StaticValue;
|
|
48
|
-
};
|
|
49
|
-
/** One dynamic value does not discard the variant — it parses to UNRESOLVED. */
|
|
50
|
-
props: Record<string, StaticValue>;
|
|
51
|
-
hasUnresolvedValues: boolean;
|
|
52
|
-
};
|
|
53
|
-
type AssetExportKind = "named" | "default" | "none";
|
|
54
|
-
/** Source spans that power the surgical editor (specs/asset-libraries.md §4). */
|
|
55
|
-
type AssetSpans = {
|
|
56
|
-
/** The whole `defineAsset(...)` expression statement, semicolon included. */
|
|
57
|
-
call: AssetSourceSpan;
|
|
58
|
-
/** The config ObjectExpression (second argument). */
|
|
59
|
-
config: AssetSourceSpan;
|
|
60
|
-
/** The `libraries` array expression, only when the value is an array
|
|
61
|
-
* literal. A `librariesProperty` without `libraries` means the property
|
|
62
|
-
* exists but its value is dynamic — the editor must refuse to touch it. */
|
|
63
|
-
libraries?: AssetSourceSpan;
|
|
64
|
-
/** The whole `libraries: <value>` property, whenever the key is present.
|
|
65
|
-
* Lets the editor remove the property outright when its array empties. */
|
|
66
|
-
librariesProperty?: AssetSourceSpan;
|
|
67
|
-
/** One span per statically-known `libraries` entry, in source order,
|
|
68
|
-
* index-aligned with ParsedAssetDeclaration.libraries. */
|
|
69
|
-
libraryItems: AssetSourceSpan[];
|
|
70
|
-
};
|
|
71
|
-
/** Reference-declaration target: defineAsset's first argument is an imported
|
|
72
|
-
* binding, and the asset's identity is the import itself. Purely syntactic —
|
|
73
|
-
* the parser records the import statement's module specifier plus the name
|
|
74
|
-
* imported from it ("default" for default imports); resolution to a
|
|
75
|
-
* workspace identity happens in @tempo-modules/asset-libraries. */
|
|
76
|
-
type ParsedAssetReference = {
|
|
77
|
-
importSpecifier: string;
|
|
78
|
-
importedName: string;
|
|
79
|
-
};
|
|
80
|
-
type ParsedAssetDeclaration = {
|
|
81
|
-
/** The identifier passed as defineAsset's first argument. */
|
|
82
|
-
bindingName: string;
|
|
83
|
-
exportKind: AssetExportKind;
|
|
84
|
-
/** Deduplicated, statically-known entries only. */
|
|
85
|
-
libraries: string[];
|
|
86
|
-
/** What this asset is and when to reach for it (and when not). */
|
|
87
|
-
usageInstructions?: string;
|
|
88
|
-
variants: ParsedAssetVariant[];
|
|
89
|
-
/** Present iff the declaration targets an imported binding. */
|
|
90
|
-
reference?: ParsedAssetReference;
|
|
91
|
-
spans: AssetSpans;
|
|
92
|
-
/** Degraded-severity notes scoped to this declaration. */
|
|
93
|
-
warnings: AssetParseError[];
|
|
94
|
-
};
|
|
95
|
-
type ParsedAssetFile = {
|
|
96
|
-
filePath: string;
|
|
97
|
-
/** Declarations whose identity parsed cleanly (may carry warnings). */
|
|
98
|
-
declarations: ParsedAssetDeclaration[];
|
|
99
|
-
/** Structural errors: file-level problems and rejected declarations. */
|
|
100
|
-
errors: AssetParseError[];
|
|
101
|
-
};
|
|
102
|
-
/** Typed failures shared by the editor operations (§4.1) and the MCP write
|
|
103
|
-
* tools that surface them (§7.3). */
|
|
104
|
-
type AssetEditFailureCode = "asset_not_found" | "config_not_editable" | "export_not_found" | "already_defined" | "not_definable";
|
|
105
|
-
|
|
106
|
-
export { type AssetEditFailureCode as A, type ParsedAssetReference as P, type StaticValue as S, UNRESOLVED_VALUE as U, type AssetSourceSpan as a, type AssetExportKind as b, type AssetParseError as c, type ParsedAssetFile as d, type AssetParseErrorCode as e, type AssetSpans as f, type ParsedAssetDeclaration as g, type ParsedAssetVariant as h, type UnresolvedValue as i, isUnresolvedValue as j };
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @deprecated V1 client compat.
|
|
3
|
-
*
|
|
4
|
-
* Everything a released V1 Tempo client (app 0.0.114, driving tempo-sdk
|
|
5
|
-
* 0.0.51 behavior) still expects from this host and that V2 no longer does.
|
|
6
|
-
* A workspace's installed tempo-sdk follows registry `latest` independently
|
|
7
|
-
* of the desktop app's update cadence, so a V1 client keeps loading hosts
|
|
8
|
-
* built from this SDK until the force-upgrade floor ages it out.
|
|
9
|
-
*
|
|
10
|
-
* Every call site gates on `isV1CanvasClient()`, so a V2 client runs today's
|
|
11
|
-
* code paths untouched. Delete this file once no protocol-1 client is
|
|
12
|
-
* supported; the compiler then lists every call site to remove.
|
|
13
|
-
*/
|
|
14
|
-
|
|
15
|
-
/** The layout spelling a V1 client still writes and type-checks
|
|
16
|
-
* (`tsc --noEmit` over canvases against `TempoStoryboard`). */
|
|
17
|
-
type V1LayoutCompat = {
|
|
18
|
-
/** @deprecated A legacy responsive marker: the width and height beside it
|
|
19
|
-
* are first-paint hints, not a frame. V2 reads the triple as responsive. */
|
|
20
|
-
intrinsicSizing?: "root-element";
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type { V1LayoutCompat as V };
|