@sixb/core 0.2.0 → 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 +30 -30
- 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 +39 -33
- 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 +17 -17
- 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 +38 -38
- package/dist/{chunk-neftrg0n.js → chunk-0j3crh1w.js} +2 -2
- package/dist/{chunk-8dcfj58k.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-fdkpkkpw.js → chunk-3sqqhpr7.js} +5 -5
- package/dist/{chunk-m3qe54bb.js → chunk-4bm0caep.js} +1 -1
- package/dist/{chunk-ztf5vtmp.js → chunk-4s753g3k.js} +41 -10
- package/dist/chunk-4s753g3k.js.map +12 -0
- package/dist/{chunk-fntqb7qy.js → chunk-57g0215c.js} +1 -1
- 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-qya541bk.js → chunk-a5v4gjdx.js} +31 -28
- package/dist/{chunk-qya541bk.js.map → chunk-a5v4gjdx.js.map} +4 -4
- package/dist/{chunk-he7g39e5.js → chunk-a7aa0nzj.js} +7 -7
- 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-ekkpzcka.js → chunk-c706qvyc.js} +36 -9
- package/dist/chunk-c706qvyc.js.map +11 -0
- package/dist/{chunk-n54k068r.js → chunk-c7cfe31p.js} +7 -7
- package/dist/{chunk-qsg8rw04.js → chunk-d04g36fw.js} +1 -1
- package/dist/{chunk-hjy3dsws.js → chunk-dsv783c3.js} +305 -32
- package/dist/{chunk-hjy3dsws.js.map → chunk-dsv783c3.js.map} +12 -10
- package/dist/{chunk-peggaard.js → chunk-e6xgz4h4.js} +20 -2
- package/dist/{chunk-peggaard.js.map → chunk-e6xgz4h4.js.map} +5 -3
- package/dist/{chunk-e99kp9jh.js → chunk-eqgr6nsa.js} +86 -30
- package/dist/{chunk-e99kp9jh.js.map → chunk-eqgr6nsa.js.map} +10 -9
- package/dist/{chunk-f2w6328x.js → chunk-f1h34y3r.js} +6 -6
- package/dist/{chunk-9rh8ncs5.js → chunk-fwsvshr5.js} +1 -1
- package/dist/{chunk-c78jjzhy.js → chunk-ga63a3dz.js} +6 -6
- package/dist/{chunk-c78jjzhy.js.map → chunk-ga63a3dz.js.map} +2 -2
- package/dist/{chunk-cgznz22f.js → chunk-gkv8r794.js} +2 -2
- package/dist/{chunk-d3t26vah.js → chunk-j1ny5fwh.js} +35 -11
- package/dist/chunk-j1ny5fwh.js.map +15 -0
- package/dist/{chunk-8hvfs0fr.js → chunk-j8thxj7w.js} +4 -4
- package/dist/{chunk-855n80en.js → chunk-jjmggm9a.js} +1 -1
- 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-fb3m4sa1.js → chunk-m2vh8gh0.js} +8 -14
- package/dist/{chunk-fb3m4sa1.js.map → chunk-m2vh8gh0.js.map} +3 -3
- package/dist/{chunk-vkweppkw.js → chunk-mbc5hvnj.js} +3 -3
- 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-9mab3dvg.js → chunk-s038wa5v.js} +9 -1
- package/dist/{chunk-9mab3dvg.js.map → chunk-s038wa5v.js.map} +3 -3
- 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-semf1yqn.js → chunk-w1btn96n.js} +51 -26
- package/dist/{chunk-semf1yqn.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-xj97s5js.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/datasets/execution.d.ts.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/selectors/index.js +1 -1
- package/dist/events/selectors/predicate.d.ts.map +1 -1
- package/dist/events/types/datasets.d.ts +6 -0
- package/dist/events/types/datasets.d.ts.map +1 -1
- package/dist/execution/agent.js +30 -30
- package/dist/execution/object-reader-security.d.ts.map +1 -1
- package/dist/execution/primitive.js +30 -30
- package/dist/execution/request.js +31 -31
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -42
- package/dist/lake-storage/in-memory.d.ts.map +1 -1
- package/dist/lake-storage/index.d.ts +2 -2
- package/dist/lake-storage/index.d.ts.map +1 -1
- package/dist/lake-storage/index.js +6 -2
- package/dist/lake-storage/index.js.map +1 -1
- package/dist/lake-storage/source-ordering.d.ts +7 -0
- package/dist/lake-storage/source-ordering.d.ts.map +1 -1
- package/dist/lake-storage/types.d.ts +18 -0
- package/dist/lake-storage/types.d.ts.map +1 -1
- package/dist/lake-storage/version-inputs.d.ts +11 -3
- package/dist/lake-storage/version-inputs.d.ts.map +1 -1
- package/dist/materializer/index.js +16 -16
- 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 +18 -18
- 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 +30 -30
- 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 +19 -16
- 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 +19 -19
- package/dist/pipelines/run-dispatch.d.ts +2 -0
- package/dist/pipelines/run-dispatch.d.ts.map +1 -1
- package/dist/projections/internal.js +16 -16
- package/dist/runtime/create.d.ts +1 -1
- package/dist/runtime/create.d.ts.map +1 -1
- package/dist/runtime/internal.js +22 -22
- package/dist/runtime/resolve-definitions.d.ts.map +1 -1
- package/dist/schedules/index.js +2 -2
- 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 +16 -16
- 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 +15 -15
- package/dist/storage/internal.d.ts +2 -0
- package/dist/storage/internal.d.ts.map +1 -1
- package/dist/storage/internal.js +8 -4
- package/dist/storage/internal.js.map +1 -1
- 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/pipeline-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/pipeline-runs/transitions.d.ts +7 -0
- package/dist/storage/pipeline-runs/transitions.d.ts.map +1 -0
- package/dist/storage/share-grants/provider.js +2 -2
- package/dist/storage/sync-runs/in-memory.d.ts.map +1 -1
- package/dist/storage/sync-runs/transitions.d.ts +7 -0
- package/dist/storage/sync-runs/transitions.d.ts.map +1 -0
- package/dist/storage/workflow-runs/provider.js +4 -4
- package/dist/syncs/index.js +20 -20
- package/dist/syncs/run-dispatch.d.ts +2 -0
- package/dist/syncs/run-dispatch.d.ts.map +1 -1
- 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/dataset-sequence-contract.d.ts.map +1 -1
- package/dist/testing/index.js +552 -61
- package/dist/testing/index.js.map +11 -11
- package/dist/testing/lake-changes-contract.d.ts.map +1 -1
- package/dist/testing/lake-storage-contract.d.ts.map +1 -1
- 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 +16 -16
- package/dist/workers/index.d.ts +1 -0
- package/dist/workers/index.d.ts.map +1 -1
- package/dist/workers/index.js +12 -2
- package/dist/workers/index.js.map +5 -4
- package/dist/workers/unstarted-run.d.ts +10 -0
- package/dist/workers/unstarted-run.d.ts.map +1 -0
- package/dist/workflows/index.js +34 -34
- 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/datasets/execution.ts +2 -0
- package/src/events/selectors/predicate.ts +15 -0
- package/src/events/types/datasets.ts +6 -0
- package/src/execution/object-reader-security.ts +4 -9
- package/src/index.ts +2 -0
- package/src/lake-storage/in-memory.ts +30 -20
- package/src/lake-storage/index.ts +2 -1
- package/src/lake-storage/source-ordering.ts +31 -4
- package/src/lake-storage/types.ts +18 -0
- package/src/lake-storage/version-inputs.ts +21 -5
- 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/pipelines/run-dispatch.ts +53 -6
- 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/internal.ts +2 -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/storage/pipeline-runs/in-memory.ts +2 -5
- package/src/storage/pipeline-runs/transitions.ts +14 -0
- package/src/storage/sync-runs/in-memory.ts +2 -5
- package/src/storage/sync-runs/transitions.ts +11 -0
- package/src/syncs/run-dispatch.ts +68 -13
- 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/dataset-sequence-contract.ts +81 -0
- package/src/testing/lake-changes-contract.ts +2 -1
- package/src/testing/lake-storage-contract.ts +112 -0
- package/src/testing/object-conditional-read-scope-contract.ts +267 -5
- package/src/testing/object-query-contract.ts +75 -0
- package/src/workers/index.ts +1 -0
- package/src/workers/unstarted-run.ts +18 -0
- package/dist/chunk-8dcfj58k.js.map +0 -18
- package/dist/chunk-d3t26vah.js.map +0 -15
- package/dist/chunk-edx8xcsm.js.map +0 -13
- package/dist/chunk-ekkpzcka.js.map +0 -11
- package/dist/chunk-fg1db9xx.js.map +0 -10
- package/dist/chunk-jk97v21j.js.map +0 -10
- package/dist/chunk-tvefbgvw.js.map +0 -11
- package/dist/chunk-ztf5vtmp.js.map +0 -12
- /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-fdkpkkpw.js.map → chunk-3sqqhpr7.js.map} +0 -0
- /package/dist/{chunk-m3qe54bb.js.map → chunk-4bm0caep.js.map} +0 -0
- /package/dist/{chunk-fntqb7qy.js.map → chunk-57g0215c.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-he7g39e5.js.map → chunk-a7aa0nzj.js.map} +0 -0
- /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.js.map} +0 -0
- /package/dist/{chunk-n54k068r.js.map → chunk-c7cfe31p.js.map} +0 -0
- /package/dist/{chunk-qsg8rw04.js.map → chunk-d04g36fw.js.map} +0 -0
- /package/dist/{chunk-f2w6328x.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-8hvfs0fr.js.map → chunk-j8thxj7w.js.map} +0 -0
- /package/dist/{chunk-855n80en.js.map → chunk-jjmggm9a.js.map} +0 -0
- /package/dist/{chunk-vkweppkw.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-xj97s5js.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
|
@@ -45,11 +45,26 @@ export function buildEventSelectorPredicate(
|
|
|
45
45
|
if (filter.runStatus !== undefined && !matchesRunStatus(event, filter.runStatus)) return false
|
|
46
46
|
|
|
47
47
|
if (!matchesPropertyChange(event, filter)) return false
|
|
48
|
+
if (!matchesDatasetChange(event, filter)) return false
|
|
48
49
|
|
|
49
50
|
return true
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
|
|
54
|
+
/**
|
|
55
|
+
* A dataset selector (`events.dataset(X).updated()`) matches the versions that change what the
|
|
56
|
+
* dataset holds: its rows, or the lineage its markings are read from. A version that only records
|
|
57
|
+
* new input versions or source ordering does not. Events stored before versions recorded either
|
|
58
|
+
* count as changed.
|
|
59
|
+
*/
|
|
60
|
+
function matchesDatasetChange(event: DomainEvent, filter: EventSelectorSpec): boolean {
|
|
61
|
+
if (event.type !== "dataset.version.committed" || !filter.types?.includes(event.type)) {
|
|
62
|
+
return true
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return event.payload.rowsChanged !== false || event.payload.lineageChanged !== false
|
|
66
|
+
}
|
|
67
|
+
|
|
53
68
|
function matchesRunStatus(
|
|
54
69
|
event: DomainEvent,
|
|
55
70
|
status: NonNullable<EventSelectorSpec["runStatus"]>
|
|
@@ -11,6 +11,12 @@ export interface DatasetVersionCommittedEvent extends EventEnvelope {
|
|
|
11
11
|
/** Canonical UTC ISO timestamp from the committed immutable dataset version. */
|
|
12
12
|
createdAt: string
|
|
13
13
|
producer: DatasetProducer
|
|
14
|
+
/**
|
|
15
|
+
* As `DatasetVersion.rowsChanged` and `DatasetVersion.lineageChanged`. Absent on events stored
|
|
16
|
+
* before versions recorded them: read a missing flag as changed (`!== false`).
|
|
17
|
+
*/
|
|
18
|
+
rowsChanged?: boolean
|
|
19
|
+
lineageChanged?: boolean
|
|
14
20
|
}
|
|
15
21
|
}
|
|
16
22
|
|
|
@@ -2,7 +2,6 @@ import { assertAuthorized, assertRuntimeAuthorizationBound, isAllowed } from "..
|
|
|
2
2
|
import { AuthorizationError } from "../authorization/errors"
|
|
3
3
|
import type { AuthorizationContext } from "../authorization/types"
|
|
4
4
|
import { type Unreadable, unreadableError } from "../objects/property-clearance"
|
|
5
|
-
import { bindCurrentUserPredicate } from "../objects/query/current-user"
|
|
6
5
|
import type { ObjectQueryPredicate } from "../objects/query/ir"
|
|
7
6
|
import {
|
|
8
7
|
createSelectedObjectQueryAdmission,
|
|
@@ -11,6 +10,7 @@ import {
|
|
|
11
10
|
import type { OntologyRegistry } from "../ontology"
|
|
12
11
|
import type { UserRef } from "../ontology/user-ref"
|
|
13
12
|
import type { AppliedMarkings } from "../security/applied-markings"
|
|
13
|
+
import { viewConditionReadCondition } from "../security/visibility-keys"
|
|
14
14
|
import type {
|
|
15
15
|
CompiledConditionalObjectReadScope,
|
|
16
16
|
CompiledObjectReadStep,
|
|
@@ -108,10 +108,9 @@ export class ObjectReaderSecurity {
|
|
|
108
108
|
|
|
109
109
|
this.conditionalScope = compileConditionalObjectReadScope({
|
|
110
110
|
kind: "conditional",
|
|
111
|
-
conditions: [...conditions].map(([objectTypeId, predicates]) =>
|
|
112
|
-
objectTypeId,
|
|
113
|
-
|
|
114
|
-
})),
|
|
111
|
+
conditions: [...conditions].map(([objectTypeId, predicates]) =>
|
|
112
|
+
viewConditionReadCondition(objectTypeId, predicates, grantee)
|
|
113
|
+
),
|
|
115
114
|
})
|
|
116
115
|
}
|
|
117
116
|
|
|
@@ -238,10 +237,6 @@ function propertiesReadBy(predicate: ObjectQueryPredicate): readonly string[] {
|
|
|
238
237
|
}
|
|
239
238
|
}
|
|
240
239
|
|
|
241
|
-
function anyOf(predicates: readonly ObjectQueryPredicate[]): ObjectQueryPredicate {
|
|
242
|
-
return predicates.length === 1 ? predicates[0]! : { op: "or", items: predicates }
|
|
243
|
-
}
|
|
244
|
-
|
|
245
240
|
/**
|
|
246
241
|
* Unrestricted authority reads every property. A principal reads what its roles clear; delegated
|
|
247
242
|
* shared access carries no clearance, so no share can expose a marked property.
|
package/src/index.ts
CHANGED
|
@@ -485,6 +485,7 @@ export type {
|
|
|
485
485
|
Selection,
|
|
486
486
|
ShareGrant,
|
|
487
487
|
UsersViewGrant,
|
|
488
|
+
ViewCondition,
|
|
488
489
|
ViewGrant,
|
|
489
490
|
ViewGrantTarget,
|
|
490
491
|
} from "./security"
|
|
@@ -1232,6 +1233,7 @@ export type {
|
|
|
1232
1233
|
AgentToolRuntimeFacade,
|
|
1233
1234
|
AgentToolTextContent,
|
|
1234
1235
|
AgentUsageReference,
|
|
1236
|
+
AgentWebOptions,
|
|
1235
1237
|
InferAgentToolInput,
|
|
1236
1238
|
InferAgentToolInputSchema,
|
|
1237
1239
|
InferAgentToolOutput,
|
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
assertUnsequencedDatasetWrite,
|
|
24
24
|
type DatasetSequenceState,
|
|
25
25
|
datasetSequenceChange,
|
|
26
|
+
isSequenceOnlyChange,
|
|
26
27
|
reconcileDatasetSequences,
|
|
27
28
|
} from "./source-ordering"
|
|
28
29
|
import type {
|
|
@@ -43,7 +44,7 @@ import type {
|
|
|
43
44
|
ReadDatasetChangesInput,
|
|
44
45
|
ReadDatasetRowsInput,
|
|
45
46
|
} from "./types"
|
|
46
|
-
import { hasDatasetProvenanceChanges } from "./version-inputs"
|
|
47
|
+
import { hasDatasetLineageChanges, hasDatasetProvenanceChanges } from "./version-inputs"
|
|
47
48
|
|
|
48
49
|
function cloneDatasetDefinition(definition: DatasetDefinition): DatasetDefinition {
|
|
49
50
|
return structuredClone(definition)
|
|
@@ -546,22 +547,19 @@ export class InMemoryLakeStorage implements LakeStorage {
|
|
|
546
547
|
}
|
|
547
548
|
}
|
|
548
549
|
|
|
550
|
+
// An upsert that only carries a newer sequence keeps the stored row: it advances ordering.
|
|
549
551
|
const nextByKey = new Map(previousByKey)
|
|
550
552
|
for (const [primaryKey, change] of finalChanges) {
|
|
551
|
-
if (change.kind === "
|
|
552
|
-
nextByKey.set(primaryKey, cloneRow(change.row))
|
|
553
|
-
} else {
|
|
553
|
+
if (change.kind === "delete") {
|
|
554
554
|
nextByKey.delete(primaryKey)
|
|
555
|
+
} else if (!isSequenceOnlyChange(definition, previousByKey.get(primaryKey), change.row)) {
|
|
556
|
+
nextByKey.set(primaryKey, cloneRow(change.row))
|
|
555
557
|
}
|
|
556
558
|
}
|
|
557
559
|
|
|
560
|
+
const sameRows = this.sameKeyedRowContent(previousByKey, nextByKey, definition.schema)
|
|
558
561
|
const createInitialVersion = options.commit?.createInitialVersion && latestVersion === null
|
|
559
|
-
if (
|
|
560
|
-
!createInitialVersion &&
|
|
561
|
-
(ordered
|
|
562
|
-
? ordered.accepted.size === 0
|
|
563
|
-
: this.sameKeyedRowContent(previousByKey, nextByKey, definition.schema))
|
|
564
|
-
) {
|
|
562
|
+
if (!createInitialVersion && (ordered ? ordered.accepted.size === 0 : sameRows)) {
|
|
565
563
|
return {
|
|
566
564
|
outcome: "unchanged",
|
|
567
565
|
version: latestVersion ? cloneDatasetVersion(latestVersion) : null,
|
|
@@ -586,6 +584,16 @@ export class InMemoryLakeStorage implements LakeStorage {
|
|
|
586
584
|
producer: options.merge.producer ? structuredClone(options.merge.producer) : undefined,
|
|
587
585
|
inputs: options.merge.inputs ? structuredClone(options.merge.inputs) : undefined,
|
|
588
586
|
...(lineage && { lineage }),
|
|
587
|
+
// A sequenced merge can accept only changes that leave the rows as they were, such as the
|
|
588
|
+
// delete of an absent key or a stored row with a newer sequence: it still records the
|
|
589
|
+
// source ordering it advanced.
|
|
590
|
+
rowsChanged: latestVersion === null || !sameRows,
|
|
591
|
+
lineageChanged: hasDatasetLineageChanges(latestVersion, {
|
|
592
|
+
datasetId: definition.id,
|
|
593
|
+
schema: definition.schema,
|
|
594
|
+
producer: options.merge.producer,
|
|
595
|
+
lineage,
|
|
596
|
+
}),
|
|
589
597
|
rowCount: visibleRows.length,
|
|
590
598
|
sizeBytes: new TextEncoder().encode(
|
|
591
599
|
visibleRows.map((row) => JSON.stringify(row)).join("\n")
|
|
@@ -640,18 +648,18 @@ export class InMemoryLakeStorage implements LakeStorage {
|
|
|
640
648
|
parent: latestVersion,
|
|
641
649
|
})
|
|
642
650
|
|
|
651
|
+
const provenance = {
|
|
652
|
+
...options.write,
|
|
653
|
+
datasetId: definition.id,
|
|
654
|
+
schema: definition.schema,
|
|
655
|
+
lineage,
|
|
656
|
+
}
|
|
657
|
+
const rowsChanged =
|
|
658
|
+
!latestVersion || !this.isUnchangedWrite(mode, latestVersion, options.rows, definition.schema)
|
|
659
|
+
|
|
643
660
|
// Content-identical snapshots and empty appends reuse the latest version
|
|
644
661
|
// unless explicitly supplied provenance has changed.
|
|
645
|
-
if (
|
|
646
|
-
latestVersion &&
|
|
647
|
-
!hasDatasetProvenanceChanges(latestVersion, {
|
|
648
|
-
...options.write,
|
|
649
|
-
datasetId: definition.id,
|
|
650
|
-
schema: definition.schema,
|
|
651
|
-
lineage,
|
|
652
|
-
}) &&
|
|
653
|
-
this.isUnchangedWrite(mode, latestVersion, options.rows, definition.schema)
|
|
654
|
-
) {
|
|
662
|
+
if (latestVersion && !rowsChanged && !hasDatasetProvenanceChanges(latestVersion, provenance)) {
|
|
655
663
|
return { ...latestVersion, outcome: "unchanged" }
|
|
656
664
|
}
|
|
657
665
|
|
|
@@ -675,6 +683,8 @@ export class InMemoryLakeStorage implements LakeStorage {
|
|
|
675
683
|
producer: options.write.producer ? structuredClone(options.write.producer) : undefined,
|
|
676
684
|
inputs: options.write.inputs ? structuredClone(options.write.inputs) : undefined,
|
|
677
685
|
...(lineage && { lineage }),
|
|
686
|
+
rowsChanged,
|
|
687
|
+
lineageChanged: hasDatasetLineageChanges(latestVersion, provenance),
|
|
678
688
|
rowCount: visibleRows.length,
|
|
679
689
|
sizeBytes,
|
|
680
690
|
}
|
|
@@ -40,6 +40,7 @@ export type { DatasetSequenceChange, DatasetSequenceState } from "./source-order
|
|
|
40
40
|
export {
|
|
41
41
|
assertUnsequencedDatasetWrite,
|
|
42
42
|
datasetSequenceChange,
|
|
43
|
+
isSequenceOnlyChange,
|
|
43
44
|
reconcileDatasetSequences,
|
|
44
45
|
} from "./source-ordering"
|
|
45
46
|
export type {
|
|
@@ -86,4 +87,4 @@ export type {
|
|
|
86
87
|
ReadDatasetRowsInput,
|
|
87
88
|
} from "./types"
|
|
88
89
|
export type { DatasetCommitProvenance } from "./version-inputs"
|
|
89
|
-
export { hasDatasetProvenanceChanges } from "./version-inputs"
|
|
90
|
+
export { hasDatasetLineageChanges, hasDatasetProvenanceChanges } from "./version-inputs"
|
|
@@ -57,12 +57,41 @@ export function reconcileDatasetSequences(
|
|
|
57
57
|
return { states, accepted }
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Whether an accepted upsert leaves the stored row of its key as it is. On a sequenced dataset, a
|
|
62
|
+
* row that differs from the stored one only in its `sequenceBy` column is the same row delivered
|
|
63
|
+
* again: the stored row keeps the sequence it was first seen at, while the source ordering still
|
|
64
|
+
* advances, so an older delivery stays ignored. Columns compare as content digests do.
|
|
65
|
+
*/
|
|
66
|
+
export function isSequenceOnlyChange(
|
|
67
|
+
dataset: DatasetDefinition,
|
|
68
|
+
stored: DatasetRow | undefined,
|
|
69
|
+
row: DatasetRow
|
|
70
|
+
): boolean {
|
|
71
|
+
if (dataset.sequenceBy === undefined || stored === undefined) {
|
|
72
|
+
return false
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return (
|
|
76
|
+
canonicalRowContent(dataset, stored, dataset.sequenceBy) ===
|
|
77
|
+
canonicalRowContent(dataset, row, dataset.sequenceBy)
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
60
81
|
function rowDigest(dataset: DatasetDefinition, row: DatasetRow): string {
|
|
82
|
+
return createHash("sha256").update(canonicalRowContent(dataset, row)).digest("hex")
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function canonicalRowContent(
|
|
86
|
+
dataset: DatasetDefinition,
|
|
87
|
+
row: DatasetRow,
|
|
88
|
+
ignoredColumn?: string
|
|
89
|
+
): string {
|
|
61
90
|
const content: Record<string, unknown> = Object.create(null)
|
|
62
91
|
for (const column of dataset.schema.columns) {
|
|
63
92
|
const value = row[column.name]
|
|
64
93
|
// Nullable additions and omitted/undefined/null values have identical content.
|
|
65
|
-
if (value == null) continue
|
|
94
|
+
if (value == null || column.name === ignoredColumn) continue
|
|
66
95
|
switch (column.type) {
|
|
67
96
|
case "int64":
|
|
68
97
|
content[column.name] = BigInt(value as string | number).toString()
|
|
@@ -80,9 +109,7 @@ function rowDigest(dataset: DatasetDefinition, row: DatasetRow): string {
|
|
|
80
109
|
content[column.name] = value
|
|
81
110
|
}
|
|
82
111
|
}
|
|
83
|
-
return
|
|
84
|
-
.update(stableJsonStringify(JSON.parse(JSON.stringify(content))))
|
|
85
|
-
.digest("hex")
|
|
112
|
+
return stableJsonStringify(JSON.parse(JSON.stringify(content)))
|
|
86
113
|
}
|
|
87
114
|
|
|
88
115
|
/** Until row reconciliation is supported, replacement writes must not erase source history. */
|
|
@@ -76,6 +76,20 @@ export interface DatasetVersion {
|
|
|
76
76
|
* (`LakeStorage.recordsLineage`), and on a pipeline version whose writer passed none.
|
|
77
77
|
*/
|
|
78
78
|
readonly lineage?: DatasetVersionLineage
|
|
79
|
+
/**
|
|
80
|
+
* Whether this version's rows differ from those of the version it was committed on top of. False
|
|
81
|
+
* for a version that only records new provenance, such as identical rows computed from new input
|
|
82
|
+
* versions, or that only advances source ordering. A dataset's first version and a schema change
|
|
83
|
+
* count as changed, and so does a stored version that predates this field.
|
|
84
|
+
*/
|
|
85
|
+
readonly rowsChanged: boolean
|
|
86
|
+
/**
|
|
87
|
+
* Whether this version's lineage classifies its rows otherwise than the lineage of the version it
|
|
88
|
+
* was committed on top of (`hasDatasetLineageChanges`), so its markings may differ. A dataset's
|
|
89
|
+
* first version and a schema change count as changed, and so does a stored version that predates
|
|
90
|
+
* this field.
|
|
91
|
+
*/
|
|
92
|
+
readonly lineageChanged: boolean
|
|
79
93
|
readonly rowCount?: number
|
|
80
94
|
readonly sizeBytes?: number
|
|
81
95
|
}
|
|
@@ -265,6 +279,10 @@ export interface LakeStorage {
|
|
|
265
279
|
* Optional comparison of two immutable versions. Null means the snapshots, schemas or unique
|
|
266
280
|
* keys cannot support a complete delta: use a full read. Operational errors must propagate.
|
|
267
281
|
* Iteration releases the provider connection between bounded pages, allowing other lake work.
|
|
282
|
+
*
|
|
283
|
+
* Between versions of identical rows, such as a version and one that only records new input
|
|
284
|
+
* versions after it, a provider may return the empty delta without checking the keys: no row
|
|
285
|
+
* needs an identity to be paired.
|
|
268
286
|
*/
|
|
269
287
|
readChanges?(input: ReadDatasetChangesInput): Promise<DatasetChanges | null>
|
|
270
288
|
|
|
@@ -13,18 +13,34 @@ export type DatasetCommitProvenance = Pick<
|
|
|
13
13
|
* version would keep provenance that no longer describes the newest calculation.
|
|
14
14
|
*
|
|
15
15
|
* `next` holds what the commit would store, after `lineageAtCommit` merged in the parent's
|
|
16
|
-
* lineage. Lineages compare
|
|
17
|
-
*
|
|
18
|
-
* them.
|
|
16
|
+
* lineage. Lineages compare as `hasDatasetLineageChanges` compares them. Inputs count only when
|
|
17
|
+
* the writer passed them.
|
|
19
18
|
*/
|
|
20
19
|
export function hasDatasetProvenanceChanges(
|
|
21
20
|
latest: DatasetCommitProvenance & Pick<DatasetVersion, "versionId">,
|
|
22
21
|
next: DatasetCommitProvenance
|
|
23
22
|
): boolean {
|
|
24
23
|
return (
|
|
25
|
-
hasDatasetInputChanges(latest.inputs, next.inputs) ||
|
|
24
|
+
hasDatasetInputChanges(latest.inputs, next.inputs) || hasDatasetLineageChanges(latest, next)
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Whether a version's lineage classifies its rows otherwise than its parent's, which a provider
|
|
30
|
+
* stores as `DatasetVersion.lineageChanged`. `next` holds the lineage `lineageAtCommit` returned
|
|
31
|
+
* for it, and a version without a parent changes lineage.
|
|
32
|
+
*
|
|
33
|
+
* Lineages compare whatever their order and repetition; an unknown lineage, or a pipeline version
|
|
34
|
+
* that records none, differs from any known one.
|
|
35
|
+
*/
|
|
36
|
+
export function hasDatasetLineageChanges(
|
|
37
|
+
parent: DatasetCommitProvenance | null | undefined,
|
|
38
|
+
next: DatasetCommitProvenance
|
|
39
|
+
): boolean {
|
|
40
|
+
return (
|
|
41
|
+
!parent ||
|
|
26
42
|
!sameLineage(
|
|
27
|
-
versionLineage(
|
|
43
|
+
versionLineage(parent, COMMITTING_PROVIDER),
|
|
28
44
|
versionLineage(next, COMMITTING_PROVIDER)
|
|
29
45
|
)
|
|
30
46
|
)
|
package/src/models/catalog.ts
CHANGED
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
modelReasoningSupportIssue,
|
|
22
22
|
} from "./language-model"
|
|
23
23
|
import { assertRerankingModel, type RerankingModel } from "./reranking-model"
|
|
24
|
+
import { assertWebSearchModel, type WebSearchModel } from "./web-search-model"
|
|
24
25
|
|
|
25
26
|
/** Stable identity of a configured provider binding. */
|
|
26
27
|
export interface ModelRef {
|
|
@@ -48,6 +49,17 @@ export interface RerankingModelCatalog {
|
|
|
48
49
|
getByRef(ref: ModelRef): RerankingModelEntry | null
|
|
49
50
|
}
|
|
50
51
|
|
|
52
|
+
export interface WebSearchModelEntry extends ModelRef {
|
|
53
|
+
readonly model: WebSearchModel
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface WebSearchModelCatalog {
|
|
57
|
+
/** The one Sixb searches with. */
|
|
58
|
+
readonly default: WebSearchModelEntry
|
|
59
|
+
list(): readonly WebSearchModelEntry[]
|
|
60
|
+
getByRef(ref: ModelRef): WebSearchModelEntry | null
|
|
61
|
+
}
|
|
62
|
+
|
|
51
63
|
/** The cost and strength classes a project can configure language models in. */
|
|
52
64
|
export const LANGUAGE_MODEL_TIERS = ["light", "standard", "heavy"] as const
|
|
53
65
|
|
|
@@ -107,6 +119,7 @@ export interface ModelCatalog {
|
|
|
107
119
|
readonly embedding: EmbeddingModelCatalog
|
|
108
120
|
readonly image?: ImageModelCatalog
|
|
109
121
|
readonly reranking?: RerankingModelCatalog
|
|
122
|
+
readonly webSearch?: WebSearchModelCatalog
|
|
110
123
|
}
|
|
111
124
|
|
|
112
125
|
export interface ModelCatalogInput {
|
|
@@ -123,6 +136,11 @@ export interface ModelCatalogInput {
|
|
|
123
136
|
readonly image?: readonly ImageModel[]
|
|
124
137
|
/** Available rerankers; no default model and no automatic activation. */
|
|
125
138
|
readonly reranking?: readonly RerankingModel[]
|
|
139
|
+
/**
|
|
140
|
+
* Ordered; the first is the one Sixb searches with. Omitted, Sixb searches with the default
|
|
141
|
+
* language model's own web search, else the first language model that offers one.
|
|
142
|
+
*/
|
|
143
|
+
readonly webSearch?: readonly WebSearchModel[]
|
|
126
144
|
}
|
|
127
145
|
|
|
128
146
|
// Only statically required inputs make their corresponding catalogs required.
|
|
@@ -166,6 +184,7 @@ export function createModelCatalog(input: ModelCatalogInput): ModelCatalog {
|
|
|
166
184
|
const audio = createAudioCatalog(input.audio)
|
|
167
185
|
const image = createImageCatalog(input.image)
|
|
168
186
|
const reranking = createRerankingCatalog(input.reranking)
|
|
187
|
+
const webSearch = createWebSearchCatalog(input.webSearch, language)
|
|
169
188
|
|
|
170
189
|
if (
|
|
171
190
|
!language &&
|
|
@@ -173,14 +192,15 @@ export function createModelCatalog(input: ModelCatalogInput): ModelCatalog {
|
|
|
173
192
|
!audio &&
|
|
174
193
|
!image &&
|
|
175
194
|
embedding.list().length === 0 &&
|
|
176
|
-
!reranking?.list().length
|
|
195
|
+
!reranking?.list().length &&
|
|
196
|
+
!webSearch
|
|
177
197
|
) {
|
|
178
198
|
throw new RuntimeError(
|
|
179
|
-
"[Sixb] Configure at least one language, embedding, decision, audio, image or
|
|
199
|
+
"[Sixb] Configure at least one language, embedding, decision, audio, image, reranking or web search model."
|
|
180
200
|
)
|
|
181
201
|
}
|
|
182
202
|
|
|
183
|
-
return Object.freeze({ language, embedding, decision, audio, image, reranking })
|
|
203
|
+
return Object.freeze({ language, embedding, decision, audio, image, reranking, webSearch })
|
|
184
204
|
}
|
|
185
205
|
|
|
186
206
|
function createRerankingCatalog(
|
|
@@ -193,6 +213,35 @@ function createRerankingCatalog(
|
|
|
193
213
|
return indexModelBindings(models, "reranking", assertRerankingModel)
|
|
194
214
|
}
|
|
195
215
|
|
|
216
|
+
/**
|
|
217
|
+
* The project's own list, else the search its default language model offers, else the first
|
|
218
|
+
* language model's that offers one. Discovered, the catalog holds that one search alone.
|
|
219
|
+
*/
|
|
220
|
+
function createWebSearchCatalog(
|
|
221
|
+
models: readonly WebSearchModel[] | undefined,
|
|
222
|
+
language: LanguageModelCatalog | undefined
|
|
223
|
+
): WebSearchModelCatalog | undefined {
|
|
224
|
+
if (models !== undefined && !Array.isArray(models)) {
|
|
225
|
+
throw new RuntimeError("[Sixb] models.webSearch must be an array of web search models.")
|
|
226
|
+
}
|
|
227
|
+
if (models?.length === 0) {
|
|
228
|
+
throw new RuntimeError(
|
|
229
|
+
"[Sixb] models.webSearch must contain at least one model. Omit it to search with your language models' own web search."
|
|
230
|
+
)
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
const discovered =
|
|
234
|
+
language?.default.model.webSearch ??
|
|
235
|
+
language?.list().find((entry) => entry.model.webSearch)?.model.webSearch
|
|
236
|
+
const configured = models ?? (discovered ? [discovered] : [])
|
|
237
|
+
|
|
238
|
+
const index = indexModelBindings(configured, "webSearch", assertWebSearchModel)
|
|
239
|
+
const [defaultEntry] = index.list()
|
|
240
|
+
if (!defaultEntry) return undefined
|
|
241
|
+
|
|
242
|
+
return Object.freeze({ ...index, default: defaultEntry })
|
|
243
|
+
}
|
|
244
|
+
|
|
196
245
|
function createLanguageCatalog(
|
|
197
246
|
input: ModelCatalogInput["language"]
|
|
198
247
|
): LanguageModelCatalog | undefined {
|
|
@@ -15,6 +15,7 @@ export const MODEL_KINDS = [
|
|
|
15
15
|
"transcription",
|
|
16
16
|
"speech",
|
|
17
17
|
"reranking",
|
|
18
|
+
"web-search",
|
|
18
19
|
] as const
|
|
19
20
|
|
|
20
21
|
export type ModelKind = (typeof MODEL_KINDS)[number]
|
|
@@ -26,6 +27,7 @@ export type ModelKind = (typeof MODEL_KINDS)[number]
|
|
|
26
27
|
export const TOKENLESS_MODEL_KINDS: readonly ModelKind[] = [
|
|
27
28
|
"transcription",
|
|
28
29
|
"reranking",
|
|
30
|
+
"web-search",
|
|
29
31
|
"image",
|
|
30
32
|
"speech",
|
|
31
33
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Model execution accounting
|
|
2
2
|
|
|
3
|
-
Internal execution and accounting shared by language, embedding, decision, reranking, image and speech calls. Application usage is
|
|
3
|
+
Internal execution and accounting shared by language, embedding, decision, reranking, web search, image and speech calls. Application usage is
|
|
4
4
|
documented in [Usage and limits](../../../../../docs/models/usage-and-limits.md).
|
|
5
5
|
|
|
6
6
|
## Execution boundary
|
|
@@ -78,11 +78,31 @@ and ranking validation. A complete permutation with finite scores is required; t
|
|
|
78
78
|
candidate order. `RerankingModelResponseError` carries metadata from malformed billable responses.
|
|
79
79
|
|
|
80
80
|
Provider charges remain distinct from token usage: absent tokens stay unknown. Token limits
|
|
81
|
-
neither admit nor count reranking, transcription, image or speech calls (`aiLimitMeterApplies` in
|
|
81
|
+
neither admit nor count reranking, web search, transcription, image or speech calls (`aiLimitMeterApplies` in
|
|
82
82
|
the limit storage helpers), so their unmetered records cannot make a token meter unavailable. Reported
|
|
83
83
|
costs reconcile monetary reservations; missing tariffs fail admission under cost limits. Recovery
|
|
84
84
|
remains the existing accounting-only replay.
|
|
85
85
|
|
|
86
|
+
## Web search flow
|
|
87
|
+
|
|
88
|
+
`web-search.ts` binds the catalog to a session the way `reranking.ts` does; an Agent run can bind
|
|
89
|
+
it to its own recorder, since it needs only a signal and accounting. The catalog's default is
|
|
90
|
+
`models.webSearch[0]`, else the default language binding's `webSearch`, else the first language
|
|
91
|
+
binding's.
|
|
92
|
+
|
|
93
|
+
The request is snapshotted, `maxResults` clamped to 1–10, and the call bounded at 30 seconds with
|
|
94
|
+
no retry. Admission reserves the binding's `estimateReservation({ maxResults })`; without one, cost
|
|
95
|
+
limits refuse the search, as they do transcription. No rate card prices a search, so its cost is
|
|
96
|
+
what the provider reports. The call is recorded before its hits are checked: a malformed reply, or
|
|
97
|
+
a `WebSearchModelResponseError` carrying its metadata, is still accounted. Results must be a list of
|
|
98
|
+
hits with a title and a snippet; a hit without an http(s) URL is dropped, not the reply. Sixb cuts
|
|
99
|
+
snippets to 300 characters and keeps only dates that parse.
|
|
100
|
+
|
|
101
|
+
A search that fails without a reply (an HTTP error, a network failure, the timeout, an abort) is
|
|
102
|
+
not recorded: whether it was billed is unknown, so its reservation is kept as unknown, as for a
|
|
103
|
+
language call. An unpriced record would leave every cost limit unable to count, refusing each call
|
|
104
|
+
it covers until the period ends.
|
|
105
|
+
|
|
86
106
|
## Decision flow
|
|
87
107
|
|
|
88
108
|
Decision evaluation in `../decision/runtime.ts` uses the same session and recorder. It snapshots JSON input/questions
|
|
@@ -151,7 +151,7 @@ export class AiModelCallRecorder {
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
/** Keep an unresolved reservation when an attempted call's billable outcome is unknown. */
|
|
154
|
-
|
|
154
|
+
async markCallUnknown(callId: string): Promise<void> {
|
|
155
155
|
if (!this.reservations.has(callId)) return
|
|
156
156
|
await this.input.limits.markModelCallUnknown({
|
|
157
157
|
projectId: this.input.projectId,
|