@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
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
requestAgentRunCancel2,
|
|
24
24
|
listSubagentThreadRuns2,
|
|
25
25
|
subagentSandboxFiles2
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-a5v4gjdx.js";
|
|
27
27
|
import {
|
|
28
28
|
createSixbError2,
|
|
29
29
|
captureSixbFailure2,
|
|
@@ -31,20 +31,28 @@ import {
|
|
|
31
31
|
} from "./chunk-escedwyt.js";
|
|
32
32
|
import {
|
|
33
33
|
principalsEqual2
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-s7j8ewqv.js";
|
|
35
35
|
import {
|
|
36
36
|
resolveAgentPropertyClearance2,
|
|
37
37
|
resolveAgentExecutionAuthorization2,
|
|
38
38
|
userCanRunAgent2,
|
|
39
39
|
resolveInheritedAgentExecutionAuthorization2
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-0j3crh1w.js";
|
|
41
|
+
import {
|
|
42
|
+
indexModelBindings,
|
|
43
|
+
WebSearchModelResponseError2,
|
|
44
|
+
MAX_WEB_SEARCH_RESULTS,
|
|
45
|
+
assertWebSearchModel,
|
|
46
|
+
validateWebSearchHits,
|
|
47
|
+
estimateModelCall
|
|
48
|
+
} from "./chunk-qttqe1ah.js";
|
|
41
49
|
import {
|
|
42
50
|
AgentStorageError2,
|
|
43
51
|
createSubagentRunId2,
|
|
44
52
|
createSubagentThreadId2,
|
|
45
53
|
createSubagentExecutionId2,
|
|
46
54
|
createAgentRunExecutionToken2
|
|
47
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-7z5rkf0m.js";
|
|
48
56
|
import {
|
|
49
57
|
ARTIFACT_LIMITS2
|
|
50
58
|
} from "./chunk-hz5d43gn.js";
|
|
@@ -59,7 +67,7 @@ import {
|
|
|
59
67
|
agentRunFinishedEvent2,
|
|
60
68
|
agentRunStreamEventBase2,
|
|
61
69
|
agentRunStreamIdempotencyKey2
|
|
62
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-wkq3kvzd.js";
|
|
63
71
|
import {
|
|
64
72
|
ArtifactRequestError2
|
|
65
73
|
} from "./chunk-kwfhd1g0.js";
|
|
@@ -70,12 +78,12 @@ import {
|
|
|
70
78
|
artifactVersionWarnings2,
|
|
71
79
|
artifactAccessRule2,
|
|
72
80
|
artifactQueryChecker2
|
|
73
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-j8thxj7w.js";
|
|
74
82
|
import {
|
|
75
83
|
ModelUsageRecordingError2,
|
|
76
84
|
createAiModelCallLimitController2,
|
|
77
85
|
AiModelCallRecorder2
|
|
78
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-ga63a3dz.js";
|
|
79
87
|
import {
|
|
80
88
|
renderOntologyDocs2
|
|
81
89
|
} from "./chunk-5taem5aw.js";
|
|
@@ -92,10 +100,10 @@ import {
|
|
|
92
100
|
} from "./chunk-e5wf5vz0.js";
|
|
93
101
|
import {
|
|
94
102
|
ensureExecutionRecord2
|
|
95
|
-
} from "./chunk-
|
|
103
|
+
} from "./chunk-9whfmsfk.js";
|
|
96
104
|
import {
|
|
97
105
|
resolveLanguageModel2
|
|
98
|
-
} from "./chunk-
|
|
106
|
+
} from "./chunk-3723kgba.js";
|
|
99
107
|
import {
|
|
100
108
|
RuntimeError2
|
|
101
109
|
} from "./chunk-m4ehq95f.js";
|
|
@@ -113,7 +121,7 @@ import {
|
|
|
113
121
|
AGENT_TOKEN_RATE_SAMPLES2,
|
|
114
122
|
AGENT_TOKEN_RATE_MIN_BYTES_PER_TOKEN2,
|
|
115
123
|
AGENT_TOKEN_RATE_MAX_BYTES_PER_TOKEN
|
|
116
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-n4zzaf6q.js";
|
|
117
125
|
import {
|
|
118
126
|
openFileRef2
|
|
119
127
|
} from "./chunk-a3faa34j.js";
|
|
@@ -505,10 +513,248 @@ function listMessageAttachments2(message) {
|
|
|
505
513
|
] : []);
|
|
506
514
|
});
|
|
507
515
|
}
|
|
516
|
+
// src/models/execution/web-search.ts
|
|
517
|
+
import { randomUUID } from "crypto";
|
|
518
|
+
function bindWebSearchModels(catalog, session) {
|
|
519
|
+
if (!catalog)
|
|
520
|
+
return;
|
|
521
|
+
const index = indexModelBindings(catalog.list().map(({ model }) => Object.freeze({
|
|
522
|
+
providerId: model.providerId,
|
|
523
|
+
modelId: model.modelId,
|
|
524
|
+
definition: model.definition,
|
|
525
|
+
search: (input) => executeWebSearch(session, model, input)
|
|
526
|
+
})), "webSearch", assertWebSearchModel);
|
|
527
|
+
const defaultEntry = index.getByRef(catalog.default);
|
|
528
|
+
if (!defaultEntry)
|
|
529
|
+
throw new Error("[SixbModels] The default web search model is not listed.");
|
|
530
|
+
return Object.freeze({ ...index, default: defaultEntry });
|
|
531
|
+
}
|
|
532
|
+
async function executeWebSearch(session, binding, input) {
|
|
533
|
+
const request = prepareRequest(input);
|
|
534
|
+
const signal = AbortSignal.any([session.signal(input.signal), AbortSignal.timeout(30000)]);
|
|
535
|
+
signal.throwIfAborted();
|
|
536
|
+
const accounting = await session.accounting();
|
|
537
|
+
accounting.assertHealthy();
|
|
538
|
+
const model = await binding.resolve?.() ?? binding;
|
|
539
|
+
assertWebSearchModel(model);
|
|
540
|
+
if (model.providerId !== binding.providerId || model.modelId !== binding.modelId) {
|
|
541
|
+
throw new TypeError("[SixbModels] Resolved web search model identity does not match its binding.");
|
|
542
|
+
}
|
|
543
|
+
signal.throwIfAborted();
|
|
544
|
+
const callId = `call_${randomUUID()}`;
|
|
545
|
+
await accounting.admitCall({
|
|
546
|
+
callId,
|
|
547
|
+
providerId: model.providerId,
|
|
548
|
+
modelId: model.modelId,
|
|
549
|
+
modelKind: "web-search",
|
|
550
|
+
inputTokens: {
|
|
551
|
+
status: "estimated",
|
|
552
|
+
tokens: Math.ceil(new TextEncoder().encode(request.query).byteLength / 4),
|
|
553
|
+
method: "utf8BytesDividedByFour"
|
|
554
|
+
},
|
|
555
|
+
outputTokenAllowance: 0,
|
|
556
|
+
reservationCost: estimateReservationCost(model, request.maxResults)
|
|
557
|
+
});
|
|
558
|
+
let result;
|
|
559
|
+
try {
|
|
560
|
+
signal.throwIfAborted();
|
|
561
|
+
result = await model.search({ ...request, signal });
|
|
562
|
+
} catch (error) {
|
|
563
|
+
if (error instanceof WebSearchModelResponseError2) {
|
|
564
|
+
await recordWebSearch(accounting, model, callId, error.metadata);
|
|
565
|
+
} else {
|
|
566
|
+
await accounting.markCallUnknown(callId);
|
|
567
|
+
}
|
|
568
|
+
throw error;
|
|
569
|
+
}
|
|
570
|
+
await recordWebSearch(accounting, model, callId, result ?? {});
|
|
571
|
+
signal.throwIfAborted();
|
|
572
|
+
try {
|
|
573
|
+
return { ...result, results: validateWebSearchHits(result?.results, request.maxResults) };
|
|
574
|
+
} catch (cause) {
|
|
575
|
+
throw new WebSearchModelResponseError2("[SixbModels] Invalid web search response.", model.providerId, model.modelId, result ?? {}, { cause });
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
function prepareRequest(input) {
|
|
579
|
+
const query = input?.query;
|
|
580
|
+
if (typeof query !== "string" || !query.trim()) {
|
|
581
|
+
throw new TypeError("[SixbModels] Web search requires a nonempty query.");
|
|
582
|
+
}
|
|
583
|
+
const maxResults = input.maxResults;
|
|
584
|
+
if (typeof maxResults !== "number" || !Number.isSafeInteger(maxResults)) {
|
|
585
|
+
throw new TypeError("[SixbModels] Web search maxResults must be an integer.");
|
|
586
|
+
}
|
|
587
|
+
const allowedDomains = domains(input.allowedDomains, "allowedDomains");
|
|
588
|
+
const blockedDomains = domains(input.blockedDomains, "blockedDomains");
|
|
589
|
+
return {
|
|
590
|
+
query: query.trim(),
|
|
591
|
+
maxResults: Math.min(Math.max(maxResults, 1), MAX_WEB_SEARCH_RESULTS),
|
|
592
|
+
...allowedDomains === undefined ? {} : { allowedDomains },
|
|
593
|
+
...blockedDomains === undefined ? {} : { blockedDomains }
|
|
594
|
+
};
|
|
595
|
+
}
|
|
596
|
+
function domains(value, field) {
|
|
597
|
+
if (value === undefined)
|
|
598
|
+
return;
|
|
599
|
+
if (!Array.isArray(value) || value.some((entry) => typeof entry !== "string" || !entry.trim())) {
|
|
600
|
+
throw new TypeError(`[SixbModels] Web search ${field} must contain nonempty strings.`);
|
|
601
|
+
}
|
|
602
|
+
return Object.freeze([...value]);
|
|
603
|
+
}
|
|
604
|
+
function estimateReservationCost(model, maxResults) {
|
|
605
|
+
try {
|
|
606
|
+
return model.costEstimator?.estimateReservation?.({ maxResults });
|
|
607
|
+
} catch {
|
|
608
|
+
return;
|
|
609
|
+
}
|
|
610
|
+
}
|
|
611
|
+
async function recordWebSearch(accounting, model, callId, metadata) {
|
|
612
|
+
const usage = metadata.usage ?? {};
|
|
613
|
+
const estimate = estimateModelCall(model, {
|
|
614
|
+
usage,
|
|
615
|
+
route: metadata.route,
|
|
616
|
+
responseModelId: metadata.responseModelId
|
|
617
|
+
});
|
|
618
|
+
await accounting.onModelCallEnd({
|
|
619
|
+
callId,
|
|
620
|
+
modelKind: "web-search",
|
|
621
|
+
providerId: model.providerId,
|
|
622
|
+
modelId: model.modelId,
|
|
623
|
+
responseId: metadata.providerIds?.responseId ?? callId,
|
|
624
|
+
responseModelId: metadata.responseModelId,
|
|
625
|
+
providerIds: metadata.providerIds,
|
|
626
|
+
usage,
|
|
627
|
+
cost: metadata.reportedCost ? { status: "reported", ...metadata.reportedCost } : estimate,
|
|
628
|
+
...metadata.reportedCost ? { estimate } : {},
|
|
629
|
+
route: metadata.route
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
// src/agents/web.ts
|
|
634
|
+
var AGENT_WEB_TOOL_NAMES = ["web_search", "web_fetch"];
|
|
635
|
+
var MAX_DOMAINS = 1200;
|
|
636
|
+
var MAX_RULE_CHARACTERS = 4096;
|
|
637
|
+
function resolveAgentWebOptions(value) {
|
|
638
|
+
if (value === undefined || value === false)
|
|
639
|
+
return value;
|
|
640
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
641
|
+
throw new RuntimeError2("[Sixb] agent.web must be false, or { allowedDomains?, blockedDomains? }.");
|
|
642
|
+
}
|
|
643
|
+
for (const key of Object.keys(value)) {
|
|
644
|
+
if (key !== "allowedDomains" && key !== "blockedDomains") {
|
|
645
|
+
throw new RuntimeError2(`[Sixb] agent.web has an unknown option '${key}': use allowedDomains or blockedDomains.`);
|
|
646
|
+
}
|
|
647
|
+
}
|
|
648
|
+
const options = value;
|
|
649
|
+
const allowedDomains = canonicalRules(options.allowedDomains, "allowedDomains");
|
|
650
|
+
const blockedDomains = canonicalRules(options.blockedDomains, "blockedDomains");
|
|
651
|
+
return Object.freeze({
|
|
652
|
+
...allowedDomains ? { allowedDomains } : {},
|
|
653
|
+
...blockedDomains ? { blockedDomains } : {}
|
|
654
|
+
});
|
|
655
|
+
}
|
|
656
|
+
function assertNoProviderWebTools(models) {
|
|
657
|
+
const offered = models?.webSearch ? AGENT_WEB_TOOL_NAMES : ["web_fetch"];
|
|
658
|
+
for (const { provider, modelId, model } of models?.language?.list() ?? []) {
|
|
659
|
+
const name = model.providerToolNames?.find((tool) => offered.includes(tool));
|
|
660
|
+
if (name === undefined)
|
|
661
|
+
continue;
|
|
662
|
+
throw new RuntimeError2(`[Sixb] Language model '${provider}/${modelId}' declares the provider tool '${name}', a name Sixb gives the Agent's own web tool. Remove it from providerTools, or set agent.web: false to keep the provider's.`);
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
function webDomainPolicy2(options) {
|
|
666
|
+
const allowed = options.allowedDomains?.map((rule) => parseRule(rule, "allowedDomains"));
|
|
667
|
+
const blocked = options.blockedDomains?.map((rule) => parseRule(rule, "blockedDomains"));
|
|
668
|
+
return {
|
|
669
|
+
refuses(url) {
|
|
670
|
+
if (blocked?.some((rule) => matchesRule(url, rule)))
|
|
671
|
+
return "blocked";
|
|
672
|
+
if (allowed && !allowed.some((rule) => matchesRule(url, rule)))
|
|
673
|
+
return "not-allowed";
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function bindAgentWebSearch2(definitions, execution) {
|
|
679
|
+
const bound = bindWebSearchModels(definitions.models?.webSearch, {
|
|
680
|
+
signal: (signal) => signal ? AbortSignal.any([execution.signal, signal]) : execution.signal,
|
|
681
|
+
accounting: execution.accounting
|
|
682
|
+
});
|
|
683
|
+
return async (request, signal) => {
|
|
684
|
+
if (definitions.agent.web === false) {
|
|
685
|
+
throw createSixbError2("agent.execution_failed", "[Sixb] The Agent's web tools are off: agent.web is false.");
|
|
686
|
+
}
|
|
687
|
+
if (!bound) {
|
|
688
|
+
throw createSixbError2("agent.execution_failed", "[Sixb] The project has no web search model: set models.webSearch, or use a language model that offers one.");
|
|
689
|
+
}
|
|
690
|
+
return bound.default.model.search({ ...request, signal });
|
|
691
|
+
};
|
|
692
|
+
}
|
|
693
|
+
function canonicalRules(value, field) {
|
|
694
|
+
if (value === undefined)
|
|
695
|
+
return;
|
|
696
|
+
if (!Array.isArray(value) || value.length < 1 || value.length > MAX_DOMAINS) {
|
|
697
|
+
throw new RuntimeError2(`[Sixb] agent.web.${field} must list from 1 to ${MAX_DOMAINS} domains.`);
|
|
698
|
+
}
|
|
699
|
+
const rules = new Set;
|
|
700
|
+
for (const entry of value)
|
|
701
|
+
rules.add(canonicalRule(parseRule(entry, field)));
|
|
702
|
+
return Object.freeze([...rules]);
|
|
703
|
+
}
|
|
704
|
+
function parseRule(value, field) {
|
|
705
|
+
if (typeof value !== "string")
|
|
706
|
+
throw invalidRule(field, value);
|
|
707
|
+
const trimmed = value.trim();
|
|
708
|
+
if (!trimmed || trimmed.length > MAX_RULE_CHARACTERS || /[\\?#]/.test(trimmed)) {
|
|
709
|
+
throw invalidRule(field, value);
|
|
710
|
+
}
|
|
711
|
+
const wildcard = trimmed.startsWith("*.");
|
|
712
|
+
const filter = wildcard ? trimmed.slice(2) : trimmed;
|
|
713
|
+
const authority = filter.split("/", 1)[0] ?? "";
|
|
714
|
+
if (!authority || /[*:@]/.test(authority))
|
|
715
|
+
throw invalidRule(field, value);
|
|
716
|
+
let parsed;
|
|
717
|
+
try {
|
|
718
|
+
parsed = new URL(`https://${filter}`);
|
|
719
|
+
} catch {
|
|
720
|
+
throw invalidRule(field, value);
|
|
721
|
+
}
|
|
722
|
+
const hostname = canonicalHostname(parsed.hostname);
|
|
723
|
+
if (!isValidHostname(hostname))
|
|
724
|
+
throw invalidRule(field, value);
|
|
725
|
+
const pathPrefix = parsed.pathname.replace(/\/+$/, "");
|
|
726
|
+
return { hostname, wildcard, ...pathPrefix ? { pathPrefix } : {} };
|
|
727
|
+
}
|
|
728
|
+
function canonicalRule(rule) {
|
|
729
|
+
return `${rule.wildcard ? "*." : ""}${rule.hostname}${rule.pathPrefix ?? ""}`;
|
|
730
|
+
}
|
|
731
|
+
function matchesRule(url, rule) {
|
|
732
|
+
const hostname = canonicalHostname(url.hostname);
|
|
733
|
+
const hostnameMatches = rule.wildcard ? hostname !== rule.hostname && hostname.endsWith(`.${rule.hostname}`) : hostname === rule.hostname;
|
|
734
|
+
if (!hostnameMatches)
|
|
735
|
+
return false;
|
|
736
|
+
if (!rule.pathPrefix)
|
|
737
|
+
return true;
|
|
738
|
+
return url.pathname === rule.pathPrefix || url.pathname.startsWith(`${rule.pathPrefix}/`);
|
|
739
|
+
}
|
|
740
|
+
function canonicalHostname(value) {
|
|
741
|
+
return value.toLowerCase().replace(/\.$/, "");
|
|
742
|
+
}
|
|
743
|
+
function isValidHostname(hostname) {
|
|
744
|
+
if (!hostname || hostname.length > 253)
|
|
745
|
+
return false;
|
|
746
|
+
return hostname.split(".").every((label) => label.length >= 1 && label.length <= 63 && /^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(label));
|
|
747
|
+
}
|
|
748
|
+
function invalidRule(field, value) {
|
|
749
|
+
return new RuntimeError2(`[Sixb] agent.web.${field} has an invalid entry ${JSON.stringify(value)}: write a domain such as 'example.com', '*.example.com' or 'example.com/docs', without a scheme, port, query or credentials.`);
|
|
750
|
+
}
|
|
751
|
+
|
|
508
752
|
// src/agents/validation.ts
|
|
509
753
|
var AGENT_TOOL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/;
|
|
510
754
|
var AGENT_RESERVED_TOOL_NAMES2 = [
|
|
511
755
|
"bash",
|
|
756
|
+
"bash_output",
|
|
757
|
+
"bash_stop",
|
|
512
758
|
"read",
|
|
513
759
|
"view_file",
|
|
514
760
|
"spawn_agent",
|
|
@@ -516,7 +762,8 @@ var AGENT_RESERVED_TOOL_NAMES2 = [
|
|
|
516
762
|
"message_agent",
|
|
517
763
|
"ask_parent",
|
|
518
764
|
"publish_artifact",
|
|
519
|
-
"publish_artifact_version"
|
|
765
|
+
"publish_artifact_version",
|
|
766
|
+
...AGENT_WEB_TOOL_NAMES
|
|
520
767
|
];
|
|
521
768
|
function isAgentToolDefinition2(value) {
|
|
522
769
|
return isRecord(value) && value.kind === "agentTool" && typeof value.name === "string" && typeof value.description === "string" && isPlainRecord(value.input) && typeof value.handler === "function";
|
|
@@ -525,6 +772,9 @@ function assertValidAgentToolName(name) {
|
|
|
525
772
|
if (typeof name !== "string" || !AGENT_TOOL_NAME_PATTERN.test(name)) {
|
|
526
773
|
throw new AgentDefinitionError2("[Sixb] Agent tool name must be 1-64 characters, start with a letter or underscore, and contain only letters, numbers, underscores, or hyphens.");
|
|
527
774
|
}
|
|
775
|
+
if (AGENT_WEB_TOOL_NAMES.includes(name)) {
|
|
776
|
+
throw new AgentDefinitionError2(`[Sixb] Agent tool name '${name}' is reserved: Sixb gives the Agent its own ${name} tool. To search with Exa, set models.webSearch: [exaSearch(...)].`);
|
|
777
|
+
}
|
|
528
778
|
if (AGENT_RESERVED_TOOL_NAMES2.includes(name)) {
|
|
529
779
|
throw new AgentDefinitionError2(`[Sixb] Agent tool name '${name}' is reserved by the framework.`);
|
|
530
780
|
}
|
|
@@ -2136,13 +2386,13 @@ function agentToolFilePath2(toolCallId, fileRef, fileName) {
|
|
|
2136
2386
|
const digestKey = fileRef.digest.slice("sha256:".length, "sha256:".length + 12);
|
|
2137
2387
|
return posix2.join("tool-files", callKey, `${digestKey}-${fileName}`);
|
|
2138
2388
|
}
|
|
2139
|
-
function agentToolOutputPath2(toolCallId, sha256) {
|
|
2389
|
+
function agentToolOutputPath2(toolCallId, sha256, extension = "txt") {
|
|
2140
2390
|
const call = SAFE_CALL_ID.test(toolCallId) ? toolCallId : createHash("sha256").update(toolCallId).digest("hex").slice(0, 16);
|
|
2141
|
-
return `${AGENT_TOOL_OUTPUTS_DIRECTORY2}/${call}-${sha256.slice(0, 12)}
|
|
2391
|
+
return `${AGENT_TOOL_OUTPUTS_DIRECTORY2}/${call}-${sha256.slice(0, 12)}.${extension}`;
|
|
2142
2392
|
}
|
|
2143
2393
|
var AGENT_TOOL_OUTPUTS_DIRECTORY2 = "tool-outputs";
|
|
2144
2394
|
var SAFE_CALL_ID = /^[A-Za-z0-9_-]{1,128}$/;
|
|
2145
|
-
var TOOL_OUTPUT_PATH = /^tool-outputs\/[A-Za-z0-9_-]{1,128}-([0-9a-f]{12})\.txt$/;
|
|
2395
|
+
var TOOL_OUTPUT_PATH = /^tool-outputs\/[A-Za-z0-9_-]{1,128}-([0-9a-f]{12})\.(?:txt|md|pdf|png|jpg|gif|webp)$/;
|
|
2146
2396
|
function isAgentToolOutputFile2(value) {
|
|
2147
2397
|
if (typeof value !== "object" || value === null)
|
|
2148
2398
|
return false;
|
|
@@ -2245,11 +2495,13 @@ function assertMaxSteps(value, name) {
|
|
|
2245
2495
|
// src/agents/run-plan.ts
|
|
2246
2496
|
function readAgentRunPlan2(definitions, run, view) {
|
|
2247
2497
|
const { agent, models, tools } = definitions;
|
|
2498
|
+
const web = readAgentRunWebPlan2(definitions);
|
|
2248
2499
|
const shared = {
|
|
2249
2500
|
...agent.instructions === undefined ? {} : { instructions: agent.instructions },
|
|
2250
2501
|
skills: agent.skills.list(),
|
|
2251
2502
|
sandboxModels: listSandboxModels2(models),
|
|
2252
|
-
ontologyDocs: renderAgentRunOntologyDocs2({ ...view, catalog: agent.ontologyDocs })
|
|
2503
|
+
ontologyDocs: renderAgentRunOntologyDocs2({ ...view, catalog: agent.ontologyDocs }),
|
|
2504
|
+
...web === undefined ? {} : { web }
|
|
2253
2505
|
};
|
|
2254
2506
|
const subagentMaxSteps = agent.subagentMaxSteps ?? UNATTENDED_AGENT_MAX_STEPS2;
|
|
2255
2507
|
if (run.kind === "subagent") {
|
|
@@ -2286,6 +2538,17 @@ function readAgentRunPlan2(definitions, run, view) {
|
|
|
2286
2538
|
...spec?.locale === undefined ? {} : { locale: spec.locale }
|
|
2287
2539
|
});
|
|
2288
2540
|
}
|
|
2541
|
+
function readAgentRunWebPlan2(definitions) {
|
|
2542
|
+
const { web } = definitions.agent;
|
|
2543
|
+
if (web === false)
|
|
2544
|
+
return;
|
|
2545
|
+
const search = definitions.models?.webSearch?.default;
|
|
2546
|
+
return Object.freeze({
|
|
2547
|
+
...search ? { search: { provider: search.provider, modelId: search.modelId } } : {},
|
|
2548
|
+
...web?.allowedDomains ? { allowedDomains: web.allowedDomains } : {},
|
|
2549
|
+
...web?.blockedDomains ? { blockedDomains: web.blockedDomains } : {}
|
|
2550
|
+
});
|
|
2551
|
+
}
|
|
2289
2552
|
function listSandboxModels2(models) {
|
|
2290
2553
|
const language = (models?.language?.list() ?? []).map((entry) => {
|
|
2291
2554
|
const { name, description } = entry.model.definition;
|
|
@@ -2596,6 +2859,10 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
2596
2859
|
});
|
|
2597
2860
|
return toolsBound;
|
|
2598
2861
|
};
|
|
2862
|
+
const webSearch = bindAgentWebSearch2(host.definitions, {
|
|
2863
|
+
signal: AbortSignal.any([cancelled, ended.signal, ...stop ? [stop] : []]),
|
|
2864
|
+
accounting: openedModelCalls
|
|
2865
|
+
});
|
|
2599
2866
|
let logs;
|
|
2600
2867
|
let toolLabels;
|
|
2601
2868
|
const toolLogger = async () => {
|
|
@@ -2645,7 +2912,7 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
2645
2912
|
pausesAfterStep: () => turnPausesOnHeldCalls2(host.storage.agents, run)
|
|
2646
2913
|
},
|
|
2647
2914
|
models: {
|
|
2648
|
-
async language(ref) {
|
|
2915
|
+
async language(ref, options) {
|
|
2649
2916
|
const key = `${ref.provider}/${ref.modelId}`;
|
|
2650
2917
|
let resolved = languageModels.get(key);
|
|
2651
2918
|
if (!resolved) {
|
|
@@ -2657,12 +2924,16 @@ async function openAgentRunSession2(host, run, cancelWith = [], stop) {
|
|
|
2657
2924
|
languageModels.set(key, resolved);
|
|
2658
2925
|
resolved.catch(() => languageModels.delete(key));
|
|
2659
2926
|
}
|
|
2660
|
-
|
|
2927
|
+
const recorded = (await openedModelCalls()).wrapModel(await resolved);
|
|
2928
|
+
if (options?.measures === false)
|
|
2929
|
+
return recorded;
|
|
2930
|
+
return measuringAgentContextTokenRates2(recorded, {
|
|
2661
2931
|
tokenRates: agents.tokenRates,
|
|
2662
2932
|
projectId: host.projectId,
|
|
2663
2933
|
runId: run.id
|
|
2664
2934
|
});
|
|
2665
|
-
}
|
|
2935
|
+
},
|
|
2936
|
+
webSearch
|
|
2666
2937
|
},
|
|
2667
2938
|
async renewLease(leaseExpiresAt) {
|
|
2668
2939
|
try {
|
|
@@ -3172,16 +3443,17 @@ function createHttpAgentRunSession2(input) {
|
|
|
3172
3443
|
executionToken,
|
|
3173
3444
|
cancelled: cancelled.signal,
|
|
3174
3445
|
models: {
|
|
3175
|
-
language(ref) {
|
|
3446
|
+
async language(ref, options) {
|
|
3176
3447
|
const key = `${ref.provider}/${ref.modelId}`;
|
|
3177
|
-
let
|
|
3178
|
-
if (!
|
|
3179
|
-
|
|
3180
|
-
|
|
3181
|
-
models.set(key,
|
|
3448
|
+
let described = models.get(key);
|
|
3449
|
+
if (!described) {
|
|
3450
|
+
described = call("models.describe", [ref]);
|
|
3451
|
+
described.catch(() => models.delete(key));
|
|
3452
|
+
models.set(key, described);
|
|
3182
3453
|
}
|
|
3183
|
-
return
|
|
3184
|
-
}
|
|
3454
|
+
return httpModel(await described, ref, request, options?.measures !== false);
|
|
3455
|
+
},
|
|
3456
|
+
webSearch: (request, signal) => call("models.webSearch", [request], signal)
|
|
3185
3457
|
},
|
|
3186
3458
|
events: sink.sink,
|
|
3187
3459
|
heldCalls: {
|
|
@@ -3321,14 +3593,14 @@ async function result(response) {
|
|
|
3321
3593
|
throw decodeWireError(body.error);
|
|
3322
3594
|
return body.result;
|
|
3323
3595
|
}
|
|
3324
|
-
function httpModel(described, ref, request) {
|
|
3596
|
+
function httpModel(described, ref, request, measures) {
|
|
3325
3597
|
return {
|
|
3326
3598
|
...described,
|
|
3327
3599
|
async stream({ signal, ...call }) {
|
|
3328
3600
|
const response = await request("models.stream", {
|
|
3329
3601
|
method: "POST",
|
|
3330
3602
|
headers: { "content-type": "application/json" },
|
|
3331
|
-
body: encodeWireValue2({ ref, call }),
|
|
3603
|
+
body: encodeWireValue2({ ref, call, ...measures ? {} : { measures: false } }),
|
|
3332
3604
|
signal
|
|
3333
3605
|
});
|
|
3334
3606
|
if (!response.ok || !response.body)
|
|
@@ -3507,6 +3779,7 @@ var OPERATIONS = {
|
|
|
3507
3779
|
const { providerId, modelId, definition, rateCard, defaultReasoning, maxOutputTokens } = model;
|
|
3508
3780
|
return { providerId, modelId, definition, rateCard, defaultReasoning, maxOutputTokens };
|
|
3509
3781
|
},
|
|
3782
|
+
"models.webSearch": (session, [request], signal) => session.models.webSearch(request, signal),
|
|
3510
3783
|
"files.stat": (session, [blobId]) => session.files.stat(blobId)
|
|
3511
3784
|
};
|
|
3512
3785
|
async function serveAgentRunSession2(host, request, options = {}) {
|
|
@@ -3680,8 +3953,8 @@ function withSavedOutputChecked(part) {
|
|
|
3680
3953
|
return rest;
|
|
3681
3954
|
}
|
|
3682
3955
|
async function streamModelCall(session, request) {
|
|
3683
|
-
const { ref, call } = decodeWireValue2(await readBodyText(request));
|
|
3684
|
-
const model = await session.models.language(ref);
|
|
3956
|
+
const { ref, call, measures } = decodeWireValue2(await readBodyText(request));
|
|
3957
|
+
const model = await session.models.language(ref, { measures: measures !== false });
|
|
3685
3958
|
const opened = await model.stream({ ...call, signal: request.signal });
|
|
3686
3959
|
const encoder = new TextEncoder;
|
|
3687
3960
|
const iterator = opened.events[Symbol.asyncIterator]();
|
|
@@ -4044,6 +4317,6 @@ function requireFinishedAt(record) {
|
|
|
4044
4317
|
}
|
|
4045
4318
|
return record.finishedAt;
|
|
4046
4319
|
}
|
|
4047
|
-
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4320
|
+
export { serializeAgentContextForModel2, isAgentToolResult2, toModelMessages2, agentMessageSteps2, attachmentKey2, toolResultAttachmentKey2, attachmentKeyMessageId2, findMessageAttachment2, listMessageAttachments2, resolveAgentWebOptions, assertNoProviderWebTools, webDomainPolicy2, bindAgentWebSearch2, AGENT_RESERVED_TOOL_NAMES2, isAgentToolDefinition2, validateAndNormalizeAgentToolInput2, toolsFromProjectConfig, defineAgentTool2, AGENT_INLINE_IMAGE_LIMITS2, AGENT_IMAGE_INPUT_TOKENS2, projectAgentThreadModelContext2, AGENT_CONTEXT_ESTIMATOR_VERSION2, shouldCompactAgentContext2, estimateAgentContextRequestTokens2, estimateAgentContextMessagesTokens2, agentContextSizeTokens2, measureAgentModelRequest2, measureModelRequest2, selectAgentContextCompactionBoundary2, measureAgentContextTokenRate2, calibrateAgentContextBytesPerToken2, learnedAgentContextBytesPerToken2, readAgentContextTokenRates2, measuringAgentContextTokenRates2, DEFAULT_AGENT_CONTEXT_WINDOW_TOKENS2, AGENT_CONTEXT_COMPACTED_SHARE2, AGENT_IDLE_COMPACTION_TOKENS2, agentOutputCapTokens2, resolveAgentContextBudget2, contextSummaryOutputTokens2, measureAgentStepRequest2, estimateAgentThreadRequest2, readAgentThreadContextUse2, agent2, afterAgentRunFinished2, stopAgentRunChild2, AgentExecutionLostError2, AgentRunRefusedError2, isTerminalOrExecutionGone2, agentRunArtifacts2, NOOP_STREAM_SINK2, createBrokerStreamSink2, isolateStreamSink2, withAgentActivityStream2, SANDBOX_CONTEXT_DIRECTORY2, AGENT_FILE_MAX_BYTES2, storeAgentToolFile2, agentToolFilePath2, agentToolOutputPath2, AGENT_TOOL_OUTPUTS_DIRECTORY2, isAgentToolOutputFile2, agentToolSpec2, runAgentTool2, threadToolAttachments2, UNATTENDED_AGENT_MAX_STEPS2, assertMaxSteps, readAgentRunPlan2, readAgentRunWebPlan2, listSandboxModels2, readAgentRunMemory2, renderAgentRunOntologyDocs2, readAgentRunDelegation2, claimAgentRun2, openAgentRunSession2, agentRunPeople2, watchAgentRunCancel2, AgentFinalizationError2, AgentTurnInterruptedError2, interruptedError2, agentRunLeaseLapsed2, endInterruptedAgentRun2, endLapsedAgentRuns2, encodeWireValue2, decodeWireValue2, encodeWireError2, createHttpAgentRunSession2, claimAgentRunOverHttp2, claimAgentRunChildOverHttp2, AGENT_API_ROUTES2, createAgentRunToken2, isAgentRunToken2, agentRunTokenRunId2, isValidAgentRunToken2, createAgentRunnerToken2, isAgentRunnerToken2, isAllowedAgentApiRequest2, findAgentApiRoute2, serveAgentRunSession2, claimAgentRunForRunner2, WorkflowResumeDispatchError2, claimWorkflowAgentNode2, enqueueWorkflowAgentNodeResume2 };
|
|
4048
4321
|
|
|
4049
|
-
//# debugId=
|
|
4322
|
+
//# debugId=21D2D9D1B87AF76E64756E2164756E21
|