@adobe/data 0.9.34 → 0.9.36

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.
Files changed (39) hide show
  1. package/dist/LICENSE +21 -0
  2. package/dist/README.md +296 -0
  3. package/dist/package.json +183 -0
  4. package/dist/schema/schema.d.ts +2 -0
  5. package/dist/service/agentic-service/create-from-config.d.ts +45 -0
  6. package/dist/service/agentic-service/create-from-config.js +85 -0
  7. package/dist/service/agentic-service/create-from-config.js.map +1 -0
  8. package/dist/service/agentic-service/create.d.ts +8 -8
  9. package/dist/service/agentic-service/create.interface-first-spike.type-test.js +119 -0
  10. package/dist/service/agentic-service/create.interface-first-spike.type-test.js.map +1 -0
  11. package/dist/service/agentic-service/create.js +3 -5
  12. package/dist/service/agentic-service/create.js.map +1 -1
  13. package/dist/service/agentic-service/create.test.js +131 -31
  14. package/dist/service/agentic-service/create.test.js.map +1 -1
  15. package/dist/service/agentic-service/create.type-test.js +22 -18
  16. package/dist/service/agentic-service/create.type-test.js.map +1 -1
  17. package/dist/service/agentic-service/index.d.ts +1 -0
  18. package/dist/service/agentic-service/index.js +3 -0
  19. package/dist/service/agentic-service/index.js.map +1 -0
  20. package/dist/service/dynamic-service/create.interface-first-spike.type-test.d.ts +1 -0
  21. package/dist/service/dynamic-service/create.interface-first-spike.type-test.js +118 -0
  22. package/dist/service/dynamic-service/create.interface-first-spike.type-test.js.map +1 -0
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/dist/ecs/database/observe-select-deep.d.ts +0 -23
  26. package/dist/ecs/database/observe-select-deep.js +0 -15
  27. package/dist/ecs/database/observe-select-deep.js.map +0 -1
  28. package/dist/ecs/database/observe-select-deep.type-test.js +0 -111
  29. package/dist/ecs/database/observe-select-deep.type-test.js.map +0 -1
  30. package/dist/service/agentic-service/link.d.ts +0 -15
  31. package/dist/service/agentic-service/link.js +0 -3
  32. package/dist/service/agentic-service/link.js.map +0 -1
  33. package/dist/service/dynamic-service/semantic-service.d.ts +0 -19
  34. package/dist/service/dynamic-service/semantic-service.js +0 -2
  35. package/dist/service/dynamic-service/semantic-service.js.map +0 -1
  36. package/dist/service/semantic-service/semantic-service.d.ts +0 -19
  37. package/dist/service/semantic-service/semantic-service.js +0 -2
  38. package/dist/service/semantic-service/semantic-service.js.map +0 -1
  39. /package/dist/{ecs/database/observe-select-deep.type-test.d.ts → service/agentic-service/create.interface-first-spike.type-test.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adobe/data",
3
- "version": "0.9.34",
3
+ "version": "0.9.36",
4
4
  "description": "Adobe data oriented programming library",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -1,23 +0,0 @@
1
- import { Observe } from "../../observe/index.js";
2
- import { StringKeyof } from "../../types/types.js";
3
- import { RequiredComponents } from "../required-components.js";
4
- import { Components } from "../store/components.js";
5
- import { EntitySelectOptions } from "../store/entity-select-options.js";
6
- import { Database } from "./database.js";
7
- /**
8
- * Entity data shape returned by observeSelectDeep.
9
- * Includes required components (id) and each queried component with its correct type.
10
- */
11
- export type SelectDeepEntityData<C, Include extends StringKeyof<C>> = RequiredComponents & {
12
- readonly [K in Include]: C[K];
13
- };
14
- /**
15
- * Deeply observe entity data for an archetype query.
16
- *
17
- * Unlike `db.observe.select` (which returns entity IDs and only triggers on
18
- * set membership changes), `observeSelectDeep` returns full typed entity data
19
- * and re-emits whenever ANY included component value changes on any matched entity.
20
- *
21
- * This IS NOT an efficient pattern, so use sparingly and with small number of entities.
22
- */
23
- export declare const observeSelectDeep: <C extends Components, Include extends StringKeyof<C>>(db: Database<C, any, any, any, any, any, any, any>, include: readonly Include[], options?: EntitySelectOptions<C, Pick<C & RequiredComponents, Include>>) => Observe<readonly SelectDeepEntityData<C, Include>[]>;
@@ -1,15 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- /**
3
- * Deeply observe entity data for an archetype query.
4
- *
5
- * Unlike `db.observe.select` (which returns entity IDs and only triggers on
6
- * set membership changes), `observeSelectDeep` returns full typed entity data
7
- * and re-emits whenever ANY included component value changes on any matched entity.
8
- *
9
- * This IS NOT an efficient pattern, so use sparingly and with small number of entities.
10
- */
11
- export const observeSelectDeep = (db, include, options) => {
12
- // TODO: implementation — returns a stub for now so the type signature compiles.
13
- return (_notify) => () => { };
14
- };
15
- //# sourceMappingURL=observe-select-deep.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observe-select-deep.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-select-deep.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAkBvD;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAI/B,EAAkD,EAClD,OAA2B,EAC3B,OAAuE,EACjB,EAAE;IACxD,gFAAgF;IAChF,OAAO,CAAC,OAAO,EAAE,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC;AAChC,CAAC,CAAC"}
@@ -1,111 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- import { Database } from "./database.js";
3
- import { observeSelectDeep } from "./observe-select-deep.js";
4
- /**
5
- * Type-only tests for observeSelectDeep type inference.
6
- *
7
- * These tests verify that:
8
- * 1. observeSelectDeep infers entity data types from included components
9
- * 2. Only queried components appear in the result type
10
- * 3. RequiredComponents (id) is always included
11
- * 4. The helper type SelectDeepEntityData resolves correctly
12
- *
13
- * Note: These are compile-time type checks only — they don't need to execute.
14
- */
15
- // ============================================================================
16
- // SelectDeepEntityData HELPER TYPE
17
- // ============================================================================
18
- function testSelectDeepEntityDataType() {
19
- }
20
- // ============================================================================
21
- // BASIC INFERENCE FROM DATABASE
22
- // ============================================================================
23
- function testObserveSelectDeepBasicInference() {
24
- const plugin = Database.Plugin.create({
25
- components: {
26
- position: { type: "number" },
27
- velocity: { type: "number" },
28
- name: { type: "string" },
29
- },
30
- archetypes: {
31
- Moving: ["position", "velocity"],
32
- },
33
- });
34
- const db = Database.create(plugin);
35
- // Querying position and velocity should infer correct entity data
36
- const observed = observeSelectDeep(db, ["position", "velocity"]);
37
- }
38
- // ============================================================================
39
- // SINGLE COMPONENT QUERY
40
- // ============================================================================
41
- function testObserveSelectDeepSingleComponent() {
42
- const plugin = Database.Plugin.create({
43
- components: {
44
- position: { type: "number" },
45
- name: { type: "string" },
46
- },
47
- });
48
- const db = Database.create(plugin);
49
- // Querying only name should produce id + name
50
- const observed = observeSelectDeep(db, ["name"]);
51
- }
52
- // ============================================================================
53
- // INVALID COMPONENT NAMES REJECTED
54
- // ============================================================================
55
- function testObserveSelectDeepRejectsInvalidComponents() {
56
- const plugin = Database.Plugin.create({
57
- components: {
58
- position: { type: "number" },
59
- },
60
- });
61
- const db = Database.create(plugin);
62
- // @ts-expect-error - "nonexistent" is not a valid component name
63
- observeSelectDeep(db, ["nonexistent"]);
64
- }
65
- // ============================================================================
66
- // WITH OPTIONS (where/order)
67
- // ============================================================================
68
- function testObserveSelectDeepWithOptions() {
69
- const plugin = Database.Plugin.create({
70
- components: {
71
- position: { type: "number" },
72
- velocity: { type: "number" },
73
- name: { type: "string" },
74
- },
75
- archetypes: {
76
- Moving: ["position", "velocity"],
77
- },
78
- });
79
- const db = Database.create(plugin);
80
- // Should accept where/order options scoped to included components
81
- const observed = observeSelectDeep(db, ["position", "velocity"], {
82
- where: { position: { ">": 0 } },
83
- order: { velocity: true },
84
- });
85
- }
86
- // ============================================================================
87
- // EXTENDED PLUGIN INFERENCE
88
- // ============================================================================
89
- function testObserveSelectDeepWithExtendedPlugin() {
90
- const basePlugin = Database.Plugin.create({
91
- components: {
92
- position: { type: "number" },
93
- },
94
- archetypes: {
95
- Positioned: ["position"],
96
- },
97
- });
98
- const extendedPlugin = Database.Plugin.create({
99
- extends: basePlugin,
100
- components: {
101
- velocity: { type: "number" },
102
- },
103
- archetypes: {
104
- Moving: ["position", "velocity"],
105
- },
106
- });
107
- const db = Database.create(extendedPlugin);
108
- // Should work with components from both base and extended plugins
109
- const observed = observeSelectDeep(db, ["position", "velocity"]);
110
- }
111
- //# sourceMappingURL=observe-select-deep.type-test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"observe-select-deep.type-test.js","sourceRoot":"","sources":["../../../src/ecs/database/observe-select-deep.type-test.ts"],"names":[],"mappings":"AAAA,uDAAuD;AAIvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,0BAA0B,CAAC;AAEnF;;;;;;;;;;GAUG;AAEH,+EAA+E;AAC/E,mCAAmC;AACnC,+EAA+E;AAE/E,SAAS,4BAA4B;AAmBrC,CAAC;AAED,+EAA+E;AAC/E,gCAAgC;AAChC,+EAA+E;AAE/E,SAAS,mCAAmC;IACxC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC3B;QACD,UAAU,EAAE;YACR,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;SACnC;KACJ,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAEnC,kEAAkE;IAClE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAQrE,CAAC;AAED,+EAA+E;AAC/E,yBAAyB;AACzB,+EAA+E;AAE/E,SAAS,oCAAoC;IACzC,MAAM,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QAClC,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC5B,IAAI,EAAE,EAAE,IAAI,EA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AAE;QAC/B,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE;KAC5B,CAAC,CAAC;AAQP,CAAC;AAED,+EAA+E;AAC/E,4BAA4B;AAC5B,+EAA+E;AAE/E,SAAS,uCAAuC;IAC5C,MAAM,UAAU,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QACtC,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;QACD,UAAU,EAAE;YACR,UAAU,EAAE,CAAC,UAAU,CAAC;SAC3B;KACJ,CAAC,CAAC;IAEH,MAAM,cAAc,GAAG,QAAQ,CAAC,MAAM,CAAC,MAAM,CAAC;QAC1C,OAAO,EAAE,UAAU;QACnB,UAAU,EAAE;YACR,QAAQ,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC/B;QACD,UAAU,EAAE;YACR,MAAM,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC;SACnC;KACJ,CAAC,CAAC;IAEH,MAAM,EAAE,GAAG,QAAQ,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;IAE3C,kEAAkE;IAClE,MAAM,QAAQ,GAAG,iBAAiB,CAAC,EAAE,EAAE,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC,CAAC;AAQrE,CAAC"}
@@ -1,15 +0,0 @@
1
- import type { AgenticService } from "./agentic-service.js";
2
- /**
3
- * A link to another agentic service. Used to expose related services (e.g. parent,
4
- * children, sibling workflows) so the UI can navigate or delegate to them.
5
- * Either `service` (in-process) or `serviceId` (resolved by host) must be set.
6
- */
7
- export type Link = {
8
- service: AgenticService;
9
- label?: string;
10
- description?: string;
11
- } | {
12
- serviceId: string;
13
- label?: string;
14
- description?: string;
15
- };
@@ -1,3 +0,0 @@
1
- // © 2026 Adobe. MIT License. See /LICENSE for details.
2
- export {};
3
- //# sourceMappingURL=link.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/service/agentic-service/link.ts"],"names":[],"mappings":"AAAA,uDAAuD"}
@@ -1,19 +0,0 @@
1
- import { Observe } from "../../observe/index.js";
2
- import { Schema } from "../../schema/index.js";
3
- import { Service } from "../service.js";
4
- export type SemanticState<S extends Schema = Schema> = {
5
- schema: S;
6
- value: Schema.ToType<S>;
7
- };
8
- export type SemanticAction<S extends Schema | false = Schema> = {
9
- schema: S;
10
- execute: Schema.ToType<S> extends void ? (() => void) : ((state: Schema.ToType<S>) => void);
11
- };
12
- export interface SemanticService extends Service {
13
- states: Observe<{
14
- [key: string]: SemanticState;
15
- }>;
16
- actions: Observe<{
17
- [key: string]: SemanticAction;
18
- }>;
19
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=semantic-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semantic-service.js","sourceRoot":"","sources":["../../../src/service/dynamic-service/semantic-service.ts"],"names":[],"mappings":""}
@@ -1,19 +0,0 @@
1
- import { Observe } from "../../observe/index.js";
2
- import { Schema } from "../../schema/index.js";
3
- import { Service } from "../service.js";
4
- export type SemanticState<S extends Schema = Schema> = {
5
- schema: S;
6
- value: Schema.ToType<S>;
7
- };
8
- export type SemanticAction<S extends Schema | false = Schema> = {
9
- schema: S;
10
- execute: Schema.ToType<S> extends void ? (() => void) : ((state: Schema.ToType<S>) => void);
11
- };
12
- export interface SemanticService extends Service {
13
- states: Observe<{
14
- [key: string]: SemanticState;
15
- }>;
16
- actions: Observe<{
17
- [key: string]: SemanticAction;
18
- }>;
19
- }
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=semantic-service.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"semantic-service.js","sourceRoot":"","sources":["../../../src/service/semantic-service/semantic-service.ts"],"names":[],"mappings":""}