@assemblyline-agents/runtime 0.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 (331) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +19 -0
  3. package/dist/agent-harness.d.ts +108 -0
  4. package/dist/agent-harness.d.ts.map +1 -0
  5. package/dist/agent-harness.js +2 -0
  6. package/dist/agent-harness.js.map +1 -0
  7. package/dist/attachments-legacy.d.ts +17 -0
  8. package/dist/attachments-legacy.d.ts.map +1 -0
  9. package/dist/attachments-legacy.js +273 -0
  10. package/dist/attachments-legacy.js.map +1 -0
  11. package/dist/attachments.d.ts +49 -0
  12. package/dist/attachments.d.ts.map +1 -0
  13. package/dist/attachments.js +832 -0
  14. package/dist/attachments.js.map +1 -0
  15. package/dist/builtin-tool-executors.d.ts +96 -0
  16. package/dist/builtin-tool-executors.d.ts.map +1 -0
  17. package/dist/builtin-tool-executors.js +501 -0
  18. package/dist/builtin-tool-executors.js.map +1 -0
  19. package/dist/builtin-tools.d.ts +30 -0
  20. package/dist/builtin-tools.d.ts.map +1 -0
  21. package/dist/builtin-tools.js +690 -0
  22. package/dist/builtin-tools.js.map +1 -0
  23. package/dist/capability-catalog.d.ts +27 -0
  24. package/dist/capability-catalog.d.ts.map +1 -0
  25. package/dist/capability-catalog.js +193 -0
  26. package/dist/capability-catalog.js.map +1 -0
  27. package/dist/channel-http-util.d.ts +34 -0
  28. package/dist/channel-http-util.d.ts.map +1 -0
  29. package/dist/channel-http-util.js +93 -0
  30. package/dist/channel-http-util.js.map +1 -0
  31. package/dist/channel-ingress.d.ts +56 -0
  32. package/dist/channel-ingress.d.ts.map +1 -0
  33. package/dist/channel-ingress.js +273 -0
  34. package/dist/channel-ingress.js.map +1 -0
  35. package/dist/channel.d.ts +146 -0
  36. package/dist/channel.d.ts.map +1 -0
  37. package/dist/channel.js +2 -0
  38. package/dist/channel.js.map +1 -0
  39. package/dist/checkpoints.d.ts +34 -0
  40. package/dist/checkpoints.d.ts.map +1 -0
  41. package/dist/checkpoints.js +86 -0
  42. package/dist/checkpoints.js.map +1 -0
  43. package/dist/code-mode.d.ts +20 -0
  44. package/dist/code-mode.d.ts.map +1 -0
  45. package/dist/code-mode.js +658 -0
  46. package/dist/code-mode.js.map +1 -0
  47. package/dist/computer-relay-protocol.d.ts +36 -0
  48. package/dist/computer-relay-protocol.d.ts.map +1 -0
  49. package/dist/computer-relay-protocol.js +127 -0
  50. package/dist/computer-relay-protocol.js.map +1 -0
  51. package/dist/concurrency.d.ts +68 -0
  52. package/dist/concurrency.d.ts.map +1 -0
  53. package/dist/concurrency.js +193 -0
  54. package/dist/concurrency.js.map +1 -0
  55. package/dist/connection-auth-util.d.ts +56 -0
  56. package/dist/connection-auth-util.d.ts.map +1 -0
  57. package/dist/connection-auth-util.js +154 -0
  58. package/dist/connection-auth-util.js.map +1 -0
  59. package/dist/connection-clients.d.ts +50 -0
  60. package/dist/connection-clients.d.ts.map +1 -0
  61. package/dist/connection-clients.js +402 -0
  62. package/dist/connection-clients.js.map +1 -0
  63. package/dist/connection-stores.d.ts +108 -0
  64. package/dist/connection-stores.d.ts.map +1 -0
  65. package/dist/connection-stores.js +127 -0
  66. package/dist/connection-stores.js.map +1 -0
  67. package/dist/connection-util.d.ts +27 -0
  68. package/dist/connection-util.d.ts.map +1 -0
  69. package/dist/connection-util.js +118 -0
  70. package/dist/connection-util.js.map +1 -0
  71. package/dist/connections.d.ts +152 -0
  72. package/dist/connections.d.ts.map +1 -0
  73. package/dist/connections.js +838 -0
  74. package/dist/connections.js.map +1 -0
  75. package/dist/content-capture.d.ts +32 -0
  76. package/dist/content-capture.d.ts.map +1 -0
  77. package/dist/content-capture.js +77 -0
  78. package/dist/content-capture.js.map +1 -0
  79. package/dist/context-policy-util.d.ts +45 -0
  80. package/dist/context-policy-util.d.ts.map +1 -0
  81. package/dist/context-policy-util.js +120 -0
  82. package/dist/context-policy-util.js.map +1 -0
  83. package/dist/conversation-context.d.ts +55 -0
  84. package/dist/conversation-context.d.ts.map +1 -0
  85. package/dist/conversation-context.js +179 -0
  86. package/dist/conversation-context.js.map +1 -0
  87. package/dist/conversation-transcript.d.ts +49 -0
  88. package/dist/conversation-transcript.d.ts.map +1 -0
  89. package/dist/conversation-transcript.js +77 -0
  90. package/dist/conversation-transcript.js.map +1 -0
  91. package/dist/conversation-turn-dispatch.d.ts +46 -0
  92. package/dist/conversation-turn-dispatch.d.ts.map +1 -0
  93. package/dist/conversation-turn-dispatch.js +201 -0
  94. package/dist/conversation-turn-dispatch.js.map +1 -0
  95. package/dist/delivery-queue.d.ts +89 -0
  96. package/dist/delivery-queue.d.ts.map +1 -0
  97. package/dist/delivery-queue.js +244 -0
  98. package/dist/delivery-queue.js.map +1 -0
  99. package/dist/delivery-send.d.ts +44 -0
  100. package/dist/delivery-send.d.ts.map +1 -0
  101. package/dist/delivery-send.js +494 -0
  102. package/dist/delivery-send.js.map +1 -0
  103. package/dist/env-config.d.ts +6 -0
  104. package/dist/env-config.d.ts.map +1 -0
  105. package/dist/env-config.js +27 -0
  106. package/dist/env-config.js.map +1 -0
  107. package/dist/eval-run-options.d.ts +37 -0
  108. package/dist/eval-run-options.d.ts.map +1 -0
  109. package/dist/eval-run-options.js +106 -0
  110. package/dist/eval-run-options.js.map +1 -0
  111. package/dist/harness-continuation.d.ts +54 -0
  112. package/dist/harness-continuation.d.ts.map +1 -0
  113. package/dist/harness-continuation.js +58 -0
  114. package/dist/harness-continuation.js.map +1 -0
  115. package/dist/harness-loop.d.ts +110 -0
  116. package/dist/harness-loop.d.ts.map +1 -0
  117. package/dist/harness-loop.js +575 -0
  118. package/dist/harness-loop.js.map +1 -0
  119. package/dist/hook-dispatch.d.ts +19 -0
  120. package/dist/hook-dispatch.d.ts.map +1 -0
  121. package/dist/hook-dispatch.js +37 -0
  122. package/dist/hook-dispatch.js.map +1 -0
  123. package/dist/http.d.ts +26 -0
  124. package/dist/http.d.ts.map +1 -0
  125. package/dist/http.js +114 -0
  126. package/dist/http.js.map +1 -0
  127. package/dist/in-memory-conversation-turn-store.d.ts +29 -0
  128. package/dist/in-memory-conversation-turn-store.d.ts.map +1 -0
  129. package/dist/in-memory-conversation-turn-store.js +166 -0
  130. package/dist/in-memory-conversation-turn-store.js.map +1 -0
  131. package/dist/in-memory-run-store.d.ts +39 -0
  132. package/dist/in-memory-run-store.d.ts.map +1 -0
  133. package/dist/in-memory-run-store.js +332 -0
  134. package/dist/in-memory-run-store.js.map +1 -0
  135. package/dist/in-memory-sandbox-session-store.d.ts +33 -0
  136. package/dist/in-memory-sandbox-session-store.d.ts.map +1 -0
  137. package/dist/in-memory-sandbox-session-store.js +186 -0
  138. package/dist/in-memory-sandbox-session-store.js.map +1 -0
  139. package/dist/in-memory-small-stores.d.ts +117 -0
  140. package/dist/in-memory-small-stores.d.ts.map +1 -0
  141. package/dist/in-memory-small-stores.js +340 -0
  142. package/dist/in-memory-small-stores.js.map +1 -0
  143. package/dist/in-memory-usage-store.d.ts +15 -0
  144. package/dist/in-memory-usage-store.d.ts.map +1 -0
  145. package/dist/in-memory-usage-store.js +49 -0
  146. package/dist/in-memory-usage-store.js.map +1 -0
  147. package/dist/index.d.ts +467 -0
  148. package/dist/index.d.ts.map +1 -0
  149. package/dist/index.js +2046 -0
  150. package/dist/index.js.map +1 -0
  151. package/dist/json-util.d.ts +19 -0
  152. package/dist/json-util.d.ts.map +1 -0
  153. package/dist/json-util.js +59 -0
  154. package/dist/json-util.js.map +1 -0
  155. package/dist/local-sandbox.d.ts +16 -0
  156. package/dist/local-sandbox.d.ts.map +1 -0
  157. package/dist/local-sandbox.js +327 -0
  158. package/dist/local-sandbox.js.map +1 -0
  159. package/dist/logging.d.ts +16 -0
  160. package/dist/logging.d.ts.map +1 -0
  161. package/dist/logging.js +41 -0
  162. package/dist/logging.js.map +1 -0
  163. package/dist/mcp-client.d.ts +27 -0
  164. package/dist/mcp-client.d.ts.map +1 -0
  165. package/dist/mcp-client.js +169 -0
  166. package/dist/mcp-client.js.map +1 -0
  167. package/dist/model-harnesses.d.ts +4 -0
  168. package/dist/model-harnesses.d.ts.map +1 -0
  169. package/dist/model-harnesses.js +6 -0
  170. package/dist/model-harnesses.js.map +1 -0
  171. package/dist/model-media.d.ts +36 -0
  172. package/dist/model-media.d.ts.map +1 -0
  173. package/dist/model-media.js +234 -0
  174. package/dist/model-media.js.map +1 -0
  175. package/dist/operator-controls.d.ts +31 -0
  176. package/dist/operator-controls.d.ts.map +1 -0
  177. package/dist/operator-controls.js +71 -0
  178. package/dist/operator-controls.js.map +1 -0
  179. package/dist/pi-agent-harness.d.ts +40 -0
  180. package/dist/pi-agent-harness.d.ts.map +1 -0
  181. package/dist/pi-agent-harness.js +222 -0
  182. package/dist/pi-agent-harness.js.map +1 -0
  183. package/dist/pi-harness.d.ts +42 -0
  184. package/dist/pi-harness.d.ts.map +1 -0
  185. package/dist/pi-harness.js +142 -0
  186. package/dist/pi-harness.js.map +1 -0
  187. package/dist/relay-mcp-client.d.ts +17 -0
  188. package/dist/relay-mcp-client.d.ts.map +1 -0
  189. package/dist/relay-mcp-client.js +119 -0
  190. package/dist/relay-mcp-client.js.map +1 -0
  191. package/dist/replay-resume.d.ts +107 -0
  192. package/dist/replay-resume.d.ts.map +1 -0
  193. package/dist/replay-resume.js +495 -0
  194. package/dist/replay-resume.js.map +1 -0
  195. package/dist/resource-projection-util.d.ts +58 -0
  196. package/dist/resource-projection-util.d.ts.map +1 -0
  197. package/dist/resource-projection-util.js +298 -0
  198. package/dist/resource-projection-util.js.map +1 -0
  199. package/dist/resource-projection.d.ts +45 -0
  200. package/dist/resource-projection.d.ts.map +1 -0
  201. package/dist/resource-projection.js +481 -0
  202. package/dist/resource-projection.js.map +1 -0
  203. package/dist/run-heartbeat.d.ts +34 -0
  204. package/dist/run-heartbeat.d.ts.map +1 -0
  205. package/dist/run-heartbeat.js +62 -0
  206. package/dist/run-heartbeat.js.map +1 -0
  207. package/dist/run-outcome.d.ts +47 -0
  208. package/dist/run-outcome.d.ts.map +1 -0
  209. package/dist/run-outcome.js +92 -0
  210. package/dist/run-outcome.js.map +1 -0
  211. package/dist/run-recovery.d.ts +117 -0
  212. package/dist/run-recovery.d.ts.map +1 -0
  213. package/dist/run-recovery.js +466 -0
  214. package/dist/run-recovery.js.map +1 -0
  215. package/dist/run-resolver.d.ts +35 -0
  216. package/dist/run-resolver.d.ts.map +1 -0
  217. package/dist/run-resolver.js +84 -0
  218. package/dist/run-resolver.js.map +1 -0
  219. package/dist/run-stream.d.ts +37 -0
  220. package/dist/run-stream.d.ts.map +1 -0
  221. package/dist/run-stream.js +78 -0
  222. package/dist/run-stream.js.map +1 -0
  223. package/dist/runs-query.d.ts +29 -0
  224. package/dist/runs-query.d.ts.map +1 -0
  225. package/dist/runs-query.js +142 -0
  226. package/dist/runs-query.js.map +1 -0
  227. package/dist/runtime-bundle.d.ts +3 -0
  228. package/dist/runtime-bundle.d.ts.map +1 -0
  229. package/dist/runtime-bundle.js +18 -0
  230. package/dist/runtime-bundle.js.map +1 -0
  231. package/dist/runtime-types.d.ts +397 -0
  232. package/dist/runtime-types.d.ts.map +1 -0
  233. package/dist/runtime-types.js +2 -0
  234. package/dist/runtime-types.js.map +1 -0
  235. package/dist/runtime-util.d.ts +45 -0
  236. package/dist/runtime-util.d.ts.map +1 -0
  237. package/dist/runtime-util.js +116 -0
  238. package/dist/runtime-util.js.map +1 -0
  239. package/dist/sandbox-cli-client.d.ts +20 -0
  240. package/dist/sandbox-cli-client.d.ts.map +1 -0
  241. package/dist/sandbox-cli-client.js +97 -0
  242. package/dist/sandbox-cli-client.js.map +1 -0
  243. package/dist/sandbox-fs.d.ts +56 -0
  244. package/dist/sandbox-fs.d.ts.map +1 -0
  245. package/dist/sandbox-fs.js +276 -0
  246. package/dist/sandbox-fs.js.map +1 -0
  247. package/dist/sandbox-session-key.d.ts +8 -0
  248. package/dist/sandbox-session-key.d.ts.map +1 -0
  249. package/dist/sandbox-session-key.js +32 -0
  250. package/dist/sandbox-session-key.js.map +1 -0
  251. package/dist/sandbox-snapshot-policy.d.ts +27 -0
  252. package/dist/sandbox-snapshot-policy.d.ts.map +1 -0
  253. package/dist/sandbox-snapshot-policy.js +94 -0
  254. package/dist/sandbox-snapshot-policy.js.map +1 -0
  255. package/dist/sandbox-sync-worker.d.ts +63 -0
  256. package/dist/sandbox-sync-worker.d.ts.map +1 -0
  257. package/dist/sandbox-sync-worker.js +448 -0
  258. package/dist/sandbox-sync-worker.js.map +1 -0
  259. package/dist/schedule-execution.d.ts +59 -0
  260. package/dist/schedule-execution.d.ts.map +1 -0
  261. package/dist/schedule-execution.js +951 -0
  262. package/dist/schedule-execution.js.map +1 -0
  263. package/dist/scheduler.d.ts +19 -0
  264. package/dist/scheduler.d.ts.map +1 -0
  265. package/dist/scheduler.js +38 -0
  266. package/dist/scheduler.js.map +1 -0
  267. package/dist/security.d.ts +20 -0
  268. package/dist/security.d.ts.map +1 -0
  269. package/dist/security.js +145 -0
  270. package/dist/security.js.map +1 -0
  271. package/dist/self-improvement.d.ts +245 -0
  272. package/dist/self-improvement.d.ts.map +1 -0
  273. package/dist/self-improvement.js +554 -0
  274. package/dist/self-improvement.js.map +1 -0
  275. package/dist/source-loader.d.ts +19 -0
  276. package/dist/source-loader.d.ts.map +1 -0
  277. package/dist/source-loader.js +160 -0
  278. package/dist/source-loader.js.map +1 -0
  279. package/dist/state-store-helpers.d.ts +28 -0
  280. package/dist/state-store-helpers.d.ts.map +1 -0
  281. package/dist/state-store-helpers.js +164 -0
  282. package/dist/state-store-helpers.js.map +1 -0
  283. package/dist/state-stores.d.ts +25 -0
  284. package/dist/state-stores.d.ts.map +1 -0
  285. package/dist/state-stores.js +157 -0
  286. package/dist/state-stores.js.map +1 -0
  287. package/dist/state.d.ts +736 -0
  288. package/dist/state.d.ts.map +1 -0
  289. package/dist/state.js +46 -0
  290. package/dist/state.js.map +1 -0
  291. package/dist/storage.d.ts +188 -0
  292. package/dist/storage.d.ts.map +1 -0
  293. package/dist/storage.js +752 -0
  294. package/dist/storage.js.map +1 -0
  295. package/dist/subagent-execution.d.ts +80 -0
  296. package/dist/subagent-execution.d.ts.map +1 -0
  297. package/dist/subagent-execution.js +135 -0
  298. package/dist/subagent-execution.js.map +1 -0
  299. package/dist/telemetry.d.ts +49 -0
  300. package/dist/telemetry.d.ts.map +1 -0
  301. package/dist/telemetry.js +60 -0
  302. package/dist/telemetry.js.map +1 -0
  303. package/dist/tool-apis.d.ts +22 -0
  304. package/dist/tool-apis.d.ts.map +1 -0
  305. package/dist/tool-apis.js +344 -0
  306. package/dist/tool-apis.js.map +1 -0
  307. package/dist/tool-execution.d.ts +143 -0
  308. package/dist/tool-execution.d.ts.map +1 -0
  309. package/dist/tool-execution.js +573 -0
  310. package/dist/tool-execution.js.map +1 -0
  311. package/dist/trusted-attachments.d.ts +20 -0
  312. package/dist/trusted-attachments.d.ts.map +1 -0
  313. package/dist/trusted-attachments.js +276 -0
  314. package/dist/trusted-attachments.js.map +1 -0
  315. package/dist/usage-accounting.d.ts +37 -0
  316. package/dist/usage-accounting.d.ts.map +1 -0
  317. package/dist/usage-accounting.js +181 -0
  318. package/dist/usage-accounting.js.map +1 -0
  319. package/dist/usage-budget.d.ts +29 -0
  320. package/dist/usage-budget.d.ts.map +1 -0
  321. package/dist/usage-budget.js +145 -0
  322. package/dist/usage-budget.js.map +1 -0
  323. package/dist/usage-reconciliation.d.ts +76 -0
  324. package/dist/usage-reconciliation.d.ts.map +1 -0
  325. package/dist/usage-reconciliation.js +463 -0
  326. package/dist/usage-reconciliation.js.map +1 -0
  327. package/dist/usage-records.d.ts +24 -0
  328. package/dist/usage-records.d.ts.map +1 -0
  329. package/dist/usage-records.js +445 -0
  330. package/dist/usage-records.js.map +1 -0
  331. package/package.json +51 -0
@@ -0,0 +1,690 @@
1
+ import { approvalNever, normalizeSandboxPath as normalizeCoreSandboxPath } from "@assemblyline-agents/core";
2
+ export const READ_TOOL_NAME = "read";
3
+ export const WRITE_TOOL_NAME = "write";
4
+ export const EDIT_TOOL_NAME = "edit";
5
+ export const DELETE_TOOL_NAME = "delete";
6
+ export const LIST_TOOL_NAME = "list";
7
+ export const GREP_TOOL_NAME = "grep";
8
+ export const BASH_TOOL_NAME = "bash";
9
+ export const ASK_QUESTION_TOOL_NAME = "ask_question";
10
+ export const SPAWN_SUBAGENT_TOOL_NAME = "spawn_subagent";
11
+ export const LOAD_SKILL_TOOL_NAME = "load_skill";
12
+ export const TOOL_SEARCH_TOOL_NAME = "tool_search";
13
+ export const TOOL_DESCRIBE_TOOL_NAME = "tool_describe";
14
+ export const TOOL_CALL_TOOL_NAME = "tool_call";
15
+ export const CORE_HARNESS_TOOL_NAMES = [
16
+ READ_TOOL_NAME,
17
+ WRITE_TOOL_NAME,
18
+ EDIT_TOOL_NAME,
19
+ DELETE_TOOL_NAME,
20
+ LIST_TOOL_NAME,
21
+ GREP_TOOL_NAME,
22
+ BASH_TOOL_NAME,
23
+ ASK_QUESTION_TOOL_NAME,
24
+ SPAWN_SUBAGENT_TOOL_NAME,
25
+ LOAD_SKILL_TOOL_NAME,
26
+ TOOL_SEARCH_TOOL_NAME,
27
+ TOOL_DESCRIBE_TOOL_NAME,
28
+ TOOL_CALL_TOOL_NAME
29
+ ];
30
+ const CORE_HARNESS_TOOL_NAME_SET = new Set(CORE_HARNESS_TOOL_NAMES);
31
+ const BUILTIN_SOURCE = {
32
+ path: "__builtin__/harness",
33
+ sha256: "builtin-harness"
34
+ };
35
+ const PATH_SCHEMA = {
36
+ type: "string",
37
+ description: "Absolute sandbox path, such as /memory/notes.md, /skills/name/SKILL.md, /workspace/report.txt, or /workspace/app.ts."
38
+ };
39
+ const READ_COMPILED_TOOL = {
40
+ name: READ_TOOL_NAME,
41
+ description: "Read a file from the sandbox filesystem. Lazily hydrates logical OpenEve paths before reading.",
42
+ inputSchema: {
43
+ type: "object",
44
+ additionalProperties: false,
45
+ properties: {
46
+ path: PATH_SCHEMA,
47
+ maxBytes: { type: "number", description: "Maximum bytes to return. Defaults to 65536." }
48
+ },
49
+ required: ["path"]
50
+ },
51
+ needsApproval: approvalNever(),
52
+ defaultEnabled: true,
53
+ visibility: "always",
54
+ execution: "sandbox",
55
+ tags: ["filesystem", "sandbox", "read"],
56
+ aliases: ["read_file", "cat"],
57
+ hasToModelOutput: true,
58
+ source: BUILTIN_SOURCE
59
+ };
60
+ const WRITE_COMPILED_TOOL = {
61
+ name: WRITE_TOOL_NAME,
62
+ description: "Write a file in the sandbox filesystem. Mutations are durably queued for async sync before the write.",
63
+ inputSchema: {
64
+ type: "object",
65
+ additionalProperties: false,
66
+ properties: {
67
+ path: PATH_SCHEMA,
68
+ content: { type: "string", description: "File contents to write." },
69
+ contents: { type: "string", description: "Alias for content." },
70
+ encoding: { type: "string", enum: ["utf8", "base64"], description: "Input encoding. Defaults to utf8." }
71
+ },
72
+ required: ["path"]
73
+ },
74
+ needsApproval: approvalNever(),
75
+ defaultEnabled: true,
76
+ visibility: "always",
77
+ execution: "sandbox",
78
+ tags: ["filesystem", "sandbox", "write"],
79
+ aliases: ["write_file"],
80
+ hasToModelOutput: true,
81
+ source: BUILTIN_SOURCE
82
+ };
83
+ const EDIT_COMPILED_TOOL = {
84
+ name: EDIT_TOOL_NAME,
85
+ description: "Edit a sandbox file by replacing exact text. Hydrates the path first when it is a logical OpenEve resource.",
86
+ inputSchema: {
87
+ type: "object",
88
+ additionalProperties: false,
89
+ properties: {
90
+ path: PATH_SCHEMA,
91
+ search: { type: "string", description: "Exact text to replace." },
92
+ replace: { type: "string", description: "Replacement text." },
93
+ expectedOccurrences: { type: "number", description: "Optional exact occurrence count guard." },
94
+ all: { type: "boolean", description: "Replace all occurrences. Defaults to true." }
95
+ },
96
+ required: ["path", "search", "replace"]
97
+ },
98
+ needsApproval: approvalNever(),
99
+ defaultEnabled: true,
100
+ visibility: "always",
101
+ execution: "sandbox",
102
+ tags: ["filesystem", "sandbox", "edit"],
103
+ aliases: ["patch", "replace"],
104
+ hasToModelOutput: true,
105
+ source: BUILTIN_SOURCE
106
+ };
107
+ const DELETE_COMPILED_TOOL = {
108
+ name: DELETE_TOOL_NAME,
109
+ description: "Delete a writable sandbox file or directory and record a tombstone for durable async sync.",
110
+ inputSchema: {
111
+ type: "object",
112
+ additionalProperties: false,
113
+ properties: {
114
+ path: PATH_SCHEMA,
115
+ recursive: { type: "boolean", description: "Allow deleting directories recursively. Defaults to true." }
116
+ },
117
+ required: ["path"]
118
+ },
119
+ needsApproval: approvalNever(),
120
+ defaultEnabled: true,
121
+ visibility: "always",
122
+ execution: "sandbox",
123
+ tags: ["filesystem", "sandbox", "delete"],
124
+ aliases: ["rm", "remove"],
125
+ hasToModelOutput: true,
126
+ source: BUILTIN_SOURCE
127
+ };
128
+ const LIST_COMPILED_TOOL = {
129
+ name: LIST_TOOL_NAME,
130
+ description: "List files under a sandbox path. Lazily hydrates bounded logical OpenEve roots before listing.",
131
+ inputSchema: {
132
+ type: "object",
133
+ additionalProperties: false,
134
+ properties: {
135
+ path: PATH_SCHEMA,
136
+ limit: { type: "number", description: "Maximum entries. Defaults to 200." }
137
+ },
138
+ required: ["path"]
139
+ },
140
+ needsApproval: approvalNever(),
141
+ defaultEnabled: true,
142
+ visibility: "always",
143
+ execution: "sandbox",
144
+ tags: ["filesystem", "sandbox", "list"],
145
+ aliases: ["ls"],
146
+ hasToModelOutput: true,
147
+ source: BUILTIN_SOURCE
148
+ };
149
+ const GREP_COMPILED_TOOL = {
150
+ name: GREP_TOOL_NAME,
151
+ description: "Search files under a sandbox path with a regular expression or literal pattern.",
152
+ inputSchema: {
153
+ type: "object",
154
+ additionalProperties: false,
155
+ properties: {
156
+ pattern: { type: "string" },
157
+ path: PATH_SCHEMA,
158
+ literal: { type: "boolean", description: "Treat pattern as literal text. Defaults to false." },
159
+ limit: { type: "number", description: "Maximum matches. Defaults to 100." }
160
+ },
161
+ required: ["pattern"]
162
+ },
163
+ needsApproval: approvalNever(),
164
+ defaultEnabled: true,
165
+ visibility: "always",
166
+ execution: "sandbox",
167
+ tags: ["filesystem", "sandbox", "search"],
168
+ aliases: ["search", "rg"],
169
+ hasToModelOutput: true,
170
+ source: BUILTIN_SOURCE
171
+ };
172
+ const BASH_COMPILED_TOOL = {
173
+ name: BASH_TOOL_NAME,
174
+ description: "Run a Bash command in the sandbox. Bash defaults to the workspace cwd; use relative paths in commands for local sandbox portability.",
175
+ inputSchema: {
176
+ type: "object",
177
+ additionalProperties: false,
178
+ properties: {
179
+ command: { type: "string" },
180
+ cwd: { type: "string" },
181
+ timeoutMs: { type: "number" }
182
+ },
183
+ required: ["command"]
184
+ },
185
+ needsApproval: approvalNever(),
186
+ defaultEnabled: true,
187
+ visibility: "always",
188
+ execution: "sandbox",
189
+ tags: ["sandbox", "bash", "shell"],
190
+ aliases: ["shell", "terminal"],
191
+ hasToModelOutput: true,
192
+ source: BUILTIN_SOURCE
193
+ };
194
+ const ASK_QUESTION_COMPILED_TOOL = {
195
+ name: ASK_QUESTION_TOOL_NAME,
196
+ description: "Ask the user a concise clarifying question and pause the run until the answer is available.",
197
+ inputSchema: {
198
+ type: "object",
199
+ additionalProperties: false,
200
+ properties: {
201
+ question: { type: "string" },
202
+ choices: { type: "array", items: { type: "string" } },
203
+ allowFreeform: { type: "boolean" },
204
+ metadata: { type: "object", additionalProperties: true }
205
+ },
206
+ required: ["question"]
207
+ },
208
+ needsApproval: approvalNever(),
209
+ defaultEnabled: true,
210
+ visibility: "always",
211
+ execution: "direct",
212
+ tags: ["human", "question"],
213
+ aliases: ["clarify"],
214
+ hasToModelOutput: true,
215
+ source: BUILTIN_SOURCE
216
+ };
217
+ const SPAWN_SUBAGENT_COMPILED_TOOL = {
218
+ name: SPAWN_SUBAGENT_TOOL_NAME,
219
+ description: "Spawn a configured subagent by name for delegated work.",
220
+ inputSchema: {
221
+ type: "object",
222
+ additionalProperties: true,
223
+ properties: {
224
+ name: { type: "string", description: "Subagent name." },
225
+ task: { type: "string" },
226
+ expectedOutput: { type: "string" },
227
+ constraints: { type: "array", items: { type: "string" } }
228
+ },
229
+ required: ["name", "task"]
230
+ },
231
+ needsApproval: approvalNever(),
232
+ defaultEnabled: true,
233
+ visibility: "always",
234
+ execution: "direct",
235
+ tags: ["subagent", "delegate"],
236
+ aliases: ["delegate", "agent"],
237
+ hasToModelOutput: true,
238
+ source: BUILTIN_SOURCE
239
+ };
240
+ const LOAD_SKILL_COMPILED_TOOL = {
241
+ name: LOAD_SKILL_TOOL_NAME,
242
+ description: "Load a skill's full instructions by name from the durable skill store. Loading a skill does not reveal additional tools.",
243
+ inputSchema: {
244
+ type: "object",
245
+ additionalProperties: false,
246
+ properties: {
247
+ name: { type: "string", description: "Skill name, such as skill-creator." },
248
+ skillName: { type: "string", description: "Alias for name." }
249
+ }
250
+ },
251
+ needsApproval: approvalNever(),
252
+ defaultEnabled: true,
253
+ visibility: "always",
254
+ execution: "direct",
255
+ tags: ["skills", "instructions", "progressive-disclosure"],
256
+ aliases: ["skill_view", "load_instructions"],
257
+ hasToModelOutput: true,
258
+ source: BUILTIN_SOURCE
259
+ };
260
+ const TOOL_SEARCH_COMPILED_TOOL = {
261
+ name: TOOL_SEARCH_TOOL_NAME,
262
+ description: "Search deferred non-core tools by name, description, tags, aliases, or connection. Returns compact metadata only.",
263
+ inputSchema: {
264
+ type: "object",
265
+ additionalProperties: false,
266
+ properties: {
267
+ query: { type: "string" },
268
+ limit: { type: "number" },
269
+ kind: { type: "string" },
270
+ connection: { type: "string" }
271
+ },
272
+ required: ["query"]
273
+ },
274
+ needsApproval: approvalNever(),
275
+ defaultEnabled: true,
276
+ visibility: "always",
277
+ execution: "direct",
278
+ tags: ["tools", "deferred", "search"],
279
+ aliases: ["tools"],
280
+ hasToModelOutput: true,
281
+ source: BUILTIN_SOURCE
282
+ };
283
+ const TOOL_DESCRIBE_COMPILED_TOOL = {
284
+ name: TOOL_DESCRIBE_TOOL_NAME,
285
+ description: "Return the full schema for one deferred tool previously found with tool_search.",
286
+ inputSchema: {
287
+ type: "object",
288
+ additionalProperties: false,
289
+ properties: {
290
+ name: { type: "string" }
291
+ },
292
+ required: ["name"]
293
+ },
294
+ needsApproval: approvalNever(),
295
+ defaultEnabled: true,
296
+ visibility: "always",
297
+ execution: "direct",
298
+ tags: ["tools", "deferred", "describe"],
299
+ aliases: ["schema"],
300
+ hasToModelOutput: true,
301
+ source: BUILTIN_SOURCE
302
+ };
303
+ const TOOL_CALL_COMPILED_TOOL = {
304
+ name: TOOL_CALL_TOOL_NAME,
305
+ description: "Call a deferred non-core tool by name with JSON arguments. The underlying tool is logged and policy-checked directly.",
306
+ inputSchema: {
307
+ type: "object",
308
+ additionalProperties: false,
309
+ properties: {
310
+ name: { type: "string" },
311
+ arguments: { type: "object", additionalProperties: true },
312
+ input: { type: "object", additionalProperties: true }
313
+ },
314
+ required: ["name"]
315
+ },
316
+ needsApproval: approvalNever(),
317
+ defaultEnabled: true,
318
+ visibility: "always",
319
+ execution: "direct",
320
+ tags: ["tools", "deferred", "call"],
321
+ aliases: ["invoke"],
322
+ hasToModelOutput: true,
323
+ source: BUILTIN_SOURCE
324
+ };
325
+ const BUILT_IN_COMPILED_TOOLS = [
326
+ READ_COMPILED_TOOL,
327
+ WRITE_COMPILED_TOOL,
328
+ EDIT_COMPILED_TOOL,
329
+ DELETE_COMPILED_TOOL,
330
+ LIST_COMPILED_TOOL,
331
+ GREP_COMPILED_TOOL,
332
+ BASH_COMPILED_TOOL,
333
+ ASK_QUESTION_COMPILED_TOOL,
334
+ SPAWN_SUBAGENT_COMPILED_TOOL,
335
+ LOAD_SKILL_COMPILED_TOOL,
336
+ TOOL_SEARCH_COMPILED_TOOL,
337
+ TOOL_DESCRIBE_COMPILED_TOOL,
338
+ TOOL_CALL_COMPILED_TOOL
339
+ ];
340
+ export function runtimeToolsForManifest(manifest) {
341
+ const builtInNamed = new Map(manifest.tools.filter((tool) => CORE_HARNESS_TOOL_NAME_SET.has(tool.name)).map((tool) => [tool.name, tool]));
342
+ return [
343
+ ...manifest.tools.filter((tool) => !CORE_HARNESS_TOOL_NAME_SET.has(tool.name) && !tool.disabled),
344
+ ...BUILT_IN_COMPILED_TOOLS.flatMap((builtin) => {
345
+ const authored = builtInNamed.get(builtin.name);
346
+ if (!authored)
347
+ return [builtin];
348
+ if (authored.disabled)
349
+ return [];
350
+ // An authored override keeps the built-in slot's availability so the model
351
+ // never silently loses a core tool to visibility inference.
352
+ return [{ ...authored, defaultEnabled: builtin.defaultEnabled, visibility: builtin.visibility }];
353
+ })
354
+ ];
355
+ }
356
+ export function builtInToolDefinition(name) {
357
+ if (name === READ_TOOL_NAME)
358
+ return readToolDefinition;
359
+ if (name === WRITE_TOOL_NAME)
360
+ return writeToolDefinition;
361
+ if (name === EDIT_TOOL_NAME)
362
+ return editToolDefinition;
363
+ if (name === DELETE_TOOL_NAME)
364
+ return deleteToolDefinition;
365
+ if (name === LIST_TOOL_NAME)
366
+ return listToolDefinition;
367
+ if (name === GREP_TOOL_NAME)
368
+ return grepToolDefinition;
369
+ if (name === BASH_TOOL_NAME)
370
+ return bashToolDefinition;
371
+ if (name === ASK_QUESTION_TOOL_NAME)
372
+ return askQuestionToolDefinition;
373
+ if (name === SPAWN_SUBAGENT_TOOL_NAME)
374
+ return spawnSubagentToolDefinition;
375
+ if (name === LOAD_SKILL_TOOL_NAME)
376
+ return runtimeHandledToolDefinition(LOAD_SKILL_COMPILED_TOOL);
377
+ if (name === TOOL_SEARCH_TOOL_NAME)
378
+ return runtimeHandledToolDefinition(TOOL_SEARCH_COMPILED_TOOL);
379
+ if (name === TOOL_DESCRIBE_TOOL_NAME)
380
+ return runtimeHandledToolDefinition(TOOL_DESCRIBE_COMPILED_TOOL);
381
+ if (name === TOOL_CALL_TOOL_NAME)
382
+ return runtimeHandledToolDefinition(TOOL_CALL_COMPILED_TOOL);
383
+ return undefined;
384
+ }
385
+ export function isBuiltInToolName(name) {
386
+ return CORE_HARNESS_TOOL_NAME_SET.has(name);
387
+ }
388
+ const readToolDefinition = {
389
+ ...toolDefinitionBase(READ_COMPILED_TOOL),
390
+ async execute(input, ctx) {
391
+ const raw = recordInput(input);
392
+ const path = requiredPath(raw.path);
393
+ const maxBytes = boundedNumber(raw.maxBytes, 65_536, 1, 10 * 1024 * 1024);
394
+ await ctx.hydrateSandboxPath?.(path);
395
+ const sandbox = await ctx.getSandbox();
396
+ const contents = await sandbox.readFile(path);
397
+ const bytes = Buffer.from(contents);
398
+ const truncated = bytes.byteLength > maxBytes;
399
+ return {
400
+ path,
401
+ content: bytes.subarray(0, maxBytes).toString("utf8"),
402
+ bytes: bytes.byteLength,
403
+ truncated
404
+ };
405
+ }
406
+ };
407
+ const writeToolDefinition = {
408
+ ...toolDefinitionBase(WRITE_COMPILED_TOOL),
409
+ async execute(input, ctx) {
410
+ const raw = recordInput(input);
411
+ const path = requiredWritablePath(raw.path);
412
+ const content = typeof raw.content === "string" ? raw.content : typeof raw.contents === "string" ? raw.contents : "";
413
+ const encoding = raw.encoding === "base64" ? "base64" : "utf8";
414
+ const bytes = encoding === "base64" ? Buffer.from(content, "base64") : content;
415
+ const sandbox = await ctx.getSandbox();
416
+ await sandbox.writeFile(path, bytes);
417
+ return {
418
+ path,
419
+ bytes: typeof bytes === "string" ? Buffer.byteLength(bytes) : bytes.byteLength,
420
+ encoding
421
+ };
422
+ }
423
+ };
424
+ const editToolDefinition = {
425
+ ...toolDefinitionBase(EDIT_COMPILED_TOOL),
426
+ async execute(input, ctx) {
427
+ const raw = recordInput(input);
428
+ const path = requiredWritablePath(raw.path);
429
+ const search = typeof raw.search === "string" ? raw.search : "";
430
+ const replace = typeof raw.replace === "string" ? raw.replace : "";
431
+ if (!search)
432
+ throw new Error("edit requires a non-empty search string.");
433
+ await ctx.hydrateSandboxPath?.(path);
434
+ const sandbox = await ctx.getSandbox();
435
+ const original = await sandbox.readFile(path);
436
+ const occurrences = countOccurrences(original, search);
437
+ if (typeof raw.expectedOccurrences === "number" && occurrences !== raw.expectedOccurrences) {
438
+ throw new Error(`edit expected ${raw.expectedOccurrences} occurrences but found ${occurrences}.`);
439
+ }
440
+ if (occurrences === 0)
441
+ throw new Error(`edit found no occurrences in ${path}.`);
442
+ const all = raw.all !== false;
443
+ const updated = all ? original.split(search).join(replace) : original.replace(search, replace);
444
+ await sandbox.writeFile(path, updated);
445
+ return {
446
+ path,
447
+ occurrences,
448
+ replaced: all ? occurrences : 1,
449
+ bytes: Buffer.byteLength(updated)
450
+ };
451
+ }
452
+ };
453
+ const deleteToolDefinition = {
454
+ ...toolDefinitionBase(DELETE_COMPILED_TOOL),
455
+ async execute(input, ctx) {
456
+ const raw = recordInput(input);
457
+ const path = requiredWritablePath(raw.path);
458
+ const sandbox = await ctx.getSandbox();
459
+ await ctx.recordSandboxTombstone?.(path);
460
+ const recursive = raw.recursive !== false;
461
+ if (sandbox.deletePath) {
462
+ await sandbox.deletePath(path, { recursive });
463
+ }
464
+ else {
465
+ const flag = recursive ? "-r" : "";
466
+ const result = await sandbox.shell(`rm ${flag} -f -- ${shellQuote(path)}`.replace(/\s+/g, " ").trim());
467
+ if (result.exitCode !== 0)
468
+ throw new Error(result.stderr || `delete failed for ${path}`);
469
+ }
470
+ return { path, deleted: true };
471
+ }
472
+ };
473
+ const listToolDefinition = {
474
+ ...toolDefinitionBase(LIST_COMPILED_TOOL),
475
+ async execute(input, ctx) {
476
+ const raw = recordInput(input);
477
+ const path = requiredPath(raw.path);
478
+ const limit = boundedNumber(raw.limit, 200, 1, 2000);
479
+ await ctx.hydrateSandboxPath?.(path, { list: true, limit });
480
+ const sandbox = await ctx.getSandbox();
481
+ const entries = await listSandboxEntries(sandbox, path, limit);
482
+ return { path, entries, count: entries.length, truncated: entries.length >= limit };
483
+ }
484
+ };
485
+ const grepToolDefinition = {
486
+ ...toolDefinitionBase(GREP_COMPILED_TOOL),
487
+ async execute(input, ctx) {
488
+ const raw = recordInput(input);
489
+ const pattern = typeof raw.pattern === "string" ? raw.pattern : "";
490
+ if (!pattern)
491
+ throw new Error("grep requires a non-empty pattern.");
492
+ const path = typeof raw.path === "string" ? normalizeSandboxPath(raw.path) : "/workspace";
493
+ const limit = boundedNumber(raw.limit, 100, 1, 2000);
494
+ await ctx.hydrateSandboxPath?.(path, { list: true, limit });
495
+ const sandbox = await ctx.getSandbox();
496
+ const matches = await grepSandbox(sandbox, path, pattern, raw.literal === true, limit);
497
+ return { pattern, path, matches, count: matches.length, truncated: matches.length >= limit };
498
+ }
499
+ };
500
+ const bashToolDefinition = {
501
+ ...toolDefinitionBase(BASH_COMPILED_TOOL),
502
+ async execute(input, ctx) {
503
+ const raw = recordInput(input);
504
+ const command = typeof raw.command === "string" ? raw.command : "";
505
+ if (!command.trim())
506
+ throw new Error("bash requires a non-empty command.");
507
+ const sandbox = await ctx.getSandbox();
508
+ const options = {};
509
+ if (typeof raw.cwd === "string")
510
+ options.cwd = raw.cwd;
511
+ if (typeof raw.timeoutMs === "number" && Number.isFinite(raw.timeoutMs))
512
+ options.timeoutMs = raw.timeoutMs;
513
+ return sandbox.shell(command, options);
514
+ }
515
+ };
516
+ const askQuestionToolDefinition = {
517
+ ...toolDefinitionBase(ASK_QUESTION_COMPILED_TOOL),
518
+ async execute(input, ctx) {
519
+ const raw = recordInput(input);
520
+ const question = typeof raw.question === "string" ? raw.question.trim() : "";
521
+ if (!question)
522
+ throw new Error("ask_question requires a non-empty question.");
523
+ const options = {};
524
+ if (Array.isArray(raw.choices))
525
+ options.choices = raw.choices.map(String).filter(Boolean);
526
+ if (typeof raw.allowFreeform === "boolean")
527
+ options.allowFreeform = raw.allowFreeform;
528
+ if (raw.metadata && typeof raw.metadata === "object" && !Array.isArray(raw.metadata)) {
529
+ options.metadata = raw.metadata;
530
+ }
531
+ return ctx.askQuestion(question, options);
532
+ }
533
+ };
534
+ const spawnSubagentToolDefinition = {
535
+ ...toolDefinitionBase(SPAWN_SUBAGENT_COMPILED_TOOL),
536
+ async execute(input, ctx) {
537
+ if (!ctx.spawnSubagent)
538
+ throw new Error("Subagent spawning is not available in this runtime.");
539
+ const raw = recordInput(input);
540
+ const name = typeof raw.name === "string" ? raw.name.trim() : "";
541
+ const task = typeof raw.task === "string" ? raw.task.trim() : "";
542
+ if (!name || !task)
543
+ throw new Error("spawn_subagent requires name and task.");
544
+ return ctx.spawnSubagent({
545
+ name,
546
+ task,
547
+ ...(typeof raw.expectedOutput === "string" ? { expectedOutput: raw.expectedOutput } : {}),
548
+ ...(Array.isArray(raw.constraints) ? { constraints: raw.constraints.map(String) } : {})
549
+ });
550
+ }
551
+ };
552
+ function toolDefinitionBase(tool) {
553
+ const definition = {
554
+ description: tool.description,
555
+ inputSchema: tool.inputSchema,
556
+ needsApproval: false,
557
+ defaultEnabled: tool.defaultEnabled,
558
+ capability: {
559
+ visibility: tool.visibility,
560
+ execution: tool.execution,
561
+ tags: tool.tags,
562
+ aliases: tool.aliases
563
+ },
564
+ toModelOutput(output) {
565
+ return output;
566
+ }
567
+ };
568
+ if (tool.outputSchema)
569
+ definition.outputSchema = tool.outputSchema;
570
+ return definition;
571
+ }
572
+ function runtimeHandledToolDefinition(tool) {
573
+ return {
574
+ ...toolDefinitionBase(tool),
575
+ async execute() {
576
+ throw new Error(`${tool.name} is handled by the OpenEve runtime dispatcher.`);
577
+ }
578
+ };
579
+ }
580
+ function recordInput(input) {
581
+ if (input && typeof input === "object" && !Array.isArray(input))
582
+ return input;
583
+ return {};
584
+ }
585
+ function requiredPath(value) {
586
+ if (typeof value !== "string" || value.trim().length === 0)
587
+ throw new Error("path is required.");
588
+ return normalizeCoreSandboxPath(value);
589
+ }
590
+ function requiredWritablePath(value) {
591
+ const path = requiredPath(value);
592
+ if (path === "/history" || path.startsWith("/history/") || path === "/files" || path.startsWith("/files/")) {
593
+ throw new Error(`${path} is read-only.`);
594
+ }
595
+ return path;
596
+ }
597
+ function normalizeSandboxPath(path) {
598
+ return normalizeCoreSandboxPath(path);
599
+ }
600
+ function boundedNumber(value, fallback, min, max) {
601
+ if (typeof value !== "number" || !Number.isFinite(value))
602
+ return fallback;
603
+ return Math.max(min, Math.min(max, Math.floor(value)));
604
+ }
605
+ async function listSandboxEntries(sandbox, path, limit) {
606
+ if (!sandbox.listFiles)
607
+ throw new Error("This sandbox adapter does not support file listing.");
608
+ const entries = await sandbox.listFiles(path);
609
+ return entries.slice(0, limit).map((entry) => {
610
+ const out = { path: entry.path };
611
+ if (entry.size !== undefined)
612
+ out.size = entry.size;
613
+ return out;
614
+ });
615
+ }
616
+ async function grepSandbox(sandbox, path, pattern, literal, limit) {
617
+ if (!sandbox.listFiles)
618
+ throw new Error("This sandbox adapter does not support grep without file listing.");
619
+ const entries = await sandbox.listFiles(path);
620
+ const matches = [];
621
+ const regexp = literal ? undefined : new RegExp(pattern, "u");
622
+ for (const entry of entries) {
623
+ if (matches.length >= limit)
624
+ break;
625
+ const contents = entryContents(entry);
626
+ if (contents === undefined)
627
+ continue;
628
+ const lines = contents.split(/\r?\n/u);
629
+ for (let index = 0; index < lines.length; index += 1) {
630
+ const text = lines[index] ?? "";
631
+ const matched = literal ? text.includes(pattern) : regexp?.test(text);
632
+ if (!matched)
633
+ continue;
634
+ matches.push({ path: entry.path, line: index + 1, text });
635
+ if (matches.length >= limit)
636
+ break;
637
+ }
638
+ }
639
+ return matches;
640
+ }
641
+ function entryContents(entry) {
642
+ if (typeof entry.contents === "string")
643
+ return entry.contents;
644
+ if (entry.contents instanceof Uint8Array)
645
+ return Buffer.from(entry.contents).toString("utf8");
646
+ return undefined;
647
+ }
648
+ function countOccurrences(value, search) {
649
+ if (!search)
650
+ return 0;
651
+ let count = 0;
652
+ let index = value.indexOf(search);
653
+ while (index >= 0) {
654
+ count += 1;
655
+ index = value.indexOf(search, index + search.length);
656
+ }
657
+ return count;
658
+ }
659
+ function shellQuote(value) {
660
+ return `'${value.replace(/'/gu, "'\\''")}'`;
661
+ }
662
+ export function builtInToolContext(tool) {
663
+ if (!isBuiltInToolName(tool.name))
664
+ return undefined;
665
+ return {
666
+ builtin: true,
667
+ source: tool.source.path
668
+ };
669
+ }
670
+ /**
671
+ * The built-in tool implementations, exported so an authored override at
672
+ * `tools/<name>.ts` can wrap the default instead of rewriting it:
673
+ *
674
+ * export default defineTool({ ...builtInToolDefaults.write, execute: guarded });
675
+ *
676
+ * The deferred bridge tools (load_skill, tool_search, tool_describe, tool_call)
677
+ * are runtime-handled and have no wrappable executor, so they are not listed.
678
+ */
679
+ export const builtInToolDefaults = Object.freeze({
680
+ read: readToolDefinition,
681
+ write: writeToolDefinition,
682
+ edit: editToolDefinition,
683
+ delete: deleteToolDefinition,
684
+ list: listToolDefinition,
685
+ grep: grepToolDefinition,
686
+ bash: bashToolDefinition,
687
+ ask_question: askQuestionToolDefinition,
688
+ spawn_subagent: spawnSubagentToolDefinition
689
+ });
690
+ //# sourceMappingURL=builtin-tools.js.map