@prometheus-ags/prometheus-entity-management 1.0.0 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,46 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
5
5
 
6
6
  ---
7
7
 
8
+ ## [1.2.0] — 2026-04-05
9
+
10
+ PWA/local-first and schema-driven entity release focused on dynamic JSON-column UI, markdown-aware rendering, and IPC-safe graph persistence.
11
+
12
+ ### Added
13
+
14
+ - Local-first runtime helpers: `startLocalFirstGraph(...)`, `hydrateGraphFromStorage(...)`, `persistGraphToStorage(...)`, and `useGraphSyncStatus()`.
15
+ - Serializable pending graph action records and replay hooks for persisted optimistic workflows.
16
+ - JSON Schema registry APIs: `registerEntityJsonSchema(...)`, `registerRuntimeSchema(...)`, `getEntityJsonSchema(...)`, `buildEntityFieldsFromSchema(...)`, and `useSchemaEntityFields(...)`.
17
+ - Built-in markdown support with `MarkdownFieldRenderer`, `MarkdownFieldEditor`, and schema-driven `format: "markdown"` field generation.
18
+ - Schema-aware AI helpers: `createSchemaGraphTool(...)` and `exportGraphSnapshotWithSchemas(...)`.
19
+ - Vitest coverage for persisted graph hydration, pending action replay, schema-driven field generation, runtime schema replacement, and safe markdown rendering.
20
+
21
+ ### Changed
22
+
23
+ - `EntityFormSheet` and related CRUD state now support dotted field paths for nested JSON-column editing.
24
+ - `FieldType` now includes `json` and `markdown`.
25
+ - Public docs and API references now describe the local-first runtime and schema/A2UI-oriented dynamic entity surface.
26
+
27
+ ## [1.1.0] — 2026-04-05
28
+
29
+ Graph-runtime expansion release focused on TanStack DB comparison gaps without changing the library’s core React entity-graph architecture.
30
+
31
+ ### Added
32
+
33
+ - Graph runtime snapshot helpers: `queryOnce(...)` and `selectGraph(...)`.
34
+ - Nested graph projection support via graph-native `include` definitions.
35
+ - Explicit optimistic write primitives: `createGraphTransaction(...)` and `createGraphAction(...)`.
36
+ - Graph workflow/effect helper: `createGraphEffect(...)`.
37
+ - Per-entity sync/provenance metadata exposed through snapshot reads: `$synced`, `$origin`, `$updatedAt`.
38
+ - AI interoperability helpers: `createGraphTool(...)` and `exportGraphSnapshot(...)`.
39
+ - Vitest coverage for graph runtime querying, actions, rollback, effects, and AI helpers.
40
+ - New comparison documentation: `docs/tanstack-comparison.md`.
41
+
42
+ ### Changed
43
+
44
+ - Core read paths now resolve sync-aware snapshots rather than base-entity-plus-patch merges alone.
45
+ - Optimistic mutation and CRUD flows now track sync metadata and restore it correctly on rollback.
46
+ - Top-level docs now describe the graph runtime surface and the library’s positioning relative to TanStack DB, Query, Table, AI, and Intent.
47
+
8
48
  ## [1.0.0] — 2026-04-04
9
49
 
10
50
  Production-ready semantic version with CI, tests, documentation, and skills export verification.
package/README.md CHANGED
@@ -9,6 +9,7 @@ Update a post in one screen and every list row, detail panel, and badge that rea
9
9
  | Doc | Purpose |
10
10
  |-----|---------|
11
11
  | [docs/tanstack-query-and-table.md](docs/tanstack-query-and-table.md) | How this library fits with TanStack Query and TanStack Table |
12
+ | [docs/tanstack-comparison.md](docs/tanstack-comparison.md) | Detailed comparison against TanStack DB, Query, Table, AI, and Intent |
12
13
  | [docs/advanced.md](docs/advanced.md) | Engine, GC, Suspense, DevTools, SSR, testing |
13
14
  | [RELEASING.md](RELEASING.md) | Versioning, `prepublishOnly`, npm publish |
14
15
  | [CHANGELOG.md](CHANGELOG.md) | Release history |
@@ -20,10 +21,10 @@ Update a post in one screen and every list row, detail panel, and badge that rea
20
21
  ### 1. Install
21
22
 
22
23
  ```bash
23
- npm install @prometheus-ags/prometheus-entity-management zustand immer
24
+ pnpm add @prometheus-ags/prometheus-entity-management zustand immer
24
25
  ```
25
26
 
26
- (`pnpm` and `yarn` work the same way for app dependencies.)
27
+ (`npm install` works for consumers too; this repository itself is `pnpm`-only.)
27
28
 
28
29
  ### 2. Define an entity type
29
30
 
@@ -98,6 +99,24 @@ Data flows **up** into the graph; UI reads **down** through hooks (see [Architec
98
99
 
99
100
  ---
100
101
 
102
+ ## New in v1.2
103
+
104
+ The graph runtime now exposes a focused set of non-hook helpers for loaders, workflows, and orchestration:
105
+
106
+ - `queryOnce(...)` / `selectGraph(...)` for one-shot graph snapshots without a live subscription
107
+ - nested `include` projections over normalized graph data
108
+ - `createGraphTransaction(...)` / `createGraphAction(...)` for explicit optimistic graph writes with rollback
109
+ - sync-aware snapshot metadata: `$synced`, `$origin`, `$updatedAt`
110
+ - `createGraphEffect(...)` for enter/update/exit reactions over graph query results
111
+ - `createGraphTool(...)` / `exportGraphSnapshot(...)` for AI interoperability without bundling an AI runtime
112
+ - `startLocalFirstGraph(...)`, `hydrateGraphFromStorage(...)`, and `persistGraphToStorage(...)` for PWA/PGlite-friendly graph persistence and replay
113
+ - schema-driven entity rendering via `registerEntityJsonSchema(...)`, `buildEntityFieldsFromSchema(...)`, and `useSchemaEntityFields(...)`
114
+ - built-in markdown-aware schema fields plus schema-aware graph export helpers for A2UI/runtime-generated entity models
115
+
116
+ These additions are intentionally graph-native. They extend the entity graph for orchestration use cases without changing the core `Components → Hooks → Stores → APIs/Realtime` architecture.
117
+
118
+ ---
119
+
101
120
  ## Feature comparison
102
121
 
103
122
  | Feature | `@prometheus-ags/prometheus-entity-management` | TanStack Query | Apollo Client | SWR |
@@ -147,6 +166,38 @@ Compare against peers only when measurement methodology matches (minified vs unm
147
166
  | `dedupe` | Process-global in-flight promise deduplication helper. |
148
167
  | `startGarbageCollector` / `stopGarbageCollector` | Periodic eviction of unsubscribed, stale entities (also started via `configureEngine`). |
149
168
 
169
+ ### Graph runtime
170
+
171
+ | Export | Description |
172
+ |--------|-------------|
173
+ | `queryOnce` / `selectGraph` | One-shot graph snapshot queries with local filtering, sorting, and nested includes. |
174
+ | `createGraphTransaction` | Explicit graph write transaction with commit / rollback. |
175
+ | `createGraphAction` | Higher-level optimistic action wrapper around graph transactions. |
176
+ | `createGraphEffect` | Subscribe to graph query results with `onEnter`, `onUpdate`, and `onExit`. |
177
+ | `createGraphTool` | Typed graph-backed helper for AI or workflow integrations. |
178
+ | `createSchemaGraphTool` | Schema-aware graph tool helper for AI workflows built around dynamic entity schemas. |
179
+ | `exportGraphSnapshot` | Serialize graph data for prompts, exports, and non-React workflows. |
180
+
181
+ ### Schema-driven entities
182
+
183
+ | Export | Description |
184
+ |--------|-------------|
185
+ | `registerEntityJsonSchema` / `registerRuntimeSchema` | Register static or runtime-generated JSON Schemas for an entity type or JSON column. |
186
+ | `getEntityJsonSchema` | Resolve the active schema by entity type, schema id, or field. |
187
+ | `buildEntityFieldsFromSchema` | Generate entity field descriptors from JSON Schema for dynamic forms and detail views. |
188
+ | `useSchemaEntityFields` | Hook that resolves a registered schema and returns generated field descriptors. |
189
+ | `MarkdownFieldRenderer` / `MarkdownFieldEditor` | Built-in markdown-aware schema field renderer and editor. |
190
+ | `exportGraphSnapshotWithSchemas` | Serialize graph data together with resolved entity schemas. |
191
+
192
+ ### Local-first runtime
193
+
194
+ | Export | Description |
195
+ |--------|-------------|
196
+ | `startLocalFirstGraph` | Starts a higher-level local-first runtime for graph hydration, persistence, action replay, and sync status. |
197
+ | `hydrateGraphFromStorage` | Restore graph state from a storage adapter using a JSON-serializable snapshot payload. |
198
+ | `persistGraphToStorage` | Persist graph state and pending action metadata through a storage adapter. |
199
+ | `useGraphSyncStatus` | Hook exposing online/offline/hydrating/syncing/ready state for PWAs and IPC-safe hosts. |
200
+
150
201
  ### Hooks (REST-oriented)
151
202
 
152
203
  | Export | Description |
@@ -232,7 +283,7 @@ Compare against peers only when measurement methodology matches (minified vs unm
232
283
 
233
284
  ### Types (high level)
234
285
 
235
- `GraphState`, `EntityState`, `ListState`, `EntityType`, `EntityId`, `EngineOptions`, `EntityQueryOptions`, `ListQueryOptions`, `ViewDescriptor`, `EntitySchema`, `RelationDescriptor`, realtime adapter types, GraphQL types, CRUD types, column meta types all exported from the package entry.
286
+ `GraphState`, `EntityState`, `ListState`, `EntityType`, `EntityId`, `EntitySyncMetadata`, `EntitySnapshot`, `EngineOptions`, `EntityQueryOptions`, `ListQueryOptions`, `ViewDescriptor`, `EntitySchema`, `RelationDescriptor`, realtime adapter types, GraphQL types, CRUD types, and column meta types are all exported from the package entry.
236
287
 
237
288
  ---
238
289
 
@@ -475,6 +526,7 @@ pnpm run dev:next # http://localhost:3000
475
526
  1. **`entities`** — Canonical server-shaped records per `(type, id)`.
476
527
  2. **`patches`** — Local-only overlays (`_selected`, `_loading`, …) merged at read time.
477
528
  3. **`lists`** — Ordered `ids[]`, pagination, and fetch flags — **not** duplicated row payloads.
529
+ 4. **`syncMetadata`** — Per-entity sync/provenance state layered into snapshot reads as `$synced`, `$origin`, and `$updatedAt`.
478
530
 
479
531
  ### Engine (`src/engine.ts`)
480
532