@assemblyline-agents/runtime 2.0.0 → 3.1.0

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 (389) hide show
  1. package/LICENSE +1 -1
  2. package/dist/a2a-client.d.ts +22 -0
  3. package/dist/a2a-client.d.ts.map +1 -0
  4. package/dist/a2a-client.js +211 -0
  5. package/dist/a2a-client.js.map +1 -0
  6. package/dist/agent-hook-context.d.ts +6 -1
  7. package/dist/agent-hook-context.d.ts.map +1 -1
  8. package/dist/agent-hook-context.js +24 -11
  9. package/dist/agent-hook-context.js.map +1 -1
  10. package/dist/agent-hook-evaluation.d.ts +6 -1
  11. package/dist/agent-hook-evaluation.d.ts.map +1 -1
  12. package/dist/agent-hook-evaluation.js +16 -5
  13. package/dist/agent-hook-evaluation.js.map +1 -1
  14. package/dist/agent-hook-run-lifecycle.d.ts +5 -1
  15. package/dist/agent-hook-run-lifecycle.d.ts.map +1 -1
  16. package/dist/agent-hook-run-lifecycle.js +11 -13
  17. package/dist/agent-hook-run-lifecycle.js.map +1 -1
  18. package/dist/agent-surface.d.ts +32 -0
  19. package/dist/agent-surface.d.ts.map +1 -0
  20. package/dist/agent-surface.js +85 -0
  21. package/dist/agent-surface.js.map +1 -0
  22. package/dist/attachments.d.ts +5 -1
  23. package/dist/attachments.d.ts.map +1 -1
  24. package/dist/attachments.js +58 -32
  25. package/dist/attachments.js.map +1 -1
  26. package/dist/audience.d.ts +30 -0
  27. package/dist/audience.d.ts.map +1 -0
  28. package/dist/audience.js +68 -0
  29. package/dist/audience.js.map +1 -0
  30. package/dist/automation-event-match.d.ts +8 -0
  31. package/dist/automation-event-match.d.ts.map +1 -0
  32. package/dist/automation-event-match.js +25 -0
  33. package/dist/automation-event-match.js.map +1 -0
  34. package/dist/background-review-trigger.d.ts.map +1 -1
  35. package/dist/background-review-trigger.js +14 -16
  36. package/dist/background-review-trigger.js.map +1 -1
  37. package/dist/background-review-types.d.ts +9 -2
  38. package/dist/background-review-types.d.ts.map +1 -1
  39. package/dist/background-review-worker.js +2 -2
  40. package/dist/background-review-worker.js.map +1 -1
  41. package/dist/background-review.d.ts.map +1 -1
  42. package/dist/background-review.js +27 -10
  43. package/dist/background-review.js.map +1 -1
  44. package/dist/builtin-tool-executors.d.ts +47 -21
  45. package/dist/builtin-tool-executors.d.ts.map +1 -1
  46. package/dist/builtin-tool-executors.js +293 -121
  47. package/dist/builtin-tool-executors.js.map +1 -1
  48. package/dist/builtin-tools.d.ts +16 -8
  49. package/dist/builtin-tools.d.ts.map +1 -1
  50. package/dist/builtin-tools.js +309 -70
  51. package/dist/builtin-tools.js.map +1 -1
  52. package/dist/capability-catalog.d.ts +3 -2
  53. package/dist/capability-catalog.d.ts.map +1 -1
  54. package/dist/capability-catalog.js +10 -6
  55. package/dist/capability-catalog.js.map +1 -1
  56. package/dist/capability-inspection.d.ts +31 -0
  57. package/dist/capability-inspection.d.ts.map +1 -0
  58. package/dist/capability-inspection.js +58 -0
  59. package/dist/capability-inspection.js.map +1 -0
  60. package/dist/channel-http-util.d.ts.map +1 -1
  61. package/dist/channel-http-util.js +6 -2
  62. package/dist/channel-http-util.js.map +1 -1
  63. package/dist/channel-ingress.d.ts +16 -1
  64. package/dist/channel-ingress.d.ts.map +1 -1
  65. package/dist/channel-ingress.js +117 -7
  66. package/dist/channel-ingress.js.map +1 -1
  67. package/dist/channel.d.ts +58 -2
  68. package/dist/channel.d.ts.map +1 -1
  69. package/dist/checkpoints.d.ts +1 -1
  70. package/dist/checkpoints.d.ts.map +1 -1
  71. package/dist/checkpoints.js +6 -6
  72. package/dist/checkpoints.js.map +1 -1
  73. package/dist/child-process-env.d.ts +7 -0
  74. package/dist/child-process-env.d.ts.map +1 -0
  75. package/dist/child-process-env.js +41 -0
  76. package/dist/child-process-env.js.map +1 -0
  77. package/dist/computer-relay-protocol.d.ts.map +1 -1
  78. package/dist/computer-relay-protocol.js +4 -4
  79. package/dist/computer-relay-protocol.js.map +1 -1
  80. package/dist/concurrency.d.ts +1 -1
  81. package/dist/concurrency.js +1 -1
  82. package/dist/connection-auth-util.d.ts +1 -0
  83. package/dist/connection-auth-util.d.ts.map +1 -1
  84. package/dist/connection-auth-util.js +1 -1
  85. package/dist/connection-auth-util.js.map +1 -1
  86. package/dist/connection-clients.d.ts +11 -3
  87. package/dist/connection-clients.d.ts.map +1 -1
  88. package/dist/connection-clients.js +71 -8
  89. package/dist/connection-clients.js.map +1 -1
  90. package/dist/connection-event-store.d.ts +98 -0
  91. package/dist/connection-event-store.d.ts.map +1 -0
  92. package/dist/connection-event-store.js +162 -0
  93. package/dist/connection-event-store.js.map +1 -0
  94. package/dist/connection-events.d.ts +51 -0
  95. package/dist/connection-events.d.ts.map +1 -0
  96. package/dist/connection-events.js +343 -0
  97. package/dist/connection-events.js.map +1 -0
  98. package/dist/connection-stores.d.ts +3 -0
  99. package/dist/connection-stores.d.ts.map +1 -1
  100. package/dist/connection-stores.js +4 -1
  101. package/dist/connection-stores.js.map +1 -1
  102. package/dist/connection-util.d.ts +3 -2
  103. package/dist/connection-util.d.ts.map +1 -1
  104. package/dist/connection-util.js +18 -1
  105. package/dist/connection-util.js.map +1 -1
  106. package/dist/connections.d.ts +54 -5
  107. package/dist/connections.d.ts.map +1 -1
  108. package/dist/connections.js +342 -53
  109. package/dist/connections.js.map +1 -1
  110. package/dist/context-policy-util.d.ts.map +1 -1
  111. package/dist/context-policy-util.js +1 -3
  112. package/dist/context-policy-util.js.map +1 -1
  113. package/dist/conversation-context.d.ts +6 -2
  114. package/dist/conversation-context.d.ts.map +1 -1
  115. package/dist/conversation-context.js +45 -12
  116. package/dist/conversation-context.js.map +1 -1
  117. package/dist/conversation-transcript.d.ts +8 -5
  118. package/dist/conversation-transcript.d.ts.map +1 -1
  119. package/dist/conversation-transcript.js +24 -5
  120. package/dist/conversation-transcript.js.map +1 -1
  121. package/dist/conversation-turn-coalescing.d.ts +22 -0
  122. package/dist/conversation-turn-coalescing.d.ts.map +1 -0
  123. package/dist/conversation-turn-coalescing.js +121 -0
  124. package/dist/conversation-turn-coalescing.js.map +1 -0
  125. package/dist/conversation-turn-dispatch.d.ts +5 -2
  126. package/dist/conversation-turn-dispatch.d.ts.map +1 -1
  127. package/dist/conversation-turn-dispatch.js +59 -22
  128. package/dist/conversation-turn-dispatch.js.map +1 -1
  129. package/dist/default-outbound-route.d.ts +29 -0
  130. package/dist/default-outbound-route.d.ts.map +1 -0
  131. package/dist/default-outbound-route.js +105 -0
  132. package/dist/default-outbound-route.js.map +1 -0
  133. package/dist/delivery-artifacts.d.ts +2 -0
  134. package/dist/delivery-artifacts.d.ts.map +1 -0
  135. package/dist/delivery-artifacts.js +34 -0
  136. package/dist/delivery-artifacts.js.map +1 -0
  137. package/dist/delivery-files.d.ts +5 -0
  138. package/dist/delivery-files.d.ts.map +1 -0
  139. package/dist/delivery-files.js +33 -0
  140. package/dist/delivery-files.js.map +1 -0
  141. package/dist/delivery-queue.d.ts +21 -1
  142. package/dist/delivery-queue.d.ts.map +1 -1
  143. package/dist/delivery-queue.js +144 -1
  144. package/dist/delivery-queue.js.map +1 -1
  145. package/dist/delivery-send.d.ts +2 -2
  146. package/dist/delivery-send.d.ts.map +1 -1
  147. package/dist/delivery-send.js +256 -100
  148. package/dist/delivery-send.js.map +1 -1
  149. package/dist/durable-files.d.ts +37 -0
  150. package/dist/durable-files.d.ts.map +1 -0
  151. package/dist/durable-files.js +63 -0
  152. package/dist/durable-files.js.map +1 -0
  153. package/dist/harness-loop.d.ts +6 -1
  154. package/dist/harness-loop.d.ts.map +1 -1
  155. package/dist/harness-loop.js +110 -25
  156. package/dist/harness-loop.js.map +1 -1
  157. package/dist/heic-transcode-worker.d.ts +2 -0
  158. package/dist/heic-transcode-worker.d.ts.map +1 -0
  159. package/dist/heic-transcode-worker.js +59 -0
  160. package/dist/heic-transcode-worker.js.map +1 -0
  161. package/dist/heic-transcode.d.ts +18 -0
  162. package/dist/heic-transcode.d.ts.map +1 -0
  163. package/dist/heic-transcode.js +99 -0
  164. package/dist/heic-transcode.js.map +1 -0
  165. package/dist/human-input-routing.d.ts +22 -0
  166. package/dist/human-input-routing.d.ts.map +1 -0
  167. package/dist/human-input-routing.js +26 -0
  168. package/dist/human-input-routing.js.map +1 -0
  169. package/dist/in-memory-conversation-turn-store.d.ts +3 -1
  170. package/dist/in-memory-conversation-turn-store.d.ts.map +1 -1
  171. package/dist/in-memory-conversation-turn-store.js +41 -2
  172. package/dist/in-memory-conversation-turn-store.js.map +1 -1
  173. package/dist/in-memory-run-store.d.ts +8 -0
  174. package/dist/in-memory-run-store.d.ts.map +1 -1
  175. package/dist/in-memory-run-store.js +28 -5
  176. package/dist/in-memory-run-store.js.map +1 -1
  177. package/dist/in-memory-sandbox-session-store.d.ts +2 -1
  178. package/dist/in-memory-sandbox-session-store.d.ts.map +1 -1
  179. package/dist/in-memory-sandbox-session-store.js +65 -1
  180. package/dist/in-memory-sandbox-session-store.js.map +1 -1
  181. package/dist/in-memory-small-stores.d.ts +18 -1
  182. package/dist/in-memory-small-stores.d.ts.map +1 -1
  183. package/dist/in-memory-small-stores.js +107 -1
  184. package/dist/in-memory-small-stores.js.map +1 -1
  185. package/dist/in-memory-workspace-store.d.ts +40 -0
  186. package/dist/in-memory-workspace-store.d.ts.map +1 -0
  187. package/dist/in-memory-workspace-store.js +370 -0
  188. package/dist/in-memory-workspace-store.js.map +1 -0
  189. package/dist/index.d.ts +73 -36
  190. package/dist/index.d.ts.map +1 -1
  191. package/dist/index.js +390 -258
  192. package/dist/index.js.map +1 -1
  193. package/dist/json-util.d.ts +8 -0
  194. package/dist/json-util.d.ts.map +1 -1
  195. package/dist/json-util.js +8 -0
  196. package/dist/json-util.js.map +1 -1
  197. package/dist/local-sandbox.d.ts +3 -2
  198. package/dist/local-sandbox.d.ts.map +1 -1
  199. package/dist/local-sandbox.js +69 -25
  200. package/dist/local-sandbox.js.map +1 -1
  201. package/dist/mcp-client.d.ts.map +1 -1
  202. package/dist/mcp-client.js +3 -2
  203. package/dist/mcp-client.js.map +1 -1
  204. package/dist/media-processor.d.ts +42 -0
  205. package/dist/media-processor.d.ts.map +1 -0
  206. package/dist/media-processor.js +2 -0
  207. package/dist/media-processor.js.map +1 -0
  208. package/dist/model-media.d.ts +13 -1
  209. package/dist/model-media.d.ts.map +1 -1
  210. package/dist/model-media.js +81 -18
  211. package/dist/model-media.js.map +1 -1
  212. package/dist/model-visible-interrupts.d.ts +10 -0
  213. package/dist/model-visible-interrupts.d.ts.map +1 -0
  214. package/dist/model-visible-interrupts.js +41 -0
  215. package/dist/model-visible-interrupts.js.map +1 -0
  216. package/dist/operator-controls.d.ts.map +1 -1
  217. package/dist/operator-controls.js +16 -3
  218. package/dist/operator-controls.js.map +1 -1
  219. package/dist/outbound-http-policy.d.ts +7 -0
  220. package/dist/outbound-http-policy.d.ts.map +1 -0
  221. package/dist/outbound-http-policy.js +155 -0
  222. package/dist/outbound-http-policy.js.map +1 -0
  223. package/dist/public-api.d.ts +21 -0
  224. package/dist/public-api.d.ts.map +1 -0
  225. package/dist/public-api.js +19 -0
  226. package/dist/public-api.js.map +1 -0
  227. package/dist/replay-resume.d.ts +8 -0
  228. package/dist/replay-resume.d.ts.map +1 -1
  229. package/dist/replay-resume.js +141 -11
  230. package/dist/replay-resume.js.map +1 -1
  231. package/dist/resource-projection-util.d.ts +1 -1
  232. package/dist/resource-projection-util.d.ts.map +1 -1
  233. package/dist/resource-projection-util.js +21 -10
  234. package/dist/resource-projection-util.js.map +1 -1
  235. package/dist/resource-projection.d.ts +8 -1
  236. package/dist/resource-projection.d.ts.map +1 -1
  237. package/dist/resource-projection.js +229 -29
  238. package/dist/resource-projection.js.map +1 -1
  239. package/dist/run-heartbeat.d.ts +12 -2
  240. package/dist/run-heartbeat.d.ts.map +1 -1
  241. package/dist/run-heartbeat.js +31 -4
  242. package/dist/run-heartbeat.js.map +1 -1
  243. package/dist/run-outcome.d.ts +9 -5
  244. package/dist/run-outcome.d.ts.map +1 -1
  245. package/dist/run-outcome.js +14 -5
  246. package/dist/run-outcome.js.map +1 -1
  247. package/dist/run-recovery.d.ts +19 -3
  248. package/dist/run-recovery.d.ts.map +1 -1
  249. package/dist/run-recovery.js +205 -34
  250. package/dist/run-recovery.js.map +1 -1
  251. package/dist/run-replay.d.ts +35 -0
  252. package/dist/run-replay.d.ts.map +1 -0
  253. package/dist/run-replay.js +193 -0
  254. package/dist/run-replay.js.map +1 -0
  255. package/dist/run-result.d.ts +4 -0
  256. package/dist/run-result.d.ts.map +1 -0
  257. package/dist/run-result.js +18 -0
  258. package/dist/run-result.js.map +1 -0
  259. package/dist/run-timeline-query.d.ts +38 -0
  260. package/dist/run-timeline-query.d.ts.map +1 -0
  261. package/dist/run-timeline-query.js +99 -0
  262. package/dist/run-timeline-query.js.map +1 -0
  263. package/dist/runs-query.d.ts.map +1 -1
  264. package/dist/runs-query.js +11 -3
  265. package/dist/runs-query.js.map +1 -1
  266. package/dist/runtime-bundle.d.ts.map +1 -1
  267. package/dist/runtime-bundle.js +2 -0
  268. package/dist/runtime-bundle.js.map +1 -1
  269. package/dist/runtime-learning.d.ts +15 -13
  270. package/dist/runtime-learning.d.ts.map +1 -1
  271. package/dist/runtime-learning.js +79 -58
  272. package/dist/runtime-learning.js.map +1 -1
  273. package/dist/runtime-types.d.ts +68 -9
  274. package/dist/runtime-types.d.ts.map +1 -1
  275. package/dist/sandbox-fs.d.ts +8 -5
  276. package/dist/sandbox-fs.d.ts.map +1 -1
  277. package/dist/sandbox-fs.js +30 -31
  278. package/dist/sandbox-fs.js.map +1 -1
  279. package/dist/sandbox-handle.d.ts +25 -0
  280. package/dist/sandbox-handle.d.ts.map +1 -0
  281. package/dist/sandbox-handle.js +120 -0
  282. package/dist/sandbox-handle.js.map +1 -0
  283. package/dist/sandbox-session-identity.d.ts +14 -0
  284. package/dist/sandbox-session-identity.d.ts.map +1 -0
  285. package/dist/sandbox-session-identity.js +33 -0
  286. package/dist/sandbox-session-identity.js.map +1 -0
  287. package/dist/sandbox-session-key.d.ts.map +1 -1
  288. package/dist/sandbox-session-key.js +12 -9
  289. package/dist/sandbox-session-key.js.map +1 -1
  290. package/dist/sandbox-session-lifecycle.d.ts.map +1 -1
  291. package/dist/sandbox-session-lifecycle.js +187 -44
  292. package/dist/sandbox-session-lifecycle.js.map +1 -1
  293. package/dist/sandbox-snapshot-policy.js +3 -3
  294. package/dist/sandbox-snapshot-policy.js.map +1 -1
  295. package/dist/sandbox-state-sync.d.ts +4 -2
  296. package/dist/sandbox-state-sync.d.ts.map +1 -1
  297. package/dist/sandbox-state-sync.js +47 -15
  298. package/dist/sandbox-state-sync.js.map +1 -1
  299. package/dist/sandbox-sync-worker.d.ts +11 -2
  300. package/dist/sandbox-sync-worker.d.ts.map +1 -1
  301. package/dist/sandbox-sync-worker.js +143 -31
  302. package/dist/sandbox-sync-worker.js.map +1 -1
  303. package/dist/schedule-execution.d.ts.map +1 -1
  304. package/dist/schedule-execution.js +127 -23
  305. package/dist/schedule-execution.js.map +1 -1
  306. package/dist/sdk-api-client.d.ts +17 -0
  307. package/dist/sdk-api-client.d.ts.map +1 -0
  308. package/dist/sdk-api-client.js +55 -0
  309. package/dist/sdk-api-client.js.map +1 -0
  310. package/dist/security.js +2 -2
  311. package/dist/security.js.map +1 -1
  312. package/dist/self-improvement.d.ts +5 -1
  313. package/dist/self-improvement.d.ts.map +1 -1
  314. package/dist/self-improvement.js +28 -14
  315. package/dist/self-improvement.js.map +1 -1
  316. package/dist/skill-bundles.d.ts +55 -0
  317. package/dist/skill-bundles.d.ts.map +1 -0
  318. package/dist/skill-bundles.js +134 -0
  319. package/dist/skill-bundles.js.map +1 -0
  320. package/dist/source-loader.js +7 -7
  321. package/dist/source-loader.js.map +1 -1
  322. package/dist/state-store-helpers.d.ts +2 -0
  323. package/dist/state-store-helpers.d.ts.map +1 -1
  324. package/dist/state-store-helpers.js +11 -1
  325. package/dist/state-store-helpers.js.map +1 -1
  326. package/dist/state-stores.d.ts +1 -0
  327. package/dist/state-stores.d.ts.map +1 -1
  328. package/dist/state-stores.js +26 -7
  329. package/dist/state-stores.js.map +1 -1
  330. package/dist/state.d.ts +305 -5
  331. package/dist/state.d.ts.map +1 -1
  332. package/dist/state.js +41 -2
  333. package/dist/state.js.map +1 -1
  334. package/dist/storage.d.ts +47 -2
  335. package/dist/storage.d.ts.map +1 -1
  336. package/dist/storage.js +158 -6
  337. package/dist/storage.js.map +1 -1
  338. package/dist/subagent-execution.d.ts +1 -1
  339. package/dist/subagent-execution.d.ts.map +1 -1
  340. package/dist/subagent-execution.js +10 -12
  341. package/dist/subagent-execution.js.map +1 -1
  342. package/dist/target-instructions.js +1 -1
  343. package/dist/target-instructions.js.map +1 -1
  344. package/dist/tool-apis.d.ts.map +1 -1
  345. package/dist/tool-apis.js +33 -9
  346. package/dist/tool-apis.js.map +1 -1
  347. package/dist/tool-execution.d.ts +22 -12
  348. package/dist/tool-execution.d.ts.map +1 -1
  349. package/dist/tool-execution.js +368 -238
  350. package/dist/tool-execution.js.map +1 -1
  351. package/dist/turn-media.d.ts +29 -0
  352. package/dist/turn-media.d.ts.map +1 -0
  353. package/dist/turn-media.js +233 -0
  354. package/dist/turn-media.js.map +1 -0
  355. package/dist/usage-reconciliation.d.ts +1 -1
  356. package/dist/usage-reconciliation.js +1 -1
  357. package/dist/workspace-id.d.ts +10 -0
  358. package/dist/workspace-id.d.ts.map +1 -0
  359. package/dist/workspace-id.js +55 -0
  360. package/dist/workspace-id.js.map +1 -0
  361. package/dist/workspace-manifest.d.ts +24 -0
  362. package/dist/workspace-manifest.d.ts.map +1 -0
  363. package/dist/workspace-manifest.js +111 -0
  364. package/dist/workspace-manifest.js.map +1 -0
  365. package/dist/workspace-operation-limiter.d.ts +16 -0
  366. package/dist/workspace-operation-limiter.d.ts.map +1 -0
  367. package/dist/workspace-operation-limiter.js +31 -0
  368. package/dist/workspace-operation-limiter.js.map +1 -0
  369. package/dist/workspace-operations.d.ts +145 -0
  370. package/dist/workspace-operations.d.ts.map +1 -0
  371. package/dist/workspace-operations.js +420 -0
  372. package/dist/workspace-operations.js.map +1 -0
  373. package/dist/workspace-runtime.d.ts +110 -0
  374. package/dist/workspace-runtime.d.ts.map +1 -0
  375. package/dist/workspace-runtime.js +240 -0
  376. package/dist/workspace-runtime.js.map +1 -0
  377. package/dist/workspace-search.d.ts +55 -0
  378. package/dist/workspace-search.d.ts.map +1 -0
  379. package/dist/workspace-search.js +262 -0
  380. package/dist/workspace-search.js.map +1 -0
  381. package/dist/workspace-service.d.ts +173 -0
  382. package/dist/workspace-service.d.ts.map +1 -0
  383. package/dist/workspace-service.js +619 -0
  384. package/dist/workspace-service.js.map +1 -0
  385. package/dist/workspace.d.ts +7 -0
  386. package/dist/workspace.d.ts.map +1 -0
  387. package/dist/workspace.js +7 -0
  388. package/dist/workspace.js.map +1 -0
  389. package/package.json +7 -4
@@ -1,4 +1,9 @@
1
- import { approvalNever, normalizeSandboxPath as normalizeCoreSandboxPath } from "@assemblyline-agents/core";
1
+ import { createHash } from "node:crypto";
2
+ import { approvalNever, approvalRequired, normalizeSandboxPath as normalizeCoreSandboxPath } from "@assemblyline-agents/core";
3
+ import { DEFAULT_DELIVERY_FILE_MAX_BYTES, deliveryFileContentType } from "./delivery-queue.js";
4
+ import { internalDeliveryArtifactReason } from "./delivery-artifacts.js";
5
+ import { boundedPositiveIntEnv } from "./env-config.js";
6
+ import { workspaceContentBlobKey } from "./workspace-service.js";
2
7
  export const READ_TOOL_NAME = "read";
3
8
  export const WRITE_TOOL_NAME = "write";
4
9
  export const EDIT_TOOL_NAME = "edit";
@@ -6,11 +11,19 @@ export const DELETE_TOOL_NAME = "delete";
6
11
  export const LIST_TOOL_NAME = "list";
7
12
  export const GREP_TOOL_NAME = "grep";
8
13
  export const BASH_TOOL_NAME = "bash";
9
- export const ASK_QUESTION_TOOL_NAME = "ask_question";
14
+ export const DELIVER_ARTIFACT_TOOL_NAME = "deliver_artifact";
10
15
  export const LOAD_SKILL_TOOL_NAME = "load_skill";
11
16
  export const TOOL_SEARCH_TOOL_NAME = "tool_search";
12
- export const TOOL_DESCRIBE_TOOL_NAME = "tool_describe";
13
- export const TOOL_CALL_TOOL_NAME = "tool_call";
17
+ export const PAIR_TOOL_NAME = "pair";
18
+ export const HISTORY_SEARCH_TOOL_NAME = "history_search";
19
+ export const FILES_SEARCH_TOOL_NAME = "files_search";
20
+ export const FILES_MOUNT_TOOL_NAME = "files_mount";
21
+ export const WORKSPACE_SEARCH_TOOL_NAME = "workspace_search";
22
+ export const WORKSPACE_STATUS_TOOL_NAME = "workspace_status";
23
+ export const WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME = "workspace_checkpoint_create";
24
+ export const WORKSPACE_CHECKPOINT_LIST_TOOL_NAME = "workspace_checkpoint_list";
25
+ export const WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME = "workspace_checkpoint_restore";
26
+ export const WORKSPACE_FORK_TOOL_NAME = "workspace_fork";
14
27
  export const CORE_HARNESS_TOOL_NAMES = [
15
28
  READ_TOOL_NAME,
16
29
  WRITE_TOOL_NAME,
@@ -19,11 +32,19 @@ export const CORE_HARNESS_TOOL_NAMES = [
19
32
  LIST_TOOL_NAME,
20
33
  GREP_TOOL_NAME,
21
34
  BASH_TOOL_NAME,
22
- ASK_QUESTION_TOOL_NAME,
35
+ DELIVER_ARTIFACT_TOOL_NAME,
23
36
  LOAD_SKILL_TOOL_NAME,
24
37
  TOOL_SEARCH_TOOL_NAME,
25
- TOOL_DESCRIBE_TOOL_NAME,
26
- TOOL_CALL_TOOL_NAME
38
+ PAIR_TOOL_NAME,
39
+ HISTORY_SEARCH_TOOL_NAME,
40
+ FILES_SEARCH_TOOL_NAME,
41
+ FILES_MOUNT_TOOL_NAME,
42
+ WORKSPACE_SEARCH_TOOL_NAME,
43
+ WORKSPACE_STATUS_TOOL_NAME,
44
+ WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME,
45
+ WORKSPACE_CHECKPOINT_LIST_TOOL_NAME,
46
+ WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME,
47
+ WORKSPACE_FORK_TOOL_NAME
27
48
  ];
28
49
  const CORE_HARNESS_TOOL_NAME_SET = new Set(CORE_HARNESS_TOOL_NAMES);
29
50
  const BUILTIN_SOURCE = {
@@ -36,7 +57,7 @@ const PATH_SCHEMA = {
36
57
  };
37
58
  const READ_COMPILED_TOOL = {
38
59
  name: READ_TOOL_NAME,
39
- description: "Read a file from the sandbox filesystem. Lazily hydrates logical OpenEve paths before reading.",
60
+ description: "Read a file from the sandbox filesystem. Lazily hydrates logical Assembly Line paths before reading.",
40
61
  inputSchema: {
41
62
  type: "object",
42
63
  additionalProperties: false,
@@ -80,7 +101,7 @@ const WRITE_COMPILED_TOOL = {
80
101
  };
81
102
  const EDIT_COMPILED_TOOL = {
82
103
  name: EDIT_TOOL_NAME,
83
- description: "Edit a sandbox file by replacing exact text. Hydrates the path first when it is a logical OpenEve resource.",
104
+ description: "Edit a sandbox file by replacing exact text. Hydrates the path first when it is a logical Assembly Line resource.",
84
105
  inputSchema: {
85
106
  type: "object",
86
107
  additionalProperties: false,
@@ -125,7 +146,7 @@ const DELETE_COMPILED_TOOL = {
125
146
  };
126
147
  const LIST_COMPILED_TOOL = {
127
148
  name: LIST_TOOL_NAME,
128
- description: "List files under a sandbox path. Lazily hydrates bounded logical OpenEve roots before listing.",
149
+ description: "List files under a sandbox path. Lazily hydrates bounded logical Assembly Line roots before listing.",
129
150
  inputSchema: {
130
151
  type: "object",
131
152
  additionalProperties: false,
@@ -189,26 +210,26 @@ const BASH_COMPILED_TOOL = {
189
210
  hasToModelOutput: true,
190
211
  source: BUILTIN_SOURCE
191
212
  };
192
- const ASK_QUESTION_COMPILED_TOOL = {
193
- name: ASK_QUESTION_TOOL_NAME,
194
- description: "Ask the user a concise clarifying question and pause the run until the answer is available.",
213
+ const DELIVER_ARTIFACT_COMPILED_TOOL = {
214
+ name: DELIVER_ARTIFACT_TOOL_NAME,
215
+ description: "Required for file delivery: select one completed /workspace file for exact attachment to the user. Call once for each file the final answer should attach; a link in the final answer does not attach a file.",
195
216
  inputSchema: {
196
217
  type: "object",
197
218
  additionalProperties: false,
198
219
  properties: {
199
- question: { type: "string" },
200
- choices: { type: "array", items: { type: "string" } },
201
- allowFreeform: { type: "boolean" },
202
- metadata: { type: "object", additionalProperties: true }
220
+ path: {
221
+ type: "string",
222
+ description: "Exact non-reserved /workspace file path to deliver, such as /workspace/Investment_Memo.xlsx."
223
+ }
203
224
  },
204
- required: ["question"]
225
+ required: ["path"]
205
226
  },
206
227
  needsApproval: approvalNever(),
207
228
  defaultEnabled: true,
208
229
  visibility: "always",
209
230
  execution: "direct",
210
- tags: ["human", "question"],
211
- aliases: ["clarify"],
231
+ tags: ["artifact", "delivery", "workspace", "file"],
232
+ aliases: ["send_file", "attach_file"],
212
233
  hasToModelOutput: true,
213
234
  source: BUILTIN_SOURCE
214
235
  };
@@ -234,7 +255,7 @@ const LOAD_SKILL_COMPILED_TOOL = {
234
255
  };
235
256
  const TOOL_SEARCH_COMPILED_TOOL = {
236
257
  name: TOOL_SEARCH_TOOL_NAME,
237
- description: "Search deferred non-core tools by name, description, tags, aliases, or connection. Returns compact metadata only.",
258
+ description: "Find and activate deferred framework, authored, and connection tools. Matching tools become directly callable.",
238
259
  inputSchema: {
239
260
  type: "object",
240
261
  additionalProperties: false,
@@ -255,45 +276,209 @@ const TOOL_SEARCH_COMPILED_TOOL = {
255
276
  hasToModelOutput: true,
256
277
  source: BUILTIN_SOURCE
257
278
  };
258
- const TOOL_DESCRIBE_COMPILED_TOOL = {
259
- name: TOOL_DESCRIBE_TOOL_NAME,
260
- description: "Return the full schema for one deferred tool previously found with tool_search.",
279
+ // The universal connection-pairing entry point. Deliberately a default-enabled
280
+ // core tool rather than a discovered connection tool: a pasted binding packet
281
+ // is often the FIRST interaction with a connection, so its landing spot must
282
+ // not depend on the discovery chain (tool_search → connection metadata) that
283
+ // breaks precisely when a connection is misconfigured. It remains visible even
284
+ // when no connection is configured so the model can explain that state.
285
+ const PAIR_COMPILED_TOOL = {
286
+ name: PAIR_TOOL_NAME,
287
+ description: "Pair a connection by redeeming a one-time pairing packet or claim code. When the user pastes binding or pairing instructions for a connection, call this with the FULL pasted text as `secret`; the host exchanges the code and stores the credential durably. Only call this for a supplied packet; the tool's presence does not mean an existing grant is missing. Omit `connection` when only one connection supports pairing.",
261
288
  inputSchema: {
262
289
  type: "object",
263
290
  additionalProperties: false,
264
291
  properties: {
265
- name: { type: "string" }
292
+ connection: {
293
+ type: "string",
294
+ description: "Connection name to pair. Optional when exactly one live connection supports pairing."
295
+ },
296
+ secret: {
297
+ type: "string",
298
+ description: "The full pasted pairing packet, binding instructions, or one-time claim code."
299
+ }
266
300
  },
267
- required: ["name"]
301
+ required: ["secret"]
268
302
  },
269
303
  needsApproval: approvalNever(),
270
304
  defaultEnabled: true,
271
305
  visibility: "always",
272
306
  execution: "direct",
273
- tags: ["tools", "deferred", "describe"],
274
- aliases: ["schema"],
307
+ tags: ["connections", "pairing", "credentials"],
308
+ aliases: ["bind", "pair_connection"],
275
309
  hasToModelOutput: true,
276
310
  source: BUILTIN_SOURCE
277
311
  };
278
- const TOOL_CALL_COMPILED_TOOL = {
279
- name: TOOL_CALL_TOOL_NAME,
280
- description: "Call a deferred non-core tool by name with JSON arguments. The underlying tool is logged and policy-checked directly.",
312
+ const HISTORY_SEARCH_COMPILED_TOOL = {
313
+ name: HISTORY_SEARCH_TOOL_NAME,
314
+ description: "Search attributed conversation and channel history without loading the full history into the prompt. Access scope is enforced by the runtime.",
281
315
  inputSchema: {
282
316
  type: "object",
283
317
  additionalProperties: false,
284
318
  properties: {
285
- name: { type: "string" },
286
- arguments: { type: "object", additionalProperties: true },
287
- input: { type: "object", additionalProperties: true }
319
+ query: { type: "string", description: "Words or concepts to find." },
320
+ scope: {
321
+ type: "string",
322
+ enum: ["current_conversation", "current_channel", "my_conversations"],
323
+ description: "History boundary. Defaults to the current conversation."
324
+ },
325
+ limit: { type: "number", description: "Maximum results. Defaults to 8 and is capped at 50." }
288
326
  },
289
- required: ["name"]
327
+ required: ["query"]
328
+ },
329
+ needsApproval: approvalNever(),
330
+ defaultEnabled: false,
331
+ visibility: "deferred",
332
+ execution: "direct",
333
+ tags: ["history", "search", "conversations", "channels"],
334
+ aliases: ["conversation_search", "search_history"],
335
+ hasToModelOutput: true,
336
+ source: BUILTIN_SOURCE
337
+ };
338
+ const FILES_SEARCH_COMPILED_TOOL = {
339
+ name: FILES_SEARCH_TOOL_NAME,
340
+ description: "Find files previously shared or created in the current durable workspace. Omit query to list the most recent files.",
341
+ inputSchema: {
342
+ type: "object",
343
+ additionalProperties: false,
344
+ properties: {
345
+ query: { type: "string", description: "Optional filename, path, or file id fragment." },
346
+ limit: { type: "number", description: "Maximum results. Defaults to 50 and is capped at 200." }
347
+ }
348
+ },
349
+ needsApproval: approvalNever(),
350
+ defaultEnabled: true,
351
+ visibility: "always",
352
+ execution: "direct",
353
+ tags: ["files", "search", "workspace", "durability"],
354
+ aliases: ["files_list", "attachments_search"],
355
+ hasToModelOutput: true,
356
+ source: BUILTIN_SOURCE
357
+ };
358
+ const FILES_MOUNT_COMPILED_TOOL = {
359
+ name: FILES_MOUNT_TOOL_NAME,
360
+ description: "Mount one durable workspace file into the current sandbox at the returned read-only /files/library path.",
361
+ inputSchema: {
362
+ type: "object",
363
+ additionalProperties: false,
364
+ properties: {
365
+ fileId: { type: "string", description: "Exact file id returned by files_search." }
366
+ },
367
+ required: ["fileId"]
290
368
  },
291
369
  needsApproval: approvalNever(),
292
370
  defaultEnabled: true,
293
371
  visibility: "always",
372
+ execution: "sandbox",
373
+ tags: ["files", "sandbox", "workspace", "durability"],
374
+ aliases: ["mount_file", "attachment_mount"],
375
+ hasToModelOutput: true,
376
+ source: BUILTIN_SOURCE
377
+ };
378
+ const WORKSPACE_STATUS_COMPILED_TOOL = {
379
+ name: WORKSPACE_STATUS_TOOL_NAME,
380
+ description: "Show the current durable workspace head, size, version count, and named checkpoints.",
381
+ inputSchema: { type: "object", additionalProperties: false, properties: {} },
382
+ needsApproval: approvalNever(),
383
+ defaultEnabled: false,
384
+ visibility: "deferred",
385
+ execution: "direct",
386
+ tags: ["workspace", "versions", "status"],
387
+ aliases: ["workspace_info"],
388
+ hasToModelOutput: true,
389
+ source: BUILTIN_SOURCE
390
+ };
391
+ const WORKSPACE_SEARCH_COMPILED_TOOL = {
392
+ name: WORKSPACE_SEARCH_TOOL_NAME,
393
+ description: "Search a committed durable workspace without hydrating it. Results identify the exact version and ranking source.",
394
+ inputSchema: {
395
+ type: "object",
396
+ additionalProperties: false,
397
+ properties: {
398
+ query: { type: "string", description: "Words or concepts to find." },
399
+ versionId: { type: "string", description: "Optional committed version. Defaults to the current head." },
400
+ limit: { type: "number", description: "Maximum results. Defaults to 8 and is capped at 100." }
401
+ },
402
+ required: ["query"]
403
+ },
404
+ needsApproval: approvalNever(),
405
+ defaultEnabled: false,
406
+ visibility: "deferred",
294
407
  execution: "direct",
295
- tags: ["tools", "deferred", "call"],
296
- aliases: ["invoke"],
408
+ tags: ["workspace", "search", "versions"],
409
+ aliases: ["search_workspace"],
410
+ hasToModelOutput: true,
411
+ source: BUILTIN_SOURCE
412
+ };
413
+ const WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL = {
414
+ name: WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME,
415
+ description: "Name the current committed workspace version without copying its files.",
416
+ inputSchema: {
417
+ type: "object",
418
+ additionalProperties: false,
419
+ properties: {
420
+ name: { type: "string", description: "Workspace-local checkpoint name." },
421
+ replace: { type: "boolean", description: "Replace an existing name. Defaults to false." }
422
+ },
423
+ required: ["name"]
424
+ },
425
+ needsApproval: approvalNever(),
426
+ defaultEnabled: false,
427
+ visibility: "deferred",
428
+ execution: "direct",
429
+ tags: ["workspace", "checkpoint", "versions"],
430
+ aliases: ["workspace_savepoint"],
431
+ hasToModelOutput: true,
432
+ source: BUILTIN_SOURCE
433
+ };
434
+ const WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL = {
435
+ name: WORKSPACE_CHECKPOINT_LIST_TOOL_NAME,
436
+ description: "List named checkpoints for the current durable workspace.",
437
+ inputSchema: { type: "object", additionalProperties: false, properties: {} },
438
+ needsApproval: approvalNever(),
439
+ defaultEnabled: false,
440
+ visibility: "deferred",
441
+ execution: "direct",
442
+ tags: ["workspace", "checkpoint", "list"],
443
+ aliases: ["workspace_savepoints"],
444
+ hasToModelOutput: true,
445
+ source: BUILTIN_SOURCE
446
+ };
447
+ const WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL = {
448
+ name: WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME,
449
+ description: "Restore a named checkpoint as a new workspace head while preserving all later versions.",
450
+ inputSchema: {
451
+ type: "object",
452
+ additionalProperties: false,
453
+ properties: { name: { type: "string", description: "Checkpoint name to restore." } },
454
+ required: ["name"]
455
+ },
456
+ needsApproval: approvalRequired("Restoring replaces the current workspace tree with a prior committed version."),
457
+ defaultEnabled: false,
458
+ visibility: "deferred",
459
+ execution: "direct",
460
+ tags: ["workspace", "checkpoint", "restore"],
461
+ aliases: ["workspace_rollback"],
462
+ hasToModelOutput: true,
463
+ source: BUILTIN_SOURCE
464
+ };
465
+ const WORKSPACE_FORK_COMPILED_TOOL = {
466
+ name: WORKSPACE_FORK_TOOL_NAME,
467
+ description: "Create an independent copy-on-write workspace from the current head or a named checkpoint.",
468
+ inputSchema: {
469
+ type: "object",
470
+ additionalProperties: false,
471
+ properties: {
472
+ name: { type: "string", description: "Optional display name for the new workspace." },
473
+ checkpoint: { type: "string", description: "Optional checkpoint to fork instead of the current head." }
474
+ }
475
+ },
476
+ needsApproval: approvalNever(),
477
+ defaultEnabled: false,
478
+ visibility: "deferred",
479
+ execution: "direct",
480
+ tags: ["workspace", "fork", "branch"],
481
+ aliases: ["workspace_branch"],
297
482
  hasToModelOutput: true,
298
483
  source: BUILTIN_SOURCE
299
484
  };
@@ -305,16 +490,24 @@ const BUILT_IN_COMPILED_TOOLS = [
305
490
  LIST_COMPILED_TOOL,
306
491
  GREP_COMPILED_TOOL,
307
492
  BASH_COMPILED_TOOL,
308
- ASK_QUESTION_COMPILED_TOOL,
493
+ DELIVER_ARTIFACT_COMPILED_TOOL,
309
494
  LOAD_SKILL_COMPILED_TOOL,
310
495
  TOOL_SEARCH_COMPILED_TOOL,
311
- TOOL_DESCRIBE_COMPILED_TOOL,
312
- TOOL_CALL_COMPILED_TOOL
496
+ PAIR_COMPILED_TOOL,
497
+ HISTORY_SEARCH_COMPILED_TOOL,
498
+ FILES_SEARCH_COMPILED_TOOL,
499
+ FILES_MOUNT_COMPILED_TOOL,
500
+ WORKSPACE_SEARCH_COMPILED_TOOL,
501
+ WORKSPACE_STATUS_COMPILED_TOOL,
502
+ WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL,
503
+ WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL,
504
+ WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL,
505
+ WORKSPACE_FORK_COMPILED_TOOL
313
506
  ];
314
- export function runtimeToolsForManifest(manifest) {
315
- const builtInNamed = new Map(manifest.tools.filter((tool) => CORE_HARNESS_TOOL_NAME_SET.has(tool.name)).map((tool) => [tool.name, tool]));
507
+ export function runtimeToolsForSurface(authoredTools) {
508
+ const builtInNamed = new Map(authoredTools.filter((tool) => CORE_HARNESS_TOOL_NAME_SET.has(tool.name)).map((tool) => [tool.name, tool]));
316
509
  return [
317
- ...manifest.tools.filter((tool) => !CORE_HARNESS_TOOL_NAME_SET.has(tool.name) && !tool.disabled),
510
+ ...authoredTools.filter((tool) => !CORE_HARNESS_TOOL_NAME_SET.has(tool.name) && !tool.disabled),
318
511
  ...BUILT_IN_COMPILED_TOOLS.flatMap((builtin) => {
319
512
  const authored = builtInNamed.get(builtin.name);
320
513
  if (!authored)
@@ -342,16 +535,32 @@ export function builtInToolDefinition(name) {
342
535
  return grepToolDefinition;
343
536
  if (name === BASH_TOOL_NAME)
344
537
  return bashToolDefinition;
345
- if (name === ASK_QUESTION_TOOL_NAME)
346
- return askQuestionToolDefinition;
538
+ if (name === DELIVER_ARTIFACT_TOOL_NAME)
539
+ return deliverArtifactToolDefinition;
347
540
  if (name === LOAD_SKILL_TOOL_NAME)
348
541
  return runtimeHandledToolDefinition(LOAD_SKILL_COMPILED_TOOL);
349
542
  if (name === TOOL_SEARCH_TOOL_NAME)
350
543
  return runtimeHandledToolDefinition(TOOL_SEARCH_COMPILED_TOOL);
351
- if (name === TOOL_DESCRIBE_TOOL_NAME)
352
- return runtimeHandledToolDefinition(TOOL_DESCRIBE_COMPILED_TOOL);
353
- if (name === TOOL_CALL_TOOL_NAME)
354
- return runtimeHandledToolDefinition(TOOL_CALL_COMPILED_TOOL);
544
+ if (name === PAIR_TOOL_NAME)
545
+ return runtimeHandledToolDefinition(PAIR_COMPILED_TOOL);
546
+ if (name === HISTORY_SEARCH_TOOL_NAME)
547
+ return runtimeHandledToolDefinition(HISTORY_SEARCH_COMPILED_TOOL);
548
+ if (name === FILES_SEARCH_TOOL_NAME)
549
+ return runtimeHandledToolDefinition(FILES_SEARCH_COMPILED_TOOL);
550
+ if (name === FILES_MOUNT_TOOL_NAME)
551
+ return runtimeHandledToolDefinition(FILES_MOUNT_COMPILED_TOOL);
552
+ if (name === WORKSPACE_SEARCH_TOOL_NAME)
553
+ return runtimeHandledToolDefinition(WORKSPACE_SEARCH_COMPILED_TOOL);
554
+ if (name === WORKSPACE_STATUS_TOOL_NAME)
555
+ return runtimeHandledToolDefinition(WORKSPACE_STATUS_COMPILED_TOOL);
556
+ if (name === WORKSPACE_CHECKPOINT_CREATE_TOOL_NAME)
557
+ return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_CREATE_COMPILED_TOOL);
558
+ if (name === WORKSPACE_CHECKPOINT_LIST_TOOL_NAME)
559
+ return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_LIST_COMPILED_TOOL);
560
+ if (name === WORKSPACE_CHECKPOINT_RESTORE_TOOL_NAME)
561
+ return runtimeHandledToolDefinition(WORKSPACE_CHECKPOINT_RESTORE_COMPILED_TOOL);
562
+ if (name === WORKSPACE_FORK_TOOL_NAME)
563
+ return runtimeHandledToolDefinition(WORKSPACE_FORK_COMPILED_TOOL);
355
564
  return undefined;
356
565
  }
357
566
  export function isBuiltInToolName(name) {
@@ -485,22 +694,53 @@ const bashToolDefinition = {
485
694
  return sandbox.shell(command, options);
486
695
  }
487
696
  };
488
- const askQuestionToolDefinition = {
489
- ...toolDefinitionBase(ASK_QUESTION_COMPILED_TOOL),
697
+ const deliverArtifactToolDefinition = {
698
+ ...toolDefinitionBase(DELIVER_ARTIFACT_COMPILED_TOOL),
490
699
  async execute(input, ctx) {
491
700
  const raw = recordInput(input);
492
- const question = typeof raw.question === "string" ? raw.question.trim() : "";
493
- if (!question)
494
- throw new Error("ask_question requires a non-empty question.");
495
- const options = {};
496
- if (Array.isArray(raw.choices))
497
- options.choices = raw.choices.map(String).filter(Boolean);
498
- if (typeof raw.allowFreeform === "boolean")
499
- options.allowFreeform = raw.allowFreeform;
500
- if (raw.metadata && typeof raw.metadata === "object" && !Array.isArray(raw.metadata)) {
501
- options.metadata = raw.metadata;
701
+ const path = requiredPath(raw.path);
702
+ if (!path.startsWith("/workspace/") || path === "/workspace/") {
703
+ throw new Error("deliver_artifact requires an exact file path below /workspace.");
502
704
  }
503
- return ctx.askQuestion(question, options);
705
+ const relativePath = path.slice("/workspace/".length);
706
+ const topLevel = relativePath.split("/", 1)[0] ?? "";
707
+ if (["memory", "skills", "history", "files", ".agents", ".assembly-line"].includes(topLevel)) {
708
+ throw new Error(`deliver_artifact cannot deliver reserved workspace path ${path}.`);
709
+ }
710
+ if (internalDeliveryArtifactReason(relativePath)) {
711
+ throw new Error(`deliver_artifact cannot deliver internal or cache path ${path}.`);
712
+ }
713
+ await ctx.hydrateSandboxPath?.(path);
714
+ const sandbox = await ctx.getSandbox();
715
+ if (!sandbox.readFileBytes) {
716
+ throw new Error("deliver_artifact requires a sandbox adapter with byte-preserving exact file reads.");
717
+ }
718
+ const contents = await sandbox.readFileBytes(path);
719
+ const bytes = Buffer.from(contents);
720
+ const sizeBytes = bytes.byteLength;
721
+ const maxBytes = boundedPositiveIntEnv(ctx.channel?.env.ASSEMBLY_LINE_DELIVERY_FILE_MAX_BYTES, DEFAULT_DELIVERY_FILE_MAX_BYTES, 1, 1024 * 1024 * 1024);
722
+ if (sizeBytes > maxBytes) {
723
+ throw new Error(`Selected delivery artifact ${path} is ${sizeBytes} bytes, exceeding the configured limit of ${maxBytes}.`);
724
+ }
725
+ if (!ctx.blob)
726
+ throw new Error("deliver_artifact requires blob storage.");
727
+ const contentType = deliveryFileContentType(relativePath);
728
+ const sha256 = createHash("sha256").update(bytes).digest("hex");
729
+ const blob = await ctx.blob.put(workspaceContentBlobKey(sha256), bytes, { contentType, visibility: "private" });
730
+ await ctx.emit("artifact.delivery_selected", {
731
+ path,
732
+ relativePath,
733
+ sizeBytes: blob.size,
734
+ contentType,
735
+ sha256: blob.sha256,
736
+ blobKey: blob.key
737
+ });
738
+ return {
739
+ path,
740
+ sizeBytes,
741
+ downloadUrl: `sandbox:${path}`,
742
+ selectedForDelivery: true
743
+ };
504
744
  }
505
745
  };
506
746
  function toolDefinitionBase(tool) {
@@ -508,7 +748,6 @@ function toolDefinitionBase(tool) {
508
748
  description: tool.description,
509
749
  inputSchema: tool.inputSchema,
510
750
  needsApproval: false,
511
- defaultEnabled: tool.defaultEnabled,
512
751
  capability: {
513
752
  visibility: tool.visibility,
514
753
  execution: tool.execution,
@@ -527,7 +766,7 @@ function runtimeHandledToolDefinition(tool) {
527
766
  return {
528
767
  ...toolDefinitionBase(tool),
529
768
  async execute() {
530
- throw new Error(`${tool.name} is handled by the OpenEve runtime dispatcher.`);
769
+ throw new Error(`${tool.name} is handled by the Assembly Line runtime dispatcher.`);
531
770
  }
532
771
  };
533
772
  }
@@ -559,8 +798,8 @@ function boundedNumber(value, fallback, min, max) {
559
798
  async function listSandboxEntries(sandbox, path, limit) {
560
799
  if (!sandbox.listFiles)
561
800
  throw new Error("This sandbox adapter does not support file listing.");
562
- const entries = await sandbox.listFiles(path);
563
- return entries.slice(0, limit).map((entry) => {
801
+ const entries = await sandbox.listFiles(path, { limit, includeContents: false });
802
+ return entries.map((entry) => {
564
803
  const out = { path: entry.path };
565
804
  if (entry.size !== undefined)
566
805
  out.size = entry.size;
@@ -570,7 +809,7 @@ async function listSandboxEntries(sandbox, path, limit) {
570
809
  async function grepSandbox(sandbox, path, pattern, literal, limit) {
571
810
  if (!sandbox.listFiles)
572
811
  throw new Error("This sandbox adapter does not support grep without file listing.");
573
- const entries = await sandbox.listFiles(path);
812
+ const entries = await sandbox.listFiles(path, { includeContents: true });
574
813
  const matches = [];
575
814
  const regexp = literal ? undefined : new RegExp(pattern, "u");
576
815
  for (const entry of entries) {
@@ -627,8 +866,8 @@ export function builtInToolContext(tool) {
627
866
  *
628
867
  * export default defineTool({ ...builtInToolDefaults.write, execute: guarded });
629
868
  *
630
- * The deferred bridge tools (load_skill, tool_search, tool_describe, tool_call)
631
- * are runtime-handled and have no wrappable executor, so they are not listed.
869
+ * The discovery tools (load_skill and tool_search) are runtime-handled and have
870
+ * no wrappable executor, so they are not listed.
632
871
  */
633
872
  export const builtInToolDefaults = Object.freeze({
634
873
  read: readToolDefinition,
@@ -638,6 +877,6 @@ export const builtInToolDefaults = Object.freeze({
638
877
  list: listToolDefinition,
639
878
  grep: grepToolDefinition,
640
879
  bash: bashToolDefinition,
641
- ask_question: askQuestionToolDefinition
880
+ deliver_artifact: deliverArtifactToolDefinition
642
881
  });
643
882
  //# sourceMappingURL=builtin-tools.js.map