@sixb/core 0.2.1 → 0.2.2
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 +29 -29
- package/dist/agents/cancel.d.ts.map +1 -1
- package/dist/agents/index.d.ts +5 -3
- package/dist/agents/index.d.ts.map +1 -1
- package/dist/agents/index.js +38 -32
- package/dist/agents/index.js.map +1 -1
- package/dist/agents/run-plan.d.ts +15 -1
- package/dist/agents/run-plan.d.ts.map +1 -1
- package/dist/agents/run-session-http.d.ts.map +1 -1
- package/dist/agents/run-session-serve.d.ts.map +1 -1
- package/dist/agents/run-session.d.ts +14 -2
- package/dist/agents/run-session.d.ts.map +1 -1
- package/dist/agents/skills.d.ts +3 -0
- package/dist/agents/skills.d.ts.map +1 -1
- package/dist/agents/step-limits.d.ts +6 -0
- package/dist/agents/step-limits.d.ts.map +1 -1
- package/dist/agents/streams/index.js +1 -1
- package/dist/agents/streams/internal.js +1 -1
- package/dist/agents/streams/protocol.d.ts +8 -2
- package/dist/agents/streams/protocol.d.ts.map +1 -1
- package/dist/agents/tool-files.d.ts +3 -1
- package/dist/agents/tool-files.d.ts.map +1 -1
- package/dist/agents/validation.d.ts +1 -1
- package/dist/agents/validation.d.ts.map +1 -1
- package/dist/agents/web.d.ts +47 -0
- package/dist/agents/web.d.ts.map +1 -0
- package/dist/artifacts/publish/index.js +16 -16
- package/dist/auth/index.js +3 -3
- package/dist/authorization/index.js +2 -2
- package/dist/authorization/resolve.d.ts +4 -3
- package/dist/authorization/resolve.d.ts.map +1 -1
- package/dist/authorization/types.d.ts +5 -5
- package/dist/authorization/types.d.ts.map +1 -1
- package/dist/bootstrap/index.js +34 -34
- package/dist/{chunk-neftrg0n.js → chunk-0j3crh1w.js} +2 -2
- package/dist/{chunk-tvbmh7tj.js → chunk-2ajw5rz0.js} +14 -10
- package/dist/chunk-2ajw5rz0.js.map +18 -0
- package/dist/{chunk-23s66j86.js → chunk-31kcqmhf.js} +1 -1
- package/dist/{chunk-nghc7eq0.js → chunk-3723kgba.js} +1 -1
- package/dist/{chunk-rjeeyssy.js → chunk-3sqqhpr7.js} +4 -4
- package/dist/{chunk-m3qe54bb.js → chunk-4bm0caep.js} +1 -1
- package/dist/{chunk-h05rg3bx.js → chunk-4s753g3k.js} +3 -3
- package/dist/{chunk-8wsjr52f.js → chunk-5wtnmpze.js} +1 -1
- package/dist/{chunk-edx8xcsm.js → chunk-7z5rkf0m.js} +29 -6
- package/dist/chunk-7z5rkf0m.js.map +13 -0
- package/dist/{chunk-2pk5hjj9.js → chunk-80gym75n.js} +1 -1
- package/dist/{chunk-qbrmpgvv.js → chunk-9whfmsfk.js} +1 -1
- package/dist/{chunk-z3evap21.js → chunk-a5v4gjdx.js} +27 -26
- package/dist/{chunk-z3evap21.js.map → chunk-a5v4gjdx.js.map} +3 -3
- package/dist/{chunk-w53trr0c.js → chunk-a7aa0nzj.js} +5 -5
- package/dist/{chunk-tvefbgvw.js → chunk-az95tsh3.js} +4 -2
- package/dist/chunk-az95tsh3.js.map +11 -0
- package/dist/{chunk-7hd2ez3q.js → chunk-c4nrycdy.js} +1 -1
- package/dist/{chunk-epyfm23v.js → chunk-c706qvyc.js} +3 -3
- package/dist/{chunk-t5daew4g.js → chunk-c7cfe31p.js} +6 -6
- package/dist/{chunk-qsg8rw04.js → chunk-d04g36fw.js} +1 -1
- package/dist/{chunk-ratj7t3t.js → chunk-dsv783c3.js} +305 -32
- package/dist/{chunk-ratj7t3t.js.map → chunk-dsv783c3.js.map} +12 -10
- package/dist/{chunk-cb21tx14.js → chunk-eqgr6nsa.js} +81 -25
- package/dist/{chunk-cb21tx14.js.map → chunk-eqgr6nsa.js.map} +8 -7
- package/dist/{chunk-ax10ft8d.js → chunk-f1h34y3r.js} +5 -5
- package/dist/{chunk-9rh8ncs5.js → chunk-fwsvshr5.js} +1 -1
- package/dist/{chunk-b7a97n8b.js → chunk-ga63a3dz.js} +6 -6
- package/dist/{chunk-b7a97n8b.js.map → chunk-ga63a3dz.js.map} +2 -2
- package/dist/{chunk-cgznz22f.js → chunk-gkv8r794.js} +2 -2
- package/dist/{chunk-t9xyr7y9.js → chunk-j8thxj7w.js} +3 -3
- package/dist/{chunk-31khg3g0.js → chunk-kkjfve0t.js} +73 -2
- package/dist/{chunk-31khg3g0.js.map → chunk-kkjfve0t.js.map} +3 -3
- package/dist/{chunk-8yzhjawq.js → chunk-m2vh8gh0.js} +8 -14
- package/dist/{chunk-8yzhjawq.js.map → chunk-m2vh8gh0.js.map} +3 -3
- package/dist/{chunk-nqnfz3jg.js → chunk-mbc5hvnj.js} +2 -2
- package/dist/{chunk-jk97v21j.js → chunk-n4zzaf6q.js} +3 -2
- package/dist/chunk-n4zzaf6q.js.map +10 -0
- package/dist/{chunk-y2x2935j.js → chunk-nh26e7c5.js} +2 -2
- package/dist/{chunk-jhbk10wf.js → chunk-q9nkpr8k.js} +1 -1
- package/dist/{chunk-47e09r7z.js → chunk-qttqe1ah.js} +86 -6
- package/dist/{chunk-47e09r7z.js.map → chunk-qttqe1ah.js.map} +5 -4
- package/dist/{chunk-3x3bebz7.js → chunk-s7j8ewqv.js} +161 -62
- package/dist/{chunk-3x3bebz7.js.map → chunk-s7j8ewqv.js.map} +7 -6
- package/dist/{chunk-dz7a4t3a.js → chunk-twfreyxr.js} +5 -10
- package/dist/{chunk-dz7a4t3a.js.map → chunk-twfreyxr.js.map} +4 -4
- package/dist/{chunk-ks87m383.js → chunk-w1btn96n.js} +49 -24
- package/dist/{chunk-ks87m383.js.map → chunk-w1btn96n.js.map} +6 -6
- package/dist/{chunk-fg1db9xx.js → chunk-wkq3kvzd.js} +5 -5
- package/dist/chunk-wkq3kvzd.js.map +10 -0
- package/dist/{chunk-aqyjb86c.js → chunk-wrjx1fqz.js} +6 -6
- package/dist/{chunk-agn8d8ys.js → chunk-xtztwpkh.js} +1 -1
- package/dist/{chunk-0g5nyx0k.js → chunk-zeykm8my.js} +2 -2
- package/dist/connectors/connections/runs.d.ts +7 -0
- package/dist/connectors/connections/runs.d.ts.map +1 -1
- package/dist/execution/agent.js +29 -29
- package/dist/execution/object-reader-security.d.ts.map +1 -1
- package/dist/execution/primitive.js +29 -29
- package/dist/execution/request.js +30 -30
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -37
- package/dist/materializer/index.js +15 -15
- package/dist/models/catalog.d.ts +16 -0
- package/dist/models/catalog.d.ts.map +1 -1
- package/dist/models/definitions.d.ts +1 -1
- package/dist/models/definitions.d.ts.map +1 -1
- package/dist/models/execution/index.js +17 -17
- package/dist/models/execution/model-call-recorder.d.ts +1 -1
- package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
- package/dist/models/execution/web-search.d.ts +7 -0
- package/dist/models/execution/web-search.d.ts.map +1 -0
- package/dist/models/index.d.ts +3 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +5 -3
- package/dist/models/index.js.map +1 -1
- package/dist/models/language-model.d.ts +12 -0
- package/dist/models/language-model.d.ts.map +1 -1
- package/dist/models/web-search-model.d.ts +66 -0
- package/dist/models/web-search-model.d.ts.map +1 -0
- package/dist/objects/index.js +29 -29
- package/dist/objects/query/executor.d.ts.map +1 -1
- package/dist/objects/query/index.d.ts +1 -0
- package/dist/objects/query/index.d.ts.map +1 -1
- package/dist/objects/query/index.js +18 -15
- package/dist/objects/query/index.js.map +1 -1
- package/dist/objects/query/sort-ties.d.ts +11 -0
- package/dist/objects/query/sort-ties.d.ts.map +1 -0
- package/dist/pipelines/index.js +15 -15
- package/dist/projections/internal.js +15 -15
- package/dist/runtime/create.d.ts +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/internal.js +21 -21
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/security/index.d.ts +1 -0
- package/dist/security/index.d.ts.map +1 -1
- package/dist/security/registry.d.ts +2 -0
- package/dist/security/registry.d.ts.map +1 -1
- package/dist/security/view-conditions.d.ts.map +1 -1
- package/dist/security/visibility-keys.d.ts +19 -0
- package/dist/security/visibility-keys.d.ts.map +1 -0
- package/dist/shares/internal.js +15 -15
- package/dist/storage/agents/in-memory.d.ts +8 -2
- package/dist/storage/agents/in-memory.d.ts.map +1 -1
- package/dist/storage/agents/index.d.ts +1 -1
- package/dist/storage/agents/index.d.ts.map +1 -1
- package/dist/storage/agents/provider.d.ts +8 -2
- package/dist/storage/agents/provider.d.ts.map +1 -1
- package/dist/storage/agents/provider.js +12 -6
- package/dist/storage/agents/provider.js.map +1 -1
- package/dist/storage/agents/types.d.ts +42 -2
- package/dist/storage/agents/types.d.ts.map +1 -1
- package/dist/storage/ai-cost/provider.js +4 -4
- package/dist/storage/ai-limits/enforcement.js +3 -3
- package/dist/storage/ai-limits/provider.js +2 -2
- package/dist/storage/connector-connections/provider.js +3 -3
- package/dist/storage/connector-connections/provider.js.map +3 -3
- package/dist/storage/file-upload-sessions/provider.js +4 -4
- package/dist/storage/index.d.ts +2 -2
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +14 -14
- package/dist/storage/internal.js +2 -2
- package/dist/storage/migrations/types.d.ts +6 -0
- package/dist/storage/migrations/types.d.ts.map +1 -1
- package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
- package/dist/storage/objects/index.d.ts +1 -1
- package/dist/storage/objects/index.d.ts.map +1 -1
- package/dist/storage/objects/query-preparation.d.ts +13 -0
- package/dist/storage/objects/query-preparation.d.ts.map +1 -1
- package/dist/storage/objects/read-scope.d.ts.map +1 -1
- package/dist/storage/objects/types.d.ts +52 -0
- package/dist/storage/objects/types.d.ts.map +1 -1
- package/dist/storage/share-grants/provider.js +2 -2
- package/dist/storage/workflow-runs/provider.js +4 -4
- package/dist/syncs/index.js +17 -17
- package/dist/testing/agent-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
- package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
- package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
- package/dist/testing/index.js +399 -45
- package/dist/testing/index.js.map +8 -8
- package/dist/testing/object-conditional-read-scope-contract.d.ts.map +1 -1
- package/dist/testing/object-query-contract.d.ts.map +1 -1
- package/dist/webhooks/internal.js +15 -15
- package/dist/workflows/index.js +31 -31
- package/package.json +1 -1
- package/src/agents/README.md +2 -1
- package/src/agents/cancel.ts +7 -1
- package/src/agents/index.ts +9 -1
- package/src/agents/run-plan.ts +31 -0
- package/src/agents/run-session-http.ts +15 -12
- package/src/agents/run-session-serve.ts +8 -2
- package/src/agents/run-session.ts +31 -11
- package/src/agents/skills.ts +3 -0
- package/src/agents/step-limits.ts +6 -0
- package/src/agents/streams/protocol.ts +9 -4
- package/src/agents/tool-files.ts +11 -3
- package/src/agents/validation.ts +9 -0
- package/src/agents/web.ts +218 -0
- package/src/authorization/resolve.ts +9 -11
- package/src/authorization/types.ts +5 -5
- package/src/connectors/connections/runs.ts +42 -5
- package/src/execution/object-reader-security.ts +4 -9
- package/src/index.ts +2 -0
- package/src/models/catalog.ts +52 -3
- package/src/models/definitions.ts +2 -0
- package/src/models/execution/README.md +22 -2
- package/src/models/execution/model-call-recorder.ts +1 -1
- package/src/models/execution/web-search.ts +186 -0
- package/src/models/index.ts +12 -0
- package/src/models/language-model.ts +12 -0
- package/src/models/web-search-model.ts +152 -0
- package/src/objects/query/executor.ts +7 -3
- package/src/objects/query/index.ts +1 -0
- package/src/objects/query/sort-ties.ts +16 -0
- package/src/runtime/create.ts +3 -2
- package/src/runtime/resolve-definitions.ts +4 -0
- package/src/security/index.ts +1 -0
- package/src/security/registry.ts +2 -0
- package/src/security/view-conditions.ts +4 -3
- package/src/security/visibility-keys.ts +144 -0
- package/src/storage/agents/in-memory.ts +29 -2
- package/src/storage/agents/index.ts +2 -0
- package/src/storage/agents/provider.ts +57 -1
- package/src/storage/agents/types.ts +45 -2
- package/src/storage/connector-connections/in-memory.ts +2 -2
- package/src/storage/connector-connections/provider/connections.ts +2 -2
- package/src/storage/index.ts +4 -0
- package/src/storage/migrations/types.ts +6 -0
- package/src/storage/objects/in-memory/query.ts +5 -2
- package/src/storage/objects/index.ts +2 -0
- package/src/storage/objects/query-preparation.ts +59 -1
- package/src/storage/objects/read-scope.ts +108 -2
- package/src/storage/objects/types.ts +43 -0
- package/src/testing/agent-storage-contract.ts +70 -0
- package/src/testing/ai-limit-storage-contract.ts +11 -1
- package/src/testing/ai-usage-storage-contract.ts +15 -2
- package/src/testing/connector-connection-storage-contract.ts +23 -0
- package/src/testing/object-conditional-read-scope-contract.ts +267 -5
- package/src/testing/object-query-contract.ts +75 -0
- package/dist/chunk-edx8xcsm.js.map +0 -13
- package/dist/chunk-fg1db9xx.js.map +0 -10
- package/dist/chunk-jk97v21j.js.map +0 -10
- package/dist/chunk-tvbmh7tj.js.map +0 -18
- package/dist/chunk-tvefbgvw.js.map +0 -11
- /package/dist/{chunk-neftrg0n.js.map → chunk-0j3crh1w.js.map} +0 -0
- /package/dist/{chunk-23s66j86.js.map → chunk-31kcqmhf.js.map} +0 -0
- /package/dist/{chunk-nghc7eq0.js.map → chunk-3723kgba.js.map} +0 -0
- /package/dist/{chunk-rjeeyssy.js.map → chunk-3sqqhpr7.js.map} +0 -0
- /package/dist/{chunk-m3qe54bb.js.map → chunk-4bm0caep.js.map} +0 -0
- /package/dist/{chunk-h05rg3bx.js.map → chunk-4s753g3k.js.map} +0 -0
- /package/dist/{chunk-8wsjr52f.js.map → chunk-5wtnmpze.js.map} +0 -0
- /package/dist/{chunk-2pk5hjj9.js.map → chunk-80gym75n.js.map} +0 -0
- /package/dist/{chunk-qbrmpgvv.js.map → chunk-9whfmsfk.js.map} +0 -0
- /package/dist/{chunk-w53trr0c.js.map → chunk-a7aa0nzj.js.map} +0 -0
- /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.js.map} +0 -0
- /package/dist/{chunk-epyfm23v.js.map → chunk-c706qvyc.js.map} +0 -0
- /package/dist/{chunk-t5daew4g.js.map → chunk-c7cfe31p.js.map} +0 -0
- /package/dist/{chunk-qsg8rw04.js.map → chunk-d04g36fw.js.map} +0 -0
- /package/dist/{chunk-ax10ft8d.js.map → chunk-f1h34y3r.js.map} +0 -0
- /package/dist/{chunk-9rh8ncs5.js.map → chunk-fwsvshr5.js.map} +0 -0
- /package/dist/{chunk-cgznz22f.js.map → chunk-gkv8r794.js.map} +0 -0
- /package/dist/{chunk-t9xyr7y9.js.map → chunk-j8thxj7w.js.map} +0 -0
- /package/dist/{chunk-nqnfz3jg.js.map → chunk-mbc5hvnj.js.map} +0 -0
- /package/dist/{chunk-y2x2935j.js.map → chunk-nh26e7c5.js.map} +0 -0
- /package/dist/{chunk-jhbk10wf.js.map → chunk-q9nkpr8k.js.map} +0 -0
- /package/dist/{chunk-aqyjb86c.js.map → chunk-wrjx1fqz.js.map} +0 -0
- /package/dist/{chunk-agn8d8ys.js.map → chunk-xtztwpkh.js.map} +0 -0
- /package/dist/{chunk-0g5nyx0k.js.map → chunk-zeykm8my.js.map} +0 -0
package/dist/testing/index.js
CHANGED
|
@@ -5,21 +5,23 @@ import"../chunk-6eqsgvxk.js";
|
|
|
5
5
|
import"../chunk-165c9wm6.js";
|
|
6
6
|
import {
|
|
7
7
|
validateObjectQuery2,
|
|
8
|
+
bindCurrentUserPredicate,
|
|
9
|
+
viewConditionReadCondition,
|
|
8
10
|
AuthStorageError2,
|
|
9
11
|
toUserProfile,
|
|
10
12
|
SYSTEM_PRINCIPAL2
|
|
11
|
-
} from "../chunk-
|
|
13
|
+
} from "../chunk-s7j8ewqv.js";
|
|
12
14
|
import"../chunk-d7v97qxq.js";
|
|
13
15
|
import {
|
|
14
16
|
agentServiceAccountId2,
|
|
15
17
|
MAX_OBJECT_READ_FACETS2,
|
|
16
18
|
defineProjection2
|
|
17
|
-
} from "../chunk-
|
|
19
|
+
} from "../chunk-twfreyxr.js";
|
|
18
20
|
import"../chunk-jspskey0.js";
|
|
19
21
|
import {
|
|
20
22
|
compileSelectedObjectReadScope2,
|
|
21
23
|
compileConditionalObjectReadScope2
|
|
22
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-kkjfve0t.js";
|
|
23
25
|
import {
|
|
24
26
|
blobIdFromDigest2
|
|
25
27
|
} from "../chunk-wkv3h3q7.js";
|
|
@@ -43,19 +45,19 @@ import {
|
|
|
43
45
|
createEventId2
|
|
44
46
|
} from "../chunk-zrvhsq7f.js";
|
|
45
47
|
import"../chunk-5grk14e5.js";
|
|
46
|
-
import"../chunk-
|
|
47
|
-
import"../chunk-
|
|
48
|
+
import"../chunk-az95tsh3.js";
|
|
49
|
+
import"../chunk-qttqe1ah.js";
|
|
48
50
|
import {
|
|
49
51
|
AgentStorageError2
|
|
50
|
-
} from "../chunk-
|
|
51
|
-
import"../chunk-
|
|
52
|
+
} from "../chunk-7z5rkf0m.js";
|
|
53
|
+
import"../chunk-zeykm8my.js";
|
|
52
54
|
import {
|
|
53
55
|
aiLimitCalendarMonth2
|
|
54
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-c4nrycdy.js";
|
|
55
57
|
import {
|
|
56
58
|
DEFAULT_FILE_UPLOAD_TERMINAL_SESSION_TTL_MS2
|
|
57
59
|
} from "../chunk-h89wz928.js";
|
|
58
|
-
import"../chunk-
|
|
60
|
+
import"../chunk-31kcqmhf.js";
|
|
59
61
|
import {
|
|
60
62
|
ArtifactStorageError
|
|
61
63
|
} from "../chunk-e6xgz4h4.js";
|
|
@@ -82,7 +84,7 @@ import {
|
|
|
82
84
|
WorkflowInterventionError2,
|
|
83
85
|
InMemoryStorage2,
|
|
84
86
|
migrateStorage2
|
|
85
|
-
} from "../chunk-
|
|
87
|
+
} from "../chunk-eqgr6nsa.js";
|
|
86
88
|
import"../chunk-nz7815t3.js";
|
|
87
89
|
import"../chunk-s7xqfxs9.js";
|
|
88
90
|
import"../chunk-mmagke4x.js";
|
|
@@ -91,18 +93,18 @@ import"../chunk-scyq22td.js";
|
|
|
91
93
|
import"../chunk-jmfet9r4.js";
|
|
92
94
|
import"../chunk-qf954wje.js";
|
|
93
95
|
import"../chunk-x0v3jd47.js";
|
|
94
|
-
import"../chunk-
|
|
96
|
+
import"../chunk-0j3crh1w.js";
|
|
95
97
|
import {
|
|
96
98
|
ProjectionRegistry2,
|
|
97
99
|
createLinkScopeFingerprint2,
|
|
98
100
|
createOntologyMaterializer2
|
|
99
|
-
} from "../chunk-
|
|
101
|
+
} from "../chunk-3sqqhpr7.js";
|
|
100
102
|
import {
|
|
101
103
|
bindModelExecutionAttempt,
|
|
102
104
|
isBoundSixb
|
|
103
|
-
} from "../chunk-
|
|
105
|
+
} from "../chunk-a5v4gjdx.js";
|
|
104
106
|
import"../chunk-w976a4me.js";
|
|
105
|
-
import"../chunk-
|
|
107
|
+
import"../chunk-f1h34y3r.js";
|
|
106
108
|
import {
|
|
107
109
|
planObjectQuery2,
|
|
108
110
|
executeObjectQuery2,
|
|
@@ -110,18 +112,18 @@ import {
|
|
|
110
112
|
existsObjects2,
|
|
111
113
|
facetObjects2,
|
|
112
114
|
executeObjectQueryLinks2
|
|
113
|
-
} from "../chunk-
|
|
114
|
-
import"../chunk-
|
|
115
|
-
import"../chunk-
|
|
115
|
+
} from "../chunk-2ajw5rz0.js";
|
|
116
|
+
import"../chunk-m2vh8gh0.js";
|
|
117
|
+
import"../chunk-wkq3kvzd.js";
|
|
116
118
|
import"../chunk-3fqxbn31.js";
|
|
117
119
|
import"../chunk-waqk73p1.js";
|
|
118
120
|
import"../chunk-kwfhd1g0.js";
|
|
119
|
-
import"../chunk-
|
|
120
|
-
import"../chunk-
|
|
121
|
+
import"../chunk-j8thxj7w.js";
|
|
122
|
+
import"../chunk-d04g36fw.js";
|
|
121
123
|
import"../chunk-sgx82nnt.js";
|
|
122
124
|
import"../chunk-8ncg20rd.js";
|
|
123
125
|
import"../chunk-5a4a52tq.js";
|
|
124
|
-
import"../chunk-
|
|
126
|
+
import"../chunk-fwsvshr5.js";
|
|
125
127
|
import {
|
|
126
128
|
col2,
|
|
127
129
|
defineDataset2,
|
|
@@ -130,31 +132,31 @@ import {
|
|
|
130
132
|
import {
|
|
131
133
|
writeDataset2
|
|
132
134
|
} from "../chunk-jbw70d6t.js";
|
|
133
|
-
import"../chunk-
|
|
134
|
-
import"../chunk-
|
|
135
|
+
import"../chunk-ga63a3dz.js";
|
|
136
|
+
import"../chunk-q9nkpr8k.js";
|
|
135
137
|
import"../chunk-1vg43g9q.js";
|
|
136
138
|
import"../chunk-m427qgq0.js";
|
|
137
139
|
import {
|
|
138
140
|
SixbHost2
|
|
139
|
-
} from "../chunk-
|
|
141
|
+
} from "../chunk-w1btn96n.js";
|
|
140
142
|
import"../chunk-w122ymx4.js";
|
|
141
143
|
import"../chunk-t5608tkq.js";
|
|
142
144
|
import"../chunk-s038wa5v.js";
|
|
143
|
-
import"../chunk-
|
|
144
|
-
import"../chunk-
|
|
145
|
+
import"../chunk-wrjx1fqz.js";
|
|
146
|
+
import"../chunk-nh26e7c5.js";
|
|
145
147
|
import"../chunk-fb3feg1e.js";
|
|
146
148
|
import"../chunk-yw9pyg66.js";
|
|
147
149
|
import"../chunk-ytzcxtpt.js";
|
|
148
150
|
import {
|
|
149
151
|
projectAgentThreadModelContext2
|
|
150
|
-
} from "../chunk-
|
|
152
|
+
} from "../chunk-dsv783c3.js";
|
|
151
153
|
import"../chunk-57g0215c.js";
|
|
152
154
|
import"../chunk-de5sfbc3.js";
|
|
153
155
|
import"../chunk-5taem5aw.js";
|
|
154
156
|
import"../chunk-jftd33rc.js";
|
|
155
157
|
import {
|
|
156
158
|
workflowAgentStepActorId2
|
|
157
|
-
} from "../chunk-
|
|
159
|
+
} from "../chunk-c7cfe31p.js";
|
|
158
160
|
import {
|
|
159
161
|
BrokerError2,
|
|
160
162
|
InMemoryBroker2
|
|
@@ -165,36 +167,36 @@ import {
|
|
|
165
167
|
} from "../chunk-s3we74h8.js";
|
|
166
168
|
import"../chunk-j1ny5fwh.js";
|
|
167
169
|
import"../chunk-4zm1k3xj.js";
|
|
168
|
-
import"../chunk-
|
|
170
|
+
import"../chunk-mbc5hvnj.js";
|
|
169
171
|
import"../chunk-jjmggm9a.js";
|
|
170
172
|
import"../chunk-c69nj7se.js";
|
|
171
|
-
import"../chunk-
|
|
173
|
+
import"../chunk-a7aa0nzj.js";
|
|
172
174
|
import {
|
|
173
175
|
createTestingScope
|
|
174
|
-
} from "../chunk-
|
|
175
|
-
import"../chunk-
|
|
176
|
-
import"../chunk-
|
|
176
|
+
} from "../chunk-4bm0caep.js";
|
|
177
|
+
import"../chunk-5wtnmpze.js";
|
|
178
|
+
import"../chunk-4s753g3k.js";
|
|
177
179
|
import {
|
|
178
180
|
SandboxNotRunningError2
|
|
179
181
|
} from "../chunk-r1cxq7vv.js";
|
|
180
|
-
import"../chunk-
|
|
181
|
-
import"../chunk-
|
|
182
|
+
import"../chunk-gkv8r794.js";
|
|
183
|
+
import"../chunk-c706qvyc.js";
|
|
182
184
|
import {
|
|
183
185
|
restoreTrustedPrimitiveExecutionScope
|
|
184
|
-
} from "../chunk-
|
|
185
|
-
import"../chunk-
|
|
186
|
+
} from "../chunk-9whfmsfk.js";
|
|
187
|
+
import"../chunk-3723kgba.js";
|
|
186
188
|
import"../chunk-6b61s40c.js";
|
|
187
189
|
import {
|
|
188
190
|
LakeStorageError2
|
|
189
191
|
} from "../chunk-65abf64x.js";
|
|
190
192
|
import"../chunk-5kyvrtjh.js";
|
|
191
|
-
import"../chunk-
|
|
193
|
+
import"../chunk-80gym75n.js";
|
|
192
194
|
import {
|
|
193
195
|
ActionRunError2
|
|
194
196
|
} from "../chunk-3gbefjg5.js";
|
|
195
197
|
import {
|
|
196
198
|
AiUsageStorageError2
|
|
197
|
-
} from "../chunk-
|
|
199
|
+
} from "../chunk-xtztwpkh.js";
|
|
198
200
|
import"../chunk-21q0j5f2.js";
|
|
199
201
|
import {
|
|
200
202
|
ObjectQueryPlanningError2
|
|
@@ -206,7 +208,7 @@ import {
|
|
|
206
208
|
} from "../chunk-y7dbmaqh.js";
|
|
207
209
|
import {
|
|
208
210
|
AGENT_TOKEN_RATE_SAMPLES2
|
|
209
|
-
} from "../chunk-
|
|
211
|
+
} from "../chunk-n4zzaf6q.js";
|
|
210
212
|
import"../chunk-a3faa34j.js";
|
|
211
213
|
|
|
212
214
|
// src/testing/action-execution.ts
|
|
@@ -3142,6 +3144,56 @@ function runAgentStorageContractSuite(label, options) {
|
|
|
3142
3144
|
await expectAgentError2(storage.computers.hold(session("s_5", { computer: { ...laptop, name: "a\x07b" } })), "invalid_input");
|
|
3143
3145
|
});
|
|
3144
3146
|
});
|
|
3147
|
+
test5("keeps what an open sixb reports of its background commands, and the stops asked", async () => {
|
|
3148
|
+
await withStorage(async (storage) => {
|
|
3149
|
+
const live = at2("2026-06-23T12:01:00.000Z");
|
|
3150
|
+
const session = (overrides = {}) => ({
|
|
3151
|
+
projectId: projectId5,
|
|
3152
|
+
id: "s_1",
|
|
3153
|
+
ownerPrincipal: owner,
|
|
3154
|
+
computer: laptop,
|
|
3155
|
+
expiresAt: live,
|
|
3156
|
+
...overrides
|
|
3157
|
+
});
|
|
3158
|
+
const running = {
|
|
3159
|
+
threadId: "thr_1",
|
|
3160
|
+
id: "bg_1",
|
|
3161
|
+
command: "bun dev",
|
|
3162
|
+
status: "running",
|
|
3163
|
+
startedAt: "2026-06-23T11:59:00.000Z"
|
|
3164
|
+
};
|
|
3165
|
+
const ref = { threadId: "thr_1", id: "bg_1", startedAt: running.startedAt };
|
|
3166
|
+
const stop = (command = ref, ownerPrincipal = owner) => storage.computers.requestStop({ projectId: projectId5, id: "s_1", ownerPrincipal, command });
|
|
3167
|
+
await storage.computers.hold(session({ backgroundCommands: [running] }));
|
|
3168
|
+
await expect5(stop()).resolves.toEqual(session({ backgroundCommands: [running], stopRequests: [ref] }));
|
|
3169
|
+
await expect5(stop()).resolves.toEqual(session({ backgroundCommands: [running], stopRequests: [ref] }));
|
|
3170
|
+
await expect5(stop(ref, otherUser)).resolves.toBeNull();
|
|
3171
|
+
const stopped = {
|
|
3172
|
+
...running,
|
|
3173
|
+
status: "stopped",
|
|
3174
|
+
exitCode: 143,
|
|
3175
|
+
endedAt: "2026-06-23T12:00:30.000Z"
|
|
3176
|
+
};
|
|
3177
|
+
await storage.computers.hold(session({ backgroundCommands: [stopped] }));
|
|
3178
|
+
await expect5(storage.computers.listLive({
|
|
3179
|
+
projectId: projectId5,
|
|
3180
|
+
ownerPrincipal: owner,
|
|
3181
|
+
now: at2(running.startedAt)
|
|
3182
|
+
})).resolves.toEqual([session({ backgroundCommands: [stopped], stopRequests: [ref] })]);
|
|
3183
|
+
for (let index = 2;index <= 65; index += 1)
|
|
3184
|
+
await stop({ ...ref, id: `bg_${index}` });
|
|
3185
|
+
const [kept] = await storage.computers.listLive({
|
|
3186
|
+
projectId: projectId5,
|
|
3187
|
+
ownerPrincipal: owner,
|
|
3188
|
+
now: at2(running.startedAt)
|
|
3189
|
+
});
|
|
3190
|
+
expect5(kept?.stopRequests?.length).toBe(64);
|
|
3191
|
+
expect5(kept?.stopRequests?.[0]?.id).toBe("bg_2");
|
|
3192
|
+
expect5(kept?.stopRequests?.at(-1)?.id).toBe("bg_65");
|
|
3193
|
+
await expectAgentError2(stop({ ...ref, id: "" }), "invalid_input");
|
|
3194
|
+
await expectAgentError2(storage.computers.hold(session({ backgroundCommands: [{ ...running, status: "lost" }] })), "invalid_input");
|
|
3195
|
+
});
|
|
3196
|
+
});
|
|
3145
3197
|
test5("reads several threads at once, in the order asked", async () => {
|
|
3146
3198
|
await withStorage(async (storage) => {
|
|
3147
3199
|
const first = await storage.threads.create(threadInput());
|
|
@@ -5913,7 +5965,7 @@ function runAiLimitStorageContractSuite(label, options) {
|
|
|
5913
5965
|
meter: "cost.catalogEstimated",
|
|
5914
5966
|
amount: { currency: "USD", amountNanos: "100" }
|
|
5915
5967
|
};
|
|
5916
|
-
for (const modelKind of ["reranking", "image", "speech"]) {
|
|
5968
|
+
for (const modelKind of ["reranking", "web-search", "image", "speech"]) {
|
|
5917
5969
|
await expect8(storage.aiLimits.reserveModelCall(reservation(modelKind, 0, { estimates: [cost], modelKind }))).resolves.toEqual({ status: "notRequired" });
|
|
5918
5970
|
}
|
|
5919
5971
|
await expect8(storage.aiLimits.reserveModelCall(reservation("language", 0, { estimates: [cost] }))).resolves.toMatchObject({ status: "unavailable", reasons: ["missingEstimate"] });
|
|
@@ -5927,6 +5979,16 @@ function runAiLimitStorageContractSuite(label, options) {
|
|
|
5927
5979
|
projectId: projectId8,
|
|
5928
5980
|
usageRecordId: "usage-reranking"
|
|
5929
5981
|
});
|
|
5982
|
+
await recordUsageInput(storage.aiUsage, {
|
|
5983
|
+
id: "usage-web-search",
|
|
5984
|
+
callId: "web-search",
|
|
5985
|
+
modelKind: "web-search",
|
|
5986
|
+
usage: {}
|
|
5987
|
+
});
|
|
5988
|
+
await storage.aiLimits.recordModelCallActuals({
|
|
5989
|
+
projectId: projectId8,
|
|
5990
|
+
usageRecordId: "usage-web-search"
|
|
5991
|
+
});
|
|
5930
5992
|
expect8(await status()).toMatchObject({
|
|
5931
5993
|
accountingStatus: "complete",
|
|
5932
5994
|
consumption: { actual: { amount: 4 } }
|
|
@@ -7180,7 +7242,7 @@ function runAiUsageStorageContractSuite(label, options) {
|
|
|
7180
7242
|
}
|
|
7181
7243
|
};
|
|
7182
7244
|
describe10(label, () => {
|
|
7183
|
-
test10("persists transcription and
|
|
7245
|
+
test10("persists transcription, reranking and web search usage kinds without invented token totals", async () => {
|
|
7184
7246
|
await withStorage(async (storage) => {
|
|
7185
7247
|
const latest = () => storage.getLatestForExecution({ projectId: projectId10, executionId: agentExecutionId });
|
|
7186
7248
|
const input = modelCallInput({
|
|
@@ -7204,6 +7266,15 @@ function runAiUsageStorageContractSuite(label, options) {
|
|
|
7204
7266
|
occurredAt: at5("2026-06-23T10:01:00.000Z")
|
|
7205
7267
|
}));
|
|
7206
7268
|
expect10((await latest())?.modelKind).toBe("reranking");
|
|
7269
|
+
await storage.recordModelCall(modelCallInput({
|
|
7270
|
+
id: "usage_web_search",
|
|
7271
|
+
callId: "call_web_search",
|
|
7272
|
+
responseId: "response_web_search",
|
|
7273
|
+
modelKind: "web-search",
|
|
7274
|
+
usage: {},
|
|
7275
|
+
occurredAt: at5("2026-06-23T10:02:00.000Z")
|
|
7276
|
+
}));
|
|
7277
|
+
expect10((await latest())?.modelKind).toBe("web-search");
|
|
7207
7278
|
});
|
|
7208
7279
|
});
|
|
7209
7280
|
test10("persists generated-media usage and the speech kind", async () => {
|
|
@@ -11387,6 +11458,26 @@ function runConnectorConnectionStorageContractSuite(label, options) {
|
|
|
11387
11458
|
});
|
|
11388
11459
|
});
|
|
11389
11460
|
});
|
|
11461
|
+
test15("connects another account to a disconnected slot without replacement", async () => {
|
|
11462
|
+
await withStorage(async (storage) => {
|
|
11463
|
+
const first = await createAuthorization(storage, "authorization-a", "account-a");
|
|
11464
|
+
const connected = await connect(storage, first, "connection-a", "account-a");
|
|
11465
|
+
await storage.disconnectConnection({
|
|
11466
|
+
projectId: projectId13,
|
|
11467
|
+
connectorId,
|
|
11468
|
+
connectionId: connected.connection.id
|
|
11469
|
+
});
|
|
11470
|
+
const second = await createAuthorization(storage, "authorization-b", "account-b");
|
|
11471
|
+
const reconnected = await connect(storage, second, "ignored-new-id", "account-b");
|
|
11472
|
+
expect15(reconnected.connection).toMatchObject({
|
|
11473
|
+
id: connected.connection.id,
|
|
11474
|
+
authorizationId: second.id,
|
|
11475
|
+
account: { id: "account-b" },
|
|
11476
|
+
status: "connected"
|
|
11477
|
+
});
|
|
11478
|
+
expect15(reconnected.replaced).toBe(false);
|
|
11479
|
+
});
|
|
11480
|
+
});
|
|
11390
11481
|
test15("keeps pending selection untouched when connection validation fails", async () => {
|
|
11391
11482
|
await withStorage(async (storage) => {
|
|
11392
11483
|
const active = await createAuthorization(storage, "authorization-a", "account-a");
|
|
@@ -17282,9 +17373,23 @@ var Customer = defineObjectType2({
|
|
|
17282
17373
|
id: "ConditionCustomer",
|
|
17283
17374
|
name: "Condition Customer",
|
|
17284
17375
|
properties: [prop2("id", "string", { required: true, primary: true }), prop2("name", "string")],
|
|
17285
|
-
links: [link2("invoices", Invoice)]
|
|
17376
|
+
links: [link2("invoices", Invoice), link2("primaryInvoice", Invoice, { cardinality: "one" })]
|
|
17377
|
+
});
|
|
17378
|
+
var Ticket = defineObjectType2({
|
|
17379
|
+
id: "ConditionTicket",
|
|
17380
|
+
name: "Condition Ticket",
|
|
17381
|
+
properties: [
|
|
17382
|
+
prop2("id", "string", {
|
|
17383
|
+
required: true,
|
|
17384
|
+
primary: true,
|
|
17385
|
+
query: { searchable: true, sortable: true }
|
|
17386
|
+
}),
|
|
17387
|
+
prop2("status", "string", { query: { searchable: true, filterable: true } }),
|
|
17388
|
+
prop2("owner", ref2.user(), { nullable: true, query: { searchable: true, filterable: true } }),
|
|
17389
|
+
prop2("watchers", { type: "array", items: ref2.user() }, { nullable: true, query: { searchable: true, filterable: true } })
|
|
17390
|
+
]
|
|
17286
17391
|
});
|
|
17287
|
-
var ontology3 = new OntologyRegistry2({ sources: [Invoice, CreditNote, Customer] });
|
|
17392
|
+
var ontology3 = new OntologyRegistry2({ sources: [Invoice, CreditNote, Customer, Ticket] });
|
|
17288
17393
|
function runConditionalObjectReadScopeContractSuite(label, options) {
|
|
17289
17394
|
const withHarness = async (body) => {
|
|
17290
17395
|
const harness = await options.createHarness();
|
|
@@ -17542,6 +17647,114 @@ function runConditionalObjectReadScopeContractSuite(label, options) {
|
|
|
17542
17647
|
expect26(invoices.map((row) => row.primaryId).sort()).toEqual(["inv-1", "inv-3"]);
|
|
17543
17648
|
});
|
|
17544
17649
|
});
|
|
17650
|
+
test26("never expands through a hidden object", async () => {
|
|
17651
|
+
await withHarness(async ({ harness }) => {
|
|
17652
|
+
const unconditioned = createReader(harness.objectReadScopeFactory, []);
|
|
17653
|
+
const conditioned = createReader(harness.objectReadScopeFactory, [noDrafts(Invoice.id)]);
|
|
17654
|
+
const customers = async (reader) => {
|
|
17655
|
+
const [customer] = await queryRows(reader, {
|
|
17656
|
+
kind: "expand",
|
|
17657
|
+
input: {
|
|
17658
|
+
kind: "limit",
|
|
17659
|
+
limit: 10,
|
|
17660
|
+
input: { kind: "start", objectTypeId: Customer.id }
|
|
17661
|
+
},
|
|
17662
|
+
expansions: [
|
|
17663
|
+
{ linkId: "primaryInvoice", direction: "outgoing" },
|
|
17664
|
+
{
|
|
17665
|
+
linkId: "invoices",
|
|
17666
|
+
direction: "outgoing",
|
|
17667
|
+
expand: [{ linkId: "related", direction: "outgoing" }]
|
|
17668
|
+
}
|
|
17669
|
+
]
|
|
17670
|
+
});
|
|
17671
|
+
return {
|
|
17672
|
+
primaryInvoice: linkedIds(customer?.links?.primaryInvoice),
|
|
17673
|
+
invoices: Object.fromEntries(linkedRows(customer?.links?.invoices).map((row) => [
|
|
17674
|
+
row.primaryId,
|
|
17675
|
+
linkedIds(row.links?.related)
|
|
17676
|
+
]))
|
|
17677
|
+
};
|
|
17678
|
+
};
|
|
17679
|
+
expect26(await customers(unconditioned)).toEqual({
|
|
17680
|
+
primaryInvoice: ["inv-2"],
|
|
17681
|
+
invoices: { "inv-1": ["inv-2", "inv-3"], "inv-2": ["inv-1"], "inv-3": [] }
|
|
17682
|
+
});
|
|
17683
|
+
expect26(await customers(conditioned)).toEqual({
|
|
17684
|
+
primaryInvoice: [],
|
|
17685
|
+
invoices: { "inv-1": ["inv-3"], "inv-3": [] }
|
|
17686
|
+
});
|
|
17687
|
+
const relatedFrom = async (reader) => {
|
|
17688
|
+
const invoices = await queryRows(reader, {
|
|
17689
|
+
kind: "expand",
|
|
17690
|
+
input: {
|
|
17691
|
+
kind: "limit",
|
|
17692
|
+
limit: 10,
|
|
17693
|
+
input: sorted({ kind: "start", objectTypeId: Invoice.id }, "amount")
|
|
17694
|
+
},
|
|
17695
|
+
expansions: [
|
|
17696
|
+
{ linkId: "related", direction: "incoming", sourceObjectTypeId: Invoice.id }
|
|
17697
|
+
]
|
|
17698
|
+
});
|
|
17699
|
+
return invoices.map((row) => linkedIds(row.links?.related));
|
|
17700
|
+
};
|
|
17701
|
+
expect26(await relatedFrom(unconditioned)).toEqual([["inv-2"], ["inv-1"], ["inv-1"]]);
|
|
17702
|
+
expect26(await relatedFrom(conditioned)).toEqual([[], ["inv-1"]]);
|
|
17703
|
+
});
|
|
17704
|
+
});
|
|
17705
|
+
test26("never traverses through a hidden object", async () => {
|
|
17706
|
+
await withHarness(async ({ harness }) => {
|
|
17707
|
+
const unconditioned = createReader(harness.objectReadScopeFactory, []);
|
|
17708
|
+
const conditioned = createReader(harness.objectReadScopeFactory, [noDrafts(Invoice.id)]);
|
|
17709
|
+
const reached = async (reader, query) => {
|
|
17710
|
+
const rows = await queryRows(reader, query);
|
|
17711
|
+
return rows.map((row) => row.primaryId).sort();
|
|
17712
|
+
};
|
|
17713
|
+
const relatedOf = (input) => ({
|
|
17714
|
+
kind: "traverse",
|
|
17715
|
+
direction: "outgoing",
|
|
17716
|
+
linkId: "related",
|
|
17717
|
+
input
|
|
17718
|
+
});
|
|
17719
|
+
const refs = (...primaryIds) => ({
|
|
17720
|
+
kind: "refs",
|
|
17721
|
+
refs: primaryIds.map((primaryId) => ({ objectTypeId: Invoice.id, primaryId }))
|
|
17722
|
+
});
|
|
17723
|
+
const twoHops = relatedOf({
|
|
17724
|
+
kind: "traverse",
|
|
17725
|
+
direction: "outgoing",
|
|
17726
|
+
linkId: "invoices",
|
|
17727
|
+
input: { kind: "start", objectTypeId: Customer.id }
|
|
17728
|
+
});
|
|
17729
|
+
expect26(await reached(unconditioned, twoHops)).toEqual(["inv-1", "inv-2", "inv-3"]);
|
|
17730
|
+
expect26(await reached(conditioned, twoHops)).toEqual(["inv-3"]);
|
|
17731
|
+
const fromRefs = relatedOf(refs("inv-1", "inv-2"));
|
|
17732
|
+
expect26(await reached(unconditioned, fromRefs)).toEqual(["inv-1", "inv-2", "inv-3"]);
|
|
17733
|
+
expect26(await reached(conditioned, fromRefs)).toEqual(["inv-3"]);
|
|
17734
|
+
const fromSet = relatedOf({
|
|
17735
|
+
kind: "set",
|
|
17736
|
+
op: "union",
|
|
17737
|
+
inputs: [refs("inv-2"), refs("inv-3")]
|
|
17738
|
+
});
|
|
17739
|
+
expect26(await reached(unconditioned, fromSet)).toEqual(["inv-1"]);
|
|
17740
|
+
expect26(await reached(conditioned, fromSet)).toEqual([]);
|
|
17741
|
+
const sourcesOf = {
|
|
17742
|
+
kind: "traverse",
|
|
17743
|
+
direction: "incoming",
|
|
17744
|
+
linkId: "related",
|
|
17745
|
+
sourceObjectTypeId: Invoice.id,
|
|
17746
|
+
input: refs("inv-1", "inv-3")
|
|
17747
|
+
};
|
|
17748
|
+
expect26(await reached(unconditioned, sourcesOf)).toEqual(["inv-1", "inv-2"]);
|
|
17749
|
+
expect26(await reached(conditioned, sourcesOf)).toEqual(["inv-1"]);
|
|
17750
|
+
expect26(await unconditioned.countObjects?.({ projectId: projectId18, query: sourcesOf })).toEqual({
|
|
17751
|
+
count: 2
|
|
17752
|
+
});
|
|
17753
|
+
expect26(await conditioned.countObjects?.({ projectId: projectId18, query: sourcesOf })).toEqual({
|
|
17754
|
+
count: 1
|
|
17755
|
+
});
|
|
17756
|
+
});
|
|
17757
|
+
});
|
|
17545
17758
|
test26("applies a condition to its concrete type only", async () => {
|
|
17546
17759
|
await withHarness(async ({ harness }) => {
|
|
17547
17760
|
const invoicesOnly = createReader(harness.objectReadScopeFactory, [noDrafts(Invoice.id)]);
|
|
@@ -17584,6 +17797,75 @@ function runConditionalObjectReadScopeContractSuite(label, options) {
|
|
|
17584
17797
|
})).toEqual([]);
|
|
17585
17798
|
});
|
|
17586
17799
|
});
|
|
17800
|
+
test26("shows a reader through its conditions' keys exactly what their predicate shows", async () => {
|
|
17801
|
+
await withHarness(async ({ harness, fixture }) => {
|
|
17802
|
+
const ids = ["usr_1", 'a"b', "a\\b", 'a", "b', "*", "u:usr_1"];
|
|
17803
|
+
const users = ids.map((id) => ({ type: "user", id }));
|
|
17804
|
+
const auth = harness.storage.auth;
|
|
17805
|
+
if (!auth)
|
|
17806
|
+
throw new Error("The conditional read contract requires auth storage.");
|
|
17807
|
+
for (const [index, id] of ids.entries()) {
|
|
17808
|
+
await auth.users.create({ projectId: projectId18, id, email: `reader-${index}@example.com` });
|
|
17809
|
+
}
|
|
17810
|
+
await fixture.seed({
|
|
17811
|
+
objects: users.flatMap((user, index) => [
|
|
17812
|
+
object(Ticket.id, `t-${index}-owned`, {
|
|
17813
|
+
id: `t-${index}-owned`,
|
|
17814
|
+
status: "open",
|
|
17815
|
+
owner: user
|
|
17816
|
+
}),
|
|
17817
|
+
object(Ticket.id, `t-${index}-watched`, {
|
|
17818
|
+
id: `t-${index}-watched`,
|
|
17819
|
+
status: index % 2 === 0 ? "open" : "closed",
|
|
17820
|
+
owner: users[(index + 1) % users.length],
|
|
17821
|
+
watchers: [user, users[(index + 2) % users.length]]
|
|
17822
|
+
})
|
|
17823
|
+
]),
|
|
17824
|
+
links: []
|
|
17825
|
+
});
|
|
17826
|
+
const me = { type: "currentUser" };
|
|
17827
|
+
const conditions = [
|
|
17828
|
+
{ op: "eq", propertyId: "owner", value: me },
|
|
17829
|
+
{ op: "contains", propertyId: "watchers", value: me },
|
|
17830
|
+
{
|
|
17831
|
+
op: "or",
|
|
17832
|
+
items: [
|
|
17833
|
+
{ op: "eq", propertyId: "status", value: "closed" },
|
|
17834
|
+
{ op: "in", propertyId: "owner", values: [me, users[0]] }
|
|
17835
|
+
]
|
|
17836
|
+
},
|
|
17837
|
+
{
|
|
17838
|
+
op: "and",
|
|
17839
|
+
items: [
|
|
17840
|
+
{ op: "eq", propertyId: "status", value: "open" },
|
|
17841
|
+
{ op: "contains", propertyId: "watchers", value: me }
|
|
17842
|
+
]
|
|
17843
|
+
},
|
|
17844
|
+
{ op: "neq", propertyId: "owner", value: me }
|
|
17845
|
+
];
|
|
17846
|
+
const visible = async (condition) => {
|
|
17847
|
+
const reader = createReader(harness.objectReadScopeFactory, [condition]);
|
|
17848
|
+
const rows = await queryRows(reader, {
|
|
17849
|
+
kind: "limit",
|
|
17850
|
+
limit: 100,
|
|
17851
|
+
input: sorted({ kind: "start", objectTypeId: Ticket.id }, "id")
|
|
17852
|
+
});
|
|
17853
|
+
return rows.map((row) => row.primaryId);
|
|
17854
|
+
};
|
|
17855
|
+
for (const [index, condition] of conditions.entries()) {
|
|
17856
|
+
const predicates = [ticketCondition(condition), ticketCondition(conditions[0])];
|
|
17857
|
+
for (const user of [undefined, ...users]) {
|
|
17858
|
+
const keyed = viewConditionReadCondition(Ticket.id, predicates, user);
|
|
17859
|
+
const bound = bindCurrentUserPredicate({ op: "or", items: predicates }, user);
|
|
17860
|
+
expect26({ index, user, ids: await visible(keyed) }).toEqual({
|
|
17861
|
+
index,
|
|
17862
|
+
user,
|
|
17863
|
+
ids: await visible({ objectTypeId: Ticket.id, predicate: bound })
|
|
17864
|
+
});
|
|
17865
|
+
}
|
|
17866
|
+
}
|
|
17867
|
+
});
|
|
17868
|
+
});
|
|
17587
17869
|
test26("never reads another project's objects or links", async () => {
|
|
17588
17870
|
await withHarness(async ({ harness }) => {
|
|
17589
17871
|
await migrateStorage2(harness.storage, { projectId: otherProjectId6, ontology: ontology3 });
|
|
@@ -17678,7 +17960,25 @@ function noDrafts(objectTypeId) {
|
|
|
17678
17960
|
const { query } = validateObjectQuery2({ kind: "filter", input: { kind: "start", objectTypeId }, predicate }, { ontology: ontology3 });
|
|
17679
17961
|
if (query.kind !== "filter")
|
|
17680
17962
|
throw new Error("expected a validated filter");
|
|
17681
|
-
return
|
|
17963
|
+
return viewConditionReadCondition(objectTypeId, [query.predicate], undefined);
|
|
17964
|
+
}
|
|
17965
|
+
function ticketCondition(predicate) {
|
|
17966
|
+
const { query } = validateObjectQuery2({ kind: "filter", input: { kind: "start", objectTypeId: Ticket.id }, predicate }, { ontology: ontology3 });
|
|
17967
|
+
if (query.kind !== "filter")
|
|
17968
|
+
throw new Error("expected a validated filter");
|
|
17969
|
+
return query.predicate;
|
|
17970
|
+
}
|
|
17971
|
+
async function queryRows(reader, query) {
|
|
17972
|
+
const result = await executeObjectQuery2({ projectId: projectId18, query }, { ontology: ontology3, storage: reader });
|
|
17973
|
+
return result.objects;
|
|
17974
|
+
}
|
|
17975
|
+
function linkedRows(value) {
|
|
17976
|
+
if (Array.isArray(value))
|
|
17977
|
+
return value;
|
|
17978
|
+
return value ? [value] : [];
|
|
17979
|
+
}
|
|
17980
|
+
function linkedIds(value) {
|
|
17981
|
+
return linkedRows(value).map((row) => row.primaryId).sort();
|
|
17682
17982
|
}
|
|
17683
17983
|
function sorted(input, propertyId, direction = "asc") {
|
|
17684
17984
|
return { kind: "sort", fields: [{ kind: "property", propertyId, direction }], input };
|
|
@@ -17701,6 +18001,7 @@ async function seed2(fixture) {
|
|
|
17701
18001
|
linkRow(Customer.id, "cust-1", "invoices", Invoice.id, "inv-1"),
|
|
17702
18002
|
linkRow(Customer.id, "cust-1", "invoices", Invoice.id, "inv-2"),
|
|
17703
18003
|
linkRow(Customer.id, "cust-1", "invoices", Invoice.id, "inv-3"),
|
|
18004
|
+
linkRow(Customer.id, "cust-1", "primaryInvoice", Invoice.id, "inv-2"),
|
|
17704
18005
|
linkRow(Invoice.id, "inv-1", "related", Invoice.id, "inv-2"),
|
|
17705
18006
|
linkRow(Invoice.id, "inv-2", "related", Invoice.id, "inv-1"),
|
|
17706
18007
|
linkRow(Invoice.id, "inv-1", "related", Invoice.id, "inv-3")
|
|
@@ -18253,6 +18554,59 @@ function runObjectQueryProviderContractSuite(label, options) {
|
|
|
18253
18554
|
expect27(codes(await where({ op: "gt", propertyId: "code", value: "\uFF21" }))).toEqual(["\uD83D\uDE00"]);
|
|
18254
18555
|
});
|
|
18255
18556
|
});
|
|
18557
|
+
test27("lists a descending sort as the ascending one backwards, ties included", async () => {
|
|
18558
|
+
await withStorage(async ({ objects: storage, fixture }) => {
|
|
18559
|
+
const labelCodes = ["b", null, "a", "b", "a", null, "b"];
|
|
18560
|
+
const deviceNames = ["dimmer", "sensor", "dimmer", "sensor"];
|
|
18561
|
+
await fixture.seed({
|
|
18562
|
+
objects: [
|
|
18563
|
+
...labelCodes.map((code, index) => objectSeed(Label.id, `tie-${index}`, { id: `tie-${index}`, code })),
|
|
18564
|
+
objectSeed(Room.id, "room-ties", { id: "room-ties" }),
|
|
18565
|
+
...deviceNames.map((name, index) => objectSeed(Device3.id, `device-tie-${index}`, { id: `device-tie-${index}`, name }))
|
|
18566
|
+
],
|
|
18567
|
+
links: deviceNames.map((_, index) => linkSeed(Room.id, "room-ties", "hasDevice", Device3.id, `device-tie-${index}`))
|
|
18568
|
+
});
|
|
18569
|
+
const run = (query) => executeObjectQuery2({ projectId: projectId19, query }, { ontology: objectQueryContractOntology, storage });
|
|
18570
|
+
const byCode = (direction) => ({
|
|
18571
|
+
kind: "sort",
|
|
18572
|
+
fields: [{ kind: "property", propertyId: "code", direction }],
|
|
18573
|
+
input: { kind: "start", objectTypeId: Label.id }
|
|
18574
|
+
});
|
|
18575
|
+
const ascending = ids(await run(byCode("asc")));
|
|
18576
|
+
const descending = ids(await run(byCode("desc")));
|
|
18577
|
+
const valued = ascending.slice(0, 5);
|
|
18578
|
+
const nulls = ascending.slice(5);
|
|
18579
|
+
expect27(descending).toEqual([...valued.reverse(), ...nulls.reverse()]);
|
|
18580
|
+
const paged = [];
|
|
18581
|
+
let pageToken;
|
|
18582
|
+
do {
|
|
18583
|
+
const page = await run({ kind: "page", pageSize: 2, pageToken, input: byCode("desc") });
|
|
18584
|
+
paged.push(...ids(page));
|
|
18585
|
+
pageToken = page.nextPageToken;
|
|
18586
|
+
} while (pageToken);
|
|
18587
|
+
expect27(paged).toEqual(descending);
|
|
18588
|
+
const devices = async (direction) => {
|
|
18589
|
+
const result = await run({
|
|
18590
|
+
kind: "expand",
|
|
18591
|
+
expansions: [
|
|
18592
|
+
{
|
|
18593
|
+
linkId: "hasDevice",
|
|
18594
|
+
direction: "outgoing",
|
|
18595
|
+
limit: deviceNames.length,
|
|
18596
|
+
orderBy: [{ kind: "property", propertyId: "name", direction }]
|
|
18597
|
+
}
|
|
18598
|
+
],
|
|
18599
|
+
input: { kind: "limit", limit: 10, input: { kind: "start", objectTypeId: Room.id } }
|
|
18600
|
+
});
|
|
18601
|
+
const room = result.objects.find((row) => row.primaryId === "room-ties");
|
|
18602
|
+
const linked = room?.links?.hasDevice;
|
|
18603
|
+
return Array.isArray(linked) ? linked.map((row) => row.primaryId) : [];
|
|
18604
|
+
};
|
|
18605
|
+
const ascendingDevices = await devices("asc");
|
|
18606
|
+
expect27(ascendingDevices).toHaveLength(deviceNames.length);
|
|
18607
|
+
expect27(await devices("desc")).toEqual([...ascendingDevices].reverse());
|
|
18608
|
+
});
|
|
18609
|
+
});
|
|
18256
18610
|
test27("keeps page tokens stable when projection hides sorted cursor fields", async () => {
|
|
18257
18611
|
await withStorage(async ({ objects: storage, fixture }) => {
|
|
18258
18612
|
await seedObjectQueryContractData(fixture);
|
|
@@ -24409,4 +24763,4 @@ export {
|
|
|
24409
24763
|
startTestWebhookRun
|
|
24410
24764
|
};
|
|
24411
24765
|
|
|
24412
|
-
//# debugId=
|
|
24766
|
+
//# debugId=652F34A1B34236CB64756E2164756E21
|