@adobe/data-ai 0.9.102 → 0.10.1
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/.claude/rules/ecs.md
CHANGED
|
@@ -140,6 +140,9 @@ Synchronous, deterministic atomic mutations. Receive `store` and a payload.
|
|
|
140
140
|
- `store.resources.x = value` — mutate resources
|
|
141
141
|
- `store.get(entity, 'component')` — read component value
|
|
142
142
|
- `store.select(archetype.components, { where })` — query entities
|
|
143
|
+
- `store.count(archetype.components, { where })` — count entities; sums archetype row
|
|
144
|
+
counts with no entity-array allocation (reactive: `db.observe.count(...)` →
|
|
145
|
+
`Observe<number>`). Prefer over `select(...).length` for membership/count computeds.
|
|
143
146
|
|
|
144
147
|
### actions
|
|
145
148
|
|
|
@@ -46,6 +46,12 @@ Type the parameter on the lowest database layer that exposes what it
|
|
|
46
46
|
reads. An `index.ts` barrel re-exports every computed; `computed-database.ts`
|
|
47
47
|
registers it under the `computed` facet.
|
|
48
48
|
|
|
49
|
+
For a computed that only needs *how many* entities match an archetype (an
|
|
50
|
+
empty-state flag, a badge count), read `db.observe.count(archetype.components,
|
|
51
|
+
{ where })` — an `Observe<number>` that sums archetype row counts and re-emits
|
|
52
|
+
only when the count changes, allocating no entity array. Prefer it over
|
|
53
|
+
`db.observe.select(...)` mapped through `.length`.
|
|
54
|
+
|
|
49
55
|
**Conform a computed to its `data/state` derivation** whenever one exists. The
|
|
50
56
|
derivation co-locates `{ input, value }` cases (`Derivation<typeof fn>`), and the
|
|
51
57
|
feature's single `conformance/conformance.test.ts` `Conformance.runFeature({...})`
|
|
@@ -70,6 +70,7 @@ literal, it is a function and does not belong in `constants.ts`.
|
|
|
70
70
|
- **`export namespace <TypeName> { ... }`** — Use `export * as <TypeName> from "./public.js"` instead.
|
|
71
71
|
- **Prefixing function files with the type name** (e.g., `vec2-add.ts`) — Use `add.ts`; the folder provides context.
|
|
72
72
|
- **Importing from `public.js` or `-schema.js`** outside the type folder — Consumers must import only from `<type-name>/<type-name>.ts`.
|
|
73
|
+
- **A generic `functions/` folder for helpers** — a helper lives on the namespace of the type it most closely relates to (or, for a single caller, as a private declaration in that caller); never a typeless `functions/` bucket.
|
|
73
74
|
|
|
74
75
|
## Consumers
|
|
75
76
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe/data-ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "Cross-agent architecture skills for @adobe/data — installable as a Claude Code plugin or copied into any Agent-Skills-compatible agent (Cursor, Codex).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"private": false,
|
|
@@ -29,12 +29,12 @@
|
|
|
29
29
|
"skills"
|
|
30
30
|
],
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@adobe/data": "0.
|
|
32
|
+
"@adobe/data": "0.10.1"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "^5.8.3",
|
|
36
36
|
"vitest": "^1.6.0",
|
|
37
|
-
"@adobe/data": "0.
|
|
37
|
+
"@adobe/data": "0.10.1"
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"scripts": {
|