@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.
Files changed (264) hide show
  1. package/dist/actions/index.js +29 -29
  2. package/dist/agents/cancel.d.ts.map +1 -1
  3. package/dist/agents/index.d.ts +5 -3
  4. package/dist/agents/index.d.ts.map +1 -1
  5. package/dist/agents/index.js +38 -32
  6. package/dist/agents/index.js.map +1 -1
  7. package/dist/agents/run-plan.d.ts +15 -1
  8. package/dist/agents/run-plan.d.ts.map +1 -1
  9. package/dist/agents/run-session-http.d.ts.map +1 -1
  10. package/dist/agents/run-session-serve.d.ts.map +1 -1
  11. package/dist/agents/run-session.d.ts +14 -2
  12. package/dist/agents/run-session.d.ts.map +1 -1
  13. package/dist/agents/skills.d.ts +3 -0
  14. package/dist/agents/skills.d.ts.map +1 -1
  15. package/dist/agents/step-limits.d.ts +6 -0
  16. package/dist/agents/step-limits.d.ts.map +1 -1
  17. package/dist/agents/streams/index.js +1 -1
  18. package/dist/agents/streams/internal.js +1 -1
  19. package/dist/agents/streams/protocol.d.ts +8 -2
  20. package/dist/agents/streams/protocol.d.ts.map +1 -1
  21. package/dist/agents/tool-files.d.ts +3 -1
  22. package/dist/agents/tool-files.d.ts.map +1 -1
  23. package/dist/agents/validation.d.ts +1 -1
  24. package/dist/agents/validation.d.ts.map +1 -1
  25. package/dist/agents/web.d.ts +47 -0
  26. package/dist/agents/web.d.ts.map +1 -0
  27. package/dist/artifacts/publish/index.js +16 -16
  28. package/dist/auth/index.js +3 -3
  29. package/dist/authorization/index.js +2 -2
  30. package/dist/authorization/resolve.d.ts +4 -3
  31. package/dist/authorization/resolve.d.ts.map +1 -1
  32. package/dist/authorization/types.d.ts +5 -5
  33. package/dist/authorization/types.d.ts.map +1 -1
  34. package/dist/bootstrap/index.js +34 -34
  35. package/dist/{chunk-neftrg0n.js → chunk-0j3crh1w.js} +2 -2
  36. package/dist/{chunk-tvbmh7tj.js → chunk-2ajw5rz0.js} +14 -10
  37. package/dist/chunk-2ajw5rz0.js.map +18 -0
  38. package/dist/{chunk-23s66j86.js → chunk-31kcqmhf.js} +1 -1
  39. package/dist/{chunk-nghc7eq0.js → chunk-3723kgba.js} +1 -1
  40. package/dist/{chunk-rjeeyssy.js → chunk-3sqqhpr7.js} +4 -4
  41. package/dist/{chunk-m3qe54bb.js → chunk-4bm0caep.js} +1 -1
  42. package/dist/{chunk-h05rg3bx.js → chunk-4s753g3k.js} +3 -3
  43. package/dist/{chunk-8wsjr52f.js → chunk-5wtnmpze.js} +1 -1
  44. package/dist/{chunk-edx8xcsm.js → chunk-7z5rkf0m.js} +29 -6
  45. package/dist/chunk-7z5rkf0m.js.map +13 -0
  46. package/dist/{chunk-2pk5hjj9.js → chunk-80gym75n.js} +1 -1
  47. package/dist/{chunk-qbrmpgvv.js → chunk-9whfmsfk.js} +1 -1
  48. package/dist/{chunk-z3evap21.js → chunk-a5v4gjdx.js} +27 -26
  49. package/dist/{chunk-z3evap21.js.map → chunk-a5v4gjdx.js.map} +3 -3
  50. package/dist/{chunk-w53trr0c.js → chunk-a7aa0nzj.js} +5 -5
  51. package/dist/{chunk-tvefbgvw.js → chunk-az95tsh3.js} +4 -2
  52. package/dist/chunk-az95tsh3.js.map +11 -0
  53. package/dist/{chunk-7hd2ez3q.js → chunk-c4nrycdy.js} +1 -1
  54. package/dist/{chunk-epyfm23v.js → chunk-c706qvyc.js} +3 -3
  55. package/dist/{chunk-t5daew4g.js → chunk-c7cfe31p.js} +6 -6
  56. package/dist/{chunk-qsg8rw04.js → chunk-d04g36fw.js} +1 -1
  57. package/dist/{chunk-ratj7t3t.js → chunk-dsv783c3.js} +305 -32
  58. package/dist/{chunk-ratj7t3t.js.map → chunk-dsv783c3.js.map} +12 -10
  59. package/dist/{chunk-cb21tx14.js → chunk-eqgr6nsa.js} +81 -25
  60. package/dist/{chunk-cb21tx14.js.map → chunk-eqgr6nsa.js.map} +8 -7
  61. package/dist/{chunk-ax10ft8d.js → chunk-f1h34y3r.js} +5 -5
  62. package/dist/{chunk-9rh8ncs5.js → chunk-fwsvshr5.js} +1 -1
  63. package/dist/{chunk-b7a97n8b.js → chunk-ga63a3dz.js} +6 -6
  64. package/dist/{chunk-b7a97n8b.js.map → chunk-ga63a3dz.js.map} +2 -2
  65. package/dist/{chunk-cgznz22f.js → chunk-gkv8r794.js} +2 -2
  66. package/dist/{chunk-t9xyr7y9.js → chunk-j8thxj7w.js} +3 -3
  67. package/dist/{chunk-31khg3g0.js → chunk-kkjfve0t.js} +73 -2
  68. package/dist/{chunk-31khg3g0.js.map → chunk-kkjfve0t.js.map} +3 -3
  69. package/dist/{chunk-8yzhjawq.js → chunk-m2vh8gh0.js} +8 -14
  70. package/dist/{chunk-8yzhjawq.js.map → chunk-m2vh8gh0.js.map} +3 -3
  71. package/dist/{chunk-nqnfz3jg.js → chunk-mbc5hvnj.js} +2 -2
  72. package/dist/{chunk-jk97v21j.js → chunk-n4zzaf6q.js} +3 -2
  73. package/dist/chunk-n4zzaf6q.js.map +10 -0
  74. package/dist/{chunk-y2x2935j.js → chunk-nh26e7c5.js} +2 -2
  75. package/dist/{chunk-jhbk10wf.js → chunk-q9nkpr8k.js} +1 -1
  76. package/dist/{chunk-47e09r7z.js → chunk-qttqe1ah.js} +86 -6
  77. package/dist/{chunk-47e09r7z.js.map → chunk-qttqe1ah.js.map} +5 -4
  78. package/dist/{chunk-3x3bebz7.js → chunk-s7j8ewqv.js} +161 -62
  79. package/dist/{chunk-3x3bebz7.js.map → chunk-s7j8ewqv.js.map} +7 -6
  80. package/dist/{chunk-dz7a4t3a.js → chunk-twfreyxr.js} +5 -10
  81. package/dist/{chunk-dz7a4t3a.js.map → chunk-twfreyxr.js.map} +4 -4
  82. package/dist/{chunk-ks87m383.js → chunk-w1btn96n.js} +49 -24
  83. package/dist/{chunk-ks87m383.js.map → chunk-w1btn96n.js.map} +6 -6
  84. package/dist/{chunk-fg1db9xx.js → chunk-wkq3kvzd.js} +5 -5
  85. package/dist/chunk-wkq3kvzd.js.map +10 -0
  86. package/dist/{chunk-aqyjb86c.js → chunk-wrjx1fqz.js} +6 -6
  87. package/dist/{chunk-agn8d8ys.js → chunk-xtztwpkh.js} +1 -1
  88. package/dist/{chunk-0g5nyx0k.js → chunk-zeykm8my.js} +2 -2
  89. package/dist/connectors/connections/runs.d.ts +7 -0
  90. package/dist/connectors/connections/runs.d.ts.map +1 -1
  91. package/dist/execution/agent.js +29 -29
  92. package/dist/execution/object-reader-security.d.ts.map +1 -1
  93. package/dist/execution/primitive.js +29 -29
  94. package/dist/execution/request.js +30 -30
  95. package/dist/index.d.ts +2 -2
  96. package/dist/index.d.ts.map +1 -1
  97. package/dist/index.js +37 -37
  98. package/dist/materializer/index.js +15 -15
  99. package/dist/models/catalog.d.ts +16 -0
  100. package/dist/models/catalog.d.ts.map +1 -1
  101. package/dist/models/definitions.d.ts +1 -1
  102. package/dist/models/definitions.d.ts.map +1 -1
  103. package/dist/models/execution/index.js +17 -17
  104. package/dist/models/execution/model-call-recorder.d.ts +1 -1
  105. package/dist/models/execution/model-call-recorder.d.ts.map +1 -1
  106. package/dist/models/execution/web-search.d.ts +7 -0
  107. package/dist/models/execution/web-search.d.ts.map +1 -0
  108. package/dist/models/index.d.ts +3 -1
  109. package/dist/models/index.d.ts.map +1 -1
  110. package/dist/models/index.js +5 -3
  111. package/dist/models/index.js.map +1 -1
  112. package/dist/models/language-model.d.ts +12 -0
  113. package/dist/models/language-model.d.ts.map +1 -1
  114. package/dist/models/web-search-model.d.ts +66 -0
  115. package/dist/models/web-search-model.d.ts.map +1 -0
  116. package/dist/objects/index.js +29 -29
  117. package/dist/objects/query/executor.d.ts.map +1 -1
  118. package/dist/objects/query/index.d.ts +1 -0
  119. package/dist/objects/query/index.d.ts.map +1 -1
  120. package/dist/objects/query/index.js +18 -15
  121. package/dist/objects/query/index.js.map +1 -1
  122. package/dist/objects/query/sort-ties.d.ts +11 -0
  123. package/dist/objects/query/sort-ties.d.ts.map +1 -0
  124. package/dist/pipelines/index.js +15 -15
  125. package/dist/projections/internal.js +15 -15
  126. package/dist/runtime/create.d.ts +1 -1
  127. package/dist/runtime/create.d.ts.map +1 -1
  128. package/dist/runtime/internal.js +21 -21
  129. package/dist/runtime/resolve-definitions.d.ts.map +1 -1
  130. package/dist/security/index.d.ts +1 -0
  131. package/dist/security/index.d.ts.map +1 -1
  132. package/dist/security/registry.d.ts +2 -0
  133. package/dist/security/registry.d.ts.map +1 -1
  134. package/dist/security/view-conditions.d.ts.map +1 -1
  135. package/dist/security/visibility-keys.d.ts +19 -0
  136. package/dist/security/visibility-keys.d.ts.map +1 -0
  137. package/dist/shares/internal.js +15 -15
  138. package/dist/storage/agents/in-memory.d.ts +8 -2
  139. package/dist/storage/agents/in-memory.d.ts.map +1 -1
  140. package/dist/storage/agents/index.d.ts +1 -1
  141. package/dist/storage/agents/index.d.ts.map +1 -1
  142. package/dist/storage/agents/provider.d.ts +8 -2
  143. package/dist/storage/agents/provider.d.ts.map +1 -1
  144. package/dist/storage/agents/provider.js +12 -6
  145. package/dist/storage/agents/provider.js.map +1 -1
  146. package/dist/storage/agents/types.d.ts +42 -2
  147. package/dist/storage/agents/types.d.ts.map +1 -1
  148. package/dist/storage/ai-cost/provider.js +4 -4
  149. package/dist/storage/ai-limits/enforcement.js +3 -3
  150. package/dist/storage/ai-limits/provider.js +2 -2
  151. package/dist/storage/connector-connections/provider.js +3 -3
  152. package/dist/storage/connector-connections/provider.js.map +3 -3
  153. package/dist/storage/file-upload-sessions/provider.js +4 -4
  154. package/dist/storage/index.d.ts +2 -2
  155. package/dist/storage/index.d.ts.map +1 -1
  156. package/dist/storage/index.js +14 -14
  157. package/dist/storage/internal.js +2 -2
  158. package/dist/storage/migrations/types.d.ts +6 -0
  159. package/dist/storage/migrations/types.d.ts.map +1 -1
  160. package/dist/storage/objects/in-memory/query.d.ts.map +1 -1
  161. package/dist/storage/objects/index.d.ts +1 -1
  162. package/dist/storage/objects/index.d.ts.map +1 -1
  163. package/dist/storage/objects/query-preparation.d.ts +13 -0
  164. package/dist/storage/objects/query-preparation.d.ts.map +1 -1
  165. package/dist/storage/objects/read-scope.d.ts.map +1 -1
  166. package/dist/storage/objects/types.d.ts +52 -0
  167. package/dist/storage/objects/types.d.ts.map +1 -1
  168. package/dist/storage/share-grants/provider.js +2 -2
  169. package/dist/storage/workflow-runs/provider.js +4 -4
  170. package/dist/syncs/index.js +17 -17
  171. package/dist/testing/agent-storage-contract.d.ts.map +1 -1
  172. package/dist/testing/ai-limit-storage-contract.d.ts.map +1 -1
  173. package/dist/testing/ai-usage-storage-contract.d.ts.map +1 -1
  174. package/dist/testing/connector-connection-storage-contract.d.ts.map +1 -1
  175. package/dist/testing/index.js +399 -45
  176. package/dist/testing/index.js.map +8 -8
  177. package/dist/testing/object-conditional-read-scope-contract.d.ts.map +1 -1
  178. package/dist/testing/object-query-contract.d.ts.map +1 -1
  179. package/dist/webhooks/internal.js +15 -15
  180. package/dist/workflows/index.js +31 -31
  181. package/package.json +1 -1
  182. package/src/agents/README.md +2 -1
  183. package/src/agents/cancel.ts +7 -1
  184. package/src/agents/index.ts +9 -1
  185. package/src/agents/run-plan.ts +31 -0
  186. package/src/agents/run-session-http.ts +15 -12
  187. package/src/agents/run-session-serve.ts +8 -2
  188. package/src/agents/run-session.ts +31 -11
  189. package/src/agents/skills.ts +3 -0
  190. package/src/agents/step-limits.ts +6 -0
  191. package/src/agents/streams/protocol.ts +9 -4
  192. package/src/agents/tool-files.ts +11 -3
  193. package/src/agents/validation.ts +9 -0
  194. package/src/agents/web.ts +218 -0
  195. package/src/authorization/resolve.ts +9 -11
  196. package/src/authorization/types.ts +5 -5
  197. package/src/connectors/connections/runs.ts +42 -5
  198. package/src/execution/object-reader-security.ts +4 -9
  199. package/src/index.ts +2 -0
  200. package/src/models/catalog.ts +52 -3
  201. package/src/models/definitions.ts +2 -0
  202. package/src/models/execution/README.md +22 -2
  203. package/src/models/execution/model-call-recorder.ts +1 -1
  204. package/src/models/execution/web-search.ts +186 -0
  205. package/src/models/index.ts +12 -0
  206. package/src/models/language-model.ts +12 -0
  207. package/src/models/web-search-model.ts +152 -0
  208. package/src/objects/query/executor.ts +7 -3
  209. package/src/objects/query/index.ts +1 -0
  210. package/src/objects/query/sort-ties.ts +16 -0
  211. package/src/runtime/create.ts +3 -2
  212. package/src/runtime/resolve-definitions.ts +4 -0
  213. package/src/security/index.ts +1 -0
  214. package/src/security/registry.ts +2 -0
  215. package/src/security/view-conditions.ts +4 -3
  216. package/src/security/visibility-keys.ts +144 -0
  217. package/src/storage/agents/in-memory.ts +29 -2
  218. package/src/storage/agents/index.ts +2 -0
  219. package/src/storage/agents/provider.ts +57 -1
  220. package/src/storage/agents/types.ts +45 -2
  221. package/src/storage/connector-connections/in-memory.ts +2 -2
  222. package/src/storage/connector-connections/provider/connections.ts +2 -2
  223. package/src/storage/index.ts +4 -0
  224. package/src/storage/migrations/types.ts +6 -0
  225. package/src/storage/objects/in-memory/query.ts +5 -2
  226. package/src/storage/objects/index.ts +2 -0
  227. package/src/storage/objects/query-preparation.ts +59 -1
  228. package/src/storage/objects/read-scope.ts +108 -2
  229. package/src/storage/objects/types.ts +43 -0
  230. package/src/testing/agent-storage-contract.ts +70 -0
  231. package/src/testing/ai-limit-storage-contract.ts +11 -1
  232. package/src/testing/ai-usage-storage-contract.ts +15 -2
  233. package/src/testing/connector-connection-storage-contract.ts +23 -0
  234. package/src/testing/object-conditional-read-scope-contract.ts +267 -5
  235. package/src/testing/object-query-contract.ts +75 -0
  236. package/dist/chunk-edx8xcsm.js.map +0 -13
  237. package/dist/chunk-fg1db9xx.js.map +0 -10
  238. package/dist/chunk-jk97v21j.js.map +0 -10
  239. package/dist/chunk-tvbmh7tj.js.map +0 -18
  240. package/dist/chunk-tvefbgvw.js.map +0 -11
  241. /package/dist/{chunk-neftrg0n.js.map → chunk-0j3crh1w.js.map} +0 -0
  242. /package/dist/{chunk-23s66j86.js.map → chunk-31kcqmhf.js.map} +0 -0
  243. /package/dist/{chunk-nghc7eq0.js.map → chunk-3723kgba.js.map} +0 -0
  244. /package/dist/{chunk-rjeeyssy.js.map → chunk-3sqqhpr7.js.map} +0 -0
  245. /package/dist/{chunk-m3qe54bb.js.map → chunk-4bm0caep.js.map} +0 -0
  246. /package/dist/{chunk-h05rg3bx.js.map → chunk-4s753g3k.js.map} +0 -0
  247. /package/dist/{chunk-8wsjr52f.js.map → chunk-5wtnmpze.js.map} +0 -0
  248. /package/dist/{chunk-2pk5hjj9.js.map → chunk-80gym75n.js.map} +0 -0
  249. /package/dist/{chunk-qbrmpgvv.js.map → chunk-9whfmsfk.js.map} +0 -0
  250. /package/dist/{chunk-w53trr0c.js.map → chunk-a7aa0nzj.js.map} +0 -0
  251. /package/dist/{chunk-7hd2ez3q.js.map → chunk-c4nrycdy.js.map} +0 -0
  252. /package/dist/{chunk-epyfm23v.js.map → chunk-c706qvyc.js.map} +0 -0
  253. /package/dist/{chunk-t5daew4g.js.map → chunk-c7cfe31p.js.map} +0 -0
  254. /package/dist/{chunk-qsg8rw04.js.map → chunk-d04g36fw.js.map} +0 -0
  255. /package/dist/{chunk-ax10ft8d.js.map → chunk-f1h34y3r.js.map} +0 -0
  256. /package/dist/{chunk-9rh8ncs5.js.map → chunk-fwsvshr5.js.map} +0 -0
  257. /package/dist/{chunk-cgznz22f.js.map → chunk-gkv8r794.js.map} +0 -0
  258. /package/dist/{chunk-t9xyr7y9.js.map → chunk-j8thxj7w.js.map} +0 -0
  259. /package/dist/{chunk-nqnfz3jg.js.map → chunk-mbc5hvnj.js.map} +0 -0
  260. /package/dist/{chunk-y2x2935j.js.map → chunk-nh26e7c5.js.map} +0 -0
  261. /package/dist/{chunk-jhbk10wf.js.map → chunk-q9nkpr8k.js.map} +0 -0
  262. /package/dist/{chunk-aqyjb86c.js.map → chunk-wrjx1fqz.js.map} +0 -0
  263. /package/dist/{chunk-agn8d8ys.js.map → chunk-xtztwpkh.js.map} +0 -0
  264. /package/dist/{chunk-0g5nyx0k.js.map → chunk-zeykm8my.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"object-conditional-read-scope-contract.d.ts","sourceRoot":"","sources":["../../src/testing/object-conditional-read-scope-contract.ts"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAO/C,OAAO,KAAK,EAEV,mCAAmC,EACpC,MAAM,8BAA8B,CAAA;AAoCrC;;;;;;GAMG;AACH,wBAAgB,0CAA0C,CAAC,QAAQ,SAAS,OAAO,EACjF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,GACrD,IAAI,CAudN"}
1
+ {"version":3,"file":"object-conditional-read-scope-contract.d.ts","sourceRoot":"","sources":["../../src/testing/object-conditional-read-scope-contract.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAO/C,OAAO,KAAK,EAEV,mCAAmC,EACpC,MAAM,8BAA8B,CAAA;AAwDrC;;;;;;GAMG;AACH,wBAAgB,0CAA0C,CAAC,QAAQ,SAAS,OAAO,EACjF,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,mCAAmC,CAAC,QAAQ,CAAC,GACrD,IAAI,CAqqBN"}
@@ -1 +1 @@
1
- {"version":3,"file":"object-query-contract.d.ts","sourceRoot":"","sources":["../../src/testing/object-query-contract.ts"],"names":[],"mappings":"AAcA,OAAO,EAA0B,gBAAgB,EAAyB,MAAM,aAAa,CAAA;AAE7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAQ/C,MAAM,WAAW,uCAAuC,CAAC,QAAQ,SAAS,OAAO;IAC/E,kFAAkF;IAClF,QAAQ,CAAC,aAAa,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1D,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChE;AAyJD,eAAO,MAAM,2BAA2B,kBAatC,CAAA;AAOF;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,QAAQ,SAAS,OAAO,EAC1E,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uCAAuC,CAAC,QAAQ,CAAC,GACzD,IAAI,CAu3CN"}
1
+ {"version":3,"file":"object-query-contract.d.ts","sourceRoot":"","sources":["../../src/testing/object-query-contract.ts"],"names":[],"mappings":"AAcA,OAAO,EAA0B,gBAAgB,EAAyB,MAAM,aAAa,CAAA;AAE7F,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAQ/C,MAAM,WAAW,uCAAuC,CAAC,QAAQ,SAAS,OAAO;IAC/E,kFAAkF;IAClF,QAAQ,CAAC,aAAa,EAAE,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IAC1D,sDAAsD;IACtD,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,QAAQ,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CAChE;AAyJD,eAAO,MAAM,2BAA2B,kBAatC,CAAA;AAOF;;;;;;;GAOG;AACH,wBAAgB,mCAAmC,CAAC,QAAQ,SAAS,OAAO,EAC1E,KAAK,EAAE,MAAM,EACb,OAAO,EAAE,uCAAuC,CAAC,QAAQ,CAAC,GACzD,IAAI,CAk8CN"}
@@ -2,30 +2,30 @@
2
2
  import"../chunk-escedwyt.js";
3
3
  import"../chunk-6eqsgvxk.js";
4
4
  import"../chunk-d7v97qxq.js";
5
- import"../chunk-dz7a4t3a.js";
5
+ import"../chunk-twfreyxr.js";
6
6
  import"../chunk-jspskey0.js";
7
- import"../chunk-31khg3g0.js";
7
+ import"../chunk-kkjfve0t.js";
8
8
  import"../chunk-wkv3h3q7.js";
9
9
  import"../chunk-djs3hw9p.js";
10
10
  import {
11
11
  createConnectorCodedError,
12
12
  getConnectorExecutionSourceResolver
13
- } from "../chunk-9rh8ncs5.js";
13
+ } from "../chunk-fwsvshr5.js";
14
14
  import"../chunk-mbsbxarb.js";
15
15
  import"../chunk-165c9wm6.js";
16
- import"../chunk-3x3bebz7.js";
16
+ import"../chunk-s7j8ewqv.js";
17
17
  import"../chunk-frsz8wxd.js";
18
18
  import"../chunk-e7v3trpz.js";
19
19
  import"../chunk-2g0r46hy.js";
20
20
  import"../chunk-zrvhsq7f.js";
21
21
  import"../chunk-5grk14e5.js";
22
- import"../chunk-tvefbgvw.js";
23
- import"../chunk-47e09r7z.js";
24
- import"../chunk-edx8xcsm.js";
25
- import"../chunk-0g5nyx0k.js";
26
- import"../chunk-7hd2ez3q.js";
22
+ import"../chunk-az95tsh3.js";
23
+ import"../chunk-qttqe1ah.js";
24
+ import"../chunk-7z5rkf0m.js";
25
+ import"../chunk-zeykm8my.js";
26
+ import"../chunk-c4nrycdy.js";
27
27
  import"../chunk-h89wz928.js";
28
- import"../chunk-23s66j86.js";
28
+ import"../chunk-31kcqmhf.js";
29
29
  import {
30
30
  isStorageSerializationFailure2
31
31
  } from "../chunk-e6xgz4h4.js";
@@ -38,7 +38,7 @@ import {
38
38
  import"../chunk-cswhawa2.js";
39
39
  import {
40
40
  canRetryWebhookRun2
41
- } from "../chunk-cb21tx14.js";
41
+ } from "../chunk-eqgr6nsa.js";
42
42
  import"../chunk-nz7815t3.js";
43
43
  import"../chunk-s7xqfxs9.js";
44
44
  import"../chunk-mmagke4x.js";
@@ -49,16 +49,16 @@ import {
49
49
  WebhookRunError2
50
50
  } from "../chunk-qf954wje.js";
51
51
  import"../chunk-x0v3jd47.js";
52
- import"../chunk-neftrg0n.js";
52
+ import"../chunk-0j3crh1w.js";
53
53
  import {
54
54
  createPrimitiveExecutionRecord
55
- } from "../chunk-qbrmpgvv.js";
55
+ } from "../chunk-9whfmsfk.js";
56
56
  import {
57
57
  isOAuthConnectorDefinition2,
58
58
  isStaticConnectorDefinition2
59
59
  } from "../chunk-9x8dybsb.js";
60
- import"../chunk-2pk5hjj9.js";
61
- import"../chunk-agn8d8ys.js";
60
+ import"../chunk-80gym75n.js";
61
+ import"../chunk-xtztwpkh.js";
62
62
  import"../chunk-21q0j5f2.js";
63
63
  // src/webhooks/connections.ts
64
64
  function createWebhookConnections(runtime, definition) {
@@ -8,12 +8,12 @@ import {
8
8
  defineWorkflow2,
9
9
  createWorkflowNodeFailure2,
10
10
  unwrapWorkflowNodeFailure2
11
- } from "../chunk-t5daew4g.js";
11
+ } from "../chunk-c7cfe31p.js";
12
12
  import"../chunk-57g0215c.js";
13
13
  import"../chunk-fb3feg1e.js";
14
14
  import"../chunk-s038wa5v.js";
15
15
  import"../chunk-t5608tkq.js";
16
- import"../chunk-ratj7t3t.js";
16
+ import"../chunk-dsv783c3.js";
17
17
  import"../chunk-5taem5aw.js";
18
18
  import"../chunk-de5sfbc3.js";
19
19
  import"../chunk-jftd33rc.js";
@@ -46,20 +46,20 @@ import {
46
46
  snapshotWorkflowActionInput2,
47
47
  WorkflowRunDispatcher2,
48
48
  requestWorkflowRun2
49
- } from "../chunk-z3evap21.js";
50
- import"../chunk-h05rg3bx.js";
51
- import"../chunk-9rh8ncs5.js";
52
- import"../chunk-ax10ft8d.js";
49
+ } from "../chunk-a5v4gjdx.js";
50
+ import"../chunk-4s753g3k.js";
51
+ import"../chunk-fwsvshr5.js";
52
+ import"../chunk-f1h34y3r.js";
53
53
  import"../chunk-r1cxq7vv.js";
54
- import"../chunk-cgznz22f.js";
55
- import"../chunk-epyfm23v.js";
54
+ import"../chunk-gkv8r794.js";
55
+ import"../chunk-c706qvyc.js";
56
56
  import"../chunk-1vg43g9q.js";
57
- import"../chunk-rjeeyssy.js";
58
- import"../chunk-qbrmpgvv.js";
59
- import"../chunk-nghc7eq0.js";
60
- import"../chunk-b7a97n8b.js";
61
- import"../chunk-jhbk10wf.js";
62
- import"../chunk-qsg8rw04.js";
57
+ import"../chunk-3sqqhpr7.js";
58
+ import"../chunk-9whfmsfk.js";
59
+ import"../chunk-3723kgba.js";
60
+ import"../chunk-ga63a3dz.js";
61
+ import"../chunk-q9nkpr8k.js";
62
+ import"../chunk-d04g36fw.js";
63
63
  import"../chunk-5a4a52tq.js";
64
64
  import"../chunk-jbw70d6t.js";
65
65
  import"../chunk-6b61s40c.js";
@@ -69,43 +69,43 @@ import"../chunk-w976a4me.js";
69
69
  import"../chunk-5kyvrtjh.js";
70
70
  import"../chunk-8ncg20rd.js";
71
71
  import"../chunk-sgx82nnt.js";
72
- import"../chunk-fg1db9xx.js";
73
- import"../chunk-t9xyr7y9.js";
74
- import"../chunk-8yzhjawq.js";
75
- import"../chunk-tvbmh7tj.js";
76
- import"../chunk-cb21tx14.js";
72
+ import"../chunk-wkq3kvzd.js";
73
+ import"../chunk-j8thxj7w.js";
74
+ import"../chunk-m2vh8gh0.js";
75
+ import"../chunk-2ajw5rz0.js";
76
+ import"../chunk-eqgr6nsa.js";
77
77
  import"../chunk-jmfet9r4.js";
78
78
  import"../chunk-qf954wje.js";
79
- import"../chunk-neftrg0n.js";
79
+ import"../chunk-0j3crh1w.js";
80
80
  import"../chunk-e6xgz4h4.js";
81
81
  import"../chunk-nz7815t3.js";
82
82
  import"../chunk-s7xqfxs9.js";
83
83
  import"../chunk-mmagke4x.js";
84
84
  import"../chunk-scyq22td.js";
85
85
  import"../chunk-hn2r7z41.js";
86
- import"../chunk-2pk5hjj9.js";
86
+ import"../chunk-80gym75n.js";
87
87
  import"../chunk-mbsbxarb.js";
88
- import"../chunk-edx8xcsm.js";
89
- import"../chunk-0g5nyx0k.js";
90
- import"../chunk-agn8d8ys.js";
91
- import"../chunk-7hd2ez3q.js";
88
+ import"../chunk-7z5rkf0m.js";
89
+ import"../chunk-zeykm8my.js";
90
+ import"../chunk-xtztwpkh.js";
91
+ import"../chunk-c4nrycdy.js";
92
92
  import"../chunk-eptrvnby.js";
93
- import"../chunk-23s66j86.js";
93
+ import"../chunk-31kcqmhf.js";
94
94
  import"../chunk-h89wz928.js";
95
95
  import"../chunk-x0v3jd47.js";
96
96
  import"../chunk-165c9wm6.js";
97
97
  import"../chunk-cswhawa2.js";
98
- import"../chunk-47e09r7z.js";
99
- import"../chunk-tvefbgvw.js";
100
- import"../chunk-3x3bebz7.js";
98
+ import"../chunk-qttqe1ah.js";
99
+ import"../chunk-az95tsh3.js";
100
+ import"../chunk-s7j8ewqv.js";
101
101
  import"../chunk-21q0j5f2.js";
102
102
  import"../chunk-2g0r46hy.js";
103
103
  import"../chunk-e7v3trpz.js";
104
104
  import"../chunk-zrvhsq7f.js";
105
105
  import"../chunk-frsz8wxd.js";
106
106
  import"../chunk-5grk14e5.js";
107
- import"../chunk-dz7a4t3a.js";
108
- import"../chunk-31khg3g0.js";
107
+ import"../chunk-twfreyxr.js";
108
+ import"../chunk-kkjfve0t.js";
109
109
  import"../chunk-djs3hw9p.js";
110
110
  import"../chunk-jspskey0.js";
111
111
  import"../chunk-d7v97qxq.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sixb/core",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "The ontology-first runtime for Sixb — objects, links, telemetry, actions, and provider contracts",
5
5
  "keywords": [
6
6
  "sixb",
@@ -65,7 +65,8 @@ renewLease · cancelled · assertOwned ownership, and a cancel of the run or o
65
65
  models.language(ref) the run's model, pinned once: each call is admitted against
66
66
  the requester's AI limits and records itself, and what it
67
67
  measured of the tokenizer (context-token-rate.ts), so the
68
- runner never reports what a call used
68
+ runner never reports what a call used; with
69
+ `{ measures: false }`, a tool's own call measures nothing
69
70
  callTool(call) one call of a project tool the run offers, for the runner
70
71
  that holds the run, run as the run (run-tools.ts): its input
71
72
  checked against the tool's schema, its model calls billed to
@@ -8,7 +8,11 @@ import {
8
8
  } from "../storage/agents"
9
9
  import { isAwaitingApprovalRun, stopAgentTurn } from "./approvals"
10
10
  import { AgentRequestError } from "./errors"
11
- import { publishAgentRunCancel, publishAgentRunFinished } from "./streams/protocol"
11
+ import {
12
+ publishAgentRunActivity,
13
+ publishAgentRunCancel,
14
+ publishAgentRunFinished,
15
+ } from "./streams/protocol"
12
16
 
13
17
  /**
14
18
  * Stop a turn. A queued turn ends here, before any worker starts it. A running turn receives the
@@ -58,6 +62,8 @@ export async function cancelAgentRun(
58
62
  }
59
63
 
60
64
  await requestAgentRunCancel({ ...runtime, storage }, current.id)
65
+ // A computer running it hears of no cancel on the broker: this brings its next renewal forward.
66
+ await publishAgentRunActivity(runtime.broker, current, { cancelRequested: true })
61
67
  return current
62
68
  }
63
69
 
@@ -223,6 +223,7 @@ export type {
223
223
  AgentRunPlan,
224
224
  AgentRunPlanDefinitions,
225
225
  AgentRunView,
226
+ AgentRunWebPlan,
226
227
  SandboxModel,
227
228
  SandboxModelKind,
228
229
  } from "./run-plan"
@@ -231,6 +232,7 @@ export {
231
232
  readAgentRunDelegation,
232
233
  readAgentRunMemory,
233
234
  readAgentRunPlan,
235
+ readAgentRunWebPlan,
234
236
  renderAgentRunOntologyDocs,
235
237
  } from "./run-plan"
236
238
  export type {
@@ -339,7 +341,11 @@ export type {
339
341
  } from "./thread-context-projection"
340
342
  export { projectAgentThreadModelContext } from "./thread-context-projection"
341
343
  export type { AgentToolCatalog } from "./tool-catalog"
342
- export type { AgentToolCallFile, StoredAgentToolFile } from "./tool-files"
344
+ export type {
345
+ AgentToolCallFile,
346
+ AgentToolOutputExtension,
347
+ StoredAgentToolFile,
348
+ } from "./tool-files"
343
349
  export {
344
350
  AGENT_FILE_MAX_BYTES,
345
351
  AGENT_TOOL_OUTPUTS_DIRECTORY,
@@ -385,6 +391,8 @@ export {
385
391
  isAgentToolDefinition,
386
392
  validateAndNormalizeAgentToolInput,
387
393
  } from "./validation"
394
+ export type { AgentWebOptions, WebDomainPolicy } from "./web"
395
+ export { bindAgentWebSearch, webDomainPolicy } from "./web"
388
396
  export type {
389
397
  WorkflowAgentNodeSession,
390
398
  WorkflowAgentNodeSessionHost,
@@ -4,6 +4,7 @@ import type {
4
4
  LanguageModelRef,
5
5
  LanguageModelTier,
6
6
  ModelCatalog,
7
+ ModelRef,
7
8
  } from "../models/catalog"
8
9
  import type { LanguageModelDefinition } from "../models/definitions"
9
10
  import type { PropertyClearance } from "../objects/property-clearance"
@@ -53,6 +54,16 @@ export interface AgentRunPlan {
53
54
  * context estimate starts from (see readAgentContextTokenRates).
54
55
  */
55
56
  readonly tokenRates: readonly AgentContextTokenRateSample[]
57
+ /** Its web tools. Absent: `agent.web: false`, so it has none. */
58
+ readonly web?: AgentRunWebPlan
59
+ }
60
+
61
+ /** The web tools a run offers, and the domains they reach. */
62
+ export interface AgentRunWebPlan {
63
+ /** The model `web_search` calls. Absent: the project has none, so the run offers no search. */
64
+ readonly search?: ModelRef
65
+ readonly allowedDomains?: readonly string[]
66
+ readonly blockedDomains?: readonly string[]
56
67
  }
57
68
 
58
69
  /** The project's language models, as a turn chooses one for a child it spawns. */
@@ -112,11 +123,13 @@ export function readAgentRunPlan(
112
123
  view: AgentRunView
113
124
  ): Omit<AgentRunPlan, "tokenRates"> {
114
125
  const { agent, models, tools } = definitions
126
+ const web = readAgentRunWebPlan(definitions)
115
127
  const shared = {
116
128
  ...(agent.instructions === undefined ? {} : { instructions: agent.instructions }),
117
129
  skills: agent.skills.list(),
118
130
  sandboxModels: listSandboxModels(models),
119
131
  ontologyDocs: renderAgentRunOntologyDocs({ ...view, catalog: agent.ontologyDocs }),
132
+ ...(web === undefined ? {} : { web }),
120
133
  }
121
134
 
122
135
  const subagentMaxSteps = agent.subagentMaxSteps ?? UNATTENDED_AGENT_MAX_STEPS
@@ -169,6 +182,24 @@ export function readAgentRunPlan(
169
182
  })
170
183
  }
171
184
 
185
+ /**
186
+ * The web tools a run offers, read from the project's definitions so that every runner (a turn, a
187
+ * child, a workflow step, in the worker or on a computer) offers the same ones.
188
+ */
189
+ export function readAgentRunWebPlan(
190
+ definitions: Pick<SixbDefinitions, "agent" | "models">
191
+ ): AgentRunWebPlan | undefined {
192
+ const { web } = definitions.agent
193
+ if (web === false) return undefined
194
+
195
+ const search = definitions.models?.webSearch?.default
196
+ return Object.freeze({
197
+ ...(search ? { search: { provider: search.provider, modelId: search.modelId } } : {}),
198
+ ...(web?.allowedDomains ? { allowedDomains: web.allowedDomains } : {}),
199
+ ...(web?.blockedDomains ? { blockedDomains: web.blockedDomains } : {}),
200
+ })
201
+ }
202
+
172
203
  /**
173
204
  * The project's models, with what each is for: its language models in catalog order, then each
174
205
  * media kind's, default first. Read from each model's configured definition, never its provider
@@ -83,7 +83,7 @@ export function createHttpAgentRunSession<TRun extends AgentRunRecord>(
83
83
  })
84
84
  )
85
85
 
86
- const models = new Map<string, Promise<LanguageModel>>()
86
+ const models = new Map<string, Promise<Omit<LanguageModel, "stream">>>()
87
87
  const sink = batchedEvents(async (batch) => {
88
88
  try {
89
89
  await result(
@@ -105,18 +105,19 @@ export function createHttpAgentRunSession<TRun extends AgentRunRecord>(
105
105
  executionToken,
106
106
  cancelled: cancelled.signal,
107
107
  models: {
108
- language(ref) {
108
+ async language(ref, options) {
109
109
  const key = `${ref.provider}/${ref.modelId}`
110
- let model = models.get(key)
111
- if (!model) {
112
- model = call<Omit<LanguageModel, "stream">>("models.describe", [ref]).then((described) =>
113
- httpModel(described, ref, request)
114
- )
115
- model.catch(() => models.delete(key))
116
- models.set(key, model)
110
+ let described = models.get(key)
111
+ if (!described) {
112
+ described = call<Omit<LanguageModel, "stream">>("models.describe", [ref])
113
+ described.catch(() => models.delete(key))
114
+ models.set(key, described)
117
115
  }
118
- return model
116
+
117
+ return httpModel(await described, ref, request, options?.measures !== false)
119
118
  },
119
+ // The server searches, with the project's key, and records the call against the run.
120
+ webSearch: (request, signal) => call("models.webSearch", [request], signal),
120
121
  },
121
122
  events: sink.sink,
122
123
  heldCalls: {
@@ -302,7 +303,9 @@ async function result<T>(response: Response): Promise<T> {
302
303
  function httpModel(
303
304
  described: Omit<LanguageModel, "stream">,
304
305
  ref: Parameters<AgentRunSession["models"]["language"]>[0],
305
- request: (operation: string, init: RequestInit) => Promise<Response>
306
+ request: (operation: string, init: RequestInit) => Promise<Response>,
307
+ /** False for a tool's own call: the server then keeps no measure of the tokenizer from it. */
308
+ measures: boolean
306
309
  ): LanguageModel {
307
310
  return {
308
311
  ...described,
@@ -310,7 +313,7 @@ function httpModel(
310
313
  const response = await request("models.stream", {
311
314
  method: "POST",
312
315
  headers: { "content-type": "application/json" },
313
- body: encodeWireValue({ ref, call }),
316
+ body: encodeWireValue({ ref, call, ...(measures ? {} : { measures: false }) }),
314
317
  signal,
315
318
  })
316
319
  if (!response.ok || !response.body) await result(response)
@@ -120,6 +120,11 @@ const OPERATIONS: Readonly<Record<string, Operation>> = {
120
120
  const { providerId, modelId, definition, rateCard, defaultReasoning, maxOutputTokens } = model
121
121
  return { providerId, modelId, definition, rateCard, defaultReasoning, maxOutputTokens }
122
122
  },
123
+ "models.webSearch": (session, [request], signal) =>
124
+ session.models.webSearch(
125
+ request as Parameters<AgentRunSession["models"]["webSearch"]>[0],
126
+ signal
127
+ ),
123
128
  "files.stat": (session, [blobId]) => session.files.stat(blobId as string),
124
129
  }
125
130
 
@@ -428,11 +433,12 @@ function withSavedOutputChecked(part: AgentMessagePart): AgentMessagePart {
428
433
 
429
434
  /** One model call, its events streamed back as lines of JSON as the provider sends them. */
430
435
  async function streamModelCall(session: AgentRunSession, request: Request): Promise<Response> {
431
- const { ref, call } = decodeWireValue(await readBodyText(request)) as {
436
+ const { ref, call, measures } = decodeWireValue(await readBodyText(request)) as {
432
437
  ref: Parameters<AgentRunSession["models"]["language"]>[0]
433
438
  call: Omit<LanguageModelRequest, "signal">
439
+ measures?: unknown
434
440
  }
435
- const model = await session.models.language(ref)
441
+ const model = await session.models.language(ref, { measures: measures !== false })
436
442
  const opened = await model.stream({ ...call, signal: request.signal })
437
443
  const encoder = new TextEncoder()
438
444
  const iterator = opened.events[Symbol.asyncIterator]()
@@ -19,6 +19,7 @@ import {
19
19
  } from "../models/execution/index"
20
20
  import type { LanguageModel } from "../models/language-model"
21
21
  import { resolveLanguageModel } from "../models/resolve"
22
+ import type { WebSearchModelRequest, WebSearchModelResult } from "../models/web-search-model"
22
23
  import type { Sixb } from "../runtime/sixb"
23
24
  import type { SecurityDefinitionCatalog } from "../security"
24
25
  import type { Storage } from "../storage"
@@ -90,6 +91,7 @@ import { subscribeAgentRunCancel } from "./streams/protocol"
90
91
  import { subagentSandboxFiles } from "./subagent-runs"
91
92
  import { conversationThreadId } from "./thread-access"
92
93
  import type { AgentToolRunInfo } from "./types"
94
+ import { bindAgentWebSearch } from "./web"
93
95
 
94
96
  /**
95
97
  * A run's session: the one way its runner reads and writes shared state for it. Claiming the run
@@ -198,8 +200,20 @@ export interface AgentRunSession<TRun extends AgentRunRecord = AgentRunRecord> {
198
200
 
199
201
  /** The models a run calls, by the ref its plan names. */
200
202
  export interface AgentRunModels {
201
- /** A language model of the project, resolved once for the session. */
202
- language(ref: LanguageModelRef): Promise<LanguageModel>
203
+ /**
204
+ * A language model of the project, resolved once for the session. Each call is recorded, and
205
+ * measures the model's tokenizer for the run, unless `measures` is false: a tool's own call
206
+ * (`web_fetch`'s question) reads other text than the run's context, and must not stand for it.
207
+ */
208
+ language(ref: LanguageModelRef, options?: { readonly measures?: boolean }): Promise<LanguageModel>
209
+ /**
210
+ * Search the web with the project's web search model, the one its plan's `web.search` names.
211
+ * It always runs where the project is: the provider's key never reaches the runner.
212
+ */
213
+ webSearch(
214
+ request: Omit<WebSearchModelRequest, "signal">,
215
+ signal: AbortSignal
216
+ ): Promise<WebSearchModelResult>
203
217
  }
204
218
 
205
219
  /** Where a run's files are stored: put one, open or stat one by its blob id. */
@@ -380,6 +394,11 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
380
394
  })
381
395
  return toolsBound
382
396
  }
397
+ // Its searches bill to the run too, and stop with it.
398
+ const webSearch = bindAgentWebSearch(host.definitions, {
399
+ signal: AbortSignal.any([cancelled, ended.signal, ...(stop ? [stop] : [])]),
400
+ accounting: openedModelCalls,
401
+ })
383
402
  let logs: RunLogSession | undefined
384
403
  // Labeled with the conversation its run works in: a child's is its parent's.
385
404
  let toolLabels: Promise<LogFields> | undefined
@@ -437,7 +456,7 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
437
456
  pausesAfterStep: () => turnPausesOnHeldCalls(host.storage.agents, run),
438
457
  },
439
458
  models: {
440
- async language(ref) {
459
+ async language(ref, options) {
441
460
  const key = `${ref.provider}/${ref.modelId}`
442
461
  let resolved = languageModels.get(key)
443
462
  if (!resolved) {
@@ -453,15 +472,16 @@ export async function openAgentRunSession<TRun extends AgentRunRecord>(
453
472
  resolved.catch(() => languageModels.delete(key))
454
473
  }
455
474
  // Each call records itself, and what it measured of the model's tokenizer.
456
- return measuringAgentContextTokenRates(
457
- (await openedModelCalls()).wrapModel(await resolved),
458
- {
459
- tokenRates: agents.tokenRates,
460
- projectId: host.projectId,
461
- runId: run.id,
462
- }
463
- )
475
+ const recorded = (await openedModelCalls()).wrapModel(await resolved)
476
+ if (options?.measures === false) return recorded
477
+
478
+ return measuringAgentContextTokenRates(recorded, {
479
+ tokenRates: agents.tokenRates,
480
+ projectId: host.projectId,
481
+ runId: run.id,
482
+ })
464
483
  },
484
+ webSearch,
465
485
  },
466
486
  async renewLease(leaseExpiresAt) {
467
487
  try {
@@ -1,6 +1,7 @@
1
1
  import type { OntologyDocsCatalog, OntologyDocsInput } from "../ontology/docs"
2
2
  import { RuntimeError } from "../runtime/errors"
3
3
  import type { AgentOptions } from "./step-limits"
4
+ import type { AgentWebOptions } from "./web"
4
5
 
5
6
  /** A project file the Agent receives byte-for-byte in its sandbox. */
6
7
  export interface AgentProjectFile {
@@ -48,6 +49,8 @@ export interface AgentDefinitions {
48
49
  /** As the project set them, checked. Absent: a turn has no limit, a sub-agent the default. */
49
50
  readonly maxSteps?: number
50
51
  readonly subagentMaxSteps?: number
52
+ /** As the project set it, checked, its domains in canonical form. Absent: web tools are on. */
53
+ readonly web?: false | AgentWebOptions
51
54
  }
52
55
 
53
56
  /** Index skills by name. Discovery validates each skill; names must also be unique. */
@@ -1,4 +1,5 @@
1
1
  import { RuntimeError } from "../runtime/errors"
2
+ import type { AgentWebOptions } from "./web"
2
3
 
3
4
  /**
4
5
  * The most model calls a run nobody watches takes when nothing sets its own limit: a sub-agent's or
@@ -15,6 +16,11 @@ export interface AgentOptions {
15
16
  readonly maxSteps?: number
16
17
  /** At most this many steps in one run of a sub-agent. Defaults to 500. */
17
18
  readonly subagentMaxSteps?: number
19
+ /**
20
+ * The web tools: `web_search` when the project has a web search model, and `web_fetch`. On by
21
+ * default; `false` turns both off, and domain lists narrow both.
22
+ */
23
+ readonly web?: false | AgentWebOptions
18
24
  }
19
25
 
20
26
  /** Reject a step limit that is not a positive integer, naming where it was set. */
@@ -37,6 +37,8 @@ export interface AgentRunActivityEvent {
37
37
  readonly attempt: number
38
38
  /** Set on a computer's turn: a `sixb` hearing of any other has nothing to read about it. */
39
39
  readonly runsOn?: "computer"
40
+ /** A stop was asked for: whatever runs it hears at its next lease renewal, or now, on this. */
41
+ readonly cancelRequested?: true
40
42
  readonly occurredAt: string
41
43
  }
42
44
 
@@ -100,7 +102,9 @@ export interface AgentApprovalActivityEvent {
100
102
 
101
103
  /**
102
104
  * An open `sixb` on its owner's computer came or went: the threads that run on that computer in
103
- * that folder are reachable now, or not. Only its owner hears it.
105
+ * that folder are reachable now, or not. Also said, `online`, as the background commands it runs
106
+ * start or end, and as its owner asks it to stop one, which it hears and renews its session for.
107
+ * Only its owner hears it.
104
108
  */
105
109
  export interface AgentComputerActivityEvent {
106
110
  readonly schemaVersion: typeof AGENT_ACTIVITY_STREAM_SCHEMA_VERSION
@@ -286,9 +290,10 @@ export async function publishAgentApprovalActivity(
286
290
 
287
291
  export async function publishAgentRunActivity(
288
292
  broker: Broker,
289
- run: ConversationAgentRunRecord
293
+ run: ConversationAgentRunRecord,
294
+ options: { readonly cancelRequested?: true } = {}
290
295
  ): Promise<void> {
291
- const event = agentRunActivityEvent(run)
296
+ const event = { ...agentRunActivityEvent(run), ...options }
292
297
  await broker.ensureStream({
293
298
  projectId: run.projectId,
294
299
  stream: agentActivityStreamDefinition(),
@@ -302,7 +307,7 @@ export async function publishAgentRunActivity(
302
307
  key: event.threadId,
303
308
  // The event is composed only of validated JSON primitives.
304
309
  payload: event as unknown as JsonValue,
305
- idempotencyKey: `${event.runId}:${event.attempt}:${event.status}`,
310
+ idempotencyKey: `${event.runId}:${event.attempt}:${event.status}${options.cancelRequested ? ":cancel" : ""}`,
306
311
  },
307
312
  ],
308
313
  })
@@ -224,23 +224,31 @@ export function agentToolFilePath(toolCallId: string, fileRef: FileRef, fileName
224
224
  return posix.join("tool-files", callKey, `${digestKey}-${fileName}`)
225
225
  }
226
226
 
227
+ /** What a saved output may be: text, a page as markdown, or a document or image as it came. */
228
+ export type AgentToolOutputExtension = "txt" | "md" | "pdf" | "png" | "jpg" | "gif" | "webp"
229
+
227
230
  /**
228
231
  * Where a call's output too large for the model's context is saved, relative to the context
229
232
  * directory: the call, and the content's digest, so a call id a provider uses again names another
230
233
  * file. `sha256` is the content's hex digest.
231
234
  */
232
- export function agentToolOutputPath(toolCallId: string, sha256: string): string {
235
+ export function agentToolOutputPath(
236
+ toolCallId: string,
237
+ sha256: string,
238
+ extension: AgentToolOutputExtension = "txt"
239
+ ): string {
233
240
  const call = SAFE_CALL_ID.test(toolCallId)
234
241
  ? toolCallId
235
242
  : createHash("sha256").update(toolCallId).digest("hex").slice(0, 16)
236
- return `${AGENT_TOOL_OUTPUTS_DIRECTORY}/${call}-${sha256.slice(0, 12)}.txt`
243
+ return `${AGENT_TOOL_OUTPUTS_DIRECTORY}/${call}-${sha256.slice(0, 12)}.${extension}`
237
244
  }
238
245
 
239
246
  /** Where saved outputs go, in the context directory. */
240
247
  export const AGENT_TOOL_OUTPUTS_DIRECTORY = "tool-outputs"
241
248
 
242
249
  const SAFE_CALL_ID = /^[A-Za-z0-9_-]{1,128}$/
243
- const TOOL_OUTPUT_PATH = /^tool-outputs\/[A-Za-z0-9_-]{1,128}-([0-9a-f]{12})\.txt$/
250
+ const TOOL_OUTPUT_PATH =
251
+ /^tool-outputs\/[A-Za-z0-9_-]{1,128}-([0-9a-f]{12})\.(?:txt|md|pdf|png|jpg|gif|webp)$/
244
252
 
245
253
  /**
246
254
  * Whether a tool-call part's `outputFile` is one {@link agentToolOutputPath} names: a stored file,
@@ -5,10 +5,13 @@ import { normalizeSchemaValue } from "../ontology/validation/normalize"
5
5
  import { validateSchemaValue } from "../ontology/validation/schema"
6
6
  import { AgentDefinitionError } from "./errors"
7
7
  import type { AgentToolDefinition, AgentToolInputSchema } from "./types"
8
+ import { AGENT_WEB_TOOL_NAMES } from "./web"
8
9
 
9
10
  const AGENT_TOOL_NAME_PATTERN = /^[A-Za-z_][A-Za-z0-9_-]{0,63}$/
10
11
  export const AGENT_RESERVED_TOOL_NAMES = [
11
12
  "bash",
13
+ "bash_output",
14
+ "bash_stop",
12
15
  "read",
13
16
  "view_file",
14
17
  "spawn_agent",
@@ -17,6 +20,7 @@ export const AGENT_RESERVED_TOOL_NAMES = [
17
20
  "ask_parent",
18
21
  "publish_artifact",
19
22
  "publish_artifact_version",
23
+ ...AGENT_WEB_TOOL_NAMES,
20
24
  ] as const
21
25
 
22
26
  export function isAgentToolDefinition(value: unknown): value is AgentToolDefinition {
@@ -36,6 +40,11 @@ export function assertValidAgentToolName(name: unknown): asserts name is string
36
40
  "[Sixb] Agent tool name must be 1-64 characters, start with a letter or underscore, and contain only letters, numbers, underscores, or hyphens."
37
41
  )
38
42
  }
43
+ if ((AGENT_WEB_TOOL_NAMES as readonly string[]).includes(name)) {
44
+ throw new AgentDefinitionError(
45
+ `[Sixb] Agent tool name '${name}' is reserved: Sixb gives the Agent its own ${name} tool. To search with Exa, set models.webSearch: [exaSearch(...)].`
46
+ )
47
+ }
39
48
  if ((AGENT_RESERVED_TOOL_NAMES as readonly string[]).includes(name)) {
40
49
  throw new AgentDefinitionError(`[Sixb] Agent tool name '${name}' is reserved by the framework.`)
41
50
  }