Add node registry primitives (PR 0.1 of node-registry plan)
Introduces the @pascal-app/core/registry surface that future node-bundle packages (and external plugins) will use to register node kinds with the host. No runtime behavior changes — registry is empty until subsequent PRs populate it. - types.ts: NodeDefinition, Capabilities, Relations, DragAction, Plugin, ParametricDescriptor, Affordance, SceneApi, NodeRegistry. Capability configs accept an override escape hatch; additive-only after v1. - registry.ts: nodeRegistry singleton, registerNode, async loadPlugin. Validates kind, schemaVersion, apiVersion; rejects duplicate kinds. - scene-api.ts: createSceneApi factory wrapping the scene store with copy-on-write snapshot semantics for pauseHistory/restore/resumeHistory. - index.ts: barrel re-exporting the public surface. - core/index.ts + package.json: export * from registry and add the ./registry subpath so consumers can import either way. Tests (27 cases, all bun:test): registry registration / validation / plugin loading; SceneApi read/write/dirty/history; lazy snapshot capture with update/upsert/delete reversal via restore and restoreAll. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
c50a4df8e1
commit
fb91713374
@@ -16,6 +16,11 @@
|
||||
"import": "./dist/utils/clone-scene-graph.js",
|
||||
"default": "./dist/utils/clone-scene-graph.js"
|
||||
},
|
||||
"./registry": {
|
||||
"types": "./dist/registry/index.d.ts",
|
||||
"import": "./dist/registry/index.js",
|
||||
"default": "./dist/registry/index.js"
|
||||
},
|
||||
"./schema": {
|
||||
"types": "./dist/schema/index.d.ts",
|
||||
"import": "./dist/schema/index.js",
|
||||
|
||||
Reference in New Issue
Block a user