@niscorp/nova 0.1.4 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ADAPTER.md +6 -6
- package/CHANGELOG.md +30 -0
- package/README.md +46 -21
- package/dist/adapters/dom/components/index.d.cts +2 -2
- package/dist/adapters/dom/components/index.d.ts +2 -2
- package/dist/adapters/dom/index.cjs +163 -34
- package/dist/adapters/dom/index.cjs.map +1 -1
- package/dist/adapters/dom/index.d.cts +2 -2
- package/dist/adapters/dom/index.d.ts +2 -2
- package/dist/adapters/dom/index.js +6 -6
- package/dist/adapters/dom/server.cjs +0 -2
- package/dist/adapters/dom/server.cjs.map +1 -1
- package/dist/adapters/dom/server.d.cts +2 -2
- package/dist/adapters/dom/server.d.ts +2 -2
- package/dist/adapters/dom/server.js +6 -6
- package/dist/adapters/react/components/index.cjs +6 -8
- package/dist/adapters/react/components/index.cjs.map +1 -1
- package/dist/adapters/react/components/index.d.cts +4 -4
- package/dist/adapters/react/components/index.d.ts +4 -4
- package/dist/adapters/react/components/index.js +7 -7
- package/dist/adapters/react/index.cjs +181 -51
- package/dist/adapters/react/index.cjs.map +1 -1
- package/dist/adapters/react/index.d.cts +4 -4
- package/dist/adapters/react/index.d.ts +4 -4
- package/dist/adapters/react/index.js +7 -7
- package/dist/adapters/tty/components/index.d.cts +2 -2
- package/dist/adapters/tty/components/index.d.ts +2 -2
- package/dist/adapters/tty/index.cjs +0 -2
- package/dist/adapters/tty/index.cjs.map +1 -1
- package/dist/adapters/tty/index.d.cts +2 -2
- package/dist/adapters/tty/index.d.ts +2 -2
- package/dist/adapters/tty/index.js +4 -4
- package/dist/adapters/tty/index.js.map +1 -1
- package/dist/adapters/vue/components/index.cjs +4 -6
- package/dist/adapters/vue/components/index.cjs.map +1 -1
- package/dist/adapters/vue/components/index.d.cts +9 -9
- package/dist/adapters/vue/components/index.d.ts +9 -9
- package/dist/adapters/vue/components/index.js +7 -7
- package/dist/adapters/vue/index.cjs +175 -46
- package/dist/adapters/vue/index.cjs.map +1 -1
- package/dist/adapters/vue/index.d.cts +4 -4
- package/dist/adapters/vue/index.d.ts +4 -4
- package/dist/adapters/vue/index.js +9 -9
- package/dist/adapters/vue/index.js.map +1 -1
- package/dist/agent/index.d.cts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/{chunk-7PKS7UYL.js → chunk-3JRTELLC.js} +3 -3
- package/dist/{chunk-7PKS7UYL.js.map → chunk-3JRTELLC.js.map} +1 -1
- package/dist/{chunk-4I2PFMY7.js → chunk-MHW5VEIM.js} +8 -8
- package/dist/chunk-MHW5VEIM.js.map +1 -0
- package/dist/chunk-OE4E6IBD.js +25 -0
- package/dist/chunk-OE4E6IBD.js.map +1 -0
- package/dist/{chunk-KYQ4EAQH.js → chunk-QXQCPH33.js} +17 -17
- package/dist/chunk-QXQCPH33.js.map +1 -0
- package/dist/chunk-RFBIGRCI.js +127 -0
- package/dist/chunk-RFBIGRCI.js.map +1 -0
- package/dist/{chunk-WZVQ5PUB.js → chunk-RYIIIXDX.js} +4 -4
- package/dist/{chunk-WZVQ5PUB.js.map → chunk-RYIIIXDX.js.map} +1 -1
- package/dist/{chunk-4ERQYDF6.js → chunk-UDCXGDLQ.js} +10 -10
- package/dist/chunk-UDCXGDLQ.js.map +1 -0
- package/dist/chunk-V4BPFFFV.js +152 -0
- package/dist/chunk-V4BPFFFV.js.map +1 -0
- package/dist/{chunk-UUYXVOK2.js → chunk-VU6NNCEJ.js} +16 -16
- package/dist/chunk-VU6NNCEJ.js.map +1 -0
- package/dist/{chunk-RXECI7DE.js → chunk-Y6XVPRYH.js} +33 -17
- package/dist/chunk-Y6XVPRYH.js.map +1 -0
- package/dist/devtools/index.d.cts +2 -2
- package/dist/devtools/index.d.ts +2 -2
- package/dist/devtools/index.js +3 -3
- package/dist/document/index.cjs +228 -119
- package/dist/document/index.cjs.map +1 -1
- package/dist/document/index.d.cts +10 -8
- package/dist/document/index.d.ts +10 -8
- package/dist/document/index.js +3 -122
- package/dist/document/index.js.map +1 -1
- package/dist/head-CAzfTnpV.d.cts +25 -0
- package/dist/head-DRpbbj-l.d.ts +25 -0
- package/dist/i18n/index.d.cts +2 -2
- package/dist/i18n/index.d.ts +2 -2
- package/dist/index.cjs +151 -41
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -31
- package/dist/index.d.ts +19 -31
- package/dist/index.js +4 -4
- package/dist/{palette-Mx7XHYC6.d.ts → palette-CIpPH90W.d.ts} +1 -1
- package/dist/{palette-wbJB_svk.d.cts → palette-CvwZZCkx.d.cts} +1 -1
- package/dist/reflect/index.d.cts +2 -2
- package/dist/reflect/index.d.ts +2 -2
- package/dist/reflect/index.js +3 -3
- package/dist/{types-B-rjaUX0.d.ts → types-BSKx5MXW.d.ts} +1 -1
- package/dist/{types-B_nOtkyt.d.ts → types-BWc-olbY.d.ts} +1 -1
- package/dist/{types-mRKXqZPX.d.cts → types-C9734_lJ.d.cts} +1 -1
- package/dist/{types-BB9RXel5.d.ts → types-D23TRvqe.d.ts} +1 -1
- package/dist/{types-uk19d6KC.d.cts → types-DsWNYc7R.d.cts} +1 -1
- package/dist/{types-BLVRduoz.d.cts → types-j290XhCn.d.cts} +1 -1
- package/dist/{types-PDXOkvtK.d.cts → types-qkzTfSye.d.cts} +1 -1
- package/dist/{types-DE77Jl2W.d.ts → types-qnKMx0_V.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/chunk-4ERQYDF6.js.map +0 -1
- package/dist/chunk-4I2PFMY7.js.map +0 -1
- package/dist/chunk-EHHJJLRX.js +0 -16
- package/dist/chunk-EHHJJLRX.js.map +0 -1
- package/dist/chunk-KYQ4EAQH.js.map +0 -1
- package/dist/chunk-RXECI7DE.js.map +0 -1
- package/dist/chunk-UUYXVOK2.js.map +0 -1
- package/dist/chunk-UV5YGBHQ.js +0 -62
- package/dist/chunk-UV5YGBHQ.js.map +0 -1
- package/dist/chunk-X7SSNSQC.js +0 -6
- package/dist/chunk-X7SSNSQC.js.map +0 -1
- package/dist/head-BNj8GwPO.d.cts +0 -20
- package/dist/head-CS6X6ZKr.d.ts +0 -20
- package/dist/{primitive-props-Cl5jiC8g.d.cts → primitive-props-CGoJvmcH.d.cts} +5 -5
- package/dist/{primitive-props-Cl5jiC8g.d.ts → primitive-props-CGoJvmcH.d.ts} +5 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/shared/bindings/scope.ts","../src/shared/bindings/resolve.ts","../src/layout/guards.ts","../src/layout/renderer.ts","../src/layout/compose.ts","../src/layout/adapter.ts","../src/layout/store.ts","../src/layout/head.schema.ts","../src/action/compose.ts","../src/action/grammar.ts","../src/action/audit.ts","../src/reflect/grammar.ts"],"names":["segments"],"mappings":";;;;;;;;;;;AAEO,IAAM,gBAAA,GAAmB,CAAC,IAAA,KAA4B,CAAC,IAAI;AAE3D,IAAM,YAAY,CAAC,KAAA,EAAmB,UAA6B,CAAC,KAAA,EAAO,GAAG,KAAK,CAAA;ACqB1F,IAAM,cAAA,GAAiB,yBAAA;AACvB,IAAM,mBAAA,GAAsB,0BAAA;AAC5B,IAAM,eAAA,GAAkB,qBAAA;AAIxB,IAAM,UAAA,GAAa,CAAC,UAAA,EAAoB,MAAA,KAA4C;AAClF,EAAA,IAAI,OAAA;AACJ,EAAA,KAAA,MAAW,GAAA,IAAO,MAAA,CAAO,IAAA,CAAK,MAAM,CAAA,EAAG;AACrC,IAAA,IAAI,eAAe,GAAA,IAAO,UAAA,CAAW,WAAW,CAAA,EAAG,GAAG,GAAG,CAAA,EAAG;AAC1D,MAAA,IAAI,YAAY,MAAA,IAAa,GAAA,CAAI,MAAA,GAAS,OAAA,CAAQ,QAAQ,OAAA,GAAU,GAAA;AAAA,IACtE;AAAA,EACF;AACA,EAAA,OAAO,OAAA;AACT,CAAA;AAEA,IAAM,sBAAA,GAAyB,CAC7B,UAAA,EACA,UAAA,EACA,MAAA,KACY;AACZ,EAAA,MAAM,IAAA,GAAO,OAAO,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Aa,EAAE,CAAA,EAAG;AACzE,IAAA,IAAI,CAAC,MAAA,CAAO,GAAA,CAAI,IAAI,CAAA,EAAG;AACvB,IAAA,KAAA,MAAW,GAAA,IAAO,WAAA,CAAa,QAAA,CAAmC,OAAO,CAAA,EAAG,IAAI,QAAA,CAAS,GAAA,CAAI,GAAG,CAAA,EAAG,IAAA,CAAK,GAAA,CAAI,GAAG,CAAA;AAAA,EACjH;AACA,EAAA,eAAA,CAAgB,GAAA,CAAI,YAAY,IAAI,CAAA;AACpC,EAAA,OAAO,IAAA;AACT","file":"chunk-Y6XVPRYH.js","sourcesContent":["import type { Scope, ScopeChain } from './types';\n\nexport const createScopeChain = (data: Scope): ScopeChain => [data];\n\nexport const pushScope = (chain: ScopeChain, scope: Scope): ScopeChain => [scope, ...chain];\n","import { evaluateSafe } from '@niscorp/prism';\nimport { hasKey, isArray, isObject } from '../common';\nimport { getPath } from './paths';\nimport type { ScopeChain } from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Unified value resolver.\n//\n// One function — `resolve` — handles every binding site uniformly.\n//\n// String semantics:\n// 1. \"{{ expr }}\" (sole expression) → raw value of expr (type preserved)\n// 2. \"...{{expr}}...\" → interpolated string\n// 3. \"$.x\" or \"$ident...\" → raw value of path (type preserved)\n// 4. anything else → literal string\n//\n// Array → mapped recursively.\n// Object → walked recursively, OR treated as an `$if` directive.\n// Primitives → returned as-is.\n//\n// Path expressions resolve via `resolvePath`, which uses the ScopeChain\n// (innermost first). An optional `extras` map injects keyed scopes for\n// templates (e.g. `{ '@error': errObj }`); longest-prefix match wins.\n// ═══════════════════════════════════════════════════════════\n\nconst TEMPLATE_REGEX = /\\{\\{\\s*([^}]+?)\\s*\\}\\}/g;\nconst SOLE_TEMPLATE_REGEX = /^\\{\\{\\s*([^}]+?)\\s*\\}\\}$/;\nconst BARE_PATH_REGEX = /^\\$(\\.|[A-Za-z_]|$)/;\n\nexport type ExtraScopes = Record<string, unknown>;\n\nconst matchExtra = (expression: string, extras: ExtraScopes): string | undefined => {\n let matched: string | undefined;\n for (const key of Object.keys(extras)) {\n if (expression === key || expression.startsWith(`${key}.`)) {\n if (matched === undefined || key.length > matched.length) matched = key;\n }\n }\n return matched;\n};\n\nconst resolveExtraExpression = (\n expression: string,\n matchedKey: string,\n extras: ExtraScopes,\n): unknown => {\n const root = extras[matchedKey];\n if (expression === matchedKey) return root;\n const rest = expression.slice(matchedKey.length + 1);\n if (rest.length === 0) return root;\n return getPath(root, rest);\n};\n\nconst walkFromScopeHead = (head: unknown, restSegments: readonly string[]): unknown => {\n if (restSegments.length === 0) return head;\n return getPath(head, restSegments.join('.'));\n};\n\nexport const resolvePath = (\n path: string,\n chain: ScopeChain,\n extras: ExtraScopes = {},\n): unknown => {\n const extraKey = matchExtra(path, extras);\n if (extraKey !== undefined) return resolveExtraExpression(path, extraKey, extras);\n\n if (!path.startsWith('$')) return undefined;\n if (path === '$') return chain[0];\n\n const afterDollar = path.slice(1);\n\n if (afterDollar.startsWith('.')) {\n const rest = afterDollar.slice(1);\n if (rest.length === 0) return chain[0];\n const segments = rest.split('.');\n const head = segments[0];\n if (head === undefined) return undefined;\n for (const scope of chain) {\n if (hasKey(scope, head)) {\n return walkFromScopeHead(scope[head], segments.slice(1));\n }\n }\n return undefined;\n }\n\n const segments = afterDollar.split('.');\n const varName = segments[0];\n if (varName === undefined || varName.length === 0) return undefined;\n for (const scope of chain) {\n if (hasKey(scope, varName)) {\n return walkFromScopeHead(scope[varName], segments.slice(1));\n }\n }\n return undefined;\n};\n\nconst stringify = (value: unknown): string => {\n if (value === null || value === undefined) return '';\n if (typeof value === 'string') return value;\n if (typeof value === 'number' || typeof value === 'boolean') return String(value);\n try {\n return JSON.stringify(value);\n } catch {\n return '';\n }\n};\n\nconst isTruthy = (value: unknown): boolean => {\n if (value === null || value === undefined) return false;\n if (value === false) return false;\n if (value === 0) return false;\n if (value === '') return false;\n if (isArray(value) && value.length === 0) return false;\n return true;\n};\n\n// Directives — evaluated objects keyed by an operator (`$if`, `$eq`, …). Each\n// resolves its operands and returns a value. Add an operator here and it works\n// everywhere bindings are resolved; later operators (`$gte`, `$and`, …) slot in\n// the same way.\ntype Directive = (node: Record<string, unknown>, chain: ScopeChain, extras: ExtraScopes) => unknown;\n\nconst DIRECTIVES: Record<string, Directive> = {\n $if: (node, chain, extras) => {\n if (isTruthy(resolve(node.$if, chain, extras))) return resolve(node.$then, chain, extras);\n if (hasKey(node, '$else')) return resolve(node.$else, chain, extras);\n return undefined;\n },\n $eq: (node, chain, extras) => {\n const args = isArray(node.$eq) ? node.$eq : [];\n return resolve(args[0], chain, extras) === resolve(args[1], chain, extras);\n },\n // True when the operand path resolves to a present value. The structural\n // counterpart to `$eq`: discriminate a union by which key a branch carries\n // (`{ $exists: \"$.shape.component\" }`) rather than a shared tag's value.\n $exists: (node, chain, extras) => resolve(node.$exists, chain, extras) !== undefined,\n // Read an array element by a (dynamic) index: `{ $at: [\"$.results\", \"$.i\"] }`.\n // An optional third arg pulls one field off the element: `[\"$.results\", \"$.i\",\n // \"id\"]`. Returns undefined when the array/index doesn't resolve.\n $at: (node, chain, extras) => {\n const args = isArray(node.$at) ? node.$at : [];\n const arr = resolve(args[0], chain, extras);\n const index = Number(resolve(args[1], chain, extras));\n if (!isArray(arr) || Number.isNaN(index)) return undefined;\n const element = arr[index];\n const field = args[2];\n return field !== undefined && isObject(element) ? element[String(field)] : element;\n },\n // THE WHOLE TRANSFORM GRAMMAR, BEHIND ONE EXPLICIT DOOR. The directives\n // above stay the small binding set; a value that needs a real transformation\n // — a join, a projection, a group — says so out loud: `{ $prism: <node> }`\n // evaluates the node with prism against the action's ROOT data. One grammar,\n // one evaluator, nothing ambient — a prism-shaped object OUTSIDE this\n // wrapper stays what it always was, a plain object walked for strings.\n //\n // The quiet failure this replaces was worse than a crash: an unrecognised\n // op-shaped value passed through `resolve` as structure, landed in data, and\n // rendered as garbage three screens later. Inside the wrapper, a bad node\n // resolves to undefined — absent, not wrong.\n $prism: (node, chain) => {\n const result = evaluateSafe(node.$prism as never, (chain[0] ?? {}) as never);\n return result.ok ? result.data : undefined;\n },\n};\n\nconst directiveOf = (value: Record<string, unknown>): Directive | undefined => {\n for (const key of Object.keys(value)) {\n const directive = DIRECTIVES[key];\n if (directive !== undefined) return directive;\n }\n return undefined;\n};\n\nconst resolveString = (value: string, chain: ScopeChain, extras: ExtraScopes): unknown => {\n const sole = value.match(SOLE_TEMPLATE_REGEX);\n if (sole !== null) {\n const expr = sole[1];\n if (expr === undefined) return value;\n return resolvePath(expr.trim(), chain, extras);\n }\n\n if (value.includes('{{')) {\n return value.replace(TEMPLATE_REGEX, (_match: string, expression: string): string => {\n const resolved = resolvePath(expression.trim(), chain, extras);\n return stringify(resolved);\n });\n }\n\n if (BARE_PATH_REGEX.test(value)) {\n return resolvePath(value, chain, extras);\n }\n\n if (matchExtra(value, extras) !== undefined) {\n return resolvePath(value, chain, extras);\n }\n\n return value;\n};\n\nexport const resolve = (\n value: unknown,\n chain: ScopeChain,\n extras: ExtraScopes = {},\n): unknown => {\n if (typeof value === 'string') return resolveString(value, chain, extras);\n if (isArray(value)) return value.map((entry) => resolve(entry, chain, extras));\n if (isObject(value)) {\n const directive = directiveOf(value);\n if (directive !== undefined) return directive(value, chain, extras);\n const out: Record<string, unknown> = {};\n for (const key of Object.keys(value)) {\n out[key] = resolve(value[key], chain, extras);\n }\n return out;\n }\n return value;\n};\n","import { hasKey, isObject } from '../shared/common';\nimport type {\n ComponentNode,\n ConditionalNode,\n LayoutNode,\n LayoutPrimitive,\n LayoutRefNode,\n LoopNode,\n SlotNode,\n} from './schemas';\n\nexport const isLayoutPrimitive = (value: unknown): value is LayoutPrimitive =>\n value === null ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean';\n\nexport const isComponentNode = (value: unknown): value is ComponentNode =>\n hasKey(value, 'component') && typeof value['component'] === 'string';\n\nexport const isConditionalNode = (value: unknown): value is ConditionalNode =>\n hasKey(value, 'if') && hasKey(value, 'then') && !hasKey(value, 'for');\n\nexport const isLoopNode = (value: unknown): value is LoopNode =>\n hasKey(value, 'for') && hasKey(value, 'as') && hasKey(value, 'do');\n\nexport const isLayoutRefNode = (value: unknown): value is LayoutRefNode =>\n isObject(value) &&\n hasKey(value, 'ref') &&\n typeof value['ref'] === 'string' &&\n !hasKey(value, 'component') &&\n Object.keys(value).length === 1;\n\nexport const isSlotNode = (value: unknown): value is SlotNode =>\n isObject(value) &&\n hasKey(value, 'slot') &&\n typeof value['slot'] === 'string' &&\n Object.keys(value).length === 1;\n\nexport const isLayoutNode = (value: unknown): value is LayoutNode =>\n isLayoutPrimitive(value) ||\n Array.isArray(value) ||\n isComponentNode(value) ||\n isConditionalNode(value) ||\n isLoopNode(value) ||\n isLayoutRefNode(value) ||\n isSlotNode(value);\n","import { isArray } from '../shared/common';\nimport {\n ComponentNotFoundError,\n LayoutRefNotFoundError,\n NovaError,\n RenderError,\n} from '../shared/errors';\nimport { createScopeChain, getPath, pushScope, resolve } from '../shared/bindings';\nimport type { ScopeChain } from '../shared/bindings';\nimport { isBinding } from '../i18n/phrases';\nimport { passFor, swap, walkValue } from '../i18n/swap';\nimport type { Pass } from '../i18n/swap';\nimport {\n isComponentNode,\n isConditionalNode,\n isLayoutPrimitive,\n isLayoutRefNode,\n isLoopNode,\n isSlotNode,\n} from './guards';\nimport { HEAD_NAMES } from './head';\nimport type { ComponentNode, LayoutNode } from './schemas';\nimport type {\n DataStoreView,\n ModelBindingDescriptor,\n RenderContext,\n RenderErrorNode,\n RenderNode,\n RenderOnError,\n} from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Renderer — converts a LayoutNode tree into a framework-agnostic\n// RenderNode[] tree. Renders children in try/catch boundaries so a\n// single broken subtree does not poison siblings, unless strict mode\n// is enabled. All errors flow through the ctx.onError telemetry hook.\n// ═══════════════════════════════════════════════════════════\n\nconst noopOnError: RenderOnError = (_error: NovaError): void => {\n // default — errors silently dropped if no handler provided\n};\n\ntype InternalRenderContext = {\n store: RenderContext['store'];\n registry: RenderContext['registry'];\n strict: boolean;\n onError: RenderOnError;\n scopePaths: string[];\n // Undefined when the host named no book and no keys — the whole language\n // apparatus is then absent rather than idling, and a `{ phrase, slots }`\n // object passes through as the object it is.\n pass: Pass | undefined;\n // Where a miss was found, coarse: the chain of component names above it.\n // Only maintained while a pass is active, since nothing else reads it.\n where: string;\n};\n\nconst textNode = (value: string): RenderNode => ({ type: 'text', value });\n\nconst fragment = (children: RenderNode[]): RenderNode => ({ type: 'fragment', children });\n\nconst errorNode = (\n error: NovaError,\n nodeRef: string | undefined,\n): RenderErrorNode => ({\n type: 'error',\n code: error.code,\n message: error.message,\n ...(nodeRef === undefined ? {} : { nodeRef }),\n});\n\nconst toRenderError = (err: unknown): NovaError => {\n if (err instanceof NovaError) return err;\n const message = err instanceof Error ? err.message : String(err);\n return new RenderError(message, {}, { cause: err });\n};\n\n// Resolve a `$.x.y` or `$loopVar.y` binding to an absolute data path\n// (used to construct stable model binding descriptors inside loops).\nconst resolveDataPath = (\n binding: string,\n scopePaths: string[],\n): string | undefined => {\n if (!binding.startsWith('$')) return undefined;\n const after = binding.slice(1);\n if (after.startsWith('.')) return after.slice(1);\n const segments = after.split('.');\n const head = segments[0];\n if (head === undefined || head.length === 0) return undefined;\n for (let i = scopePaths.length - 1; i >= 0; i -= 1) {\n const entry = scopePaths[i];\n if (entry === undefined) continue;\n const eq = entry.indexOf('=');\n if (eq < 0) continue;\n const key = entry.slice(0, eq);\n if (key !== head) continue;\n const rooted = entry.slice(eq + 1);\n const rest = segments.slice(1).join('.');\n if (rest.length === 0) return rooted;\n return `${rooted}.${rest}`;\n }\n return undefined;\n};\n\nconst makeAutoRef = (componentName: string, path: string): string =>\n `auto-${componentName}-${path}`;\n\nconst renderNode = (\n node: LayoutNode,\n chain: ScopeChain,\n ctx: InternalRenderContext,\n): RenderNode[] => {\n if (node === null) return [textNode('')];\n if (typeof node === 'string') {\n const resolved = resolve(node, chain);\n if (resolved === undefined || resolved === null) return [textNode('')];\n const value = String(resolved);\n // A LITERAL text child is prose; a BOUND one is data wearing a text\n // position, and offering it to the book is how a member called \"Pass\" gets\n // renamed. Nothing but the renderer can tell those apart — by the time a\n // tree exists both are the same plain string — which is why this rule\n // could not be written in `translateRenderTree` and can be written here.\n if (ctx.pass === undefined || !ctx.pass.text || isBinding(node)) return [textNode(value)];\n return [textNode(swap(value, `${ctx.where}#text`, ctx.pass))];\n }\n if (isLayoutPrimitive(node)) {\n return [textNode(String(node))];\n }\n if (isArray(node)) {\n const children = renderChildArray(node, chain, ctx);\n return [fragment(children)];\n }\n if (isLayoutRefNode(node)) {\n const target = ctx.store.get(node.ref);\n if (target === undefined) {\n throw new LayoutRefNotFoundError(`Layout ref not found: ${node.ref}`, { ref: node.ref });\n }\n return renderNode(target, chain, ctx);\n }\n if (isSlotNode(node)) {\n // A slot is filled at fragment-merge time (fillSlots). One that survives to\n // render was never filled — render nothing.\n return [];\n }\n if (isConditionalNode(node)) {\n const condition = resolve(node.if, chain);\n const truthy =\n condition !== undefined &&\n condition !== null &&\n condition !== false &&\n condition !== 0 &&\n condition !== '';\n const branchTruthy = isArray(condition) ? condition.length > 0 : truthy;\n if (branchTruthy) return renderNode(node.then, chain, ctx);\n if (node.else !== undefined) return renderNode(node.else, chain, ctx);\n return [];\n }\n if (isLoopNode(node)) {\n const items = resolve(node.for, chain);\n if (!isArray(items)) return [];\n const loopBasePath = typeof node.for === 'string'\n ? resolveDataPath(node.for, ctx.scopePaths)\n : undefined;\n const out: RenderNode[] = [];\n items.forEach((item, index) => {\n // Each iteration binds three reserved loop vars: the element (`$<as>`),\n // its position (`$index`), and the array itself (`$items`). `$items`\n // lets a control inside the loop edit the whole list — remove or reorder\n // an element — not just its own value. Both `index` and `items` are\n // reserved names; an `as` of `'index'` or `'items'` would shadow them.\n const innerChain = pushScope(chain, { [node.as]: item, index, items });\n // `$items` resolves to a *writable* path (so `model: \"$items\"` works) only\n // when the loop's source is itself a resolvable path; a literal-array loop\n // exposes the value but stays read-only, exactly as `$<as>` does.\n const nextScopePaths =\n loopBasePath === undefined\n ? ctx.scopePaths\n : [...ctx.scopePaths, `${node.as}=${loopBasePath}.${index}`, `items=${loopBasePath}`];\n const innerCtx: InternalRenderContext = { ...ctx, scopePaths: nextScopePaths };\n // Stamp a stable React-identity key on each item's output: the value at\n // `node.key` (e.g. the row id), or the index when no key path is given.\n // This is what lets looped rows share a `ref` (the trigger target) without\n // colliding as React keys. `withKey` (in render-tree) prefers it over ref.\n const idKey = node.key !== undefined ? getPath(item, node.key) : index;\n const rendered = safeRenderSingle(node.do, innerChain, innerCtx, undefined);\n rendered.forEach((rn, sub) => {\n out.push({ ...rn, key: rendered.length === 1 ? String(idKey) : `${String(idKey)}:${sub}` });\n });\n });\n return [fragment(out)];\n }\n if (isComponentNode(node)) {\n return [renderComponent(node, chain, ctx)];\n }\n return [];\n};\n\nconst renderComponent = (\n node: ComponentNode,\n chain: ScopeChain,\n ctx: InternalRenderContext,\n): RenderNode => {\n // A head and what it holds are drawn by nobody, so no kit has anything to\n // register for them.\n if (!HEAD_NAMES.includes(node.component) && !ctx.registry.has(node.component)) {\n throw new ComponentNotFoundError(\n `Component not found in registry: ${node.component}`,\n { name: node.component },\n );\n }\n // THE ONE PLACE A PROP BECOMES A WORD ON A SCREEN. The swap belongs here\n // rather than in a later walk over the finished tree: the value is already\n // in hand, so translating it costs one lookup instead of a second traversal\n // of everything that was just built.\n //\n // Unlike a text child, a BOUND prop is translated — that is the whole\n // `_display` mechanism, where a query manufactures a closed-set word and a\n // read puts it on the screen. What protects data here is the KEY: `label` is\n // prose, `name` is not, and no value ever votes on the question.\n const pass = ctx.pass;\n const at = pass === undefined ? '' : `${ctx.where}/${node.component}`;\n const props: Record<string, unknown> = Object.fromEntries(\n Object.entries(node.props ?? {}).map(([k, v]) => {\n const resolved = resolve(v, chain);\n if (pass === undefined) return [k, resolved];\n return [k, walkValue(resolved, pass.isProse(k), `${at}.${k}`, pass)];\n }),\n );\n const children = renderChildren(node.children, chain, pass === undefined ? ctx : { ...ctx, where: at });\n\n let model: ModelBindingDescriptor | undefined;\n if (node.model !== undefined) {\n const resolvedPath = resolveDataPath(node.model, ctx.scopePaths);\n if (resolvedPath !== undefined) {\n const ref = node.ref ?? makeAutoRef(node.component, resolvedPath);\n model = { path: resolvedPath, ref };\n // Two-way binding: if the component doesn't already have an explicit\n // `value` prop, auto-derive it from the model expression so the\n // displayed value tracks the data store. Without this, controlled\n // inputs always show their initial value because nothing updates the\n // `value` prop on re-render.\n if (!('value' in props)) {\n props['value'] = resolve(node.model, chain);\n }\n }\n }\n\n const component: RenderNode = {\n type: 'component',\n name: node.component,\n props,\n children,\n ...(node.ref === undefined ? {} : { ref: node.ref }),\n ...(model === undefined ? {} : { model }),\n };\n return component;\n};\n\nconst safeRenderSingle = (\n node: LayoutNode,\n chain: ScopeChain,\n ctx: InternalRenderContext,\n nodeRef: string | undefined,\n): RenderNode[] => {\n try {\n return renderNode(node, chain, ctx);\n } catch (err) {\n const novaError = toRenderError(err);\n if (ctx.strict) throw novaError;\n ctx.onError(novaError);\n return [errorNode(novaError, nodeRef)];\n }\n};\n\nconst renderChildArray = (\n nodes: LayoutNode[],\n chain: ScopeChain,\n ctx: InternalRenderContext,\n): RenderNode[] => {\n const out: RenderNode[] = [];\n for (const child of nodes) out.push(...safeRenderSingle(child, chain, ctx, undefined));\n return out;\n};\n\nconst renderChildren = (\n children: LayoutNode | LayoutNode[] | undefined,\n chain: ScopeChain,\n ctx: InternalRenderContext,\n): RenderNode[] => {\n if (children === undefined) return [];\n if (isArray(children)) return renderChildArray(children, chain, ctx);\n return safeRenderSingle(children, chain, ctx, undefined);\n};\n\nconst toInternal = (ctx: RenderContext): InternalRenderContext => ({\n store: ctx.store,\n registry: ctx.registry,\n strict: ctx.strict ?? false,\n onError: ctx.onError ?? noopOnError,\n scopePaths: [],\n // Built once per render call. The matcher compiles a Set and a suffix list,\n // and doing that per node would make the cheapest branch the expensive one.\n pass: passFor({\n ...(ctx.phrases === undefined ? {} : { phrases: ctx.phrases }),\n ...(ctx.phraseKeys === undefined ? {} : { keys: ctx.phraseKeys }),\n ...(ctx.onPhraseMiss === undefined ? {} : { onMiss: ctx.onPhraseMiss }),\n }),\n where: '',\n});\n\nexport const renderLayout = (\n node: LayoutNode,\n data: Record<string, unknown>,\n ctx: RenderContext,\n): RenderNode[] => {\n const internal = toInternal(ctx);\n return safeRenderSingle(node, createScopeChain(data), internal, undefined);\n};\n\n// Object-form alias for renderLayout. Same semantics, named parameters —\n// so the caller doesn't have to remember the positional order of\n// (layout, data, ctx) and so `data` can be omitted when the layout has\n// no resolvables.\nexport type RenderOptions = {\n layout: LayoutNode;\n data?: Record<string, unknown>;\n store: RenderContext['store'];\n registry: RenderContext['registry'];\n strict?: boolean;\n onError?: RenderOnError;\n phrases?: RenderContext['phrases'];\n phraseKeys?: RenderContext['phraseKeys'];\n onPhraseMiss?: RenderContext['onPhraseMiss'];\n};\n\nexport const render = (options: RenderOptions): RenderNode[] =>\n renderLayout(options.layout, options.data ?? {}, {\n store: options.store,\n registry: options.registry,\n ...(options.strict === undefined ? {} : { strict: options.strict }),\n ...(options.onError === undefined ? {} : { onError: options.onError }),\n ...(options.phrases === undefined ? {} : { phrases: options.phrases }),\n ...(options.phraseKeys === undefined ? {} : { phraseKeys: options.phraseKeys }),\n ...(options.onPhraseMiss === undefined ? {} : { onPhraseMiss: options.onPhraseMiss }),\n });\n\n// Render a layout reading its root data from a DataStore view. Used by the\n// action runtime so layout and action share a single data store instance.\nexport const renderLayoutFromStore = (\n node: LayoutNode,\n store: DataStoreView,\n ctx: RenderContext,\n): RenderNode[] => {\n const internal = toInternal(ctx);\n return safeRenderSingle(node, createScopeChain(store.get()), internal, undefined);\n};\n\nexport type { ScopeChain };\n","import { isComponentNode, isConditionalNode, isLoopNode, isSlotNode } from './guards';\nimport type { LayoutNode } from './schemas';\n\n// ═══════════════════════════════════════════════════════════\n// fillSlots — replace every `{ slot: name }` placeholder in a layout tree with\n// the layout in `fills[name]`. Used by the ActionFragment merge: a fragment's\n// chrome layout has a `{ slot: 'body' }`, and the composing action's own layout\n// is dropped into it. A slot whose name has no fill is left in place — the\n// renderer renders an unfilled slot as nothing.\n//\n// A pure tree-walk modelled on the layout store's `resolveReferences`: recurse\n// through children / then / else / do / arrays, rebuilding the tree.\n// ═══════════════════════════════════════════════════════════\n\nexport const fillSlots = (layout: LayoutNode, fills: Record<string, LayoutNode>): LayoutNode => {\n if (isSlotNode(layout)) {\n const fill = fills[layout.slot];\n return fill === undefined ? layout : fill;\n }\n if (Array.isArray(layout)) {\n return layout.map((node) => fillSlots(node, fills));\n }\n if (isComponentNode(layout)) {\n const { children } = layout;\n if (children === undefined) return layout;\n const next = Array.isArray(children)\n ? children.map((child) => fillSlots(child, fills))\n : fillSlots(children, fills);\n return { ...layout, children: next };\n }\n if (isConditionalNode(layout)) {\n return {\n ...layout,\n then: fillSlots(layout.then, fills),\n ...(layout.else === undefined ? {} : { else: fillSlots(layout.else, fills) }),\n };\n }\n if (isLoopNode(layout)) {\n return { ...layout, do: fillSlots(layout.do, fills) };\n }\n // primitives, layout refs, slot-less nodes — unchanged\n return layout;\n};\n","import type { RenderNode } from './types';\n\n// ═══════════════════════════════════════════════════════════\n// Adapter helpers — framework-agnostic pieces every adapter\n// (React, Vue, …) needs to render a RenderNode tree the same\n// way. See packages/nova/ADAPTER.md for the full contract.\n// ═══════════════════════════════════════════════════════════\n\n// Names of the props an adapter injects on rendered components:\n// `RenderNode.model` → NOVA_MODEL_PROP ({ ref, path }),\n// `RenderNode.ref` → NOVA_REF_PROP (string). Constants so all\n// adapters inject identically and components can rely on them.\nexport const NOVA_MODEL_PROP = 'novaModel';\nexport const NOVA_REF_PROP = 'novaRef';\n\n// Stable identity for a RenderNode within its sibling list.\n// Loop identity (stamped from LoopNode.key/index) wins over ref: a shared\n// `ref` across looped rows is an event-target id, not a list key.\nexport const renderNodeKey = (node: RenderNode, index: number): string => {\n if (node.key !== undefined) return `k:${node.key}`;\n if (node.type === 'component') {\n if (node.ref !== undefined) return `c:${node.ref}`;\n return `c:${node.name}:${index}`;\n }\n if (node.type === 'text') return `t:${index}`;\n if (node.type === 'fragment') return `f:${index}`;\n return `e:${node.code}:${index}`;\n};\n","import { DefinitionValidationError } from '../shared/errors';\nimport { depthRefusal, exceedsDepth } from '@niscorp/strata';\nimport {\n isComponentNode,\n isConditionalNode,\n isLayoutRefNode,\n isLoopNode,\n} from './guards';\nimport { LayoutNodeSchema, type LayoutNode } from './schemas';\nimport type { LayoutStore } from './types';\n\nexport const createLayoutStore = (): LayoutStore => {\n const layouts = new Map<string, LayoutNode>();\n\n const get = (id: string): LayoutNode | undefined => layouts.get(id);\n\n const set = (id: string, layout: LayoutNode): void => {\n // Before the schema: a deep enough layout overflows it (strata depth.ts).\n if (exceedsDepth(layout)) {\n throw new DefinitionValidationError(`Invalid layout for id \"${id}\"`, { failures: [{ id, issues: [{ code: 'custom', path: [], message: depthRefusal(), input: undefined }] }] });\n }\n const result = LayoutNodeSchema.safeParse(layout);\n if (!result.success) {\n throw new DefinitionValidationError(`Invalid layout for id \"${id}\"`, {\n failures: [{ id, issues: result.error.issues }],\n });\n }\n layouts.set(id, layout);\n };\n\n const remove = (id: string): void => {\n layouts.delete(id);\n };\n\n const list = (): string[] => Array.from(layouts.keys());\n\n const resolveReferences = (layout: LayoutNode): LayoutNode => {\n if (isLayoutRefNode(layout)) {\n const target = layouts.get(layout.ref);\n if (target === undefined) return layout;\n return resolveReferences(target);\n }\n if (Array.isArray(layout)) {\n return layout.map(resolveReferences);\n }\n if (isComponentNode(layout)) {\n const children = layout.children;\n let resolvedChildren: LayoutNode | LayoutNode[] | undefined;\n if (children === undefined) {\n resolvedChildren = undefined;\n } else if (Array.isArray(children)) {\n resolvedChildren = children.map(resolveReferences);\n } else {\n resolvedChildren = resolveReferences(children);\n }\n return {\n ...layout,\n ...(resolvedChildren === undefined ? {} : { children: resolvedChildren }),\n };\n }\n if (isConditionalNode(layout)) {\n return {\n ...layout,\n then: resolveReferences(layout.then),\n ...(layout.else === undefined ? {} : { else: resolveReferences(layout.else) }),\n };\n }\n if (isLoopNode(layout)) {\n return {\n ...layout,\n do: resolveReferences(layout.do),\n };\n }\n return layout;\n };\n\n return { get, set, delete: remove, list, resolveReferences };\n};\n","import { z } from 'zod';\nimport { HEAD_LINK_NAME, HEAD_META_NAME, HEAD_NAME, HEAD_SCRIPT_NAME, HEAD_TITLE_NAME } from './head';\nimport type { ComponentMeta } from './types';\n\n// The authoring contracts of a head and the elements it holds (./head): what a\n// layout may set on each. Props are bound and resolved like any other node's.\n//\n// An element's props are its attributes, so these are open records: any\n// attribute HTML gives the element may be written. What each refuses is said\n// in its description, and held by the reader (`headOf`), not by a list here.\n\n// What every element refuses, whatever else it is.\nconst REFUSED_ATTRIBUTES = 'an attribute whose name starts with `on`, or a prop whose name is not an attribute’s name';\n\nconst AttributeSchema = z\n .union([z.string(), z.number(), z.boolean()])\n .describe(\n 'An attribute’s value. Text is written as given, a number as text. `true` writes the attribute with no value. `false`, an empty or blank string, and anything that is none of these (a binding not answered yet, an object, a list) leave the attribute out.',\n );\n\nexport const HeadPropsSchema = z\n .object({})\n .strict()\n .describe(\n 'The document’s <head>. Takes no props. Its children are the elements the head holds — `nova:title`, `nova:meta`, `nova:link`, `nova:script` — placed directly or through loops and conditions; any other component among them is refused and left out, and the rest stand. Draws nothing on the screen. Elements are read in the order written, and where a screen holds several heads, in the order the screen is drawn. A later element takes an earlier one’s place when both are the title, both are a `nova:meta` of the same `name` or `property`, or both are a `nova:link` whose `rel` includes `canonical`. Any other two stand side by side.',\n );\n\nexport const HeadTitlePropsSchema = z\n .object({})\n .strict()\n .describe(\n 'The document’s <title>, inside `nova:head`. Takes no props. Its text is given as its children: a text string, which may hold bindings — not components. A title with no text is left out.',\n );\n\nexport const HeadMetaPropsSchema = z\n .record(z.string(), AttributeSchema)\n .describe(\n `A <meta> element, inside \\`nova:head\\`. Its props are the element’s attributes, written as given: \\`name\\` or \\`property\\` to say what it is, \\`content\\` for its value. Left out while it has no \\`content\\`. A later one with the same \\`name\\` or \\`property\\` takes an earlier one’s place (compared without regard to case; \\`name\\` decides when both are set), and one with neither stands beside the rest. The whole element is refused and left out if it has \\`http-equiv\\`, which instructs the browser rather than describing the document, ${REFUSED_ATTRIBUTES}.`,\n );\n\nexport const HeadLinkPropsSchema = z\n .record(z.string(), AttributeSchema)\n .describe(\n `A <link> element, inside \\`nova:head\\`. Its props are the element’s attributes, written as given: \\`rel\\` to say what the link is, \\`href\\` for its address, and any other the element takes (\\`type\\`, \\`hreflang\\`, \\`sizes\\`, \\`media\\`). Left out while it has no \\`href\\`. A later one whose \\`rel\\` includes \\`canonical\\` takes an earlier canonical’s place; all other links stand side by side. The whole element is refused and left out if its \\`rel\\` includes \\`stylesheet\\`, which styles the page, or it has ${REFUSED_ATTRIBUTES}.`,\n );\n\nexport const HeadScriptPropsSchema = z\n .object({\n type: z\n .string()\n .describe('The kind of data the block holds. Only a JSON type is accepted: `application/json`, or one ending in `+json` such as `application/ld+json`. Any other type, or none, is refused.'),\n data: z\n .unknown()\n .describe('What the block holds: the value itself — an object, a list, a number, text — which is serialised as JSON. Not JSON already written as text. Nothing, `null` or an empty string counts as no data.'),\n })\n .catchall(AttributeSchema)\n .describe(\n `A <script> element that holds data, inside \\`nova:head\\`: \\`type\\`, \\`data\\`, and any other attribute the element takes. Left out while it has no \\`data\\`. Data blocks never take one another’s place. It never runs: the whole element is refused and left out unless its \\`type\\` is a JSON type, and if it has a \\`src\\` or ${REFUSED_ATTRIBUTES}.`,\n );\n\nexport type HeadMetaProps = z.infer<typeof HeadMetaPropsSchema>;\nexport type HeadLinkProps = z.infer<typeof HeadLinkPropsSchema>;\nexport type HeadScriptProps = z.infer<typeof HeadScriptPropsSchema>;\n\nconst described = (schema: z.ZodTypeAny): ComponentMeta => ({ description: schema.description ?? '', propsSchema: schema });\n\n// What to register each name with, for a palette that should offer them.\nexport const HEAD_META: Record<string, ComponentMeta> = {\n [HEAD_NAME]: described(HeadPropsSchema),\n [HEAD_TITLE_NAME]: described(HeadTitlePropsSchema),\n [HEAD_META_NAME]: described(HeadMetaPropsSchema),\n [HEAD_LINK_NAME]: described(HeadLinkPropsSchema),\n [HEAD_SCRIPT_NAME]: described(HeadScriptPropsSchema),\n};\n","import { fillSlots } from '@layout';\nimport type { LayoutNode } from '@layout';\nimport type {\n ActionDefinition,\n ActionFragment,\n EndpointConfig,\n Step,\n TriggerConfig,\n} from './schemas';\n\n// ═══════════════════════════════════════════════════════════\n// composeAction — merge a concrete action with the fragments listed in a\n// push/replace `with`, producing the effective ActionDefinition to instantiate.\n// Composition, not inheritance: the action ALWAYS wins on conflict.\n//\n// - layout: each fragment WRAPS the layout so far — its `{ slot: 'body' }`\n// is filled with the action's own layout (innermost). Fragments\n// fold in array order, so the last listed is the outermost wrap.\n// (Wrapping fragments must use an inline layout, not a store id.)\n// - data: shallow-merge, action wins.\n// - triggers: concat — fragment triggers first, then the action's.\n// - endpoints: merge, action wins on a name clash.\n// - lifecycle: per-hook concat — fragment steps run before the action's.\n// - id/name/description/title/input: the action's (fragments have no say).\n// The result is a plain ActionDefinition.\n// ═══════════════════════════════════════════════════════════\n\nconst HOOKS = ['mount', 'unmount', 'suspend', 'resume'] as const;\n\nexport const composeAction = (\n action: ActionDefinition,\n fragments: ActionFragment[],\n): ActionDefinition => {\n if (fragments.length === 0) return action;\n\n // Layout — wrap the action's layout in each fragment's slot.\n let layout = action.layout;\n for (const frag of fragments) {\n const wrap = frag.layout;\n if (wrap === undefined) continue;\n if (typeof wrap === 'string') {\n layout = wrap; // stored-layout fragment: can't slot-fill, replaces\n continue;\n }\n layout = fillSlots(wrap, layout === undefined ? {} : { body: layout as LayoutNode });\n }\n\n // Data — fragments (in order), then the action on top.\n const data: Record<string, unknown> = {};\n for (const frag of fragments) Object.assign(data, frag.data ?? {});\n Object.assign(data, action.data ?? {});\n\n // Triggers — fragment triggers first, then the action's.\n const triggers: TriggerConfig[] = [\n ...fragments.flatMap((f) => f.triggers ?? []),\n ...(action.triggers ?? []),\n ];\n\n // Endpoints — fragments, then the action (action wins on a name clash).\n const endpoints: Record<string, EndpointConfig> = {};\n for (const frag of fragments) Object.assign(endpoints, frag.endpoints ?? {});\n Object.assign(endpoints, action.endpoints ?? {});\n\n // Lifecycle — per hook, fragment steps before the action's.\n const lifecycle: Record<string, Step[]> = {};\n for (const hook of HOOKS) {\n const steps: Step[] = [\n ...fragments.flatMap((f) => f.lifecycle?.[hook] ?? []),\n ...(action.lifecycle?.[hook] ?? []),\n ];\n if (steps.length > 0) lifecycle[hook] = steps;\n }\n\n return {\n id: action.id,\n ...(action.name === undefined ? {} : { name: action.name }),\n ...(action.description === undefined ? {} : { description: action.description }),\n ...(action.title === undefined ? {} : { title: action.title }),\n ...(action.input === undefined ? {} : { input: action.input }),\n ...(layout === undefined ? {} : { layout }),\n ...(Object.keys(data).length > 0 ? { data } : {}),\n ...(triggers.length > 0 ? { triggers } : {}),\n ...(Object.keys(endpoints).length > 0 ? { endpoints } : {}),\n ...(Object.keys(lifecycle).length > 0 ? { lifecycle } : {}),\n } as ActionDefinition;\n};\n","import { OPS } from './mutations/ops';\nimport type { Mutation, Step } from './schemas';\n\n// What a step list WRITES, derived from the op registry.\n//\n// Three places needed this and each kept its own copy of the op names: the\n// runtime (which steps are mutations), the audit (which data paths a definition\n// fills), and anything reflecting over a definition. `OPS` is already the single\n// source of truth for operations, so it is the source of truth here too — adding\n// an op stays a one-line change in ops/index.ts.\n\n// Every mutation op's key. Derived, so it cannot drift from the ops themselves.\nexport const MUTATION_KEYS: readonly string[] = [...new Set(OPS.map((op) => op.key))];\n\n// Each op's own discrimination. `push` and `pop` are the interesting ones: as a\n// string they name a data path (a mutation), as anything else they are the\n// navigation effect.\nconst MATCHERS = OPS.map((op) => op.match ?? ((step: Record<string, unknown>) => op.key in step));\n\nexport const isMutationStep = (step: Step): step is Mutation => MATCHERS.some((match) => match(step as unknown as Record<string, unknown>));\n\n// Every data path a step list writes, at any depth. `call` branches nest their\n// own steps, so one trigger can load and then set.\nexport const mutationPaths = (steps: unknown): string[] => {\n const found: string[] = [];\n const walk = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) walk(item);\n return;\n }\n if (node === null || typeof node !== 'object') return;\n const step = node as Record<string, unknown>;\n if (isMutationStep(step as unknown as Step)) {\n for (const key of MUTATION_KEYS) {\n const value = step[key];\n if (typeof value === 'string') found.push(value);\n }\n }\n walk(step['onSuccess']);\n walk(step['onError']);\n };\n walk(steps);\n return found;\n};\n\n// `openIssue.issue_id` and `openIssue` are one key: both point the card at an\n// issue. Every reading below compares at this level.\nexport const rootOf = (path: string): string => path.split('.')[0] ?? path;\n","import { collectInteractive } from '../agent/affordances';\nimport { MUTATION_KEYS } from './grammar';\nimport type { ActionDefinition } from './schemas';\n\n// ═══════════════════════════════════════════════════════════\n// auditAction — static analysis of an ActionDefinition's internal wiring.\n//\n// A definition can parse, mount, and render politely while being broken in\n// every way that matters: a table bound to a key no endpoint fills, a search\n// box whose trigger re-calls a load that never reads it, a ref with no\n// trigger (dead chrome), a push into an action that doesn't exist. None of\n// that is visible to a schema parse or a mount probe — it IS visible in the\n// artifact. This audits the definition deterministically: every claim is a\n// cross-reference inside the definition (plus an optional catalog), so there\n// are no heuristics and no false authority.\n//\n// Scope: SELF-CONTAINED definitions with an inline layout — generated\n// actions above all. Hand-authored actions that receive triggers from\n// fragments (`with: [...]`) or bind stored layouts will report issues that\n// composition would resolve; audit the COMPOSED definition instead, or skip.\n// ═══════════════════════════════════════════════════════════\n\nexport type AuditCatalogEntry = {\n id: string;\n // The action's openable-input contract (a JSON Schema). When it carries\n // `properties`, seeded push input keys are checked against them.\n input?: Record<string, unknown>;\n};\n\nexport type AuditOptions = {\n // Known pushable action ids. When given, every push/replace/resetTo\n // target must be one of them (or the definition's own id), with input\n // keys from its contract.\n catalog?: ReadonlyArray<AuditCatalogEntry>;\n // Known message channels (derive them from the registered definitions —\n // see collectChannels). When given, a `message:` listen must name a known\n // channel or one this definition emits itself; an `emit` must name a known\n // channel or one this definition listens on. Catches the silent\n // never-fires class (\"tasks:changed\" vs \"tasks-changed\").\n channels?: ReadonlyArray<string>;\n};\n\nexport type AuditResult = { ok: boolean; issues: string[] };\n\n// The channels a definition talks on — every `message:` trigger (listens)\n// and every `emit` step (emits), nested steps included. Walk a whole\n// registry's definitions to derive the app's live channel vocabulary.\nexport type ChannelUsage = { emits: string[]; listens: string[] };\n\nexport const collectChannels = (definition: ActionDefinition): ChannelUsage => {\n const emits = new Set<string>();\n const listens = new Set<string>();\n\n const walkSteps = (list: unknown): void => {\n if (!Array.isArray(list)) return;\n for (const step of list) {\n if (!isRecord(step)) continue;\n const emit = step['emit'];\n if (isRecord(emit) && typeof emit['channel'] === 'string') emits.add(emit['channel']);\n if (typeof step['call'] === 'string') {\n walkSteps(step['onSuccess']);\n walkSteps(step['onError']);\n }\n }\n };\n for (const trigger of definition.triggers ?? []) {\n if (typeof trigger.message === 'string') listens.add(trigger.message);\n walkSteps(trigger.do);\n }\n for (const hook of Object.values(definition.lifecycle ?? {})) walkSteps(hook);\n\n return { emits: [...emits].sort(), listens: [...listens].sort() };\n};\n\n// Mutation ops whose value is a data PATH (see action/mutations/ops). The\nconst firstSegment = (path: string): string => {\n const segment = path.split('.')[0];\n return segment === undefined || segment.length === 0 ? path : segment;\n};\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\n\ntype NavTarget = { action: string; input?: Record<string, unknown> };\n\nconst navTargetOf = (step: Record<string, unknown>): NavTarget | undefined => {\n for (const key of ['push', 'replace', 'resetTo']) {\n const value = step[key];\n if (isRecord(value) && typeof value['action'] === 'string') {\n const input = value['input'];\n return { action: value['action'], ...(isRecord(input) ? { input } : {}) };\n }\n }\n return undefined;\n};\n\nexport const auditAction = (definition: ActionDefinition, options?: AuditOptions): AuditResult => {\n const issues: string[] = [];\n const dataKeys = new Set(Object.keys(definition.data ?? {}));\n const endpointNames = new Set(Object.keys(definition.endpoints ?? {}));\n\n // ── collect every step (structurally — nested onSuccess/onError included),\n // wherever steps live: triggers and lifecycle hooks ──\n const steps: Record<string, unknown>[] = [];\n const pushSteps = (list: unknown): void => {\n if (!Array.isArray(list)) return;\n for (const step of list) {\n if (!isRecord(step)) continue;\n steps.push(step);\n if (typeof step['call'] === 'string') {\n pushSteps(step['onSuccess']);\n pushSteps(step['onError']);\n }\n }\n };\n for (const trigger of definition.triggers ?? []) pushSteps(trigger.do);\n for (const hook of Object.values(definition.lifecycle ?? {})) pushSteps(hook);\n\n // ── steps: calls name real endpoints; mutations write declared keys;\n // navigation targets exist in the catalog with legal input keys ──\n for (const step of steps) {\n const call = step['call'];\n if (typeof call === 'string' && !endpointNames.has(call)) {\n issues.push(`step calls endpoint \"${call}\" but endpoints has no \"${call}\"`);\n }\n\n for (const key of MUTATION_KEYS) {\n const path = step[key];\n if (typeof path === 'string' && path.length > 0 && !dataKeys.has(firstSegment(path))) {\n issues.push(`step \"${key}: ${path}\" writes a key with no default in data`);\n }\n }\n\n const nav = navTargetOf(step);\n if (nav !== undefined && options?.catalog !== undefined) {\n const entry = options.catalog.find((candidate) => candidate.id === nav.action);\n if (entry === undefined && nav.action !== definition.id) {\n issues.push(`step pushes action \"${nav.action}\" which is not in the catalog`);\n continue;\n }\n const properties = entry?.input?.['properties'];\n if (nav.input !== undefined && isRecord(properties)) {\n for (const key of Object.keys(nav.input)) {\n if (!(key in properties)) {\n issues.push(`push to \"${nav.action}\" seeds input key \"${key}\" which is not in its input contract`);\n }\n }\n }\n }\n }\n\n // ── endpoints: targets land on declared keys ──\n for (const [name, endpoint] of Object.entries(definition.endpoints ?? {})) {\n for (const field of ['target', 'errorTarget'] as const) {\n const target = endpoint[field];\n if (typeof target === 'string' && target.length > 0 && !dataKeys.has(firstSegment(target))) {\n issues.push(`endpoint \"${name}\" ${field} \"${target}\" has no default in data`);\n }\n }\n }\n\n // ── message channels (when the app's vocabulary is provided) ──\n if (options?.channels !== undefined) {\n const known = new Set(options.channels);\n const usage = collectChannels(definition);\n for (const channel of usage.listens) {\n if (!known.has(channel) && !usage.emits.includes(channel)) {\n issues.push(`trigger listens on channel \"${channel}\" which nothing is known to emit`);\n }\n }\n for (const channel of usage.emits) {\n if (!known.has(channel) && !usage.listens.includes(channel)) {\n issues.push(`step emits channel \"${channel}\" which nothing is known to listen on`);\n }\n }\n }\n\n // ── layout ↔ data ↔ triggers (inline layouts only) ──\n if (definition.layout !== undefined && typeof definition.layout !== 'string') {\n const surface = collectInteractive(definition.layout);\n\n for (const key of surface.boundKeys) {\n if (!dataKeys.has(key)) {\n issues.push(`layout binds \"$.${key}\" but data has no \"${key}\" default`);\n }\n }\n\n for (const suspect of surface.suspectBindings) {\n issues.push(\n `layout binding \"${suspect}…\" is malformed — the data root is \"$.\" (\"$.key\"), and \"$name.\" is only legal for a loop variable declared by an enclosing for/as`,\n );\n }\n\n const layoutRefs = new Set(surface.refs.map((entry) => entry.ref));\n const triggerRefs = new Set(\n (definition.triggers ?? [])\n .map((trigger) => trigger.ref)\n .filter((ref): ref is string => typeof ref === 'string'),\n );\n for (const ref of layoutRefs) {\n if (!triggerRefs.has(ref)) {\n issues.push(`layout ref \"${ref}\" has no trigger — dead chrome`);\n }\n }\n for (const ref of triggerRefs) {\n if (!layoutRefs.has(ref)) {\n issues.push(`trigger listens on ref \"${ref}\" but no layout node carries it`);\n }\n }\n }\n\n return { ok: issues.length === 0, issues };\n};\n","import type { ActionDefinition } from '@action';\nimport { mutationPaths, rootOf } from '@action/grammar';\n\n// What an action does with its DATA KEYS, read off its own definition.\n//\n// Four questions, each a pure function of the artifact and each with more than\n// one consumer: an audit asking whether declared state is reachable, an agent\n// asking whether a change was a person or a re-read, a devtools pane asking what\n// fills a field. Every one of them was being re-derived outside nova, which is\n// how a hand-copied list of mutation ops ended up in an application.\n\n// What a FINGER can write: every data path a `ui:` trigger sets.\nexport const gesturedKeys = (definition: ActionDefinition): readonly string[] => [\n ...new Set(\n (definition.triggers ?? [])\n .filter((trigger) => typeof trigger.event === 'string' && trigger.event.startsWith('ui:'))\n .flatMap((trigger) => mutationPaths(trigger.do))\n .map(rootOf),\n ),\n];\n\n// What an OPENER may set: the declared input contract.\nexport const declaredKeys = (definition: ActionDefinition): readonly string[] =>\n Object.keys((definition.input as { properties?: Record<string, unknown> } | undefined)?.properties ?? {});\n\n// What the DATABASE writes: every endpoint's landing place.\nexport const loadedKeys = (definition: ActionDefinition): readonly string[] => {\n const loaded = new Set<string>();\n for (const endpoint of Object.values(definition.endpoints ?? {})) {\n const spec = endpoint as { target?: string; errorTarget?: string };\n if (spec.target !== undefined) loaded.add(rootOf(spec.target));\n if (spec.errorTarget !== undefined) loaded.add(rootOf(spec.errorTarget));\n }\n return [...loaded];\n};\n\n// What a surface writes to ITSELF when it opens or resumes: a loading flag\n// clearing, a working flag resetting.\nexport const lifecycleKeys = (definition: ActionDefinition): readonly string[] => [\n ...new Set(\n Object.values((definition.lifecycle ?? {}) as Record<string, unknown>)\n .flatMap(mutationPaths)\n .map(rootOf),\n ),\n];\n\n// Endpoint names a `mount` step calls, at any depth.\nconst mountCalls = (definition: ActionDefinition): Set<string> => {\n const names = new Set<string>();\n const walk = (node: unknown): void => {\n if (Array.isArray(node)) {\n for (const item of node) walk(item);\n return;\n }\n if (node === null || typeof node !== 'object') return;\n const step = node as Record<string, unknown>;\n if (typeof step['call'] === 'string') names.add(step['call']);\n walk(step['onSuccess']);\n walk(step['onError']);\n };\n walk((definition.lifecycle as { mount?: unknown } | undefined)?.mount);\n return names;\n};\n\n// Every `$.<key>` an endpoint's request reads. `{ id: { $ref: '$.issueId' } }`\n// and the bare form `'$.issueId'` both count.\nconst requestKeys = (request: unknown): string[] => {\n const found: string[] = [];\n const walk = (node: unknown): void => {\n if (typeof node === 'string') {\n if (node.startsWith('$.')) found.push(rootOf(node.slice(2)));\n return;\n }\n if (Array.isArray(node)) {\n for (const item of node) walk(item);\n return;\n }\n if (node === null || typeof node !== 'object') return;\n for (const value of Object.values(node as Record<string, unknown>)) walk(value);\n };\n walk(request);\n return found.filter((key) => key !== '');\n};\n\nconst mountInputCache = new WeakMap<ActionDefinition, ReadonlySet<string>>();\n\n// Input keys the surface consumes WHEN IT OPENS: an id its own mount-time load\n// sends. Writing one into a live instance leaves the previous record's data on\n// screen, so a caller that wants to re-aim must re-mount instead.\n//\n// Cached per definition object: definitions are read on every telemetry event,\n// and a bundle sync replaces them wholesale, so identity is the right key.\nexport const mountInputKeys = (definition: ActionDefinition): ReadonlySet<string> => {\n const cached = mountInputCache.get(definition);\n if (cached !== undefined) return cached;\n const called = mountCalls(definition);\n const declared = new Set(declaredKeys(definition));\n const keys = new Set<string>();\n for (const [name, endpoint] of Object.entries(definition.endpoints ?? {})) {\n if (!called.has(name)) continue;\n for (const key of requestKeys((endpoint as { request?: unknown }).request)) if (declared.has(key)) keys.add(key);\n }\n mountInputCache.set(definition, keys);\n return keys;\n};\n"]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as ActionDefinition } from '../index-caZoXSwr.cjs';
|
|
2
|
-
import { a as Shell, i as FunctionHandler } from '../types-
|
|
2
|
+
import { a as Shell, i as FunctionHandler } from '../types-qkzTfSye.cjs';
|
|
3
3
|
import '../effects-CndX9K7D.cjs';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../schemas-DPdeFlCT.cjs';
|
|
6
|
-
import '../types-
|
|
6
|
+
import '../types-j290XhCn.cjs';
|
|
7
7
|
import '../schemas-pMyyuXV7.cjs';
|
|
8
8
|
|
|
9
9
|
declare const DEVTOOLS_CANVAS = "devtools";
|
package/dist/devtools/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { A as ActionDefinition } from '../index-CNfzSBe2.js';
|
|
2
|
-
import { a as Shell, i as FunctionHandler } from '../types-
|
|
2
|
+
import { a as Shell, i as FunctionHandler } from '../types-D23TRvqe.js';
|
|
3
3
|
import '../effects-CndX9K7D.js';
|
|
4
4
|
import 'zod';
|
|
5
5
|
import '../schemas-DPdeFlCT.js';
|
|
6
|
-
import '../types-
|
|
6
|
+
import '../types-qnKMx0_V.js';
|
|
7
7
|
import '../schemas-pMyyuXV7.js';
|
|
8
8
|
|
|
9
9
|
declare const DEVTOOLS_CANVAS = "devtools";
|
package/dist/devtools/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describeInstance, auditCatalog, snapshotShell } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { describeInstance, auditCatalog, snapshotShell } from '../chunk-3JRTELLC.js';
|
|
2
|
+
import '../chunk-Y6XVPRYH.js';
|
|
3
3
|
import '../chunk-OGD5CCMZ.js';
|
|
4
4
|
import '../chunk-7TS3YVQR.js';
|
|
5
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-OE4E6IBD.js';
|
|
6
6
|
import '../chunk-DIFE573X.js';
|
|
7
7
|
import '../chunk-JI7ZRESP.js';
|
|
8
8
|
import '../chunk-RBU5PHN4.js';
|