@sixb/core 0.1.3 → 0.1.4
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/dist/actions/index.js +17 -18
- package/dist/actions/index.js.map +1 -1
- package/dist/actions/worker.js +4 -4
- package/dist/actions/worker.js.map +1 -1
- package/dist/agents/context-compaction.d.ts +40 -0
- package/dist/agents/context-compaction.d.ts.map +1 -0
- package/dist/agents/ids.d.ts +2 -0
- package/dist/agents/ids.d.ts.map +1 -1
- package/dist/agents/index.d.ts +6 -5
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +42 -37
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/streams.d.ts +17 -1
- package/dist/agents/streams.d.ts.map +1 -1
- package/dist/agents/streams.js +4 -2
- package/dist/agents/streams.js.map +1 -1
- package/dist/agents/types.d.ts +9 -0
- package/dist/agents/types.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/auth/index.js +7 -3
- package/dist/auth/index.js.map +1 -1
- package/dist/authorization/index.js +6 -2
- package/dist/authorization/index.js.map +1 -1
- package/dist/bootstrap/index.js +30 -31
- package/dist/bootstrap/index.js.map +1 -1
- package/dist/{chunk-xmggaxg4.js → chunk-1wk20wn3.js} +188 -21
- package/dist/{chunk-xmggaxg4.js.map → chunk-1wk20wn3.js.map} +7 -5
- package/dist/{chunk-1ywq4hzk.js → chunk-1yz3x65y.js} +7 -7
- package/dist/{chunk-gqdd7508.js → chunk-4rh2m6zg.js} +1 -1
- package/dist/{chunk-fmx1sz2h.js → chunk-72q2y8hn.js} +3 -3
- package/dist/{chunk-fmx1sz2h.js.map → chunk-72q2y8hn.js.map} +3 -3
- package/dist/{chunk-f1cyvnrk.js → chunk-7gw7mepb.js} +259 -9
- package/dist/chunk-7gw7mepb.js.map +14 -0
- package/dist/{chunk-wb4051cx.js → chunk-819wnjz8.js} +11 -5
- package/dist/chunk-819wnjz8.js.map +12 -0
- package/dist/{chunk-pxtrxm3p.js → chunk-a09jx26t.js} +1 -1
- package/dist/{chunk-ettb0cy4.js → chunk-afjpa2hs.js} +59 -29
- package/dist/{chunk-ettb0cy4.js.map → chunk-afjpa2hs.js.map} +5 -5
- package/dist/{chunk-177ed2mp.js → chunk-c43qr6s0.js} +229 -97
- package/dist/{chunk-177ed2mp.js.map → chunk-c43qr6s0.js.map} +9 -9
- package/dist/{chunk-261ag4t4.js → chunk-cbkm2vam.js} +3 -3
- package/dist/{chunk-zpw39qhj.js → chunk-dm72y8wt.js} +25 -2
- package/dist/chunk-dm72y8wt.js.map +10 -0
- package/dist/{chunk-kqxgf6kv.js → chunk-drjqm1aa.js} +16 -1
- package/dist/{chunk-kqxgf6kv.js.map → chunk-drjqm1aa.js.map} +3 -3
- package/dist/chunk-dysw7nsm.js.map +1 -1
- package/dist/{chunk-4aw0jwk0.js → chunk-f6erf2vv.js} +1 -1
- package/dist/{chunk-4z3n1dzt.js → chunk-f83ka50g.js} +131 -25
- package/dist/chunk-f83ka50g.js.map +23 -0
- package/dist/{chunk-km4rkj4t.js → chunk-g13869yf.js} +3 -3
- package/dist/{chunk-c8bw2b6c.js → chunk-hbeh8j9w.js} +2 -2
- package/dist/{chunk-n5x5y80a.js → chunk-nzw7sm3b.js} +2 -2
- package/dist/{chunk-3rsf30p4.js → chunk-pn8n8sba.js} +16 -15
- package/dist/{chunk-3rsf30p4.js.map → chunk-pn8n8sba.js.map} +3 -3
- package/dist/{chunk-63te770v.js → chunk-qewtks41.js} +8 -8
- package/dist/{chunk-63te770v.js.map → chunk-qewtks41.js.map} +2 -2
- package/dist/{chunk-4p9rh7jj.js → chunk-rs1wbvy6.js} +1 -1
- package/dist/{chunk-88ppkr54.js → chunk-rte5sm3z.js} +26 -2
- package/dist/chunk-rte5sm3z.js.map +12 -0
- package/dist/{chunk-bv41fmjn.js → chunk-s31d0qmq.js} +57 -20
- package/dist/{chunk-bv41fmjn.js.map → chunk-s31d0qmq.js.map} +8 -7
- package/dist/{chunk-c6cfqydk.js → chunk-sxwk41qa.js} +1 -1
- package/dist/chunk-t0jjkep3.js.map +1 -1
- package/dist/{chunk-d6y2wsfg.js → chunk-tek1qwgm.js} +6 -6
- package/dist/{chunk-d6y2wsfg.js.map → chunk-tek1qwgm.js.map} +1 -1
- package/dist/{chunk-d2adj15j.js → chunk-tkdscva6.js} +1 -1
- package/dist/{chunk-ttba8x6z.js → chunk-tycbzedm.js} +2 -2
- package/dist/{chunk-z8j83gzd.js → chunk-x2yw73hy.js} +1 -1
- package/dist/{chunk-qer6am8w.js → chunk-xdf9yswn.js} +1 -1
- package/dist/execution/agent.js +26 -27
- package/dist/execution/agent.js.map +1 -1
- package/dist/execution/primitive.js +26 -27
- package/dist/execution/primitive.js.map +2 -2
- package/dist/execution/request.js +27 -28
- package/dist/execution/request.js.map +2 -2
- package/dist/http/index.js +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +52 -53
- package/dist/index.js.map +1 -1
- package/dist/lake-storage/types.d.ts +2 -1
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/materializer/index.js +15 -16
- package/dist/materializer/index.js.map +1 -1
- package/dist/models/index.d.ts +40 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/objects/execution.d.ts +6 -1
- package/dist/objects/execution.d.ts.map +1 -1
- package/dist/objects/index.js +19 -20
- package/dist/objects/index.js.map +1 -1
- package/dist/objects/link/endpoints.d.ts.map +1 -1
- package/dist/objects/query/executor.d.ts +1 -0
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/explain.d.ts +1 -0
- package/dist/objects/query/explain.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +3 -1
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +30 -5
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/ir.d.ts +14 -1
- package/dist/objects/query/ir.d.ts.map +1 -1
- package/dist/objects/query/links.d.ts +25 -0
- package/dist/objects/query/links.d.ts.map +1 -0
- package/dist/objects/query/normalize.d.ts.map +1 -1
- package/dist/objects/query/planner.d.ts.map +1 -1
- package/dist/objects/query/validate.d.ts +1 -0
- package/dist/objects/query/validate.d.ts.map +1 -1
- package/dist/pipelines/index.js +15 -16
- package/dist/pipelines/index.js.map +1 -1
- package/dist/projections/builders.d.ts +33 -4
- package/dist/projections/builders.d.ts.map +1 -1
- package/dist/projections/index.d.ts +1 -1
- package/dist/projections/index.d.ts.map +1 -1
- package/dist/projections/internal.js +15 -16
- package/dist/projections/internal.js.map +1 -1
- package/dist/projections/run-dispatch.d.ts +1 -0
- package/dist/projections/run-dispatch.d.ts.map +1 -1
- package/dist/projections/types.d.ts +12 -9
- package/dist/projections/types.d.ts.map +1 -1
- package/dist/projections/validation.d.ts +6 -5
- package/dist/projections/validation.d.ts.map +1 -1
- package/dist/query.d.ts +2 -1
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +2 -2
- package/dist/runtime/create.d.ts +3 -0
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/definitions.d.ts +3 -0
- package/dist/runtime/definitions.d.ts.map +1 -1
- package/dist/runtime/host.d.ts +2 -0
- package/dist/runtime/host.d.ts.map +1 -1
- package/dist/runtime/resolve-definitions.d.ts +2 -0
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/storage/agents/in-memory.d.ts +4 -0
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +9 -5
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +5 -0
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +1 -1
- package/dist/storage/ai-usage/in-memory.d.ts +2 -1
- package/dist/storage/ai-usage/in-memory.d.ts.map +1 -1
- package/dist/storage/ai-usage/index.d.ts +1 -1
- package/dist/storage/ai-usage/index.d.ts.map +1 -1
- package/dist/storage/ai-usage/types.d.ts +6 -0
- package/dist/storage/ai-usage/types.d.ts.map +1 -1
- package/dist/storage/index.d.ts +3 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +19 -14
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/objects/in-memory.d.ts +6 -3
- package/dist/storage/objects/in-memory.d.ts.map +1 -1
- package/dist/storage/objects/index.d.ts +3 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/keys.d.ts +16 -0
- package/dist/storage/objects/keys.d.ts.map +1 -0
- package/dist/storage/objects/types.d.ts +33 -6
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/ontology/provider.js +1 -1
- package/dist/storage/workflow-runs/provider.js +9 -5
- package/dist/storage/workflow-runs/provider.js.map +1 -1
- package/dist/syncs/index.js +15 -16
- package/dist/syncs/index.js.map +1 -1
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/effective-storage-contract.d.ts +1 -1
- package/dist/testing/effective-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +455 -40
- package/dist/testing/index.js.map +7 -7
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- package/dist/testing/object-query-contract.d.ts +1 -1
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +13 -14
- package/dist/webhooks/internal.js.map +2 -2
- package/dist/workflows/index.js +27 -28
- package/dist/workflows/index.js.map +1 -1
- package/package.json +1 -1
- package/src/agents/builders.ts +3 -3
- package/src/agents/context-compaction.ts +261 -0
- package/src/agents/ids.ts +5 -0
- package/src/agents/index.ts +18 -9
- package/src/agents/streams.ts +56 -0
- package/src/agents/types.ts +10 -0
- package/src/agents/validation.ts +35 -5
- package/src/http/api-routes.ts +7 -7
- package/src/index.ts +14 -0
- package/src/lake-storage/types.ts +2 -1
- package/src/materializer/telemetry/append.ts +33 -16
- package/src/models/index.ts +71 -0
- package/src/objects/execution.ts +20 -0
- package/src/objects/link/endpoints.ts +2 -1
- package/src/objects/query/executor.ts +42 -11
- package/src/objects/query/explain.ts +11 -0
- package/src/objects/query/index.ts +6 -0
- package/src/objects/query/ir.ts +16 -0
- package/src/objects/query/links.ts +308 -0
- package/src/objects/query/normalize.ts +40 -1
- package/src/objects/query/planner.ts +5 -0
- package/src/objects/query/validate.ts +58 -2
- package/src/projections/builders.ts +220 -15
- package/src/projections/index.ts +1 -0
- package/src/projections/ownership.ts +5 -5
- package/src/projections/registry.ts +9 -3
- package/src/projections/revision.ts +31 -5
- package/src/projections/run-dispatch.ts +10 -1
- package/src/projections/types.ts +13 -9
- package/src/projections/validation.ts +61 -19
- package/src/query.ts +2 -0
- package/src/runtime/create.ts +4 -0
- package/src/runtime/definitions.ts +3 -0
- package/src/runtime/host.ts +2 -0
- package/src/runtime/resolve-definitions.ts +28 -0
- package/src/storage/agents/in-memory.ts +15 -0
- package/src/storage/agents/types.ts +5 -0
- package/src/storage/ai-usage/in-memory.ts +23 -0
- package/src/storage/ai-usage/index.ts +1 -0
- package/src/storage/ai-usage/types.ts +10 -0
- package/src/storage/index.ts +11 -0
- package/src/storage/objects/in-memory.ts +103 -16
- package/src/storage/objects/index.ts +9 -0
- package/src/storage/objects/keys.ts +36 -0
- package/src/storage/objects/types.ts +34 -6
- package/src/storage/ontology/provider-header-validation.ts +2 -2
- package/src/testing/agent-storage-contract.ts +12 -0
- package/src/testing/ai-usage-storage-contract.ts +35 -0
- package/src/testing/effective-storage-contract.ts +194 -4
- package/src/testing/lake-storage-contract.ts +56 -0
- package/src/testing/object-query-contract.ts +208 -1
- package/dist/agents/prompt.d.ts +0 -21
- package/dist/agents/prompt.d.ts.map +0 -1
- package/dist/chunk-4z3n1dzt.js.map +0 -23
- package/dist/chunk-6wetht33.js +0 -89
- package/dist/chunk-6wetht33.js.map +0 -10
- package/dist/chunk-88ppkr54.js.map +0 -12
- package/dist/chunk-f1cyvnrk.js.map +0 -13
- package/dist/chunk-wb4051cx.js.map +0 -12
- package/dist/chunk-zpw39qhj.js.map +0 -10
- package/src/agents/prompt.ts +0 -85
- /package/dist/{chunk-1ywq4hzk.js.map → chunk-1yz3x65y.js.map} +0 -0
- /package/dist/{chunk-gqdd7508.js.map → chunk-4rh2m6zg.js.map} +0 -0
- /package/dist/{chunk-pxtrxm3p.js.map → chunk-a09jx26t.js.map} +0 -0
- /package/dist/{chunk-261ag4t4.js.map → chunk-cbkm2vam.js.map} +0 -0
- /package/dist/{chunk-4aw0jwk0.js.map → chunk-f6erf2vv.js.map} +0 -0
- /package/dist/{chunk-km4rkj4t.js.map → chunk-g13869yf.js.map} +0 -0
- /package/dist/{chunk-c8bw2b6c.js.map → chunk-hbeh8j9w.js.map} +0 -0
- /package/dist/{chunk-n5x5y80a.js.map → chunk-nzw7sm3b.js.map} +0 -0
- /package/dist/{chunk-4p9rh7jj.js.map → chunk-rs1wbvy6.js.map} +0 -0
- /package/dist/{chunk-c6cfqydk.js.map → chunk-sxwk41qa.js.map} +0 -0
- /package/dist/{chunk-d2adj15j.js.map → chunk-tkdscva6.js.map} +0 -0
- /package/dist/{chunk-ttba8x6z.js.map → chunk-tycbzedm.js.map} +0 -0
- /package/dist/{chunk-z8j83gzd.js.map → chunk-x2yw73hy.js.map} +0 -0
- /package/dist/{chunk-qer6am8w.js.map → chunk-xdf9yswn.js.map} +0 -0
package/dist/testing/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
createTestingScope
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-x2yw73hy.js";
|
|
5
5
|
import {
|
|
6
6
|
SixbHost
|
|
7
|
-
} from "../chunk-
|
|
7
|
+
} from "../chunk-s31d0qmq.js";
|
|
8
8
|
import"../chunk-9t8f5xfx.js";
|
|
9
|
-
import"../chunk-
|
|
9
|
+
import"../chunk-819wnjz8.js";
|
|
10
10
|
import {
|
|
11
11
|
QueueError
|
|
12
12
|
} from "../chunk-6gjqgd3d.js";
|
|
@@ -20,10 +20,10 @@ import"../chunk-ghteq96b.js";
|
|
|
20
20
|
import"../chunk-z3zp0bj1.js";
|
|
21
21
|
import"../chunk-zqqz8052.js";
|
|
22
22
|
import"../chunk-f2rt4vkh.js";
|
|
23
|
-
import"../chunk-
|
|
24
|
-
import"../chunk-
|
|
25
|
-
import"../chunk-
|
|
26
|
-
import"../chunk-
|
|
23
|
+
import"../chunk-1yz3x65y.js";
|
|
24
|
+
import"../chunk-sxwk41qa.js";
|
|
25
|
+
import"../chunk-hbeh8j9w.js";
|
|
26
|
+
import"../chunk-rs1wbvy6.js";
|
|
27
27
|
import"../chunk-5sz8ta9r.js";
|
|
28
28
|
import"../chunk-979ww6b3.js";
|
|
29
29
|
import"../chunk-2ab72m2h.js";
|
|
@@ -39,72 +39,75 @@ import {
|
|
|
39
39
|
} from "../chunk-wtmzkcht.js";
|
|
40
40
|
import {
|
|
41
41
|
isBoundSixb
|
|
42
|
-
} from "../chunk-
|
|
43
|
-
import"../chunk-
|
|
44
|
-
import"../chunk-
|
|
45
|
-
import"../chunk-
|
|
46
|
-
import"../chunk-
|
|
42
|
+
} from "../chunk-c43qr6s0.js";
|
|
43
|
+
import"../chunk-g13869yf.js";
|
|
44
|
+
import"../chunk-cbkm2vam.js";
|
|
45
|
+
import"../chunk-pn8n8sba.js";
|
|
46
|
+
import"../chunk-4rh2m6zg.js";
|
|
47
47
|
import"../chunk-xhy826cz.js";
|
|
48
48
|
import {
|
|
49
49
|
collectObjectQueryValidationIssues,
|
|
50
50
|
countObjects,
|
|
51
51
|
executeObjectQuery,
|
|
52
|
+
executeObjectQueryLinks,
|
|
52
53
|
existsObjects,
|
|
53
54
|
facetObjects,
|
|
54
55
|
validateObjectQuery
|
|
55
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-7gw7mepb.js";
|
|
56
57
|
import {
|
|
57
58
|
ObjectQueryPlanningError,
|
|
58
59
|
normalizeObjectQuery
|
|
59
|
-
} from "../chunk-
|
|
60
|
-
import"../chunk-
|
|
60
|
+
} from "../chunk-rte5sm3z.js";
|
|
61
|
+
import"../chunk-qewtks41.js";
|
|
61
62
|
import {
|
|
62
63
|
computeBlobDigest
|
|
63
64
|
} from "../chunk-8b55ygje.js";
|
|
64
65
|
import"../chunk-51fjndv0.js";
|
|
65
66
|
import"../chunk-8m5ejdpn.js";
|
|
66
67
|
import"../chunk-nf4r78r4.js";
|
|
67
|
-
import"../chunk-
|
|
68
|
-
import"../chunk-
|
|
68
|
+
import"../chunk-tycbzedm.js";
|
|
69
|
+
import"../chunk-tek1qwgm.js";
|
|
69
70
|
import {
|
|
70
71
|
ProjectionRegistry,
|
|
71
72
|
createOntologyMaterializer
|
|
72
|
-
} from "../chunk-
|
|
73
|
+
} from "../chunk-afjpa2hs.js";
|
|
73
74
|
import"../chunk-96swp2wd.js";
|
|
74
75
|
import {
|
|
75
76
|
restoreTrustedPrimitiveExecutionScope
|
|
76
|
-
} from "../chunk-
|
|
77
|
+
} from "../chunk-f6erf2vv.js";
|
|
77
78
|
import {
|
|
78
79
|
AGENT_MESSAGE_CONTENT_VERSION,
|
|
79
|
-
AiCostStorageError
|
|
80
|
-
|
|
80
|
+
AiCostStorageError,
|
|
81
|
+
linkBatchKey,
|
|
82
|
+
objectBatchKey,
|
|
83
|
+
objectLinkCursor
|
|
84
|
+
} from "../chunk-1wk20wn3.js";
|
|
81
85
|
import {
|
|
82
86
|
createEventId
|
|
83
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-72q2y8hn.js";
|
|
84
88
|
import"../chunk-xc7hq65b.js";
|
|
85
89
|
import"../chunk-cy0n5dms.js";
|
|
86
90
|
import"../chunk-dysw7nsm.js";
|
|
87
91
|
import"../chunk-62c7t4jc.js";
|
|
88
92
|
import"../chunk-ezake7g1.js";
|
|
89
|
-
import"../chunk-
|
|
93
|
+
import"../chunk-a09jx26t.js";
|
|
90
94
|
import"../chunk-htq0qh7z.js";
|
|
91
95
|
import"../chunk-xkthy56g.js";
|
|
92
96
|
import {
|
|
93
97
|
AgentStorageError
|
|
94
|
-
} from "../chunk-
|
|
98
|
+
} from "../chunk-xdf9yswn.js";
|
|
95
99
|
import {
|
|
96
100
|
agentServiceAccountId
|
|
97
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-nzw7sm3b.js";
|
|
98
102
|
import"../chunk-t9xghkva.js";
|
|
99
103
|
import {
|
|
100
104
|
AiUsageStorageError
|
|
101
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-drjqm1aa.js";
|
|
102
106
|
import"../chunk-5gd7tpv6.js";
|
|
103
107
|
import"../chunk-h9kxd41f.js";
|
|
104
108
|
import"../chunk-9dzba0f2.js";
|
|
105
109
|
import"../chunk-vybf6pkp.js";
|
|
106
110
|
import"../chunk-ry24jbr1.js";
|
|
107
|
-
import"../chunk-6wetht33.js";
|
|
108
111
|
import {
|
|
109
112
|
OntologyRegistry,
|
|
110
113
|
defineObjectType,
|
|
@@ -117,24 +120,24 @@ import"../chunk-zcnhxkvd.js";
|
|
|
117
120
|
import"../chunk-1evzqhks.js";
|
|
118
121
|
import"../chunk-dsrkgtnh.js";
|
|
119
122
|
import"../chunk-bhxaq2nn.js";
|
|
120
|
-
import"../chunk-rnshztfq.js";
|
|
121
|
-
import"../chunk-04b07a9q.js";
|
|
122
|
-
import"../chunk-dktq02ne.js";
|
|
123
|
-
import {
|
|
124
|
-
blobIdFromDigest
|
|
125
|
-
} from "../chunk-zqysyfjt.js";
|
|
126
123
|
import"../chunk-yt8wphsx.js";
|
|
127
124
|
import"../chunk-rdeagz6b.js";
|
|
128
|
-
import"../chunk-
|
|
125
|
+
import"../chunk-dm72y8wt.js";
|
|
129
126
|
import"../chunk-t0jjkep3.js";
|
|
130
127
|
import {
|
|
131
128
|
AuthStorageError
|
|
132
|
-
} from "../chunk-
|
|
129
|
+
} from "../chunk-tkdscva6.js";
|
|
133
130
|
import"../chunk-rhrbz7d4.js";
|
|
134
131
|
import"../chunk-xwnf87e1.js";
|
|
135
132
|
import {
|
|
136
133
|
defineProjection
|
|
137
|
-
} from "../chunk-
|
|
134
|
+
} from "../chunk-f83ka50g.js";
|
|
135
|
+
import"../chunk-rnshztfq.js";
|
|
136
|
+
import"../chunk-04b07a9q.js";
|
|
137
|
+
import"../chunk-dktq02ne.js";
|
|
138
|
+
import {
|
|
139
|
+
blobIdFromDigest
|
|
140
|
+
} from "../chunk-zqysyfjt.js";
|
|
138
141
|
import"../chunk-0172wgm9.js";
|
|
139
142
|
import"../chunk-t8t39h7v.js";
|
|
140
143
|
import"../chunk-y64skrwp.js";
|
|
@@ -1024,6 +1027,14 @@ function runAgentStorageContractSuite(label, options) {
|
|
|
1024
1027
|
expect(await storage.checkpoints.getLatest({ projectId, threadId: "thr_1" })).toEqual(created);
|
|
1025
1028
|
expect(await storage.checkpoints.getLatest({ projectId: otherProjectId, threadId: "thr_1" })).toBeNull();
|
|
1026
1029
|
expect(await storage.checkpoints.getLatest({ projectId, threadId: "thr_2" })).toBeNull();
|
|
1030
|
+
await expect(storage.checkpoints.getByRunIds({
|
|
1031
|
+
projectId,
|
|
1032
|
+
runIds: ["run_2", "missing", "run_2"]
|
|
1033
|
+
})).resolves.toEqual([created]);
|
|
1034
|
+
await expect(storage.checkpoints.getByRunIds({
|
|
1035
|
+
projectId: otherProjectId,
|
|
1036
|
+
runIds: ["run_2"]
|
|
1037
|
+
})).resolves.toEqual([]);
|
|
1027
1038
|
const retained = await storage.messages.list({
|
|
1028
1039
|
projectId,
|
|
1029
1040
|
threadId: "thr_1",
|
|
@@ -1533,6 +1544,28 @@ function runAiUsageStorageContractSuite(label, options) {
|
|
|
1533
1544
|
});
|
|
1534
1545
|
});
|
|
1535
1546
|
});
|
|
1547
|
+
test3("returns the latest completed call for one execution", async () => {
|
|
1548
|
+
await withStorage(async (storage) => {
|
|
1549
|
+
await expect3(storage.getLatestForExecution({ projectId: projectId3, executionId: agentExecutionId })).resolves.toBeNull();
|
|
1550
|
+
await storage.recordModelCall(modelCallInput({
|
|
1551
|
+
id: "usage_later",
|
|
1552
|
+
callId: "call_later",
|
|
1553
|
+
responseId: "response_later",
|
|
1554
|
+
occurredAt: at2("2026-06-23T10:02:00.000Z")
|
|
1555
|
+
}));
|
|
1556
|
+
await storage.recordModelCall(modelCallInput({
|
|
1557
|
+
id: "usage_earlier",
|
|
1558
|
+
callId: "call_earlier",
|
|
1559
|
+
responseId: "response_earlier",
|
|
1560
|
+
occurredAt: at2("2026-06-23T10:01:00.000Z")
|
|
1561
|
+
}));
|
|
1562
|
+
await expect3(storage.getLatestForExecution({ projectId: projectId3, executionId: agentExecutionId })).resolves.toMatchObject({ id: "usage_later", responseId: "response_later" });
|
|
1563
|
+
await expect3(storage.getLatestForExecution({
|
|
1564
|
+
projectId: "other-project",
|
|
1565
|
+
executionId: agentExecutionId
|
|
1566
|
+
})).resolves.toBeNull();
|
|
1567
|
+
});
|
|
1568
|
+
});
|
|
1536
1569
|
test3("bills the same call and response IDs again on a later delivery attempt", async () => {
|
|
1537
1570
|
await withStorage(async (storage) => {
|
|
1538
1571
|
await storage.recordModelCall(modelCallInput());
|
|
@@ -4994,7 +5027,25 @@ var Device = defineObjectType({
|
|
|
4994
5027
|
],
|
|
4995
5028
|
links: [link.self("peers", { cardinality: "many" })]
|
|
4996
5029
|
});
|
|
4997
|
-
var
|
|
5030
|
+
var OpaqueA = defineObjectType({
|
|
5031
|
+
id: "A",
|
|
5032
|
+
name: "Opaque A",
|
|
5033
|
+
properties: [
|
|
5034
|
+
prop("id", "string", { primary: true, required: true }),
|
|
5035
|
+
prop("name", "string", { required: true })
|
|
5036
|
+
],
|
|
5037
|
+
links: [link.self("D", { cardinality: "many" })]
|
|
5038
|
+
});
|
|
5039
|
+
var OpaqueAB = defineObjectType({
|
|
5040
|
+
id: "A:B",
|
|
5041
|
+
name: "Opaque AB",
|
|
5042
|
+
properties: [
|
|
5043
|
+
prop("id", "string", { primary: true, required: true }),
|
|
5044
|
+
prop("name", "string", { required: true })
|
|
5045
|
+
],
|
|
5046
|
+
links: [link.self("D", { cardinality: "many" })]
|
|
5047
|
+
});
|
|
5048
|
+
var ontology = new OntologyRegistry({ sources: [Device, OpaqueA, OpaqueAB] });
|
|
4998
5049
|
function runEffectiveStorageContractSuite(name, provider) {
|
|
4999
5050
|
const withStorage = async (body) => {
|
|
5000
5051
|
const storage = await provider.createStorage();
|
|
@@ -5025,7 +5076,7 @@ function runEffectiveStorageContractSuite(name, provider) {
|
|
|
5025
5076
|
{ objectTypeId: Device.id, primaryId: "missing" }
|
|
5026
5077
|
]
|
|
5027
5078
|
});
|
|
5028
|
-
expect8([...batch.keys()]).toEqual([
|
|
5079
|
+
expect8([...batch.keys()]).toEqual([objectBatchKey(Device.id, "a")]);
|
|
5029
5080
|
});
|
|
5030
5081
|
});
|
|
5031
5082
|
test8("reads Materializer-owned links", async () => {
|
|
@@ -5047,7 +5098,163 @@ function runEffectiveStorageContractSuite(name, provider) {
|
|
|
5047
5098
|
projectId: projectId6,
|
|
5048
5099
|
items: [{ objectTypeId: Device.id, objectId: "a", linkId: "peers" }]
|
|
5049
5100
|
});
|
|
5050
|
-
expect8(linksByScope.get(
|
|
5101
|
+
expect8(linksByScope.get(linkBatchKey(Device.id, "a", "peers"))).toHaveLength(2);
|
|
5102
|
+
});
|
|
5103
|
+
});
|
|
5104
|
+
test8("pages and filters incident links in the provider", async () => {
|
|
5105
|
+
await withStorage(async (storage) => {
|
|
5106
|
+
const first = await storage.objects.queryLinks({
|
|
5107
|
+
projectId: projectId6,
|
|
5108
|
+
objectRefs: [{ objectTypeId: Device.id, primaryId: "a" }],
|
|
5109
|
+
direction: "outgoing",
|
|
5110
|
+
linkId: "peers",
|
|
5111
|
+
endpointObjectTypeIds: [Device.id],
|
|
5112
|
+
limit: 1
|
|
5113
|
+
});
|
|
5114
|
+
expect8(first.links.map((row) => row.targetId)).toEqual(["b"]);
|
|
5115
|
+
expect8(first.hasMore).toBe(true);
|
|
5116
|
+
const second = await storage.objects.queryLinks({
|
|
5117
|
+
projectId: projectId6,
|
|
5118
|
+
objectRefs: [{ objectTypeId: Device.id, primaryId: "a" }],
|
|
5119
|
+
direction: "outgoing",
|
|
5120
|
+
linkId: "peers",
|
|
5121
|
+
endpointObjectTypeIds: [Device.id],
|
|
5122
|
+
after: objectLinkCursor(first.links[0]),
|
|
5123
|
+
limit: 1
|
|
5124
|
+
});
|
|
5125
|
+
expect8(second.links.map((row) => row.targetId)).toEqual(["c"]);
|
|
5126
|
+
expect8(second.hasMore).toBe(false);
|
|
5127
|
+
const duplicateRefs = await storage.objects.queryLinks({
|
|
5128
|
+
projectId: projectId6,
|
|
5129
|
+
objectRefs: [
|
|
5130
|
+
{ objectTypeId: Device.id, primaryId: "a" },
|
|
5131
|
+
{ objectTypeId: Device.id, primaryId: "a" }
|
|
5132
|
+
],
|
|
5133
|
+
direction: "outgoing",
|
|
5134
|
+
limit: 10
|
|
5135
|
+
});
|
|
5136
|
+
expect8(duplicateRefs.links.map((row) => row.targetId)).toEqual(["b", "c"]);
|
|
5137
|
+
const incoming = await storage.objects.queryLinks({
|
|
5138
|
+
projectId: projectId6,
|
|
5139
|
+
objectRefs: [{ objectTypeId: Device.id, primaryId: "b" }],
|
|
5140
|
+
direction: "incoming",
|
|
5141
|
+
limit: 10
|
|
5142
|
+
});
|
|
5143
|
+
expect8(incoming.links.map((row) => [row.sourceId, row.targetId])).toEqual([["a", "b"]]);
|
|
5144
|
+
const bothDirections = await storage.objects.queryLinks({
|
|
5145
|
+
projectId: projectId6,
|
|
5146
|
+
objectRefs: [
|
|
5147
|
+
{ objectTypeId: Device.id, primaryId: "a" },
|
|
5148
|
+
{ objectTypeId: Device.id, primaryId: "b" }
|
|
5149
|
+
],
|
|
5150
|
+
direction: "both",
|
|
5151
|
+
endpointObjectTypeIds: [Device.id],
|
|
5152
|
+
limit: 10
|
|
5153
|
+
});
|
|
5154
|
+
expect8(bothDirections.links.map((row) => [row.sourceId, row.targetId])).toEqual([
|
|
5155
|
+
["a", "b"],
|
|
5156
|
+
["a", "c"]
|
|
5157
|
+
]);
|
|
5158
|
+
const unauthorized = await storage.objects.queryLinks({
|
|
5159
|
+
projectId: projectId6,
|
|
5160
|
+
objectRefs: [{ objectTypeId: Device.id, primaryId: "a" }],
|
|
5161
|
+
direction: "both",
|
|
5162
|
+
endpointObjectTypeIds: [],
|
|
5163
|
+
limit: 10
|
|
5164
|
+
});
|
|
5165
|
+
expect8(unauthorized).toEqual({ links: [], hasMore: false });
|
|
5166
|
+
});
|
|
5167
|
+
});
|
|
5168
|
+
test8("keeps delimiter-bearing object and batch-link identities distinct", async () => {
|
|
5169
|
+
await withStorage(async (storage) => {
|
|
5170
|
+
const opaqueProjectId = `${projectId6}-opaque-batch-keys`;
|
|
5171
|
+
const fixture = createMaterializerTestFixture({
|
|
5172
|
+
projectId: opaqueProjectId,
|
|
5173
|
+
ontology,
|
|
5174
|
+
storage
|
|
5175
|
+
});
|
|
5176
|
+
await fixture.seed({
|
|
5177
|
+
objects: [
|
|
5178
|
+
{
|
|
5179
|
+
ref: { objectTypeId: OpaqueA.id, primaryId: "B:C" },
|
|
5180
|
+
properties: { id: "B:C", name: "First" }
|
|
5181
|
+
},
|
|
5182
|
+
{
|
|
5183
|
+
ref: { objectTypeId: OpaqueAB.id, primaryId: "C" },
|
|
5184
|
+
properties: { id: "C", name: "Second" }
|
|
5185
|
+
}
|
|
5186
|
+
],
|
|
5187
|
+
links: [
|
|
5188
|
+
{
|
|
5189
|
+
ref: {
|
|
5190
|
+
source: { objectTypeId: OpaqueA.id, primaryId: "B:C" },
|
|
5191
|
+
linkId: "D",
|
|
5192
|
+
target: { objectTypeId: OpaqueA.id, primaryId: "B:C" }
|
|
5193
|
+
}
|
|
5194
|
+
},
|
|
5195
|
+
{
|
|
5196
|
+
ref: {
|
|
5197
|
+
source: { objectTypeId: OpaqueAB.id, primaryId: "C" },
|
|
5198
|
+
linkId: "D",
|
|
5199
|
+
target: { objectTypeId: OpaqueAB.id, primaryId: "C" }
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
]
|
|
5203
|
+
});
|
|
5204
|
+
const objects = await storage.objects.getByPrimaryIdBatch({
|
|
5205
|
+
projectId: opaqueProjectId,
|
|
5206
|
+
items: [
|
|
5207
|
+
{ objectTypeId: OpaqueA.id, primaryId: "B:C" },
|
|
5208
|
+
{ objectTypeId: OpaqueAB.id, primaryId: "C" }
|
|
5209
|
+
]
|
|
5210
|
+
});
|
|
5211
|
+
expect8(objects.get(objectBatchKey(OpaqueA.id, "B:C"))?.properties.name).toBe("First");
|
|
5212
|
+
expect8(objects.get(objectBatchKey(OpaqueAB.id, "C"))?.properties.name).toBe("Second");
|
|
5213
|
+
const links = await storage.objects.listLinksBatch({
|
|
5214
|
+
projectId: opaqueProjectId,
|
|
5215
|
+
items: [
|
|
5216
|
+
{ objectTypeId: OpaqueA.id, objectId: "B:C", linkId: "D" },
|
|
5217
|
+
{ objectTypeId: OpaqueAB.id, objectId: "C", linkId: "D" }
|
|
5218
|
+
]
|
|
5219
|
+
});
|
|
5220
|
+
expect8(links.get(linkBatchKey(OpaqueA.id, "B:C", "D"))).toHaveLength(1);
|
|
5221
|
+
expect8(links.get(linkBatchKey(OpaqueAB.id, "C", "D"))).toHaveLength(1);
|
|
5222
|
+
});
|
|
5223
|
+
});
|
|
5224
|
+
test8("preserves distinct incident links when opaque ids contain delimiters", async () => {
|
|
5225
|
+
await withStorage(async (storage) => {
|
|
5226
|
+
const opaqueIdsProjectId = `${projectId6}-opaque-link-ids`;
|
|
5227
|
+
const firstSourceId = "opaque:source";
|
|
5228
|
+
const firstTargetId = `target:peers:${Device.id}:opaque:end`;
|
|
5229
|
+
const secondSourceId = `${firstSourceId}:peers:${Device.id}:target`;
|
|
5230
|
+
const secondTargetId = "opaque:end";
|
|
5231
|
+
const fixture = createMaterializerTestFixture({
|
|
5232
|
+
projectId: opaqueIdsProjectId,
|
|
5233
|
+
ontology,
|
|
5234
|
+
storage
|
|
5235
|
+
});
|
|
5236
|
+
await fixture.seed({
|
|
5237
|
+
objects: [
|
|
5238
|
+
device(firstSourceId, "First source"),
|
|
5239
|
+
device(firstTargetId, "First target"),
|
|
5240
|
+
device(secondSourceId, "Second source"),
|
|
5241
|
+
device(secondTargetId, "Second target")
|
|
5242
|
+
],
|
|
5243
|
+
links: [peer(firstSourceId, firstTargetId), peer(secondSourceId, secondTargetId)]
|
|
5244
|
+
});
|
|
5245
|
+
const incident = await storage.objects.listIncidentLinksBatch({
|
|
5246
|
+
projectId: opaqueIdsProjectId,
|
|
5247
|
+
items: [
|
|
5248
|
+
{ objectTypeId: Device.id, objectId: firstSourceId },
|
|
5249
|
+
{ objectTypeId: Device.id, objectId: secondSourceId }
|
|
5250
|
+
]
|
|
5251
|
+
});
|
|
5252
|
+
const matching = incident.filter((row) => row.sourceId === firstSourceId || row.sourceId === secondSourceId);
|
|
5253
|
+
expect8(matching.map((row) => [row.sourceId, row.linkId, row.targetId])).toEqual(expect8.arrayContaining([
|
|
5254
|
+
[firstSourceId, "peers", firstTargetId],
|
|
5255
|
+
[secondSourceId, "peers", secondTargetId]
|
|
5256
|
+
]));
|
|
5257
|
+
expect8(matching).toHaveLength(2);
|
|
5051
5258
|
});
|
|
5052
5259
|
});
|
|
5053
5260
|
test8("pages Materializer-owned objects with a stable cursor", async () => {
|
|
@@ -6045,6 +6252,50 @@ function runLakeStorageContractSuite(label, options) {
|
|
|
6045
6252
|
expect11(await storage.getVersion(writeDataset.id, missingVersionId)).toBeNull();
|
|
6046
6253
|
});
|
|
6047
6254
|
});
|
|
6255
|
+
test11("creates an initial empty snapshot version", async () => {
|
|
6256
|
+
await withStorage(async (storage) => {
|
|
6257
|
+
await storage.createDataset(writeDataset);
|
|
6258
|
+
const write = await storage.beginWrite({ dataset: writeDataset, mode: "snapshot" });
|
|
6259
|
+
const version = await write.commit();
|
|
6260
|
+
expect11(version).toMatchObject({
|
|
6261
|
+
datasetId: writeDataset.id,
|
|
6262
|
+
mode: "snapshot",
|
|
6263
|
+
outcome: "created",
|
|
6264
|
+
rowCount: 0
|
|
6265
|
+
});
|
|
6266
|
+
expect11(await storage.getLatestVersion(writeDataset.id)).toMatchObject({
|
|
6267
|
+
versionId: version.versionId
|
|
6268
|
+
});
|
|
6269
|
+
expect11(await storage.listVersions(writeDataset.id)).toHaveLength(1);
|
|
6270
|
+
const repeatedWrite = await storage.beginWrite({
|
|
6271
|
+
dataset: writeDataset,
|
|
6272
|
+
mode: "snapshot"
|
|
6273
|
+
});
|
|
6274
|
+
const repeatedVersion = await repeatedWrite.commit();
|
|
6275
|
+
expect11(repeatedVersion.outcome).toBe("unchanged");
|
|
6276
|
+
expect11(repeatedVersion.versionId).toBe(version.versionId);
|
|
6277
|
+
expect11(await storage.listVersions(writeDataset.id)).toHaveLength(1);
|
|
6278
|
+
await expect11(collectRows2(storage.readRows({ datasetId: writeDataset.id }))).resolves.toEqual([]);
|
|
6279
|
+
});
|
|
6280
|
+
});
|
|
6281
|
+
test11("creates an initial empty append version", async () => {
|
|
6282
|
+
await withStorage(async (storage) => {
|
|
6283
|
+
await storage.createDataset(writeDataset);
|
|
6284
|
+
const write = await storage.beginWrite({ dataset: writeDataset, mode: "append" });
|
|
6285
|
+
const version = await write.commit();
|
|
6286
|
+
expect11(version).toMatchObject({
|
|
6287
|
+
datasetId: writeDataset.id,
|
|
6288
|
+
mode: "append",
|
|
6289
|
+
outcome: "created"
|
|
6290
|
+
});
|
|
6291
|
+
expect11(version.parentVersionId).toBeUndefined();
|
|
6292
|
+
expect11(await storage.getLatestVersion(writeDataset.id)).toMatchObject({
|
|
6293
|
+
versionId: version.versionId
|
|
6294
|
+
});
|
|
6295
|
+
expect11(await storage.listVersions(writeDataset.id)).toHaveLength(1);
|
|
6296
|
+
await expect11(collectRows2(storage.readRows({ datasetId: writeDataset.id }))).resolves.toEqual([]);
|
|
6297
|
+
});
|
|
6298
|
+
});
|
|
6048
6299
|
test11("snapshot writes replace the visible latest rows", async () => {
|
|
6049
6300
|
await withStorage(async (storage) => {
|
|
6050
6301
|
await storage.createDataset(writeDataset);
|
|
@@ -7336,6 +7587,170 @@ function runObjectQueryProviderContractSuite(label, options) {
|
|
|
7336
7587
|
expect14(result.hasMore).toBe(false);
|
|
7337
7588
|
});
|
|
7338
7589
|
});
|
|
7590
|
+
test14("queries opaque ids through canonical exact refs", async () => {
|
|
7591
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7592
|
+
const issue297 = "github:issue:sixb-ai/sixb#297";
|
|
7593
|
+
const issue298 = "github:issue:sixb-ai/sixb#298";
|
|
7594
|
+
await fixture.seed({
|
|
7595
|
+
objects: [
|
|
7596
|
+
objectSeed(Asset.id, issue297, { id: issue297 }),
|
|
7597
|
+
objectSeed(Asset.id, issue298, { id: issue298 })
|
|
7598
|
+
]
|
|
7599
|
+
});
|
|
7600
|
+
const refs = await executeObjectQuery({
|
|
7601
|
+
projectId: projectId8,
|
|
7602
|
+
query: {
|
|
7603
|
+
kind: "refs",
|
|
7604
|
+
refs: [
|
|
7605
|
+
{ objectTypeId: Asset.id, primaryId: issue298 },
|
|
7606
|
+
{ objectTypeId: Asset.id, primaryId: issue297 }
|
|
7607
|
+
]
|
|
7608
|
+
}
|
|
7609
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7610
|
+
expect14(refs.plan.mode).toBe(storage.queryCapabilities().nodes?.refs === true ? "pushdown" : "fallback");
|
|
7611
|
+
expect14(ids(refs)).toEqual([issue297, issue298]);
|
|
7612
|
+
});
|
|
7613
|
+
});
|
|
7614
|
+
test14("executes canonical heterogeneous refs with pagination and projection", async () => {
|
|
7615
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7616
|
+
await seedObjectQueryContractData(fixture);
|
|
7617
|
+
const refs = [
|
|
7618
|
+
{ objectTypeId: Device3.id, primaryId: "device-sensor" },
|
|
7619
|
+
{ objectTypeId: Room.id, primaryId: "room-gamma" },
|
|
7620
|
+
{ objectTypeId: Room.id, primaryId: "missing" },
|
|
7621
|
+
{ objectTypeId: Room.id, primaryId: "room-alpha" }
|
|
7622
|
+
];
|
|
7623
|
+
const first = await executeObjectQuery({
|
|
7624
|
+
projectId: projectId8,
|
|
7625
|
+
query: {
|
|
7626
|
+
kind: "project",
|
|
7627
|
+
properties: ["id"],
|
|
7628
|
+
input: { kind: "page", pageSize: 2, input: { kind: "refs", refs } }
|
|
7629
|
+
}
|
|
7630
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7631
|
+
const second = await executeObjectQuery({
|
|
7632
|
+
projectId: projectId8,
|
|
7633
|
+
query: {
|
|
7634
|
+
kind: "project",
|
|
7635
|
+
properties: ["id"],
|
|
7636
|
+
input: {
|
|
7637
|
+
kind: "page",
|
|
7638
|
+
pageSize: 2,
|
|
7639
|
+
pageToken: first.nextPageToken,
|
|
7640
|
+
input: { kind: "refs", refs }
|
|
7641
|
+
}
|
|
7642
|
+
}
|
|
7643
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7644
|
+
const count = await countObjects({ projectId: projectId8, query: { kind: "refs", refs } }, { ontology: objectQueryContractOntology, storage });
|
|
7645
|
+
const expectedMode = storage.queryCapabilities().nodes?.refs === true ? "pushdown" : "fallback";
|
|
7646
|
+
expect14(first.plan.mode).toBe(expectedMode);
|
|
7647
|
+
expect14(ids(first)).toEqual(["device-sensor", "room-alpha"]);
|
|
7648
|
+
expect14(first.objects.map((row) => row.properties)).toEqual([
|
|
7649
|
+
{ id: "device-sensor" },
|
|
7650
|
+
{ id: "room-alpha" }
|
|
7651
|
+
]);
|
|
7652
|
+
expect14(first.total).toBe(3);
|
|
7653
|
+
expect14(first.hasMore).toBe(true);
|
|
7654
|
+
expect14(first.nextPageToken).toBeTruthy();
|
|
7655
|
+
expect14(second.plan.mode).toBe(expectedMode);
|
|
7656
|
+
expect14(ids(second)).toEqual(["room-gamma"]);
|
|
7657
|
+
expect14(second.hasMore).toBe(false);
|
|
7658
|
+
expect14(count.plan.mode).toBe(expectedMode);
|
|
7659
|
+
expect14(count.count).toBe(3);
|
|
7660
|
+
});
|
|
7661
|
+
});
|
|
7662
|
+
test14("composes refs with traversal in provider pushdown", async () => {
|
|
7663
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7664
|
+
if (storage.queryCapabilities().nodes?.refs !== true)
|
|
7665
|
+
return;
|
|
7666
|
+
await seedObjectQueryContractData(fixture);
|
|
7667
|
+
const result = await executeObjectQuery({
|
|
7668
|
+
projectId: projectId8,
|
|
7669
|
+
query: {
|
|
7670
|
+
kind: "traverse",
|
|
7671
|
+
direction: "outgoing",
|
|
7672
|
+
linkId: "hasDevice",
|
|
7673
|
+
input: {
|
|
7674
|
+
kind: "refs",
|
|
7675
|
+
refs: [{ objectTypeId: Room.id, primaryId: "room-alpha" }]
|
|
7676
|
+
}
|
|
7677
|
+
}
|
|
7678
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7679
|
+
expect14(result.plan.mode).toBe("pushdown");
|
|
7680
|
+
expect14(ids(result)).toEqual(["device-projector"]);
|
|
7681
|
+
});
|
|
7682
|
+
});
|
|
7683
|
+
test14("queries and paginates incident links over a provider-backed object set", async () => {
|
|
7684
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7685
|
+
await seedObjectQueryContractData(fixture);
|
|
7686
|
+
const query = {
|
|
7687
|
+
kind: "refs",
|
|
7688
|
+
refs: [{ objectTypeId: Device3.id, primaryId: "device-projector" }]
|
|
7689
|
+
};
|
|
7690
|
+
const first = await executeObjectQueryLinks({
|
|
7691
|
+
projectId: projectId8,
|
|
7692
|
+
query,
|
|
7693
|
+
direction: "incoming",
|
|
7694
|
+
includeObjects: true,
|
|
7695
|
+
pageSize: 1
|
|
7696
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7697
|
+
const second = await executeObjectQueryLinks({
|
|
7698
|
+
projectId: projectId8,
|
|
7699
|
+
query,
|
|
7700
|
+
direction: "incoming",
|
|
7701
|
+
includeObjects: true,
|
|
7702
|
+
pageSize: 1,
|
|
7703
|
+
pageToken: first.nextPageToken
|
|
7704
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7705
|
+
expect14(first.links).toEqual([
|
|
7706
|
+
expect14.objectContaining({
|
|
7707
|
+
sourceTypeId: Room.id,
|
|
7708
|
+
sourceId: "room-alpha",
|
|
7709
|
+
linkId: "hasDevice",
|
|
7710
|
+
targetTypeId: Device3.id,
|
|
7711
|
+
targetId: "device-projector"
|
|
7712
|
+
})
|
|
7713
|
+
]);
|
|
7714
|
+
expect14(first.objects.map((row) => row.primaryId)).toEqual([
|
|
7715
|
+
"device-projector",
|
|
7716
|
+
"room-alpha"
|
|
7717
|
+
]);
|
|
7718
|
+
expect14(first.hasMore).toBe(true);
|
|
7719
|
+
expect14(first.nextPageToken).toBeTruthy();
|
|
7720
|
+
expect14(second.links).toEqual([
|
|
7721
|
+
expect14.objectContaining({
|
|
7722
|
+
sourceTypeId: Zone.id,
|
|
7723
|
+
sourceId: "zone-one",
|
|
7724
|
+
linkId: "hasDevice",
|
|
7725
|
+
targetTypeId: Device3.id,
|
|
7726
|
+
targetId: "device-projector"
|
|
7727
|
+
})
|
|
7728
|
+
]);
|
|
7729
|
+
expect14(second.objects.map((row) => row.primaryId)).toEqual(["device-projector", "zone-one"]);
|
|
7730
|
+
expect14(second.hasMore).toBe(false);
|
|
7731
|
+
});
|
|
7732
|
+
});
|
|
7733
|
+
test14("does not admit a provider page probe into the link selector", async () => {
|
|
7734
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7735
|
+
await seedObjectQueryContractData(fixture);
|
|
7736
|
+
const result = await executeObjectQueryLinks({
|
|
7737
|
+
projectId: projectId8,
|
|
7738
|
+
query: {
|
|
7739
|
+
kind: "page",
|
|
7740
|
+
pageSize: 1,
|
|
7741
|
+
input: {
|
|
7742
|
+
kind: "sort",
|
|
7743
|
+
fields: [{ kind: "property", propertyId: "id", direction: "asc" }],
|
|
7744
|
+
input: { kind: "start", objectTypeId: Room.id }
|
|
7745
|
+
}
|
|
7746
|
+
},
|
|
7747
|
+
direction: "outgoing"
|
|
7748
|
+
}, { ontology: objectQueryContractOntology, storage });
|
|
7749
|
+
expect14(result.links).toEqual([
|
|
7750
|
+
expect14.objectContaining({ sourceId: "room-alpha", targetId: "device-projector" })
|
|
7751
|
+
]);
|
|
7752
|
+
});
|
|
7753
|
+
});
|
|
7339
7754
|
test14("matches null, missing, neq, in, and not predicate semantics", async () => {
|
|
7340
7755
|
await withStorage(async ({ objects: storage, fixture }) => {
|
|
7341
7756
|
await seedObjectQueryContractData(fixture);
|
|
@@ -10413,4 +10828,4 @@ export {
|
|
|
10413
10828
|
claimTestProjectionRun
|
|
10414
10829
|
};
|
|
10415
10830
|
|
|
10416
|
-
//# debugId=
|
|
10831
|
+
//# debugId=18CDE018B0AEEC3264756E2164756E21
|