tempo-sdk 0.0.45 → 0.0.52
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/dist/assets/editor.d.ts +1 -1
- package/dist/assets/editor.js +4 -2
- package/dist/assets/editor.js.map +1 -1
- package/dist/assets/index.d.ts +112 -24
- package/dist/assets/index.js +309 -1
- package/dist/assets/index.js.map +1 -1
- package/dist/assets/parser.d.ts +21 -4
- package/dist/assets/parser.js +7 -3
- package/dist/canvas/index.d.ts +6 -6
- package/dist/canvas/index.js +3 -2
- package/dist/canvas/index.js.map +1 -1
- package/dist/canvas/interact-projection.js +2 -1
- package/dist/canvas/svelte.d.ts +3 -4
- package/dist/canvas/svelte.js +1 -1
- package/dist/{chunk-7AJVPFFG.js → chunk-7Y7XNHUM.js} +3 -3
- package/dist/{chunk-7AJVPFFG.js.map → chunk-7Y7XNHUM.js.map} +1 -1
- package/dist/chunk-DI2ZFAWL.js +14 -0
- package/dist/chunk-DI2ZFAWL.js.map +1 -0
- package/dist/chunk-DX6XAXCK.js +827 -0
- package/dist/chunk-DX6XAXCK.js.map +1 -0
- package/dist/{chunk-7O6DPEMF.js → chunk-PULSTDX2.js} +9 -3
- package/dist/chunk-PULSTDX2.js.map +1 -0
- package/dist/{chunk-IWULHYPW.js → chunk-XLEKCOB7.js} +219 -21
- package/dist/chunk-XLEKCOB7.js.map +1 -0
- package/dist/{chunk-FIIU52RN.js → chunk-ZZYNOX24.js} +22 -810
- package/dist/chunk-ZZYNOX24.js.map +1 -0
- package/dist/index.js +86 -13
- package/dist/index.js.map +1 -1
- package/dist/nextjs/plugin.js +1 -1
- package/dist/nextjs.cjs +2 -2
- package/dist/nextjs.cjs.map +1 -1
- package/dist/nextjs.js +1 -1
- package/dist/{storyboard-xVaRTJAu.d.ts → storyboard-DbtzTPvI.d.ts} +8 -7
- package/dist/{types-B-dRoF2T.d.ts → types-C8OIU-kc.d.ts} +6 -2
- package/package.json +2 -2
- package/dist/chunk-7O6DPEMF.js.map +0 -1
- package/dist/chunk-FIIU52RN.js.map +0 -1
- package/dist/chunk-IWULHYPW.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../assets/parser.ts","../assets/types.ts"],"sourcesContent":["/**\n * Static parser for `defineAsset` declarations (specs/asset-libraries.md §3).\n *\n * Mirrors the construction of canvas/parser.ts: oxc-parser `parseSync`, an\n * import map that only trusts `defineAsset` imported from \"tempo-sdk/assets\"\n * (or a local path ending \"/tempo-sdk/assets\"), and a manual walk over\n * module-top-level statements. Never executes user code — the whole pipeline\n * is text → AST → data.\n *\n * Alongside `parseAssetFile`, this module exports the program-level analysis\n * helpers (`parseAssetProgram`, `readAssetImports`, `collectTopLevelScope`,\n * `hasTopLevelDefineAssetCallFor`, `collectIdentifierNames`) that the\n * colocated span-based editor (./editor.ts) shares, so import-trust rules and\n * binding resolution cannot drift between the two.\n */\nimport { parseSync } from \"oxc-parser\";\n\nimport {\n UNRESOLVED_VALUE,\n isUnresolvedValue,\n type AssetExportKind,\n type AssetParseError,\n type AssetSourceSpan,\n type AssetSpans,\n type ParsedAssetDeclaration,\n type ParsedAssetFile,\n type ParsedAssetReference,\n type ParsedAssetVariant,\n type StaticValue,\n} from \"./types\";\n\nexport * from \"./types\";\n\n/** The one module specifier `defineAsset` may be imported from. */\nexport const ASSET_SDK_IMPORT_SOURCE = \"tempo-sdk/assets\";\n\nexport function parseAssetFile(\n filePath: string,\n source: string,\n): ParsedAssetFile {\n const { program, errors } = parseAssetProgram(filePath, source);\n if (!program) {\n return { filePath, declarations: [], errors };\n }\n\n const imports = readAssetImports(program);\n for (const misimport of imports.misimports) {\n errors.push({\n code: \"misimported_define_asset\",\n severity: \"structural\",\n message: `defineAsset must be imported from \"${ASSET_SDK_IMPORT_SOURCE}\" — found import from \"${misimport.source}\"`,\n span: misimport.span,\n });\n }\n\n const scope = collectTopLevelScope(program);\n const declarations: ParsedAssetDeclaration[] = [];\n const declaredBindings = new Set<string>();\n const topLevelCalls = new Set<any>();\n\n for (const statement of program.body ?? []) {\n const call = readTopLevelTrustedCall(\n statement,\n imports.trustedDefineAssetNames,\n );\n if (!call) continue;\n topLevelCalls.add(call);\n const declaration = readAssetDeclaration({\n statement,\n call,\n scope,\n imports,\n program,\n source,\n errors,\n declaredBindings,\n });\n if (declaration) declarations.push(declaration);\n }\n\n // A trusted defineAsset call anywhere but a module-top-level statement\n // (inside a function, wrapped in another expression, …) has no stable\n // identity — report it rather than silently ignoring it (§3.4).\n walk(program, (node) => {\n if (\n node.type === \"CallExpression\" &&\n node.callee?.type === \"Identifier\" &&\n imports.trustedDefineAssetNames.has(node.callee.name) &&\n !topLevelCalls.has(node)\n ) {\n errors.push({\n code: \"non_top_level_call\",\n severity: \"structural\",\n message:\n \"defineAsset must be called as a top-level statement — in the file that defines the component, or in a canvas file that imports it\",\n span: toSourceSpan(node),\n });\n }\n });\n\n return { filePath, declarations, errors };\n}\n\n/**\n * Editor-support: parse and return the raw oxc program. A file with syntax\n * errors returns `program: null` plus structural `unparseable_source` errors\n * — a recovered AST has untrustworthy spans, so both parser and editor fail\n * closed on it.\n */\nexport function parseAssetProgram(\n filePath: string,\n source: string,\n): { program: any | null; errors: AssetParseError[] } {\n try {\n const result = parseSync(filePath, source) as any;\n const errors: AssetParseError[] = (result.errors ?? []).map(\n (error: any) => ({\n code: \"unparseable_source\" as const,\n severity: \"structural\" as const,\n message: error?.message ?? \"Unable to parse asset source\",\n span: toSourceSpan(error) ?? toSourceSpan(error?.labels?.[0]),\n }),\n );\n if (errors.length > 0) return { program: null, errors };\n return { program: result.program, errors: [] };\n } catch (error) {\n return {\n program: null,\n errors: [\n {\n code: \"unparseable_source\",\n severity: \"structural\",\n message:\n error instanceof Error\n ? error.message\n : \"Unable to parse asset source\",\n },\n ],\n };\n }\n}\n\n/** One comment's text (delimiters stripped) and source span. */\nexport type SourceComment = {\n value: string;\n span: AssetSourceSpan;\n};\n\n/**\n * Every comment (line and block) in a source file, for consumers that\n * validate documentation conventions (e.g. the asset index's canvas-pointer\n * check). Returns `null` when the file does not parse — comments recovered\n * from a broken AST are untrustworthy, so callers must treat the file as\n * uninspectable rather than comment-free.\n */\nexport function readSourceComments(\n filePath: string,\n source: string,\n): SourceComment[] | null {\n try {\n const result = parseSync(filePath, source) as any;\n if ((result.errors ?? []).length > 0) return null;\n return (result.comments ?? []).flatMap((comment: any) =>\n typeof comment?.value === \"string\"\n ? [\n {\n value: comment.value,\n span: toSourceSpan(comment) ?? { start: 0, end: 0 },\n },\n ]\n : [],\n );\n } catch {\n return null;\n }\n}\n\nexport type AssetImportInfo = {\n /** Local names bound to `defineAsset` imported from tempo-sdk/assets. */\n trustedDefineAssetNames: Set<string>;\n /** Every value-import local name → its module specifier. */\n importedBindings: Map<string, string>;\n /** Named/default value imports a reference declaration may target: local\n * name → specifier + imported name (\"default\" for default imports).\n * Namespace imports are excluded — they cannot name one component. */\n referenceableImports: Map<string, ParsedAssetReference>;\n /** Span of every import declaration, in source order (editor placement). */\n importDeclarationSpans: AssetSourceSpan[];\n /** `defineAsset` imports using a wrong tempo-sdk-family specifier. The span\n * covers the source string literal, quotes included. */\n misimports: { source: string; span: AssetSourceSpan }[];\n};\n\nexport function readAssetImports(program: any): AssetImportInfo {\n const info: AssetImportInfo = {\n trustedDefineAssetNames: new Set(),\n importedBindings: new Map(),\n referenceableImports: new Map(),\n importDeclarationSpans: [],\n misimports: [],\n };\n\n for (const statement of program?.body ?? []) {\n if (\n statement?.type !== \"ImportDeclaration\" ||\n typeof statement.source?.value !== \"string\"\n ) {\n continue;\n }\n const declarationSpan = toSourceSpan(statement);\n if (declarationSpan) info.importDeclarationSpans.push(declarationSpan);\n if (statement.importKind === \"type\") continue;\n\n const source = statement.source.value;\n const trusted = isTrustedAssetImportSource(source);\n\n for (const specifier of statement.specifiers ?? []) {\n if (specifier?.importKind === \"type\") continue;\n const localName = specifier?.local?.name;\n if (typeof localName !== \"string\") continue;\n info.importedBindings.set(localName, source);\n\n if (specifier.type === \"ImportDefaultSpecifier\") {\n info.referenceableImports.set(localName, {\n importSpecifier: source,\n importedName: \"default\",\n });\n continue;\n }\n if (specifier.type !== \"ImportSpecifier\") continue;\n const importedName =\n specifier.imported?.name ?? specifier.imported?.value ?? localName;\n info.referenceableImports.set(localName, {\n importSpecifier: source,\n importedName,\n });\n if (importedName !== \"defineAsset\") continue;\n\n if (trusted) {\n info.trustedDefineAssetNames.add(localName);\n } else if (isMisimportedAssetSdkSource(source)) {\n info.misimports.push({\n source,\n span: toSourceSpan(statement.source) ??\n declarationSpan ?? { start: 0, end: 0 },\n });\n }\n }\n }\n\n return info;\n}\n\nfunction isTrustedAssetImportSource(source: string): boolean {\n return (\n source === ASSET_SDK_IMPORT_SOURCE ||\n source.endsWith(`/${ASSET_SDK_IMPORT_SOURCE}`)\n );\n}\n\nfunction isMisimportedAssetSdkSource(source: string): boolean {\n return (\n (source === \"tempo-sdk\" || source.startsWith(\"tempo-sdk/\")) &&\n !isTrustedAssetImportSource(source)\n );\n}\n\nexport type AssetTopLevelBinding = {\n name: string;\n /** Whole top-level statement declaring the binding, export keyword\n * included — the editor inserts defineAsset statements after it. */\n statementSpan: AssetSourceSpan;\n exportKind: AssetExportKind;\n};\n\nexport type AssetTopLevelScope = {\n /** Plain top-level bindings defineAsset may target: function/class\n * declarations and initialized `const`/`let`/`var` declarators. */\n bindings: Map<string, AssetTopLevelBinding>;\n /** Top-level names bound only via destructuring patterns or uninitialized\n * declarators — they exist, but defineAsset cannot target them; kept so\n * error messages can say why. */\n nonSimpleNames: Set<string>;\n};\n\nexport function collectTopLevelScope(program: any): AssetTopLevelScope {\n const bindings = new Map<string, AssetTopLevelBinding>();\n const nonSimpleNames = new Set<string>();\n const namedExports = new Set<string>();\n const defaultExports = new Set<string>();\n\n const register = (\n declaration: any,\n statementSpan: AssetSourceSpan,\n exported: \"named\" | \"default\" | null,\n ) => {\n const markExported = (name: string) => {\n if (exported === \"named\") namedExports.add(name);\n if (exported === \"default\") defaultExports.add(name);\n };\n\n if (\n declaration?.type === \"FunctionDeclaration\" ||\n declaration?.type === \"ClassDeclaration\"\n ) {\n const name = declaration.id?.name;\n if (typeof name === \"string\") {\n bindings.set(name, { name, statementSpan, exportKind: \"none\" });\n markExported(name);\n }\n return;\n }\n\n if (declaration?.type === \"VariableDeclaration\") {\n for (const declarator of declaration.declarations ?? []) {\n if (declarator?.id?.type === \"Identifier\") {\n const name = declarator.id.name;\n if (declarator.init) {\n bindings.set(name, { name, statementSpan, exportKind: \"none\" });\n markExported(name);\n } else {\n nonSimpleNames.add(name);\n }\n } else {\n collectPatternNames(declarator?.id, nonSimpleNames);\n }\n }\n }\n };\n\n for (const statement of program?.body ?? []) {\n const statementSpan = toSourceSpan(statement) ?? { start: 0, end: 0 };\n\n if (statement?.type === \"ExportNamedDeclaration\") {\n if (statement.declaration) {\n register(statement.declaration, statementSpan, \"named\");\n }\n // `export { X } from \"./y\"` re-exports another module's binding, not a\n // local one — only sourceless specifier lists mark local bindings.\n if (!statement.source) {\n for (const specifier of statement.specifiers ?? []) {\n if (specifier?.type !== \"ExportSpecifier\") continue;\n const localName = specifier.local?.name;\n if (typeof localName !== \"string\") continue;\n const exportedName =\n specifier.exported?.name ?? specifier.exported?.value;\n (exportedName === \"default\" ? defaultExports : namedExports).add(\n localName,\n );\n }\n }\n continue;\n }\n\n if (statement?.type === \"ExportDefaultDeclaration\") {\n const declaration = statement.declaration;\n if (\n declaration?.type === \"FunctionDeclaration\" ||\n declaration?.type === \"ClassDeclaration\"\n ) {\n register(declaration, statementSpan, \"default\");\n } else {\n const expression = unwrapTsExpression(declaration);\n if (expression?.type === \"Identifier\") {\n defaultExports.add(expression.name);\n }\n }\n continue;\n }\n\n register(statement, statementSpan, null);\n }\n\n // A binding exported both ways reports \"default\" — the module's primary\n // export identity wins over the incidental named alias.\n for (const binding of bindings.values()) {\n binding.exportKind = defaultExports.has(binding.name)\n ? \"default\"\n : namedExports.has(binding.name)\n ? \"named\"\n : \"none\";\n }\n\n return { bindings, nonSimpleNames };\n}\n\nfunction collectPatternNames(pattern: any, names: Set<string>): void {\n if (!pattern || typeof pattern !== \"object\") return;\n if (pattern.type === \"Identifier\" && typeof pattern.name === \"string\") {\n names.add(pattern.name);\n return;\n }\n if (pattern.type === \"ObjectPattern\") {\n for (const property of pattern.properties ?? []) {\n collectPatternNames(property?.value ?? property?.argument, names);\n }\n return;\n }\n if (pattern.type === \"ArrayPattern\") {\n for (const element of pattern.elements ?? []) {\n collectPatternNames(element, names);\n }\n return;\n }\n if (pattern.type === \"AssignmentPattern\") {\n collectPatternNames(pattern.left, names);\n return;\n }\n if (pattern.type === \"RestElement\") {\n collectPatternNames(pattern.argument, names);\n }\n}\n\n/**\n * Editor-support: true when any module-top-level trusted defineAsset call\n * targets `bindingName`, regardless of whether the call parses cleanly —\n * the editor must not insert a second declaration next to a broken one.\n */\nexport function hasTopLevelDefineAssetCallFor(\n program: any,\n trustedNames: Set<string>,\n bindingName: string,\n): boolean {\n for (const statement of program?.body ?? []) {\n const call = readTopLevelTrustedCall(statement, trustedNames);\n if (!call) continue;\n const componentArg = unwrapTsExpression(call.arguments?.[0]);\n if (\n componentArg?.type === \"Identifier\" &&\n componentArg.name === bindingName\n ) {\n return true;\n }\n }\n return false;\n}\n\n/** Editor-support: every Identifier/JSXIdentifier name appearing anywhere in\n * the program — used to deconflict generated binding names. */\nexport function collectIdentifierNames(program: any): Set<string> {\n const names = new Set<string>();\n walk(program, (node) => {\n if (\n (node.type === \"Identifier\" || node.type === \"JSXIdentifier\") &&\n typeof node.name === \"string\"\n ) {\n names.add(node.name);\n }\n });\n return names;\n}\n\nfunction readTopLevelTrustedCall(\n statement: any,\n trustedNames: Set<string>,\n): any | null {\n if (statement?.type !== \"ExpressionStatement\") return null;\n const expression = unwrapTsExpression(statement.expression);\n if (\n expression?.type === \"CallExpression\" &&\n expression.callee?.type === \"Identifier\" &&\n trustedNames.has(expression.callee.name)\n ) {\n return expression;\n }\n return null;\n}\n\nfunction readAssetDeclaration(input: {\n statement: any;\n call: any;\n scope: AssetTopLevelScope;\n imports: AssetImportInfo;\n program: any;\n source: string;\n errors: AssetParseError[];\n declaredBindings: Set<string>;\n}): ParsedAssetDeclaration | null {\n const { statement, call, scope, imports, program, source, errors } = input;\n const callSpan = statementSpanWithSemicolon(source, statement);\n const args = call.arguments ?? [];\n\n if (args.length !== 2) {\n errors.push({\n code: \"invalid_call_arguments\",\n severity: \"structural\",\n message: `defineAsset takes exactly two arguments (component, config) — found ${args.length}`,\n span: callSpan,\n });\n return null;\n }\n\n const componentArg = unwrapTsExpression(args[0]);\n if (componentArg?.type !== \"Identifier\") {\n errors.push({\n code: \"non_identifier_component\",\n severity: \"structural\",\n message:\n \"defineAsset's first argument must be an identifier naming a component defined in this file\",\n span: toSourceSpan(args[0]) ?? callSpan,\n });\n return null;\n }\n\n const bindingName = componentArg.name;\n const binding = scope.bindings.get(bindingName);\n // A named/default import target makes this a reference declaration: the\n // asset's identity is the import itself, resolved downstream where\n // workspace context exists (§2.7).\n const reference = binding\n ? undefined\n : imports.referenceableImports.get(bindingName);\n if (!binding && !reference) {\n errors.push(\n classifyMissingBinding(\n bindingName,\n scope,\n imports,\n program,\n toSourceSpan(componentArg) ?? callSpan,\n ),\n );\n return null;\n }\n\n const configArg = unwrapTsExpression(args[1]);\n if (configArg?.type !== \"ObjectExpression\") {\n errors.push({\n code: \"config_not_object_literal\",\n severity: \"structural\",\n message:\n \"defineAsset's config must be an inline object literal — the span-based editor needs literal spans to mutate\",\n span: toSourceSpan(args[1]) ?? callSpan,\n });\n return null;\n }\n\n if (input.declaredBindings.has(bindingName)) {\n errors.push({\n code: \"duplicate_declaration\",\n severity: \"structural\",\n message: `duplicate defineAsset call for \"${bindingName}\" — the first declaration stays authoritative`,\n span: callSpan,\n });\n return null;\n }\n input.declaredBindings.add(bindingName);\n\n const warnings: AssetParseError[] = [];\n const spans: AssetSpans = {\n call: callSpan,\n config: toSourceSpan(configArg) ?? callSpan,\n libraryItems: [],\n };\n\n const usageInstructions = readUsageInstructions(configArg);\n const libraries = readLibraries(configArg, spans, warnings);\n const variants = readVariants(configArg, warnings);\n\n // Reference declarations skip the not_exported warning — the target lives\n // in another module, and the import form already proves it is importable.\n if (binding && binding.exportKind === \"none\") {\n warnings.push({\n code: \"not_exported\",\n severity: \"degraded\",\n message: `\"${bindingName}\" is not exported — other files cannot import this asset`,\n span: callSpan,\n });\n }\n\n return {\n bindingName,\n exportKind: binding\n ? binding.exportKind\n : referenceExportKind(reference as ParsedAssetReference),\n libraries,\n ...(usageInstructions === undefined ? {} : { usageInstructions }),\n variants,\n ...(reference ? { reference } : {}),\n spans,\n warnings,\n };\n}\n\n/** How the target is exported from its module, read straight off the import\n * form — a default import can only bind a default export, a named import a\n * named one. */\nfunction referenceExportKind(reference: ParsedAssetReference): AssetExportKind {\n return reference.importedName === \"default\" ? \"default\" : \"named\";\n}\n\nfunction classifyMissingBinding(\n name: string,\n scope: AssetTopLevelScope,\n imports: AssetImportInfo,\n program: any,\n span: AssetSourceSpan,\n): AssetParseError {\n // Named/default imports parse as reference declarations before reaching\n // here, so an import landing in this branch is a namespace import.\n const importSource = imports.importedBindings.get(name);\n if (importSource !== undefined) {\n return {\n code: \"imported_binding\",\n severity: \"structural\",\n message: `\"${name}\" is a namespace import from \"${importSource}\" — declare the asset on a named or default import of the component instead`,\n span,\n };\n }\n if (scope.nonSimpleNames.has(name)) {\n return {\n code: \"unknown_binding\",\n severity: \"structural\",\n message: `\"${name}\" is not a plain initialized top-level binding — destructured and uninitialized declarations are not supported`,\n span,\n };\n }\n if (hasNestedBinding(program, name)) {\n return {\n code: \"non_top_level_binding\",\n severity: \"structural\",\n message: `\"${name}\" is not declared at the top level of the module`,\n span,\n };\n }\n return {\n code: \"unknown_binding\",\n severity: \"structural\",\n message: `no top-level declaration of \"${name}\" found in this file`,\n span,\n };\n}\n\nfunction hasNestedBinding(program: any, name: string): boolean {\n let found = false;\n walk(program, (node) => {\n if (found) return;\n if (\n (node.type === \"VariableDeclarator\" ||\n node.type === \"FunctionDeclaration\" ||\n node.type === \"ClassDeclaration\") &&\n node.id?.type === \"Identifier\" &&\n node.id.name === name\n ) {\n found = true;\n }\n });\n return found;\n}\n\nfunction readUsageInstructions(configNode: any): string | undefined {\n return readStaticStringProperty(configNode, \"usageInstructions\");\n}\n\nfunction readStaticStringProperty(\n configNode: any,\n name: string,\n): string | undefined {\n const property = getObjectProperty(configNode, name);\n if (!property) return undefined;\n const value = readStaticValue(property.value);\n return typeof value === \"string\" ? value : undefined;\n}\n\nfunction readLibraries(\n configNode: any,\n spans: AssetSpans,\n warnings: AssetParseError[],\n): string[] {\n const property = getObjectProperty(configNode, \"libraries\");\n if (!property) return [];\n spans.librariesProperty = toSourceSpan(property);\n\n const value = unwrapTsExpression(property.value);\n if (value?.type !== \"ArrayExpression\") {\n warnings.push({\n code: \"non_literal_library\",\n severity: \"degraded\",\n message:\n \"libraries must be an inline array literal of string literals — its entries were dropped\",\n span: toSourceSpan(property.value) ?? spans.librariesProperty,\n });\n return [];\n }\n spans.libraries = toSourceSpan(value);\n\n const names: string[] = [];\n for (const element of value.elements ?? []) {\n const elementSpan = toSourceSpan(element) ?? spans.libraries;\n const name = readStaticString(element);\n if (name === null) {\n warnings.push({\n code: \"non_literal_library\",\n severity: \"degraded\",\n message:\n \"libraries entries must be string literals — dropped a non-literal entry\",\n span: elementSpan,\n });\n continue;\n }\n if (name === \"\") {\n warnings.push({\n code: \"empty_library_name\",\n severity: \"degraded\",\n message: \"libraries entries must be non-empty — dropped an empty entry\",\n span: elementSpan,\n });\n continue;\n }\n if (names.includes(name)) {\n warnings.push({\n code: \"duplicate_library\",\n severity: \"degraded\",\n message: `duplicate library name \"${name}\" — deduplicated`,\n span: elementSpan,\n });\n continue;\n }\n names.push(name);\n if (elementSpan) spans.libraryItems.push(elementSpan);\n }\n return names;\n}\n\nfunction readVariants(\n configNode: any,\n warnings: AssetParseError[],\n): ParsedAssetVariant[] {\n const property = getObjectProperty(configNode, \"variants\");\n if (!property) return [];\n\n const value = unwrapTsExpression(property.value);\n if (value?.type !== \"ObjectExpression\") {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message:\n \"variants is not an inline object literal — variant props are not statically readable\",\n span: toSourceSpan(property.value) ?? toSourceSpan(property),\n });\n return [];\n }\n\n const properties = value.properties ?? [];\n if (properties.length === 0) {\n warnings.push({\n code: \"empty_variants\",\n severity: \"degraded\",\n message: \"variants is present but empty\",\n span: toSourceSpan(value),\n });\n return [];\n }\n\n const variants: ParsedAssetVariant[] = [];\n for (const entry of properties) {\n const name =\n entry?.type === \"Property\" && !entry.computed\n ? readPropertyKeyName(entry.key)\n : null;\n if (name === null) {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message:\n \"variant names must be identifier or string keys — skipped an entry that is not statically readable\",\n span: toSourceSpan(entry) ?? toSourceSpan(value),\n });\n continue;\n }\n variants.push(readVariant(name, entry, warnings));\n }\n return variants;\n}\n\nfunction readVariant(\n name: string,\n entry: any,\n warnings: AssetParseError[],\n): ParsedAssetVariant {\n const value = unwrapTsExpression(entry.value);\n const propsProperty =\n value?.type === \"ObjectExpression\" ? getObjectProperty(value, \"props\") : null;\n const propsValue = propsProperty\n ? readStaticValue(propsProperty.value)\n : UNRESOLVED_VALUE;\n const props = isPlainRecord(propsValue) ? propsValue : {};\n const hasUnresolvedValues =\n !isPlainRecord(propsValue) || containsUnresolvedValue(propsValue);\n\n if (hasUnresolvedValues) {\n warnings.push({\n code: \"unresolved_prop_value\",\n severity: \"degraded\",\n message: `variant \"${name}\" has prop values that are not statically readable`,\n span: toSourceSpan(entry),\n });\n }\n\n return { name, props, hasUnresolvedValues };\n}\n\n/** Static value model (§3.2): literals, interpolation-free templates, unary\n * minus on numbers, array/object literals; anything else degrades to the\n * UNRESOLVED sentinel in place, preserving the surrounding structure. */\nfunction readStaticValue(node: any): StaticValue {\n const expression = unwrapTsExpression(node);\n if (!expression) return UNRESOLVED_VALUE;\n\n switch (expression.type) {\n case \"Literal\": {\n if (expression.regex || expression.bigint) return UNRESOLVED_VALUE;\n const { value } = expression;\n return value === null ||\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ? value\n : UNRESOLVED_VALUE;\n }\n case \"TemplateLiteral\": {\n if ((expression.expressions ?? []).length > 0) return UNRESOLVED_VALUE;\n const cooked = expression.quasis?.[0]?.value?.cooked;\n return typeof cooked === \"string\" ? cooked : UNRESOLVED_VALUE;\n }\n case \"UnaryExpression\": {\n if (expression.operator !== \"-\") return UNRESOLVED_VALUE;\n const argument = unwrapTsExpression(expression.argument);\n return argument?.type === \"Literal\" &&\n typeof argument.value === \"number\" &&\n Number.isFinite(argument.value)\n ? -argument.value\n : UNRESOLVED_VALUE;\n }\n case \"ArrayExpression\":\n return (expression.elements ?? []).map((element: any) =>\n element == null || element.type === \"SpreadElement\"\n ? UNRESOLVED_VALUE\n : readStaticValue(element),\n );\n case \"ObjectExpression\": {\n const record: Record<string, StaticValue> = {};\n for (const property of expression.properties ?? []) {\n // A spread or computed key makes the object's final shape unknowable\n // statically, so the whole object degrades to UNRESOLVED rather than\n // presenting a misleading partial record.\n if (property?.type !== \"Property\" || property.computed) {\n return UNRESOLVED_VALUE;\n }\n const key = readPropertyKeyName(property.key);\n if (key === null) return UNRESOLVED_VALUE;\n record[key] = readStaticValue(property.value);\n }\n return record;\n }\n default:\n return UNRESOLVED_VALUE;\n }\n}\n\nfunction readStaticString(node: any): string | null {\n const value = node == null ? UNRESOLVED_VALUE : readStaticValue(node);\n return typeof value === \"string\" ? value : null;\n}\n\nfunction isPlainRecord(\n value: StaticValue,\n): value is Record<string, StaticValue> {\n return (\n typeof value === \"object\" &&\n value !== null &&\n !Array.isArray(value) &&\n !isUnresolvedValue(value)\n );\n}\n\nfunction containsUnresolvedValue(value: StaticValue): boolean {\n if (isUnresolvedValue(value)) return true;\n if (Array.isArray(value)) return value.some(containsUnresolvedValue);\n if (typeof value === \"object\" && value !== null) {\n return Object.values(value).some(containsUnresolvedValue);\n }\n return false;\n}\n\n/** ExpressionStatement spans normally include the terminating semicolon, but\n * a semicolon separated by inline whitespace still belongs to the call. */\nfunction statementSpanWithSemicolon(\n source: string,\n statement: any,\n): AssetSourceSpan {\n const span = toSourceSpan(statement) ?? { start: 0, end: 0 };\n if (source[span.end - 1] === \";\") return span;\n let end = span.end;\n while (end < source.length && (source[end] === \" \" || source[end] === \"\\t\")) {\n end++;\n }\n return source[end] === \";\" ? { start: span.start, end: end + 1 } : span;\n}\n\nexport function unwrapTsExpression(node: any): any {\n let current = node;\n while (\n current?.type === \"TSSatisfiesExpression\" ||\n current?.type === \"TSAsExpression\" ||\n current?.type === \"TSNonNullExpression\" ||\n current?.type === \"ParenthesizedExpression\"\n ) {\n current = current.expression;\n }\n return current;\n}\n\nfunction readPropertyKeyName(key: any): string | null {\n if (key?.type === \"Identifier\") return key.name;\n if (key?.type === \"Literal\") {\n if (typeof key.value === \"string\") return key.value;\n if (typeof key.value === \"number\") return String(key.value);\n }\n return null;\n}\n\nfunction getObjectProperty(objectExpression: any, name: string): any | null {\n if (objectExpression?.type !== \"ObjectExpression\") return null;\n for (const property of objectExpression.properties ?? []) {\n if (property?.type !== \"Property\" || property.computed) continue;\n if (readPropertyKeyName(property.key) === name) return property;\n }\n return null;\n}\n\nexport function toSourceSpan(node: any): AssetSourceSpan | undefined {\n return typeof node?.start === \"number\" &&\n Number.isFinite(node.start) &&\n typeof node?.end === \"number\" &&\n Number.isFinite(node.end)\n ? { start: node.start, end: node.end }\n : undefined;\n}\n\nfunction walk(\n node: any,\n visitor: (node: any) => void,\n seen = new Set<any>(),\n): void {\n if (!node || typeof node !== \"object\" || seen.has(node)) return;\n seen.add(node);\n if (typeof node.type === \"string\") visitor(node);\n\n for (const value of Object.values(node)) {\n if (!value || typeof value !== \"object\") continue;\n if (Array.isArray(value)) {\n for (const item of value) walk(item, visitor, seen);\n } else {\n walk(value, visitor, seen);\n }\n }\n}\n","/**\n * Shared data-model types for the asset system's static pipeline: the parser\n * (`tempo-sdk/assets/parser`), the source editor (`tempo-sdk/assets/editor`),\n * and downstream consumers (`@tempo-modules/asset-libraries` index + MCP\n * tools). Everything here must stay JSON-serializable — parse results cross\n * IPC and MCP boundaries verbatim.\n *\n * See specs/asset-libraries.md §3 for the full parsing contract.\n */\n\nexport type AssetSourceSpan = { start: number; end: number };\n\n/** Stable machine-readable identifiers for every parse/edit problem. */\nexport type AssetParseErrorCode =\n // structural — the declaration's identity cannot be trusted; excluded from the index\n | \"misimported_define_asset\"\n | \"non_identifier_component\"\n | \"unknown_binding\"\n | \"imported_binding\"\n | \"non_top_level_binding\"\n | \"config_not_object_literal\"\n | \"invalid_call_arguments\"\n | \"duplicate_declaration\"\n | \"non_top_level_call\"\n | \"unparseable_source\"\n // structural — emitted by the workspace index builder (@tempo-modules/\n // asset-libraries), never by the per-file parser: these need workspace\n // context (canvas-dir location, cross-file identity) the parser lacks\n | \"component_declaration_outside_canvas\"\n | \"duplicate_asset_declaration\"\n // degraded/info — canvas-pointer docstring validation, emitted by the\n // workspace index builder for canvas-declared components: the component's\n // defining file must carry a comment naming the declaring canvas's path\n | \"missing_canvas_pointer\"\n | \"stale_canvas_pointer\"\n | \"canvas_pointer_unverified\"\n // degraded — emitted by the workspace index builder: a canvas self-\n // registration is redundant when files in the same canvas folder also\n // declare component references (those already link the canvas via\n // canvasPath — self-registration is strictly for component-less\n // foundations pages)\n | \"redundant_canvas_declaration\"\n // degraded — the declaration is indexed; the issue is carried as a warning\n | \"non_literal_library\"\n | \"empty_library_name\"\n | \"duplicate_library\"\n | \"empty_variants\"\n | \"variants_on_canvas\"\n | \"unresolved_prop_value\"\n | \"not_exported\";\n\nexport type AssetParseError = {\n code: AssetParseErrorCode;\n message: string;\n /** \"structural\": the declaration is excluded from the index — readers must\n * fail closed. \"degraded\": the declaration is indexed; this is a warning\n * carried on the entry. \"info\": advisory note carried on the entry —\n * best-effort validation that could not run to a verdict; never a\n * failure. Mirrors CanvasParseError's severity split. */\n severity: \"structural\" | \"degraded\" | \"info\";\n span?: AssetSourceSpan;\n};\n\n/**\n * A config value the parser could not resolve statically (identifier\n * reference, call result, JSX, spread, …). The `$unresolved` shape is the\n * wire format everywhere (index, IPC, MCP) — no translation layers.\n * A user literally writing `{ $unresolved: true }` as a prop value is\n * indistinguishable from this marker; that collision is accepted.\n */\nexport type UnresolvedValue = { $unresolved: true };\n\nexport const UNRESOLVED_VALUE: UnresolvedValue = Object.freeze({\n $unresolved: true,\n});\n\nexport function isUnresolvedValue(value: unknown): value is UnresolvedValue {\n return (\n typeof value === \"object\" &&\n value !== null &&\n ($unresolvedKey in value) &&\n (value as UnresolvedValue).$unresolved === true\n );\n}\n\nconst $unresolvedKey = \"$unresolved\" satisfies keyof UnresolvedValue;\n\n/** Statically-readable config value: JSON literals plus the UNRESOLVED marker. */\nexport type StaticValue =\n | string\n | number\n | boolean\n | null\n | UnresolvedValue\n | StaticValue[]\n | { [key: string]: StaticValue };\n\nexport type ParsedAssetVariant = {\n name: string;\n /** One dynamic value does not discard the variant — it parses to UNRESOLVED. */\n props: Record<string, StaticValue>;\n hasUnresolvedValues: boolean;\n};\n\nexport type AssetExportKind = \"named\" | \"default\" | \"none\";\n\n/** Source spans that power the surgical editor (specs/asset-libraries.md §4). */\nexport type AssetSpans = {\n /** The whole `defineAsset(...)` expression statement, semicolon included. */\n call: AssetSourceSpan;\n /** The config ObjectExpression (second argument). */\n config: AssetSourceSpan;\n /** The `libraries` array expression, only when the value is an array\n * literal. A `librariesProperty` without `libraries` means the property\n * exists but its value is dynamic — the editor must refuse to touch it. */\n libraries?: AssetSourceSpan;\n /** The whole `libraries: <value>` property, whenever the key is present.\n * Lets the editor remove the property outright when its array empties. */\n librariesProperty?: AssetSourceSpan;\n /** One span per statically-known `libraries` entry, in source order,\n * index-aligned with ParsedAssetDeclaration.libraries. */\n libraryItems: AssetSourceSpan[];\n};\n\n/** Reference-declaration target: defineAsset's first argument is an imported\n * binding, and the asset's identity is the import itself. Purely syntactic —\n * the parser records the import statement's module specifier plus the name\n * imported from it (\"default\" for default imports); resolution to a\n * workspace identity happens in @tempo-modules/asset-libraries. */\nexport type ParsedAssetReference = {\n importSpecifier: string;\n importedName: string;\n};\n\nexport type ParsedAssetDeclaration = {\n /** The identifier passed as defineAsset's first argument. */\n bindingName: string;\n exportKind: AssetExportKind;\n /** Deduplicated, statically-known entries only. */\n libraries: string[];\n /** What this asset is and when to reach for it (and when not). */\n usageInstructions?: string;\n variants: ParsedAssetVariant[];\n /** Present iff the declaration targets an imported binding. */\n reference?: ParsedAssetReference;\n spans: AssetSpans;\n /** Degraded-severity notes scoped to this declaration. */\n warnings: AssetParseError[];\n};\n\nexport type ParsedAssetFile = {\n filePath: string;\n /** Declarations whose identity parsed cleanly (may carry warnings). */\n declarations: ParsedAssetDeclaration[];\n /** Structural errors: file-level problems and rejected declarations. */\n errors: AssetParseError[];\n};\n\n/** Typed failures shared by the editor operations (§4.1) and the MCP write\n * tools that surface them (§7.3). */\nexport type AssetEditFailureCode =\n | \"asset_not_found\"\n | \"config_not_editable\"\n | \"export_not_found\"\n | \"already_defined\"\n | \"not_definable\";\n"],"mappings":";AAeA,SAAS,iBAAiB;;;ACyDnB,IAAM,mBAAoC,OAAO,OAAO;AAAA,EAC7D,aAAa;AACf,CAAC;AAEM,SAAS,kBAAkB,OAA0C;AAC1E,SACE,OAAO,UAAU,YACjB,UAAU,QACT,kBAAkB,SAClB,MAA0B,gBAAgB;AAE/C;AAEA,IAAM,iBAAiB;;;ADnDhB,IAAM,0BAA0B;AAEhC,SAAS,eACd,UACA,QACiB;AACjB,QAAM,EAAE,SAAS,OAAO,IAAI,kBAAkB,UAAU,MAAM;AAC9D,MAAI,CAAC,SAAS;AACZ,WAAO,EAAE,UAAU,cAAc,CAAC,GAAG,OAAO;AAAA,EAC9C;AAEA,QAAM,UAAU,iBAAiB,OAAO;AACxC,aAAW,aAAa,QAAQ,YAAY;AAC1C,WAAO,KA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