@niscorp/nova 0.2.2 → 0.3.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/CHANGELOG.md +51 -0
- package/dist/adapters/dom/index.cjs +5 -5
- package/dist/adapters/dom/index.js +3 -3
- package/dist/adapters/dom/server.cjs +4 -4
- package/dist/adapters/dom/server.js +3 -3
- package/dist/adapters/react/components/index.cjs +23 -23
- package/dist/adapters/react/components/index.d.cts +2 -2
- package/dist/adapters/react/components/index.d.ts +2 -2
- package/dist/adapters/react/components/index.js +4 -4
- package/dist/adapters/react/index.cjs +26 -26
- package/dist/adapters/react/index.js +4 -4
- package/dist/adapters/tty/index.cjs +2 -2
- package/dist/adapters/tty/index.js +2 -2
- package/dist/adapters/vue/components/index.cjs +23 -23
- package/dist/adapters/vue/components/index.d.cts +10 -10
- package/dist/adapters/vue/components/index.d.ts +10 -10
- package/dist/adapters/vue/components/index.js +4 -4
- package/dist/adapters/vue/index.cjs +31 -31
- package/dist/adapters/vue/index.js +5 -5
- package/dist/{chunk-F2H7WP6R.js → chunk-7MATRNZZ.js} +5 -5
- package/dist/{chunk-F2H7WP6R.js.map → chunk-7MATRNZZ.js.map} +1 -1
- package/dist/{chunk-3IPM5QBT.cjs → chunk-AGEAMUQR.cjs} +6 -6
- package/dist/{chunk-3IPM5QBT.cjs.map → chunk-AGEAMUQR.cjs.map} +1 -1
- package/dist/{chunk-OO247V4J.cjs → chunk-ECFWPZGL.cjs} +34 -34
- package/dist/{chunk-OO247V4J.cjs.map → chunk-ECFWPZGL.cjs.map} +1 -1
- package/dist/{chunk-VOD5JA4D.js → chunk-EG45GQOE.js} +3 -3
- package/dist/{chunk-VOD5JA4D.js.map → chunk-EG45GQOE.js.map} +1 -1
- package/dist/{chunk-5AF72LOE.cjs → chunk-HYFNOF7Y.cjs} +4 -4
- package/dist/{chunk-5AF72LOE.cjs.map → chunk-HYFNOF7Y.cjs.map} +1 -1
- package/dist/{chunk-TMLNVU5W.cjs → chunk-M3UFIUXK.cjs} +7 -7
- package/dist/{chunk-TMLNVU5W.cjs.map → chunk-M3UFIUXK.cjs.map} +1 -1
- package/dist/{chunk-DU2VIJAF.js → chunk-P5SJ3QXJ.js} +3 -3
- package/dist/{chunk-DU2VIJAF.js.map → chunk-P5SJ3QXJ.js.map} +1 -1
- package/dist/{chunk-IZ2UU5UL.cjs → chunk-PBPUSZIQ.cjs} +2 -2
- package/dist/chunk-PBPUSZIQ.cjs.map +1 -0
- package/dist/{chunk-SVNK5NIK.js → chunk-QLFHYHJ2.js} +4 -4
- package/dist/{chunk-SVNK5NIK.js.map → chunk-QLFHYHJ2.js.map} +1 -1
- package/dist/{chunk-G4LSLLGI.js → chunk-RB4OMSPA.js} +5 -5
- package/dist/{chunk-G4LSLLGI.js.map → chunk-RB4OMSPA.js.map} +1 -1
- package/dist/{chunk-3JRTELLC.js → chunk-X5JTZ5LW.js} +3 -3
- package/dist/{chunk-3JRTELLC.js.map → chunk-X5JTZ5LW.js.map} +1 -1
- package/dist/{chunk-Y6XVPRYH.js → chunk-XUSKGJRI.js} +2 -2
- package/dist/chunk-XUSKGJRI.js.map +1 -0
- package/dist/{chunk-WGPFR7MN.cjs → chunk-Z7CS43ZT.cjs} +22 -22
- package/dist/{chunk-WGPFR7MN.cjs.map → chunk-Z7CS43ZT.cjs.map} +1 -1
- package/dist/{chunk-TRJYDVWK.cjs → chunk-ZYTWQZZC.cjs} +21 -21
- package/dist/{chunk-TRJYDVWK.cjs.map → chunk-ZYTWQZZC.cjs.map} +1 -1
- package/dist/devtools/index.cjs +5 -5
- package/dist/devtools/index.js +2 -2
- package/dist/index.cjs +40 -40
- package/dist/index.js +2 -2
- package/dist/reflect/index.cjs +20 -20
- package/dist/reflect/index.js +2 -2
- package/package.json +5 -5
- package/dist/chunk-IZ2UU5UL.cjs.map +0 -1
- package/dist/chunk-Y6XVPRYH.js.map +0 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/reflect/walk.ts","../src/reflect/audit.ts","../src/reflect/shell.ts","../src/reflect/graph.ts","../src/reflect/cycles.ts","../src/reflect/liveness.ts"],"names":[],"mappings":";;;AAcO,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,KAAA,KAAU,IAAA,IAAQ,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK;AAI9D,IAAM,SAAA,GAAY,CAAC,KAAA,EAAgB,KAAA,KAA2D;AACnG,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,IAAA,IAAQ,KAAA,EAAO,SAAA,CAAU,IAAA,EAAM,KAAK,CAAA;AAC/C,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG;AACtB,EAAA,KAAA,CAAM,KAAK,CAAA;AACX,EAAA,KAAA,MAAW,SAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA,EAAG,SAAA,CAAU,OAAO,KAAK,CAAA;AAClE;AAIO,IAAM,YAAA,GAAe,CAAC,KAAA,KAAgC;AAC3D,EAAA,MAAM,GAAA,uBAAU,GAAA,EAAY;AAC5B,EAAA,SAAA,CAAU,KAAA,EAAO,CAAC,MAAA,KAAW;AAC3B,IAAA,IAAI,OAAO,OAAO,WAAW,CAAA,KAAM,UAAU,GAAA,CAAI,GAAA,CAAI,MAAA,CAAO,WAAW,CAAC,CAAA;AAAA,EAC1E,CAAC,CAAA;AACD,EAAA,OAAO,GAAA;AACT;AAKO,IAAM,MAAA,GAAS,CAAC,KAAA,KAAgC;AACrD,EAAA,MAAM,GAAA,uBAAU,GAAA,EAAY;AAC5B,EAAA,SAAA,CAAU,KAAA,EAAO,C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AAA;AAAA,IAC/E,OAAA,EAAS,CAAC,GAAG,IAAI,IAAI,QAAA,CAAS,GAAA,CAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,OAAO,CAAA,CAAE,MAAA,CAAO,CAAC,OAAA,KAA+B,OAAO,YAAY,QAAQ,CAAC,CAAC,CAAA,CAAE,IAAA,EAAK;AAAA,IAC3I,SAAA;AAAA,IACA,YAAA,EAAc,OAAO,MAAA,KAAW;AAAA,GAClC;AACF","file":"chunk-3JRTELLC.js","sourcesContent":["// ═══════════════════════════════════════════════════════════\n// The one traversal the codebase kept re-writing. A nova artifact — a layout,\n// a render tree, a definition, a whole manifest — is nested plain objects and\n// arrays; walking it to collect or check \"every node that has X\" was\n// hand-rolled in moss (collectComponents, hasVisibleContent) and relay's\n// devtools (walk, collectLoopVars, collectPropRefs). This is that walk, once,\n// plus the collectors that ride it.\n//\n// This is the STRUCTURAL walk — it visits every plain-object record. The\n// SEMANTIC walkers (collectChannels, which follows call→onSuccess; the typed\n// RenderNode model-binding walk) stay their own thing: folding them onto a\n// blind structural walk would lose their precision.\n// ═══════════════════════════════════════════════════════════\n\nexport const isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\n\n// Visit every plain-object record in a nova tree, arrays and nested objects\n// included. The visitor sees each record before its children.\nexport const walkNodes = (value: unknown, visit: (record: Record<string, unknown>) => void): void => {\n if (Array.isArray(value)) {\n for (const item of value) walkNodes(item, visit);\n return;\n }\n if (!isRecord(value)) return;\n visit(value);\n for (const inner of Object.values(value)) walkNodes(inner, visit);\n};\n\n// Every component NAME referenced anywhere in a tree — layouts, render trees,\n// fragments, a manifest. (Was moss's `collectComponents`.)\nexport const componentsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (typeof record['component'] === 'string') out.add(record['component']);\n });\n return out;\n};\n\n// Every ref carried by a `ref` / `*Ref` key INSIDE a component's props — the\n// refs a component dispatches for (a Table's rowRef, a cell's ref), which\n// node-level `ref:` analysis doesn't see. (Was devtools' `collectPropRefs`.)\nexport const refsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (record['component'] === undefined || !isRecord(record['props'])) return;\n walkNodes(record['props'], (props) => {\n for (const [key, propValue] of Object.entries(props)) {\n if ((key === 'ref' || key.endsWith('Ref')) && typeof propValue === 'string' && propValue !== '') out.add(propValue);\n }\n });\n });\n return out;\n};\n\n// Every loop `as:` variable declared anywhere in a layout — the names that are\n// in scope at runtime inside a `for`. (Was devtools' `collectLoopVars`.)\nexport const loopVarsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (typeof record['as'] === 'string' && record['for'] !== undefined) out.add(record['as']);\n });\n return out;\n};\n","import { auditAction, collectChannels } from '@action';\nimport type { ActionDefinition } from '@action';\nimport { loopVarsOf, refsOf } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// Audit classification — the static auditAction (action/audit.ts) has three\n// known blind spots; each is decidable from the definition itself. This turns\n// a raw issue string into `address` (a real break a human should see) or\n// `info` (runtime-explained). It's nova reasoning about its OWN audit\n// semantics — generic, not app opinion — so it lives here, not in an app's\n// devtools. Uses the walk collectors (loopVarsOf/refsOf).\n// ═══════════════════════════════════════════════════════════\n\nexport type IssueClass = { kind: 'address' } | { kind: 'info'; tag: string; reason: string };\n\nexport const classifyAudit = (issue: string, definition: ActionDefinition): IssueClass => {\n const layout = typeof definition.layout === 'object' ? definition.layout : undefined;\n\n const bind = issue.match(/binds \"\\$\\.([\\w.]+)\"/);\n if (bind !== null) {\n const root = (bind[1] ?? '').split('.')[0] ?? '';\n if (root === 'index' || root === 'items') {\n return { kind: 'info', tag: 'loop scope', reason: `\\`${root}\\` is a renderer-reserved loop variable` };\n }\n if (loopVarsOf(layout).has(root)) {\n return { kind: 'info', tag: 'loop var', reason: `\\`${root}\\` is a loop \\`as:\\` variable — in scope at runtime` };\n }\n }\n\n const ref = issue.match(/ref \"([^\"]+)\"/);\n if (ref !== null && issue.includes('listens') && refsOf(layout).has(ref[1] ?? '')) {\n return { kind: 'info', tag: 'prop ref', reason: 'dispatched by a component from a props value (e.g. Table rowRef / cell.ref)' };\n }\n\n if (issue.includes('{{')) {\n return { kind: 'info', tag: 'template', reason: 'target resolves from data at runtime — statically unknowable' };\n }\n\n return { kind: 'address' };\n};\n\nexport type ClassifiedIssue = { issue: string } & IssueClass;\nexport type CatalogAuditRow = { id: string; address: number; issues: ClassifiedIssue[] };\n\n// Audit a whole set of definitions and classify every finding: each definition\n// is checked against a catalog + channel vocabulary derived from the set, so\n// cross-action wiring (a push to a missing action, a channel nobody serves) is\n// visible. Rows carry unresolved (`address`) findings first and sort by how\n// many they have. The self-audit devtools render this verbatim.\nexport const auditCatalog = (\n definitions: Record<string, ActionDefinition> | readonly ActionDefinition[],\n): CatalogAuditRow[] => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const catalog = defs.map((definition) => ({ id: definition.id, ...(definition.input !== undefined ? { input: definition.input } : {}) }));\n const channels = [\n ...new Set(\n defs.flatMap((definition) => {\n const usage = collectChannels(definition);\n return [...usage.emits, ...usage.listens];\n }),\n ),\n ];\n return defs\n .map((definition): CatalogAuditRow => {\n const issues = auditAction(definition, { catalog, channels }).issues.map((issue): ClassifiedIssue => ({ issue, ...classifyAudit(issue, definition) }));\n issues.sort((a, b) => Number(a.kind === 'info') - Number(b.kind === 'info'));\n return { id: definition.id, address: issues.filter((issue) => issue.kind === 'address').length, issues };\n })\n .filter((row) => row.issues.length > 0)\n .sort((a, b) => b.address - a.address);\n};\n","import type { Shell } from '@shell';\nimport type { ActionDefinition, EndpointConfig, TriggerConfig } from '@action';\nimport type { LayoutNode } from '@layout';\nimport { classifyAudit, type ClassifiedIssue } from './audit';\nimport { auditAction } from '@action';\n\n// ═══════════════════════════════════════════════════════════\n// Shell reflection — nova reading its own running state. The canvas/instance\n// tree (snapshotShell) and a full model for one instance (describeInstance).\n// Both were re-derived in relay's devtools fns; they're pure reads over the\n// Shell's own introspection API, so they belong here. Consumers: devtools, and\n// (server-ladder) the working-set / level-streaming that walks the same tree.\n// ═══════════════════════════════════════════════════════════\n\nexport type InstanceRef = {\n definitionId: string;\n instanceId: string;\n status: string;\n active: boolean;\n};\n\nexport type CanvasRef = {\n id: string;\n depth: number;\n // top-of-stack first\n items: InstanceRef[];\n};\n\nexport type ShellSnapshot = {\n canvases: CanvasRef[];\n layouts: string[];\n // every component name the shell's registry can render\n components: string[];\n};\n\n// The whole shell as a tree of canvases → instances, plus the shell-level\n// model (layout store ids, registered component names). `exclude` drops\n// canvases the caller owns (a devtools canvas shouldn't inspect itself).\nexport const snapshotShell = (shell: Shell, exclude: readonly string[] = []): ShellSnapshot => {\n const state = shell.getState();\n const canvases = Object.values(state.canvases)\n .filter((canvas) => !exclude.includes(canvas.id))\n .map((canvas): CanvasRef => ({\n id: canvas.id,\n depth: canvas.stack.length,\n items: [...canvas.stack].reverse().map((instance): InstanceRef => ({\n definitionId: instance.definitionId,\n instanceId: instance.id,\n status: instance.status,\n active: instance.id === canvas.active?.id,\n })),\n }));\n return { canvases, layouts: shell.layoutStore.list(), components: shell.registry.list() };\n};\n\n// ─── the shell as text ─────────────────────────────────────\n// What a model is shown when it has to reason about a screen. Same tree as\n// snapshotShell, rendered flat with each card's live data.\n//\n// Long arrays collapse to a head and a count: an agent looking at the same\n// screen many times a shift cannot pay for forty rows each time, and a person\n// reading a board of forty does not hold forty either.\n\nexport type DescribeShellOptions = {\n // Canvases to render. Default: all of them.\n only?: readonly string[];\n // Marks an instance in the output. An agent whose answer is the complete state\n // of its own canvases has to tell its cards from the person's.\n mark?: (instanceId: string) => string | undefined;\n // Array length past which values collapse. 0 disables collapsing.\n collapseOver?: number;\n head?: number;\n // Last pass over each card's data before it is written. A caller that knows\n // which fields are for rendering rather than reading — tones, formatted\n // stamps — drops them here instead of paying for them.\n clean?: (data: Record<string, unknown>) => Record<string, unknown>;\n};\n\nconst compact = (value: unknown, over: number, head: number): unknown => {\n if (Array.isArray(value)) {\n return over === 0 || value.length <= over ? value.map((item) => compact(item, over, head)) : [...value.slice(0, head).map((item) => compact(item, over, head)), `…${value.length - head} more`];\n }\n if (value === null || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [key, inner] of Object.entries(value as Record<string, unknown>)) out[key] = compact(inner, over, head);\n return out;\n};\n\nexport const describeShell = (shell: Shell, options: DescribeShellOptions = {}): string => {\n const { only, mark, collapseOver = 5, head = 3, clean } = options;\n const lines: string[] = [];\n for (const [canvasId, canvas] of Object.entries(shell.getState().canvases)) {\n if (only !== undefined && !only.includes(canvasId)) continue;\n if (canvas.active === undefined) {\n lines.push(` ${canvasId}: (empty)`);\n continue;\n }\n lines.push(` ${canvasId}: ${canvas.stack.map((item, index) => `${item.definitionId}${index === canvas.stack.length - 1 ? '*' : ''}`).join(' › ')}`);\n for (const item of canvas.stack) {\n const runtime = shell.getRuntime(item.id);\n const note = mark?.(item.id);\n const data = runtime === undefined ? undefined : (clean ?? ((value: Record<string, unknown>) => value))(runtime.getData());\n lines.push(` ${item.definitionId}${note === undefined ? '' : ` ${note}`} data: ${data === undefined ? '{}' : JSON.stringify(compact(data, collapseOver, head))}`);\n }\n }\n return lines.join('\\n');\n};\n\nexport type InstanceModel = {\n id: string;\n instanceId: string;\n canvasId: string;\n status: string;\n title: string;\n data: Record<string, unknown>;\n endpoints: Array<{ name: string; config: EndpointConfig }>;\n triggers: TriggerConfig[];\n lifecycle: Record<string, unknown>;\n layoutKind: 'inline' | 'store';\n layout: LayoutNode | undefined;\n input: Record<string, unknown> | undefined;\n issues: ClassifiedIssue[];\n};\n\n// The full model for one live instance — its definition wiring, its current\n// data, and its classified audit. `undefined` when the id isn't mounted.\nexport const describeInstance = (shell: Shell, instanceId: string): InstanceModel | undefined => {\n const runtime = shell.getRuntime(instanceId);\n if (runtime === undefined) return undefined;\n\n const definition: ActionDefinition = runtime.definition;\n const layout = definition.layout;\n const layoutNode = typeof layout === 'string' ? shell.layoutStore.get(layout) : layout;\n const issues = auditAction(definition).issues.map((issue): ClassifiedIssue => ({ issue, ...classifyAudit(issue, definition) }));\n\n return {\n id: definition.id,\n instanceId,\n canvasId: runtime.instance.canvasId,\n status: runtime.instance.status,\n title: definition.title ?? '',\n data: runtime.getData(),\n endpoints: Object.entries(definition.endpoints ?? {}).map(([name, config]) => ({ name, config })),\n triggers: definition.triggers ?? [],\n lifecycle: definition.lifecycle ?? {},\n layoutKind: typeof layout === 'string' ? 'store' : 'inline',\n layout: layoutNode,\n input: definition.input,\n issues,\n };\n};\n","import { collectChannels } from '@action';\nimport type { ActionDefinition } from '@action';\nimport { walkNodes, isRecord } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// The action graph — each action's outgoing edges: the actions it can push to\n// (navigation) and the channels it emits/listens on. This is the adjacency the\n// audit closure walks per role, and the neighbourhood the server ladder's\n// working-set / level-streaming serves by radius. Built on the walk (nav\n// targets) + the semantic channel walker. Reachability (radius-N) layers on\n// top when working-set streaming lands.\n// ═══════════════════════════════════════════════════════════\n\n// Every action a definition navigates to — push/replace/resetTo targets in its\n// triggers and lifecycle. A template target ({{…}}) is runtime-resolved, kept\n// as-is so a caller can see it's dynamic.\nconst navTargetsOf = (definition: ActionDefinition): string[] => {\n const out = new Set<string>();\n const scan = (value: unknown): void =>\n walkNodes(value, (record) => {\n for (const key of ['push', 'replace', 'resetTo']) {\n const target = record[key];\n if (isRecord(target) && typeof target['action'] === 'string') out.add(target['action']);\n }\n });\n scan(definition.triggers ?? []);\n scan(definition.lifecycle ?? {});\n return [...out].sort();\n};\n\nexport type ActionNode = {\n id: string;\n pushes: string[];\n emits: string[];\n listens: string[];\n};\n\nexport type ActionGraph = {\n nodes: ActionNode[];\n // ids referenced as push targets that aren't defined here (a dangling edge)\n dangling: string[];\n};\n\nexport const actionGraph = (\n definitions: Record<string, ActionDefinition> | readonly ActionDefinition[],\n): ActionGraph => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const known = new Set(defs.map((definition) => definition.id));\n const dangling = new Set<string>();\n\n const nodes = defs.map((definition): ActionNode => {\n const pushes = navTargetsOf(definition);\n for (const target of pushes) if (!target.includes('{{') && !known.has(target)) dangling.add(target);\n const usage = collectChannels(definition);\n return { id: definition.id, pushes, emits: usage.emits, listens: usage.listens };\n });\n\n return { nodes, dangling: [...dangling].sort() };\n};\n","import type { ActionDefinition } from '@action';\nimport { isRecord } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// CHAINS THAT NEVER END, found in the definitions. A step list has no\n// conditionals, so once a chain can come back to where it started it always\n// will: a trigger on `x` that emits `x`, two triggers answering each other, a\n// mount that reloads itself, a mount whose emit reaches a trigger that pushes\n// the same action again. The runtime stops every such chain at its budget\n// (action/runtime/cause.ts); this finds them before anything runs.\n//\n// The graph: a node is where steps start running — a channel (its message\n// triggers) or an action's mount. An edge is a step that starts more:\n//\n// · `emit: c` → the channel c\n// · `reload` → this action's own mount\n// · `push`/`replace`/`resetTo` of A → A's mount\n//\n// followed through `call`'s onSuccess/onError, which run as part of the same\n// chain. A channel or target written as a template (`{{…}}`) is decided at\n// runtime and has no edge; a push to an action not in the set has none\n// either. Fragment triggers join when an action is composed — walk the\n// composed definitions to see them.\n// ═══════════════════════════════════════════════════════════\n\nexport type ChainStep = {\n // Where the steps run: `channel:x` or `mount:<action id>`.\n from: string;\n to: string;\n // The action whose trigger or mount carries the step.\n action: string;\n // What the step is: `emit`, `reload`, `push`, `replace`, `resetTo`.\n via: string;\n};\n\nexport type ChainCycle = {\n // The steps round the cycle, back to where it started.\n steps: ChainStep[];\n // One line: `x —emit (loop)→ x`.\n path: string;\n};\n\nconst NAV_KEYS = ['push', 'replace', 'resetTo'];\n\nconst isLiteral = (value: unknown): value is string => typeof value === 'string' && value !== '' && !value.includes('{{');\n\nconst edgesOf = (definition: ActionDefinition, from: string, steps: unknown, known: ReadonlySet<string>, out: ChainStep[]): void => {\n if (!Array.isArray(steps)) return;\n for (const step of steps) {\n if (!isRecord(step)) continue;\n const emit = step['emit'];\n if (isRecord(emit) && isLiteral(emit['channel'])) out.push({ from, to: `channel:${emit['channel']}`, action: definition.id, via: 'emit' });\n if (step['reload'] === true) out.push({ from, to: `mount:${definition.id}`, action: definition.id, via: 'reload' });\n for (const key of NAV_KEYS) {\n const nav = step[key];\n if (isRecord(nav) && isLiteral(nav['action']) && known.has(nav['action'])) out.push({ from, to: `mount:${nav['action']}`, action: definition.id, via: key });\n }\n if (typeof step['call'] === 'string') {\n edgesOf(definition, from, step['onSuccess'], known, out);\n edgesOf(definition, from, step['onError'], known, out);\n }\n }\n};\n\nconst label = (node: string): string => (node.startsWith('channel:') ? node.slice('channel:'.length) : `mount ${node.slice('mount:'.length)}`);\n\nexport const chainCycles = (definitions: Record<string, ActionDefinition> | readonly ActionDefinition[]): ChainCycle[] => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const known = new Set(defs.map((definition) => definition.id));\n const edges: ChainStep[] = [];\n for (const definition of defs) {\n for (const trigger of definition.triggers ?? []) {\n if (isLiteral(trigger.message)) edgesOf(definition, `channel:${trigger.message}`, trigger.do, known, edges);\n }\n edgesOf(definition, `mount:${definition.id}`, definition.lifecycle?.mount, known, edges);\n }\n const outgoing = new Map<string, ChainStep[]>();\n for (const edge of edges) outgoing.set(edge.from, [...(outgoing.get(edge.from) ?? []), edge]);\n\n // One cycle per strongly connected component that has one (Tarjan), so a\n // tangle of triggers reports once, not once per rotation of every loop in it.\n const index = new Map<string, number>();\n const low = new Map<string, number>();\n const onStack = new Set<string>();\n const stack: string[] = [];\n const components: string[][] = [];\n let counter = 0;\n const connect = (node: string): void => {\n index.set(node, counter);\n low.set(node, counter);\n counter += 1;\n stack.push(node);\n onStack.add(node);\n for (const edge of outgoing.get(node) ?? []) {\n if (!index.has(edge.to)) {\n connect(edge.to);\n low.set(node, Math.min(low.get(node) ?? 0, low.get(edge.to) ?? 0));\n } else if (onStack.has(edge.to)) {\n low.set(node, Math.min(low.get(node) ?? 0, index.get(edge.to) ?? 0));\n }\n }\n if (low.get(node) !== index.get(node)) return;\n const component: string[] = [];\n for (let top = stack.pop(); top !== undefined; top = stack.pop()) {\n onStack.delete(top);\n component.push(top);\n if (top === node) break;\n }\n components.push(component);\n };\n for (const node of [...outgoing.keys()].sort()) if (!index.has(node)) connect(node);\n\n // A path round the component from its first node back to it, by\n // breadth-first search inside the component — the shortest such cycle.\n const cycleIn = (component: readonly string[]): ChainStep[] | undefined => {\n const members = new Set(component);\n const start = [...component].sort()[0];\n if (start === undefined) return undefined;\n const via = new Map<string, ChainStep>();\n const queue = [start];\n for (let node = queue.shift(); node !== undefined; node = queue.shift()) {\n for (const edge of outgoing.get(node) ?? []) {\n if (!members.has(edge.to)) continue;\n if (edge.to === start) {\n const steps = [edge];\n for (let back = via.get(node); back !== undefined; back = via.get(back.from)) steps.unshift(back);\n return steps;\n }\n if (via.has(edge.to)) continue;\n via.set(edge.to, edge);\n queue.push(edge.to);\n }\n }\n return undefined;\n };\n\n return components\n .map(cycleIn)\n .filter((steps): steps is ChainStep[] => steps !== undefined)\n .map((steps) => ({\n steps,\n path: [label(steps[0]?.from ?? ''), ...steps.map((step) => `—${step.via} (${step.action})→ ${label(step.to)}`)].join(' '),\n }))\n .sort((a, b) => a.path.localeCompare(b.path));\n};\n","import type { ActionDefinition } from '@action';\nimport { isRecord, walkNodes } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// What an action can still DO once it has been drawn — read off its own\n// definition.\n//\n// A screen that has been rendered is either finished or it is not. It is\n// finished when nothing on it can be pressed, nothing it waits on can arrive,\n// and nothing it would call is left to call: its tree is then the whole of it,\n// and a host can serve that tree and keep nothing running behind it. Everything\n// that makes it NOT finished is a declared part of the definition — a trigger,\n// a binding, a channel, an endpoint — so the question is decidable without\n// running anything.\n//\n// This reports the facts and decides nothing. Whether a given endpoint needs a\n// server is not nova's to know (it does not know what answers a url); a host\n// that does — moss, holding the entries behind each fingerprint — composes the\n// verdict from these.\n// ═══════════════════════════════════════════════════════════\n\nexport type EndpointUse = {\n name: string;\n kind: 'fn' | 'http';\n // http only: the url as authored (a template stays a template), and the\n // request body as authored — where a host finds the fingerprint it replays.\n url?: string;\n request?: unknown;\n // called while the action OPENS (its lifecycle hooks, and what those chain to)\n onOpen: boolean;\n // called because of something that happens LATER (a trigger, and what it chains to)\n later: boolean;\n};\n\nexport type ActionLiveness = {\n // A person can do something here: a `ui:` trigger, or a two-way binding (a\n // bound field writes the action's data, which lives wherever the shell does).\n gestures: boolean;\n // The channels it waits on — something else can change it while it is shown.\n listens: readonly string[];\n // Every declared endpoint, and when it is called. One that is never called\n // is still listed (`onOpen` and `later` both false): dead, but declared.\n endpoints: readonly EndpointUse[];\n // The layout is a store id, not inline: what it draws — bindings included —\n // cannot be read here, so a caller must not conclude nothing can be pressed.\n opaqueLayout: boolean;\n};\n\n// Every endpoint name a list of steps calls, nested steps included.\nconst callsIn = (steps: unknown): Set<string> => {\n const names = new Set<string>();\n walkNodes(steps, (record) => {\n if (typeof record['call'] === 'string') names.add(record['call']);\n });\n return names;\n};\n\nexport const livenessOf = (definition: ActionDefinition): ActionLiveness => {\n const triggers = definition.triggers ?? [];\n const layout = definition.layout;\n\n let bound = false;\n if (layout !== undefined && typeof layout !== 'string') {\n walkNodes(layout, (record) => {\n if (typeof record['component'] === 'string' && record['model'] !== undefined) bound = true;\n });\n }\n\n const opening = callsIn(definition.lifecycle ?? {});\n const afterwards = callsIn(triggers.map((trigger) => trigger.do));\n\n const endpoints = Object.entries(definition.endpoints ?? {}).map(([name, config]): EndpointUse => {\n const spec: unknown = config;\n const use = { name, onOpen: opening.has(name), later: afterwards.has(name) };\n if (isRecord(spec) && typeof spec['fn'] === 'string') return { ...use, kind: 'fn' };\n return {\n ...use,\n kind: 'http',\n ...(isRecord(spec) && typeof spec['url'] === 'string' ? { url: spec['url'] } : {}),\n ...(isRecord(spec) && spec['request'] !== undefined ? { request: spec['request'] } : {}),\n };\n });\n\n return {\n gestures: bound || triggers.some((trigger) => typeof trigger.event === 'string'),\n listens: [...new Set(triggers.map((trigger) => trigger.message).filter((channel): channel is string => typeof channel === 'string'))].sort(),\n endpoints,\n opaqueLayout: typeof layout === 'string',\n };\n};\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/reflect/walk.ts","../src/reflect/audit.ts","../src/reflect/shell.ts","../src/reflect/graph.ts","../src/reflect/cycles.ts","../src/reflect/liveness.ts"],"names":[],"mappings":";;;AAcO,IAAM,QAAA,GAAW,CAAC,KAAA,KACvB,KAAA,KAAU,IAAA,IAAQ,OAAO,KAAA,KAAU,QAAA,IAAY,CAAC,KAAA,CAAM,OAAA,CAAQ,KAAK;AAI9D,IAAM,SAAA,GAAY,CAAC,KAAA,EAAgB,KAAA,KAA2D;AACnG,EAAA,IAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG;AACxB,IAAA,KAAA,MAAW,IAAA,IAAQ,KAAA,EAAO,SAAA,CAAU,IAAA,EAAM,KAAK,CAAA;AAC/C,IAAA;AAAA,EACF;AACA,EAAA,IAAI,CAAC,QAAA,CAAS,KAAK,CAAA,EAAG;AACtB,EAAA,KAAA,CAAM,KAAK,CAAA;AACX,EAAA,KAAA,MAAW,SAAS,MAAA,CAAO,MAAA,CAAO,KAAK,CAAA,EAAG,SAAA,CAAU,OAAO,KAAK,CAAA;AAClE;AAIO,IAAM,YAAA,GAAe,CAAC,KAAA,KAAgC;AAC3D,EAAA,MAAM,GAAA,uBAAU,GAAA,EAAY;AAC5B,EAAA,SAAA,CAAU,KAAA,EAAO,CAAC,MAAA,KAAW;AAC3B,IAAA,IAAI,OAAO,OAAO,WAAW,CAAA,KAAM,UAAU,GAAA,CAAI,GAAA,CAAI,MAAA,CAAO,WAAW,CAAC,CAAA;AAAA,EAC1E,CAAC,CAAA;AACD,EAAA,OAAO,GAAA;AACT;AAKO,IAAM,MAAA,GAAS,CAAC,KAAA,KAAgC;AACrD,EAAA,MAAM,GAAA,uBAAU,GAAA,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AAY,OAAO,OAAA,CAAQ,KAAA,KAAU,QAAQ,CAAA;AAAA,IAC/E,OAAA,EAAS,CAAC,GAAG,IAAI,IAAI,QAAA,CAAS,GAAA,CAAI,CAAC,OAAA,KAAY,OAAA,CAAQ,OAAO,CAAA,CAAE,MAAA,CAAO,CAAC,OAAA,KAA+B,OAAO,YAAY,QAAQ,CAAC,CAAC,CAAA,CAAE,IAAA,EAAK;AAAA,IAC3I,SAAA;AAAA,IACA,YAAA,EAAc,OAAO,MAAA,KAAW;AAAA,GAClC;AACF","file":"chunk-X5JTZ5LW.js","sourcesContent":["// ═══════════════════════════════════════════════════════════\n// The one traversal the codebase kept re-writing. A nova artifact — a layout,\n// a render tree, a definition, a whole manifest — is nested plain objects and\n// arrays; walking it to collect or check \"every node that has X\" was\n// hand-rolled in moss (collectComponents, hasVisibleContent) and relay's\n// devtools (walk, collectLoopVars, collectPropRefs). This is that walk, once,\n// plus the collectors that ride it.\n//\n// This is the STRUCTURAL walk — it visits every plain-object record. The\n// SEMANTIC walkers (collectChannels, which follows call→onSuccess; the typed\n// RenderNode model-binding walk) stay their own thing: folding them onto a\n// blind structural walk would lose their precision.\n// ═══════════════════════════════════════════════════════════\n\nexport const isRecord = (value: unknown): value is Record<string, unknown> =>\n value !== null && typeof value === 'object' && !Array.isArray(value);\n\n// Visit every plain-object record in a nova tree, arrays and nested objects\n// included. The visitor sees each record before its children.\nexport const walkNodes = (value: unknown, visit: (record: Record<string, unknown>) => void): void => {\n if (Array.isArray(value)) {\n for (const item of value) walkNodes(item, visit);\n return;\n }\n if (!isRecord(value)) return;\n visit(value);\n for (const inner of Object.values(value)) walkNodes(inner, visit);\n};\n\n// Every component NAME referenced anywhere in a tree — layouts, render trees,\n// fragments, a manifest. (Was moss's `collectComponents`.)\nexport const componentsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (typeof record['component'] === 'string') out.add(record['component']);\n });\n return out;\n};\n\n// Every ref carried by a `ref` / `*Ref` key INSIDE a component's props — the\n// refs a component dispatches for (a Table's rowRef, a cell's ref), which\n// node-level `ref:` analysis doesn't see. (Was devtools' `collectPropRefs`.)\nexport const refsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (record['component'] === undefined || !isRecord(record['props'])) return;\n walkNodes(record['props'], (props) => {\n for (const [key, propValue] of Object.entries(props)) {\n if ((key === 'ref' || key.endsWith('Ref')) && typeof propValue === 'string' && propValue !== '') out.add(propValue);\n }\n });\n });\n return out;\n};\n\n// Every loop `as:` variable declared anywhere in a layout — the names that are\n// in scope at runtime inside a `for`. (Was devtools' `collectLoopVars`.)\nexport const loopVarsOf = (value: unknown): Set<string> => {\n const out = new Set<string>();\n walkNodes(value, (record) => {\n if (typeof record['as'] === 'string' && record['for'] !== undefined) out.add(record['as']);\n });\n return out;\n};\n","import { auditAction, collectChannels } from '@action';\nimport type { ActionDefinition } from '@action';\nimport { loopVarsOf, refsOf } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// Audit classification — the static auditAction (action/audit.ts) has three\n// known blind spots; each is decidable from the definition itself. This turns\n// a raw issue string into `address` (a real break a human should see) or\n// `info` (runtime-explained). It's nova reasoning about its OWN audit\n// semantics — generic, not app opinion — so it lives here, not in an app's\n// devtools. Uses the walk collectors (loopVarsOf/refsOf).\n// ═══════════════════════════════════════════════════════════\n\nexport type IssueClass = { kind: 'address' } | { kind: 'info'; tag: string; reason: string };\n\nexport const classifyAudit = (issue: string, definition: ActionDefinition): IssueClass => {\n const layout = typeof definition.layout === 'object' ? definition.layout : undefined;\n\n const bind = issue.match(/binds \"\\$\\.([\\w.]+)\"/);\n if (bind !== null) {\n const root = (bind[1] ?? '').split('.')[0] ?? '';\n if (root === 'index' || root === 'items') {\n return { kind: 'info', tag: 'loop scope', reason: `\\`${root}\\` is a renderer-reserved loop variable` };\n }\n if (loopVarsOf(layout).has(root)) {\n return { kind: 'info', tag: 'loop var', reason: `\\`${root}\\` is a loop \\`as:\\` variable — in scope at runtime` };\n }\n }\n\n const ref = issue.match(/ref \"([^\"]+)\"/);\n if (ref !== null && issue.includes('listens') && refsOf(layout).has(ref[1] ?? '')) {\n return { kind: 'info', tag: 'prop ref', reason: 'dispatched by a component from a props value (e.g. Table rowRef / cell.ref)' };\n }\n\n if (issue.includes('{{')) {\n return { kind: 'info', tag: 'template', reason: 'target resolves from data at runtime — statically unknowable' };\n }\n\n return { kind: 'address' };\n};\n\nexport type ClassifiedIssue = { issue: string } & IssueClass;\nexport type CatalogAuditRow = { id: string; address: number; issues: ClassifiedIssue[] };\n\n// Audit a whole set of definitions and classify every finding: each definition\n// is checked against a catalog + channel vocabulary derived from the set, so\n// cross-action wiring (a push to a missing action, a channel nobody serves) is\n// visible. Rows carry unresolved (`address`) findings first and sort by how\n// many they have. The self-audit devtools render this verbatim.\nexport const auditCatalog = (\n definitions: Record<string, ActionDefinition> | readonly ActionDefinition[],\n): CatalogAuditRow[] => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const catalog = defs.map((definition) => ({ id: definition.id, ...(definition.input !== undefined ? { input: definition.input } : {}) }));\n const channels = [\n ...new Set(\n defs.flatMap((definition) => {\n const usage = collectChannels(definition);\n return [...usage.emits, ...usage.listens];\n }),\n ),\n ];\n return defs\n .map((definition): CatalogAuditRow => {\n const issues = auditAction(definition, { catalog, channels }).issues.map((issue): ClassifiedIssue => ({ issue, ...classifyAudit(issue, definition) }));\n issues.sort((a, b) => Number(a.kind === 'info') - Number(b.kind === 'info'));\n return { id: definition.id, address: issues.filter((issue) => issue.kind === 'address').length, issues };\n })\n .filter((row) => row.issues.length > 0)\n .sort((a, b) => b.address - a.address);\n};\n","import type { Shell } from '@shell';\nimport type { ActionDefinition, EndpointConfig, TriggerConfig } from '@action';\nimport type { LayoutNode } from '@layout';\nimport { classifyAudit, type ClassifiedIssue } from './audit';\nimport { auditAction } from '@action';\n\n// ═══════════════════════════════════════════════════════════\n// Shell reflection — nova reading its own running state. The canvas/instance\n// tree (snapshotShell) and a full model for one instance (describeInstance).\n// Both were re-derived in relay's devtools fns; they're pure reads over the\n// Shell's own introspection API, so they belong here. Consumers: devtools, and\n// (server-ladder) the working-set / level-streaming that walks the same tree.\n// ═══════════════════════════════════════════════════════════\n\nexport type InstanceRef = {\n definitionId: string;\n instanceId: string;\n status: string;\n active: boolean;\n};\n\nexport type CanvasRef = {\n id: string;\n depth: number;\n // top-of-stack first\n items: InstanceRef[];\n};\n\nexport type ShellSnapshot = {\n canvases: CanvasRef[];\n layouts: string[];\n // every component name the shell's registry can render\n components: string[];\n};\n\n// The whole shell as a tree of canvases → instances, plus the shell-level\n// model (layout store ids, registered component names). `exclude` drops\n// canvases the caller owns (a devtools canvas shouldn't inspect itself).\nexport const snapshotShell = (shell: Shell, exclude: readonly string[] = []): ShellSnapshot => {\n const state = shell.getState();\n const canvases = Object.values(state.canvases)\n .filter((canvas) => !exclude.includes(canvas.id))\n .map((canvas): CanvasRef => ({\n id: canvas.id,\n depth: canvas.stack.length,\n items: [...canvas.stack].reverse().map((instance): InstanceRef => ({\n definitionId: instance.definitionId,\n instanceId: instance.id,\n status: instance.status,\n active: instance.id === canvas.active?.id,\n })),\n }));\n return { canvases, layouts: shell.layoutStore.list(), components: shell.registry.list() };\n};\n\n// ─── the shell as text ─────────────────────────────────────\n// What a model is shown when it has to reason about a screen. Same tree as\n// snapshotShell, rendered flat with each card's live data.\n//\n// Long arrays collapse to a head and a count: an agent looking at the same\n// screen many times a shift cannot pay for forty rows each time, and a person\n// reading a board of forty does not hold forty either.\n\nexport type DescribeShellOptions = {\n // Canvases to render. Default: all of them.\n only?: readonly string[];\n // Marks an instance in the output. An agent whose answer is the complete state\n // of its own canvases has to tell its cards from the person's.\n mark?: (instanceId: string) => string | undefined;\n // Array length past which values collapse. 0 disables collapsing.\n collapseOver?: number;\n head?: number;\n // Last pass over each card's data before it is written. A caller that knows\n // which fields are for rendering rather than reading — tones, formatted\n // stamps — drops them here instead of paying for them.\n clean?: (data: Record<string, unknown>) => Record<string, unknown>;\n};\n\nconst compact = (value: unknown, over: number, head: number): unknown => {\n if (Array.isArray(value)) {\n return over === 0 || value.length <= over ? value.map((item) => compact(item, over, head)) : [...value.slice(0, head).map((item) => compact(item, over, head)), `…${value.length - head} more`];\n }\n if (value === null || typeof value !== 'object') return value;\n const out: Record<string, unknown> = {};\n for (const [key, inner] of Object.entries(value as Record<string, unknown>)) out[key] = compact(inner, over, head);\n return out;\n};\n\nexport const describeShell = (shell: Shell, options: DescribeShellOptions = {}): string => {\n const { only, mark, collapseOver = 5, head = 3, clean } = options;\n const lines: string[] = [];\n for (const [canvasId, canvas] of Object.entries(shell.getState().canvases)) {\n if (only !== undefined && !only.includes(canvasId)) continue;\n if (canvas.active === undefined) {\n lines.push(` ${canvasId}: (empty)`);\n continue;\n }\n lines.push(` ${canvasId}: ${canvas.stack.map((item, index) => `${item.definitionId}${index === canvas.stack.length - 1 ? '*' : ''}`).join(' › ')}`);\n for (const item of canvas.stack) {\n const runtime = shell.getRuntime(item.id);\n const note = mark?.(item.id);\n const data = runtime === undefined ? undefined : (clean ?? ((value: Record<string, unknown>) => value))(runtime.getData());\n lines.push(` ${item.definitionId}${note === undefined ? '' : ` ${note}`} data: ${data === undefined ? '{}' : JSON.stringify(compact(data, collapseOver, head))}`);\n }\n }\n return lines.join('\\n');\n};\n\nexport type InstanceModel = {\n id: string;\n instanceId: string;\n canvasId: string;\n status: string;\n title: string;\n data: Record<string, unknown>;\n endpoints: Array<{ name: string; config: EndpointConfig }>;\n triggers: TriggerConfig[];\n lifecycle: Record<string, unknown>;\n layoutKind: 'inline' | 'store';\n layout: LayoutNode | undefined;\n input: Record<string, unknown> | undefined;\n issues: ClassifiedIssue[];\n};\n\n// The full model for one live instance — its definition wiring, its current\n// data, and its classified audit. `undefined` when the id isn't mounted.\nexport const describeInstance = (shell: Shell, instanceId: string): InstanceModel | undefined => {\n const runtime = shell.getRuntime(instanceId);\n if (runtime === undefined) return undefined;\n\n const definition: ActionDefinition = runtime.definition;\n const layout = definition.layout;\n const layoutNode = typeof layout === 'string' ? shell.layoutStore.get(layout) : layout;\n const issues = auditAction(definition).issues.map((issue): ClassifiedIssue => ({ issue, ...classifyAudit(issue, definition) }));\n\n return {\n id: definition.id,\n instanceId,\n canvasId: runtime.instance.canvasId,\n status: runtime.instance.status,\n title: definition.title ?? '',\n data: runtime.getData(),\n endpoints: Object.entries(definition.endpoints ?? {}).map(([name, config]) => ({ name, config })),\n triggers: definition.triggers ?? [],\n lifecycle: definition.lifecycle ?? {},\n layoutKind: typeof layout === 'string' ? 'store' : 'inline',\n layout: layoutNode,\n input: definition.input,\n issues,\n };\n};\n","import { collectChannels } from '@action';\nimport type { ActionDefinition } from '@action';\nimport { walkNodes, isRecord } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// The action graph — each action's outgoing edges: the actions it can push to\n// (navigation) and the channels it emits/listens on. This is the adjacency the\n// audit closure walks per role, and the neighbourhood the server ladder's\n// working-set / level-streaming serves by radius. Built on the walk (nav\n// targets) + the semantic channel walker. Reachability (radius-N) layers on\n// top when working-set streaming lands.\n// ═══════════════════════════════════════════════════════════\n\n// Every action a definition navigates to — push/replace/resetTo targets in its\n// triggers and lifecycle. A template target ({{…}}) is runtime-resolved, kept\n// as-is so a caller can see it's dynamic.\nconst navTargetsOf = (definition: ActionDefinition): string[] => {\n const out = new Set<string>();\n const scan = (value: unknown): void =>\n walkNodes(value, (record) => {\n for (const key of ['push', 'replace', 'resetTo']) {\n const target = record[key];\n if (isRecord(target) && typeof target['action'] === 'string') out.add(target['action']);\n }\n });\n scan(definition.triggers ?? []);\n scan(definition.lifecycle ?? {});\n return [...out].sort();\n};\n\nexport type ActionNode = {\n id: string;\n pushes: string[];\n emits: string[];\n listens: string[];\n};\n\nexport type ActionGraph = {\n nodes: ActionNode[];\n // ids referenced as push targets that aren't defined here (a dangling edge)\n dangling: string[];\n};\n\nexport const actionGraph = (\n definitions: Record<string, ActionDefinition> | readonly ActionDefinition[],\n): ActionGraph => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const known = new Set(defs.map((definition) => definition.id));\n const dangling = new Set<string>();\n\n const nodes = defs.map((definition): ActionNode => {\n const pushes = navTargetsOf(definition);\n for (const target of pushes) if (!target.includes('{{') && !known.has(target)) dangling.add(target);\n const usage = collectChannels(definition);\n return { id: definition.id, pushes, emits: usage.emits, listens: usage.listens };\n });\n\n return { nodes, dangling: [...dangling].sort() };\n};\n","import type { ActionDefinition } from '@action';\nimport { isRecord } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// CHAINS THAT NEVER END, found in the definitions. A step list has no\n// conditionals, so once a chain can come back to where it started it always\n// will: a trigger on `x` that emits `x`, two triggers answering each other, a\n// mount that reloads itself, a mount whose emit reaches a trigger that pushes\n// the same action again. The runtime stops every such chain at its budget\n// (action/runtime/cause.ts); this finds them before anything runs.\n//\n// The graph: a node is where steps start running — a channel (its message\n// triggers) or an action's mount. An edge is a step that starts more:\n//\n// · `emit: c` → the channel c\n// · `reload` → this action's own mount\n// · `push`/`replace`/`resetTo` of A → A's mount\n//\n// followed through `call`'s onSuccess/onError, which run as part of the same\n// chain. A channel or target written as a template (`{{…}}`) is decided at\n// runtime and has no edge; a push to an action not in the set has none\n// either. Fragment triggers join when an action is composed — walk the\n// composed definitions to see them.\n// ═══════════════════════════════════════════════════════════\n\nexport type ChainStep = {\n // Where the steps run: `channel:x` or `mount:<action id>`.\n from: string;\n to: string;\n // The action whose trigger or mount carries the step.\n action: string;\n // What the step is: `emit`, `reload`, `push`, `replace`, `resetTo`.\n via: string;\n};\n\nexport type ChainCycle = {\n // The steps round the cycle, back to where it started.\n steps: ChainStep[];\n // One line: `x —emit (loop)→ x`.\n path: string;\n};\n\nconst NAV_KEYS = ['push', 'replace', 'resetTo'];\n\nconst isLiteral = (value: unknown): value is string => typeof value === 'string' && value !== '' && !value.includes('{{');\n\nconst edgesOf = (definition: ActionDefinition, from: string, steps: unknown, known: ReadonlySet<string>, out: ChainStep[]): void => {\n if (!Array.isArray(steps)) return;\n for (const step of steps) {\n if (!isRecord(step)) continue;\n const emit = step['emit'];\n if (isRecord(emit) && isLiteral(emit['channel'])) out.push({ from, to: `channel:${emit['channel']}`, action: definition.id, via: 'emit' });\n if (step['reload'] === true) out.push({ from, to: `mount:${definition.id}`, action: definition.id, via: 'reload' });\n for (const key of NAV_KEYS) {\n const nav = step[key];\n if (isRecord(nav) && isLiteral(nav['action']) && known.has(nav['action'])) out.push({ from, to: `mount:${nav['action']}`, action: definition.id, via: key });\n }\n if (typeof step['call'] === 'string') {\n edgesOf(definition, from, step['onSuccess'], known, out);\n edgesOf(definition, from, step['onError'], known, out);\n }\n }\n};\n\nconst label = (node: string): string => (node.startsWith('channel:') ? node.slice('channel:'.length) : `mount ${node.slice('mount:'.length)}`);\n\nexport const chainCycles = (definitions: Record<string, ActionDefinition> | readonly ActionDefinition[]): ChainCycle[] => {\n const defs = Array.isArray(definitions) ? [...definitions] : Object.values(definitions);\n const known = new Set(defs.map((definition) => definition.id));\n const edges: ChainStep[] = [];\n for (const definition of defs) {\n for (const trigger of definition.triggers ?? []) {\n if (isLiteral(trigger.message)) edgesOf(definition, `channel:${trigger.message}`, trigger.do, known, edges);\n }\n edgesOf(definition, `mount:${definition.id}`, definition.lifecycle?.mount, known, edges);\n }\n const outgoing = new Map<string, ChainStep[]>();\n for (const edge of edges) outgoing.set(edge.from, [...(outgoing.get(edge.from) ?? []), edge]);\n\n // One cycle per strongly connected component that has one (Tarjan), so a\n // tangle of triggers reports once, not once per rotation of every loop in it.\n const index = new Map<string, number>();\n const low = new Map<string, number>();\n const onStack = new Set<string>();\n const stack: string[] = [];\n const components: string[][] = [];\n let counter = 0;\n const connect = (node: string): void => {\n index.set(node, counter);\n low.set(node, counter);\n counter += 1;\n stack.push(node);\n onStack.add(node);\n for (const edge of outgoing.get(node) ?? []) {\n if (!index.has(edge.to)) {\n connect(edge.to);\n low.set(node, Math.min(low.get(node) ?? 0, low.get(edge.to) ?? 0));\n } else if (onStack.has(edge.to)) {\n low.set(node, Math.min(low.get(node) ?? 0, index.get(edge.to) ?? 0));\n }\n }\n if (low.get(node) !== index.get(node)) return;\n const component: string[] = [];\n for (let top = stack.pop(); top !== undefined; top = stack.pop()) {\n onStack.delete(top);\n component.push(top);\n if (top === node) break;\n }\n components.push(component);\n };\n for (const node of [...outgoing.keys()].sort()) if (!index.has(node)) connect(node);\n\n // A path round the component from its first node back to it, by\n // breadth-first search inside the component — the shortest such cycle.\n const cycleIn = (component: readonly string[]): ChainStep[] | undefined => {\n const members = new Set(component);\n const start = [...component].sort()[0];\n if (start === undefined) return undefined;\n const via = new Map<string, ChainStep>();\n const queue = [start];\n for (let node = queue.shift(); node !== undefined; node = queue.shift()) {\n for (const edge of outgoing.get(node) ?? []) {\n if (!members.has(edge.to)) continue;\n if (edge.to === start) {\n const steps = [edge];\n for (let back = via.get(node); back !== undefined; back = via.get(back.from)) steps.unshift(back);\n return steps;\n }\n if (via.has(edge.to)) continue;\n via.set(edge.to, edge);\n queue.push(edge.to);\n }\n }\n return undefined;\n };\n\n return components\n .map(cycleIn)\n .filter((steps): steps is ChainStep[] => steps !== undefined)\n .map((steps) => ({\n steps,\n path: [label(steps[0]?.from ?? ''), ...steps.map((step) => `—${step.via} (${step.action})→ ${label(step.to)}`)].join(' '),\n }))\n .sort((a, b) => a.path.localeCompare(b.path));\n};\n","import type { ActionDefinition } from '@action';\nimport { isRecord, walkNodes } from './walk';\n\n// ═══════════════════════════════════════════════════════════\n// What an action can still DO once it has been drawn — read off its own\n// definition.\n//\n// A screen that has been rendered is either finished or it is not. It is\n// finished when nothing on it can be pressed, nothing it waits on can arrive,\n// and nothing it would call is left to call: its tree is then the whole of it,\n// and a host can serve that tree and keep nothing running behind it. Everything\n// that makes it NOT finished is a declared part of the definition — a trigger,\n// a binding, a channel, an endpoint — so the question is decidable without\n// running anything.\n//\n// This reports the facts and decides nothing. Whether a given endpoint needs a\n// server is not nova's to know (it does not know what answers a url); a host\n// that does — moss, holding the entries behind each fingerprint — composes the\n// verdict from these.\n// ═══════════════════════════════════════════════════════════\n\nexport type EndpointUse = {\n name: string;\n kind: 'fn' | 'http';\n // http only: the url as authored (a template stays a template), and the\n // request body as authored — where a host finds the fingerprint it replays.\n url?: string;\n request?: unknown;\n // called while the action OPENS (its lifecycle hooks, and what those chain to)\n onOpen: boolean;\n // called because of something that happens LATER (a trigger, and what it chains to)\n later: boolean;\n};\n\nexport type ActionLiveness = {\n // A person can do something here: a `ui:` trigger, or a two-way binding (a\n // bound field writes the action's data, which lives wherever the shell does).\n gestures: boolean;\n // The channels it waits on — something else can change it while it is shown.\n listens: readonly string[];\n // Every declared endpoint, and when it is called. One that is never called\n // is still listed (`onOpen` and `later` both false): dead, but declared.\n endpoints: readonly EndpointUse[];\n // The layout is a store id, not inline: what it draws — bindings included —\n // cannot be read here, so a caller must not conclude nothing can be pressed.\n opaqueLayout: boolean;\n};\n\n// Every endpoint name a list of steps calls, nested steps included.\nconst callsIn = (steps: unknown): Set<string> => {\n const names = new Set<string>();\n walkNodes(steps, (record) => {\n if (typeof record['call'] === 'string') names.add(record['call']);\n });\n return names;\n};\n\nexport const livenessOf = (definition: ActionDefinition): ActionLiveness => {\n const triggers = definition.triggers ?? [];\n const layout = definition.layout;\n\n let bound = false;\n if (layout !== undefined && typeof layout !== 'string') {\n walkNodes(layout, (record) => {\n if (typeof record['component'] === 'string' && record['model'] !== undefined) bound = true;\n });\n }\n\n const opening = callsIn(definition.lifecycle ?? {});\n const afterwards = callsIn(triggers.map((trigger) => trigger.do));\n\n const endpoints = Object.entries(definition.endpoints ?? {}).map(([name, config]): EndpointUse => {\n const spec: unknown = config;\n const use = { name, onOpen: opening.has(name), later: afterwards.has(name) };\n if (isRecord(spec) && typeof spec['fn'] === 'string') return { ...use, kind: 'fn' };\n return {\n ...use,\n kind: 'http',\n ...(isRecord(spec) && typeof spec['url'] === 'string' ? { url: spec['url'] } : {}),\n ...(isRecord(spec) && spec['request'] !== undefined ? { request: spec['request'] } : {}),\n };\n });\n\n return {\n gestures: bound || triggers.some((trigger) => typeof trigger.event === 'string'),\n listens: [...new Set(triggers.map((trigger) => trigger.message).filter((channel): channel is string => typeof channel === 'string'))].sort(),\n endpoints,\n opaqueLayout: typeof layout === 'string',\n };\n};\n"]}
|
|
@@ -771,5 +771,5 @@ var mountInputKeys = (definition) => {
|
|
|
771
771
|
};
|
|
772
772
|
|
|
773
773
|
export { HEAD_META, HeadLinkPropsSchema, HeadMetaPropsSchema, HeadPropsSchema, HeadScriptPropsSchema, HeadTitlePropsSchema, NOVA_MODEL_PROP, NOVA_REF_PROP, auditAction, collectChannels, composeAction, createLayoutStore, createScopeChain, declaredKeys, fillSlots, gesturedKeys, isComponentNode, isConditionalNode, isLayoutNode, isLayoutPrimitive, isLayoutRefNode, isLoopNode, isMutationStep, isSlotNode, lifecycleKeys, loadedKeys, mountInputKeys, render, renderLayout, renderLayoutFromStore, renderNodeKey, resolve };
|
|
774
|
-
//# sourceMappingURL=chunk-
|
|
775
|
-
//# sourceMappingURL=chunk-
|
|
774
|
+
//# sourceMappingURL=chunk-XUSKGJRI.js.map
|
|
775
|
+
//# sourceMappingURL=chunk-XUSKGJRI.js.map
|
|
@@ -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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CAAM,MAAA,CAAO,CAAC,GAAA,KAAQ,QAAQ,EAAE,CAAA;AACzC,CAAA;AAEA,IAAM,eAAA,uBAAsB,OAAA,EAA+C;AAQpE,IAAM,cAAA,GAAiB,CAAC,UAAA,KAAsD;AACnF,EAAA,MAAM,MAAA,GAAS,eAAA,CAAgB,GAAA,CAAI,UAAU,CAAA;AAC7C,EAAA,IAAI,MAAA,KAAW,QAAW,OAAO,MAAA;AACjC,EAAA,MAAM,MAAA,GAAS,WAAW,UAAU,CAAA;AACpC,EAAA,MAAM,QAAA,GAAW,IAAI,GAAA,CAAI,YAAA,CAAa,UAAU,CAAC,CAAA;AACjD,EAAA,MAAM,IAAA,uBAAW,GAAA,EAAY;AAC7B,EAAA,KAAA,MAAW,CAAC,IAAA,EAAM,QAAQ,CAAA,IAAK,MAAA,CAAO,QAAQ,UAAA,CAAW,SAAA,IAAa,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-XUSKGJRI.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, chain[0] ?? {});\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
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkHYFNOF7Y_cjs = require('./chunk-HYFNOF7Y.cjs');
|
|
4
|
+
var chunkECFWPZGL_cjs = require('./chunk-ECFWPZGL.cjs');
|
|
5
5
|
var chunkPNQY6OFB_cjs = require('./chunk-PNQY6OFB.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkPBPUSZIQ_cjs = require('./chunk-PBPUSZIQ.cjs');
|
|
7
7
|
var chunkOE527MXF_cjs = require('./chunk-OE527MXF.cjs');
|
|
8
8
|
var jsxRuntime = require('react/jsx-runtime');
|
|
9
9
|
var react = require('react');
|
|
@@ -43,7 +43,7 @@ var Stack = ({
|
|
|
43
43
|
};
|
|
44
44
|
Stack.meta = {
|
|
45
45
|
description: "Flex container that arranges children in a row or column.",
|
|
46
|
-
propsSchema:
|
|
46
|
+
propsSchema: chunkHYFNOF7Y_cjs.StackPropsSchema
|
|
47
47
|
};
|
|
48
48
|
var SIZE_MAP = {
|
|
49
49
|
sm: "12px",
|
|
@@ -74,7 +74,7 @@ var Text = ({
|
|
|
74
74
|
};
|
|
75
75
|
Text.meta = {
|
|
76
76
|
description: "Text element with semantic typography props.",
|
|
77
|
-
propsSchema:
|
|
77
|
+
propsSchema: chunkHYFNOF7Y_cjs.TextPropsSchema
|
|
78
78
|
};
|
|
79
79
|
var NovaRenderContext = react.createContext(void 0);
|
|
80
80
|
var NovaShellContext = react.createContext(void 0);
|
|
@@ -89,7 +89,7 @@ var HeadMark = () => {
|
|
|
89
89
|
return null;
|
|
90
90
|
};
|
|
91
91
|
var ShellHeadProvider = ({ shell, children }) => {
|
|
92
|
-
const head = react.useMemo(() =>
|
|
92
|
+
const head = react.useMemo(() => chunkHYFNOF7Y_cjs.createShellHead(shell), [shell]);
|
|
93
93
|
react.useEffect(() => head.watch(), [head]);
|
|
94
94
|
return /* @__PURE__ */ jsxRuntime.jsx(ShellHeadContext.Provider, { value: head, children });
|
|
95
95
|
};
|
|
@@ -161,12 +161,12 @@ var RenderNodeView = ({ node }) => {
|
|
|
161
161
|
}
|
|
162
162
|
const props = { ...node.props };
|
|
163
163
|
if (node.model !== void 0) {
|
|
164
|
-
props[
|
|
164
|
+
props[chunkPBPUSZIQ_cjs.NOVA_MODEL_PROP] = { ref: node.model.ref, path: node.model.path };
|
|
165
165
|
}
|
|
166
166
|
if (node.ref !== void 0) {
|
|
167
|
-
props[
|
|
167
|
+
props[chunkPBPUSZIQ_cjs.NOVA_REF_PROP] = node.ref;
|
|
168
168
|
}
|
|
169
|
-
const viewOf = (child, i) => /* @__PURE__ */ jsxRuntime.jsx(RenderNodeView, { node: child },
|
|
169
|
+
const viewOf = (child, i) => /* @__PURE__ */ jsxRuntime.jsx(RenderNodeView, { node: child }, chunkPBPUSZIQ_cjs.renderNodeKey(child, i));
|
|
170
170
|
if (!node.children.some(chunkPNQY6OFB_cjs.isHeadNode)) {
|
|
171
171
|
return react.createElement(Component2, props, node.children.length === 0 ? void 0 : node.children.map(viewOf));
|
|
172
172
|
}
|
|
@@ -177,7 +177,7 @@ var RenderNodeView = ({ node }) => {
|
|
|
177
177
|
views.filter((child) => child.head).map((child) => child.view)
|
|
178
178
|
] });
|
|
179
179
|
};
|
|
180
|
-
var RenderTree = ({ nodes }) => /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: nodes.map((node, i) => /* @__PURE__ */ jsxRuntime.jsx(RenderNodeView, { node },
|
|
180
|
+
var RenderTree = ({ nodes }) => /* @__PURE__ */ jsxRuntime.jsx(react.Fragment, { children: nodes.map((node, i) => /* @__PURE__ */ jsxRuntime.jsx(RenderNodeView, { node }, chunkPBPUSZIQ_cjs.renderNodeKey(node, i))) });
|
|
181
181
|
var NovaErrorBoundary = class extends react.Component {
|
|
182
182
|
state = { error: void 0 };
|
|
183
183
|
static getDerivedStateFromError(error) {
|
|
@@ -275,11 +275,11 @@ var NovaLayout = ({
|
|
|
275
275
|
if (components !== void 0) reg.registerAll(components);
|
|
276
276
|
return reg;
|
|
277
277
|
});
|
|
278
|
-
const [store] = react.useState(() => storeProp ??
|
|
278
|
+
const [store] = react.useState(() => storeProp ?? chunkPBPUSZIQ_cjs.createLayoutStore());
|
|
279
279
|
const nodes = react.useMemo(() => {
|
|
280
280
|
const resolved = typeof layout === "string" ? store.get(layout) : layout;
|
|
281
281
|
if (resolved === void 0) return [];
|
|
282
|
-
return
|
|
282
|
+
return chunkPBPUSZIQ_cjs.renderLayout(resolved, data ?? {}, {
|
|
283
283
|
store,
|
|
284
284
|
registry,
|
|
285
285
|
...strict === void 0 ? {} : { strict },
|
|
@@ -575,7 +575,7 @@ var Input = ({
|
|
|
575
575
|
};
|
|
576
576
|
Input.meta = {
|
|
577
577
|
description: "Text input bound to data via the `model` field on the layout node.",
|
|
578
|
-
propsSchema:
|
|
578
|
+
propsSchema: chunkHYFNOF7Y_cjs.InputPropsSchema
|
|
579
579
|
};
|
|
580
580
|
var BASE_STYLE = {
|
|
581
581
|
borderRadius: 6,
|
|
@@ -649,7 +649,7 @@ var Button = ({
|
|
|
649
649
|
};
|
|
650
650
|
Button.meta = {
|
|
651
651
|
description: "Clickable button. Click events fire as `ui:click` with the layout node's ref.",
|
|
652
|
-
propsSchema:
|
|
652
|
+
propsSchema: chunkHYFNOF7Y_cjs.ButtonPropsSchema
|
|
653
653
|
};
|
|
654
654
|
var Box = ({
|
|
655
655
|
padding,
|
|
@@ -668,7 +668,7 @@ var Box = ({
|
|
|
668
668
|
};
|
|
669
669
|
Box.meta = {
|
|
670
670
|
description: "Generic container with basic styling props. Use Stack for layout, Box for visual wrapping.",
|
|
671
|
-
propsSchema:
|
|
671
|
+
propsSchema: chunkHYFNOF7Y_cjs.BoxPropsSchema
|
|
672
672
|
};
|
|
673
673
|
var Panel = ({ title, backRef, closeRef, children }) => {
|
|
674
674
|
const dispatch = useNovaDispatch();
|
|
@@ -697,7 +697,7 @@ var Panel = ({ title, backRef, closeRef, children }) => {
|
|
|
697
697
|
children
|
|
698
698
|
] });
|
|
699
699
|
};
|
|
700
|
-
Panel.meta = { description: "A framed, elevated surface with an optional title; `closeRef` adds a header \u2715.", propsSchema:
|
|
700
|
+
Panel.meta = { description: "A framed, elevated surface with an optional title; `closeRef` adds a header \u2715.", propsSchema: chunkHYFNOF7Y_cjs.PanelPropsSchema };
|
|
701
701
|
var entriesOf = (value) => Array.isArray(value) ? value.map((item, index) => [String(index), item]) : Object.entries(value);
|
|
702
702
|
var JsonNode = ({ value, name }) => {
|
|
703
703
|
if (value !== null && typeof value === "object") {
|
|
@@ -712,7 +712,7 @@ var JsonNode = ({ value, name }) => {
|
|
|
712
712
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { style: { whiteSpace: "pre-wrap", wordBreak: "break-word" }, children: text });
|
|
713
713
|
};
|
|
714
714
|
var JsonTree = ({ value, label }) => /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontFamily: "ui-monospace, SFMono-Regular, Menlo, monospace", fontSize: 12, lineHeight: 1.5 }, children: /* @__PURE__ */ jsxRuntime.jsx(JsonNode, { value, name: label }) });
|
|
715
|
-
JsonTree.meta = { description: "A collapsible view of any JSON value.", propsSchema:
|
|
715
|
+
JsonTree.meta = { description: "A collapsible view of any JSON value.", propsSchema: chunkHYFNOF7Y_cjs.JsonTreePropsSchema };
|
|
716
716
|
var CanvasSlot = ({
|
|
717
717
|
canvasId
|
|
718
718
|
}) => {
|
|
@@ -722,7 +722,7 @@ var CanvasSlot = ({
|
|
|
722
722
|
};
|
|
723
723
|
CanvasSlot.meta = {
|
|
724
724
|
description: "Renders a canvas by id, recursing into its actionLayout.",
|
|
725
|
-
propsSchema:
|
|
725
|
+
propsSchema: chunkHYFNOF7Y_cjs.CanvasSlotPropsSchema
|
|
726
726
|
};
|
|
727
727
|
var ActionSlot = ({
|
|
728
728
|
instanceId
|
|
@@ -734,7 +734,7 @@ var ActionSlot = ({
|
|
|
734
734
|
const ctx = react.useContext(NovaRenderContext);
|
|
735
735
|
const scoped = react.useMemo(() => {
|
|
736
736
|
if (ctx === void 0 || instanceId === void 0 || instanceId === "") return ctx;
|
|
737
|
-
return { ...ctx, dispatch:
|
|
737
|
+
return { ...ctx, dispatch: chunkECFWPZGL_cjs.scopeDispatch(ctx.dispatch, instanceId) };
|
|
738
738
|
}, [ctx, instanceId]);
|
|
739
739
|
if (slotWrapper === void 0) {
|
|
740
740
|
if (!hasInstance) return null;
|
|
@@ -754,7 +754,7 @@ var ActionSlot = ({
|
|
|
754
754
|
};
|
|
755
755
|
ActionSlot.meta = {
|
|
756
756
|
description: "Renders an action instance by id. Used inside a canvas actionLayout.",
|
|
757
|
-
propsSchema:
|
|
757
|
+
propsSchema: chunkHYFNOF7Y_cjs.ActionSlotPropsSchema
|
|
758
758
|
};
|
|
759
759
|
|
|
760
760
|
// src/adapters/react/components/index.ts
|
|
@@ -804,5 +804,5 @@ exports.useShell = useShell;
|
|
|
804
804
|
exports.useShellRenderTree = useShellRenderTree;
|
|
805
805
|
exports.useShellState = useShellState;
|
|
806
806
|
exports.useSlotWrapper = useSlotWrapper;
|
|
807
|
-
//# sourceMappingURL=chunk-
|
|
808
|
-
//# sourceMappingURL=chunk-
|
|
807
|
+
//# sourceMappingURL=chunk-Z7CS43ZT.cjs.map
|
|
808
|
+
//# sourceMappingURL=chunk-Z7CS43ZT.cjs.map
|